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