NeoMutt  2025-12-11-694-ga89709
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
private.h
Go to the documentation of this file.
1
22
23#ifndef MUTT_SIDEBAR_PRIVATE_H
24#define MUTT_SIDEBAR_PRIVATE_H
25
26#include <stdbool.h>
27#include "mutt/lib.h"
28#include "email/lib.h"
29#include "core/lib.h"
30
31struct IndexSharedData;
32struct MuttWindow;
33struct ParseContext;
34struct ParseError;
35
36extern struct ListHead SidebarPinned;
37
41struct SbEntry
42{
43 char box[256];
44 char display[256];
45 int depth;
46 struct Mailbox *mailbox;
47 bool is_hidden;
48 const struct AttrColor *color;
49 int score;
50};
51ARRAY_HEAD(SbEntryArray, struct SbEntry *);
52
77
86
107
108// sidebar.c
109void sb_add_mailbox (struct SidebarWindowData *wdata, struct Mailbox *m);
110void sb_remove_mailbox (struct SidebarWindowData *wdata, const struct Mailbox *m);
111void sb_set_current_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m);
112struct Mailbox *sb_get_highlight(struct MuttWindow *win);
113
114// commands.c
115enum CommandResult parse_sidebar_unpin(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe);
116enum CommandResult parse_sidebar_pin (const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe);
117
118// functions.c
119bool sb_next(struct SidebarWindowData *wdata);
120bool sb_prev(struct SidebarWindowData *wdata);
121
122// observer.c
124void sb_win_add_observers(struct MuttWindow *win);
125
126// sort.c
127void sb_sort_entries(struct SidebarWindowData *wdata, enum EmailSortType sort);
128
129// wdata.c
130void sb_wdata_free(struct MuttWindow *win, void **ptr);
133
134// window.c
135void sb_entry_set_display_name(struct SbEntry *entry);
136int sb_recalc(struct MuttWindow *win);
137int sb_repaint(struct MuttWindow *win);
138
139#endif /* MUTT_SIDEBAR_PRIVATE_H */
#define ARRAY_HEAD(name, T)
Define a named struct for arrays of elements of a certain type.
Definition array.h:47
CommandResult
Error codes for command_t parse functions.
Definition command.h:37
Convenience wrapper for the core headers.
Structs that make up an email.
EmailSortType
Methods for sorting Emails.
Definition sort.h:53
enum CommandResult parse_sidebar_pin(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'sidebar-pin' command - Implements Command::parse() -.
Definition commands.c:44
enum CommandResult parse_sidebar_unpin(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'sidebar-unpin' command - Implements Command::parse() -.
Definition commands.c:74
int sb_insertion_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition observer.c:485
int sb_recalc(struct MuttWindow *win)
Recalculate the Sidebar display - Implements MuttWindow::recalc() -.
Definition window.c:555
int sb_repaint(struct MuttWindow *win)
Repaint the Sidebar display - Implements MuttWindow::repaint() -.
Definition window.c:710
void sb_wdata_free(struct MuttWindow *win, void **ptr)
Free Sidebar Window data - Implements MuttWindow::wdata_free() -.
Definition wdata.c:56
Convenience wrapper for the library headers.
void sb_win_add_observers(struct MuttWindow *win)
Add Observers to the Sidebar Window.
Definition observer.c:442
DivType
Source of the sidebar divider character.
Definition private.h:82
@ SB_DIV_ASCII
An ASCII vertical bar (pipe)
Definition private.h:84
@ SB_DIV_USER
User configured using $sidebar_divider_char.
Definition private.h:83
void sb_sort_entries(struct SidebarWindowData *wdata, enum EmailSortType sort)
Sort the Sidebar entries.
Definition sort.c:161
void sb_remove_mailbox(struct SidebarWindowData *wdata, const struct Mailbox *m)
Remove a Mailbox from the Sidebar.
Definition sidebar.c:138
bool sb_prev(struct SidebarWindowData *wdata)
Find the previous unhidden Mailbox.
Definition functions.c:155
struct SidebarWindowData * sb_wdata_new(struct MuttWindow *win, struct IndexSharedData *shared)
Create new Window data for the Sidebar.
Definition wdata.c:44
void sb_set_current_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Set the current Mailbox.
Definition sidebar.c:191
struct ListHead SidebarPinned
List of mailboxes to always display in the sidebar.
Definition sidebar.c:44
void sb_entry_set_display_name(struct SbEntry *entry)
Set the display name for an SbEntry.
Definition window.c:305
ExpandoDataSidebar
Expando UIDs for the Sidebar.
Definition private.h:59
@ ED_SID_FLAGGED_COUNT
Mailbox.msg_flagged.
Definition private.h:63
@ ED_SID_FUZZY_SCORE
SbEntry.score.
Definition private.h:67
@ ED_SID_READ_COUNT
Mailbox.msg_count, Mailbox.msg_unread.
Definition private.h:72
@ ED_SID_DESCRIPTION
Mailbox.name.
Definition private.h:61
@ ED_SID_NEW_MAIL
Mailbox.has_new.
Definition private.h:68
@ ED_SID_UNSEEN_COUNT
Mailbox.msg_new.
Definition private.h:75
@ ED_SID_POLL
Mailbox.poll_new_mail.
Definition private.h:71
@ ED_SID_OLD_COUNT
Mailbox.msg_unread, Mailbox.msg_new.
Definition private.h:70
@ ED_SID_MESSAGE_COUNT
Mailbox.msg_count.
Definition private.h:65
@ ED_SID_LIMITED_COUNT
Mailbox.vcount.
Definition private.h:64
@ ED_SID_UNREAD_COUNT
Mailbox.msg_unread.
Definition private.h:74
@ ED_SID_TAGGED_COUNT
Mailbox.msg_tagged.
Definition private.h:73
@ ED_SID_NOTIFY
Mailbox.notify_user.
Definition private.h:69
@ ED_SID_NAME
SbEntry.box.
Definition private.h:66
@ ED_SID_DELETED_COUNT
Mailbox.msg_deleted.
Definition private.h:60
@ ED_SID_FLAGGED
Mailbox.msg_flagged.
Definition private.h:62
void sb_add_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Add a Mailbox to the Sidebar.
Definition sidebar.c:100
struct SidebarWindowData * sb_wdata_get(struct MuttWindow *win)
Get the Sidebar data for this window.
Definition wdata.c:77
bool sb_next(struct SidebarWindowData *wdata)
Find the next unhidden Mailbox.
Definition functions.c:116
struct Mailbox * sb_get_highlight(struct MuttWindow *win)
Get the Mailbox that's highlighted in the sidebar.
Definition sidebar.c:75
A curses colour and its attributes.
Definition attr.h:65
String manipulation buffer.
Definition buffer.h:36
Data shared between Index, Pager and Sidebar.
Definition shared_data.h:37
A mailbox.
Definition mailbox.h:78
Data passed to a notification function.
Definition observer.h:34
Context for config parsing (history/backtrace)
Definition pcontext.h:34
Detailed error information from config parsing.
Definition perror.h:34
Info about folders in the sidebar.
Definition private.h:42
const struct AttrColor * color
Colour to use.
Definition private.h:48
int depth
Indentation depth.
Definition private.h:45
int score
Fuzzy-match score.
Definition private.h:49
char display[256]
Formatted string to display.
Definition private.h:44
struct Mailbox * mailbox
Mailbox this represents.
Definition private.h:46
bool is_hidden
Don't show, e.g. $sidebar_new_mail_only.
Definition private.h:47
char box[256]
Mailbox path (possibly abbreviated)
Definition private.h:43
Sidebar private Window data -.
Definition private.h:91
short previous_sort
Old $sidebar_sort
Definition private.h:103
int top_index
First mailbox visible in sidebar.
Definition private.h:96
short divider_width
Width of the divider in screen columns.
Definition private.h:105
int bot_index
Last mailbox visible in sidebar.
Definition private.h:99
int hil_index
Highlighted mailbox.
Definition private.h:98
enum DivType divider_type
Type of divider to use, e.g. SB_DIV_ASCII.
Definition private.h:104
struct IndexSharedData * shared
Shared Index Data.
Definition private.h:93
int opn_index
Current (open) mailbox.
Definition private.h:97
bool search_active
Sidebar Search is running.
Definition private.h:101
struct MuttWindow * win
Sidebar Window.
Definition private.h:92
struct SbEntryArray entries
Items to display in the sidebar.
Definition private.h:94
bool repage
Force RECALC to recompute the paging used for the overlays.
Definition private.h:100