NeoMutt  2025-12-11-58-g09398d
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;
33
34extern struct ListHead SidebarPinned;
35
39struct SbEntry
40{
41 char box[256];
42 char display[256];
43 int depth;
44 struct Mailbox *mailbox;
45 bool is_hidden;
46 const struct AttrColor *color;
47};
48ARRAY_HEAD(SbEntryArray, struct SbEntry *);
49
73
82
87{
88 struct MuttWindow *win;
90 struct SbEntryArray entries;
91
96
100};
101
102// sidebar.c
103void sb_add_mailbox (struct SidebarWindowData *wdata, struct Mailbox *m);
104void sb_remove_mailbox (struct SidebarWindowData *wdata, const struct Mailbox *m);
105void sb_set_current_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m);
106struct Mailbox *sb_get_highlight(struct MuttWindow *win);
107
108// commands.c
109enum CommandResult parse_sidebar_unpin(const struct Command *cmd, struct Buffer *line, struct Buffer *err);
110enum CommandResult parse_sidebar_pin (const struct Command *cmd, struct Buffer *line, struct Buffer *err);
111
112// functions.c
113bool sb_next(struct SidebarWindowData *wdata);
114bool sb_prev(struct SidebarWindowData *wdata);
115
116// observer.c
118void sb_win_add_observers(struct MuttWindow *win);
119
120// sort.c
121void sb_sort_entries(struct SidebarWindowData *wdata, enum EmailSortType sort);
122
123// wdata.c
124void sb_wdata_free(struct MuttWindow *win, void **ptr);
127
128// window.c
129int sb_recalc(struct MuttWindow *win);
130int sb_repaint(struct MuttWindow *win);
131
132#endif /* MUTT_SIDEBAR_PRIVATE_H */
#define ARRAY_HEAD(name, type)
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:35
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_unpin(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'sidebar_unpin' command - Implements Command::parse() -.
Definition commands.c:71
enum CommandResult parse_sidebar_pin(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'sidebar_pin' command - Implements Command::parse() -.
Definition commands.c:43
int sb_insertion_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition observer.c:474
int sb_recalc(struct MuttWindow *win)
Recalculate the Sidebar display - Implements MuttWindow::recalc() -.
Definition window.c:505
int sb_repaint(struct MuttWindow *win)
Repaint the Sidebar display - Implements MuttWindow::repaint() -.
Definition window.c:695
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:435
DivType
Source of the sidebar divider character.
Definition private.h:78
@ SB_DIV_ASCII
An ASCII vertical bar (pipe)
Definition private.h:80
@ SB_DIV_USER
User configured using $sidebar_divider_char.
Definition private.h:79
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:135
bool sb_prev(struct SidebarWindowData *wdata)
Find the previous unhidden Mailbox.
Definition functions.c:86
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:188
struct ListHead SidebarPinned
List of mailboxes to always display in the sidebar.
Definition sidebar.c:44
ExpandoDataSidebar
Expando UIDs for the Sidebar.
Definition private.h:56
@ ED_SID_FLAGGED_COUNT
Mailbox.msg_flagged.
Definition private.h:60
@ ED_SID_READ_COUNT
Mailbox.msg_count, Mailbox.msg_unread.
Definition private.h:68
@ ED_SID_DESCRIPTION
Mailbox.name.
Definition private.h:58
@ ED_SID_NEW_MAIL
Mailbox.has_new.
Definition private.h:64
@ ED_SID_UNSEEN_COUNT
Mailbox.msg_new.
Definition private.h:71
@ ED_SID_POLL
Mailbox.poll_new_mail.
Definition private.h:67
@ ED_SID_OLD_COUNT
Mailbox.msg_unread, Mailbox.msg_new.
Definition private.h:66
@ ED_SID_MESSAGE_COUNT
Mailbox.msg_count.
Definition private.h:62
@ ED_SID_LIMITED_COUNT
Mailbox.vcount.
Definition private.h:61
@ ED_SID_UNREAD_COUNT
Mailbox.msg_unread.
Definition private.h:70
@ ED_SID_TAGGED_COUNT
Mailbox.msg_tagged.
Definition private.h:69
@ ED_SID_NOTIFY
Mailbox.notify_user.
Definition private.h:65
@ ED_SID_NAME
SbEntry.box.
Definition private.h:63
@ ED_SID_DELETED_COUNT
Mailbox.msg_deleted.
Definition private.h:57
@ ED_SID_FLAGGED
Mailbox.msg_flagged.
Definition private.h:59
void sb_add_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Add a Mailbox to the Sidebar.
Definition sidebar.c:98
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:47
struct Mailbox * sb_get_highlight(struct MuttWindow *win)
Get the Mailbox that's highlighted in the sidebar.
Definition sidebar.c:73
A curses colour and its attributes.
Definition attr.h:66
String manipulation buffer.
Definition buffer.h:36
Data shared between Index, Pager and Sidebar.
Definition shared_data.h:37
A mailbox.
Definition mailbox.h:79
Data passed to a notification function.
Definition observer.h:34
Info about folders in the sidebar.
Definition private.h:40
const struct AttrColor * color
Colour to use.
Definition private.h:46
int depth
Indentation depth.
Definition private.h:43
char display[256]
Formatted string to display.
Definition private.h:42
struct Mailbox * mailbox
Mailbox this represents.
Definition private.h:44
bool is_hidden
Don't show, e.g. $sidebar_new_mail_only.
Definition private.h:45
char box[256]
Mailbox path (possibly abbreviated)
Definition private.h:41
Sidebar private Window data -.
Definition private.h:87
short previous_sort
Old $sidebar_sort
Definition private.h:97
int top_index
First mailbox visible in sidebar.
Definition private.h:92
short divider_width
Width of the divider in screen columns.
Definition private.h:99
int bot_index
Last mailbox visible in sidebar.
Definition private.h:95
int hil_index
Highlighted mailbox.
Definition private.h:94
enum DivType divider_type
Type of divider to use, e.g. SB_DIV_ASCII.
Definition private.h:98
struct IndexSharedData * shared
Shared Index Data.
Definition private.h:89
int opn_index
Current (open) mailbox.
Definition private.h:93
struct MuttWindow * win
Sidebar Window.
Definition private.h:88
struct SbEntryArray entries
Items to display in the sidebar.
Definition private.h:90