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