2005-01-01 [colin] 0.9.13cvs24
[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 #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         NEXTUNREADMSGDIALOG_ALWAYS,
59         NEXTUNREADMSGDIALOG_ASSUME_YES,
60         NEXTUNREADMSGDIALOG_ASSUME_NO
61 } NextUnreadMsgDialogShow;
62
63 struct _PrefsCommon
64 {
65         /* Receive */
66         gboolean use_extinc;
67         gchar *extinc_cmd;
68         gboolean scan_all_after_inc;
69         gboolean autochk_newmail;
70         gint autochk_itv;
71         gboolean chk_on_startup;
72         gboolean newmail_notify_auto;
73         gboolean newmail_notify_manu;
74         gchar   *newmail_notify_cmd;
75         RecvDialogMode recv_dialog_mode;
76         gboolean close_recv_dialog;
77         gboolean no_recv_err_panel;
78
79         /* Send */
80         gboolean savemsg;
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 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         gchar *widgetfont;
125         gchar *textfont;
126         gchar *normalfont;
127         gchar *boldfont;
128         gchar *smallfont;
129
130         gboolean trans_hdr;
131         gboolean display_folder_unread;
132         gint ng_abbrev_len;
133
134         gboolean show_searchbar;
135         gboolean swap_from;
136         gboolean expand_thread;
137         gboolean use_addr_book;
138         gchar *date_format;
139
140         gboolean enable_hscrollbar;
141         gboolean bold_unread;
142         gboolean enable_thread;
143         gboolean thread_by_subject;
144         gint thread_by_subject_max_age; /*!< Max. age of a thread which was threaded
145                                          *   by subject (days) */
146
147         ToolbarStyle toolbar_style;
148         gboolean show_statusbar;
149
150         gint folderview_vscrollbar_policy;
151
152         /* Filtering */
153         GSList *fltlist;
154
155         gint kill_score;
156         gint important_score;
157
158         /* Actions */
159         GSList *actions_list;
160
161         /* Summary columns visibility, position and size */
162         gboolean summary_col_visible[N_SUMMARY_COLS];
163         gint summary_col_pos[N_SUMMARY_COLS];
164         gint summary_col_size[N_SUMMARY_COLS];
165
166         /* Widget visibility, position and size */
167         gint folderwin_x;
168         gint folderwin_y;
169         gint folderview_width;
170         gint folderview_height;
171         gboolean folderview_visible;
172
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 main_msgwin_x;
182         gint main_msgwin_y;
183         gint msgview_width;
184         gint msgview_height;
185         gboolean msgview_visible;
186
187         gint mainview_x;
188         gint mainview_y;
189         gint mainview_width;
190         gint mainview_height;
191         gint mainwin_x;
192         gint mainwin_y;
193         gint mainwin_width;
194         gint mainwin_height;
195
196         gint msgwin_width;
197         gint msgwin_height;
198
199         gint sourcewin_width;
200         gint sourcewin_height;
201
202         gint compose_width;
203         gint compose_height;
204         gint compose_x;
205         gint compose_y;
206
207         /* Message */
208         gboolean enable_color;
209         gulong quote_level1_col;
210         gulong quote_level2_col;
211         gulong quote_level3_col;
212         gulong uri_col;
213         gulong tgt_folder_col;
214         gulong signature_col;
215         gboolean recycle_quote_colors;
216         gboolean conv_mb_alnum;
217         gboolean display_header_pane;
218         gboolean display_header;
219         gboolean head_space;
220         gint line_space;
221         gboolean enable_smooth_scroll;
222         gint scroll_step;
223         gboolean scroll_halfpage;
224
225         gboolean show_other_header;
226         GSList *disphdr_list;
227
228         gboolean attach_desc;
229
230         /* MIME viewer */
231         gchar *mime_image_viewer;
232         gchar *mime_audio_player;
233         gchar *mime_open_cmd;
234         gchar *attach_save_dir;
235
236         GList *mime_open_cmd_history;
237
238         /* Interface */
239         gboolean sep_folder;
240         gboolean sep_msg;
241         gboolean emulate_emacs;
242         gboolean always_show_msg;
243         gboolean open_unread_on_enter;
244         gboolean mark_as_read_on_new_window;
245         gboolean mark_as_read_delay;
246         gboolean open_inbox_on_inc;
247         gboolean immediate_exec;
248         NextUnreadMsgDialogShow next_unread_msg_dialog;
249         gboolean add_address_by_click;
250         gchar *pixmap_theme_path;
251         int hover_timeout; /* msecs mouse hover timeout */
252
253         /* Other */
254         gchar *uri_cmd;
255         gchar *print_cmd;
256         gchar *ext_editor_cmd;
257
258         gboolean cliplog;
259         guint loglength;
260
261         gboolean confirm_on_exit;
262         gboolean clean_on_exit;
263         gboolean ask_on_clean;
264         gboolean warn_queued_on_exit;
265
266         gint io_timeout_secs;
267         
268 #if 0
269 #ifdef USE_OPENSSL
270         gboolean ssl_ask_unknown_valid;
271 #endif
272 #endif
273
274         /* Memory cache*/
275         gint cache_max_mem_usage;
276         gint cache_min_keep_time;
277         
278         /* boolean for work offline 
279            stored here for use in inc.c */
280         gboolean work_offline;
281         
282         gint summary_quicksearch_type;
283         gint summary_quicksearch_sticky;
284         gulong color_new;
285         
286         GList *summary_quicksearch_history;
287 };
288
289 extern PrefsCommon prefs_common;
290
291 void prefs_common_init          (void);
292 void prefs_common_read_config   (void);
293 void prefs_common_write_config  (void);
294 void prefs_common_open          (void);
295 PrefsCommon *prefs_common_get   (void);
296
297 #endif /* __PREFS_COMMON_H__ */