NeoMutt  2022-04-29-249-gaae397
Teaching an old dog new tricks
DOXYGEN
Postpone Function API

Prototype for a Postpone Function. More...

+ Collaboration diagram for Postpone Function API:

Functions

static int op_delete (struct PostponeData *pd, int op)
 Delete the current entry - Implements postpone_function_t -. More...
 
static int op_exit (struct PostponeData *pd, int op)
 Exit this menu - Implements postpone_function_t -. More...
 
static int op_generic_select_entry (struct PostponeData *pd, int op)
 Select the current entry - Implements postpone_function_t -. More...
 
static int op_search (struct PostponeData *pd, int op)
 Search for a regular expression - Implements postpone_function_t -. More...
 

Detailed Description

Prototype for a Postpone Function.

Parameters
menuMenu
opOperation to perform, e.g. OP_DELETE
Return values
enumFunctionRetval

Function Documentation

◆ op_delete()

static int op_delete ( struct PostponeData pd,
int  op 
)
static

Delete the current entry - Implements postpone_function_t -.

Definition at line 47 of file functions.c.

48{
49 struct Menu *menu = pd->menu;
50 struct Mailbox *m = pd->mailbox;
51
52 const int index = menu_get_index(menu);
53 /* should deleted draft messages be saved in the trash folder? */
54 mutt_set_flag(m, m->emails[index], MUTT_DELETE, (op == OP_DELETE));
56 const bool c_resolve = cs_subset_bool(NeoMutt->sub, "resolve");
57 if (c_resolve && (index < (menu->max - 1)))
58 {
59 menu_set_index(menu, index + 1);
60 if (index >= (menu->top + menu->page_len))
61 {
62 menu->top = index;
64 }
65 }
66 else
67 {
69 }
70
71 return FR_SUCCESS;
72}
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:73
@ FR_SUCCESS
Valid function - successfully performed.
Definition: dispatcher.h:39
#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:178
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition: menu.c:154
#define MENU_REDRAW_CURRENT
Redraw the current line of the menu.
Definition: lib.h:58
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition: menu.c:168
@ MUTT_DELETE
Messages to be deleted.
Definition: mutt.h:95
short PostCount
Definition: postpone.c:58
#define mutt_set_flag(m, e, flag, bf)
Definition: protos.h:63
A mailbox.
Definition: mailbox.h:79
int msg_count
Total number of messages.
Definition: mailbox.h:88
struct Email ** emails
Array of Emails.
Definition: mailbox.h:96
int msg_deleted
Number of deleted messages.
Definition: mailbox.h:93
Definition: lib.h:69
int top
Entry that is the top of the current page.
Definition: lib.h:80
int max
Number of entries in the menu.
Definition: lib.h:71
int page_len
Number of entries per screen.
Definition: lib.h:74
Container for Accounts, Notifications.
Definition: neomutt.h:37
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
struct Mailbox * mailbox
Postponed Mailbox.
Definition: functions.h:36
struct Menu * menu
Postponed Menu.
Definition: functions.h:37
+ Here is the call graph for this function:

◆ op_exit()

static int op_exit ( struct PostponeData pd,
int  op 
)
static

Exit this menu - Implements postpone_function_t -.

Definition at line 77 of file functions.c.

78{
79 pd->done = true;
80 return FR_SUCCESS;
81}
bool done
Should we close the Dialog?
Definition: functions.h:35

◆ op_generic_select_entry()

static int op_generic_select_entry ( struct PostponeData pd,
int  op 
)
static

Select the current entry - Implements postpone_function_t -.

Definition at line 86 of file functions.c.

87{
88 int index = menu_get_index(pd->menu);
89 pd->email = pd->mailbox->emails[index];
90 pd->done = true;
91 return FR_SUCCESS;
92}
struct Email * email
Selected Email.
Definition: functions.h:38
+ Here is the call graph for this function:

◆ op_search()

static int op_search ( struct PostponeData pd,
int  op 
)
static

Search for a regular expression - Implements postpone_function_t -.

Definition at line 97 of file functions.c.

98{
99 int index = menu_get_index(pd->menu);
100 index = mutt_search_command(pd->mailbox, pd->menu, index, op);
101 if (index != -1)
102 menu_set_index(pd->menu, index);
103
104 return FR_SUCCESS;
105}
int mutt_search_command(struct Mailbox *m, struct Menu *menu, int cur, int op)
Perform a search.
Definition: pattern.c:494
+ Here is the call graph for this function: