2006-09-06 [wwp] 2.4.0cvs154
[claws.git] / src / prefs_common.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef __PREFS_COMMON_H__
21 #define __PREFS_COMMON_H__
22
23 #ifdef HAVE_CONFIG_H
24 #  include "config.h"
25 #endif
26
27 #include <glib.h>
28
29 #include "mainwindow.h"
30 #include "summaryview.h"
31 #include "folderview.h"
32 #include "codeconv.h"
33 #include "textview.h"
34 #include "procmime.h"
35 #include "prefs_msg_colors.h"
36
37 typedef struct _PrefsCommon     PrefsCommon;
38
39 typedef enum {
40         RECV_DIALOG_ALWAYS,
41         RECV_DIALOG_MANUAL,
42         RECV_DIALOG_NEVER
43 } RecvDialogMode;
44
45 typedef enum {
46         COMPOSE_DND_ASK,
47         COMPOSE_DND_INSERT,
48         COMPOSE_DND_ATTACH
49 } ComposeDndInsertOrAttach;
50
51 typedef enum {
52         CTE_AUTO,
53         CTE_BASE64,
54         CTE_QUOTED_PRINTABLE,
55         CTE_8BIT
56 } TransferEncodingMethod;
57
58 typedef enum {
59         SEND_DIALOG_ALWAYS,
60         /* SEND_DIALOG_ACTIVE would be irrelevant */
61         SEND_DIALOG_NEVER
62 } SendDialogMode;
63
64 typedef enum
65 {
66 /* U = unread, N = new, M = marked */
67         SELECTONENTRY_NOTHING,
68         SELECTONENTRY_UNM,
69         SELECTONENTRY_UMN,
70         SELECTONENTRY_NUM,
71         SELECTONENTRY_NMU,
72         SELECTONENTRY_MNU,
73         SELECTONENTRY_MUN
74 } SelectOnEntry;
75
76 typedef enum
77 {
78         NEXTUNREADMSGDIALOG_ALWAYS,
79         NEXTUNREADMSGDIALOG_ASSUME_YES,
80         NEXTUNREADMSGDIALOG_ASSUME_NO
81 } NextUnreadMsgDialogShow;
82
83 struct _PrefsCommon
84 {
85         /* Receive */
86         gboolean use_extinc;
87         gchar *extinc_cmd;
88         gboolean scan_all_after_inc;
89         gboolean autochk_newmail;
90         gint autochk_itv;
91         gboolean chk_on_startup;
92         gboolean open_inbox_on_inc;
93         gboolean newmail_notify_auto;
94         gboolean newmail_notify_manu;
95         gchar   *newmail_notify_cmd;
96         RecvDialogMode recv_dialog_mode;
97         gboolean close_recv_dialog;
98         gboolean no_recv_err_panel;
99
100         /* Send */
101         gboolean savemsg;
102         gboolean confirm_send_queued_messages;
103         SendDialogMode send_dialog_mode;
104         gchar *outgoing_charset;
105         TransferEncodingMethod encoding_method;
106
107         gboolean allow_jisx0201_kana;
108
109         /* Compose */
110         gint undolevels;
111         gint linewrap_len;
112         gboolean linewrap_quote;
113         gboolean linewrap_pastes;
114         gboolean autowrap;
115         gboolean auto_exteditor;
116         gboolean reply_account_autosel;
117         gboolean default_reply_list;
118         gboolean forward_account_autosel;
119         gboolean reedit_account_autosel;
120         gboolean show_ruler;
121         gboolean autosave;
122         gint autosave_length;
123         gboolean compose_no_markup;
124         ComposeDndInsertOrAttach compose_dnd_mode;
125
126         /* Quote */
127         gboolean reply_with_quote;
128         gchar *quotemark;
129         gchar *quotefmt;
130         gchar *fw_quotemark;
131         gchar *fw_quotefmt;
132         gboolean forward_as_attachment;
133         gboolean redirect_keep_from;
134         gboolean block_cursor;
135         gchar *quote_chars;
136         
137 #if USE_ASPELL
138         gboolean enable_aspell;
139         gchar *aspell_path;
140         gchar *dictionary;
141         gulong misspelled_col;
142         gint aspell_sugmode;
143         gboolean check_while_typing;
144         gboolean recheck_when_changing_dict;
145         gboolean use_alternate;
146 #endif
147         
148         /* Display */
149         /* obsolete fonts */
150         gchar *widgetfont_gtk1;
151         gchar *textfont_gtk1;
152         gchar *normalfont_gtk1;
153         gchar *boldfont_gtk1;
154         gchar *smallfont_gtk1;
155
156         /* new fonts */
157         gchar *widgetfont;
158         gchar *textfont;
159         gchar *printfont;
160         gchar *normalfont;
161         gchar *smallfont;
162         gchar *titlefont;
163
164         /* custom colors */
165         ColorlabelPrefs custom_colorlabel[COLORLABELS];
166
167         /* image viewer */
168         gboolean display_img;
169         gboolean resize_img;
170         gboolean inline_img;
171
172         gboolean trans_hdr;
173         gboolean display_folder_unread;
174         gint ng_abbrev_len;
175
176         gboolean show_searchbar;
177         gboolean expand_thread;
178         gboolean swap_from;
179         gboolean use_addr_book;
180         gchar *date_format;
181
182         gboolean use_stripes_everywhere;
183         gboolean use_stripes_in_summaries; /* overrides if use_stripes_everywhere is set to TRUE */
184         gboolean enable_dotted_lines;
185         gboolean enable_hscrollbar;
186         gboolean bold_unread;
187         gboolean enable_thread;
188         gboolean thread_by_subject;
189         gint thread_by_subject_max_age; /*!< Max. age of a thread which was threaded
190                                          *   by subject (days) */
191
192         ToolbarStyle toolbar_style;
193         gboolean toolbar_detachable;
194         gboolean show_statusbar;
195
196         gint folderview_vscrollbar_policy;
197
198         /* Filtering */
199         GSList *fltlist;
200
201         gint kill_score;
202         gint important_score;
203
204         /* Actions */
205         GSList *actions_list;
206
207         /* Summary columns visibility, position and size */
208         gboolean summary_col_visible[N_SUMMARY_COLS];
209         gint summary_col_pos[N_SUMMARY_COLS];
210         gint summary_col_size[N_SUMMARY_COLS];
211
212         gboolean folder_col_visible[N_FOLDER_COLS];
213         gint folder_col_pos[N_FOLDER_COLS];
214         gint folder_col_size[N_FOLDER_COLS];
215
216         /* Widget visibility, position and size */
217         gint folderwin_x;
218         gint folderwin_y;
219         gint folderview_width;
220         gint folderview_height;
221         gboolean folderview_visible;
222
223         gint summaryview_width;
224         gint summaryview_height;
225
226         gint main_msgwin_x;
227         gint main_msgwin_y;
228         gint msgview_width;
229         gint msgview_height;
230         gboolean msgview_visible;
231
232         gint mainview_x;
233         gint mainview_y;
234         gint mainview_width;
235         gint mainview_height;
236         gint mainwin_x;
237         gint mainwin_y;
238         gint mainwin_width;
239         gint mainwin_height;
240
241         gint msgwin_width;
242         gint msgwin_height;
243
244         gint sourcewin_width;
245         gint sourcewin_height;
246
247         gint compose_width;
248         gint compose_height;
249         gint compose_x;
250         gint compose_y;
251
252         /* Message */
253         gboolean enable_color;
254         gboolean enable_bgcolor;
255         gulong quote_level1_col;
256         gulong quote_level2_col;
257         gulong quote_level3_col;
258         gulong quote_level1_bgcol;
259         gulong quote_level2_bgcol;
260         gulong quote_level3_bgcol;
261         gulong uri_col;
262         gulong tgt_folder_col;
263         gulong signature_col;
264         gboolean recycle_quote_colors;
265         gboolean display_header_pane;
266         gboolean display_header;
267         gboolean display_xface;
268         gint line_space;
269         gboolean render_html;
270         gboolean invoke_plugin_on_html;
271         gboolean textview_cursor_visible;
272         gboolean enable_smooth_scroll;
273         gint scroll_step;
274         gboolean scroll_halfpage;
275
276         gboolean show_other_header;
277         gboolean use_different_print_font;
278         GSList *disphdr_list;
279
280         gboolean attach_desc;
281
282         /* MIME viewer */
283         gchar *mime_textviewer;
284         gchar *mime_open_cmd;
285         gchar *attach_save_dir;
286         gchar *attach_load_dir;
287
288         GList *mime_open_cmd_history;
289
290 #if USE_GPGME
291         /* Privacy */
292         gboolean auto_check_signatures;
293         gboolean gpg_signature_popup;
294         gboolean store_passphrase;
295         gint store_passphrase_timeout;
296         gboolean passphrase_grab;
297         gboolean gpg_warning;
298 #endif /* USE_GPGME */
299
300         /* Interface */
301         gboolean sep_folder;
302         gboolean sep_msg;
303         gint statusbar_update_step;
304         gboolean emulate_emacs;
305         gboolean always_show_msg;
306         gboolean mark_as_read_on_new_window;
307         gboolean mark_as_read_delay;
308         gboolean immediate_exec;
309         SelectOnEntry select_on_entry;
310         NextUnreadMsgDialogShow next_unread_msg_dialog;
311         gboolean add_address_by_click;
312         gchar *pixmap_theme_path;
313         int hover_timeout; /* msecs mouse hover timeout */
314         gboolean ask_mark_all_read;
315         gboolean ask_apply_per_account_filtering_rules;
316         gint apply_per_account_filtering_rules;
317
318         /* Other */
319         gchar *uri_cmd;
320         gchar *print_cmd;
321         gchar *ext_editor_cmd;
322
323     gboolean cliplog;
324     guint loglength;
325         gulong log_msg_color;
326         gulong log_warn_color;
327         gulong log_error_color;
328         gulong log_in_color;
329         gulong log_out_color;
330
331     gboolean confirm_on_exit;
332         gboolean clean_on_exit;
333         gboolean ask_on_clean;
334         gboolean warn_queued_on_exit;
335
336         gint io_timeout_secs;
337         
338         /* Memory cache*/
339         gint cache_max_mem_usage;
340         gint cache_min_keep_time;
341         
342         /* boolean for work offline 
343            stored here for use in inc.c */
344         gboolean work_offline;
345         
346         gint summary_quicksearch_type;
347         gint summary_quicksearch_sticky;
348         gint summary_quicksearch_recurse;
349         gulong color_new;
350         
351         GList *summary_quicksearch_history;
352
353         gint filteringwin_width;
354         gint filteringwin_height;
355         gint filteringactionwin_width;
356         gint filteringactionwin_height;
357         gint matcherwin_width;
358         gint matcherwin_height;
359         gint templateswin_width;
360         gint templateswin_height;
361         gint actionswin_width;
362         gint actionswin_height;
363         gint addressbookwin_width;
364         gint addressbookwin_height;
365         gint addressbookeditpersonwin_width;
366         gint addressbookeditpersonwin_height;
367         gint pluginswin_width;
368         gint pluginswin_height;
369         gint prefswin_width;
370         gint prefswin_height;
371         gint folderitemwin_width;
372         gint folderitemwin_height;
373         gint editaccountwin_width;
374         gint editaccountwin_height;
375         gint accountswin_width;
376         gint accountswin_height;
377         gint logwin_width;
378         gint logwin_height;
379         gint folderselwin_width;
380         gint folderselwin_height;
381         gint addressaddwin_width;
382         gint addressaddwin_height;
383         gint addressbook_folderselwin_width;
384         gint addressbook_folderselwin_height;
385
386         gint warn_dnd;
387         gint broken_are_utf8;
388         gint skip_ssl_cert_check;
389         gint live_dangerously;
390         gint never_send_retrcpt;
391         gint hide_quotes;
392 };
393
394 extern PrefsCommon prefs_common;
395
396 void prefs_common_read_config   (void);
397 void prefs_common_write_config  (void);
398 void prefs_common_open          (void);
399 PrefsCommon *prefs_common_get   (void);
400 void pref_set_textview_from_pref(GtkTextView *textview, gchar *txt);
401 gchar *pref_get_pref_from_textview(GtkTextView *textview);
402
403 #endif /* __PREFS_COMMON_H__ */