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