NeoMutt  2024-11-14-138-ge5ca67
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
lib.h
Go to the documentation of this file.
1
43#ifndef MUTT_INDEX_LIB_H
44#define MUTT_INDEX_LIB_H
45
46#include <stdbool.h>
47#include <stdint.h>
48#include <stdio.h>
49#include "mutt/lib.h"
50#include "core/lib.h"
51#include "expando/lib.h" // IWYU pragma: keep
52#include "expando_index.h" // IWYU pragma: keep
53#include "functions.h" // IWYU pragma: keep
54#include "shared_data.h" // IWYU pragma: keep
55#include "status.h" // IWYU pragma: keep
56
57struct Email;
58struct MailboxView;
59struct Menu;
60struct MuttWindow;
61
62// Observers of #NT_INDEX will be passed an #IndexSharedData.
63typedef uint8_t NotifyIndex;
64#define NT_INDEX_NO_FLAGS 0
65#define NT_INDEX_ADD (1 << 0)
66#define NT_INDEX_DELETE (1 << 1)
67#define NT_INDEX_SUBSET (1 << 2)
68#define NT_INDEX_ACCOUNT (1 << 3)
69#define NT_INDEX_MVIEW (1 << 4)
70#define NT_INDEX_MAILBOX (1 << 5)
71#define NT_INDEX_EMAIL (1 << 6)
72
73typedef uint8_t CheckFlags;
74#define CHECK_NO_FLAGS 0
75#define CHECK_IN_MAILBOX (1 << 0)
76#define CHECK_MSGCOUNT (1 << 1)
77#define CHECK_VISIBLE (1 << 2)
78#define CHECK_READONLY (1 << 3)
79#define CHECK_ATTACH (1 << 4)
80
81extern const struct Mapping IndexNewsHelp[];
82
83extern const struct ExpandoDefinition StatusFormatDef[];
84
85void change_folder_mailbox (struct Menu *menu, struct Mailbox *m, int *oldcount, struct IndexSharedData *shared, bool read_only);
86struct Mailbox * change_folder_notmuch (struct Menu *menu, char *buf, int buflen, int *oldcount, struct IndexSharedData *shared, bool read_only);
87void change_folder_string (struct Menu *menu, struct Buffer *buf, int *oldcount, struct IndexSharedData *shared, bool read_only);
88bool check_acl (struct Mailbox *m, AclFlags acl, const char *msg);
89void collapse_all (struct MailboxView *mv, struct Menu *menu, int toggle);
90struct Mailbox * dlg_index (struct MuttWindow *dlg, struct Mailbox *m);
91int find_first_message (struct MailboxView *mv);
92int find_next_undeleted (struct MailboxView *mv, int msgno, bool uncollapse);
93int find_previous_undeleted (struct MailboxView *mv, int msgno, bool uncollapse);
94struct Mailbox * get_current_mailbox (void);
96struct Menu * get_current_menu (void);
97void index_change_folder (struct MuttWindow *dlg, struct Mailbox *m);
98const struct AttrColor *index_color (struct Menu *menu, int line);
99int index_make_entry (struct Menu *menu, int line, int max_cols, struct Buffer *buf);
100struct MuttWindow * index_pager_init (void);
102void mutt_draw_statusline (struct MuttWindow *win, int max_cols, const char *buf, size_t buflen);
103void email_set_color (struct Mailbox *m, struct Email *e);
104void resort_index (struct MailboxView *mv, struct Menu *menu);
105void update_index (struct Menu *menu, struct MailboxView *mv, enum MxStatus check, int oldcount, const struct IndexSharedData *shared);
106
107int mutt_make_string(struct Buffer *buf, size_t max_cols, const struct Expando *exp,
108 struct Mailbox *m, int inpgr, struct Email *e,
109 MuttFormatFlags flags, const char *progress);
110
111#endif /* MUTT_INDEX_LIB_H */
Convenience wrapper for the core headers.
uint16_t AclFlags
ACL Rights - These show permission to...
Definition: mailbox.h:59
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:1099
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:926
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:825
bool check_acl(struct Mailbox *m, AclFlags acl, const char *msg)
Check the ACLs for a function.
Definition: dlg_index.c:138
uint8_t CheckFlags
Flags, e.g. CHECK_IN_MAILBOX.
Definition: lib.h:73
const struct Mapping IndexNewsHelp[]
Help Bar for the News Index dialog.
Definition: dlg_index.c:117
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:611
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:732
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:958
void email_set_color(struct Mailbox *m, struct Email *e)
Select an Index colour for an Email.
Definition: dlg_index.c:1406
const struct ExpandoDefinition StatusFormatDef[]
Expando definitions.
Definition: config.c:47
uint8_t NotifyIndex
Flags, e.g. NT_INDEX_ACCOUNT.
Definition: lib.h:63
struct MailboxView * get_current_mailbox_view(void)
Get the current Mailbox view.
Definition: index.c:683
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:542
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
Definition: index.c:715
void index_change_folder(struct MuttWindow *dlg, struct Mailbox *m)
Change the current folder, cautiously.
Definition: dlg_index.c:1465
struct Menu * get_current_menu(void)
Get the current Menu.
Definition: index.c:731
int find_first_message(struct MailboxView *mv)
Get index of first new message.
Definition: dlg_index.c:309
void resort_index(struct MailboxView *mv, struct Menu *menu)
Resort the index.
Definition: dlg_index.c:369
int find_next_undeleted(struct MailboxView *mv, int msgno, bool uncollapse)
Find the next undeleted email.
Definition: dlg_index.c:241
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:165
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:757
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:803
int find_previous_undeleted(struct MailboxView *mv, int msgno, bool uncollapse)
Find the previous undeleted email.
Definition: dlg_index.c:275
struct MuttWindow * index_pager_init(void)
Allocate the Windows for the Index/Pager.
Definition: dlg_index.c:1437
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:63
uint8_t MuttFormatFlags
Flags for expando_render(), e.g. MUTT_FORMAT_FORCESUBJ.
Definition: render.h:32
Sidebar functions.
GUI display a user-configurable status line.
A curses colour and its attributes.
Definition: attr.h:66
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:44
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:79
Mapping between user-readable string and a constant.
Definition: mapping.h:33
Definition: lib.h:79
Data passed to a notification function.
Definition: observer.h:34