GUI manage the main index (list of emails) More...
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "mutt/lib.h"
#include "core/lib.h"
#include "expando/lib.h"
#include "expando_index.h"
#include "functions.h"
#include "shared_data.h"
#include "status.h"
Go to the source code of this file.
Macros | |
#define | NT_INDEX_NO_FLAGS 0 |
No flags are set. | |
#define | NT_INDEX_ADD (1 << 0) |
New Index Shared Data has been created. | |
#define | NT_INDEX_DELETE (1 << 1) |
Index Shared Data is about to be freed. | |
#define | NT_INDEX_SUBSET (1 << 2) |
Config Subset has changed. | |
#define | NT_INDEX_ACCOUNT (1 << 3) |
Account has changed. | |
#define | NT_INDEX_MVIEW (1 << 4) |
MailboxView has changed. | |
#define | NT_INDEX_MAILBOX (1 << 5) |
Mailbox has changed. | |
#define | NT_INDEX_EMAIL (1 << 6) |
Email has changed. | |
#define | CHECK_NO_FLAGS 0 |
No flags are set. | |
#define | CHECK_IN_MAILBOX (1 << 0) |
Is there a mailbox open? | |
#define | CHECK_MSGCOUNT (1 << 1) |
Are there any messages? | |
#define | CHECK_VISIBLE (1 << 2) |
Is the selected message visible in the index? | |
#define | CHECK_READONLY (1 << 3) |
Is the mailbox readonly? | |
#define | CHECK_ATTACH (1 << 4) |
Is the user in message-attach mode? | |
Typedefs | |
typedef uint8_t | NotifyIndex |
Flags, e.g. NT_INDEX_ACCOUNT. | |
typedef uint8_t | CheckFlags |
Flags, e.g. CHECK_IN_MAILBOX. | |
Functions | |
void | change_folder_mailbox (struct Menu *menu, struct Mailbox *m, int *oldcount, struct IndexSharedData *shared, bool read_only) |
Change to a different Mailbox by pointer. | |
struct Mailbox * | change_folder_notmuch (struct Menu *menu, char *buf, int buflen, int *oldcount, struct IndexSharedData *shared, bool read_only) |
Change to a different Notmuch Mailbox by string. | |
void | change_folder_string (struct Menu *menu, struct Buffer *buf, int *oldcount, struct IndexSharedData *shared, bool read_only) |
Change to a different Mailbox by string. | |
bool | check_acl (struct Mailbox *m, AclFlags acl, const char *msg) |
Check the ACLs for a function. | |
void | collapse_all (struct MailboxView *mv, struct Menu *menu, int toggle) |
Collapse/uncollapse all threads. | |
struct Mailbox * | dlg_index (struct MuttWindow *dlg, struct Mailbox *m) |
Display a list of emails -. | |
int | find_first_message (struct MailboxView *mv) |
Get index of first new message. | |
int | find_next_undeleted (struct MailboxView *mv, int msgno, bool uncollapse) |
Find the next undeleted email. | |
int | find_previous_undeleted (struct MailboxView *mv, int msgno, bool uncollapse) |
Find the previous undeleted email. | |
struct Mailbox * | get_current_mailbox (void) |
Get the current Mailbox. | |
struct MailboxView * | get_current_mailbox_view (void) |
Get the current Mailbox view. | |
struct Menu * | get_current_menu (void) |
Get the current Menu. | |
void | index_change_folder (struct MuttWindow *dlg, struct Mailbox *m) |
Change the current folder, cautiously. | |
const struct AttrColor * | index_color (struct Menu *menu, int line) |
Calculate the colour for a line of the index - Implements Menu::color() -. | |
int | index_make_entry (struct Menu *menu, int line, int max_cols, struct Buffer *buf) |
Format an Email for the Menu - Implements Menu::make_entry() -. | |
struct MuttWindow * | index_pager_init (void) |
Allocate the Windows for the Index/Pager. | |
int | mutt_dlgindex_observer (struct NotifyCallback *nc) |
void | mutt_draw_statusline (struct MuttWindow *win, int max_cols, const char *buf, size_t buflen) |
Draw a highlighted status bar. | |
void | email_set_color (struct Mailbox *m, struct Email *e) |
Select an Index colour for an Email. | |
void | resort_index (struct MailboxView *mv, struct Menu *menu) |
Resort the index. | |
void | update_index (struct Menu *menu, struct MailboxView *mv, enum MxStatus check, int oldcount, const struct IndexSharedData *shared) |
Update the index. | |
int | mutt_make_string (struct Buffer *buf, size_t max_cols, const struct Expando *exp, struct Mailbox *m, int inpgr, struct Email *e, MuttFormatFlags flags, const char *progress) |
Create formatted strings using mailbox expandos. | |
Variables | |
const struct Mapping | IndexNewsHelp [] |
Help Bar for the News Index dialog. | |
const struct ExpandoDefinition | StatusFormatDef [] |
Expando definitions. | |
GUI manage the main index (list of emails)
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/.
Definition in file lib.h.
#define NT_INDEX_ADD (1 << 0) |
#define NT_INDEX_DELETE (1 << 1) |
#define NT_INDEX_MVIEW (1 << 4) |
MailboxView has changed.
#define CHECK_VISIBLE (1 << 2) |
#define CHECK_ATTACH (1 << 4) |
typedef uint8_t NotifyIndex |
Flags, e.g. NT_INDEX_ACCOUNT.
typedef uint8_t CheckFlags |
Flags, e.g. CHECK_IN_MAILBOX.
void change_folder_mailbox | ( | struct Menu * | menu, |
struct Mailbox * | m, | ||
int * | oldcount, | ||
struct IndexSharedData * | shared, | ||
bool | read_only | ||
) |
Change to a different Mailbox by pointer.
menu | Current Menu |
m | Mailbox |
oldcount | How many items are currently in the index |
shared | Shared Index data |
read_only | Open Mailbox in read-only mode |
Definition at line 611 of file dlg_index.c.
struct Mailbox * change_folder_notmuch | ( | struct Menu * | menu, |
char * | buf, | ||
int | buflen, | ||
int * | oldcount, | ||
struct IndexSharedData * | shared, | ||
bool | read_only | ||
) |
Change to a different Notmuch Mailbox by string.
menu | Current Menu |
buf | Folder to change to |
buflen | Length of buffer |
oldcount | How many items are currently in the index |
shared | Shared Index data |
read_only | Open Mailbox in read-only mode |
ptr | Mailbox |
Definition at line 732 of file dlg_index.c.
void change_folder_string | ( | struct Menu * | menu, |
struct Buffer * | buf, | ||
int * | oldcount, | ||
struct IndexSharedData * | shared, | ||
bool | read_only | ||
) |
Change to a different Mailbox by string.
menu | Current Menu |
buf | Folder to change to |
oldcount | How many items are currently in the index |
shared | Shared Index data |
read_only | Open Mailbox in read-only mode |
Definition at line 757 of file dlg_index.c.
Check the ACLs for a function.
true | The function is permitted |
Definition at line 138 of file dlg_index.c.
void collapse_all | ( | struct MailboxView * | mv, |
struct Menu * | menu, | ||
int | toggle | ||
) |
Collapse/uncollapse all threads.
mv | Mailbox View |
menu | current menu |
toggle | toggle collapsed state |
This function is called by the OP_MAIN_COLLAPSE_ALL command and on folder enter if the $collapse_all
option is set. In the first case, the toggle parameter is 1 to actually toggle collapsed/uncollapsed state on all threads. In the second case, the toggle parameter is 0, actually turning this function into a one-way collapse.
Definition at line 165 of file dlg_index.c.
int find_first_message | ( | struct MailboxView * | mv | ) |
Get index of first new message.
mv | Mailbox view |
num | Index of first new message |
Return the index of the first new message, or failing that, the first unread message.
Definition at line 309 of file dlg_index.c.
int find_next_undeleted | ( | struct MailboxView * | mv, |
int | msgno, | ||
bool | uncollapse | ||
) |
Find the next undeleted email.
>=0 | Message number of next undeleted email |
-1 | No more undeleted messages |
Definition at line 241 of file dlg_index.c.
int find_previous_undeleted | ( | struct MailboxView * | mv, |
int | msgno, | ||
bool | uncollapse | ||
) |
Find the previous undeleted email.
>=0 | Message number of next undeleted email |
-1 | No more undeleted messages |
Definition at line 275 of file dlg_index.c.
struct Mailbox * get_current_mailbox | ( | void | ) |
Get the current Mailbox.
ptr | Current Mailbox |
Search for the last (most recent) dialog that has an Index. Then return the Mailbox from its shared data.
Definition at line 715 of file index.c.
struct MailboxView * get_current_mailbox_view | ( | void | ) |
Get the current Mailbox view.
ptr | Current Mailbox view |
Search for the last (most recent) dialog that has an Index. Then return the Mailbox from its shared data.
Definition at line 683 of file index.c.
struct Menu * get_current_menu | ( | void | ) |
Get the current Menu.
ptr | Current Menu |
Search for the last (most recent) dialog that has an Index. Then return the Menu from its private data.
Definition at line 731 of file index.c.
void index_change_folder | ( | struct MuttWindow * | dlg, |
struct Mailbox * | m | ||
) |
Change the current folder, cautiously.
dlg | Dialog holding the Index |
m | Mailbox to change to |
Definition at line 1464 of file dlg_index.c.
struct MuttWindow * index_pager_init | ( | void | ) |
Allocate the Windows for the Index/Pager.
ptr | Dialog containing nested Windows |
Definition at line 1436 of file dlg_index.c.
int mutt_dlgindex_observer | ( | struct NotifyCallback * | nc | ) |
void mutt_draw_statusline | ( | struct MuttWindow * | win, |
int | max_cols, | ||
const char * | buf, | ||
size_t | buflen | ||
) |
Draw a highlighted status bar.
win | Window |
max_cols | Maximum number of screen columns |
buf | Message to be displayed |
buflen | Length of the buffer |
Users configure the highlighting of the status bar, e.g. color status red default "[0-9][0-9]:[0-9][0-9]"
Where regexes overlap, the one nearest the start will be used. If two regexes start at the same place, the longer match will be used.
Colours of the status bar
< First character of that colour
< Last character of that colour
Definition at line 958 of file dlg_index.c.
Select an Index colour for an Email.
Calculate the colour for an Email in the Index. Cache the colour in the Email.
Definition at line 1405 of file dlg_index.c.
void resort_index | ( | struct MailboxView * | mv, |
struct Menu * | menu | ||
) |
Resort the index.
Definition at line 369 of file dlg_index.c.
void update_index | ( | struct Menu * | menu, |
struct MailboxView * | mv, | ||
enum MxStatus | check, | ||
int | oldcount, | ||
const struct IndexSharedData * | shared | ||
) |
Update the index.
menu | Current Menu |
mv | Mailbox |
check | Flags, e.g. MX_STATUS_REOPENED |
oldcount | How many items are currently in the index |
shared | Shared Index data |
Definition at line 542 of file dlg_index.c.
int mutt_make_string | ( | struct Buffer * | buf, |
size_t | max_cols, | ||
const struct Expando * | exp, | ||
struct Mailbox * | m, | ||
int | inpgr, | ||
struct Email * | e, | ||
MuttFormatFlags | flags, | ||
const char * | progress | ||
) |
Create formatted strings using mailbox expandos.
buf | Buffer for the result |
max_cols | Number of screen columns (-1 means unlimited) |
exp | Expando containing expando tree |
m | Mailbox |
inpgr | Message shown in the pager |
e | |
flags | Flags, see MuttFormatFlags |
progress | Pager progress string |
num | Number of screen columns used |
Definition at line 803 of file dlg_index.c.
|
extern |
Help Bar for the News Index dialog.
Definition at line 117 of file dlg_index.c.
|
extern |