NeoMutt  2025-12-11-860-g80c9cc
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
functions.h File Reference

Index functions. More...

#include <stdbool.h>
+ Include dependency graph for functions.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  IndexFunctionData
 Data passed to Index worker functions. More...
 
struct  IndexFunction
 A NeoMutt function. More...
 

Macros

#define MdIndex   (index_get_menu_definition())
 

Typedefs

typedef int(* index_function_t) (struct IndexFunctionData *fdata, const struct KeyEvent *event)
 

Functions

int index_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform an Index function - Implements function_dispatcher_t -.
 
bool index_next_undeleted (struct MuttWindow *win_index)
 Select the next undeleted Email (if possible)
 
struct MenuDefinitionindex_get_menu_definition (void)
 Get the Index Menu Definition.
 

Detailed Description

Index functions.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file functions.h.

Macro Definition Documentation

◆ MdIndex

#define MdIndex   (index_get_menu_definition())

Definition at line 72 of file functions.h.

Typedef Documentation

◆ index_function_t

typedef int(* index_function_t) (struct IndexFunctionData *fdata, const struct KeyEvent *event)

Definition at line 55 of file functions.h.

Function Documentation

◆ index_next_undeleted()

bool index_next_undeleted ( struct MuttWindow * win_index)

Select the next undeleted Email (if possible)

Parameters
win_indexIndex Window
Return values
trueSelection succeeded

Definition at line 427 of file functions.c.

428{
429 struct MuttWindow *dlg = dialog_find(win_index);
430 if (!dlg)
431 return false;
432
433 struct Menu *menu = win_index->wdata;
434 struct IndexSharedData *shared = dlg->wdata;
435 if (!shared)
436 return false;
437
438 struct IndexPrivateData *priv = win_index->parent->wdata;
439 const bool uncollapse = mutt_using_threads() && !window_is_focused(priv->win_index);
440
441 int index = find_next_undeleted(shared->mailbox_view, menu_get_index(menu), uncollapse);
442 if ((index < 0) || (index >= shared->mailbox->vcount))
443 {
444 // Selection failed
446 return false;
447 }
448
449 menu_set_index(menu, index);
450 return true;
451}
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition dialog.c:89
int find_next_undeleted(struct MailboxView *mv, int msgno, bool uncollapse)
Find the next undeleted email.
Definition dlg_index.c:259
#define mutt_using_threads()
Definition thread.h:113
#define NT_INDEX_EMAIL
Email has changed.
Definition lib.h:76
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition menu.c:155
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition menu.c:169
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 window_is_focused(const struct MuttWindow *win)
Does the given Window have the focus?
@ NT_INDEX
Index data has changed, NotifyIndex, IndexSharedData.
Definition notify_type.h:48
Private state data for the Index.
struct MuttWindow * win_index
Window for the Index.
struct IndexSharedData * shared
Shared Index data.
struct Menu * menu
Menu controlling the index.
Data shared between Index, Pager and Sidebar.
Definition shared_data.h:37
struct Mailbox * mailbox
Current Mailbox.
Definition shared_data.h:41
struct MailboxView * mailbox_view
Current Mailbox view.
Definition shared_data.h:40
struct Notify * notify
Notifications: NotifyIndex, IndexSharedData.
Definition shared_data.h:44
int vcount
The number of virtual messages.
Definition mailbox.h:98
Definition lib.h:80
void * wdata
Private data.
struct MuttWindow * parent
Parent Window.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ index_get_menu_definition()

struct MenuDefinition * index_get_menu_definition ( void )

Get the Index Menu Definition.

Return values
ptrIndex Menu Definition

Definition at line 4043 of file functions.c.

4044{
4046 ASSERT(mod_data);
4047
4048 return mod_data->menu_index;
4049}
@ MODULE_ID_INDEX
ModuleIndex, Index
Definition module_api.h:72
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:663
#define ASSERT(COND)
Definition signal2.h:59
Index private Module data.
Definition module_data.h:32
struct MenuDefinition * menu_index
Index menu definition.
Definition module_data.h:34
Container for Accounts, Notifications.
Definition neomutt.h:41
+ Here is the call graph for this function: