NeoMutt  2024-04-16-36-g75b6fb
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  IndexFunction
 A NeoMutt function. More...
 

Typedefs

typedef int(* index_function_t) (struct IndexSharedData *shared, struct IndexPrivateData *priv, int op)
 

Functions

int index_function_dispatcher (struct MuttWindow *win, int op)
 Perform an Index function - Implements function_dispatcher_t -.
 
bool index_next_undeleted (struct MuttWindow *win_index)
 Select the next undeleted Email (if possible)
 

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 IndexSharedData *shared, struct IndexPrivateData *priv, int op)

Definition at line 43 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 394 of file functions.c.

395{
396 struct MuttWindow *dlg = dialog_find(win_index);
397 if (!dlg)
398 return false;
399
400 struct Menu *menu = win_index->wdata;
401 struct IndexSharedData *shared = dlg->wdata;
402 if (!shared)
403 return false;
404
405 struct IndexPrivateData *priv = win_index->parent->wdata;
406 const bool uncollapse = mutt_using_threads() && !window_is_focused(priv->win_index);
407
408 int index = find_next_undeleted(shared->mailbox_view, menu_get_index(menu), uncollapse);
409 if ((index < 0) || (index >= shared->mailbox->vcount))
410 {
411 // Selection failed
413 return false;
414 }
415
416 menu_set_index(menu, index);
417 return true;
418}
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:243
#define NT_INDEX_EMAIL
Email has changed.
Definition: lib.h:65
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
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
#define mutt_using_threads()
Definition: mutt_thread.h:114
bool window_is_focused(const struct MuttWindow *win)
Does the given Window have the focus?
Definition: mutt_window.c:654
@ NT_INDEX
Index data has changed, NotifyIndex, IndexSharedData.
Definition: notify_type.h:48
Private state data for the Index.
Definition: private_data.h:35
struct MuttWindow * win_index
Window for the Index.
Definition: private_data.h:42
struct IndexSharedData * shared
Shared Index data.
Definition: private_data.h:40
struct Menu * menu
Menu controlling the index.
Definition: private_data.h:41
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:99
Definition: lib.h:79
void * wdata
Private data.
Definition: mutt_window.h:145
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:135
+ Here is the call graph for this function:
+ Here is the caller graph for this function: