NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
lib.h
Go to the documentation of this file.
1
22
46
47#ifndef MUTT_INDEX_LIB_H
48#define MUTT_INDEX_LIB_H
49
50#include <stdbool.h>
51#include <stdint.h>
52#include <stdio.h>
53#include "mutt/lib.h"
54#include "core/lib.h"
55#include "expando/lib.h" // IWYU pragma: keep
56#include "expando_index.h" // IWYU pragma: keep
57#include "functions.h" // IWYU pragma: keep
58#include "shared_data.h" // IWYU pragma: keep
59#include "status.h" // IWYU pragma: keep
60#include "subjectrx.h" // IWYU pragma: keep
61
62struct Email;
63struct MailboxView;
64struct Menu;
65struct MuttWindow;
66struct SubMenu;
67
68// Observers of #NT_INDEX will be passed an #IndexSharedData.
73{
75 NT_INDEX_ADD = 1U << 0,
76 NT_INDEX_DELETE = 1U << 1,
77 NT_INDEX_SUBSET = 1U << 2,
78 NT_INDEX_ACCOUNT = 1U << 3,
79 NT_INDEX_MVIEW = 1U << 4,
80 NT_INDEX_MAILBOX = 1U << 5,
81 NT_INDEX_EMAIL = 1U << 6,
82};
83typedef uint8_t NotifyIndex;
84
89{
91 CHECK_IN_MAILBOX = 1U << 0,
92 CHECK_MSGCOUNT = 1U << 1,
93 CHECK_VISIBLE = 1U << 2,
94 CHECK_READONLY = 1U << 3,
95 CHECK_ATTACH = 1U << 4,
96};
97typedef uint8_t CheckFlags;
98
108
109extern const struct Mapping IndexNewsHelp[];
110
111extern const struct ExpandoDefinition StatusFormatDef[];
112
113void index_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic);
114
115void change_folder_mailbox (struct Menu *menu, struct Mailbox *m, int *oldcount, struct IndexSharedData *shared, bool read_only);
116struct Mailbox * change_folder_notmuch (struct Menu *menu, char *buf, int buflen, int *oldcount, struct IndexSharedData *shared, bool read_only);
117void change_folder_string (struct Menu *menu, struct Buffer *buf, int *oldcount, struct IndexSharedData *shared, bool read_only);
118bool check_acl (struct Mailbox *m, AclFlags acl, const char *msg);
119void collapse_all (struct MailboxView *mv, struct Menu *menu, enum CollapseMode mode);
120void dlg_list (struct Mailbox *m, struct Email *e);
121struct Mailbox * dlg_index (struct MuttWindow *dlg, struct Mailbox *m);
122int find_first_message (struct MailboxView *mv);
123int find_next_undeleted (struct MailboxView *mv, int msgno, bool uncollapse);
124int find_previous_undeleted (struct MailboxView *mv, int msgno, bool uncollapse);
125struct Mailbox * get_current_mailbox (void);
127void index_change_folder (struct MuttWindow *dlg, struct Mailbox *m);
128const struct AttrColor *index_color (struct Menu *menu, int line);
129int index_make_entry (struct Menu *menu, int line, int max_cols, struct Buffer *buf);
130struct MuttWindow * index_pager_init (void);
132void mutt_draw_statusline (struct MuttWindow *win, int max_cols, const char *buf, size_t buflen);
133void email_set_color (struct Mailbox *m, struct Email *e);
134void resort_index (struct MailboxView *mv, struct Menu *menu);
135void update_index (struct Menu *menu, struct MailboxView *mv, enum MxStatus check, int oldcount, const struct IndexSharedData *shared);
136
137int mutt_make_string(struct Buffer *buf, size_t max_cols, const struct Expando *exp,
138 struct Mailbox *m, int inpgr, struct Email *e,
139 MuttFormatFlags flags, const char *progress);
140
141#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.
void dlg_list(struct Mailbox *m, struct Email *e)
Display mailing-list actions for an email -.
Definition dlg_list.c:293
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:97
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:73
@ NT_INDEX_SUBSET
Config Subset has changed.
Definition lib.h:77
@ NT_INDEX_DELETE
Index Shared Data is about to be freed.
Definition lib.h:76
@ NT_INDEX_MAILBOX
Mailbox has changed.
Definition lib.h:80
@ NT_INDEX_EMAIL
Email has changed.
Definition lib.h:81
@ NT_INDEX_ACCOUNT
Account has changed.
Definition lib.h:78
@ NT_INDEX_MVIEW
MailboxView has changed.
Definition lib.h:79
@ NT_INDEX_ADD
New Index Shared Data has been created.
Definition lib.h:75
@ NT_INDEX_NONE
No flags are set.
Definition lib.h:74
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:103
@ COLLAPSE_MODE_TOGGLE
Toggle collapsed state.
Definition lib.h:104
@ COLLAPSE_MODE_CLOSE
Collapse all threads.
Definition lib.h:105
@ COLLAPSE_MODE_OPEN
Open all threads.
Definition lib.h:106
uint8_t NotifyIndex
Definition lib.h:83
struct MailboxView * get_current_mailbox_view(void)
Get the current Mailbox view.
Definition index.c:693
void index_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
Initialise the Index Keybindings - Implements ::init_keys_api.
Definition functions.c:358
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:726
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:89
@ CHECK_VISIBLE
Is the selected message visible in the index?
Definition lib.h:93
@ CHECK_NONE
No flags are set.
Definition lib.h:90
@ CHECK_READONLY
Is the mailbox readonly?
Definition lib.h:94
@ CHECK_MSGCOUNT
Are there any messages?
Definition lib.h:92
@ CHECK_IN_MAILBOX
Is there a mailbox open?
Definition lib.h:91
@ CHECK_ATTACH
Is the user in message-attach mode?
Definition lib.h:95
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 menu.h:65
Parse Subject-regex Commands.