talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

mainwindow.h (6107B)


      1 /*
      2  * Claws Mail -- a GTK based, lightweight, and fast e-mail client
      3  * Copyright (C) 1999-2024 the Claws Mail team and 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 3 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, see <http://www.gnu.org/licenses/>.
     17  */
     18 
     19 #ifndef __MAINWINDOW_H__
     20 #define __MAINWINDOW_H__
     21 
     22 #include <glib.h>
     23 
     24 typedef struct _MainWindow  MainWindow;
     25 
     26 #include "viewtypes.h"
     27 #include "gtk/logwindow.h"
     28 #include "procmsg.h"
     29 #include "toolbar.h"
     30 
     31 #define OFFLINE_SWITCH_HOOKLIST "offline_switch"
     32 #define ACCOUNT_LIST_CHANGED_HOOKLIST "account_list_changed"
     33 #define MAIN_WINDOW_CLOSE "mainwindow_close"
     34 #define MAIN_WINDOW_GOT_ICONIFIED "mainwindow_iconified"
     35 #define THEME_CHANGED_HOOKLIST "theme_changed"
     36 typedef enum
     37 {
     38 	M_UNLOCKED,
     39 	M_MSG_EXIST,
     40 	M_TARGET_EXIST,
     41 	M_SINGLE_TARGET_EXIST,
     42 	M_EXEC,
     43 	M_ALLOW_REEDIT,
     44 	M_HAVE_ACCOUNT,
     45 	M_THREADED,
     46 	M_UNTHREADED,
     47 	M_ALLOW_DELETE,
     48 	M_INC_ACTIVE,
     49 	M_SEND_ACTIVE,
     50 	M_NEWS,
     51 	M_HAVE_NEWS_ACCOUNT,
     52 	M_HIDE_READ_MSG,
     53 	M_DELAY_EXEC,
     54 	M_NOT_NEWS,
     55 	M_ACTIONS_EXIST,
     56 	M_HAVE_QUEUED_MAILS,
     57 	M_TAGS_EXIST,
     58 	M_HAVE_PROCESSING,
     59 	M_SUMMARY_ISLIST,
     60 	M_IN_MSGLIST,
     61 	M_HAVE_MULTI_ACCOUNT,
     62 	M_FOLDER_SELECTED,
     63 	M_SESSION_PASSWORDS,
     64 	M_MASTER_PASSPHRASE,
     65 	M_DELETED_EXISTS,
     66 	M_NOT_TRASH,
     67 	M_HIDE_READ_THREADS,
     68 	M_HAVE_RETRIEVABLE_ACCOUNT,
     69 	M_HAVE_ANY_RETRIEVABLE_ACCOUNT,
     70 	M_NOT_DRAFT,
     71 	M_MSG_SELECTED,
     72 
     73 /* reserved */
     74     M_MAX_RESERVED
     75 } SensitiveCond;
     76 
     77 typedef guint64 SensitiveCondMask;
     78 
     79 typedef enum
     80 {
     81 	NORMAL_LAYOUT       = 0,
     82 	VERTICAL_LAYOUT     = 1 << 0,
     83 } LayoutType;
     84 
     85 typedef enum
     86 {
     87 	TOOLBAR_NONE		= 0,
     88 	TOOLBAR_ICON		= 1,
     89 	TOOLBAR_TEXT		= 2,
     90 	TOOLBAR_BOTH		= 3,
     91 	TOOLBAR_BOTH_HORIZ	= 4
     92 } ToolbarStyle;
     93 
     94 struct _MainWindow
     95 {
     96 	GtkWidget *hpaned;
     97 	GtkWidget *vpaned;
     98 
     99 	GtkWidget *window;
    100 	GtkWidget *vbox;
    101 	GtkWidget *menubar;
    102 
    103 	/* Toolbar handlebox */
    104 	GtkWidget *handlebox;
    105 	Toolbar *toolbar;
    106 
    107 	/* body */
    108 	GtkWidget *vbox_body;
    109 	GtkWidget *hbox_stat;
    110 	GtkWidget *statusbar;
    111 	GtkWidget *progressbar;
    112 	GtkWidget *statuslabel;
    113 	GtkWidget *ac_button;
    114 	GtkWidget *ac_label;
    115 	GtkWidget *ac_menu;
    116 	GtkWidget *online_switch;
    117 	GtkWidget *offline_switch;
    118 	GtkWidget *online_pixmap;
    119 	GtkWidget *offline_pixmap;
    120 
    121 	/* context IDs for status bar */
    122 	gint mainwin_cid;
    123 	gint folderview_cid;
    124 	gint summaryview_cid;
    125 	gint messageview_cid;
    126 
    127 	ToolbarStyle toolbar_style;
    128 
    129 	guint lock_count;
    130 	guint menu_lock_count;
    131 	guint cursor_count;
    132 
    133 	FolderView	*folderview;
    134 	SummaryView	*summaryview;
    135 	MessageView	*messageview;
    136 	LogWindow	*logwin;
    137 	LogWindow	*filtering_debugwin;
    138 
    139 	gint	progressindicator_hook;
    140 
    141 	GtkWidget	*warning_btn;
    142 	GtkWidget 	*tags_menu;
    143 
    144 	gboolean	 in_folder;
    145 	GtkActionGroup	*action_group;
    146 	GtkUIManager	*ui_manager;
    147 };
    148 
    149 MainWindow *main_window_create		(void);
    150 
    151 void main_window_update_actions_menu	(MainWindow	*mainwin);
    152 
    153 void main_window_cursor_wait		(MainWindow	*mainwin);
    154 void main_window_cursor_normal		(MainWindow	*mainwin);
    155 
    156 void main_window_lock			(MainWindow	*mainwin);
    157 void main_window_unlock			(MainWindow	*mainwin);
    158 
    159 void main_window_reflect_prefs_all_real	(gboolean 	 pixmap_theme_changed);
    160 void main_window_reflect_prefs_all	(void);
    161 void main_window_reflect_prefs_all_now	(void);
    162 void main_window_reflect_prefs_custom_colors(MainWindow 	*mainwindow);
    163 void main_window_reflect_tags_changes(MainWindow 	*mainwindow);
    164 void main_window_set_summary_column	(void);
    165 void main_window_set_folder_column	(void);
    166 void main_window_set_account_menu	(GList		*account_list);
    167 void main_window_set_account_menu_only_toolbar	(GList		*account_list);
    168 
    169 /* Mailing list support */
    170 void main_create_mailing_list_menu 	(MainWindow *mainwin, MsgInfo *msginfo);
    171 gint mailing_list_get_list_post_mailto 	(gchar **url, gchar *mailto, gint maxlen);
    172 
    173 void main_window_toggle_message_view	(MainWindow *mainwin);
    174 
    175 void main_window_get_size		(MainWindow	*mainwin);
    176 void main_window_get_position		(MainWindow	*mainwin);
    177 
    178 void main_window_progress_on		(MainWindow	*mainwin);
    179 void main_window_progress_off		(MainWindow	*mainwin);
    180 gboolean main_window_empty_trash	(MainWindow	*mainwin,
    181 					 gboolean	 confirm,
    182 					 gboolean 	 for_quit);
    183 
    184 SensitiveCondMask main_window_get_mask(SensitiveCond cond, ...);
    185 
    186 void main_window_set_menu_sensitive	(MainWindow	*mainwin);
    187 
    188 
    189 void main_window_show			(MainWindow 	*mainwin);
    190 void main_window_hide			(MainWindow 	*mainwin);
    191 void main_window_popup			(MainWindow	*mainwin);
    192 
    193 SensitiveCondMask main_window_get_current_state   (MainWindow *mainwin);
    194 
    195 void toolbar_set_compose_button               (Toolbar		 *toolbar,
    196 					       ComposeButtonType  compose_btn_type);
    197 void main_window_destroy_all                  (void);
    198 
    199 void main_window_toggle_work_offline          (MainWindow        *mainwin,
    200                                                gboolean           offline,
    201 					       gboolean		  ask_sync);
    202 
    203 MainWindow *mainwindow_get_mainwindow 	      (void);
    204 void mainwindow_jump_to			      (const gchar 	 *target,
    205 					       gboolean popup);
    206 void mainwindow_show_error		      (void);
    207 void mainwindow_clear_error		      (MainWindow *mainwin);
    208 void mainwindow_delete_duplicated     (MainWindow *mainwin);
    209 void mainwindow_delete_duplicated_all (MainWindow *mainwin);
    210 gboolean mainwindow_is_obscured		      (void);
    211 void mainwindow_exit_folder		      (MainWindow *mainwin);
    212 void mainwindow_enter_folder		      (MainWindow *mainwin);
    213 void mainwindow_reset_paned		      (GtkPaned *paned);
    214 
    215 void mainwin_accel_changed_cb (GtkAccelGroup *accelgroup, guint keyval, GdkModifierType modifier,
    216 				  GClosure *closure, GtkMenuItem *item);
    217 
    218 void mainwindow_import_mbox(const gchar* mbox_file);
    219 
    220 #endif /* __MAINWINDOW_H__ */