GTK2 fixes
[claws.git] / src / prefs_common.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2003 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         gboolean queue_msg;
81         SendDialogMode send_dialog_mode;
82         gchar *outgoing_charset;
83         TransferEncodingMethod encoding_method;
84
85         /* Compose */
86         gint undolevels;
87         gint linewrap_len;
88         gboolean linewrap_quote;
89         gboolean autowrap;
90         gboolean linewrap_at_send;
91         gboolean auto_exteditor;
92         gboolean reply_account_autosel;
93         gboolean default_reply_list;
94         gboolean forward_account_autosel;
95         gboolean reedit_account_autosel;
96         gboolean show_ruler;
97         gboolean autosave;
98         gint autosave_length;
99         
100         /* Quote */
101         gboolean reply_with_quote;
102         gchar *quotemark;
103         gchar *quotefmt;
104         gchar *fw_quotemark;
105         gchar *fw_quotefmt;
106         gboolean forward_as_attachment;
107         gboolean redirect_keep_from;
108         gboolean smart_wrapping;
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
213         /* Message */
214         gboolean enable_color;
215         gulong quote_level1_col;
216         gulong quote_level2_col;
217         gulong quote_level3_col;
218         gulong uri_col;
219         gulong tgt_folder_col;
220         gulong signature_col;
221         gboolean recycle_quote_colors;
222         gboolean conv_mb_alnum;
223         gboolean display_header_pane;
224         gboolean display_header;
225         gboolean head_space;
226         gint line_space;
227         gboolean enable_smooth_scroll;
228         gint scroll_step;
229         gboolean scroll_halfpage;
230
231         gchar *force_charset;
232
233         gboolean show_other_header;
234         GSList *disphdr_list;
235
236         gboolean attach_desc;
237
238         /* MIME viewer */
239         gchar *mime_image_viewer;
240         gchar *mime_audio_player;
241         gchar *mime_open_cmd;
242
243         GList *mime_open_cmd_history;
244
245 #if USE_GPGME
246         /* Privacy */
247         gboolean auto_check_signatures;
248         gboolean gpg_signature_popup;
249         gboolean store_passphrase;
250         gint store_passphrase_timeout;
251         gboolean passphrase_grab;
252         gboolean gpg_warning;
253 #endif /* USE_GPGME */
254
255         /* Interface */
256         gboolean sep_folder;
257         gboolean sep_msg;
258         gboolean emulate_emacs;
259         gboolean always_show_msg;
260         gboolean open_unread_on_enter;
261         gboolean mark_as_read_on_new_window;
262         gboolean open_inbox_on_inc;
263         gboolean immediate_exec;
264         NextUnreadMsgDialogShow next_unread_msg_dialog;
265         gboolean add_address_by_click;
266         gchar *pixmap_theme_path;
267         int hover_timeout; /* msecs mouse hover timeout */
268
269         /* Other */
270         gchar *uri_cmd;
271         gchar *print_cmd;
272         gchar *ext_editor_cmd;
273
274         gboolean cliplog;
275         guint loglength;
276
277         gboolean confirm_on_exit;
278         gboolean clean_on_exit;
279         gboolean ask_on_clean;
280         gboolean warn_queued_on_exit;
281
282         gint io_timeout_secs;
283         
284 #if 0
285 #ifdef USE_OPENSSL
286         gboolean ssl_ask_unknown_valid;
287 #endif
288 #endif
289
290         /* Memory cache*/
291         gint cache_max_mem_usage;
292         gint cache_min_keep_time;
293         
294         /* boolean for work offline 
295            stored here for use in inc.c */
296         gboolean work_offline;
297         
298         gint summary_quicksearch_type;
299         gulong color_new;
300 };
301
302 extern PrefsCommon prefs_common;
303
304 void prefs_common_init          (void);
305 void prefs_common_read_config   (void);
306 void prefs_common_save_config   (void);
307 void prefs_common_open          (void);
308 PrefsCommon *prefs_common_get   (void);
309
310 #endif /* __PREFS_COMMON_H__ */