NeoMutt  2023-05-17-33-gce4425
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 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 struct AttrColor *color;
48};
49ARRAY_HEAD(SbEntryArray, struct SbEntry *);
50
55{
58};
59
64{
65 struct MuttWindow *win;
67 struct SbEntryArray entries;
68
73
77};
78
79// sidebar.c
80void sb_add_mailbox (struct SidebarWindowData *wdata, struct Mailbox *m);
81void sb_remove_mailbox (struct SidebarWindowData *wdata, const struct Mailbox *m);
82void sb_set_current_mailbox(struct SidebarWindowData *wdata, struct Mailbox *m);
83struct Mailbox *sb_get_highlight(struct MuttWindow *win);
84
85// commands.c
86enum CommandResult sb_parse_sidebar_unpin(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
87enum CommandResult sb_parse_sidebar_pin (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
88
89// functions.c
90bool sb_next(struct SidebarWindowData *wdata);
91bool sb_prev(struct SidebarWindowData *wdata);
92
93// observer.c
95void sb_win_add_observers(struct MuttWindow *win);
96
97// sort.c
98void sb_sort_entries(struct SidebarWindowData *wdata, enum SortType sort);
99
100// wdata.c
101void sb_wdata_free(struct MuttWindow *win, void **ptr);
104
105// window.c
106int sb_recalc(struct MuttWindow *win);
107int sb_repaint(struct MuttWindow *win);
108
109#endif /* MUTT_SIDEBAR_PRIVATE_H */
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:40
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:59
int sb_insertion_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: observer.c:464
int sb_recalc(struct MuttWindow *win)
Recalculate the Sidebar display - Implements MuttWindow::recalc() -.
Definition: window.c:742
int sb_repaint(struct MuttWindow *win)
Repaint the Sidebar display - Implements MuttWindow::repaint() -.
Definition: window.c:931
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:425
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
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:43
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
ARRAY_HEAD(SbEntryArray, struct SbEntry *)
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: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:63
SortType
Methods for sorting.
Definition: sort2.h:38
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:64
short previous_sort
Old $sidebar_sort_method
Definition: private.h:74
int top_index
First mailbox visible in sidebar.
Definition: private.h:69
short divider_width
Width of the divider in screen columns.
Definition: private.h:76
int bot_index
Last mailbox visible in sidebar.
Definition: private.h:72
int hil_index
Highlighted mailbox.
Definition: private.h:71
enum DivType divider_type
Type of divider to use, e.g. SB_DIV_ASCII.
Definition: private.h:75
struct IndexSharedData * shared
Shared Index Data.
Definition: private.h:66
int opn_index
Current (open) mailbox.
Definition: private.h:70
struct MuttWindow * win
Sidebar Window.
Definition: private.h:65
struct SbEntryArray entries
Items to display in the sidebar.
Definition: private.h:67