2006-06-21 [paul] 2.3.1cvs5
[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         CTE_AUTO,
47         CTE_BASE64,
48         CTE_QUOTED_PRINTABLE,
49         CTE_8BIT
50 } TransferEncodingMethod;
51
52 typedef enum {
53         SEND_DIALOG_ALWAYS,
54         /* SEND_DIALOG_ACTIVE would be irrelevant */
55         SEND_DIALOG_NEVER
56 } SendDialogMode;
57
58 typedef enum
59 {
60 /* U = unread, N = new, M = marked */
61         SELECTONENTRY_NOTHING,
62         SELECTONENTRY_UNM,
63         SELECTONENTRY_UMN,
64         SELECTONENTRY_NUM,
65         SELECTONENTRY_NMU,
66         SELECTONENTRY_MNU,
67         SELECTONENTRY_MUN
68 } SelectOnEntry;
69
70 typedef enum
71 {
72         NEXTUNREADMSGDIALOG_ALWAYS,
73         NEXTUNREADMSGDIALOG_ASSUME_YES,
74         NEXTUNREADMSGDIALOG_ASSUME_NO
75 } NextUnreadMsgDialogShow;
76
77 struct _PrefsCommon
78 {
79         /* Receive */
80         gboolean use_extinc;
81         gchar *extinc_cmd;
82         gboolean scan_all_after_inc;
83         gboolean autochk_newmail;
84         gint autochk_itv;
85         gboolean chk_on_startup;
86         gboolean open_inbox_on_inc;
87         gboolean newmail_notify_auto;
88         gboolean newmail_notify_manu;
89         gchar   *newmail_notify_cmd;
90         RecvDialogMode recv_dialog_mode;
91         gboolean close_recv_dialog;
92         gboolean no_recv_err_panel;
93
94         /* Send */
95         gboolean savemsg;
96         gboolean confirm_send_queued_messages;
97         SendDialogMode send_dialog_mode;
98         gchar *outgoing_charset;
99         TransferEncodingMethod encoding_method;
100
101         gboolean allow_jisx0201_kana;
102
103         /* Compose */
104         gint undolevels;
105         gint linewrap_len;
106         gboolean linewrap_quote;
107         gboolean linewrap_pastes;
108         gboolean autowrap;
109         gboolean auto_exteditor;
110         gboolean reply_account_autosel;
111         gboolean default_reply_list;
112         gboolean forward_account_autosel;
113         gboolean reedit_account_autosel;
114         gboolean show_ruler;
115         gboolean autosave;
116         gint autosave_length;
117         gboolean compose_no_markup;
118
119         /* Quote */
120         gboolean reply_with_quote;
121         gchar *quotemark;
122         gchar *quotefmt;
123         gchar *fw_quotemark;
124         gchar *fw_quotefmt;
125         gboolean forward_as_attachment;
126         gboolean redirect_keep_from;
127         gboolean block_cursor;
128         gchar *quote_chars;
129         
130 #if USE_ASPELL
131         gboolean enable_aspell;
132         gchar *aspell_path;
133         gchar *dictionary;
134         gulong misspelled_col;
135         gint aspell_sugmode;
136         gboolean check_while_typing;
137         gboolean recheck_when_changing_dict;
138         gboolean use_alternate;
139 #endif
140         
141         /* Display */
142         /* obsolete fonts */
143         gchar *widgetfont_gtk1;
144         gchar *textfont_gtk1;
145         gchar *normalfont_gtk1;
146         gchar *boldfont_gtk1;
147         gchar *smallfont_gtk1;
148
149         /* new fonts */
150         gchar *widgetfont;
151         gchar *textfont;
152         gchar *printfont;
153         gchar *normalfont;
154         gchar *smallfont;
155         gchar *titlefont;
156
157         /* custom colors */
158         ColorlabelPrefs custom_colorlabel[COLORLABELS];
159
160         /* image viewer */
161         gboolean display_img;
162         gboolean resize_img;
163         gboolean inline_img;
164
165         gboolean trans_hdr;
166         gboolean display_folder_unread;
167         gint ng_abbrev_len;
168
169         gboolean show_searchbar;
170         gboolean expand_thread;
171         gboolean swap_from;
172         gboolean use_addr_book;
173         gchar *date_format;
174
175         gboolean enable_rules_hint;
176         gboolean enable_hscrollbar;
177         gboolean bold_unread;
178         gboolean enable_thread;
179         gboolean thread_by_subject;
180         gint thread_by_subject_max_age; /*!< Max. age of a thread which was threaded
181                                          *   by subject (days) */
182
183         ToolbarStyle toolbar_style;
184         gboolean toolbar_detachable;
185         gboolean show_statusbar;
186
187         gint folderview_vscrollbar_policy;
188
189         /* Filtering */
190         GSList *fltlist;
191
192         gint kill_score;
193         gint important_score;
194
195         /* Actions */
196         GSList *actions_list;
197
198         /* Summary columns visibility, position and size */
199         gboolean summary_col_visible[N_SUMMARY_COLS];
200         gint summary_col_pos[N_SUMMARY_COLS];
201         gint summary_col_size[N_SUMMARY_COLS];
202
203         gboolean folder_col_visible[N_FOLDER_COLS];
204         gint folder_col_pos[N_FOLDER_COLS];
205         gint folder_col_size[N_FOLDER_COLS];
206
207         /* Widget visibility, position and size */
208         gint folderwin_x;
209         gint folderwin_y;
210         gint folderview_width;
211         gint folderview_height;
212         gboolean folderview_visible;
213
214         gint summaryview_width;
215         gint summaryview_height;
216
217         gint main_msgwin_x;
218         gint main_msgwin_y;
219         gint msgview_width;
220         gint msgview_height;
221         gboolean msgview_visible;
222
223         gint mainview_x;
224         gint mainview_y;
225         gint mainview_width;
226         gint mainview_height;
227         gint mainwin_x;
228         gint mainwin_y;
229         gint mainwin_width;
230         gint mainwin_height;
231
232         gint msgwin_width;
233         gint msgwin_height;
234
235         gint sourcewin_width;
236         gint sourcewin_height;
237
238         gint compose_width;
239         gint compose_height;
240         gint compose_x;
241         gint compose_y;
242
243         /* Message */
244         gboolean enable_color;
245         gboolean enable_bgcolor;
246         gulong quote_level1_col;
247         gulong quote_level2_col;
248         gulong quote_level3_col;
249         gulong quote_level1_bgcol;
250         gulong quote_level2_bgcol;
251         gulong quote_level3_bgcol;
252         gulong uri_col;
253         gulong tgt_folder_col;
254         gulong signature_col;
255         gboolean recycle_quote_colors;
256         gboolean display_header_pane;
257         gboolean display_header;
258         gboolean display_xface;
259         gint line_space;
260         gboolean render_html;
261         gboolean invoke_plugin_on_html;
262         gboolean textview_cursor_visible;
263         gboolean enable_smooth_scroll;
264         gint scroll_step;
265         gboolean scroll_halfpage;
266
267         gboolean show_other_header;
268         gboolean use_different_print_font;
269         GSList *disphdr_list;
270
271         gboolean attach_desc;
272
273         /* MIME viewer */
274         gchar *mime_image_viewer;
275         gchar *mime_audio_player;
276         gchar *mime_open_cmd;
277         gchar *attach_save_dir;
278         gchar *attach_load_dir;
279
280         GList *mime_open_cmd_history;
281
282 #if USE_GPGME
283         /* Privacy */
284         gboolean auto_check_signatures;
285         gboolean gpg_signature_popup;
286         gboolean store_passphrase;
287         gint store_passphrase_timeout;
288         gboolean passphrase_grab;
289         gboolean gpg_warning;
290 #endif /* USE_GPGME */
291
292         /* Interface */
293         gboolean sep_folder;
294         gboolean sep_msg;
295         gint statusbar_update_step;
296         gboolean emulate_emacs;
297         gboolean always_show_msg;
298         gboolean mark_as_read_on_new_window;
299         gboolean mark_as_read_delay;
300         gboolean immediate_exec;
301         SelectOnEntry select_on_entry;
302         NextUnreadMsgDialogShow next_unread_msg_dialog;
303         gboolean add_address_by_click;
304         gchar *pixmap_theme_path;
305         int hover_timeout; /* msecs mouse hover timeout */
306         gboolean ask_mark_all_read;
307
308         /* Other */
309         gchar *uri_cmd;
310         gchar *print_cmd;
311         gchar *ext_editor_cmd;
312
313     gboolean cliplog;
314     guint loglength;
315         gulong log_msg_color;
316         gulong log_warn_color;
317         gulong log_error_color;
318         gulong log_in_color;
319         gulong log_out_color;
320
321     gboolean confirm_on_exit;
322         gboolean clean_on_exit;
323         gboolean ask_on_clean;
324         gboolean warn_queued_on_exit;
325
326         gint io_timeout_secs;
327         
328         /* Memory cache*/
329         gint cache_max_mem_usage;
330         gint cache_min_keep_time;
331         
332         /* boolean for work offline 
333            stored here for use in inc.c */
334         gboolean work_offline;
335         
336         gint summary_quicksearch_type;
337         gint summary_quicksearch_sticky;
338         gint summary_quicksearch_recurse;
339         gulong color_new;
340         
341         GList *summary_quicksearch_history;
342
343         gint filteringwin_width;
344         gint filteringwin_height;
345         gint filteringactionwin_width;
346         gint filteringactionwin_height;
347         gint matcherwin_width;
348         gint matcherwin_height;
349         gint templateswin_width;
350         gint templateswin_height;
351         gint actionswin_width;
352         gint actionswin_height;
353         gint addressbookwin_width;
354         gint addressbookwin_height;
355         gint addressbookeditpersonwin_width;
356         gint addressbookeditpersonwin_height;
357         gint pluginswin_width;
358         gint pluginswin_height;
359         gint prefswin_width;
360         gint prefswin_height;
361         gint folderitemwin_width;
362         gint folderitemwin_height;
363         gint editaccountwin_width;
364         gint editaccountwin_height;
365         gint accountswin_width;
366         gint accountswin_height;
367         gint logwin_width;
368         gint logwin_height;
369         gint folderselwin_width;
370         gint folderselwin_height;
371         gint addressaddwin_width;
372         gint addressaddwin_height;
373
374         gint warn_dnd;
375         gint broken_are_utf8;
376         gint skip_ssl_cert_check;
377         gint live_dangerously;
378         gint never_send_retrcpt;
379 };
380
381 extern PrefsCommon prefs_common;
382
383 void prefs_common_read_config   (void);
384 void prefs_common_write_config  (void);
385 void prefs_common_open          (void);
386 PrefsCommon *prefs_common_get   (void);
387 void pref_set_textview_from_pref(GtkTextView *textview, gchar *txt);
388 gchar *pref_get_pref_from_textview(GtkTextView *textview);
389
390 #endif /* __PREFS_COMMON_H__ */