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