forked from neomutt/neomutt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
browser.h
109 lines (93 loc) · 2.7 KB
/
browser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/**
* @file
* GUI component for displaying/selecting items from a list
*
* @authors
* Copyright (C) 1996-2000 Michael R. Elkins <[email protected]>
*
* @copyright
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MUTT_BROWSER_H
#define MUTT_BROWSER_H
#include "config.h"
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>
#include <time.h>
struct Buffer;
/* These Config Variables are only used in browser.c */
extern bool C_BrowserAbbreviateMailboxes;
extern char *C_FolderFormat;
extern short C_SortBrowser;
typedef uint8_t SelectFileFlags; ///< Flags for mutt_select_file(), e.g. #MUTT_SEL_MAILBOX
#define MUTT_SEL_NO_FLAGS 0 ///< No flags are set
#define MUTT_SEL_MAILBOX (1 << 0) ///< Select a mailbox
#define MUTT_SEL_MULTI (1 << 1) ///< Multi-selection is enabled
#define MUTT_SEL_FOLDER (1 << 2) ///< Select a local directory
/**
* struct Folder - A folder/dir in the browser
*/
struct Folder
{
struct FolderFile *ff;
int num;
};
/**
* struct FolderFile - Browser entry representing a folder/dir
*/
struct FolderFile
{
mode_t mode;
off_t size;
time_t mtime;
uid_t uid;
gid_t gid;
nlink_t nlink;
char *name;
char *desc;
bool has_new_mail; ///< true if mailbox has "new mail"
int msg_count; ///< total number of messages
int msg_unread; ///< number of unread messages
#ifdef USE_IMAP
char delim;
bool imap : 1;
bool selectable : 1;
bool inferiors : 1;
#endif
bool has_mailbox : 1;
bool local : 1; ///< folder is on local filesystem
bool tagged : 1;
#ifdef USE_NNTP
struct NntpMboxData *nd;
#endif
int gen;
};
ARRAY_HEAD(BrowserStateEntry, struct FolderFile);
/**
* struct BrowserState - State of the file/mailbox browser
*/
struct BrowserState
{
struct BrowserStateEntry entry;
#ifdef USE_IMAP
bool imap_browse;
char *folder;
#endif
};
void mutt_select_file(char *file, size_t filelen, SelectFileFlags flags, char ***files, int *numfiles);
void mutt_buffer_select_file(struct Buffer *f, SelectFileFlags flags, char ***files, int *numfiles);
void mutt_browser_select_dir(const char *f);
void mutt_browser_cleanup(void);
#endif /* MUTT_BROWSER_H */