NeoMutt  2020-03-20-65-g141838
Teaching an old dog new tricks
DOXYGEN
context.h
Go to the documentation of this file.
1 
23 #ifndef MUTT_CONTEXT_H
24 #define MUTT_CONTEXT_H
25 
26 #include <stdbool.h>
27 #include <sys/types.h>
28 
29 struct Email;
30 struct EmailList;
31 struct Mailbox;
32 struct NotifyCallback;
33 
37 struct Context
38 {
39  off_t vsize;
40  char *pattern;
41  struct PatternList *limit_pattern;
42  struct Email *last_tag;
43  struct MuttThread *tree;
44  struct Hash *thread_hash;
46 
47  struct Menu *menu;
48 
49  bool collapsed : 1;
50 
51  struct Mailbox *mailbox;
52  struct Notify *notify;
53 };
54 
59 {
60  struct Context *context;
61 };
62 
67 {
70 };
71 
72 void ctx_free (struct Context **ptr);
73 int ctx_mailbox_observer(struct NotifyCallback *nc);
74 struct Context *ctx_new (void);
75 void ctx_update (struct Context *ctx);
76 void ctx_update_tables (struct Context *ctx, bool committing);
77 
78 bool message_is_tagged (struct Context *ctx, struct Email *e);
79 bool message_is_visible(struct Context *ctx, struct Email *e);
80 struct Email *mutt_get_virt_email(struct Mailbox *m, int vnum);
81 
82 int el_add_tagged (struct EmailList *el, struct Context *ctx, struct Email *e, bool use_tagged);
83 
84 #endif /* MUTT_CONTEXT_H */
The "current" mailbox.
Definition: context.h:37
The envelope/body of an email.
Definition: email.h:37
GUI selectable list of items.
Definition: mutt_menu.h:82
Data passed to a notification function.
Definition: observer.h:39
struct MuttThread * tree
Top of thread tree.
Definition: context.h:43
A Hash Table.
Definition: hash.h:61
bool message_is_visible(struct Context *ctx, struct Email *e)
Is a message in the index within limit.
Definition: context.c:335
NotifyContext
Types of Context Event.
Definition: context.h:66
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:365
int ctx_mailbox_observer(struct NotifyCallback *nc)
Watch for changes affecting the Context - Implements observer_t.
Definition: context.c:294
struct Mailbox * mailbox
Definition: context.h:51
struct Email * mutt_get_virt_email(struct Mailbox *m, int vnum)
Get a virtual Email.
Definition: context.c:413
The Context has been opened.
Definition: context.h:68
struct Notify * notify
Notifications handler.
Definition: context.h:52
struct Context * context
The Context this Event relates to.
Definition: context.h:60
struct Menu * menu
Needed for pattern compilation.
Definition: context.h:47
struct Context * ctx_new(void)
Create a new Context.
Definition: context.c:71
int msg_not_read_yet
Which msg "new" in pager, -1 if none.
Definition: context.h:45
off_t vsize
Definition: context.h:39
struct Hash * thread_hash
Hash table for threading.
Definition: context.h:44
bool message_is_tagged(struct Context *ctx, struct Email *e)
Is a message in the index tagged (and within limit)
Definition: context.c:351
A mailbox.
Definition: mailbox.h:81
struct PatternList * limit_pattern
Compiled limit pattern.
Definition: context.h:41
Notification API.
Definition: notify.c:39
int vnum
Virtual message number.
Definition: email.h:87
void ctx_update(struct Context *ctx)
Update the Context&#39;s message counts.
Definition: context.c:105
The Context is about to be destroyed.
Definition: context.h:69
An Email conversation.
Definition: thread.h:34
bool collapsed
Are all threads collapsed?
Definition: context.h:49
An Event that happened to an Context.
Definition: context.h:58
void ctx_free(struct Context **ptr)
Free a Context.
Definition: context.c:48
char * pattern
Limit pattern string.
Definition: context.h:40
void ctx_update_tables(struct Context *ctx, bool committing)
Update a Context structure&#39;s internal tables.
Definition: context.c:198
struct Email * last_tag
Last tagged msg (used to link threads)
Definition: context.h:42