Thanks to visit codestin.com
Credit goes to code.neomutt.org

NeoMutt  2025-12-11-189-gceedb6
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
thread.h
Go to the documentation of this file.
1
24
25#ifndef MUTT_GUI_THREAD_H
26#define MUTT_GUI_THREAD_H
27
28#include "email/lib.h"
29#include <stdbool.h>
30#include <stdint.h>
31#include <sys/types.h>
32
33struct Buffer;
34struct ConfigDef;
35struct Mailbox;
36struct MailboxView;
37
49
74
75typedef uint8_t MuttThreadFlags;
76#define MUTT_THREAD_NO_FLAGS 0
77#define MUTT_THREAD_COLLAPSE (1 << 0)
78#define MUTT_THREAD_UNCOLLAPSE (1 << 1)
79#define MUTT_THREAD_UNREAD (1 << 2)
80#define MUTT_THREAD_NEXT_UNREAD (1 << 3)
81#define MUTT_THREAD_FLAGGED (1 << 4)
82
91
102
103extern const struct EnumDef UseThreadsTypeDef;
104
105int mutt_traverse_thread(struct Email *e, MuttThreadFlags flag);
106#define mutt_collapse_thread(e) mutt_traverse_thread(e, MUTT_THREAD_COLLAPSE)
107#define mutt_uncollapse_thread(e) mutt_traverse_thread(e, MUTT_THREAD_UNCOLLAPSE)
108#define mutt_thread_contains_unread(e) mutt_traverse_thread(e, MUTT_THREAD_UNREAD)
109#define mutt_thread_contains_flagged(e) mutt_traverse_thread(e, MUTT_THREAD_FLAGGED)
110#define mutt_thread_next_unread(e) mutt_traverse_thread(e, MUTT_THREAD_NEXT_UNREAD)
111
113#define mutt_using_threads() (mutt_thread_style() > UT_FLAT)
114const char *get_use_threads_str(enum UseThreads value);
115int sort_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err);
116
117int mutt_aside_thread(struct Email *e, bool forwards, bool subthreads);
118#define mutt_next_thread(e) mutt_aside_thread(e, true, false)
119#define mutt_previous_thread(e) mutt_aside_thread(e, false, false)
120#define mutt_next_subthread(e) mutt_aside_thread(e, true, true)
121#define mutt_previous_subthread(e) mutt_aside_thread(e, false, true)
122
124void mutt_thread_ctx_free (struct ThreadsContext **ptr);
126void mutt_thread_collapse (struct ThreadsContext *tctx, bool collapse);
127bool mutt_thread_can_collapse (struct Email *e);
128
129void mutt_clear_threads (struct ThreadsContext *tctx);
130void mutt_draw_tree (struct ThreadsContext *tctx);
131bool mutt_link_threads (struct Email *parent, struct EmailArray *children, struct Mailbox *m);
132struct HashTable * mutt_make_id_hash (struct Mailbox *m);
133int mutt_messages_in_thread(struct Mailbox *m, struct Email *e, enum MessageInThread mit);
134int mutt_parent_message (struct Email *e, bool find_root);
135off_t mutt_set_vnum (struct Mailbox *m);
136void mutt_sort_threads (struct ThreadsContext *tctx, bool init);
137
138#endif /* MUTT_GUI_THREAD_H */
Structs that make up an email.
EmailSortType
Methods for sorting Emails.
Definition sort.h:53
int sort_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "sort" config variable - Implements ConfigDef::validator() -.
Definition thread.c:105
const struct EnumDef UseThreadsTypeDef
Data for the $use_threads enumeration.
Definition thread.c:64
uint8_t MuttThreadFlags
Flags, e.g. MUTT_THREAD_COLLAPSE.
Definition thread.h:75
void mutt_clear_threads(struct ThreadsContext *tctx)
Clear the threading of message in a mailbox.
Definition thread.c:716
UseThreads
Which threading style is active, $use_threads.
Definition thread.h:96
@ UT_FLAT
Unthreaded.
Definition thread.h:98
@ UT_UNSET
Not yet set by user, stick to legacy semantics.
Definition thread.h:97
@ UT_THREADS
Normal threading (root above subthreads)
Definition thread.h:99
@ UT_REVERSE
Reverse threading (subthreads above root)
Definition thread.h:100
void mutt_thread_collapse(struct ThreadsContext *tctx, bool collapse)
Toggle collapse.
Definition thread.c:1787
struct ThreadsContext * mutt_thread_ctx_init(struct MailboxView *mv)
Initialize a threading context.
Definition thread.c:353
void mutt_thread_collapse_collapsed(struct ThreadsContext *tctx)
Re-collapse threads marked as collapsed.
Definition thread.c:1766
int mutt_traverse_thread(struct Email *e, MuttThreadFlags flag)
Recurse through an email thread, matching messages.
Definition thread.c:1436
bool mutt_link_threads(struct Email *parent, struct EmailArray *children, struct Mailbox *m)
Forcibly link threads together.
Definition thread.c:1745
void mutt_draw_tree(struct ThreadsContext *tctx)
Draw a tree of threaded emails.
Definition thread.c:390
int mutt_messages_in_thread(struct Mailbox *m, struct Email *e, enum MessageInThread mit)
Count the messages in a thread.
Definition thread.c:1655
MessageInThread
Flags for mutt_messages_in_thread()
Definition thread.h:87
@ MIT_NUM_MESSAGES
How many messages are in the thread.
Definition thread.h:88
@ MIT_POSITION
Our position in the thread.
Definition thread.h:89
void mutt_thread_ctx_free(struct ThreadsContext **ptr)
Finalize a threading context.
Definition thread.c:364
const char * get_use_threads_str(enum UseThreads value)
Convert UseThreads enum to string.
Definition thread.c:97
enum UseThreads mutt_thread_style(void)
Which threading style is active?
Definition thread.c:79
void mutt_sort_threads(struct ThreadsContext *tctx, bool init)
Sort email threads.
Definition thread.c:1029
off_t mutt_set_vnum(struct Mailbox *m)
Set the virtual index number of all the messages in a mailbox.
Definition thread.c:1402
int mutt_aside_thread(struct Email *e, bool forwards, bool subthreads)
Find the next/previous (sub)thread.
Definition thread.c:1285
bool mutt_thread_can_collapse(struct Email *e)
Check whether a thread can be collapsed.
Definition thread.c:1815
int mutt_parent_message(struct Email *e, bool find_root)
Find the parent of a message.
Definition thread.c:1352
struct HashTable * mutt_make_id_hash(struct Mailbox *m)
Create a Hash Table for message-ids.
Definition thread.c:1700
TreeChar
Tree characters for menus.
Definition thread.h:56
@ MUTT_TREE_MAX
Definition thread.h:70
@ MUTT_TREE_LLCORNER
Lower left corner.
Definition thread.h:57
@ MUTT_TREE_RARROW
Right arrow.
Definition thread.h:63
@ MUTT_SPECIAL_INDEX
Colour indicator.
Definition thread.h:72
@ MUTT_TREE_ULCORNER
Upper left corner.
Definition thread.h:58
@ MUTT_TREE_EQUALS
Equals (for threads)
Definition thread.h:66
@ MUTT_TREE_HIDDEN
Ampersand character (for threads)
Definition thread.h:65
@ MUTT_TREE_STAR
Star character (for threads)
Definition thread.h:64
@ MUTT_TREE_LTEE
Left T-piece.
Definition thread.h:59
@ MUTT_TREE_VLINE
Vertical line.
Definition thread.h:61
@ MUTT_TREE_MISSING
Question mark.
Definition thread.h:69
@ MUTT_TREE_TTEE
Top T-piece.
Definition thread.h:67
@ MUTT_TREE_HLINE
Horizontal line.
Definition thread.h:60
@ MUTT_TREE_SPACE
Blank space.
Definition thread.h:62
@ MUTT_TREE_BTEE
Bottom T-piece.
Definition thread.h:68
String manipulation buffer.
Definition buffer.h:36
The envelope/body of an email.
Definition email.h:39
An enumeration.
Definition enum.h:30
A Hash Table.
Definition hash.h:99
View of a Mailbox.
Definition mview.h:40
A mailbox.
Definition mailbox.h:79
An Email conversation.
Definition thread.h:34
The "current" threading state.
Definition thread.h:42
struct MailboxView * mailbox_view
Current mailbox.
Definition thread.h:43
struct MuttThread * tree
Top of thread tree.
Definition thread.h:44
enum EmailSortType c_sort
Last sort method.
Definition thread.h:46
struct HashTable * hash
Hash Table: "message-id" -> MuttThread.
Definition thread.h:45
enum EmailSortType c_sort_aux
Last sort_aux method.
Definition thread.h:47