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