NeoMutt  2022-04-29-81-g9c5a59
Teaching an old dog new tricks
DOXYGEN
lib.h
Go to the documentation of this file.
1 
40 #ifndef MUTT_INDEX_LIB_H
41 #define MUTT_INDEX_LIB_H
42 
43 #include <stdbool.h>
44 #include <stdint.h>
45 #include <stdio.h>
46 #include "mutt/lib.h"
47 #include "core/lib.h"
48 #include "functions.h" // IWYU pragma: keep
49 #include "mx.h" // IWYU pragma: keep
50 #include "shared_data.h" // IWYU pragma: keep
51 
52 struct Email;
53 struct MailboxView;
54 struct Menu;
55 struct MuttWindow;
56 
57 // Observers of #NT_INDEX will be passed an #IndexSharedData.
58 typedef uint8_t NotifyIndex;
59 #define NT_INDEX_NO_FLAGS 0
60 #define NT_INDEX_ADD (1 << 0)
61 #define NT_INDEX_DELETE (1 << 1)
62 #define NT_INDEX_SUBSET (1 << 2)
63 #define NT_INDEX_ACCOUNT (1 << 3)
64 #define NT_INDEX_MVIEW (1 << 4)
65 #define NT_INDEX_MAILBOX (1 << 5)
66 #define NT_INDEX_EMAIL (1 << 6)
67 
68 typedef uint8_t CheckFlags;
69 #define CHECK_NO_FLAGS 0
70 #define CHECK_IN_MAILBOX (1 << 0)
71 #define CHECK_MSGCOUNT (1 << 1)
72 #define CHECK_VISIBLE (1 << 2)
73 #define CHECK_READONLY (1 << 3)
74 #define CHECK_ATTACH (1 << 4)
75 
76 struct AttrColor *index_color(struct Menu *menu, int line);
77 void index_make_entry(struct Menu *menu, char *buf, size_t buflen, int line);
78 void mutt_draw_statusline(struct MuttWindow *win, int cols, const char *buf, size_t buflen);
79 struct Mailbox *mutt_index_menu(struct MuttWindow *dlg, struct Mailbox *m);
80 void mutt_set_header_color(struct Mailbox *m, struct Email *e);
81 void mutt_update_index(struct Menu *menu, struct MailboxView *mv, enum MxStatus check, int oldcount, struct IndexSharedData *shared);
82 struct MuttWindow *index_pager_init(void);
84 bool check_acl(struct Mailbox *m, AclFlags acl, const char *msg);
85 int ci_next_undeleted(struct Mailbox *m, int msgno);
86 void update_index(struct Menu *menu, struct MailboxView *mv, enum MxStatus check, int oldcount, const struct IndexSharedData *shared);
87 void change_folder_mailbox(struct Menu *menu, struct Mailbox *m, int *oldcount, struct IndexSharedData *shared, bool read_only);
88 void collapse_all(struct MailboxView *mv, struct Menu *menu, int toggle);
89 void change_folder_string(struct Menu *menu, char *buf, size_t buflen, int *oldcount, struct IndexSharedData *shared, bool read_only);
90 int ci_previous_undeleted(struct Mailbox *m, int msgno);
91 int ci_first_message(struct Mailbox *m);
92 void resort_index(struct MailboxView *mv, struct Menu *menu);
93 int mx_toggle_write(struct Mailbox *m);
94 extern const struct Mapping IndexNewsHelp[];
95 struct Mailbox *change_folder_notmuch(struct Menu *menu, char *buf, int buflen, int *oldcount, struct IndexSharedData *shared, bool read_only);
96 struct Mailbox *get_current_mailbox(void);
97 struct Menu *get_current_menu(void);
98 void dlg_change_folder(struct MuttWindow *dlg, struct Mailbox *m);
99 
100 #endif /* MUTT_INDEX_LIB_H */
Convenience wrapper for the core headers.
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:848
void index_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
Format a menu item for the index list - Implements Menu::make_entry() -.
Definition: dlg_index.c:761
void mutt_update_index(struct Menu *menu, struct MailboxView *mv, enum MxStatus check, int oldcount, struct IndexSharedData *shared)
Update the index.
Definition: dlg_index.c:541
int ci_previous_undeleted(struct Mailbox *m, int msgno)
Find the previous undeleted email.
Definition: dlg_index.c:249
bool check_acl(struct Mailbox *m, AclFlags acl, const char *msg)
Check the ACLs for a function.
Definition: dlg_index.c:143
uint8_t CheckFlags
Flags, e.g. CHECK_IN_MAILBOX.
Definition: lib.h:68
struct Menu * get_current_menu(void)
Get the current Menu.
Definition: index.c:632
const struct Mapping IndexNewsHelp[]
Help Bar for the News Index dialog.
Definition: dlg_index.c:121
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:577
void dlg_change_folder(struct MuttWindow *dlg, struct Mailbox *m)
Change the current folder, cautiously.
Definition: dlg_index.c:1391
uint8_t NotifyIndex
Flags, e.g. NT_INDEX_ACCOUNT.
Definition: lib.h:55
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:496
void change_folder_string(struct Menu *menu, char *buf, size_t buflen, int *oldcount, struct IndexSharedData *shared, bool read_only)
Change to a different Mailbox by string.
Definition: dlg_index.c:724
void mutt_set_header_color(struct Mailbox *m, struct Email *e)
Select a colour for a message.
Definition: dlg_index.c:1330
void mutt_draw_statusline(struct MuttWindow *win, int cols, const char *buf, size_t buflen)
Draw a highlighted status bar.
Definition: dlg_index.c:880
void resort_index(struct MailboxView *mv, struct Menu *menu)
Resort the index.
Definition: dlg_index.c:329
struct Mailbox * mutt_index_menu(struct MuttWindow *dlg, struct Mailbox *m)
Display a list of emails.
Definition: dlg_index.c:1016
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:700
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
Definition: index.c:606
int ci_first_message(struct Mailbox *m)
Get index of first new message.
Definition: dlg_index.c:273
int ci_next_undeleted(struct Mailbox *m, int msgno)
Find the next undeleted email.
Definition: dlg_index.c:226
int mutt_dlgindex_observer(struct NotifyCallback *nc)
void collapse_all(struct MailboxView *mv, struct Menu *menu, int toggle)
Collapse/uncollapse all threads.
Definition: dlg_index.c:170
int mx_toggle_write(struct Mailbox *m)
Toggle the mailbox's readonly flag.
Definition: mx.c:1848
struct MuttWindow * index_pager_init(void)
Allocate the Windows for the Index/Pager.
Definition: dlg_index.c:1361
Data shared between Index, Pager and Sidebar.
uint16_t AclFlags
ACL Rights - These show permission to...
Definition: mailbox.h:59
Convenience wrapper for the library headers.
API for mailboxes.
MxStatus
Return values from mbox_check(), mbox_check_stats(), mbox_snc(), and mbox_close()
Definition: mxapi.h:84
Sidebar functions.
A curses colour and its attributes.
Definition: attr.h:35
The envelope/body of an email.
Definition: email.h:37
Data shared between Index, Pager and Sidebar.
Definition: shared_data.h:37
The "current" mailbox.
Definition: mview.h:38
A mailbox.
Definition: mailbox.h:79
Mapping between user-readable string and a constant.
Definition: mapping.h:32
Definition: lib.h:69
Data passed to a notification function.
Definition: observer.h:34