NeoMutt  2024-10-02-7-gd3e66a
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
lib.h
Go to the documentation of this file.
1
38#ifndef MUTT_BROWSER_LIB_H
39#define MUTT_BROWSER_LIB_H
40
41#include "config.h"
42#include <stdbool.h>
43#include <stdint.h>
44#include <sys/types.h>
45#include "mutt/lib.h"
46#include "complete/lib.h"
47
48struct Mailbox;
49struct Menu;
50struct MuttWindow;
51struct stat;
52
53extern struct Buffer LastDir;
54extern struct Buffer LastDirBackup;
55
56typedef uint8_t SelectFileFlags;
57#define MUTT_SEL_NO_FLAGS 0
58#define MUTT_SEL_MAILBOX (1 << 0)
59#define MUTT_SEL_MULTI (1 << 1)
60#define MUTT_SEL_FOLDER (1 << 2)
61
62extern const struct CompleteOps CompleteFileOps;
63extern const struct CompleteOps CompleteMailboxOps;
64
68struct Folder
69{
70 struct FolderFile *ff;
71 int num;
72};
73
78{
79 mode_t mode;
80 off_t size;
81 time_t mtime;
82 uid_t uid;
83 gid_t gid;
84 nlink_t nlink;
85
86 char *name;
87 char *desc;
88
92
93 char delim;
94
95 bool imap : 1;
96 bool selectable : 1;
97 bool inferiors : 1;
98 bool has_mailbox : 1;
99 bool local : 1;
100 bool notify_user : 1;
101 bool poll_new_mail : 1;
102 bool tagged : 1;
103 struct NntpMboxData *nd;
104
105 int gen;
106};
107
108ARRAY_HEAD(BrowserEntryArray, struct FolderFile);
109
116{
138};
139
144{
145 struct BrowserEntryArray entry;
147 char *folder;
149};
150
151void dlg_browser(struct Buffer *file, SelectFileFlags flags, struct Mailbox *m, char ***files, int *numfiles);
152void mutt_browser_select_dir(const char *f);
153void mutt_browser_cleanup(void);
154
155void browser_sort(struct BrowserState *state);
156void browser_add_folder(const struct Menu *menu, struct BrowserState *state, const char *name, const char *desc, const struct stat *st, struct Mailbox *m, void *data);
157void browser_highlight_default(struct BrowserState *state, struct Menu *menu);
158int examine_directory(struct Mailbox *m, struct Menu *menu, struct BrowserState *state, const char *d, const char *prefix);
159int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state);
160void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m, struct MuttWindow *sbar);
161void init_state(struct BrowserState *state, struct Menu *menu);
162bool link_is_dir(const char *folder, const char *path);
163void destroy_state(struct BrowserState *state);
164void dump_state(struct BrowserState *state);
165
166#endif /* MUTT_BROWSER_LIB_H */
#define ARRAY_HEAD(name, type)
Define a named struct for arrays of elements of a certain type.
Definition: array.h:47
void init_state(struct BrowserState *state, struct Menu *menu)
Initialise a browser state.
Definition: dlg_browser.c:688
void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m, struct MuttWindow *sbar)
Set up a new menu.
Definition: dlg_browser.c:1028
void browser_sort(struct BrowserState *state)
Sort the entries in the browser.
Definition: sort.c:186
ExpandoDataFolder
Expando UIDs for the File Browser.
Definition: lib.h:116
@ ED_FOL_POLL
FolderFile.poll_new_mail.
Definition: lib.h:134
@ ED_FOL_NOTIFY
FolderFile.notify_user.
Definition: lib.h:132
@ ED_FOL_NEW_COUNT
FolderFile.nd (NntpMboxData)
Definition: lib.h:130
@ ED_FOL_FILE_OWNER
FolderFile.uid.
Definition: lib.h:123
@ ED_FOL_FILE_GROUP
FolderFile.gid.
Definition: lib.h:121
@ ED_FOL_FILENAME
FolderFile.name.
Definition: lib.h:120
@ ED_FOL_DATE_FORMAT
FolderFile.mtime.
Definition: lib.h:118
@ ED_FOL_UNREAD_COUNT
FolderFile.msg_unread.
Definition: lib.h:137
@ ED_FOL_FLAGS2
FolderFile.nd (NntpMboxData)
Definition: lib.h:126
@ ED_FOL_FILE_MODE
FolderFile.move.
Definition: lib.h:122
@ ED_FOL_NEW_MAIL
FolderFile.has_new_mail.
Definition: lib.h:131
@ ED_FOL_FILE_SIZE
FolderFile.size.
Definition: lib.h:124
@ ED_FOL_HARD_LINKS
FolderFile.nlink.
Definition: lib.h:127
@ ED_FOL_DATE
FolderFile.mtime.
Definition: lib.h:117
@ ED_FOL_STRF
FolderFile.mtime.
Definition: lib.h:135
@ ED_FOL_TAGGED
FolderFile.tagged.
Definition: lib.h:136
@ ED_FOL_NUMBER
Folder.num.
Definition: lib.h:133
@ ED_FOL_DESCRIPTION
FolderFile.desc, FolderFile.name.
Definition: lib.h:119
@ ED_FOL_MESSAGE_COUNT
FolderFile.msg_count.
Definition: lib.h:128
@ ED_FOL_NEWSGROUP
FolderFile.name.
Definition: lib.h:129
@ ED_FOL_FLAGS
FolderFile.nd (NntpMboxData)
Definition: lib.h:125
const struct CompleteOps CompleteFileOps
Auto-Completion of Files.
Definition: complete.c:153
struct Buffer LastDir
Browser: previous selected directory.
Definition: dlg_browser.c:139
void mutt_browser_select_dir(const char *f)
Remember the last directory selected.
Definition: dlg_browser.c:1272
void destroy_state(struct BrowserState *state)
Free the BrowserState.
Definition: functions.c:137
struct Buffer LastDirBackup
Browser: backup copy of the current directory.
Definition: dlg_browser.c:141
const struct CompleteOps CompleteMailboxOps
Auto-Completion of Files / Mailboxes.
Definition: complete.c:160
int examine_directory(struct Mailbox *m, struct Menu *menu, struct BrowserState *state, const char *d, const char *prefix)
Get list of all files/newsgroups with mask.
Definition: dlg_browser.c:711
void browser_add_folder(const struct Menu *menu, struct BrowserState *state, const char *name, const char *desc, const struct stat *st, struct Mailbox *m, void *data)
Add a folder to the browser list.
Definition: dlg_browser.c:637
void mutt_browser_cleanup(void)
Clean up working Buffers.
Definition: dlg_browser.c:162
void browser_highlight_default(struct BrowserState *state, struct Menu *menu)
Decide which browser item should be highlighted.
Definition: dlg_browser.c:1002
void dump_state(struct BrowserState *state)
int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state)
Get list of mailboxes/subscribed newsgroups.
Definition: dlg_browser.c:838
uint8_t SelectFileFlags
Flags for mutt_select_file(), e.g. MUTT_SEL_MAILBOX.
Definition: lib.h:56
bool link_is_dir(const char *folder, const char *path)
Does this symlink point to a directory?
Definition: dlg_browser.c:175
Auto-completion.
void dlg_browser(struct Buffer *file, SelectFileFlags flags, struct Mailbox *m, char ***files, int *numfiles)
Let the user select a file -.
Definition: dlg_browser.c:1295
Convenience wrapper for the library headers.
State of the file/mailbox browser.
Definition: lib.h:144
char * folder
Folder name.
Definition: lib.h:147
bool is_mailbox_list
Viewing mailboxes.
Definition: lib.h:148
struct BrowserEntryArray entry
Array of files / dirs / mailboxes.
Definition: lib.h:145
bool imap_browse
IMAP folder.
Definition: lib.h:146
String manipulation buffer.
Definition: buffer.h:36
Browser entry representing a folder/dir.
Definition: lib.h:78
bool selectable
Folder can be selected.
Definition: lib.h:96
char delim
Path delimiter.
Definition: lib.h:93
bool imap
This is an IMAP folder.
Definition: lib.h:95
bool has_mailbox
This is a mailbox.
Definition: lib.h:98
char * name
Name of file/dir/mailbox.
Definition: lib.h:86
uid_t uid
File's User ID.
Definition: lib.h:82
bool tagged
Folder is tagged.
Definition: lib.h:102
gid_t gid
File's Group ID.
Definition: lib.h:83
bool has_new_mail
true if mailbox has "new mail"
Definition: lib.h:89
bool poll_new_mail
Check mailbox for new mail.
Definition: lib.h:101
bool notify_user
User will be notified of new mail.
Definition: lib.h:100
nlink_t nlink
Number of hard links.
Definition: lib.h:84
char * desc
Description of mailbox.
Definition: lib.h:87
struct NntpMboxData * nd
Extra NNTP data.
Definition: lib.h:103
off_t size
File size.
Definition: lib.h:80
int gen
Unique id, used for (un)sorting.
Definition: lib.h:105
time_t mtime
Modification time.
Definition: lib.h:81
int msg_count
total number of messages
Definition: lib.h:90
mode_t mode
File permissions.
Definition: lib.h:79
bool inferiors
Folder has children.
Definition: lib.h:97
int msg_unread
number of unread messages
Definition: lib.h:91
A folder/dir in the browser.
Definition: lib.h:69
int num
Number in the index.
Definition: lib.h:71
struct FolderFile * ff
File / Dir / Mailbox.
Definition: lib.h:70
A mailbox.
Definition: mailbox.h:79
Definition: lib.h:79
NNTP-specific Mailbox data -.
Definition: mdata.h:34