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