better next/previous/delete/focus navigation with separate
[claws.git] / src / prefs_common.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2004 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_MANUAL,
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 scan_all_after_inc;
68         gboolean autochk_newmail;
69         gint autochk_itv;
70         gboolean chk_on_startup;
71         gboolean newmail_notify_auto;
72         gboolean newmail_notify_manu;
73         gchar   *newmail_notify_cmd;
74         RecvDialogMode recv_dialog_mode;
75         gboolean close_recv_dialog;
76         gboolean no_recv_err_panel;
77
78         /* Send */
79         gboolean savemsg;
80         gboolean queue_msg;
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 smart_wrapping;
111         gboolean block_cursor;
112         gchar *quote_chars;
113         
114 #if USE_ASPELL
115         gboolean enable_aspell;
116         gchar *aspell_path;
117         gchar *dictionary;
118         gulong misspelled_col;
119         gint aspell_sugmode;
120         gboolean check_while_typing;
121         gboolean use_alternate;
122 #endif
123         
124         /* Display */
125         gchar *widgetfont;
126         gchar *textfont;
127         gchar *normalfont;
128         gchar *boldfont;
129         gchar *smallfont;
130
131         gboolean trans_hdr;
132         gboolean display_folder_unread;
133         gint ng_abbrev_len;
134
135         gboolean show_searchbar;
136         gboolean swap_from;
137         gboolean expand_thread;
138         gboolean use_addr_book;
139         gchar *date_format;
140
141         gboolean enable_hscrollbar;
142         gboolean bold_unread;
143         gboolean enable_thread;
144         gboolean thread_by_subject;
145         gint thread_by_subject_max_age; /*!< Max. age of a thread which was threaded
146                                          *   by subject (days) */
147
148         ToolbarStyle toolbar_style;
149         gboolean show_statusbar;
150
151         gint folderview_vscrollbar_policy;
152
153         /* Filtering */
154         GSList *fltlist;
155
156         gint kill_score;
157         gint important_score;
158
159         /* Actions */
160         GSList *actions_list;
161
162         /* Summary columns visibility, position and size */
163         gboolean summary_col_visible[N_SUMMARY_COLS];
164         gint summary_col_pos[N_SUMMARY_COLS];
165         gint summary_col_size[N_SUMMARY_COLS];
166
167         /* Widget visibility, position and size */
168         gint folderwin_x;
169         gint folderwin_y;
170         gint folderview_width;
171         gint folderview_height;
172         gboolean folderview_visible;
173
174         gint folder_col_folder;
175         gint folder_col_new;
176         gint folder_col_unread;
177         gint folder_col_total;
178
179         gint summaryview_width;
180         gint summaryview_height;
181
182         gint main_msgwin_x;
183         gint main_msgwin_y;
184         gint msgview_width;
185         gint msgview_height;
186         gboolean msgview_visible;
187
188         gint mainview_x;
189         gint mainview_y;
190         gint mainview_width;
191         gint mainview_height;
192         gint mainwin_x;
193         gint mainwin_y;
194         gint mainwin_width;
195         gint mainwin_height;
196
197         gint msgwin_width;
198         gint msgwin_height;
199
200         gint sourcewin_width;
201         gint sourcewin_height;
202
203         gint compose_width;
204         gint compose_height;
205         gint compose_x;
206         gint compose_y;
207
208         /* Message */
209         gboolean enable_color;
210         gulong quote_level1_col;
211         gulong quote_level2_col;
212         gulong quote_level3_col;
213         gulong uri_col;
214         gulong tgt_folder_col;
215         gulong signature_col;
216         gboolean recycle_quote_colors;
217         gboolean conv_mb_alnum;
218         gboolean display_header_pane;
219         gboolean display_header;
220         gboolean head_space;
221         gint line_space;
222         gboolean enable_smooth_scroll;
223         gint scroll_step;
224         gboolean scroll_halfpage;
225
226         gchar *force_charset;
227
228         gboolean show_other_header;
229         GSList *disphdr_list;
230
231         gboolean attach_desc;
232
233         /* MIME viewer */
234         gchar *mime_image_viewer;
235         gchar *mime_audio_player;
236         gchar *mime_open_cmd;
237         gchar *attach_save_dir;
238
239         GList *mime_open_cmd_history;
240
241 #if USE_GPGME
242         /* Privacy */
243         gboolean auto_check_signatures;
244         gboolean gpg_signature_popup;
245         gboolean store_passphrase;
246         gint store_passphrase_timeout;
247         gboolean passphrase_grab;
248         gboolean gpg_warning;
249 #endif /* USE_GPGME */
250
251         /* Interface */
252         gboolean sep_folder;
253         gboolean sep_msg;
254         gboolean emulate_emacs;
255         gboolean always_show_msg;
256         gboolean open_unread_on_enter;
257         gboolean mark_as_read_on_new_window;
258         gboolean open_inbox_on_inc;
259         gboolean immediate_exec;
260         NextUnreadMsgDialogShow next_unread_msg_dialog;
261         gboolean add_address_by_click;
262         gchar *pixmap_theme_path;
263         int hover_timeout; /* msecs mouse hover timeout */
264
265         /* Other */
266         gchar *uri_cmd;
267         gchar *print_cmd;
268         gchar *ext_editor_cmd;
269
270         gboolean cliplog;
271         guint loglength;
272
273         gboolean confirm_on_exit;
274         gboolean clean_on_exit;
275         gboolean ask_on_clean;
276         gboolean warn_queued_on_exit;
277
278         gint io_timeout_secs;
279         
280 #if 0
281 #ifdef USE_OPENSSL
282         gboolean ssl_ask_unknown_valid;
283 #endif
284 #endif
285
286         /* Memory cache*/
287         gint cache_max_mem_usage;
288         gint cache_min_keep_time;
289         
290         /* boolean for work offline 
291            stored here for use in inc.c */
292         gboolean work_offline;
293         
294         gint summary_quicksearch_type;
295         gulong color_new;
296 };
297
298 extern PrefsCommon prefs_common;
299
300 void prefs_common_init          (void);
301 void prefs_common_read_config   (void);
302 void prefs_common_save_config   (void);
303 void prefs_common_open          (void);
304 PrefsCommon *prefs_common_get   (void);
305
306 #endif /* __PREFS_COMMON_H__ */