aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/e-addressbook-model.h
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-09-17 23:07:13 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-09-17 23:07:13 +0800
commitbb7cb1d677117a938ae18d9cae7acc7a56678b6f (patch)
treeb0e4f8354732c23a0ade524fd2036c4ced7275da /addressbook/gui/widgets/e-addressbook-model.h
parent7d2c28c02c6ecddcf492f385cacbd3d24ac215db (diff)
downloadgsoc2013-evolution-bb7cb1d677117a938ae18d9cae7acc7a56678b6f.tar
gsoc2013-evolution-bb7cb1d677117a938ae18d9cae7acc7a56678b6f.tar.gz
gsoc2013-evolution-bb7cb1d677117a938ae18d9cae7acc7a56678b6f.tar.bz2
gsoc2013-evolution-bb7cb1d677117a938ae18d9cae7acc7a56678b6f.tar.lz
gsoc2013-evolution-bb7cb1d677117a938ae18d9cae7acc7a56678b6f.tar.xz
gsoc2013-evolution-bb7cb1d677117a938ae18d9cae7acc7a56678b6f.tar.zst
gsoc2013-evolution-bb7cb1d677117a938ae18d9cae7acc7a56678b6f.zip
Massive address book refactoring. Things are mostly working again.
Also, begin documenting the new shell API, and provide a Gtk-Doc framework. svn path=/branches/kill-bonobo/; revision=36359
Diffstat (limited to 'addressbook/gui/widgets/e-addressbook-model.h')
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.h147
1 files changed, 80 insertions, 67 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-model.h b/addressbook/gui/widgets/e-addressbook-model.h
index 6558d94812..d4f7cae332 100644
--- a/addressbook/gui/widgets/e-addressbook-model.h
+++ b/addressbook/gui/widgets/e-addressbook-model.h
@@ -18,84 +18,97 @@
*
*/
-#ifndef _EAB_MODEL_H_
-#define _EAB_MODEL_H_
+#ifndef E_ADDRESSBOOK_MODEL_H
+#define E_ADDRESSBOOK_MODEL_H
-#include <glib.h>
-#include <glib-object.h>
#include <libebook/e-book.h>
+#include <libebook/e-book-query.h>
#include <libebook/e-book-view.h>
-#define EAB_TYPE_MODEL (eab_model_get_type ())
-#define EAB_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EAB_TYPE_MODEL, EABModel))
-#define EAB_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EAB_TYPE_MODEL, EABModelClass))
-#define E_IS_ADDRESSBOOK_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EAB_TYPE_MODEL))
-#define E_IS_ADDRESSBOOK_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EAB_TYPE_MODEL))
-
-typedef struct _EABModel EABModel;
-typedef struct _EABModelClass EABModelClass;
-
-struct _EABModel {
+/* Standard GObject macros */
+#define E_TYPE_ADDRESSBOOK_MODEL \
+ (e_addressbook_model_get_type ())
+#define E_ADDRESSBOOK_MODEL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_ADDRESSBOOK_MODEL, EAddressbookModel))
+#define E_ADDRESSBOOK_MODEL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_ADDRESSBOOK_MODEL, EAddressbookModelClass))
+#define E_IS_ADDRESSBOOK_MODEL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_ADDRESSBOOK_MODEL))
+#define E_IS_ADDRESSBOOK_MODEL_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_ADDRESSBOOK_MODEL))
+#define E_ADDRESSBOOK_MODEL_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_ADDRESSBOOK_MODEL))
+
+G_BEGIN_DECLS
+
+typedef struct _EAddressbookModel EAddressbookModel;
+typedef struct _EAddressbookModelClass EAddressbookModelClass;
+typedef struct _EAddressbookModelPrivate EAddressbookModelPrivate;
+
+struct _EAddressbookModel {
GObject parent;
-
- /* item specific fields */
- EBook *book;
- EBookQuery *query;
- EBookView *book_view;
-
- int book_view_idle_id;
-
- EContact **data;
- int data_count;
- int allocated_count;
-
- int create_contact_id, remove_contact_id, modify_contact_id;
- int status_message_id, writable_status_id, sequence_complete_id;
- int backend_died_id;
-
- guint search_in_progress : 1;
- guint editable : 1;
- guint editable_set : 1;
- guint first_get_view : 1;
+ EAddressbookModelPrivate *priv;
};
-struct _EABModelClass {
+struct _EAddressbookModelClass {
GObjectClass parent_class;
- /*
- * Signals
- */
- void (*writable_status) (EABModel *model, gboolean writable);
- void (*search_started) (EABModel *model);
- void (*search_result) (EABModel *model, EBookViewStatus status);
- void (*status_message) (EABModel *model, const gchar *message);
- void (*folder_bar_message) (EABModel *model, const gchar *message);
- void (*contact_added) (EABModel *model, gint index, gint count);
- void (*contacts_removed) (EABModel *model, gpointer id_list);
- void (*contact_changed) (EABModel *model, gint index);
- void (*model_changed) (EABModel *model);
- void (*stop_state_changed) (EABModel *model);
- void (*backend_died) (EABModel *model);
+ /* Signals */
+ void (*writable_status) (EAddressbookModel *model,
+ gboolean writable);
+ void (*search_started) (EAddressbookModel *model);
+ void (*search_result) (EAddressbookModel *model,
+ EBookViewStatus status);
+ void (*status_message) (EAddressbookModel *model,
+ const gchar *message);
+ void (*folder_bar_message) (EAddressbookModel *model,
+ const gchar *message);
+ void (*contact_added) (EAddressbookModel *model,
+ gint index,
+ gint count);
+ void (*contacts_removed) (EAddressbookModel *model,
+ gpointer id_list);
+ void (*contact_changed) (EAddressbookModel *model,
+ gint index);
+ void (*model_changed) (EAddressbookModel *model);
+ void (*stop_state_changed) (EAddressbookModel *model);
+ void (*backend_died) (EAddressbookModel *model);
};
-
-GType eab_model_get_type (void);
-EABModel *eab_model_new (void);
+GType e_addressbook_model_get_type (void);
+EAddressbookModel *
+ e_addressbook_model_new (void);
/* Returns object with ref count of 1. */
-EContact *eab_model_get_contact (EABModel *model,
- int row);
-EBook *eab_model_get_ebook (EABModel *model);
-
-void eab_model_stop (EABModel *model);
-gboolean eab_model_can_stop (EABModel *model);
-
-void eab_model_force_folder_bar_message (EABModel *model);
-
-int eab_model_contact_count (EABModel *model);
-const EContact *eab_model_contact_at (EABModel *model,
- int index);
-gboolean eab_model_editable (EABModel *model);
-
-#endif /* _EAB_MODEL_H_ */
+EContact * e_addressbook_model_get_contact (EAddressbookModel *model,
+ gint row);
+
+void e_addressbook_model_stop (EAddressbookModel *model);
+gboolean e_addressbook_model_can_stop (EAddressbookModel *model);
+
+void e_addressbook_model_force_folder_bar_message
+ (EAddressbookModel *model);
+
+gint e_addressbook_model_contact_count
+ (EAddressbookModel *model);
+EContact * e_addressbook_model_contact_at (EAddressbookModel *model,
+ gint index);
+EBook * e_addressbook_model_get_book (EAddressbookModel *model);
+void e_addressbook_model_set_book (EAddressbookModel *model,
+ EBook *book);
+gboolean e_addressbook_model_get_editable(EAddressbookModel *model);
+void e_addressbook_model_set_editable(EAddressbookModel *model,
+ gboolean editable);
+gchar * e_addressbook_model_get_query (EAddressbookModel *model);
+void e_addressbook_model_set_query (EAddressbookModel *model,
+ const gchar *query);
+
+G_END_DECLS
+
+#endif /* E_ADDRESSBOOK_MODEL_H */