5315d105b88ffce3fdc3b5ba75b61c90ad26bbea
[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 "headerwindow.h"
32 #include "logwindow.h"
33
34 typedef enum
35 {
36         SEPARATE_NONE    = 0,
37         SEPARATE_FOLDER  = 1 << 0,
38         SEPARATE_MESSAGE = 1 << 1,
39         SEPARATE_BOTH    = (SEPARATE_FOLDER | SEPARATE_MESSAGE)
40 } SeparateType;
41
42 typedef enum
43 {
44         TOOLBAR_NONE    = 0,
45         TOOLBAR_ICON    = 1,
46         TOOLBAR_TEXT    = 2,
47         TOOLBAR_BOTH    = 3
48 } ToolbarStyle;
49
50 typedef enum 
51 {
52         COMPOSEBUTTON_MAIL,
53         COMPOSEBUTTON_NEWS
54 } ComposeButtonType;
55
56 struct _MainWindow
57 {
58         SeparateType type;
59
60         union CompositeWin {
61                 struct 
62                 {
63                         GtkWidget *hpaned;
64                         GtkWidget *vpaned;
65                 } sep_none;
66                 struct {
67                         GtkWidget *folderwin;
68                         GtkWidget *vpaned;
69                 } sep_folder;
70                 struct {
71                         GtkWidget *messagewin;
72                         GtkWidget *hpaned;
73                 } sep_message;
74                 struct {
75                         GtkWidget *folderwin;
76                         GtkWidget *messagewin;
77                 } sep_both;
78         } win;
79
80         GtkWidget *window;
81         GtkWidget *vbox;
82         GtkWidget *menubar;
83
84         /* toolbar */
85         GtkWidget *handlebox;
86         GtkWidget *toolbar;
87         GtkWidget *get_btn;
88         GtkWidget *getall_btn;
89
90         /* compose button stuff */
91         GtkWidget *compose_mail_btn;            /* a la Leandro */
92         GtkWidget *compose_news_btn;            /* a la Leandro */
93         GtkWidget *compose_mail_btn_plain;      /* plain (text/icon only) */
94         GtkWidget *compose_news_btn_plain;      /* plain (text/icon only) */
95         ComposeButtonType compose_btn_type;
96         
97         GtkWidget *reply_btn;
98         GtkWidget *replyall_btn;
99         GtkWidget *replysender_btn;
100         GtkWidget *fwd_btn;
101         GtkWidget *send_btn;
102         /*
103         GtkWidget *prefs_btn;
104         GtkWidget *account_btn;
105         */
106         GtkWidget *next_btn;
107         GtkWidget *delete_btn;
108         GtkWidget *exec_btn;
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
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 cursor_count;
129
130         FolderView      *folderview;
131         SummaryView     *summaryview;
132         MessageView     *messageview;
133         HeaderWindow    *headerwin;
134         LogWindow       *logwin;
135 };
136
137 MainWindow *main_window_create          (SeparateType    type);
138
139 void main_window_cursor_wait            (MainWindow     *mainwin);
140 void main_window_cursor_normal          (MainWindow     *mainwin);
141
142 void main_window_lock                   (MainWindow     *mainwin);
143 void main_window_unlock                 (MainWindow     *mainwin);
144
145 void main_window_reflect_prefs_all      (void);
146 void main_window_set_account_menu       (GList          *account_list);
147 void main_window_separation_change      (MainWindow     *mainwin,
148                                          SeparateType    type);
149
150 void main_window_get_size               (MainWindow     *mainwin);
151 void main_window_get_position           (MainWindow     *mainwin);
152
153 void main_window_empty_trash            (MainWindow     *mainwin,
154                                          gboolean        confirm);
155 void main_window_add_mailbox            (MainWindow     *mainwin);
156
157 void main_window_set_toolbar_sensitive  (MainWindow     *mainwin);
158 void main_window_set_menu_sensitive     (MainWindow     *mainwin);
159
160 void main_window_popup                  (MainWindow     *mainwin);
161 /*void main_window_set_thread_option      (MainWindow *mainwin);*/
162
163 #endif /* __MAINWINDOW_H__ */