/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2002 Hiroyuki Yamamoto
+ * Copyright (C) 2001-2003 Hiroyuki Yamamoto and the Sylpheed-Claws team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __CUSTOM_TOOLBAR_H__
#define __CUSTOM_TOOLBAR_H__
-#define SEPARATOR "separator"
+#include "gtk/gtkutils.h"
+
#define SEPARATOR_PIXMAP "---"
+typedef struct _Toolbar Toolbar;
+typedef struct _ToolbarItem ToolbarItem;
+typedef struct _ToolbarSylpheedActions ToolbarSylpheedActions;
+
typedef enum {
- TOOLBAR_MAIN,
+ TOOLBAR_MAIN = 0,
TOOLBAR_COMPOSE,
-} Toolbar;
+ TOOLBAR_MSGVIEW
+} ToolbarType;
-#define TOOLBAR_DESTROY_ITEMS(t_item_list) \
+typedef enum
+{
+ COMPOSEBUTTON_MAIL,
+ COMPOSEBUTTON_NEWS
+} ComposeButtonType;
+
+struct _Toolbar {
+ GtkWidget *toolbar;
+
+ GtkWidget *get_btn;
+ GtkWidget *getall_btn;
+ ComboButton *getall_combo;
+ GtkWidget *send_btn;
+
+ GtkWidget *compose_mail_btn;
+ GtkWidget *compose_news_btn;
+
+ GtkWidget *reply_btn;
+ ComboButton *reply_combo;
+ GtkWidget *replysender_btn;
+ ComboButton *replysender_combo;
+ GtkWidget *replyall_btn;
+ ComboButton *replyall_combo;
+ GtkWidget *replylist_btn;
+ ComboButton *replylist_combo;
+
+ GtkWidget *fwd_btn;
+ ComboButton *fwd_combo;
+
+ GtkWidget *trash_btn;
+ GtkWidget *delete_btn;
+ GtkWidget *prev_btn;
+ GtkWidget *next_btn;
+ GtkWidget *exec_btn;
+
+ GtkWidget *separator;
+
+
+ ComposeButtonType compose_btn_type;
+
+ /* compose buttons */
+ GtkWidget *sendl_btn;
+ GtkWidget *draft_btn;
+ GtkWidget *insert_btn;
+ GtkWidget *attach_btn;
+ GtkWidget *sig_btn;
+ GtkWidget *exteditor_btn;
+ GtkWidget *linewrap_current_btn;
+ GtkWidget *linewrap_all_btn;
+ GtkWidget *addrbook_btn;
+#ifdef USE_ASPELL
+ GtkWidget *spellcheck_btn;
+#endif
+
+ GSList *action_list;
+ GSList *item_list;
+
+};
+
+struct _ToolbarItem {
+ gint index;
+ gchar *file;
+ gchar *text;
+ ToolbarType type;
+ gpointer parent;
+};
+
+#define TOOLBAR_DESTROY_ITEMS(item_list) \
{ \
- ToolbarItem *t_item; \
- while (t_item_list != NULL) { \
- t_item = (ToolbarItem*)t_item_list->data; \
- t_item_list = g_slist_remove(t_item_list, t_item); \
- if (t_item->file) \
- g_free(t_item->file); \
- if (t_item->text) \
- g_free(t_item->text);\
- g_free(t_item);\
+ ToolbarItem *item; \
+ while (item_list != NULL) { \
+ item = (ToolbarItem*)item_list->data; \
+ item_list = g_slist_remove(item_list, item); \
+ if (item->file) \
+ g_free(item->file); \
+ if (item->text) \
+ g_free(item->text); \
+ g_free(item);\
}\
- g_slist_free(t_item_list);\
+ g_slist_free(item_list);\
}
-#define TOOLBAR_DESTROY_ACTIONS(t_action_list) \
+#define TOOLBAR_DESTROY_ACTIONS(action_list) \
{ \
- ToolbarSylpheedActions *t_action; \
- while (t_action_list != NULL) { \
- t_action = (ToolbarSylpheedActions*)t_action_list->data;\
- t_action_list = \
- g_slist_remove(t_action_list, t_action);\
- if (t_action->name) \
- g_free(t_action->name); \
- g_free(t_action); \
+ ToolbarSylpheedActions *action; \
+ while (action_list != NULL) { \
+ action = (ToolbarSylpheedActions*)action_list->data;\
+ action_list = \
+ g_slist_remove(action_list, action);\
+ if (action->name) \
+ g_free(action->name); \
+ g_free(action); \
} \
- g_slist_free(t_action_list); \
+ g_slist_free(action_list); \
}
-typedef struct _ToolbarConfig ToolbarConfig;
-struct _ToolbarConfig {
- const gchar *conf_file;
- GSList *item_list;
-};
+
/* enum holds available actions for both
A_REPLY_ALL,
A_REPLY_ML,
A_FORWARD,
- A_DELETE,
+ A_TRASH,
+ A_DELETE_REAL,
A_EXECUTE,
+ A_GOTO_PREV,
A_GOTO_NEXT,
+ A_IGNORE_THREAD,
+ A_PRINT,
/* compose toolbar */
A_SEND,
A_ATTACH,
A_SIG,
A_EXTEDITOR,
- A_LINEWRAP,
+ A_LINEWRAP_CURRENT,
+ A_LINEWRAP_ALL,
A_ADDRBOOK,
+#ifdef USE_ASPELL
+ A_CHECK_SPELLING,
+#endif
/* common items */
A_SYL_ACTIONS,
N_ACTION_VAL
};
-typedef struct _ToolbarText ToolbarText;
-struct _ToolbarText
-{
- gchar *index_str;
- gchar *descr;
-};
-
-typedef struct _ToolbarItem ToolbarItem;
-struct _ToolbarItem
-{
- gint index;
- gchar *file;
- gchar *text;
- gpointer parent;
-};
-
-typedef struct _ToolbarSylpheedActions ToolbarSylpheedActions;
-struct _ToolbarSylpheedActions
-{
+struct _ToolbarSylpheedActions {
GtkWidget *widget;
gchar *name;
};
-void toolbar_action_execute (GtkWidget *widget,
- GSList *action_list,
- gpointer data,
- gint source);
-
-GList *toolbar_get_action_items (Toolbar source);
-
-void toolbar_save_config_file (Toolbar source);
-void toolbar_read_config_file (Toolbar source);
-
-void toolbar_set_default (Toolbar source);
-void toolbar_clear_list (Toolbar source);
-
-GSList *toolbar_get_list (Toolbar source);
-void toolbar_set_list_item (ToolbarItem *t_item,
- Toolbar source);
-
-gint toolbar_ret_val_from_descr (const gchar *descr);
-gchar *toolbar_ret_descr_from_val (gint val);
+void toolbar_action_execute (GtkWidget *widget,
+ GSList *action_list,
+ gpointer data,
+ gint source);
+
+GList *toolbar_get_action_items (ToolbarType source);
+
+void toolbar_save_config_file (ToolbarType source);
+void toolbar_read_config_file (ToolbarType source);
+
+void toolbar_set_default (ToolbarType source);
+void toolbar_clear_list (ToolbarType source);
+
+GSList *toolbar_get_list (ToolbarType source);
+void toolbar_set_list_item (ToolbarItem *t_item,
+ ToolbarType source);
+
+gint toolbar_ret_val_from_descr (const gchar *descr);
+gchar *toolbar_ret_descr_from_val (gint val);
+
+void toolbar_main_set_sensitive (gpointer data);
+void toolbar_comp_set_sensitive (gpointer data,
+ gboolean sensitive);
+
+/* invoked by mainwindow entries and toolbar actions */
+void delete_msgview_cb (gpointer data,
+ guint action,
+ GtkWidget *widget);
+void inc_mail_cb (gpointer data,
+ guint action,
+ GtkWidget *widget);
+void inc_all_account_mail_cb (gpointer data,
+ guint action,
+ GtkWidget *widget);
+void send_queue_cb (gpointer data,
+ guint action,
+ GtkWidget *widget);
+void compose_mail_cb (gpointer data,
+ guint action,
+ GtkWidget *widget);
+void compose_news_cb (gpointer data,
+ guint action,
+ GtkWidget *widget);
+/* END */
+
+void toolbar_toggle (guint action,
+ gpointer data);
+void toolbar_update (ToolbarType type,
+ gpointer data);
+Toolbar *toolbar_create (ToolbarType type,
+ GtkWidget *container,
+ gpointer data);
+void toolbar_set_style (GtkWidget *toolbar_wid,
+ GtkWidget *handlebox_wid,
+ guint action);
+void toolbar_destroy (Toolbar *toolbar);
+void toolbar_init (Toolbar *toolbar);
-void toolbar_destroy_items (GSList *t_item_list);
#endif /* __CUSTOM_TOOLBAR_H__ */