From 81a0ff5bc44a3bd11399e6b3c985735737606c8c Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 17 Sep 2003 21:19:04 +0000 Subject: cvs removed. 2003-09-17 Not Zed * 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 --- mail/em-popup.h | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 mail/em-popup.h (limited to 'mail/em-popup.h') 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 + * + * 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 + +#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__ */ -- cgit v1.2.3