NeoMutt  2025-12-11-694-ga89709
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
lib.h
Go to the documentation of this file.
1
22
45
46#ifndef MUTT_INDEX_LIB_H
47#define MUTT_INDEX_LIB_H
48
49#include <stdbool.h>
50#include <stdint.h>
51#include <stdio.h>
52#include "mutt/lib.h"
53#include "core/lib.h"
54#include "expando/lib.h" // IWYU pragma: keep
55#include "expando_index.h" // IWYU pragma: keep
56#include "functions.h" // IWYU pragma: keep
57#include "shared_data.h" // IWYU pragma: keep
58#include "status.h" // IWYU pragma: keep
59#include "subjectrx.h" // IWYU pragma: keep
60
61struct Email;
62struct MailboxView;
63struct Menu;
64struct MuttWindow;
65struct SubMenu;
66
67// Observers of #NT_INDEX will be passed an #IndexSharedData.
68typedef uint8_t NotifyIndex;
69#define NT_INDEX_NO_FLAGS 0
70#define NT_INDEX_ADD (1 << 0)
71#define NT_INDEX_DELETE (1 << 1)
72#define NT_INDEX_SUBSET (1 << 2)
73#define NT_INDEX_ACCOUNT (1 << 3)
74#define NT_INDEX_MVIEW (1 << 4)
75#define NT_INDEX_MAILBOX (1 << 5)
76#define NT_INDEX_EMAIL (1 << 6)
77
78typedef uint8_t CheckFlags;
79#define CHECK_NO_FLAGS 0
80#define CHECK_IN_MAILBOX (1 << 0)
81#define CHECK_MSGCOUNT (1 << 1)
82#define CHECK_VISIBLE (1 << 2)
83#define CHECK_READONLY (1 << 3)
84#define CHECK_ATTACH (1 << 4)
85
95
96extern const struct Mapping IndexNewsHelp[];
97
98extern const struct ExpandoDefinition StatusFormatDef[];
99
100void index_init_keys(struct SubMenu *sm_generic);
101
102void change_folder_mailbox (struct Menu *menu, struct Mailbox *m, int *oldcount, struct IndexSharedData *shared, bool read_only);
103struct Mailbox * change_folder_notmuch (struct Menu *menu, char *buf, int buflen, int *oldcount, struct IndexSharedData *shared, bool read_only);
104void change_folder_string (struct Menu *menu, struct Buffer *buf, int *oldcount, struct IndexSharedData *shared, bool read_only);
105bool check_acl (struct Mailbox *m, AclFlags acl, const char *msg);
106void collapse_all (struct MailboxView *mv, struct Menu *menu, enum CollapseMode mode);
107struct Mailbox * dlg_index (struct MuttWindow *dlg, struct Mailbox *m);
108int find_first_message (struct MailboxView *mv);
109int find_next_undeleted (struct MailboxView *mv, int msgno, bool uncollapse);
110int find_previous_undeleted (struct MailboxView *mv, int msgno, bool uncollapse);
111struct Mailbox * get_current_mailbox (void);
113void index_change_folder (struct MuttWindow *dlg, struct Mailbox *m);
114const struct AttrColor *index_color (struct Menu *menu, int line);
115int index_make_entry (struct Menu *menu, int line, int max_cols, struct Buffer *buf);
116struct MuttWindow * index_pager_init (void);
118void mutt_draw_statusline (struct MuttWindow *win, int max_cols, const char *buf, size_t buflen);
119void email_set_color (struct Mailbox *m, struct Email *e);
120void resort_index (struct MailboxView *mv, struct Menu *menu);
121void update_index (struct Menu *menu, struct MailboxView *mv, enum MxStatus check, int oldcount, const struct IndexSharedData *shared);
122
123int mutt_make_string(struct Buffer *buf, size_t max_cols, const struct Expando *exp,
124 struct Mailbox *m, int inpgr, struct Email *e,
125 MuttFormatFlags flags, const char *progress);
126
127#endif /* MUTT_INDEX_LIB_H */
Convenience wrapper for the core headers.
uint16_t AclFlags
ACL Rights - These show permission to...
Definition mailbox.h:58
const struct Mapping IndexNewsHelp[]
Help Bar for the News Index dialog.
Definition dlg_index.c:114
Parse Expando string.
String processing routines to generate the mail index.
struct Mailbox * dlg_index(struct MuttWindow *dlg, struct Mailbox *m)
Display a list of emails -.
Definition dlg_index.c:1118
const struct AttrColor * index_color(struct Menu *menu, int line)
Calculate the colour for a line of the index - Implements Menu::color() -.
Definition dlg_index.c:945
int index_make_entry(struct Menu *menu, int line, int max_cols, struct Buffer *buf)
Format an Email for the Menu - Implements Menu::make_entry() -.
Definition dlg_index.c:844
const struct ExpandoDefinition StatusFormatDef[]
Expando definitions.
Definition config.c:49
Index functions.
bool check_acl(struct Mailbox *m, AclFlags acl, const char *msg)
Check the ACLs for a function.
Definition dlg_index.c:135
uint8_t CheckFlags
Flags, e.g. CHECK_IN_MAILBOX.
Definition lib.h:78
void change_folder_mailbox(struct Menu *menu, struct Mailbox *m, int *oldcount, struct IndexSharedData *shared, bool read_only)
Change to a different Mailbox by pointer.
Definition dlg_index.c:629
struct Mailbox * change_folder_notmuch(struct Menu *menu, char *buf, int buflen, int *oldcount, struct IndexSharedData *shared, bool read_only)
Change to a different Notmuch Mailbox by string.
Definition dlg_index.c:750
void mutt_draw_statusline(struct MuttWindow *win, int max_cols, const char *buf, size_t buflen)
Draw a highlighted status bar.
Definition dlg_index.c:977
void email_set_color(struct Mailbox *m, struct Email *e)
Select an Index colour for an Email.
Definition dlg_index.c:1425
CollapseMode
Action to perform on a Thread.
Definition lib.h:90
@ COLLAPSE_MODE_TOGGLE
Toggle collapsed state.
Definition lib.h:91
@ COLLAPSE_MODE_CLOSE
Collapse all threads.
Definition lib.h:92
@ COLLAPSE_MODE_OPEN
Open all threads.
Definition lib.h:93
uint8_t NotifyIndex
Flags, e.g. NT_INDEX_ACCOUNT.
Definition lib.h:68
struct MailboxView * get_current_mailbox_view(void)
Get the current Mailbox view.
Definition index.c:689
void update_index(struct Menu *menu, struct MailboxView *mv, enum MxStatus check, int oldcount, const struct IndexSharedData *shared)
Update the index.
Definition dlg_index.c:560
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
Definition index.c:721
void index_change_folder(struct MuttWindow *dlg, struct Mailbox *m)
Change the current folder, cautiously.
Definition dlg_index.c:1484
int find_first_message(struct MailboxView *mv)
Get index of first new message.
Definition dlg_index.c:325
void resort_index(struct MailboxView *mv, struct Menu *menu)
Resort the index.
Definition dlg_index.c:385
int find_next_undeleted(struct MailboxView *mv, int msgno, bool uncollapse)
Find the next undeleted email.
Definition dlg_index.c:257
void index_init_keys(struct SubMenu *sm_generic)
Initialise the Index Keybindings - Implements ::init_keys_api.
Definition functions.c:326
int mutt_dlgindex_observer(struct NotifyCallback *nc)
void change_folder_string(struct Menu *menu, struct Buffer *buf, int *oldcount, struct IndexSharedData *shared, bool read_only)
Change to a different Mailbox by string.
Definition dlg_index.c:775
int mutt_make_string(struct Buffer *buf, size_t max_cols, const struct Expando *exp, struct Mailbox *m, int inpgr, struct Email *e, MuttFormatFlags flags, const char *progress)
Create formatted strings using mailbox expandos.
Definition dlg_index.c:821
int find_previous_undeleted(struct MailboxView *mv, int msgno, bool uncollapse)
Find the previous undeleted email.
Definition dlg_index.c:291
struct MuttWindow * index_pager_init(void)
Allocate the Windows for the Index/Pager.
Definition dlg_index.c:1456
void collapse_all(struct MailboxView *mv, struct Menu *menu, enum CollapseMode mode)
Collapse/uncollapse all threads.
Definition dlg_index.c:159
Data shared between Index, Pager and Sidebar.
Convenience wrapper for the library headers.
MxStatus
Return values from mbox_check(), mbox_check_stats(), mbox_sync(), and mbox_close()
Definition mxapi.h:59
uint8_t MuttFormatFlags
Flags for expando_render(), e.g. MUTT_FORMAT_FORCESUBJ.
Definition render.h:32
GUI display a user-configurable status line.
A curses colour and its attributes.
Definition attr.h:65
String manipulation buffer.
Definition buffer.h:36
The envelope/body of an email.
Definition email.h:39
Definition of a format string.
Definition definition.h:43
Parsed Expando trees.
Definition expando.h:41
Data shared between Index, Pager and Sidebar.
Definition shared_data.h:37
View of a Mailbox.
Definition mview.h:40
A mailbox.
Definition mailbox.h:78
Mapping between user-readable string and a constant.
Definition mapping.h:33
Definition lib.h:80
Data passed to a notification function.
Definition observer.h:34
Collection of related functions.
Definition menu.h:68
Parse Subject-regex Commands.