2006-04-10 [colin] 2.1.0cvs27
[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         gboolean enable_bgcolor;
239         gulong quote_level1_col;
240         gulong quote_level2_col;
241         gulong quote_level3_col;
242         gulong quote_level1_bgcol;
243         gulong quote_level2_bgcol;
244         gulong quote_level3_bgcol;
245         gulong uri_col;
246         gulong tgt_folder_col;
247         gulong signature_col;
248         gboolean recycle_quote_colors;
249         gboolean display_header_pane;
250         gboolean display_header;
251         gboolean display_xface;
252         gint line_space;
253         gboolean render_html;
254         gboolean invoke_plugin_on_html;
255         gboolean textview_cursor_visible;
256         gboolean enable_smooth_scroll;
257         gint scroll_step;
258         gboolean scroll_halfpage;
259
260         gboolean show_other_header;
261         GSList *disphdr_list;
262
263         gboolean attach_desc;
264
265         /* MIME viewer */
266         gchar *mime_image_viewer;
267         gchar *mime_audio_player;
268         gchar *mime_open_cmd;
269         gchar *attach_save_dir;
270         gchar *attach_load_dir;
271
272         GList *mime_open_cmd_history;
273
274 #if USE_GPGME
275         /* Privacy */
276         gboolean auto_check_signatures;
277         gboolean gpg_signature_popup;
278         gboolean store_passphrase;
279         gint store_passphrase_timeout;
280         gboolean passphrase_grab;
281         gboolean gpg_warning;
282 #endif /* USE_GPGME */
283
284         /* Interface */
285         gboolean sep_folder;
286         gboolean sep_msg;
287         gint statusbar_update_step;
288         gboolean emulate_emacs;
289         gboolean always_show_msg;
290         gboolean mark_as_read_on_new_window;
291         gboolean mark_as_read_delay;
292         gboolean immediate_exec;
293         SelectOnEntry select_on_entry;
294         NextUnreadMsgDialogShow next_unread_msg_dialog;
295         gboolean add_address_by_click;
296         gchar *pixmap_theme_path;
297         int hover_timeout; /* msecs mouse hover timeout */
298         gboolean ask_mark_all_read;
299
300         /* Other */
301         gchar *uri_cmd;
302         gchar *print_cmd;
303         gchar *ext_editor_cmd;
304
305         gboolean cliplog;
306         guint loglength;
307
308         gboolean confirm_on_exit;
309         gboolean clean_on_exit;
310         gboolean ask_on_clean;
311         gboolean warn_queued_on_exit;
312
313         gint io_timeout_secs;
314         
315         /* Memory cache*/
316         gint cache_max_mem_usage;
317         gint cache_min_keep_time;
318         
319         /* boolean for work offline 
320            stored here for use in inc.c */
321         gboolean work_offline;
322         
323         gint summary_quicksearch_type;
324         gint summary_quicksearch_sticky;
325         gint summary_quicksearch_recurse;
326         gulong color_new;
327         
328         GList *summary_quicksearch_history;
329
330         gint filteringwin_width;
331         gint filteringwin_height;
332         gint filteringactionwin_width;
333         gint filteringactionwin_height;
334         gint matcherwin_width;
335         gint matcherwin_height;
336         gint templateswin_width;
337         gint templateswin_height;
338         gint actionswin_width;
339         gint actionswin_height;
340         gint addressbookwin_width;
341         gint addressbookwin_height;
342         gint addressbookeditpersonwin_width;
343         gint addressbookeditpersonwin_height;
344         gint pluginswin_width;
345         gint pluginswin_height;
346         gint prefswin_width;
347         gint prefswin_height;
348         gint folderitemwin_width;
349         gint folderitemwin_height;
350         gint editaccountwin_width;
351         gint editaccountwin_height;
352         gint accountswin_width;
353         gint accountswin_height;
354         gint logwin_width;
355         gint logwin_height;
356         gint folderselwin_width;
357         gint folderselwin_height;
358         gint addressaddwin_width;
359         gint addressaddwin_height;
360
361         gint warn_dnd;
362         gint broken_are_utf8;
363 };
364
365 extern PrefsCommon prefs_common;
366
367 void prefs_common_read_config   (void);
368 void prefs_common_write_config  (void);
369 void prefs_common_open          (void);
370 PrefsCommon *prefs_common_get   (void);
371 void pref_set_textview_from_pref(GtkTextView *textview, gchar *txt);
372 gchar *pref_get_pref_from_textview(GtkTextView *textview);
373
374 #endif /* __PREFS_COMMON_H__ */