2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2013 Hiroyuki Yamamoto and the Claws Mail team
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 3 of the License, or
8 * (at your option) any later version.
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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __PREFS_COMMON_H__
21 #define __PREFS_COMMON_H__
25 #include "claws-features.h"
30 #include "mainwindow.h"
31 #include "summaryview.h"
32 #include "folderview.h"
36 #include "prefs_msg_colors.h"
37 #include "prefs_summary_open.h"
39 typedef struct _PrefsCommon PrefsCommon;
51 } ComposeDndInsertOrAttach;
58 } TransferEncodingMethod;
62 /* U = unread, N = new, M = marked */
63 SELECTONENTRY_NOTHING,
75 ACTION_UNSET = 0, /* for backward compatibility */
87 NEXTUNREADMSGDIALOG_ALWAYS,
88 NEXTUNREADMSGDIALOG_ASSUME_YES,
89 NEXTUNREADMSGDIALOG_ASSUME_NO
90 } NextUnreadMsgDialogShow;
94 OPENMSG_REQUEST_ONLY = 0,
96 OPENMSG_WHEN_VIEW_VISIBLE
109 AVATARS_ENABLE_CAPTURE = 1,
110 AVATARS_ENABLE_RENDER = 2,
111 AVATARS_ENABLE_BOTH = 3
119 gboolean scan_all_after_inc;
120 gboolean autochk_newmail;
122 gboolean chk_on_startup;
123 gboolean open_inbox_on_inc;
124 gboolean newmail_notify_auto;
125 gboolean newmail_notify_manu;
126 gchar *newmail_notify_cmd;
127 RecvDialogMode recv_dialog_mode;
128 gint receivewin_width;
129 gint receivewin_height;
130 gboolean close_recv_dialog;
131 gboolean no_recv_err_panel;
135 gboolean confirm_send_queued_messages;
136 gboolean send_dialog_invisible;
139 gchar *outgoing_charset;
140 TransferEncodingMethod encoding_method;
141 gboolean outgoing_fallback_to_ascii;
142 gboolean warn_empty_subj;
144 gboolean allow_jisx0201_kana;
149 gboolean linewrap_quote;
150 gboolean linewrap_pastes;
151 gboolean primary_paste_unselects;
153 gboolean auto_indent;
154 gboolean auto_exteditor;
155 gboolean reply_account_autosel;
156 gboolean default_reply_list;
157 gboolean forward_account_autosel;
158 gboolean reedit_account_autosel;
161 gint autosave_length;
162 gboolean autosave_encrypted;
163 gboolean warn_large_insert;
164 gint warn_large_insert_size;
165 gboolean compose_no_markup;
166 ComposeDndInsertOrAttach compose_dnd_mode;
167 gboolean compose_with_format;
168 gchar *compose_subject_format;
169 gchar *compose_body_format;
170 gboolean show_compose_margin;
171 gboolean type_any_header;
174 gboolean reply_with_quote;
179 gboolean forward_as_attachment;
180 gboolean redirect_keep_from;
183 gboolean enable_aspell;
185 gchar *alt_dictionary;
186 gulong misspelled_col;
187 gboolean check_while_typing;
188 gboolean recheck_when_changing_dict;
189 gboolean use_alternate;
190 gboolean use_both_dicts;
194 gchar *widgetfont_gtk1;
195 gchar *textfont_gtk1;
196 gchar *normalfont_gtk1;
197 gchar *boldfont_gtk1;
198 gchar *smallfont_gtk1;
208 gboolean use_different_print_font;
209 gboolean derive_from_normal_font;
212 ColorlabelPrefs custom_colorlabel[COLORLABELS];
215 gboolean display_img;
220 gint display_folder_unread;
223 gboolean show_searchbar;
224 gboolean expand_thread;
226 gboolean use_addr_book;
228 gboolean *msgview_date_format;
230 gboolean use_stripes_everywhere;
231 gboolean use_stripes_in_summaries; /* overrides if use_stripes_everywhere is set to TRUE */
232 gint stripes_color_offset;
233 gboolean enable_hscrollbar;
234 gboolean bold_unread;
235 gboolean next_on_delete;
236 gboolean enable_thread;
237 gboolean thread_by_subject;
238 gint thread_by_subject_max_age; /*!< Max. age of a thread which was threaded
239 * by subject (days) */
240 FolderSortKey default_sort_key;
241 FolderSortType default_sort_type;
243 gchar *last_opened_folder;
244 gboolean goto_last_folder_on_startup;
246 ToolbarStyle toolbar_style;
247 gboolean toolbar_detachable;
248 gboolean show_statusbar;
249 gboolean show_col_headers;
251 gint folderview_vscrollbar_policy;
257 gint important_score;
260 GSList *actions_list;
262 /* Summary columns visibility, position and size */
263 gboolean summary_col_visible[N_SUMMARY_COLS];
264 gint summary_col_pos[N_SUMMARY_COLS];
265 gint summary_col_size[N_SUMMARY_COLS];
267 gboolean folder_col_visible[N_FOLDER_COLS];
268 gint folder_col_pos[N_FOLDER_COLS];
269 gint folder_col_size[N_FOLDER_COLS];
271 /* Widget visibility, position and size */
274 gint folderview_width;
275 gint folderview_height;
276 gboolean folderview_visible;
278 gint summaryview_width;
279 gint summaryview_height;
285 gboolean msgview_visible;
290 gint mainview_height;
295 gint mainwin_maximised;
296 gint mainwin_fullscreen;
297 gint mainwin_menubar;
302 gint mimeview_tree_height;
304 gint sourcewin_width;
305 gint sourcewin_height;
309 gint compose_notebook_height;
314 gboolean enable_color;
315 gboolean enable_bgcolor;
316 gulong quote_level1_col;
317 gulong quote_level2_col;
318 gulong quote_level3_col;
319 gulong quote_level1_bgcol;
320 gulong quote_level2_bgcol;
321 gulong quote_level3_bgcol;
323 gulong tgt_folder_col;
324 gulong signature_col;
326 gboolean recycle_quote_colors;
327 gboolean display_header_pane;
328 gboolean display_header;
329 gboolean display_xface;
331 gboolean render_html;
332 gboolean invoke_plugin_on_html;
333 gboolean promote_html_part;
334 gboolean textview_cursor_visible;
335 gboolean enable_smooth_scroll;
337 gboolean scroll_halfpage;
338 gboolean hide_quoted;
339 gboolean respect_flowed_format;
340 gboolean show_all_headers;
342 gboolean show_other_header;
343 GSList *disphdr_list;
345 gboolean attach_desc;
348 gchar *mime_textviewer;
349 gchar *mime_open_cmd;
350 gchar *attach_save_dir;
351 gchar *attach_load_dir;
353 GList *mime_open_cmd_history;
354 gboolean show_inline_attachments;
357 gboolean addressbook_use_editaddress_dialog;
358 gint addressbook_hpaned_pos;
359 gint addressbook_vpaned_pos;
360 GList *addressbook_custom_attributes;
363 gboolean layout_mode;
365 gint statusbar_update_step;
366 gboolean emulate_emacs;
367 ShowMsgPolicy always_show_msg;
368 gboolean mark_as_read_on_new_window;
369 gboolean mark_as_read_delay;
370 gboolean immediate_exec;
371 SelectOnEntry select_on_entry;
372 gboolean show_tooltips;
374 EntryAction summary_select_prio[SUMMARY_OPEN_ACTIONS-1];
376 NextUnreadMsgDialogShow next_unread_msg_dialog;
377 SummaryFromShow summary_from_show;
378 gboolean add_address_by_click;
379 gchar *pixmap_theme_path;
380 int hover_timeout; /* msecs mouse hover timeout */
381 gboolean ask_mark_all_read;
382 gboolean ask_apply_per_account_filtering_rules;
383 gint apply_per_account_filtering_rules;
391 gchar *ext_editor_cmd;
392 gboolean cmds_use_system_default;
396 gboolean enable_log_standard;
397 gboolean enable_log_warning;
398 gboolean enable_log_error;
399 gboolean enable_log_status;
401 gulong log_msg_color;
402 gulong log_warn_color;
403 gulong log_error_color;
405 gulong log_out_color;
406 gulong log_status_ok_color;
407 gulong log_status_nok_color;
408 gulong log_status_skip_color;
410 gboolean enable_filtering_debug;
411 gint filtering_debug_level;
412 gboolean enable_filtering_debug_inc;
413 gboolean enable_filtering_debug_manual;
414 gboolean enable_filtering_debug_folder_proc;
415 gboolean enable_filtering_debug_pre_proc;
416 gboolean enable_filtering_debug_post_proc;
417 gboolean filtering_debug_cliplog;
418 guint filtering_debug_loglength;
420 gboolean confirm_on_exit;
421 gboolean session_passwords;
422 gboolean clean_on_exit;
423 gboolean ask_on_clean;
424 gboolean warn_queued_on_exit;
426 gint io_timeout_secs;
428 gboolean gtk_can_change_accels;
431 gint cache_max_mem_usage;
432 gint cache_min_keep_time;
434 /* boolean for work offline
435 stored here for use in inc.c */
436 gboolean work_offline;
438 gint summary_quicksearch_type;
439 gint summary_quicksearch_sticky;
440 gint summary_quicksearch_recurse;
441 gint summary_quicksearch_dynamic;
442 gint summary_quicksearch_autorun;
445 GList *summary_quicksearch_history;
446 GList *summary_search_from_history;
447 GList *summary_search_to_history;
448 GList *summary_search_subject_history;
449 GList *summary_search_body_history;
450 GList *summary_search_adv_condition_history;
451 GList *message_search_history;
452 GList *compose_save_to_history;
454 gint filteringwin_width;
455 gint filteringwin_height;
456 gint filteringactionwin_width;
457 gint filteringactionwin_height;
458 gint matcherwin_width;
459 gint matcherwin_height;
460 gint templateswin_width;
461 gint templateswin_height;
462 gint actionswin_width;
463 gint actionswin_height;
466 gint addressbookwin_width;
467 gint addressbookwin_height;
468 gint addressbookeditpersonwin_width;
469 gint addressbookeditpersonwin_height;
470 gint addressbookeditgroupwin_width;
471 gint addressbookeditgroupwin_height;
472 gint pluginswin_width;
473 gint pluginswin_height;
475 gint prefswin_height;
476 gint folderitemwin_width;
477 gint folderitemwin_height;
478 gchar *zero_replacement;
479 gint editaccountwin_width;
480 gint editaccountwin_height;
481 gint accountswin_width;
482 gint accountswin_height;
485 gint filtering_debugwin_width;
486 gint filtering_debugwin_height;
487 gint folderselwin_width;
488 gint folderselwin_height;
489 gint addressaddwin_width;
490 gint addressaddwin_height;
491 gint addressbook_folderselwin_width;
492 gint addressbook_folderselwin_height;
494 gint aboutwin_height;
495 gint addrgather_width;
496 gint addrgather_height;
497 gint news_subscribe_width;
498 gint news_subscribe_height;
501 gint broken_are_utf8;
502 gint skip_ssl_cert_check;
503 gint live_dangerously;
504 gint save_parts_readwrite;
505 gint never_send_retrcpt;
507 gboolean unsafe_ssl_certs;
508 gboolean real_time_sync;
510 gchar *print_paper_type;
511 gint print_paper_orientation;
512 gint print_margin_top;
513 gint print_margin_bottom;
514 gint print_margin_left;
515 gint print_margin_right;
517 gint print_use_color;
518 gint print_use_collate;
519 gint print_use_reverse;
520 gint print_use_duplex;
522 gint print_previewwin_width;
523 gint print_previewwin_height;
525 gboolean use_networkmanager;
527 gboolean two_line_vert;
528 gboolean inherit_folder_props;
529 gboolean flush_metadata;
531 gint nav_history_length;
533 gulong diff_added_color;
534 gulong diff_deleted_color;
535 gulong diff_hunk_color;
537 gboolean folder_search_wildcard;
538 gboolean address_search_wildcard;
540 guint enable_avatars;
542 #ifndef PASSWORD_CRYPTO_OLD
543 gboolean use_master_passphrase;
544 gchar *master_passphrase_hash;
548 extern PrefsCommon prefs_common;
550 PrefsCommon *prefs_common_get_prefs(void);
552 GList *prefs_common_read_history_from_dir_with_defaults(const gchar *dirname, const gchar *history,
553 GList *default_list);
554 void prefs_common_read_config (void);
555 void prefs_common_write_config (void);
556 void prefs_common_open (void);
557 void pref_get_unescaped_pref(gchar *out, const gchar *in);
558 void pref_get_escaped_pref(gchar *out, const gchar *in);
559 void pref_set_textview_from_pref(GtkTextView *textview, const gchar *txt);
560 void pref_set_entry_from_pref(GtkEntry *entry, const gchar *txt);
561 gchar *pref_get_pref_from_textview(GtkTextView *textview);
562 gchar *pref_get_pref_from_entry(GtkEntry *entry);
563 const gchar *prefs_common_translated_header_name(const gchar *header_name);
564 const gchar *prefs_common_get_uri_cmd(void);
565 const gchar *prefs_common_get_ext_editor_cmd(void);
566 #endif /* __PREFS_COMMON_H__ */