From 4bca50f1c5060efbfe2f0c9d011e4d51f1e8be0f Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 28 Nov 2007 20:54:19 +0000 Subject: ** Fixes bug #489652 2007-11-28 Matthew Barnes ** Fixes bug #489652 Migrate the contact list editor from ETable to GtkTreeView and fix some HIG issues. * addressbook/gui/contact-list-editor/Makefile.am: Remove e-contact-list-editor.etspec Remove e-contact-list-editor-marshal.list * addressbook/gui/contact-list-editor/contact-list-editor.glade: Fix some HIG issues and give all the widgets proper names. * addressbook/gui/contact-list-editor/e-contact-list-model.c: * addressbook/gui/contact-list-editor/e-contact-list-model.h: EContactListModel is now a subclass of GtkListStore. * addressbook/gui/contact-list-editor/e-contact-list.c: * addressbook/gui/contact-list-editor/e-contact-list.h: Use a GtkTreeView instead of an ETable for displaying members. Refactor everything; see bug #489652 for more details. svn path=/trunk/; revision=34610 --- .../gui/contact-list-editor/e-contact-list-model.h | 68 +++++++++++++--------- 1 file changed, 41 insertions(+), 27 deletions(-) (limited to 'addressbook/gui/contact-list-editor/e-contact-list-model.h') diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.h b/addressbook/gui/contact-list-editor/e-contact-list-model.h index 55fe251ad2..68de720286 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-model.h +++ b/addressbook/gui/contact-list-editor/e-contact-list-model.h @@ -1,48 +1,62 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + #ifndef _E_CONTACT_LIST_MODEL_H_ #define _E_CONTACT_LIST_MODEL_H_ -#include +#include #include #include -G_BEGIN_DECLS +/* Standard GObject macros */ +#define E_TYPE_CONTACT_LIST_MODEL \ + (e_contact_list_model_get_type ()) +#define E_CONTACT_LIST_MODEL(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_CONTACT_LIST_MODEL, EContactListModel)) +#define E_CONTACT_LIST_MODEL_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_CONTACT_LIST_MODEL, EContactListModelClass)) +#define E_IS_CONTACT_LIST_MODEL(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_CONTACT_LIST_MODEL)) +#define E_IS_CONTACT_LIST_MODEL_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_CONTACT_LIST_MODEL)) +#define E_CONTACT_LIST_MODEL_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_CONTACT_LIST_MODEL, EContactListModelClass)) -#define E_TYPE_CONTACT_LIST_MODEL (e_contact_list_model_get_type ()) -#define E_CONTACT_LIST_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_CONTACT_LIST_MODEL, EContactListModel)) -#define E_CONTACT_LIST_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_CONTACT_LIST_MODEL, EContactListModelClass)) -#define E_IS_CONTACT_LIST_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_CONTACT_LIST_MODEL)) -#define E_IS_CONTACT_LIST_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_CONTACT_LIST_MODEL)) +G_BEGIN_DECLS typedef struct _EContactListModel EContactListModel; typedef struct _EContactListModelClass EContactListModelClass; struct _EContactListModel { - ETableModel parent; - - EDestination **data; - int data_count; - int data_alloc; + GtkListStore parent; }; - struct _EContactListModelClass { - ETableModelClass parent_class; + GtkListStoreClass parent_class; }; - -GType e_contact_list_model_get_type (void); -void e_contact_list_model_construct (EContactListModel *model); -ETableModel *e_contact_list_model_new (void); - -void e_contact_list_model_add_destination (EContactListModel *model, EDestination *dest); -void e_contact_list_model_add_email (EContactListModel *model, const char *email); -void e_contact_list_model_add_contact (EContactListModel *model, EContact *contact, int email_num); - -void e_contact_list_model_remove_row (EContactListModel *model, int row); -void e_contact_list_model_remove_all (EContactListModel *model); - -const EDestination *e_contact_list_model_get_destination (EContactListModel *model, int row); +GType e_contact_list_model_get_type (void); +GtkTreeModel * e_contact_list_model_new (void); +gboolean e_contact_list_model_has_email (EContactListModel *model, + const gchar *email); +void e_contact_list_model_add_destination + (EContactListModel *model, + EDestination *dest); +void e_contact_list_model_add_email (EContactListModel *model, + const gchar *email); +void e_contact_list_model_add_contact(EContactListModel *model, + EContact *contact, + gint email_num); +void e_contact_list_model_remove_row (EContactListModel *model, + gint row); +void e_contact_list_model_remove_all (EContactListModel *model); +EDestination * e_contact_list_model_get_destination + (EContactListModel *model, + gint row); G_END_DECLS -- cgit v1.2.3