a1c816c6fa8c13ee801941af96aace919aba065e
[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 struct _MainWindow
51 {
52         SeparateType type;
53
54         union CompositeWin {
55                 struct 
56                 {
57                         GtkWidget *hpaned;
58                         GtkWidget *vpaned;
59                 } sep_none;
60                 struct {
61                         GtkWidget *folderwin;
62                         GtkWidget *vpaned;
63                 } sep_folder;
64                 struct {
65                         GtkWidget *messagewin;
66                         GtkWidget *hpaned;
67                 } sep_message;
68                 struct {
69                         GtkWidget *folderwin;
70                         GtkWidget *messagewin;
71                 } sep_both;
72         } win;
73
74         GtkWidget *window;
75         GtkWidget *vbox;
76         GtkWidget *menubar;
77
78         /* tool bar */
79         GtkWidget *handlebox;
80         GtkWidget *toolbar;
81         GtkWidget *get_btn;
82         GtkWidget *getall_btn;
83         GtkWidget *compose_btn;
84         GtkWidget *reply_btn;
85         GtkWidget *replyall_btn;
86         GtkWidget *fwd_btn;
87         GtkWidget *send_btn;
88         GtkWidget *prefs_btn;
89         GtkWidget *account_btn;
90         GtkWidget *next_btn;
91         GtkWidget *delete_btn;
92         GtkWidget *exec_btn;
93
94         /* body */
95         GtkWidget *vbox_body;
96         GtkWidget *hbox_stat;
97         GtkWidget *statusbar;
98         GtkWidget *ac_button;
99         GtkWidget *ac_label;
100         GtkWidget *ac_menu;
101
102         /* context IDs for status bar */
103         gint mainwin_cid;
104         gint folderview_cid;
105         gint summaryview_cid;
106
107         ToolbarStyle toolbar_style;
108
109         guint cursor_count;
110
111         FolderView      *folderview;
112         SummaryView     *summaryview;
113         MessageView     *messageview;
114         HeaderWindow    *headerwin;
115         LogWindow       *logwin;
116 };
117
118 MainWindow *main_window_create          (SeparateType    type);
119 void main_window_cursor_wait            (MainWindow     *mainwin);
120 void main_window_cursor_normal          (MainWindow     *mainwin);
121 void main_window_reflect_prefs_all      (void);
122 void main_window_set_account_menu       (GList          *account_list);
123 void main_window_separation_change      (MainWindow     *mainwin,
124                                          SeparateType    type);
125 void main_window_get_size               (MainWindow     *mainwin);
126 void main_window_get_position           (MainWindow     *mainwin);
127 void main_window_empty_trash            (MainWindow     *mainwin,
128                                          gboolean        confirm);
129 void main_window_add_mailbox            (MainWindow     *mainwin);
130
131 void main_window_set_toolbar_sensitive  (MainWindow     *mainwin,
132                                          gboolean        sensitive);
133 void main_window_set_menu_sensitive     (MainWindow     *mainwin,
134                                          gint            selection);
135 void main_window_popup                  (MainWindow     *mainwin);
136 void main_window_set_thread_option      (MainWindow *mainwin);
137
138 #endif /* __MAINWINDOW_H__ */