From 227fab86efce103776af0364cbfd3f1959f9d269 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Thu, 8 Jun 2000 17:12:12 +0000 Subject: Now this derives from GtkObject. It follows the same strategy as the 2000-06-08 Federico Mena Quintero * contact-editor/e-contact-editor.h (EContactEditor): Now this derives from GtkObject. It follows the same strategy as the EventEditor in the calendar. (EContactEditor): Added an is_new_card field so that we can know whether to add() or commit() the card. * contact-editor/e-contact-editor.c (e_contact_editor_get_type): Derive from GtkObject. (e_contact_editor_class_init): Likewise. (e_contact_editor_class_init): Added an "is_new_card" argument. (e_contact_editor_set_arg): Handle ARG_IS_NEW_CARD. (e_contact_editor_get_arg): Likewise. (e_contact_editor_new): Take in an is_new_arg argument and set it on the object. (e_contact_editor_init): Load the app widget into the app field of the EContactEditor structure. Create its UIHandler as well. (e_contact_editor_class_init): New "add_card", "commit_card", and "editor_closed" signals. * contact-editor/test-editor.c (main): Modified for the new API. (editor_closed_cb): Tweaked for the new API. Since this test program does not use Bonobo, it doesn't work, though. * gui/component/addressbook.c (new_contact_cb): Use the new contact editor API. (table_double_click): Ditto. * gui/minicard/e-minicard-view.c (e_minicard_view_event): Use the new contact editor API. * gui/minicard/e-minicard.c (e_minicard_event): Use the new contact editor API. svn path=/trunk/; revision=3479 --- addressbook/contact-editor/e-contact-editor.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'addressbook/contact-editor/e-contact-editor.h') diff --git a/addressbook/contact-editor/e-contact-editor.h b/addressbook/contact-editor/e-contact-editor.h index 288cec1db0..8eae2bf1b5 100644 --- a/addressbook/contact-editor/e-contact-editor.h +++ b/addressbook/contact-editor/e-contact-editor.h @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -52,13 +53,17 @@ typedef struct _EContactEditorClass EContactEditorClass; struct _EContactEditor { - GtkVBox parent; + GtkObject object; /* item specific fields */ ECard *card; ECardSimple *simple; + + /* UI handler */ + BonoboUIHandler *uih; GladeXML *gui; + GtkWidget *app; GnomeUIInfo *email_info; GnomeUIInfo *phone_info; GnomeUIInfo *address_info; @@ -77,15 +82,24 @@ struct _EContactEditor ECardSimpleAddressId address_choice; GList *arbitrary_fields; + + /* Whether we are editing a new card or an existing one */ + guint is_new_card : 1; }; struct _EContactEditorClass { - GtkVBoxClass parent_class; + GtkObjectClass parent_class; + + /* Notification signals */ + + void (* add_card) (EContactEditor *ce, ECard *card); + void (* commit_card) (EContactEditor *ce, ECard *card); + void (* editor_closed) (EContactEditor *ce); }; -GtkWidget *e_contact_editor_new(ECard *card); +EContactEditor *e_contact_editor_new (ECard *card, gboolean is_new_card); GtkType e_contact_editor_get_type (void); #ifdef __cplusplus -- cgit v1.2.3