aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-popup.h
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-09-18 05:19:04 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-09-18 05:19:04 +0800
commit81a0ff5bc44a3bd11399e6b3c985735737606c8c (patch)
tree54b5ed4342a6843c1db4c7e75f2e1b1fe9b82dff /mail/em-popup.h
parenta36a1bb70b6ebcb51ac39304370c89bda63e11b9 (diff)
downloadgsoc2013-evolution-81a0ff5bc44a3bd11399e6b3c985735737606c8c.tar
gsoc2013-evolution-81a0ff5bc44a3bd11399e6b3c985735737606c8c.tar.gz
gsoc2013-evolution-81a0ff5bc44a3bd11399e6b3c985735737606c8c.tar.bz2
gsoc2013-evolution-81a0ff5bc44a3bd11399e6b3c985735737606c8c.tar.lz
gsoc2013-evolution-81a0ff5bc44a3bd11399e6b3c985735737606c8c.tar.xz
gsoc2013-evolution-81a0ff5bc44a3bd11399e6b3c985735737606c8c.tar.zst
gsoc2013-evolution-81a0ff5bc44a3bd11399e6b3c985735737606c8c.zip
cvs removed.
2003-09-17 Not Zed <NotZed@Ximian.com> * folder-browser.c, folder-browser.h, folder-browser-ui.c folder-browser-ui.h, mail-callbacks.c, mail-callbacks.h mail-display.c, mail-display.h, mail-display-stream.c mail-display-stream.h, mail-format.c, mail-format.h mail-identify.c, mail-search.c, mail-search.h message-browser.c, message-browser.h, subscribe-dialog.c subscribe-dialog.h, mail-font-prefs.c, mail-font-prefs.h: cvs removed. * Makefile.am: Removed mail-font-prefs.[ch], hasn't been built for ages. * em-*.c: killed a bunch of printfs. * em-format-html-display.c (efhd_html_button_press_event): update for html object api chagnes. ** Merge in mail-refactor-2 branch. svn path=/trunk/; revision=22602
Diffstat (limited to 'mail/em-popup.h')
-rw-r--r--mail/em-popup.h158
1 files changed, 158 insertions, 0 deletions
diff --git a/mail/em-popup.h b/mail/em-popup.h
new file mode 100644
index 0000000000..877b28fc28
--- /dev/null
+++ b/mail/em-popup.h
@@ -0,0 +1,158 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Authors: Michel Zucchi <notzed@ximian.com>
+ *
+ * Copyright 2003 Ximian, Inc. (www.ximian.com)
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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 Street #330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __EM_POPUP_H__
+#define __EM_POPUP_H__
+
+#include <glib-object.h>
+
+#ifdef __cplusplus
+extern "C" {
+#pragma }
+#endif /* __cplusplus */
+
+/* NB: This is TEMPORARY, to be replaced by EggMenu, if it does what we need? */
+
+typedef struct _EMPopup EMPopup;
+typedef struct _EMPopupClass EMPopupClass;
+
+typedef struct _EMPopupItem EMPopupItem;
+typedef struct _EMPopupFactory EMPopupFactory; /* anonymous type */
+typedef struct _EMPopupTarget EMPopupTarget;
+
+typedef void (*EMPopupFactoryFunc)(EMPopup *emp, EMPopupTarget *target, void *data);
+
+/* Menu item descriptions */
+enum _em_popup_t {
+ EM_POPUP_ITEM = 0,
+ EM_POPUP_TOGGLE,
+ EM_POPUP_RADIO,
+ EM_POPUP_IMAGE,
+ EM_POPUP_SUBMENU,
+ EM_POPUP_BAR,
+ EM_POPUP_TYPE_MASK = 0xffff,
+ EM_POPUP_ACTIVE = 0x10000,
+};
+
+struct _EMPopupItem {
+ enum _em_popup_t type;
+ char *path; /* absolute path! must sort ascii-lexographically into the right spot */
+ char *label;
+ GCallback activate;
+ void *activate_data;
+ void *image; /* char* for item type, GtkWidget * for image type */
+ guint32 mask;
+};
+
+/* Current target description */
+/* Types of popup tagets */
+enum _em_popup_target_t {
+ EM_POPUP_TARGET_SELECT,
+ EM_POPUP_TARGET_URI,
+ EM_POPUP_TARGET_PART,
+};
+
+/* Flags that describe a TARGET_SELECT */
+enum {
+ EM_POPUP_SELECT_ONE = 1<<1,
+ EM_POPUP_SELECT_MANY = 1<<2,
+ EM_POPUP_SELECT_MARK_READ = 1<<3,
+ EM_POPUP_SELECT_MARK_UNREAD = 1<<4,
+ EM_POPUP_SELECT_DELETE = 1<<5,
+ EM_POPUP_SELECT_UNDELETE = 1<<6,
+ EM_POPUP_SELECT_MAILING_LIST = 1<<7,
+ EM_POPUP_SELECT_RESEND = 1<<8,
+ EM_POPUP_SELECT_MARK_IMPORTANT = 1<<9,
+ EM_POPUP_SELECT_MARK_UNIMPORTANT = 1<<10,
+ EM_POPUP_SELECT_FLAG_FOLLOWUP = 1<<11,
+ EM_POPUP_SELECT_FLAG_COMPLETED = 1<<12,
+ EM_POPUP_SELECT_FLAG_CLEAR = 1<<13,
+ EM_POPUP_SELECT_ADD_SENDER = 1<<14,
+ EM_POPUP_SELECT_LAST = 1<<16 /* reserve 2 slots */
+};
+
+/* Flags that describe a TARGET_URI */
+enum {
+ EM_POPUP_URI_HTTP = 1<<0,
+ EM_POPUP_URI_MAILTO = 1<<1,
+ EM_POPUP_URI_NOT_MAILTO = 1<<2,
+};
+
+/* Flags that describe TARGET_PART */
+enum {
+ EM_POPUP_PART_MESSAGE = 1<<0,
+ EM_POPUP_PART_IMAGE = 1<<1,
+};
+
+struct _EMPopupTarget {
+ enum _em_popup_target_t type;
+ guint32 mask; /* depends on type, see above */
+ struct _GtkWidget *widget; /* used if you need a parent toplevel, if available */
+ union {
+ char *uri;
+ struct {
+ struct _CamelFolder *folder;
+ char *folder_uri;
+ GPtrArray *uids;
+ } select;
+ struct {
+ char *mime_type;
+ struct _CamelMimePart *part;
+ } part;
+ } data;
+};
+
+/* The object */
+struct _EMPopup {
+ GObject object;
+
+ struct _EMPopupPrivate *priv;
+
+ char *menuid;
+};
+
+struct _EMPopupClass {
+ GObjectClass object_class;
+};
+
+GType em_popup_get_type(void);
+
+/* Static class methods */
+EMPopupFactory *em_popup_static_add_factory(const char *menuid, EMPopupFactoryFunc func, void *data);
+void em_popup_static_remove_factory(EMPopupFactory *f);
+
+EMPopup *em_popup_new(const char *menuid);
+void em_popup_add_items(EMPopup *, GSList *items, GDestroyNotify freefunc);
+void em_popup_add_static_items(EMPopup *emp, EMPopupTarget *target);
+struct _GtkMenu *em_popup_create_menu(EMPopup *, guint32 hide_mask, guint32 disable_mask);
+struct _GtkMenu *em_popup_create_menu_once(EMPopup *emp, EMPopupTarget *, guint32 hide_mask, guint32 disable_mask);
+
+EMPopupTarget *em_popup_target_new_uri(const char *uri);
+EMPopupTarget *em_popup_target_new_select(struct _CamelFolder *folder, const char *folder_uri, GPtrArray *uids);
+EMPopupTarget *em_popup_target_new_part(struct _CamelMimePart *part, const char *mime_type);
+void em_popup_target_free(EMPopupTarget *target);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __EM_POPUP_H__ */