cleaned up conflicting declarations of imageview_show_image()
[claws.git] / src / mainwindow.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2001 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 __MAINWINDOW_H__
21 #define __MAINWINDOW_H__
22
23 #include <glib.h>
24
25 typedef struct _MainWindow  MainWindow;
26 typedef struct _MainToolbar MainToolbar;
27
28 #include "folderview.h"
29 #include "summaryview.h"
30 #include "headerview.h"
31 #include "messageview.h"
32 #include "logwindow.h"
33 #include "toolbar.h"
34
35 typedef enum
36 {
37         M_UNLOCKED            = 1 << 0,
38         M_MSG_EXIST           = 1 << 1,
39         M_TARGET_EXIST        = 1 << 2,
40         M_SINGLE_TARGET_EXIST = 1 << 3,
41         M_EXEC                = 1 << 4,
42         M_ALLOW_REEDIT        = 1 << 5,
43         M_HAVE_ACCOUNT        = 1 << 6,
44         M_THREADED            = 1 << 7,
45         M_UNTHREADED          = 1 << 8,
46         M_ALLOW_DELETE        = 1 << 9,
47         M_INC_ACTIVE          = 1 << 10,
48         M_NEWS                = 1 << 11,
49         M_HAVE_NEWS_ACCOUNT   = 1 << 12,
50         M_HIDE_READ_MSG       = 1 << 13,
51         M_DELAY_EXEC          = 1 << 14,
52         M_NOT_NEWS            = 1 << 15,
53 } SensitiveCond;
54
55 typedef enum
56 {
57         SEPARATE_NONE    = 0,
58         SEPARATE_FOLDER  = 1 << 0,
59         SEPARATE_MESSAGE = 1 << 1,
60         SEPARATE_BOTH    = (SEPARATE_FOLDER | SEPARATE_MESSAGE)
61 } SeparateType;
62
63 typedef enum
64 {
65         TOOLBAR_NONE    = 0,
66         TOOLBAR_ICON    = 1,
67         TOOLBAR_TEXT    = 2,
68         TOOLBAR_BOTH    = 3
69 } ToolbarStyle;
70
71 struct _MainWindow
72 {
73         SeparateType type;
74
75         union CompositeWin {
76                 struct 
77                 {
78                         GtkWidget *hpaned;
79                         GtkWidget *vpaned;
80                 } sep_none;
81                 struct {
82                         GtkWidget *folderwin;
83                         GtkWidget *vpaned;
84                 } sep_folder;
85                 struct {
86                         GtkWidget *messagewin;
87                         GtkWidget *hpaned;
88                 } sep_message;
89                 struct {
90                         GtkWidget *folderwin;
91                         GtkWidget *messagewin;
92                 } sep_both;
93         } win;
94
95         GtkWidget *window;
96         GtkWidget *vbox;
97         GtkWidget *menubar;
98
99         GtkItemFactory *menu_factory;
100         
101         /* Toolbar handlebox */
102         GtkWidget *handlebox;
103         
104         MainToolbar *toolbar;
105
106         /* body */
107         GtkWidget *vbox_body;
108         GtkWidget *hbox_stat;
109         GtkWidget *statusbar;
110         GtkWidget *progressbar;
111         GtkWidget *statuslabel;
112         GtkWidget *ac_button;
113         GtkWidget *ac_label;
114         GtkWidget *ac_menu;
115         GtkWidget *online_switch;
116         GtkWidget *offline_switch;
117         GtkWidget *online_pixmap;
118         GtkWidget *offline_pixmap;
119
120         /* context IDs for status bar */
121         gint mainwin_cid;
122         gint folderview_cid;
123         gint summaryview_cid;
124
125         ToolbarStyle toolbar_style;
126
127         guint lock_count;
128         guint menu_lock_count;
129         guint cursor_count;
130
131         FolderView      *folderview;
132         SummaryView     *summaryview;
133         MessageView     *messageview;
134         LogWindow       *logwin;
135 };
136 typedef enum 
137 {
138         COMPOSEBUTTON_MAIL,
139         COMPOSEBUTTON_NEWS
140 } ComposeButtonType;
141
142 struct _MainToolbar {
143
144         GtkWidget *toolbar;
145
146         GtkWidget *get_btn;
147         GtkWidget *getall_btn;
148         GtkWidget *sel_down;
149         GtkWidget *sel_down_all;
150         GtkWidget *sel_down_cur;
151         GtkWidget *send_btn;
152
153         GtkWidget *compose_mail_btn;
154         GtkWidget *compose_news_btn;
155
156         GtkWidget *reply_btn;
157         GtkWidget *replysender_btn;
158         GtkWidget *replyall_btn;
159         GtkWidget *replylist_btn;
160
161         GtkWidget *fwd_btn;
162
163         GtkWidget *delete_btn;
164         GtkWidget *next_btn;
165         GtkWidget *exec_btn;
166
167         GtkWidget *separator;
168
169         /* for the reply buttons */
170         GtkWidget *reply_popup;
171         GtkWidget *replyall_popup;
172         GtkWidget *replylist_popup;
173         GtkWidget *replysender_popup;
174         
175         /* the forward button similar to the reply buttons*/
176         GtkWidget *fwd_popup;
177
178         ComposeButtonType compose_btn_type;
179
180         GSList    *t_action_list;
181         GSList    *t_item_list;
182 };
183
184 MainWindow *main_window_create          (SeparateType    type);
185
186 void main_window_cursor_wait            (MainWindow     *mainwin);
187 void main_window_cursor_normal          (MainWindow     *mainwin);
188
189 void main_window_lock                   (MainWindow     *mainwin);
190 void main_window_unlock                 (MainWindow     *mainwin);
191
192 void main_window_reflect_prefs_all_real         (gboolean pixmap_theme_changed);
193 void main_window_reflect_prefs_all      (void);
194 void main_window_set_summary_column     (void);
195 void main_window_set_account_menu       (GList          *account_list);
196 void main_window_separation_change      (MainWindow     *mainwin,
197                                          SeparateType    type);
198
199 void main_window_toggle_message_view    (MainWindow *mainwin);
200
201 void main_window_get_size               (MainWindow     *mainwin);
202 void main_window_get_position           (MainWindow     *mainwin);
203
204 void main_window_empty_trash            (MainWindow     *mainwin,
205                                          gboolean        confirm);
206 void main_window_add_mailbox            (MainWindow     *mainwin);
207
208 void main_window_set_menu_sensitive     (MainWindow     *mainwin);
209
210
211 void main_window_popup                  (MainWindow     *mainwin);
212
213 void main_window_toolbar_set_compose_button     (MainWindow *mainwin, 
214                                                  ComposeButtonType compose_btn_type);
215
216 SensitiveCond main_window_get_current_state   (MainWindow *mainwin);
217
218 void toolbar_set_sensitive                    (MainWindow *mainwin);
219
220 void toolbar_set_compose_button               (MainToolbar        *toolbar, 
221                                                ComposeButtonType  compose_btn_type);
222 void main_window_destroy_all                  (void);
223
224 void main_window_toggle_work_offline          (MainWindow        *mainwin, 
225                                                gboolean           offline);
226
227 #endif /* __MAINWINDOW_H__ */