sync with HEAD
[claws.git] / src / prefs_common.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2004 Hiroyuki Yamamoto
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 "codeconv.h"
32 #include "textview.h"
33
34 typedef struct _PrefsCommon     PrefsCommon;
35
36 typedef enum {
37         RECV_DIALOG_ALWAYS,
38         RECV_DIALOG_MANUAL,
39         RECV_DIALOG_NEVER
40 } RecvDialogMode;
41
42 typedef enum {
43         CTE_AUTO,
44         CTE_BASE64,
45         CTE_QUOTED_PRINTABLE,
46         CTE_8BIT
47 } TransferEncodingMethod;
48
49 typedef enum {
50         SEND_DIALOG_ALWAYS,
51         /* SEND_DIALOG_ACTIVE would be irrelevant */
52         SEND_DIALOG_NEVER
53 } SendDialogMode;
54
55 typedef enum
56 {
57         NEXTUNREADMSGDIALOG_ALWAYS,
58         NEXTUNREADMSGDIALOG_ASSUME_YES,
59         NEXTUNREADMSGDIALOG_ASSUME_NO
60 } NextUnreadMsgDialogShow;
61
62 struct _PrefsCommon
63 {
64         /* Receive */
65         gboolean use_extinc;
66         gchar *extinc_cmd;
67         gboolean scan_all_after_inc;
68         gboolean autochk_newmail;
69         gint autochk_itv;
70         gboolean chk_on_startup;
71         gboolean newmail_notify_auto;
72         gboolean newmail_notify_manu;
73         gchar   *newmail_notify_cmd;
74         RecvDialogMode recv_dialog_mode;
75         gboolean close_recv_dialog;
76         gboolean no_recv_err_panel;
77
78         /* Send */
79         gboolean savemsg;
80         SendDialogMode send_dialog_mode;
81         gchar *outgoing_charset;
82         TransferEncodingMethod encoding_method;
83
84         gboolean allow_jisx0201_kana;
85
86         /* Compose */
87         gint undolevels;
88         gint linewrap_len;
89         gboolean linewrap_quote;
90         gboolean autowrap;
91         gboolean linewrap_at_send;
92         gboolean auto_exteditor;
93         gboolean reply_account_autosel;
94         gboolean default_reply_list;
95         gboolean forward_account_autosel;
96         gboolean reedit_account_autosel;
97         gboolean show_ruler;
98         gboolean autosave;
99         gint autosave_length;
100         
101         /* Quote */
102         gboolean reply_with_quote;
103         gchar *quotemark;
104         gchar *quotefmt;
105         gchar *fw_quotemark;
106         gchar *fw_quotefmt;
107         gboolean forward_as_attachment;
108         gboolean redirect_keep_from;
109         gboolean block_cursor;
110         gchar *quote_chars;
111         
112 #if USE_ASPELL
113         gboolean enable_aspell;
114         gchar *aspell_path;
115         gchar *dictionary;
116         gulong misspelled_col;
117         gint aspell_sugmode;
118         gboolean check_while_typing;
119         gboolean use_alternate;
120 #endif
121         
122         /* Display */
123         /* obsolete fonts */
124         gchar *widgetfont_gtk1;
125         gchar *textfont_gtk1;
126         gchar *normalfont_gtk1;
127         gchar *boldfont_gtk1;
128         gchar *smallfont_gtk1;
129
130         /* new fonts */
131         gchar *widgetfont;
132         gchar *textfont;
133         gchar *normalfont;
134         gchar *boldfont;
135         gchar *smallfont;
136         gchar *titlefont;
137
138         gboolean trans_hdr;
139         gboolean display_folder_unread;
140         gint ng_abbrev_len;
141
142         gboolean show_searchbar;
143         gboolean swap_from;
144         gboolean expand_thread;
145         gboolean use_addr_book;
146         gchar *date_format;
147
148         gboolean enable_hscrollbar;
149         gboolean bold_unread;
150         gboolean enable_thread;
151         gboolean thread_by_subject;
152         gint thread_by_subject_max_age; /*!< Max. age of a thread which was threaded
153                                          *   by subject (days) */
154
155         ToolbarStyle toolbar_style;
156         gboolean show_statusbar;
157
158         gint folderview_vscrollbar_policy;
159
160         /* Filtering */
161         GSList *fltlist;
162
163         gint kill_score;
164         gint important_score;
165
166         /* Actions */
167         GSList *actions_list;
168
169         /* Summary columns visibility, position and size */
170         gboolean summary_col_visible[N_SUMMARY_COLS];
171         gint summary_col_pos[N_SUMMARY_COLS];
172         gint summary_col_size[N_SUMMARY_COLS];
173
174         /* Widget visibility, position and size */
175         gint folderwin_x;
176         gint folderwin_y;
177         gint folderview_width;
178         gint folderview_height;
179         gboolean folderview_visible;
180
181         gint folder_col_folder;
182         gint folder_col_new;
183         gint folder_col_unread;
184         gint folder_col_total;
185
186         gint summaryview_width;
187         gint summaryview_height;
188
189         gint main_msgwin_x;
190         gint main_msgwin_y;
191         gint msgview_width;
192         gint msgview_height;
193         gboolean msgview_visible;
194
195         gint mainview_x;
196         gint mainview_y;
197         gint mainview_width;
198         gint mainview_height;
199         gint mainwin_x;
200         gint mainwin_y;
201         gint mainwin_width;
202         gint mainwin_height;
203
204         gint msgwin_width;
205         gint msgwin_height;
206
207         gint sourcewin_width;
208         gint sourcewin_height;
209
210         gint compose_width;
211         gint compose_height;
212         gint compose_x;
213         gint compose_y;
214
215         /* Message */
216         gboolean enable_color;
217         gulong quote_level1_col;
218         gulong quote_level2_col;
219         gulong quote_level3_col;
220         gulong uri_col;
221         gulong tgt_folder_col;
222         gulong signature_col;
223         gboolean recycle_quote_colors;
224         gboolean conv_mb_alnum;
225         gboolean display_header_pane;
226         gboolean display_header;
227         gboolean head_space;
228         gint line_space;
229         gboolean enable_smooth_scroll;
230         gint scroll_step;
231         gboolean scroll_halfpage;
232
233         gchar *force_charset;
234
235         gboolean show_other_header;
236         GSList *disphdr_list;
237
238         gboolean attach_desc;
239
240         /* MIME viewer */
241         gchar *mime_image_viewer;
242         gchar *mime_audio_player;
243         gchar *mime_open_cmd;
244         gchar *attach_save_dir;
245
246         GList *mime_open_cmd_history;
247
248 #if USE_GPGME
249         /* Privacy */
250         gboolean auto_check_signatures;
251         gboolean gpg_signature_popup;
252         gboolean store_passphrase;
253         gint store_passphrase_timeout;
254         gboolean passphrase_grab;
255         gboolean gpg_warning;
256 #endif /* USE_GPGME */
257
258         /* Interface */
259         gboolean sep_folder;
260         gboolean sep_msg;
261         gboolean emulate_emacs;
262         gboolean always_show_msg;
263         gboolean open_unread_on_enter;
264         gboolean mark_as_read_on_new_window;
265         gboolean open_inbox_on_inc;
266         gboolean immediate_exec;
267         NextUnreadMsgDialogShow next_unread_msg_dialog;
268         gboolean add_address_by_click;
269         gchar *pixmap_theme_path;
270         int hover_timeout; /* msecs mouse hover timeout */
271
272         /* Other */
273         gchar *uri_cmd;
274         gchar *print_cmd;
275         gchar *ext_editor_cmd;
276
277         gboolean cliplog;
278         guint loglength;
279
280         gboolean confirm_on_exit;
281         gboolean clean_on_exit;
282         gboolean ask_on_clean;
283         gboolean warn_queued_on_exit;
284
285         gint io_timeout_secs;
286         
287 #if 0
288 #ifdef USE_OPENSSL
289         gboolean ssl_ask_unknown_valid;
290 #endif
291 #endif
292
293         /* Memory cache*/
294         gint cache_max_mem_usage;
295         gint cache_min_keep_time;
296         
297         /* boolean for work offline 
298            stored here for use in inc.c */
299         gboolean work_offline;
300         
301         gint summary_quicksearch_type;
302         gint summary_quicksearch_sticky;
303         gulong color_new;
304         
305         GList *summary_quicksearch_history;
306 };
307
308 extern PrefsCommon prefs_common;
309
310 void prefs_common_init          (void);
311 void prefs_common_read_config   (void);
312 void prefs_common_write_config  (void);
313 void prefs_common_open          (void);
314 PrefsCommon *prefs_common_get   (void);
315
316 #endif /* __PREFS_COMMON_H__ */