a sync from 0.9.3cvs17
[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 folderview_x;
172         gint folderview_y;
173         gint folderview_width;
174         gint folderview_height;
175         gint folder_col_folder;
176         gint folder_col_new;
177         gint folder_col_unread;
178         gint folder_col_total;
179
180         gint summaryview_width;
181         gint summaryview_height;
182
183         gint mainview_x;
184         gint mainview_y;
185         gint mainview_width;
186         gint mainview_height;
187         gint mainwin_x;
188         gint mainwin_y;
189         gint mainwin_width;
190         gint mainwin_height;
191
192         gint msgwin_width;
193         gint msgwin_height;
194
195         gint sourcewin_width;
196         gint sourcewin_height;
197
198         gint compose_width;
199         gint compose_height;
200
201         /* Message */
202         gboolean enable_color;
203         gulong quote_level1_col;
204         gulong quote_level2_col;
205         gulong quote_level3_col;
206         gulong uri_col;
207         gulong tgt_folder_col;
208         gulong signature_col;
209         gboolean recycle_quote_colors;
210         gboolean conv_mb_alnum;
211         gboolean display_header_pane;
212         gboolean display_header;
213         gboolean head_space;
214         gint line_space;
215         gboolean enable_smooth_scroll;
216         gint scroll_step;
217         gboolean scroll_halfpage;
218
219         gchar *force_charset;
220
221         gboolean show_other_header;
222         GSList *disphdr_list;
223
224         gboolean attach_desc;
225
226         /* MIME viewer */
227         gchar *mime_image_viewer;
228         gchar *mime_audio_player;
229         gchar *mime_open_cmd;
230
231         GList *mime_open_cmd_history;
232
233 #if USE_GPGME
234         /* Privacy */
235         gboolean auto_check_signatures;
236         gboolean gpg_signature_popup;
237         gboolean store_passphrase;
238         gint store_passphrase_timeout;
239         gboolean passphrase_grab;
240         gboolean gpg_warning;
241 #endif /* USE_GPGME */
242
243         /* Interface */
244         gboolean sep_folder;
245         gboolean sep_msg;
246         gboolean emulate_emacs;
247         gboolean always_show_msg;
248         gboolean open_unread_on_enter;
249         gboolean mark_as_read_on_new_window;
250         gboolean open_inbox_on_inc;
251         gboolean immediate_exec;
252         NextUnreadMsgDialogShow next_unread_msg_dialog;
253         gboolean add_address_by_click;
254         gchar *pixmap_theme_path;
255         int hover_timeout; /* msecs mouse hover timeout */
256
257         /* Other */
258         gchar *uri_cmd;
259         gchar *print_cmd;
260         gchar *ext_editor_cmd;
261
262         gboolean cliplog;
263         guint loglength;
264
265         gboolean confirm_on_exit;
266         gboolean clean_on_exit;
267         gboolean ask_on_clean;
268         gboolean warn_queued_on_exit;
269
270         gint io_timeout_secs;
271         
272 #if 0
273 #ifdef USE_OPENSSL
274         gboolean ssl_ask_unknown_valid;
275 #endif
276 #endif
277
278         /* Memory cache*/
279         gint cache_max_mem_usage;
280         gint cache_min_keep_time;
281         
282         /* boolean for work offline 
283            stored here for use in inc.c */
284         gboolean work_offline;
285         
286         gint summary_quicksearch_type;
287         gulong color_new;
288 };
289
290 extern PrefsCommon prefs_common;
291
292 void prefs_common_init          (void);
293 void prefs_common_read_config   (void);
294 void prefs_common_save_config   (void);
295 void prefs_common_open          (void);
296 PrefsCommon *prefs_common_get   (void);
297
298 #endif /* __PREFS_COMMON_H__ */