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