Added work offline availability.
[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
27 #include "folderview.h"
28 #include "summaryview.h"
29 #include "headerview.h"
30 #include "messageview.h"
31 #include "logwindow.h"
32
33 typedef enum
34 {
35         SEPARATE_NONE    = 0,
36         SEPARATE_FOLDER  = 1 << 0,
37         SEPARATE_MESSAGE = 1 << 1,
38         SEPARATE_BOTH    = (SEPARATE_FOLDER | SEPARATE_MESSAGE)
39 } SeparateType;
40
41 typedef enum
42 {
43         TOOLBAR_NONE    = 0,
44         TOOLBAR_ICON    = 1,
45         TOOLBAR_TEXT    = 2,
46         TOOLBAR_BOTH    = 3
47 } ToolbarStyle;
48
49 typedef enum 
50 {
51         COMPOSEBUTTON_MAIL,
52         COMPOSEBUTTON_NEWS
53 } ComposeButtonType;
54
55 struct _MainWindow
56 {
57         SeparateType type;
58
59         union CompositeWin {
60                 struct 
61                 {
62                         GtkWidget *hpaned;
63                         GtkWidget *vpaned;
64                 } sep_none;
65                 struct {
66                         GtkWidget *folderwin;
67                         GtkWidget *vpaned;
68                 } sep_folder;
69                 struct {
70                         GtkWidget *messagewin;
71                         GtkWidget *hpaned;
72                 } sep_message;
73                 struct {
74                         GtkWidget *folderwin;
75                         GtkWidget *messagewin;
76                 } sep_both;
77         } win;
78
79         GtkWidget *window;
80         GtkWidget *vbox;
81         GtkWidget *menubar;
82
83         /* toolbar */
84         GtkWidget *handlebox;
85         GtkWidget *toolbar;
86         GtkWidget *get_btn;
87         GtkWidget *getall_btn;
88
89         /* compose button stuff */
90         GtkWidget *compose_mail_btn;
91         GtkWidget *compose_news_btn;
92         ComposeButtonType compose_btn_type;
93         
94         /* for the reply buttons */
95         GtkWidget *reply_btn;
96         GtkWidget *reply_popup;
97         GtkWidget *replyall_btn;
98         GtkWidget *replyall_popup;
99         GtkWidget *replysender_btn;
100         GtkWidget *replysender_popup;
101         
102         /* the forward button similar to the reply buttons*/
103         GtkWidget *fwd_btn;
104         GtkWidget *fwd_popup;
105         
106         GtkWidget *send_btn;
107         /*
108         GtkWidget *prefs_btn;
109         GtkWidget *account_btn;
110         */
111         GtkWidget *next_btn;
112         GtkWidget *delete_btn;
113         GtkWidget *exec_btn;
114
115         /* body */
116         GtkWidget *vbox_body;
117         GtkWidget *hbox_stat;
118         GtkWidget *statusbar;
119         GtkWidget *progressbar;
120         GtkWidget *statuslabel;
121         GtkWidget *ac_button;
122         GtkWidget *ac_label;
123         GtkWidget *ac_menu;
124         GtkWidget *online_switch;
125         GtkWidget *offline_switch;
126
127         /* context IDs for status bar */
128         gint mainwin_cid;
129         gint folderview_cid;
130         gint summaryview_cid;
131
132         ToolbarStyle toolbar_style;
133
134         guint lock_count;
135         guint menu_lock_count;
136         guint cursor_count;
137
138         FolderView      *folderview;
139         SummaryView     *summaryview;
140         MessageView     *messageview;
141         LogWindow       *logwin;
142 };
143
144 MainWindow *main_window_create          (SeparateType    type);
145
146 void main_window_cursor_wait            (MainWindow     *mainwin);
147 void main_window_cursor_normal          (MainWindow     *mainwin);
148
149 void main_window_lock                   (MainWindow     *mainwin);
150 void main_window_unlock                 (MainWindow     *mainwin);
151
152 void main_window_reflect_prefs_all_real         (gboolean pixmap_theme_changed);
153 void main_window_reflect_prefs_all      (void);
154 void main_window_set_summary_column     (void);
155 void main_window_set_account_menu       (GList          *account_list);
156 void main_window_separation_change      (MainWindow     *mainwin,
157                                          SeparateType    type);
158
159 void main_window_get_size               (MainWindow     *mainwin);
160 void main_window_get_position           (MainWindow     *mainwin);
161
162 void main_window_empty_trash            (MainWindow     *mainwin,
163                                          gboolean        confirm);
164 void main_window_add_mailbox            (MainWindow     *mainwin);
165
166 void main_window_set_toolbar_sensitive  (MainWindow     *mainwin);
167 void main_window_set_menu_sensitive     (MainWindow     *mainwin);
168
169
170 void main_window_popup                  (MainWindow     *mainwin);
171
172 void main_window_toolbar_set_compose_button     
173                                         (MainWindow *mainwin, 
174                                          ComposeButtonType compose_btn_type);
175
176 #endif /* __MAINWINDOW_H__ */