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