Statistics
| Revision:

root / src / mainwindow.h @ 548

History | View | Annotate | Download (4.2 kB)

1
/*
2
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3
 * Copyright (C) 1999-2005 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 "enums.h"
31
#include "folderview.h"
32
#include "summaryview.h"
33
#include "headerview.h"
34
#include "messageview.h"
35
#include "logwindow.h"
36
#include "gtkutils.h"
37
38
typedef enum
39
{
40
        SEPARATE_NONE         = 0,
41
        SEPARATE_FOLDER         = 1 << 0,
42
        SEPARATE_MESSAGE = 1 << 1,
43
        SEPARATE_BOTH         = (SEPARATE_FOLDER | SEPARATE_MESSAGE)
44
} SeparateType;
45
46
struct _MainWindow
47
{
48
        SeparateType type;
49
50
        union CompositeWin {
51
                struct 
52
                {
53
                        GtkWidget *hpaned;
54
                        GtkWidget *vpaned;
55
                } sep_none;
56
                struct {
57
                        GtkWidget *folderwin;
58
                        GtkWidget *vpaned;
59
                } sep_folder;
60
                struct {
61
                        GtkWidget *messagewin;
62
                        GtkWidget *hpaned;
63
                } sep_message;
64
                struct {
65
                        GtkWidget *folderwin;
66
                        GtkWidget *messagewin;
67
                } sep_both;
68
        } win;
69
70
        GtkWidget *window;
71
        GtkWidget *vbox;
72
        GtkWidget *menubar;
73
74
        GtkItemFactory *menu_factory;
75
76
        /* toolbar */
77
        GtkWidget *toolbar;
78
        GtkWidget *get_btn;
79
        GtkWidget *getall_btn;
80
        GtkWidget *compose_btn;
81
        GtkWidget *reply_btn;
82
        ComboButton *reply_combo;
83
        GtkWidget *replyall_btn;
84
        GtkWidget *fwd_btn;
85
        ComboButton *fwd_combo;
86
        GtkWidget *send_btn;
87
        GtkWidget *prefs_btn;
88
        GtkWidget *account_btn;
89
        GtkWidget *next_btn;
90
        GtkWidget *delete_btn;
91
        GtkWidget *junk_btn;
92
        GtkWidget *exec_btn;
93
94
        /* body */
95
        GtkWidget *vbox_body;
96
        GtkWidget *statusbar;
97
        GtkWidget *progressbar;
98
        GtkWidget *statuslabel;
99
        GtkWidget *online_switch;
100
        GtkWidget *online_pixmap;
101
        GtkWidget *offline_pixmap;
102
        GtkTooltips *online_tip;
103
        GtkWidget *ac_button;
104
        GtkWidget *ac_label;
105
        GtkWidget *ac_menu;
106
107
        GtkWidget *tray_icon;
108
109
        /* context IDs for status bar */
110
        gint mainwin_cid;
111
        gint folderview_cid;
112
        gint summaryview_cid;
113
        gint messageview_cid;
114
115
        ToolbarStyle toolbar_style;
116
117
        guint lock_count;
118
        guint menu_lock_count;
119
        guint cursor_count;
120
121
        FolderView        *folderview;
122
        SummaryView        *summaryview;
123
        MessageView        *messageview;
124
        LogWindow        *logwin;
125
};
126
127
MainWindow *main_window_create                (SeparateType         type);
128
129
void main_window_cursor_wait                (MainWindow        *mainwin);
130
void main_window_cursor_normal                (MainWindow        *mainwin);
131
132
void main_window_lock                        (MainWindow        *mainwin);
133
void main_window_unlock                        (MainWindow        *mainwin);
134
135
void main_window_reflect_prefs_all        (void);
136
void main_window_set_summary_column        (void);
137
void main_window_set_account_menu        (GList                *account_list);
138
139
MainWindow *main_window_get                (void);
140
141
GtkWidget *main_window_get_folder_window        (MainWindow        *mainwin);
142
GtkWidget *main_window_get_message_window        (MainWindow        *mainwin);
143
144
void main_window_separation_change        (MainWindow        *mainwin,
145
                                         SeparateType         type);
146
147
void main_window_toggle_message_view        (MainWindow        *mainwin);
148
149
void main_window_get_size                (MainWindow        *mainwin);
150
void main_window_get_position                (MainWindow        *mainwin);
151
152
void main_window_progress_on                (MainWindow        *mainwin);
153
void main_window_progress_off                (MainWindow        *mainwin);
154
void main_window_progress_set                (MainWindow        *mainwin,
155
                                         gint                 cur,
156
                                         gint                 total);
157
158
void main_window_toggle_online                        (MainWindow        *mainwin,
159
                                                 gboolean         online);
160
gboolean main_window_toggle_online_if_offline        (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
void main_window_popup                        (MainWindow        *mainwin);
170
171
#endif /* __MAINWINDOW_H__ */