-
Notifications
You must be signed in to change notification settings - Fork 8
/
configuration.h
251 lines (201 loc) · 6.4 KB
/
configuration.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
/***************************************************************************
SimpleMail - Copyright (C) 2000 Hynek Schlawack and Sebastian Bauer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
/**
* @file configuration.h
*/
#ifndef SM__CONFIGURATION_H
#define SM__CONFIGURATION_H
#ifndef SM__LISTS_H
#include "lists.h"
#endif
#ifndef SM__ACOUNT_H
#include "account.h"
#endif
#ifndef SM__PHRASE_H
#include "phrase.h"
#endif
#ifndef SM__CODESETS_H
#include "codesets.h"
#endif
struct pop3_server;
#define SHOW_HEADER_NONE 0
#define SHOW_HEADER_FROM (1<<0)
#define SHOW_HEADER_TO (1<<1)
#define SHOW_HEADER_CC (1<<2)
#define SHOW_HEADER_SUBJECT (1<<3)
#define SHOW_HEADER_DATE (1<<4)
#define SHOW_HEADER_REPLYTO (1<<5)
#define SHOW_HEADER_ALL (1<<31)
/**
* @brief SimpleMail's main configuration structure
*/
struct config
{
int from_disk; /* 1 if config has been loaded from disk */
int dst;
/**
* Indicates that the trash folder should be emptied
* on exit.
*/
int delete_deleted;
int receive_preselection; /* 0 no selection, 1 size selection, 2 full selection */
int receive_size; /* the size in kb */
int receive_autocheck; /* 0 no auto check */
int receive_autoifonline; /* before auto check, check if online */
int receive_autoonstartup; /* check mails at startup */
int receive_sound;
char *receive_sound_file;
int receive_arexx;
char *receive_arexx_file;
/* list of all accounts */
struct list account_list;
/* list of all signatures */
struct list signature_list;
/* list of all phrases */
struct list phrase_list;
int signatures_use;
/* headers */
unsigned int header_flags;
char **header_array;
int write_wrap;
int write_wrap_type;
int write_reply_quote;
int write_reply_stripsig;
int write_reply_citeemptyl;
int write_forward_as_attachment;
char *read_fixedfont;
char *read_propfont;
/* Colors */
int read_background;
int read_text;
int read_quoted;
int read_old_quoted;
int read_quoted_background;
int read_link;
int read_header_background;
/* Boolean */
int read_wordwrap;
int read_link_underlined;
int read_smilies;
int read_graphical_quote_bar;
int readwnd_close_after_last;
int readwnd_next_after_move;
/* list of the filters */
struct list filter_list;
/* array of "internet connectable" e-mail addresses */
char **internet_emails;
/* spam */
int spam_mark_moved; /* mark mails if they are moved to spam */
int spam_auto_check;
int spam_addrbook_is_white;
char **spam_white_emails;
char **spam_black_emails;
/* charset */
struct codeset *default_codeset; /* the user default codeset, might be NULL */
/* appicon */
char *appicon_label; /* the label to be shown with the appicon */
int appicon_show; /* when should the appicon be displayed */
/* startup display folder */
char *startup_folder_name; /* if NULL folder_incoming() will be shown */
/* hidden */
int set_all_stati; /* expand the context menu of the maillisttree to set all stati */
int min_classified_mails; /* number of minimum spam/ham classification to invoke the auto spamcheck */
int dont_show_shutdown_text; /* Do not show the text in the shutdown window */
int dont_use_thebar_mcc; /* Do not use TheBar, also if it's available */
int dont_add_default_addresses; /* Do not add the default email addresses if they don't exist */
int dont_jump_to_unread_mail; /* Do not jump to the first unread mail if changing folders */
int dont_use_aiss; /* Do not use AISS icons, also if they're available */
int dont_draw_alternating_rows; /* Disable the rendering of alternating rows */
int row_background; /* Row color */
int alt_row_background; /* Color of alternative row */
char *ssl_cypher_list; /* The cypher list used for ssl connections */
};
struct user
{
char *name; /* name of the user */
char *directory; /* the directory where all data is saved */
char *folder_directory; /* the directory where the folders should be saved */
char *new_folder_directory; /* the new folder directory */
char *config_filename; /* path to the the configuration */
char *filter_filename; /* path to the separate filter config file */
char *signature_filename; /* path to the sparate signature config file */
char *taglines_filename; /* path to the taglines */
struct config config;
};
/**
* Sets the user profile directory. If this function is not called
* some defaults are used.
*
* @param profile_directory
* @return 0 on failure, 1 on success
*/
int config_set_user_profile_directory(char *path);
/**
* Load the configuration.
*
* @return 0 on failure, 1 on success
*/
int load_config(void);
/**
* Frees all resources needed for the configuration.
*/
void free_config(void);
/**
* Save the configuration.
*/
void save_config(void);
/**
* Save the filters.
*/
void save_filter(void);
/**
* Clear all the accounts.
*/
void clear_config_accounts(void);
/**
* Insert a new account into the configuration list.
*
* @param account the account to be inserted
*/
void insert_config_account(struct account *account);
/**
* Find a signature by name.
*
* @param name the name of the signature to be found.
* @return the signature or NULL
*/
struct signature *find_config_signature_by_name(char *name);
/**
* Clear all the signatures.
*/
void clear_config_signatures(void);
/**
* Insert a new signature into the configuration list.
*
* @param signature the signature to be inserted
*/
void insert_config_signature(struct signature *signature);
/**
* Clear all the phrases
*/
void clear_config_phrases(void);
/**
* Insert a new phrase into the configuration list.
*
* @param phrase the phrase to be inserted.
*/
void insert_config_phrase(struct phrase *phrase);
extern struct user user; /* the current user */
#endif