NeoMutt  2025-12-11-980-ge38c27
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.
72{
74 NT_INDEX_ADD = 1U << 0,
75 NT_INDEX_DELETE = 1U << 1,
76 NT_INDEX_SUBSET = 1U << 2,
77 NT_INDEX_ACCOUNT = 1U << 3,
78 NT_INDEX_MVIEW = 1U << 4,
79 NT_INDEX_MAILBOX = 1U << 5,
80 NT_INDEX_EMAIL = 1U << 6,
81};
82typedef uint8_t NotifyIndex;
83
88{
90 CHECK_IN_MAILBOX = 1U << 0,
91 CHECK_MSGCOUNT = 1U << 1,
92 CHECK_VISIBLE = 1U << 2,
93 CHECK_READONLY = 1U << 3,
94 CHECK_ATTACH = 1U << 4,
95};
96typedef uint8_t CheckFlags;
97
107
108extern const struct Mapping IndexNewsHelp[];
109
110extern const struct ExpandoDefinition StatusFormatDef[];
111
112void index_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic);
113
114void change_folder_mailbox (struct Menu *menu, struct Mailbox *m, int *oldcount, struct IndexSharedData *shared, bool read_only);
115struct Mailbox * change_folder_notmuch (struct Menu *menu, char *buf, int buflen, int *oldcount, struct IndexSharedData *shared, bool read_only);
116void change_folder_string (struct Menu *menu, struct Buffer *buf, int *oldcount, struct IndexSharedData *shared, bool read_only);
117bool check_acl (struct Mailbox *m, AclFlags acl, const char *msg);
118void collapse_all (struct MailboxView *mv, struct Menu *menu, enum CollapseMode mode);
119struct Mailbox * dlg_index (struct MuttWindow *dlg, struct Mailbox *m);
120int find_first_message (struct MailboxView *mv);
121int find_next_undeleted (struct MailboxView *mv, int msgno, bool uncollapse);
122int find_previous_undeleted (struct MailboxView *mv, int msgno, bool uncollapse);
123struct Mailbox * get_current_mailbox (void);
125void index_change_folder (struct MuttWindow *dlg, struct Mailbox *m);
126const struct AttrColor *index_color (struct Menu *menu, int line);
127int index_make_entry (struct Menu *menu, int line, int max_cols, struct Buffer *buf);
128struct MuttWindow * index_pager_init (void);
130void mutt_draw_statusline (struct MuttWindow *win, int max_cols, const char *buf, size_t buflen);
131void email_set_color (struct Mailbox *m, struct Email *e);
132void resort_index (struct MailboxView *mv, struct Menu *menu);
133void update_index (struct Menu *menu, struct MailboxView *mv, enum MxStatus check, int oldcount, const struct IndexSharedData *shared);
134
135int mutt_make_string(struct Buffer *buf, size_t max_cols, const struct Expando *exp,
136 struct Mailbox *m, int inpgr, struct Email *e,
137 MuttFormatFlags flags, const char *progress);
138
139#endif /* MUTT_INDEX_LIB_H */
Convenience wrapper for the core headers.
uint16_t AclFlags
Definition mailbox.h:73
const struct Mapping IndexNewsHelp[]
Help Bar for the News Index dialog.
Definition dlg_index.c:116
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:1121
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:948
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:847
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:137
uint8_t CheckFlags
Definition lib.h:96
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:631
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:752
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:980
NotifyIndexFlag
Flags, e.g.
Definition lib.h:72
@ NT_INDEX_SUBSET
Config Subset has changed.
Definition lib.h:76
@ NT_INDEX_DELETE
Index Shared Data is about to be freed.
Definition lib.h:75
@ NT_INDEX_MAILBOX
Mailbox has changed.
Definition lib.h:79
@ NT_INDEX_EMAIL
Email has changed.
Definition lib.h:80
@ NT_INDEX_ACCOUNT
Account has changed.
Definition lib.h:77
@ NT_INDEX_MVIEW
MailboxView has changed.
Definition lib.h:78
@ NT_INDEX_ADD
New Index Shared Data has been created.
Definition lib.h:74
@ NT_INDEX_NONE
No flags are set.
Definition lib.h:73
void email_set_color(struct Mailbox *m, struct Email *e)
Select an Index colour for an Email.
Definition dlg_index.c:1431
CollapseMode
Action to perform on a Thread.
Definition lib.h:102
@ COLLAPSE_MODE_TOGGLE
Toggle collapsed state.
Definition lib.h:103
@ COLLAPSE_MODE_CLOSE
Collapse all threads.
Definition lib.h:104
@ COLLAPSE_MODE_OPEN
Open all threads.
Definition lib.h:105
uint8_t NotifyIndex
Definition lib.h:82
struct MailboxView * get_current_mailbox_view(void)
Get the current Mailbox view.
Definition index.c:692
void index_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
Initialise the Index Keybindings - Implements ::init_keys_api.
Definition functions.c:327
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:562
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
Definition index.c:725
void index_change_folder(struct MuttWindow *dlg, struct Mailbox *m)
Change the current folder, cautiously.
Definition dlg_index.c:1490
int find_first_message(struct MailboxView *mv)
Get index of first new message.
Definition dlg_index.c:327
void resort_index(struct MailboxView *mv, struct Menu *menu)
Resort the index.
Definition dlg_index.c:387
int find_next_undeleted(struct MailboxView *mv, int msgno, bool uncollapse)
Find the next undeleted email.
Definition dlg_index.c:259
CheckFlag
Flags, e.g.
Definition lib.h:88
@ CHECK_VISIBLE
Is the selected message visible in the index?
Definition lib.h:92
@ CHECK_NONE
No flags are set.
Definition lib.h:89
@ CHECK_READONLY
Is the mailbox readonly?
Definition lib.h:93
@ CHECK_MSGCOUNT
Are there any messages?
Definition lib.h:91
@ CHECK_IN_MAILBOX
Is there a mailbox open?
Definition lib.h:90
@ CHECK_ATTACH
Is the user in message-attach mode?
Definition lib.h:94
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:777
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:824
int find_previous_undeleted(struct MailboxView *mv, int msgno, bool uncollapse)
Find the previous undeleted email.
Definition dlg_index.c:293
struct MuttWindow * index_pager_init(void)
Allocate the Windows for the Index/Pager.
Definition dlg_index.c:1462
void collapse_all(struct MailboxView *mv, struct Menu *menu, enum CollapseMode mode)
Collapse/uncollapse all threads.
Definition dlg_index.c:161
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:70
uint8_t MuttFormatFlags
Definition render.h:45
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:49
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:81
Mapping between user-readable string and a constant.
Definition mapping.h:33
Definition lib.h:86
Container for Accounts, Notifications.
Definition neomutt.h:41
Data passed to a notification function.
Definition observer.h:34
Collection of related functions.
Definition menudef.h:33
Parse Subject-regex Commands.