NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
node.h
Go to the documentation of this file.
1
24#ifndef MUTT_EXPANDO_NODE_H
25#define MUTT_EXPANDO_NODE_H
26
27#include <stdbool.h>
28#include "mutt/lib.h"
29#include "format.h"
30#include "render.h"
31
36{
45};
46
47ARRAY_HEAD(ExpandoNodeArray, struct ExpandoNode *);
48
53{
57 char leader;
58 bool lower;
59};
60
67{
69 int did;
70 int uid;
71
73 const char *text;
74
75 struct ExpandoNodeArray children;
76
77 void *ndata;
78 void (*ndata_free)(void **ptr);
79
91 int (*render)(const struct ExpandoNode *node, const struct ExpandoRenderData *rdata, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags);
92};
93
94struct ExpandoNode *node_new(void);
95void node_free(struct ExpandoNode **ptr);
96
97void node_add_child(struct ExpandoNode *node, struct ExpandoNode *child);
98struct ExpandoNode *node_get_child(const struct ExpandoNode *node, int index);
99
100struct ExpandoNode *node_last (struct ExpandoNode *node);
101
102#endif /* MUTT_EXPANDO_NODE_H */
#define ARRAY_HEAD(name, type)
Define a named struct for arrays of elements of a certain type.
Definition: array.h:47
Simple string formatting.
FormatJustify
Alignment for format_string()
Definition: format.h:33
Convenience wrapper for the library headers.
struct ExpandoNode * node_new(void)
Create a new empty ExpandoNode.
Definition: node.c:39
ExpandoNodeType
Type of Expando Node.
Definition: node.h:36
@ ENT_EXPANDO
Expando, e.g. 'n'.
Definition: node.h:39
@ ENT_CONTAINER
Container for other nodes.
Definition: node.h:44
@ ENT_CONDITION
True/False condition.
Definition: node.h:41
@ ENT_TEXT
Plain text.
Definition: node.h:38
@ ENT_CONDDATE
True/False date condition.
Definition: node.h:43
@ ENT_EMPTY
Empty.
Definition: node.h:37
@ ENT_CONDBOOL
True/False boolean condition.
Definition: node.h:42
@ ENT_PADDING
Padding: soft, hard, EOL.
Definition: node.h:40
struct ExpandoNode * node_get_child(const struct ExpandoNode *node, int index)
Get a child of an ExpandoNode.
Definition: node.c:91
void node_add_child(struct ExpandoNode *node, struct ExpandoNode *child)
Add a child to an ExpandoNode.
Definition: node.c:76
struct ExpandoNode * node_last(struct ExpandoNode *node)
Find the last Node in a tree.
Definition: node.c:108
void node_free(struct ExpandoNode **ptr)
Free an ExpandoNode and its private data.
Definition: node.c:48
Render Expandos using Data.
uint8_t MuttFormatFlags
Flags for expando_render(), e.g. MUTT_FORMAT_FORCESUBJ.
Definition: render.h:32
String manipulation buffer.
Definition: buffer.h:36
Formatting information for an Expando.
Definition: node.h:53
char leader
Leader character, 0 or space.
Definition: node.h:57
enum FormatJustify justification
Justification: left, centre, right.
Definition: node.h:56
int min_cols
Minimum number of screen columns.
Definition: node.h:54
int max_cols
Maximum number of screen columns.
Definition: node.h:55
bool lower
Display in lower case.
Definition: node.h:58
Basic Expando Node.
Definition: node.h:67
int uid
Unique ID, e.g. ED_EMA_SIZE.
Definition: node.h:70
int(* render)(const struct ExpandoNode *node, const struct ExpandoRenderData *rdata, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
Definition: node.h:91
void * ndata
Private node data.
Definition: node.h:77
struct ExpandoFormat * format
Formatting info.
Definition: node.h:72
int did
Domain ID, e.g. ED_EMAIL.
Definition: node.h:69
const char * text
Node-specific text.
Definition: node.h:73
enum ExpandoNodeType type
Type of Node, e.g. ENT_EXPANDO.
Definition: node.h:68
void(* ndata_free)(void **ptr)
Function to free the private node data.
Definition: node.h:78
struct ExpandoNodeArray children
Children nodes.
Definition: node.h:75