0.8.5claws179
[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         SEND_DIALOG_ALWAYS,
44         /* SEND_DIALOG_ACTIVE would be irrelevant */
45         SEND_DIALOG_NEVER
46 } SendDialogMode;
47
48 typedef enum
49 {
50         NEXTUNREADMSGDIALOG_ALWAYS,
51         NEXTUNREADMSGDIALOG_ASSUME_YES,
52         NEXTUNREADMSGDIALOG_ASSUME_NO
53 } NextUnreadMsgDialogShow;
54
55 struct _PrefsCommon
56 {
57         /* Receive */
58         gboolean use_extinc;
59         gchar *extinc_cmd;
60         gboolean inc_local;
61         gboolean filter_on_inc;
62         gchar *spool_path;
63         gboolean scan_all_after_inc;
64         gboolean autochk_newmail;
65         gint autochk_itv;
66         gboolean chk_on_startup;
67         gboolean newmail_notify_auto;
68         gboolean newmail_notify_manu;
69         gchar   *newmail_notify_cmd;
70         gint max_articles;
71
72         /* Send */
73         gboolean use_extsend;
74         gchar *extsend_cmd;
75         gboolean savemsg;
76         gboolean queue_msg;
77         gchar *outgoing_charset;
78
79         /* Compose */
80         gboolean auto_sig;
81         gchar *sig_sep;
82         gint undolevels;
83         gint linewrap_len;
84         gboolean linewrap_quote;
85         gboolean autowrap;
86         gboolean linewrap_at_send;
87         gboolean auto_exteditor;
88         gboolean reply_account_autosel;
89         gboolean default_reply_list;
90         gboolean forward_account_autosel;
91         gboolean reedit_account_autosel;
92         gboolean show_ruler;
93         gboolean autosave;
94         gint autosave_length;
95         
96         /* Quote */
97         gboolean reply_with_quote;
98         gchar *quotemark;
99         gchar *quotefmt;
100         gchar *fw_quotemark;
101         gchar *fw_quotefmt;
102         gboolean forward_as_attachment;
103         gboolean redirect_keep_from;
104         gboolean smart_wrapping;
105         gboolean block_cursor;
106         gchar *quote_chars;
107         
108 #if USE_ASPELL
109         gboolean enable_aspell;
110         gchar *aspell_path;
111         gchar *dictionary;
112         gint misspelled_col;
113         gint aspell_sugmode;
114         gboolean check_while_typing;
115         gboolean use_alternate;
116 #endif
117         
118         /* Display */
119         gchar *widgetfont;
120         gchar *textfont;
121         gchar *normalfont;
122         gchar *boldfont;
123         gchar *smallfont;
124         gboolean display_folder_unread;
125         gboolean display_img;
126         gint ng_abbrev_len;
127         ToolbarStyle toolbar_style;
128         gboolean show_statusbar;
129         gboolean show_searchbar;
130         gboolean trans_hdr;
131         gboolean enable_thread;
132         gboolean enable_hscrollbar;
133         gboolean expand_thread;
134         gboolean bold_unread;
135         gboolean swap_from;
136         gboolean use_addr_book;
137         gchar *date_format;
138
139         gint folderview_vscrollbar_policy;
140
141         /* Filtering */
142         GSList *fltlist;
143
144         gint kill_score;
145         gint important_score;
146
147         /* Actions */
148         GSList *actions_list;
149
150         /* Summary columns visibility, position and size */
151         gboolean summary_col_visible[N_SUMMARY_COLS];
152         gint summary_col_pos[N_SUMMARY_COLS];
153         gint summary_col_size[N_SUMMARY_COLS];
154
155         /* Widget size */
156         gint folderview_x;
157         gint folderview_y;
158         gint folderview_width;
159         gint folderview_height;
160         gint folder_col_folder;
161         gint folder_col_new;
162         gint folder_col_unread;
163         gint folder_col_total;
164
165         gint summaryview_width;
166         gint summaryview_height;
167
168         gint mainview_x;
169         gint mainview_y;
170         gint mainview_width;
171         gint mainview_height;
172         gint mainwin_x;
173         gint mainwin_y;
174         gint mainwin_width;
175         gint mainwin_height;
176
177         gint msgwin_width;
178         gint msgwin_height;
179
180         gint compose_width;
181         gint compose_height;
182
183         /* Message */
184         gboolean enable_color;
185         gint quote_level1_col;
186         gint quote_level2_col;
187         gint quote_level3_col;
188         gint uri_col;
189         gint tgt_folder_col;
190         gint signature_col;
191         gboolean recycle_quote_colors;
192         gboolean conv_mb_alnum;
193         gboolean display_header_pane;
194         gboolean display_header;
195         gboolean head_space;
196         gint line_space;
197         gboolean enable_smooth_scroll;
198         gint scroll_step;
199         gboolean scroll_halfpage;
200
201         gchar *force_charset;
202
203         gboolean show_other_header;
204         GSList *disphdr_list;
205
206         /* MIME viewer */
207         gchar *mime_image_viewer;
208         gchar *mime_audio_player;
209         gchar *mime_open_cmd;
210
211         GList *mime_open_cmd_history;
212
213 #if USE_GPGME
214         /* Privacy */
215         gboolean auto_check_signatures;
216         gboolean gpg_signature_popup;
217         gboolean store_passphrase;
218         gint store_passphrase_timeout;
219         gboolean passphrase_grab;
220         gboolean gpg_warning;
221 #endif /* USE_GPGME */
222
223         /* Interface */
224         gboolean sep_folder;
225         gboolean sep_msg;
226         gboolean emulate_emacs;
227         gboolean show_msg_with_cursor_key;
228         gboolean open_unread_on_enter;
229         gboolean mark_as_read_on_new_window;
230         gboolean open_inbox_on_inc;
231         gboolean immediate_exec;
232         RecvDialogMode recv_dialog_mode;
233         SendDialogMode send_dialog_mode;
234         gboolean close_recv_dialog;
235         gboolean no_recv_err_panel;
236         NextUnreadMsgDialogShow next_unread_msg_dialog;
237         gboolean add_address_by_click;
238         gchar *pixmap_theme_path;
239
240         /* Other */
241         gchar *uri_cmd;
242         gchar *print_cmd;
243         gchar *ext_editor_cmd;
244
245         gboolean cliplog;
246         guint loglength;
247
248         gboolean confirm_on_exit;
249         gboolean clean_on_exit;
250         gboolean ask_on_clean;
251         gboolean warn_queued_on_exit;
252
253         /* Memory cache*/
254         gint cache_max_mem_usage;
255         gint cache_min_keep_time;
256         
257         /* boolean for work offline 
258            stored here for use in inc.c */
259         gboolean work_offline;
260
261 };
262
263 extern PrefsCommon prefs_common;
264
265 void prefs_common_init          ();
266 void prefs_common_read_config   (void);
267 void prefs_common_save_config   (void);
268 void prefs_common_open          (void);
269
270 #endif /* __PREFS_COMMON_H__ */