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