2006-06-01 [colin] 2.2.0cvs71
[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 *normalfont;
153         gchar *smallfont;
154         gchar *titlefont;
155
156         /* custom colors */
157         ColorlabelPrefs custom_colorlabel[COLORLABELS];
158
159         /* image viewer */
160         gboolean display_img;
161         gboolean resize_img;
162         gboolean inline_img;
163
164         gboolean trans_hdr;
165         gboolean display_folder_unread;
166         gint ng_abbrev_len;
167
168         gboolean show_searchbar;
169         gboolean expand_thread;
170         gboolean swap_from;
171         gboolean use_addr_book;
172         gchar *date_format;
173
174         gboolean enable_rules_hint;
175         gboolean enable_hscrollbar;
176         gboolean bold_unread;
177         gboolean enable_thread;
178         gboolean thread_by_subject;
179         gint thread_by_subject_max_age; /*!< Max. age of a thread which was threaded
180                                          *   by subject (days) */
181
182         ToolbarStyle toolbar_style;
183         gboolean toolbar_detachable;
184         gboolean show_statusbar;
185
186         gint folderview_vscrollbar_policy;
187
188         /* Filtering */
189         GSList *fltlist;
190
191         gint kill_score;
192         gint important_score;
193
194         /* Actions */
195         GSList *actions_list;
196
197         /* Summary columns visibility, position and size */
198         gboolean summary_col_visible[N_SUMMARY_COLS];
199         gint summary_col_pos[N_SUMMARY_COLS];
200         gint summary_col_size[N_SUMMARY_COLS];
201
202         gboolean folder_col_visible[N_FOLDER_COLS];
203         gint folder_col_pos[N_FOLDER_COLS];
204         gint folder_col_size[N_FOLDER_COLS];
205
206         /* Widget visibility, position and size */
207         gint folderwin_x;
208         gint folderwin_y;
209         gint folderview_width;
210         gint folderview_height;
211         gboolean folderview_visible;
212
213         gint summaryview_width;
214         gint summaryview_height;
215
216         gint main_msgwin_x;
217         gint main_msgwin_y;
218         gint msgview_width;
219         gint msgview_height;
220         gboolean msgview_visible;
221
222         gint mainview_x;
223         gint mainview_y;
224         gint mainview_width;
225         gint mainview_height;
226         gint mainwin_x;
227         gint mainwin_y;
228         gint mainwin_width;
229         gint mainwin_height;
230
231         gint msgwin_width;
232         gint msgwin_height;
233
234         gint sourcewin_width;
235         gint sourcewin_height;
236
237         gint compose_width;
238         gint compose_height;
239         gint compose_x;
240         gint compose_y;
241
242         /* Message */
243         gboolean enable_color;
244         gboolean enable_bgcolor;
245         gulong quote_level1_col;
246         gulong quote_level2_col;
247         gulong quote_level3_col;
248         gulong quote_level1_bgcol;
249         gulong quote_level2_bgcol;
250         gulong quote_level3_bgcol;
251         gulong uri_col;
252         gulong tgt_folder_col;
253         gulong signature_col;
254         gboolean recycle_quote_colors;
255         gboolean display_header_pane;
256         gboolean display_header;
257         gboolean display_xface;
258         gint line_space;
259         gboolean render_html;
260         gboolean invoke_plugin_on_html;
261         gboolean textview_cursor_visible;
262         gboolean enable_smooth_scroll;
263         gint scroll_step;
264         gboolean scroll_halfpage;
265
266         gboolean show_other_header;
267         GSList *disphdr_list;
268
269         gboolean attach_desc;
270
271         /* MIME viewer */
272         gchar *mime_image_viewer;
273         gchar *mime_audio_player;
274         gchar *mime_open_cmd;
275         gchar *attach_save_dir;
276         gchar *attach_load_dir;
277
278         GList *mime_open_cmd_history;
279
280 #if USE_GPGME
281         /* Privacy */
282         gboolean auto_check_signatures;
283         gboolean gpg_signature_popup;
284         gboolean store_passphrase;
285         gint store_passphrase_timeout;
286         gboolean passphrase_grab;
287         gboolean gpg_warning;
288 #endif /* USE_GPGME */
289
290         /* Interface */
291         gboolean sep_folder;
292         gboolean sep_msg;
293         gint statusbar_update_step;
294         gboolean emulate_emacs;
295         gboolean always_show_msg;
296         gboolean mark_as_read_on_new_window;
297         gboolean mark_as_read_delay;
298         gboolean immediate_exec;
299         SelectOnEntry select_on_entry;
300         NextUnreadMsgDialogShow next_unread_msg_dialog;
301         gboolean add_address_by_click;
302         gchar *pixmap_theme_path;
303         int hover_timeout; /* msecs mouse hover timeout */
304         gboolean ask_mark_all_read;
305
306         /* Other */
307         gchar *uri_cmd;
308         gchar *print_cmd;
309         gchar *ext_editor_cmd;
310
311     gboolean cliplog;
312     guint loglength;
313         gulong log_msg_color;
314         gulong log_warn_color;
315         gulong log_error_color;
316         gulong log_in_color;
317         gulong log_out_color;
318
319     gboolean confirm_on_exit;
320         gboolean clean_on_exit;
321         gboolean ask_on_clean;
322         gboolean warn_queued_on_exit;
323
324         gint io_timeout_secs;
325         
326         /* Memory cache*/
327         gint cache_max_mem_usage;
328         gint cache_min_keep_time;
329         
330         /* boolean for work offline 
331            stored here for use in inc.c */
332         gboolean work_offline;
333         
334         gint summary_quicksearch_type;
335         gint summary_quicksearch_sticky;
336         gint summary_quicksearch_recurse;
337         gulong color_new;
338         
339         GList *summary_quicksearch_history;
340
341         gint filteringwin_width;
342         gint filteringwin_height;
343         gint filteringactionwin_width;
344         gint filteringactionwin_height;
345         gint matcherwin_width;
346         gint matcherwin_height;
347         gint templateswin_width;
348         gint templateswin_height;
349         gint actionswin_width;
350         gint actionswin_height;
351         gint addressbookwin_width;
352         gint addressbookwin_height;
353         gint addressbookeditpersonwin_width;
354         gint addressbookeditpersonwin_height;
355         gint pluginswin_width;
356         gint pluginswin_height;
357         gint prefswin_width;
358         gint prefswin_height;
359         gint folderitemwin_width;
360         gint folderitemwin_height;
361         gint editaccountwin_width;
362         gint editaccountwin_height;
363         gint accountswin_width;
364         gint accountswin_height;
365         gint logwin_width;
366         gint logwin_height;
367         gint folderselwin_width;
368         gint folderselwin_height;
369         gint addressaddwin_width;
370         gint addressaddwin_height;
371
372         gint warn_dnd;
373         gint broken_are_utf8;
374         gint skip_ssl_cert_check;
375 };
376
377 extern PrefsCommon prefs_common;
378
379 void prefs_common_read_config   (void);
380 void prefs_common_write_config  (void);
381 void prefs_common_open          (void);
382 PrefsCommon *prefs_common_get   (void);
383 void pref_set_textview_from_pref(GtkTextView *textview, gchar *txt);
384 gchar *pref_get_pref_from_textview(GtkTextView *textview);
385
386 #endif /* __PREFS_COMMON_H__ */