NeoMutt  2025-12-11-1039-g550ac6
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...

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.
struct SubMenuindex_get_submenu (void)
 Get the Index SubMenu.

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.

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 444 of file functions.c.

445{
446 struct MuttWindow *dlg = dialog_find(win_index);
447 if (!dlg)
448 return false;
449
450 struct Menu *menu = win_index->wdata;
451 struct IndexSharedData *shared = dlg->wdata;
452 if (!shared)
453 return false;
454
455 struct IndexPrivateData *priv = win_index->parent->wdata;
456 const bool uncollapse = mutt_using_threads() && !window_is_focused(priv->win_index);
457
458 int index = find_next_undeleted(shared->mailbox_view, menu_get_index(menu), uncollapse);
459 if ((index < 0) || (index >= shared->mailbox->vcount))
460 {
461 // Selection failed
463 return false;
464 }
465
466 menu_set_index(menu, index);
467 return true;
468}
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:119
@ NT_INDEX_EMAIL
Email has changed.
Definition lib.h:80
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition menu.c:153
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition menu.c:167
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:101
Definition lib.h:86
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 4118 of file functions.c.

4119{
4121 ASSERT(mod_data);
4122
4123 return mod_data->md_index;
4124}
@ MODULE_ID_INDEX
ModuleIndex, Index
Definition module_api.h:73
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:666
#define ASSERT(COND)
Definition signal2.h:59
Index private Module data.
Definition module_data.h:32
struct MenuDefinition * md_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:
Here is the caller graph for this function:

◆ index_get_submenu()

struct SubMenu * index_get_submenu ( void )

Get the Index SubMenu.

Return values
ptrIndex SubMenu

Definition at line 355 of file functions.c.

356{
358 ASSERT(mod_data);
359
360 return mod_data->sm_index;
361}
struct SubMenu * sm_index
Index functions.
Definition module_data.h:35
Here is the call graph for this function:
Here is the caller graph for this function: