25#ifndef MUTT_MUTT_THREAD_H
26#define MUTT_MUTT_THREAD_H
77#define MUTT_THREAD_NO_FLAGS 0
78#define MUTT_THREAD_COLLAPSE (1 << 0)
79#define MUTT_THREAD_UNCOLLAPSE (1 << 1)
80#define MUTT_THREAD_UNREAD (1 << 2)
81#define MUTT_THREAD_NEXT_UNREAD (1 << 3)
82#define MUTT_THREAD_FLAGGED (1 << 4)
107#define mutt_collapse_thread(e) mutt_traverse_thread(e, MUTT_THREAD_COLLAPSE)
108#define mutt_uncollapse_thread(e) mutt_traverse_thread(e, MUTT_THREAD_UNCOLLAPSE)
109#define mutt_thread_contains_unread(e) mutt_traverse_thread(e, MUTT_THREAD_UNREAD)
110#define mutt_thread_contains_flagged(e) mutt_traverse_thread(e, MUTT_THREAD_FLAGGED)
111#define mutt_thread_next_unread(e) mutt_traverse_thread(e, MUTT_THREAD_NEXT_UNREAD)
114#define mutt_using_threads() (mutt_thread_style() > UT_FLAT)
117 intptr_t value,
struct Buffer *err);
120#define mutt_next_thread(e) mutt_aside_thread(e, true, false)
121#define mutt_previous_thread(e) mutt_aside_thread(e, false, false)
122#define mutt_next_subthread(e) mutt_aside_thread(e, true, true)
123#define mutt_previous_subthread(e) mutt_aside_thread(e, false, true)
Convenience wrapper for the config headers.
int sort_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "sort" config variable - Implements ConfigDef::validator() -.
uint8_t MuttThreadFlags
Flags, e.g. MUTT_THREAD_COLLAPSE.
void mutt_clear_threads(struct ThreadsContext *tctx)
Clear the threading of message in a mailbox.
UseThreads
Which threading style is active, $use_threads.
@ UT_UNSET
Not yet set by user, stick to legacy semantics.
@ UT_THREADS
Normal threading (root above subthreads)
@ UT_REVERSE
Reverse threading (subthreads above root)
void mutt_thread_collapse(struct ThreadsContext *tctx, bool collapse)
Toggle collapse.
struct ThreadsContext * mutt_thread_ctx_init(struct MailboxView *mv)
Initialize a threading context.
void mutt_thread_collapse_collapsed(struct ThreadsContext *tctx)
Re-collapse threads marked as collapsed.
int mutt_traverse_thread(struct Email *e, MuttThreadFlags flag)
Recurse through an email thread, matching messages.
bool mutt_link_threads(struct Email *parent, struct EmailArray *children, struct Mailbox *m)
Forcibly link threads together.
void mutt_draw_tree(struct ThreadsContext *tctx)
Draw a tree of threaded emails.
int mutt_messages_in_thread(struct Mailbox *m, struct Email *e, enum MessageInThread mit)
Count the messages in a thread.
MessageInThread
Flags for mutt_messages_in_thread()
@ MIT_NUM_MESSAGES
How many messages are in the thread.
@ MIT_POSITION
Our position in the thread.
void mutt_thread_ctx_free(struct ThreadsContext **ptr)
Finalize a threading context.
const char * get_use_threads_str(enum UseThreads value)
Convert UseThreads enum to string.
enum UseThreads mutt_thread_style(void)
Which threading style is active?
void mutt_sort_threads(struct ThreadsContext *tctx, bool init)
Sort email threads.
const struct EnumDef UseThreadsTypeDef
Data for the $use_threads enumeration.
off_t mutt_set_vnum(struct Mailbox *m)
Set the virtual index number of all the messages in a mailbox.
int mutt_aside_thread(struct Email *e, bool forwards, bool subthreads)
Find the next/previous (sub)thread.
bool mutt_thread_can_collapse(struct Email *e)
Check whether a thread can be collapsed.
int mutt_parent_message(struct Email *e, bool find_root)
Find the parent of a message.
struct HashTable * mutt_make_id_hash(struct Mailbox *m)
Create a Hash Table for message-ids.
TreeChar
Tree characters for menus.
@ MUTT_TREE_LLCORNER
Lower left corner.
@ MUTT_TREE_RARROW
Right arrow.
@ MUTT_SPECIAL_INDEX
Colour indicator.
@ MUTT_TREE_ULCORNER
Upper left corner.
@ MUTT_TREE_EQUALS
Equals (for threads)
@ MUTT_TREE_HIDDEN
Ampersand character (for threads)
@ MUTT_TREE_STAR
Star character (for threads)
@ MUTT_TREE_LTEE
Left T-piece.
@ MUTT_TREE_VLINE
Vertical line.
@ MUTT_TREE_MISSING
Question mark.
@ MUTT_TREE_TTEE
Top T-piece.
@ MUTT_TREE_HLINE
Horizontal line.
@ MUTT_TREE_SPACE
Blank space.
@ MUTT_TREE_BTEE
Bottom T-piece.
SortType
Methods for sorting.
String manipulation buffer.
Container for lots of config items.
The envelope/body of an email.
The "current" threading state.
struct MailboxView * mailbox_view
Current mailbox.
struct MuttThread * tree
Top of thread tree.
struct HashTable * hash
Hash Table: "message-id" -> MuttThread.
enum SortType c_sort_aux
Last sort_aux method.
enum SortType c_sort
Last sort method.