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