NeoMutt  2024-12-12-14-g7b49f7
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
dlg_compose.c
Go to the documentation of this file.
1
67#include "config.h"
68#include <stdbool.h>
69#include <stdint.h>
70#include <stdio.h>
71#include "private.h"
72#include "mutt/lib.h"
73#include "config/lib.h"
74#include "email/lib.h"
75#include "core/lib.h"
76#include "gui/lib.h"
77#include "lib.h"
78#include "attach/lib.h"
79#include "envelope/lib.h"
80#include "index/lib.h"
81#include "key/lib.h"
82#include "menu/lib.h"
83#include "ncrypt/lib.h"
84#include "attach_data.h"
85#include "cbar.h"
86#include "functions.h"
87#include "globals.h"
88#include "hook.h"
89#include "mutt_logging.h"
90#include "shared_data.h"
91
93static const struct Mapping ComposeHelp[] = {
94 // clang-format off
95 { N_("Send"), OP_COMPOSE_SEND_MESSAGE },
96 { N_("Abort"), OP_EXIT },
97 /* L10N: compose menu help line entry */
98 { N_("To"), OP_ENVELOPE_EDIT_TO },
99 /* L10N: compose menu help line entry */
100 { N_("CC"), OP_ENVELOPE_EDIT_CC },
101 /* L10N: compose menu help line entry */
102 { N_("Subj"), OP_ENVELOPE_EDIT_SUBJECT },
103 { N_("Attach file"), OP_ATTACHMENT_ATTACH_FILE },
104 { N_("Descrip"), OP_ATTACHMENT_EDIT_DESCRIPTION },
105 { N_("Help"), OP_HELP },
106 { NULL, 0 },
107 // clang-format on
108};
109
111static const struct Mapping ComposeNewsHelp[] = {
112 // clang-format off
113 { N_("Send"), OP_COMPOSE_SEND_MESSAGE },
114 { N_("Abort"), OP_EXIT },
115 { N_("Newsgroups"), OP_ENVELOPE_EDIT_NEWSGROUPS },
116 { N_("Subj"), OP_ENVELOPE_EDIT_SUBJECT },
117 { N_("Attach file"), OP_ATTACHMENT_ATTACH_FILE },
118 { N_("Descrip"), OP_ATTACHMENT_EDIT_DESCRIPTION },
119 { N_("Help"), OP_HELP },
120 { NULL, 0 },
121 // clang-format on
122};
123
127static int compose_recalc(struct MuttWindow *dlg)
128{
129 if (!dlg)
130 return -1;
131
132 struct ComposeSharedData *shared = dlg->wdata;
133 struct MuttWindow *win_env = window_find_child(dlg, WT_CUSTOM);
134 struct MuttWindow *win_preview = shared->win_preview;
135 struct MuttWindow *win_preview_bar = shared->win_preview_bar;
136
137 const bool c_show_preview = cs_subset_bool(shared->sub, "compose_show_preview");
138 const short c_preview_min_rows = cs_subset_number(shared->sub, "compose_preview_min_rows");
139
140 // How many rows are available for the preview window?
141 // Total rows - (envelope window + attachments + number of status bars)
142 int rows_available = dlg->state.rows -
143 (win_env->state.rows + shared->adata->actx->idxlen + 3);
144
145 if (c_show_preview && rows_available >= c_preview_min_rows)
146 {
147 window_set_visible(win_preview, true);
148 window_set_visible(win_preview_bar, true);
150 }
151 else
152 {
153 window_set_visible(win_preview, false);
154 window_set_visible(win_preview_bar, false);
156 }
157
158 return 0;
159}
160
165{
166 if (nc->event_type != NT_CONFIG)
167 return 0;
168 if (!nc->global_data || !nc->event_data)
169 return -1;
170
171 struct EventConfig *ev_c = nc->event_data;
172 struct MuttWindow *dlg = nc->global_data;
173
174 if (mutt_str_equal(ev_c->name, "status_on_top"))
175 {
177 mutt_debug(LL_DEBUG5, "config done, request WA_REFLOW\n");
178 }
179 else if (mutt_str_equal(ev_c->name, "compose_show_preview") ||
180 mutt_str_equal(ev_c->name, "compose_preview_min_rows"))
181 {
182 dlg->actions |= WA_RECALC;
183 mutt_debug(LL_DEBUG5, "config done, request WA_RECALC\n");
184 }
185 else if (mutt_str_equal(ev_c->name, "compose_preview_above_attachments"))
186 {
187 struct ComposeSharedData *shared = dlg->wdata;
188
189 mutt_window_swap(dlg, shared->win_preview_bar, shared->win_attach_bar);
190 mutt_window_swap(dlg, shared->win_preview, shared->adata->menu->win);
191
192 dlg->actions |= WA_REPAINT;
193 mutt_debug(LL_DEBUG5, "config done, request WA_REPAINT\n");
194 }
195
196 return 0;
197}
198
203{
204 if (nc->event_type != NT_ENVELOPE)
205 return 0;
206 if (!nc->global_data || !nc->event_data)
207 return -1;
208
209 struct ComposeSharedData *shared = nc->global_data;
210
212 shared->fcc_set = true;
213
215 return 0;
216}
217
222{
223 if (nc->event_type != NT_WINDOW)
224 return 0;
225 if (!nc->global_data || !nc->event_data)
226 return -1;
227
228 struct MuttWindow *dlg = nc->global_data;
229 struct EventWindow *ev_w = nc->event_data;
230 if (ev_w->win != dlg)
231 return 0;
232
233 struct ComposeSharedData *shared = dlg->wdata;
234
236 {
237 dlg->actions |= WA_RECALC;
238 mutt_debug(LL_DEBUG5, "window state done, request WA_RECALC\n");
239 }
240 else if (nc->event_subtype == NT_WINDOW_DELETE)
241 {
245 mutt_debug(LL_DEBUG5, "window delete done\n");
246 }
247
248 return 0;
249}
250
258static void gen_attach_list(struct AttachCtx *actx, struct Body *b, int parent_type, int level)
259{
260 for (; b; b = b->next)
261 {
262 struct AttachPtr *ap = mutt_aptr_new();
263 mutt_actx_add_attach(actx, ap);
264 ap->body = b;
265 b->aptr = ap;
267 ap->level = level;
268 if ((b->type == TYPE_MULTIPART) && b->parts &&
270 {
271 gen_attach_list(actx, b->parts, b->type, level + 1);
272 }
273 }
274}
275
282void update_menu(struct AttachCtx *actx, struct Menu *menu, bool init)
283{
284 if (init)
285 {
286 gen_attach_list(actx, actx->email->body, -1, 0);
287 mutt_attach_init(actx);
288
289 struct ComposeAttachData *adata = menu->mdata;
290 adata->actx = actx;
291 }
292
294
295 menu->max = actx->vcount;
296 if (menu->max)
297 {
298 int index = menu_get_index(menu);
299 if (index >= menu->max)
301 }
302 else
303 {
305 }
306
308}
309
317static struct MuttWindow *compose_dlg_init(struct ConfigSubset *sub,
318 struct Email *e, struct Buffer *fcc)
319{
321 shared->sub = sub;
322 shared->email = e;
323
327 dlg->wdata = shared;
329 dlg->recalc = compose_recalc;
330
331 struct MuttWindow *win_env = env_window_new(e, fcc, sub);
332 struct MuttWindow *win_attach = attach_new(dlg, shared);
333 struct MuttWindow *win_cbar = cbar_new(shared);
334 struct MuttWindow *win_abar = sbar_new();
335 sbar_set_title(win_abar, _("-- Attachments"));
336 struct MuttWindow *win_preview_bar = sbar_new();
337 sbar_set_title(win_preview_bar, _("-- Preview"));
338 struct MuttWindow *win_preview = preview_window_new(e, win_preview_bar);
339
340 const bool c_preview_above_attachments = cs_subset_bool(shared->sub, "compose_preview_above_attachments");
341 const bool c_status_on_top = cs_subset_bool(sub, "status_on_top");
342 if (c_status_on_top)
343 {
344 mutt_window_add_child(dlg, win_cbar);
345 mutt_window_add_child(dlg, win_env);
346 if (c_preview_above_attachments)
347 {
348 mutt_window_add_child(dlg, win_preview_bar);
349 mutt_window_add_child(dlg, win_preview);
350 mutt_window_add_child(dlg, win_abar);
351 mutt_window_add_child(dlg, win_attach);
352 }
353 else
354 {
355 mutt_window_add_child(dlg, win_abar);
356 mutt_window_add_child(dlg, win_attach);
357 mutt_window_add_child(dlg, win_preview_bar);
358 mutt_window_add_child(dlg, win_preview);
359 }
360 }
361 else
362 {
363 mutt_window_add_child(dlg, win_env);
364 if (c_preview_above_attachments)
365 {
366 mutt_window_add_child(dlg, win_preview_bar);
367 mutt_window_add_child(dlg, win_preview);
368 mutt_window_add_child(dlg, win_abar);
369 mutt_window_add_child(dlg, win_attach);
370 }
371 else
372 {
373 mutt_window_add_child(dlg, win_abar);
374 mutt_window_add_child(dlg, win_attach);
375 mutt_window_add_child(dlg, win_preview_bar);
376 mutt_window_add_child(dlg, win_preview);
377 }
378 mutt_window_add_child(dlg, win_cbar);
379 }
380
381 shared->win_preview_bar = win_preview_bar;
382 shared->win_preview = win_preview;
383 shared->win_attach_bar = win_abar;
384
385 dlg->help_data = ComposeHelp;
386 dlg->help_menu = MENU_COMPOSE;
387
388 return dlg;
389}
390
403int dlg_compose(struct Email *e, struct Buffer *fcc, uint8_t flags, struct ConfigSubset *sub)
404{
405 struct MuttWindow *dlg = compose_dlg_init(sub, e, fcc);
406 struct ComposeSharedData *shared = dlg->wdata;
407 shared->mailbox = get_current_mailbox();
408 shared->email = e;
409 shared->sub = sub;
410 shared->fcc = fcc;
411 shared->fcc_set = false;
412 shared->flags = flags;
413 shared->rc = -1;
414
418
419 if (OptNewsSend)
421 else
422 dlg->help_data = ComposeHelp;
423 dlg->help_menu = MENU_COMPOSE;
424
425 struct Menu *menu = shared->adata->menu;
426 update_menu(shared->adata->actx, menu, true);
428
429 struct MuttWindow *win_env = window_find_child(dlg, WT_CUSTOM);
430
431 dialog_push(dlg);
432 struct MuttWindow *old_focus = window_set_focus(menu->win);
433 // ---------------------------------------------------------------------------
434 // Event Loop
435 int rc = 0;
436 int op = OP_NULL;
437 do
438 {
439 OptNews = false; /* for any case */
440 menu_tagging_dispatcher(menu->win, op);
441 window_redraw(NULL);
442
444 mutt_debug(LL_DEBUG1, "Got op %s (%d)\n", opcodes_get_name(op), op);
445 if (op < 0)
446 continue;
447 if (op == OP_NULL)
448 {
450 continue;
451 }
453
454 rc = compose_function_dispatcher(dlg, op);
455 if (rc == FR_UNKNOWN)
456 rc = env_function_dispatcher(win_env, op);
457 if (rc == FR_UNKNOWN)
459 if (rc == FR_UNKNOWN)
460 rc = menu_function_dispatcher(menu->win, op);
461 if (rc == FR_UNKNOWN)
462 rc = global_function_dispatcher(NULL, op);
463 } while (rc != FR_DONE);
464 // ---------------------------------------------------------------------------
465
466#ifdef USE_AUTOCRYPT
467 /* This is a fail-safe to make sure the bit isn't somehow turned
468 * on. The user could have disabled the option after setting SEC_AUTOCRYPT,
469 * or perhaps resuming or replying to an autocrypt message. */
470 const bool c_autocrypt = cs_subset_bool(sub, "autocrypt");
471 if (!c_autocrypt)
472 e->security &= ~SEC_AUTOCRYPT;
473#endif
474
475 if (shared->adata->actx->idxlen)
476 e->body = shared->adata->actx->idx[0]->body;
477 else
478 e->body = NULL;
479
480 rc = shared->rc;
481
482 window_set_focus(old_focus);
483 dialog_pop();
484 mutt_window_free(&dlg);
485
486 return rc;
487}
void mutt_actx_add_attach(struct AttachCtx *actx, struct AttachPtr *attach)
Add an Attachment to an Attachment Context.
Definition: attach.c:65
struct AttachPtr * mutt_aptr_new(void)
Create a new Attachment Pointer.
Definition: attach.c:40
GUI display the mailboxes in a side panel.
Compose Attach Data.
struct MuttWindow * cbar_new(struct ComposeSharedData *shared)
Create the Compose Bar (status)
Definition: cbar.c:226
Compose Bar.
void attachment_size_fixed(struct MuttWindow *win)
Make the Attachment Window fixed-size.
Definition: attach.c:297
struct MuttWindow * attach_new(struct MuttWindow *parent, struct ComposeSharedData *shared)
Create the Attachments Menu.
Definition: attach.c:267
void attachment_size_max(struct MuttWindow *win)
Make the Attachment Window maximised.
Definition: attach.c:310
struct ComposeSharedData * compose_shared_data_new(void)
Free the compose shared data.
Definition: shared_data.c:48
short cs_subset_number(const struct ConfigSubset *sub, const char *name)
Get a number config item by name.
Definition: helpers.c:143
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:47
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
SecurityFlags mutt_is_multipart_encrypted(struct Body *b)
Does the message have encrypted parts?
Definition: crypt.c:443
void dialog_push(struct MuttWindow *dlg)
Display a Window to the user.
Definition: dialog.c:109
void dialog_pop(void)
Hide a Window from the user.
Definition: dialog.c:142
@ FR_DONE
Exit the Dialog.
Definition: dispatcher.h:35
@ FR_UNKNOWN
Unknown function.
Definition: dispatcher.h:33
static void gen_attach_list(struct AttachCtx *actx, struct Body *b, int parent_type, int level)
Generate the attachment list for the compose screen.
Definition: dlg_compose.c:258
void update_menu(struct AttachCtx *actx, struct Menu *menu, bool init)
Redraw the compose window.
Definition: dlg_compose.c:282
static const struct Mapping ComposeHelp[]
Help Bar for the Compose dialog.
Definition: dlg_compose.c:93
static const struct Mapping ComposeNewsHelp[]
Help Bar for the News Compose dialog.
Definition: dlg_compose.c:111
static struct MuttWindow * compose_dlg_init(struct ConfigSubset *sub, struct Email *e, struct Buffer *fcc)
Allocate the Windows for Compose.
Definition: dlg_compose.c:317
Structs that make up an email.
@ NT_EMAIL_CHANGE
Email has changed.
Definition: email.h:186
Envelope-editing Window.
struct MuttWindow * env_window_new(struct Email *e, struct Buffer *fcc, struct ConfigSubset *sub)
Create the Envelope Window.
Definition: window.c:944
@ NT_ENVELOPE_FCC
"Fcc:" header has changed
Definition: envelope.h:139
int km_dokey(enum MenuType mtype, GetChFlags flags)
Determine what a keypress should do.
Definition: get.c:464
void km_error_key(enum MenuType mtype)
Handle an unbound key sequence.
Definition: get.c:294
bool OptNews
(pseudo) used to change reader mode
Definition: globals.c:67
bool OptNewsSend
(pseudo) used to change behavior when posting
Definition: globals.c:68
int preview_function_dispatcher(struct MuttWindow *win, int op)
Perform a preview function - Implements function_dispatcher_t -.
Definition: preview.c:405
int menu_tagging_dispatcher(struct MuttWindow *win, int op)
Perform tagging operations on the Menu - Implements function_dispatcher_t -.
Definition: tagging.c:230
int env_function_dispatcher(struct MuttWindow *win, int op)
Perform an Envelope function - Implements function_dispatcher_t -.
Definition: functions.c:530
int compose_function_dispatcher(struct MuttWindow *win, int op)
Perform a Compose function - Implements function_dispatcher_t -.
Definition: functions.c:2143
int global_function_dispatcher(struct MuttWindow *win, int op)
Perform a Global function - Implements function_dispatcher_t -.
Definition: global.c:172
int menu_function_dispatcher(struct MuttWindow *win, int op)
Perform a Menu function - Implements function_dispatcher_t -.
Definition: functions.c:318
int dlg_compose(struct Email *e, struct Buffer *fcc, uint8_t flags, struct ConfigSubset *sub)
Allow the user to edit the message envelope -.
Definition: dlg_compose.c:403
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
static int compose_email_observer(struct NotifyCallback *nc)
Notification that an Email has changed - Implements observer_t -.
Definition: dlg_compose.c:202
static int compose_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: dlg_compose.c:164
static int compose_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: dlg_compose.c:221
static int compose_recalc(struct MuttWindow *dlg)
Recalculate the Window data - Implements MuttWindow::recalc() -.
Definition: dlg_compose.c:127
void compose_shared_data_free(struct MuttWindow *win, void **ptr)
Free the compose shared data - Implements MuttWindow::wdata_free() -.
Definition: shared_data.c:36
Convenience wrapper for the gui headers.
void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type)
Perform a message hook.
Definition: hook.c:699
Parse and execute user-defined hooks.
#define MUTT_SEND2_HOOK
send2-hook: when changing fields in the compose menu
Definition: hook.h:48
GUI manage the main index (list of emails)
Data shared between Index, Pager and Sidebar.
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
Definition: index.c:715
Manage keymappings.
#define GETCH_NO_FLAGS
No flags are set.
Definition: lib.h:51
@ LL_DEBUG5
Log at debug level 5.
Definition: logging2.h:47
@ LL_DEBUG1
Log at debug level 1.
Definition: logging2.h:43
GUI present the user with a selectable list.
#define MENU_REDRAW_INDEX
Redraw the index.
Definition: lib.h:56
void menu_queue_redraw(struct Menu *menu, MenuRedrawFlags redraw)
Queue a request for a redraw.
Definition: menu.c:184
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition: menu.c:160
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition: menu.c:174
@ TYPE_MULTIPART
Type: 'multipart/*'.
Definition: mime.h:37
Convenience wrapper for the library headers.
#define N_(a)
Definition: message.h:32
#define _(a)
Definition: message.h:28
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
Definition: notify.c:230
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition: notify.c:191
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:173
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:660
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Definition: mutt_logging.c:74
NeoMutt Logging.
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
Definition: mutt_window.c:634
bool window_status_on_top(struct MuttWindow *panel, struct ConfigSubset *sub)
Organise windows according to config variable.
Definition: mutt_window.c:784
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
Definition: mutt_window.c:202
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:446
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
Definition: mutt_window.c:182
bool mutt_window_swap(struct MuttWindow *parent, struct MuttWindow *win1, struct MuttWindow *win2)
Swap the position of two windows.
Definition: mutt_window.c:820
struct MuttWindow * window_set_focus(struct MuttWindow *win)
Set the Window focus.
Definition: mutt_window.c:684
void window_set_visible(struct MuttWindow *win, bool visible)
Set a Window visible or hidden.
Definition: mutt_window.c:165
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
Definition: mutt_window.c:533
#define WA_RECALC
Recalculate the contents of the Window.
Definition: mutt_window.h:110
@ WT_CUSTOM
Window with a custom drawing function.
Definition: mutt_window.h:95
@ WT_DLG_COMPOSE
Compose Dialog, dlg_compose()
Definition: mutt_window.h:83
@ MUTT_WIN_ORIENT_VERTICAL
Window uses all available vertical space.
Definition: mutt_window.h:39
@ NT_WINDOW_STATE
Window state has changed, e.g. WN_VISIBLE.
Definition: mutt_window.h:230
@ NT_WINDOW_DELETE
Window is about to be deleted.
Definition: mutt_window.h:229
#define WA_REPAINT
Redraw the contents of the Window.
Definition: mutt_window.h:111
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition: mutt_window.h:53
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
Definition: mutt_window.h:49
API for encryption/signing of emails.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:96
#define WithCrypto
Definition: lib.h:122
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:57
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:43
@ NT_EMAIL
Email has changed, NotifyEmail, EventEmail.
Definition: notify_type.h:44
@ NT_ENVELOPE
Envelope has changed, NotifyEnvelope.
Definition: notify_type.h:45
@ NT_ALL
Register for all notifications.
Definition: notify_type.h:35
const char * opcodes_get_name(int op)
Get the name of an opcode.
Definition: opcodes.c:48
struct MuttWindow * preview_window_new(struct Email *e, struct MuttWindow *bar)
Create the preview window.
Definition: preview.c:339
void mutt_attach_init(struct AttachCtx *actx)
Create a new Attachment context.
Definition: recvattach.c:1189
void mutt_update_tree(struct AttachCtx *actx)
Refresh the list of attachments.
Definition: recvattach.c:122
struct MuttWindow * sbar_new(void)
Add the Simple Bar (status)
Definition: sbar.c:203
void sbar_set_title(struct MuttWindow *win, const char *title)
Set the title for the Simple Bar.
Definition: sbar.c:227
Sidebar functions.
GUI display the mailboxes in a side panel.
Key value store.
A set of attachments.
Definition: attach.h:63
short vcount
The number of virtual attachments.
Definition: attach.h:72
struct Email * email
Used by recvattach for updating.
Definition: attach.h:64
struct AttachPtr ** idx
Array of attachments.
Definition: attach.h:67
short idxlen
Number of attachmentes.
Definition: attach.h:68
An email to which things will be attached.
Definition: attach.h:35
struct Body * body
Attachment.
Definition: attach.h:36
int level
Nesting depth of attachment.
Definition: attach.h:40
int parent_type
Type of parent attachment, e.g. TYPE_MULTIPART.
Definition: attach.h:38
The body of an email.
Definition: body.h:36
struct Body * parts
parts of a multipart or message/rfc822
Definition: body.h:73
struct AttachPtr * aptr
Menu information, used in recvattach.c.
Definition: body.h:75
struct Body * next
next attachment in the list
Definition: body.h:72
unsigned int type
content-type primary type, ContentType
Definition: body.h:40
String manipulation buffer.
Definition: buffer.h:36
Data to fill the Compose Attach Window.
Definition: attach_data.h:33
struct Menu * menu
Menu displaying the attachments.
Definition: attach_data.h:35
struct AttachCtx * actx
Set of attachments.
Definition: attach_data.h:34
Shared Compose Data.
Definition: shared_data.h:36
struct ConfigSubset * sub
Config set to use.
Definition: shared_data.h:37
struct Mailbox * mailbox
Current Mailbox.
Definition: shared_data.h:38
int flags
Flags, e.g. MUTT_COMPOSE_NOFREEHEADER.
Definition: shared_data.h:46
struct MuttWindow * win_preview
Message preview window.
Definition: shared_data.h:42
struct MuttWindow * win_preview_bar
Status bar divider above preview.
Definition: shared_data.h:43
bool fcc_set
User has edited the Fcc: field.
Definition: shared_data.h:47
int rc
Return code to leave compose.
Definition: shared_data.h:48
struct ComposeAttachData * adata
Attachments.
Definition: shared_data.h:40
struct Email * email
Email being composed.
Definition: shared_data.h:39
struct MuttWindow * win_attach_bar
Status bar divider above attachments.
Definition: shared_data.h:41
struct Buffer * fcc
Buffer to save FCC.
Definition: shared_data.h:45
A set of inherited config items.
Definition: subset.h:47
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition: subset.h:52
The envelope/body of an email.
Definition: email.h:39
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
Definition: email.h:43
struct Body * body
List of MIME parts.
Definition: email.h:69
struct Notify * notify
Notifications: NotifyEmail, EventEmail.
Definition: email.h:73
A config-change event.
Definition: subset.h:71
const char * name
Name of config item that changed.
Definition: subset.h:73
An Event that happened to a Window.
Definition: mutt_window.h:239
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:240
Mapping between user-readable string and a constant.
Definition: mapping.h:33
Definition: lib.h:79
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:86
void * mdata
Private data.
Definition: lib.h:147
int max
Number of entries in the menu.
Definition: lib.h:81
const struct Mapping * help_data
Data for the Help Bar.
Definition: mutt_window.h:142
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
void * wdata
Private data.
Definition: mutt_window.h:145
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:138
int(* recalc)(struct MuttWindow *win)
Definition: mutt_window.h:173
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Definition: mutt_window.h:159
int help_menu
Menu for key bindings, e.g. MENU_PAGER.
Definition: mutt_window.h:141
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
Definition: mutt_window.h:132
Container for Accounts, Notifications.
Definition: neomutt.h:42
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46
Data passed to a notification function.
Definition: observer.h:34
void * event_data
Data from notify_send()
Definition: observer.h:38
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
Definition: observer.h:36
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
Definition: observer.h:37
void * global_data
Data from notify_observer_add()
Definition: observer.h:39
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:62
@ MENU_COMPOSE
Compose an email.
Definition: type.h:42