a3589f49e4198e3afacd1c27759deb9cc321b1af
[claws.git] / src / toolbar.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2002 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 __CUSTOM_TOOLBAR_H__
21 #define __CUSTOM_TOOLBAR_H__
22
23 #define SEPARATOR        "separator"
24 #define TOOLBAR_FILE     "toolbar.xml"
25
26 #define SEPARATOR_PIXMAP "---"
27
28 typedef enum 
29 {
30         A_RECEIVE_ALL = 0,
31         A_RECEIVE_CUR,
32         A_SEND_QUEUED,
33         A_COMPOSE_EMAIL,
34         A_REPLY_MESSAGE,
35         A_REPLY_SENDER,
36         A_REPLY_ALL,
37         A_FORWARD,
38         A_DELETE,
39         A_EXECUTE,
40         A_GOTO_NEXT,
41         A_SYL_ACTIONS,
42         A_COMPOSE_NEWS, 
43         
44         N_ACTION_VAL
45 } CTActionVal;
46
47 #define A_SEPARATOR    N_ACTION_VAL + 1
48
49
50 typedef struct _ToolbarAction ToolbarAction;
51 struct _ToolbarAction
52 {
53         gchar *action_text;
54         gchar *descr;
55         void (*func)(GtkWidget *widget, gpointer data);
56 };
57
58 typedef struct _ToolbarItem ToolbarItem;
59 struct _ToolbarItem 
60 {
61         gchar *file;
62         gchar *text;
63         gint  action;
64 };
65
66 typedef struct _ToolbarSylpheedActions ToolbarSylpheedActions;
67 struct _ToolbarSylpheedActions
68 {
69         GtkWidget *widget;
70         gchar     *name;
71 };
72
73 typedef enum 
74 {
75         COMPOSEBUTTON_MAIL,
76         COMPOSEBUTTON_NEWS
77 } ComposeButtonType;
78
79 typedef struct _MainToolbar MainToolbar;
80
81 struct _MainToolbar {
82
83         GtkWidget *toolbar;
84
85         GtkWidget *get_btn;
86         GtkWidget *getall_btn;
87         GtkWidget *sel_down;
88         GtkWidget *sel_down_all;
89         GtkWidget *sel_down_cur;
90         GtkWidget *send_btn;
91
92         GtkWidget *compose_mail_btn;
93         GtkWidget *compose_news_btn;
94
95         GtkWidget *reply_btn;
96         GtkWidget *replysender_btn;
97         GtkWidget *replyall_btn;
98
99         GtkWidget *fwd_btn;
100
101         GtkWidget *delete_btn;
102         GtkWidget *next_btn;
103
104         GSList    *syl_action;
105         GtkWidget *separator;
106
107         GtkWidget *exec_btn;
108
109         /* for the reply buttons */
110         GtkWidget *reply_popup;
111         GtkWidget *replyall_popup;
112         GtkWidget *replysender_popup;
113         
114         /* the forward button similar to the reply buttons*/
115         GtkWidget *fwd_popup;
116
117         ComposeButtonType compose_btn_type;
118 };
119
120 extern GSList *toolbar_list;
121
122 void      toolbar_actions_cb               (GtkWidget          *widget, 
123                                             ToolbarItem        *toolbar_item);
124
125 GList    *toolbar_get_action_items         (void);
126 void      toolbar_save_config_file         (void);
127 void      toolbar_read_config_file         (void);
128 void      toolbar_set_default_toolbar      (void);
129 void      toolbar_clear_list               (void);
130 void      toolbar_update                   (void);
131 void      toolbar_destroy                  (MainWindow         *mainwin);
132
133 gint      toolbar_ret_val_from_descr       (gchar              *descr);
134 gchar    *toolbar_ret_descr_from_val       (gint               val);
135 gchar    *toolbar_ret_text_from_val        (gint               val);
136 void      toolbar_create                   (MainWindow         *mainwin,
137                                             GtkWidget          *container);
138
139 void      toolbar_popups_create            (MainWindow         *mainwin, 
140                                             GtkWidget          *window);
141
142 void      toolbar_set_sensitive            (MainWindow         *mainwin);
143 void      toolbar_set_compose_button       (MainToolbar        *toolbar, 
144                                             ComposeButtonType  compose_btn_type);
145 #endif /* __CUSTOM_TOOLBAR_H__ */