NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Postpone Function API

Prototype for a Postpone Function. More...

+ Collaboration diagram for Postpone Function API:

Functions

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

Detailed Description

Prototype for a Postpone Function.

Parameters
menuMenu
eventEvent to process
Return values
enumFunctionRetval
Precondition
menu is not NULL
event is not NULL

Function Documentation

◆ op_delete()

static int op_delete ( struct PostponeData * pd,
const struct KeyEvent * event )
static

Delete the current entry - Implements postpone_function_t -.

Definition at line 87 of file functions.c.

88{
89 struct Menu *menu = pd->menu;
90 struct MailboxView *mv = pd->mailbox_view;
91 struct Mailbox *m = mv->mailbox;
92
93 const int index = menu_get_index(menu);
94 /* should deleted draft messages be saved in the trash folder? */
95 mutt_set_flag(m, m->emails[index], MUTT_DELETE, (event->op == OP_DELETE), true);
97 const bool c_resolve = cs_subset_bool(NeoMutt->sub, "resolve");
98 if (c_resolve && (index < (menu->max - 1)))
99 {
100 menu_set_index(menu, index + 1);
101 if (index >= (menu->top + menu->page_len))
102 {
103 menu->top = index;
105 }
106 }
107 else
108 {
110 }
111
112 return FR_SUCCESS;
113}
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
@ FR_SUCCESS
Valid function - successfully performed.
Definition dispatcher.h:40
void mutt_set_flag(struct Mailbox *m, struct Email *e, enum MessageType flag, bool bf, bool upd_mbox)
Set a flag on an email.
Definition flags.c:54
#define MENU_REDRAW_INDEX
Redraw the index.
Definition lib.h:57
void menu_queue_redraw(struct Menu *menu, MenuRedrawFlags redraw)
Queue a request for a redraw.
Definition menu.c:188
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition menu.c:164
#define MENU_REDRAW_CURRENT
Redraw the current line of the menu.
Definition lib.h:59
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition menu.c:178
short PostCount
Number of postponed (draft) emails.
Definition postpone.c:55
@ MUTT_DELETE
Messages to be deleted.
Definition mutt.h:94
int op
Function opcode, e.g. OP_HELP.
Definition get.h:52
View of a Mailbox.
Definition mview.h:40
struct Mailbox * mailbox
Current Mailbox.
Definition mview.h:51
A mailbox.
Definition mailbox.h:78
int msg_count
Total number of messages.
Definition mailbox.h:87
struct Email ** emails
Array of Emails.
Definition mailbox.h:95
int msg_deleted
Number of deleted messages.
Definition mailbox.h:92
Definition lib.h:80
int top
Entry that is the top of the current page.
Definition lib.h:92
int max
Number of entries in the menu.
Definition lib.h:82
int page_len
Number of entries per screen.
Definition lib.h:85
Container for Accounts, Notifications.
Definition neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
struct MailboxView * mailbox_view
Postponed Mailbox view.
Definition functions.h:38
struct Menu * menu
Postponed Menu.
Definition functions.h:39
+ Here is the call graph for this function:

◆ op_exit()

static int op_exit ( struct PostponeData * pd,
const struct KeyEvent * event )
static

Exit this menu - Implements postpone_function_t -.

Definition at line 118 of file functions.c.

119{
120 pd->done = true;
121 return FR_SUCCESS;
122}
bool done
Should we close the Dialog?
Definition functions.h:41

◆ op_generic_select_entry()

static int op_generic_select_entry ( struct PostponeData * pd,
const struct KeyEvent * event )
static

Select the current entry - Implements postpone_function_t -.

Definition at line 127 of file functions.c.

128{
129 int index = menu_get_index(pd->menu);
130 struct MailboxView *mv = pd->mailbox_view;
131 struct Mailbox *m = mv->mailbox;
132 pd->email = m->emails[index];
133 pd->done = true;
134 return FR_SUCCESS;
135}
struct Email * email
Selected Email.
Definition functions.h:40
+ Here is the call graph for this function:

◆ op_search()

static int op_search ( struct PostponeData * pd,
const struct KeyEvent * event )
static

Search for a regular expression - Implements postpone_function_t -.

Definition at line 140 of file functions.c.

141{
143 switch (event->op)
144 {
145 case OP_SEARCH:
146 flags |= SEARCH_PROMPT;
147 pd->search_state->reverse = false;
148 break;
149 case OP_SEARCH_REVERSE:
150 flags |= SEARCH_PROMPT;
151 pd->search_state->reverse = true;
152 break;
153 case OP_SEARCH_NEXT:
154 break;
155 case OP_SEARCH_OPPOSITE:
156 flags |= SEARCH_OPPOSITE;
157 break;
158 }
159
160 int index = menu_get_index(pd->menu);
161 struct MailboxView *mv = pd->mailbox_view;
162 index = mutt_search_command(mv, pd->menu, index, pd->search_state, flags);
163 if (index != -1)
164 menu_set_index(pd->menu, index);
165
166 return FR_SUCCESS;
167}
int mutt_search_command(struct MailboxView *mv, struct Menu *menu, int cur, struct SearchState *state, SearchFlags flags)
Perform a search.
Definition pattern.c:474
#define SEARCH_OPPOSITE
Search in the opposite direction.
uint8_t SearchFlags
Flags for a specific search, e.g. SEARCH_PROMPT.
#define SEARCH_NO_FLAGS
No flags are set.
#define SEARCH_PROMPT
Ask for search input.
struct SearchState * search_state
State of the current search.
Definition functions.h:42
bool reverse
search backwards
+ Here is the call graph for this function: