NeoMutt  2021-10-29-220-g2b1eec
Teaching an old dog new tricks
Go to the documentation of this file.
23 #ifndef MUTT_CONTEXT_H
24 #define MUTT_CONTEXT_H
26 #include <stdbool.h>
27 #include <sys/types.h>
29 struct Email;
30 struct EmailList;
31 struct Mailbox;
32 struct NotifyCallback;
37 struct Context
38 {
39  off_t vsize;
40  char *pattern;
41  struct PatternList *limit_pattern;
45  struct Menu *menu;
47  bool collapsed : 1;
49  struct Mailbox *mailbox;
50  struct Notify *notify;
51 };
59 {
63 };
69 {
70  struct Context *ctx;
71 };
73 void ctx_free (struct Context **ptr);
74 int ctx_mailbox_observer(struct NotifyCallback *nc);
75 struct Context *ctx_new (struct Mailbox *m);
76 void ctx_update (struct Context *ctx);
77 bool ctx_has_limit (const struct Context *ctx);
78 struct Mailbox* ctx_mailbox (struct Context *ctx);
80 bool message_is_tagged(struct Email *e);
81 struct Email *mutt_get_virt_email(struct Mailbox *m, int vnum);
83 int el_add_tagged (struct EmailList *el, struct Context *ctx, struct Email *e, bool use_tagged);
85 #endif /* MUTT_CONTEXT_H */
struct Email * mutt_get_virt_email(struct Mailbox *m, int vnum)
Get a virtual Email.
Definition: context.c:412
struct Context * ctx_new(struct Mailbox *m)
Create a new Context.
Definition: context.c:77
struct Mailbox * ctx_mailbox(struct Context *ctx)
Wrapper to get the mailbox in a Context, or NULL.
Definition: context.c:444
void ctx_free(struct Context **ptr)
Free a Context.
Definition: context.c:49
Types of Context Event.
Definition: context.h:59
The Context is about to be destroyed.
Definition: context.h:61
The Context has been opened.
Definition: context.h:60
The Context has changed.
Definition: context.h:62
int el_add_tagged(struct EmailList *el, struct Context *ctx, struct Email *e, bool use_tagged)
Get a list of the tagged Emails.
Definition: context.c:364
void ctx_update(struct Context *ctx)
Update the Context's message counts.
Definition: context.c:125
bool message_is_tagged(struct Email *e)
Is a message in the index tagged (and within limit)
Definition: context.c:350
bool ctx_has_limit(const struct Context *ctx)
Is a limit active?
Definition: context.c:433
int ctx_mailbox_observer(struct NotifyCallback *nc)
Notification that a Mailbox has changed - Implements observer_t -.
Definition: context.c:313
The "current" mailbox.
Definition: context.h:38
int msg_in_pager
Message currently shown in the pager.
Definition: context.h:43
char * pattern
Limit pattern string.
Definition: context.h:40
struct Mailbox * mailbox
Current Mailbox.
Definition: context.h:49
off_t vsize
Size (in bytes) of the messages shown.
Definition: context.h:39
struct ThreadsContext * threads
Threads context.
Definition: context.h:42
struct PatternList * limit_pattern
Compiled limit pattern.
Definition: context.h:41
bool collapsed
Are all threads collapsed?
Definition: context.h:47
struct Menu * menu
Needed for pattern compilation.
Definition: context.h:45
struct Notify * notify
Notifications: NotifyContext, EventContext.
Definition: context.h:50
The envelope/body of an email.
Definition: email.h:37
int vnum
Virtual message number.
Definition: email.h:114
An Event that happened to an Context.
Definition: context.h:69
struct Context * ctx
The Context this Event relates to.
Definition: context.h:70
A mailbox.
Definition: mailbox.h:82
Definition: lib.h:69
Data passed to a notification function.
Definition: observer.h:34
Notification API.
Definition: notify.c:51
The "current" threading state.
Definition: mutt_thread.c:50