Statistics
| Revision:

root / src / mainwindow.h @ 1

History | View | Annotate | Download (4.33 KB)

1
/*
2
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3
 * Copyright (C) 1999-2004 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
#include <gtk/gtkwidget.h>
25
#include <gtk/gtkitemfactory.h>
26
#include <gtk/gtktooltips.h>
27

    
28
typedef struct _MainWindow        MainWindow;
29

    
30
#include "folderview.h"
31
#include "summaryview.h"
32
#include "headerview.h"
33
#include "messageview.h"
34
#include "logwindow.h"
35
#include "gtkutils.h"
36

    
37
typedef enum
38
{
39
        SEPARATE_NONE         = 0,
40
        SEPARATE_FOLDER         = 1 << 0,
41
        SEPARATE_MESSAGE = 1 << 1,
42
        SEPARATE_BOTH         = (SEPARATE_FOLDER | SEPARATE_MESSAGE)
43
} SeparateType;
44

    
45
typedef enum
46
{
47
        TOOLBAR_NONE        = 0,
48
        TOOLBAR_ICON        = 1,
49
        TOOLBAR_TEXT        = 2,
50
        TOOLBAR_BOTH        = 3
51
} ToolbarStyle;
52

    
53
struct _MainWindow
54
{
55
        SeparateType type;
56

    
57
        union CompositeWin {
58
                struct 
59
                {
60
                        GtkWidget *hpaned;
61
                        GtkWidget *vpaned;
62
                } sep_none;
63
                struct {
64
                        GtkWidget *folderwin;
65
                        GtkWidget *vpaned;
66
                } sep_folder;
67
                struct {
68
                        GtkWidget *messagewin;
69
                        GtkWidget *hpaned;
70
                } sep_message;
71
                struct {
72
                        GtkWidget *folderwin;
73
                        GtkWidget *messagewin;
74
                } sep_both;
75
        } win;
76

    
77
        GtkWidget *window;
78
        GtkWidget *vbox;
79
        GtkWidget *menubar;
80

    
81
        GtkItemFactory *menu_factory;
82

    
83
        /* toolbar */
84
        GtkWidget *handlebox;
85
        GtkWidget *toolbar;
86
        GtkWidget *get_btn;
87
        GtkWidget *getall_btn;
88
        GtkWidget *compose_btn;
89
        GtkWidget *reply_btn;
90
        ComboButton *reply_combo;
91
        GtkWidget *replyall_btn;
92
        GtkWidget *fwd_btn;
93
        ComboButton *fwd_combo;
94
        GtkWidget *send_btn;
95
        GtkWidget *prefs_btn;
96
        GtkWidget *account_btn;
97
        GtkWidget *next_btn;
98
        GtkWidget *delete_btn;
99
        GtkWidget *exec_btn;
100

    
101
        /* body */
102
        GtkWidget *vbox_body;
103
        GtkWidget *hbox_stat;
104
        GtkWidget *statusbar;
105
        GtkWidget *progressbar;
106
        GtkWidget *statuslabel;
107
        GtkWidget *online_switch;
108
        GtkWidget *online_pixmap;
109
        GtkWidget *offline_pixmap;
110
        GtkTooltips *online_tip;
111
        GtkWidget *ac_button;
112
        GtkWidget *ac_label;
113
        GtkWidget *ac_menu;
114

    
115
        /* context IDs for status bar */
116
        gint mainwin_cid;
117
        gint folderview_cid;
118
        gint summaryview_cid;
119
        gint messageview_cid;
120

    
121
        ToolbarStyle toolbar_style;
122

    
123
        guint lock_count;
124
        guint menu_lock_count;
125
        guint cursor_count;
126

    
127
        FolderView        *folderview;
128
        SummaryView        *summaryview;
129
        MessageView        *messageview;
130
        LogWindow        *logwin;
131
};
132

    
133
MainWindow *main_window_create                (SeparateType         type);
134

    
135
void main_window_cursor_wait                (MainWindow        *mainwin);
136
void main_window_cursor_normal                (MainWindow        *mainwin);
137

    
138
void main_window_lock                        (MainWindow        *mainwin);
139
void main_window_unlock                        (MainWindow        *mainwin);
140

    
141
void main_window_reflect_prefs_all        (void);
142
void main_window_set_summary_column        (void);
143
void main_window_set_account_menu        (GList                *account_list);
144

    
145
MainWindow *main_window_get                (void);
146

    
147
GtkWidget *main_window_get_folder_window        (MainWindow        *mainwin);
148
GtkWidget *main_window_get_message_window        (MainWindow        *mainwin);
149

    
150
void main_window_separation_change        (MainWindow        *mainwin,
151
                                         SeparateType         type);
152

    
153
void main_window_toggle_message_view        (MainWindow        *mainwin);
154

    
155
void main_window_get_size                (MainWindow        *mainwin);
156
void main_window_get_position                (MainWindow        *mainwin);
157

    
158
void main_window_progress_on                (MainWindow        *mainwin);
159
void main_window_progress_off                (MainWindow        *mainwin);
160
void main_window_progress_set                (MainWindow        *mainwin,
161
                                         gint                 cur,
162
                                         gint                 total);
163

    
164
void main_window_toggle_online                        (MainWindow        *mainwin,
165
                                                 gboolean         online);
166
gboolean main_window_toggle_online_if_offline        (MainWindow        *mainwin);
167

    
168
void main_window_empty_trash                (MainWindow        *mainwin,
169
                                         gboolean         confirm);
170
void main_window_add_mailbox                (MainWindow        *mainwin);
171

    
172
void main_window_set_toolbar_sensitive        (MainWindow        *mainwin);
173
void main_window_set_menu_sensitive        (MainWindow        *mainwin);
174

    
175
void main_window_popup                        (MainWindow        *mainwin);
176

    
177
#endif /* __MAINWINDOW_H__ */