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