3e495eaf10a7bf5df71fc7f614f6c086f710a0fc
[claws.git] / src / prefs_common.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2003 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_ACTIVE,
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 inc_local;
68         gboolean filter_on_inc;
69         gchar *spool_path;
70         gboolean scan_all_after_inc;
71         gboolean autochk_newmail;
72         gint autochk_itv;
73         gboolean chk_on_startup;
74         gboolean newmail_notify_auto;
75         gboolean newmail_notify_manu;
76         gchar   *newmail_notify_cmd;
77         RecvDialogMode recv_dialog_mode;
78         gboolean close_recv_dialog;
79         gboolean no_recv_err_panel;
80
81         /* Send */
82         gboolean use_extsend;
83         gchar *extsend_cmd;
84         gboolean savemsg;
85         gboolean queue_msg;
86         SendDialogMode send_dialog_mode;
87         gchar *outgoing_charset;
88         TransferEncodingMethod encoding_method;
89
90         /* Compose */
91         gint undolevels;
92         gint linewrap_len;
93         gboolean linewrap_quote;
94         gboolean autowrap;
95         gboolean linewrap_at_send;
96         gboolean auto_exteditor;
97         gboolean reply_account_autosel;
98         gboolean default_reply_list;
99         gboolean forward_account_autosel;
100         gboolean reedit_account_autosel;
101         gboolean show_ruler;
102         gboolean autosave;
103         gint autosave_length;
104         
105         /* Quote */
106         gboolean reply_with_quote;
107         gchar *quotemark;
108         gchar *quotefmt;
109         gchar *fw_quotemark;
110         gchar *fw_quotefmt;
111         gboolean forward_as_attachment;
112         gboolean redirect_keep_from;
113         gboolean smart_wrapping;
114         gboolean block_cursor;
115         gchar *quote_chars;
116         
117 #if USE_ASPELL
118         gboolean enable_aspell;
119         gchar *aspell_path;
120         gchar *dictionary;
121         gulong misspelled_col;
122         gint aspell_sugmode;
123         gboolean check_while_typing;
124         gboolean use_alternate;
125 #endif
126         
127         /* Display */
128         gchar *widgetfont;
129         gchar *textfont;
130         gchar *normalfont;
131         gchar *boldfont;
132         gchar *smallfont;
133
134         gboolean trans_hdr;
135         gboolean display_folder_unread;
136         gint ng_abbrev_len;
137
138         gboolean show_searchbar;
139         gboolean swap_from;
140         gboolean expand_thread;
141         gboolean use_addr_book;
142         gchar *date_format;
143
144         gboolean enable_hscrollbar;
145         gboolean bold_unread;
146         gboolean enable_thread;
147         gboolean thread_by_subject;
148
149         ToolbarStyle toolbar_style;
150         gboolean show_statusbar;
151
152         gint folderview_vscrollbar_policy;
153
154         /* Filtering */
155         GSList *fltlist;
156
157         gint kill_score;
158         gint important_score;
159
160         /* Actions */
161         GSList *actions_list;
162
163         /* Summary columns visibility, position and size */
164         gboolean summary_col_visible[N_SUMMARY_COLS];
165         gint summary_col_pos[N_SUMMARY_COLS];
166         gint summary_col_size[N_SUMMARY_COLS];
167
168         /* Widget size */
169         gint folderview_x;
170         gint folderview_y;
171         gint folderview_width;
172         gint folderview_height;
173         gint folder_col_folder;
174         gint folder_col_new;
175         gint folder_col_unread;
176         gint folder_col_total;
177
178         gint summaryview_width;
179         gint summaryview_height;
180
181         gint mainview_x;
182         gint mainview_y;
183         gint mainview_width;
184         gint mainview_height;
185         gint mainwin_x;
186         gint mainwin_y;
187         gint mainwin_width;
188         gint mainwin_height;
189
190         gint msgwin_width;
191         gint msgwin_height;
192
193         gint sourcewin_width;
194         gint sourcewin_height;
195
196         gint compose_width;
197         gint compose_height;
198
199         /* Message */
200         gboolean enable_color;
201         gulong quote_level1_col;
202         gulong quote_level2_col;
203         gulong quote_level3_col;
204         gulong uri_col;
205         gulong tgt_folder_col;
206         gulong signature_col;
207         gboolean recycle_quote_colors;
208         gboolean conv_mb_alnum;
209         gboolean display_header_pane;
210         gboolean display_header;
211         gboolean head_space;
212         gint line_space;
213         gboolean enable_smooth_scroll;
214         gint scroll_step;
215         gboolean scroll_halfpage;
216
217         gchar *force_charset;
218
219         gboolean show_other_header;
220         GSList *disphdr_list;
221
222         gboolean attach_desc;
223
224         /* MIME viewer */
225         gchar *mime_image_viewer;
226         gchar *mime_audio_player;
227         gchar *mime_open_cmd;
228
229         GList *mime_open_cmd_history;
230
231 #if USE_GPGME
232         /* Privacy */
233         gboolean auto_check_signatures;
234         gboolean gpg_signature_popup;
235         gboolean store_passphrase;
236         gint store_passphrase_timeout;
237         gboolean passphrase_grab;
238         gboolean gpg_warning;
239 #endif /* USE_GPGME */
240
241         /* Interface */
242         gboolean sep_folder;
243         gboolean sep_msg;
244         gboolean emulate_emacs;
245         gboolean show_msg_with_cursor_key;
246         gboolean open_unread_on_enter;
247         gboolean mark_as_read_on_new_window;
248         gboolean open_on_delete;
249         gboolean open_inbox_on_inc;
250         gboolean immediate_exec;
251         NextUnreadMsgDialogShow next_unread_msg_dialog;
252         gboolean add_address_by_click;
253         gchar *pixmap_theme_path;
254
255         /* Other */
256         gchar *uri_cmd;
257         gchar *print_cmd;
258         gchar *ext_editor_cmd;
259
260         gboolean cliplog;
261         guint loglength;
262
263         gboolean confirm_on_exit;
264         gboolean clean_on_exit;
265         gboolean ask_on_clean;
266         gboolean warn_queued_on_exit;
267 #if 0
268 #ifdef USE_OPENSSL
269         gboolean ssl_ask_unknown_valid;
270 #endif
271 #endif
272
273         /* Memory cache*/
274         gint cache_max_mem_usage;
275         gint cache_min_keep_time;
276         
277         /* boolean for work offline 
278            stored here for use in inc.c */
279         gboolean work_offline;
280         
281         gint summary_quicksearch_type;
282         gulong color_new;
283 };
284
285 extern PrefsCommon prefs_common;
286
287 void prefs_common_init          ();
288 void prefs_common_read_config   (void);
289 void prefs_common_save_config   (void);
290 void prefs_common_open          (void);
291 PrefsCommon *prefs_common_get   (void);
292
293 #endif /* __PREFS_COMMON_H__ */