NeoMutt  2022-04-29-323-g5fcc6c
Teaching an old dog new tricks
DOXYGEN
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 SidebarWhitelist;
36
40struct SbEntry
41{
42 char box[256];
43 char display[256];
44 int depth;
45 struct Mailbox *mailbox;
46 bool is_hidden;
47 struct AttrColor *color;
48};
49ARRAY_HEAD(SbEntryArray, struct SbEntry *);
50
55{
59};
60
65{
66 struct MuttWindow *win;
68 struct SbEntryArray entries;
69
74
78};
79
80// sidebar.c
81void sb_add_mailbox (struct SidebarWindowData *wdata, struct Mailbox *m);
82void sb_remove_mailbox (struct SidebarWindowData *wdata, const struct Mailbox *m);
83void sb_set_current_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m);
84struct Mailbox *sb_get_highlight(struct MuttWindow *win);
85
86// commands.c
87enum CommandResult sb_parse_unwhitelist(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
88enum CommandResult sb_parse_whitelist (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
89
90// functions.c
91bool sb_next(struct SidebarWindowData *wdata);
92bool sb_prev(struct SidebarWindowData *wdata);
93
94// observer.c
96void sb_win_add_observers(struct MuttWindow *win);
97
98// sort.c
99void sb_sort_entries(struct SidebarWindowData *wdata, enum SortType sort);
100
101// wdata.c
102void sb_wdata_free(struct MuttWindow *win, void **ptr);
105
106// window.c
107int sb_recalc(struct MuttWindow *win);
108int sb_repaint(struct MuttWindow *win);
109
110#endif /* MUTT_SIDEBAR_PRIVATE_H */
CommandResult
Error codes for command_t parse functions.
Definition: command.h:34
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
enum CommandResult sb_parse_whitelist(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'sidebar_whitelist' command - Implements Command::parse() -.
Definition: commands.c:41
enum CommandResult sb_parse_unwhitelist(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'unsidebar_whitelist' 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:471
int sb_recalc(struct MuttWindow *win)
Recalculate the Sidebar display - Implements MuttWindow::recalc() -.
Definition: window.c:711
int sb_repaint(struct MuttWindow *win)
Repaint the Sidebar display - Implements MuttWindow::repaint() -.
Definition: window.c:897
void sb_wdata_free(struct MuttWindow *win, void **ptr)
Free Sidebar Window data - Implements MuttWindow::wdata_free() -.
Definition: wdata.c:55
Convenience wrapper for the library headers.
void sb_win_add_observers(struct MuttWindow *win)
Add Observers to the Sidebar Window.
Definition: observer.c:432
DivType
Source of the sidebar divider character.
Definition: private.h:55
@ SB_DIV_ASCII
An ASCII vertical bar (pipe)
Definition: private.h:57
@ SB_DIV_USER
User configured using $sidebar_divider_char.
Definition: private.h:56
@ SB_DIV_UTF8
A unicode line-drawing character.
Definition: private.h:58
void sb_remove_mailbox(struct SidebarWindowData *wdata, const struct Mailbox *m)
Remove a Mailbox from the Sidebar.
Definition: sidebar.c:120
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:43
void sb_set_current_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Set the current Mailbox.
Definition: sidebar.c:173
ARRAY_HEAD(SbEntryArray, struct SbEntry *)
struct ListHead SidebarWhitelist
List of mailboxes to always display in the sidebar.
Definition: sidebar.c:44
void sb_add_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m)
Add a Mailbox to the Sidebar.
Definition: sidebar.c:83
void sb_sort_entries(struct SidebarWindowData *wdata, enum SortType sort)
Sort the Sidebar entries.
Definition: sort.c:177
struct SidebarWindowData * sb_wdata_get(struct MuttWindow *win)
Get the Sidebar data for this window.
Definition: wdata.c:73
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:58
SortType
Methods for sorting.
Definition: sort2.h:42
A curses colour and its attributes.
Definition: attr.h:35
String manipulation buffer.
Definition: buffer.h:34
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
int depth
Indentation depth.
Definition: private.h:44
char display[256]
Formatted string to display.
Definition: private.h:43
struct AttrColor * color
Colour to use.
Definition: private.h:47
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:65
short previous_sort
Old $sidebar_sort_method
Definition: private.h:75
int top_index
First mailbox visible in sidebar.
Definition: private.h:70
short divider_width
Width of the divider in screen columns.
Definition: private.h:77
int bot_index
Last mailbox visible in sidebar.
Definition: private.h:73
int hil_index
Highlighted mailbox.
Definition: private.h:72
enum DivType divider_type
Type of divider to use, e.g. SB_DIV_ASCII.
Definition: private.h:76
struct IndexSharedData * shared
Shared Index Data.
Definition: private.h:67
int opn_index
Current (open) mailbox.
Definition: private.h:71
struct MuttWindow * win
Sidebar Window.
Definition: private.h:66
struct SbEntryArray entries
Items to display in the sidebar.
Definition: private.h:68