NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
private.h
Go to the documentation of this file.
1
23#ifndef MUTT_SIDEBAR_PRIVATE_H
24#define MUTT_SIDEBAR_PRIVATE_H
25
26#include <stdbool.h>
27#include <stdint.h>
28#include "mutt/lib.h"
29#include "config/lib.h"
30#include "core/lib.h"
31
32struct IndexSharedData;
33struct MuttWindow;
34
35extern struct ListHead SidebarPinned;
36
40struct SbEntry
41{
42 char box[256];
43 char display[256];
44 int depth;
45 struct Mailbox *mailbox;
46 bool is_hidden;
47 const struct AttrColor *color;
48};
49ARRAY_HEAD(SbEntryArray, struct SbEntry *);
50
57{
73};
74
79{
82};
83
88{
89 struct MuttWindow *win;
91 struct SbEntryArray entries;
92
97
101};
102
103// sidebar.c
104void sb_add_mailbox (struct SidebarWindowData *wdata, struct Mailbox *m);
105void sb_remove_mailbox (struct SidebarWindowData *wdata, const struct Mailbox *m);
106void sb_set_current_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m);
107struct Mailbox *sb_get_highlight(struct MuttWindow *win);
108
109// commands.c
110enum CommandResult sb_parse_sidebar_unpin(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
111enum CommandResult sb_parse_sidebar_pin (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
112
113// functions.c
114bool sb_next(struct SidebarWindowData *wdata);
115bool sb_prev(struct SidebarWindowData *wdata);
116
117// observer.c
119void sb_win_add_observers(struct MuttWindow *win);
120
121// sort.c
122void sb_sort_entries(struct SidebarWindowData *wdata, enum SortType sort);
123
124// wdata.c
125void sb_wdata_free(struct MuttWindow *win, void **ptr);
128
129// window.c
130int sb_recalc(struct MuttWindow *win);
131int sb_repaint(struct MuttWindow *win);
132
133#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:36
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
enum CommandResult sb_parse_sidebar_pin(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'sidebar_pin' command - Implements Command::parse() -.
Definition: commands.c:41
enum CommandResult sb_parse_sidebar_unpin(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'sidebar_unpin' command - Implements Command::parse() -.
Definition: commands.c:60
int sb_insertion_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: observer.c:466
int sb_recalc(struct MuttWindow *win)
Recalculate the Sidebar display - Implements MuttWindow::recalc() -.
Definition: window.c:777
int sb_repaint(struct MuttWindow *win)
Repaint the Sidebar display - Implements MuttWindow::repaint() -.
Definition: window.c:966
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:427
DivType
Source of the sidebar divider character.
Definition: private.h:79
@ SB_DIV_ASCII
An ASCII vertical bar (pipe)
Definition: private.h:81
@ SB_DIV_USER
User configured using $sidebar_divider_char.
Definition: private.h:80
void sb_remove_mailbox(struct SidebarWindowData *wdata, const struct Mailbox *m)
Remove a Mailbox from the Sidebar.
Definition: sidebar.c:125
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:178
struct ListHead SidebarPinned
List of mailboxes to always display in the sidebar.
Definition: sidebar.c:43
ExpandoDataSidebar
Expando UIDs for the Sidebar.
Definition: private.h:57
@ ED_SID_FLAGGED_COUNT
Mailbox.msg_flagged.
Definition: private.h:61
@ ED_SID_READ_COUNT
Mailbox.msg_count, Mailbox.msg_unread.
Definition: private.h:69
@ ED_SID_DESCRIPTION
Mailbox.name.
Definition: private.h:59
@ ED_SID_NEW_MAIL
Mailbox.has_new.
Definition: private.h:65
@ ED_SID_UNSEEN_COUNT
Mailbox.msg_new.
Definition: private.h:72
@ ED_SID_POLL
Mailbox.poll_new_mail.
Definition: private.h:68
@ ED_SID_OLD_COUNT
Mailbox.msg_unread, Mailbox.msg_new.
Definition: private.h:67
@ ED_SID_MESSAGE_COUNT
Mailbox.msg_count.
Definition: private.h:63
@ ED_SID_LIMITED_COUNT
Mailbox.vcount.
Definition: private.h:62
@ ED_SID_UNREAD_COUNT
Mailbox.msg_unread.
Definition: private.h:71
@ ED_SID_TAGGED_COUNT
Mailbox.msg_tagged.
Definition: private.h:70
@ ED_SID_NOTIFY
Mailbox.notify_user.
Definition: private.h:66
@ ED_SID_NAME
SbEntry.box.
Definition: private.h:64
@ ED_SID_DELETED_COUNT
Mailbox.msg_deleted.
Definition: private.h:58
@ ED_SID_FLAGGED
Mailbox.msg_flagged.
Definition: private.h:60
void sb_add_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Add a Mailbox to the Sidebar.
Definition: sidebar.c:88
void sb_sort_entries(struct SidebarWindowData *wdata, enum SortType sort)
Sort the Sidebar entries.
Definition: sort.c:171
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:63
SortType
Methods for sorting.
Definition: sort2.h:34
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:41
const struct AttrColor * color
Colour to use.
Definition: private.h:47
int depth
Indentation depth.
Definition: private.h:44
char display[256]
Formatted string to display.
Definition: private.h:43
struct Mailbox * mailbox
Mailbox this represents.
Definition: private.h:45
bool is_hidden
Don't show, e.g. $sidebar_new_mail_only.
Definition: private.h:46
char box[256]
Mailbox path (possibly abbreviated)
Definition: private.h:42
Sidebar private Window data -.
Definition: private.h:88
short previous_sort
Old $sidebar_sort_method
Definition: private.h:98
int top_index
First mailbox visible in sidebar.
Definition: private.h:93
short divider_width
Width of the divider in screen columns.
Definition: private.h:100
int bot_index
Last mailbox visible in sidebar.
Definition: private.h:96
int hil_index
Highlighted mailbox.
Definition: private.h:95
enum DivType divider_type
Type of divider to use, e.g. SB_DIV_ASCII.
Definition: private.h:99
struct IndexSharedData * shared
Shared Index Data.
Definition: private.h:90
int opn_index
Current (open) mailbox.
Definition: private.h:94
struct MuttWindow * win
Sidebar Window.
Definition: private.h:89
struct SbEntryArray entries
Items to display in the sidebar.
Definition: private.h:91