2 * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2016 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/>.
19 #ifndef __PREFS_COMMON_H__
20 #define __PREFS_COMMON_H__
24 #include "claws-features.h"
29 #include "mainwindow.h"
30 #include "summaryview.h"
31 #include "folderview.h"
35 #include "prefs_msg_colors.h"
36 #include "prefs_summary_open.h"
38 #define CLAWS_CONFIG_VERSION 3
40 typedef struct _PrefsCommon PrefsCommon;
52 } ComposeDndInsertOrAttach;
59 } TransferEncodingMethod;
63 /* U = unread, N = new, M = marked */
64 SELECTONENTRY_NOTHING,
76 ACTION_UNSET = 0, /* for backward compatibility */
91 NEXTUNREADMSGDIALOG_ALWAYS,
92 NEXTUNREADMSGDIALOG_ASSUME_YES,
93 NEXTUNREADMSGDIALOG_ASSUME_NO
94 } NextUnreadMsgDialogShow;
106 AVATARS_ENABLE_CAPTURE = 1,
107 AVATARS_ENABLE_RENDER = 2,
108 AVATARS_ENABLE_BOTH = 3
125 COL_DEFAULT_HEADER_BG,
154 gboolean scan_all_after_inc;
155 gboolean autochk_newmail;
157 gboolean chk_on_startup;
158 gboolean open_inbox_on_inc;
159 gboolean newmail_notify_auto;
160 gboolean newmail_notify_manu;
161 gchar *newmail_notify_cmd;
162 RecvDialogMode recv_dialog_mode;
163 gint receivewin_width;
164 gint receivewin_height;
165 gboolean close_recv_dialog;
166 gboolean no_recv_err_panel;
170 gboolean confirm_send_queued_messages;
171 gboolean send_dialog_invisible;
174 gchar *outgoing_charset;
175 TransferEncodingMethod encoding_method;
176 gboolean outgoing_fallback_to_ascii;
177 gboolean rewrite_first_from;
178 gboolean warn_empty_subj;
179 gint warn_sending_many_recipients_num;
180 gboolean hide_timezone;
181 gboolean allow_jisx0201_kana;
186 gboolean linewrap_quote;
187 gboolean linewrap_pastes;
188 gboolean primary_paste_unselects;
190 gboolean auto_indent;
191 gboolean auto_exteditor;
192 gboolean reply_account_autosel;
193 gboolean default_reply_list;
194 gboolean forward_account_autosel;
195 gboolean reedit_account_autosel;
198 gint autosave_length;
199 gboolean autosave_encrypted;
200 gboolean warn_large_insert;
201 gint warn_large_insert_size;
202 gboolean compose_no_markup;
203 ComposeDndInsertOrAttach compose_dnd_mode;
204 gboolean compose_with_format;
205 gchar *compose_subject_format;
206 gchar *compose_body_format;
207 gboolean show_compose_margin;
208 gboolean type_any_header;
211 gboolean reply_with_quote;
216 gboolean forward_as_attachment;
217 gboolean redirect_keep_from;
220 gboolean enable_aspell;
222 gchar *alt_dictionary;
223 gboolean check_while_typing;
224 gboolean recheck_when_changing_dict;
225 gboolean use_alternate;
226 gboolean use_both_dicts;
236 gboolean use_different_print_font;
237 gboolean derive_from_normal_font;
240 ColorlabelPrefs custom_colorlabel[COLORLABELS];
243 gulong color[COL_LAST_COLOR_INDEX];
246 gboolean display_img;
251 gint display_folder_unread;
254 gboolean show_searchbar;
256 gboolean use_addr_book;
258 gboolean *msgview_date_format;
260 gboolean use_stripes_everywhere;
261 gboolean use_stripes_in_summaries; /* overrides if use_stripes_everywhere is set to TRUE */
262 gint stripes_color_offset;
263 gboolean enable_hscrollbar;
264 gboolean bold_unread;
265 gboolean next_on_delete;
266 gboolean thread_by_subject;
267 gint thread_by_subject_max_age; /*!< Max. age of a thread which was threaded
268 * by subject (days) */
269 FolderSortKey default_sort_key;
270 FolderSortType default_sort_type;
271 gboolean folder_default_thread;
272 gboolean folder_default_thread_collapsed;
273 gboolean folder_default_hide_read_threads;
274 gboolean folder_default_hide_read_msgs;
275 gboolean folder_default_hide_del_msgs;
277 gchar *last_opened_folder;
278 gboolean goto_last_folder_on_startup;
280 ToolbarStyle toolbar_style;
281 gboolean toolbar_detachable;
282 gboolean show_statusbar;
283 gboolean show_col_headers;
285 gint folderview_vscrollbar_policy;
291 gint important_score;
294 GSList *actions_list;
296 /* Summary lock column headers */
297 gboolean summary_col_lock;
299 /* Summary columns visibility, position and size */
300 gboolean summary_col_visible[N_SUMMARY_COLS];
301 gint summary_col_pos[N_SUMMARY_COLS];
302 gint summary_col_size[N_SUMMARY_COLS];
304 gboolean folder_col_visible[N_FOLDER_COLS];
305 gint folder_col_pos[N_FOLDER_COLS];
306 gint folder_col_size[N_FOLDER_COLS];
308 /* Widget visibility, position and size */
311 gint folderview_width;
312 gint folderview_height;
313 gboolean folderview_visible;
315 gint summaryview_width;
316 gint summaryview_height;
322 gboolean msgview_visible;
327 gint mainview_height;
332 gint mainwin_maximised;
333 gint mainwin_fullscreen;
334 gint mainwin_menubar;
339 gint mimeview_tree_height;
341 gint sourcewin_width;
342 gint sourcewin_height;
346 gint compose_notebook_height;
351 gboolean enable_color;
352 gboolean enable_bgcolor;
353 gboolean recycle_quote_colors;
354 gboolean display_header_pane;
355 gboolean display_header;
356 gboolean display_xface;
358 gboolean render_html;
359 gboolean invoke_plugin_on_html;
360 gboolean promote_html_part;
361 gboolean textview_cursor_visible;
362 gboolean enable_smooth_scroll;
364 gboolean scroll_halfpage;
365 gboolean hide_quoted;
366 gboolean respect_flowed_format;
367 gboolean show_all_headers;
369 gboolean show_other_header;
370 GSList *disphdr_list;
372 gboolean attach_desc;
375 gchar *mime_textviewer;
376 gchar *mime_open_cmd;
377 gchar *attach_save_dir;
378 gchar *attach_load_dir;
380 GList *mime_open_cmd_history;
381 gboolean show_inline_attachments;
384 gboolean addressbook_use_editaddress_dialog;
385 gint addressbook_hpaned_pos;
386 gint addressbook_vpaned_pos;
387 GList *addressbook_custom_attributes;
390 LayoutType layout_mode;
392 gint statusbar_update_step;
393 gboolean emulate_emacs;
395 gboolean open_selected_on_folder_open;
396 gboolean open_selected_on_search_results;
397 gboolean open_selected_on_prevnext;
398 gboolean open_selected_on_deletemove;
399 gboolean open_selected_on_directional;
400 gboolean always_show_msg;
402 gboolean mark_as_read_on_new_window;
403 gboolean mark_as_read_delay;
404 gboolean immediate_exec;
405 SelectOnEntry select_on_entry;
406 gboolean show_tooltips;
408 EntryAction summary_select_prio[SUMMARY_OPEN_ACTIONS-1];
410 NextUnreadMsgDialogShow next_unread_msg_dialog;
411 SummaryFromShow summary_from_show;
412 gboolean add_address_by_click;
413 gchar *pixmap_theme_path;
415 gboolean enable_alpha_svg;
416 gboolean enable_pixmap_scaling;
417 gboolean pixmap_scaling_auto;
418 gint pixmap_scaling_ppi;
420 int hover_timeout; /* msecs mouse hover timeout */
421 gboolean ask_mark_all_read;
422 gboolean ask_override_colorlabel;
423 gboolean ask_apply_per_account_filtering_rules;
424 gint apply_per_account_filtering_rules;
432 gchar *ext_editor_cmd;
433 gboolean cmds_use_system_default;
437 gboolean enable_log_standard;
438 gboolean enable_log_warning;
439 gboolean enable_log_error;
440 gboolean enable_log_status;
442 gboolean enable_filtering_debug;
443 gint filtering_debug_level;
444 gboolean enable_filtering_debug_inc;
445 gboolean enable_filtering_debug_manual;
446 gboolean enable_filtering_debug_folder_proc;
447 gboolean enable_filtering_debug_pre_proc;
448 gboolean enable_filtering_debug_post_proc;
449 gboolean filtering_debug_cliplog;
450 guint filtering_debug_loglength;
452 gboolean confirm_on_exit;
453 gboolean session_passwords;
454 gboolean clean_on_exit;
455 gboolean ask_on_clean;
456 gboolean warn_queued_on_exit;
458 gint io_timeout_secs;
460 gboolean gtk_can_change_accels;
463 gint cache_max_mem_usage;
464 gint cache_min_keep_time;
466 /* boolean for work offline
467 stored here for use in inc.c */
468 gboolean work_offline;
470 gint summary_quicksearch_type;
471 gint summary_quicksearch_sticky;
472 gint summary_quicksearch_recurse;
473 gint summary_quicksearch_dynamic;
474 gint summary_quicksearch_autorun;
476 GList *summary_quicksearch_history;
477 GList *summary_search_from_history;
478 GList *summary_search_to_history;
479 GList *summary_search_subject_history;
480 GList *summary_search_body_history;
481 GList *summary_search_adv_condition_history;
482 GList *message_search_history;
483 GList *compose_save_to_history;
485 gint filteringwin_width;
486 gint filteringwin_height;
487 gint filteringactionwin_width;
488 gint filteringactionwin_height;
489 gint matcherwin_width;
490 gint matcherwin_height;
491 gint templateswin_width;
492 gint templateswin_height;
493 gint actionswin_width;
494 gint actionswin_height;
495 gint actionsiodialog_width;
496 gint actionsiodialog_height;
499 gint addressbookwin_width;
500 gint addressbookwin_height;
501 gint addressbookeditpersonwin_width;
502 gint addressbookeditpersonwin_height;
503 gint addressbookeditgroupwin_width;
504 gint addressbookeditgroupwin_height;
505 gint pluginswin_width;
506 gint pluginswin_height;
508 gint prefswin_height;
509 gint folderitemwin_width;
510 gint folderitemwin_height;
511 gchar *zero_replacement;
512 gint editaccountwin_width;
513 gint editaccountwin_height;
514 gint accountswin_width;
515 gint accountswin_height;
518 gint filtering_debugwin_width;
519 gint filtering_debugwin_height;
520 gint folderselwin_width;
521 gint folderselwin_height;
522 gint addressaddwin_width;
523 gint addressaddwin_height;
524 gint addressbook_folderselwin_width;
525 gint addressbook_folderselwin_height;
527 gint aboutwin_height;
528 gint addrgather_width;
529 gint addrgather_height;
530 gint news_subscribe_width;
531 gint news_subscribe_height;
534 gint broken_are_utf8;
535 gint skip_ssl_cert_check;
536 gint live_dangerously;
537 gint save_parts_readwrite;
538 gint never_send_retrcpt;
540 gboolean unsafe_ssl_certs;
541 gboolean real_time_sync;
543 gchar *print_paper_type;
544 gint print_paper_orientation;
545 gint print_margin_top;
546 gint print_margin_bottom;
547 gint print_margin_left;
548 gint print_margin_right;
550 gint print_use_color;
551 gint print_use_collate;
552 gint print_use_reverse;
553 gint print_use_duplex;
555 gint print_previewwin_width;
556 gint print_previewwin_height;
558 gboolean use_networkmanager;
560 gboolean two_line_vert;
561 gboolean inherit_folder_props;
562 gboolean flush_metadata;
564 gint nav_history_length;
566 gboolean folder_search_wildcard;
567 gboolean address_search_wildcard;
569 guint enable_avatars;
571 #ifndef PASSWORD_CRYPTO_OLD
572 gboolean use_master_passphrase;
573 gchar *master_passphrase;
574 gchar *master_passphrase_salt;
575 guint master_passphrase_pbkdf2_rounds;
580 ProxyInfo proxy_info;
583 extern PrefsCommon prefs_common;
585 PrefsCommon *prefs_common_get_prefs(void);
587 GList *prefs_common_read_history_from_dir_with_defaults(const gchar *dirname, const gchar *history,
588 GList *default_list);
589 void prefs_common_read_config (void);
590 void prefs_common_write_config (void);
591 void prefs_common_open (void);
592 void pref_get_unescaped_pref(gchar *out, const gchar *in);
593 void pref_get_escaped_pref(gchar *out, const gchar *in);
594 void pref_set_textview_from_pref(GtkTextView *textview, const gchar *txt);
595 void pref_set_entry_from_pref(GtkEntry *entry, const gchar *txt);
596 gchar *pref_get_pref_from_textview(GtkTextView *textview);
597 gchar *pref_get_pref_from_entry(GtkEntry *entry);
598 const gchar *prefs_common_translated_header_name(const gchar *header_name);
599 const gchar *prefs_common_get_uri_cmd(void);
600 const gchar *prefs_common_get_ext_editor_cmd(void);
602 #define OPEN_SELECTED(when) (prefs_common.always_show_msg || prefs_common.when)
604 #define OPEN_SELECTED_ON_FOLDER_OPEN OPEN_SELECTED(open_selected_on_folder_open)
605 #define OPEN_SELECTED_ON_SEARCH_RESULTS OPEN_SELECTED(open_selected_on_search_results)
606 #define OPEN_SELECTED_ON_PREVNEXT OPEN_SELECTED(open_selected_on_prevnext)
607 #define OPEN_SELECTED_ON_DELETEMOVE OPEN_SELECTED(open_selected_on_deletemove)
608 #define OPEN_SELECTED_ON_DIRECTIONAL OPEN_SELECTED(open_selected_on_directional)
610 #endif /* __PREFS_COMMON_H__ */