sync with 0.9.4cvs6
[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_ACTIVE,
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         gchar *widgetfont;
129         gchar *textfont;
130         gchar *normalfont;
131         gchar *boldfont;
132         gchar *smallfont;
133
134         gboolean trans_hdr;
135         gboolean display_folder_unread;
136         gint ng_abbrev_len;
137
138         gboolean show_searchbar;
139         gboolean swap_from;
140         gboolean expand_thread;
141         gboolean use_addr_book;
142         gchar *date_format;
143
144         gboolean enable_hscrollbar;
145         gboolean bold_unread;
146         gboolean enable_thread;
147         gboolean thread_by_subject;
148         gint thread_by_subject_max_age; /*!< Max. age of a thread which was threaded
149                                          *   by subject (days) */
150
151         ToolbarStyle toolbar_style;
152         gboolean show_statusbar;
153
154         gint folderview_vscrollbar_policy;
155
156         /* Filtering */
157         GSList *fltlist;
158
159         gint kill_score;
160         gint important_score;
161
162         /* Actions */
163         GSList *actions_list;
164
165         /* Summary columns visibility, position and size */
166         gboolean summary_col_visible[N_SUMMARY_COLS];
167         gint summary_col_pos[N_SUMMARY_COLS];
168         gint summary_col_size[N_SUMMARY_COLS];
169
170         /* Widget size */
171         gint folderwin_x;
172         gint folderwin_y;
173         gint folderview_width;
174         gint folderview_height;
175
176         gint folder_col_folder;
177         gint folder_col_new;
178         gint folder_col_unread;
179         gint folder_col_total;
180
181         gint summaryview_width;
182         gint summaryview_height;
183
184         gint main_msgwin_x;
185         gint main_msgwin_y;
186         gint msgview_width;
187         gint msgview_height;
188
189         gint mainview_x;
190         gint mainview_y;
191         gint mainview_width;
192         gint mainview_height;
193         gint mainwin_x;
194         gint mainwin_y;
195         gint mainwin_width;
196         gint mainwin_height;
197
198         gint msgwin_width;
199         gint msgwin_height;
200
201         gint sourcewin_width;
202         gint sourcewin_height;
203
204         gint compose_width;
205         gint compose_height;
206
207         /* Message */
208         gboolean enable_color;
209         gulong quote_level1_col;
210         gulong quote_level2_col;
211         gulong quote_level3_col;
212         gulong uri_col;
213         gulong tgt_folder_col;
214         gulong signature_col;
215         gboolean recycle_quote_colors;
216         gboolean conv_mb_alnum;
217         gboolean display_header_pane;
218         gboolean display_header;
219         gboolean head_space;
220         gint line_space;
221         gboolean enable_smooth_scroll;
222         gint scroll_step;
223         gboolean scroll_halfpage;
224
225         gchar *force_charset;
226
227         gboolean show_other_header;
228         GSList *disphdr_list;
229
230         gboolean attach_desc;
231
232         /* MIME viewer */
233         gchar *mime_image_viewer;
234         gchar *mime_audio_player;
235         gchar *mime_open_cmd;
236
237         GList *mime_open_cmd_history;
238
239 #if USE_GPGME
240         /* Privacy */
241         gboolean auto_check_signatures;
242         gboolean gpg_signature_popup;
243         gboolean store_passphrase;
244         gint store_passphrase_timeout;
245         gboolean passphrase_grab;
246         gboolean gpg_warning;
247 #endif /* USE_GPGME */
248
249         /* Interface */
250         gboolean sep_folder;
251         gboolean sep_msg;
252         gboolean emulate_emacs;
253         gboolean always_show_msg;
254         gboolean open_unread_on_enter;
255         gboolean mark_as_read_on_new_window;
256         gboolean open_inbox_on_inc;
257         gboolean immediate_exec;
258         NextUnreadMsgDialogShow next_unread_msg_dialog;
259         gboolean add_address_by_click;
260         gchar *pixmap_theme_path;
261         int hover_timeout; /* msecs mouse hover timeout */
262
263         /* Other */
264         gchar *uri_cmd;
265         gchar *print_cmd;
266         gchar *ext_editor_cmd;
267
268         gboolean cliplog;
269         guint loglength;
270
271         gboolean confirm_on_exit;
272         gboolean clean_on_exit;
273         gboolean ask_on_clean;
274         gboolean warn_queued_on_exit;
275
276         gint io_timeout_secs;
277         
278 #if 0
279 #ifdef USE_OPENSSL
280         gboolean ssl_ask_unknown_valid;
281 #endif
282 #endif
283
284         /* Memory cache*/
285         gint cache_max_mem_usage;
286         gint cache_min_keep_time;
287         
288         /* boolean for work offline 
289            stored here for use in inc.c */
290         gboolean work_offline;
291         
292         gint summary_quicksearch_type;
293         gulong color_new;
294 };
295
296 extern PrefsCommon prefs_common;
297
298 void prefs_common_init          (void);
299 void prefs_common_read_config   (void);
300 void prefs_common_save_config   (void);
301 void prefs_common_open          (void);
302 PrefsCommon *prefs_common_get   (void);
303
304 #endif /* __PREFS_COMMON_H__ */