diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-06-04 13:59:20 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-06-04 15:55:50 +0100 |
commit | 29d64267eb9494792f57d12e6624d20a9cff35a6 (patch) | |
tree | 99236cc93fc3f27e19a4df054b342bdf2715a87c /telepathy-glib/base-contact-list.h | |
parent | 067eed0b504a7b4d21009a0a45965b28946e426a (diff) | |
download | telepathy-glib-29d64267eb9494792f57d12e6624d20a9cff35a6.tar.gz |
TpBaseContactList: put the modify accessors on a GInterface
This should make it possible to implement them in bindings, and we can
safely add additional function pointers to a GInterface.
Also, change the signature of TpBaseContactListActOnContactsFunc to
return void.
Diffstat (limited to 'telepathy-glib/base-contact-list.h')
-rw-r--r-- | telepathy-glib/base-contact-list.h | 82 |
1 files changed, 51 insertions, 31 deletions
diff --git a/telepathy-glib/base-contact-list.h b/telepathy-glib/base-contact-list.h index 9d0f42c9c..2a265fa31 100644 --- a/telepathy-glib/base-contact-list.h +++ b/telepathy-glib/base-contact-list.h @@ -114,50 +114,70 @@ struct _TpBaseContactListClass { TpBaseContactListClassPrivate *priv; }; -/* ---- Implemented by subclasses for ContactList ---- */ +/* ---- Implemented by subclasses for ContactList modification ---- */ -void tp_base_contact_list_class_implement_can_change_subscriptions ( - TpBaseContactListClass *cls, - TpBaseContactListBooleanFunc check); +#define TP_TYPE_MUTABLE_CONTACT_LIST \ + (tp_mutable_contact_list_get_type ()) -void tp_base_contact_list_class_implement_request_uses_message ( - TpBaseContactListClass *cls, - TpBaseContactListBooleanFunc check); +#define TP_IS_MUTABLE_CONTACT_LIST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + TP_TYPE_MUTABLE_CONTACT_LIST)) + +#define TP_MUTABLE_CONTACT_LIST_GET_INTERFACE(obj) \ + (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ + TP_TYPE_MUTABLE_CONTACT_LIST, TpMutableContactListInterface)) -typedef gboolean (*TpBaseContactListRequestSubscriptionFunc) ( +typedef struct _TpMutableContactListInterface TpMutableContactListInterface; + +typedef void (*TpBaseContactListRequestSubscriptionFunc) ( TpBaseContactList *self, TpHandleSet *contacts, - const gchar *message, - GError **error); - -void tp_base_contact_list_class_implement_request_subscription ( - TpBaseContactListClass *cls, - TpBaseContactListRequestSubscriptionFunc impl); + const gchar *message); -typedef gboolean (*TpBaseContactListActOnContactsFunc) ( +typedef void (*TpBaseContactListActOnContactsFunc) ( TpBaseContactList *self, + TpHandleSet *contacts); + +struct _TpMutableContactListInterface { + GTypeInterface parent; + /* mandatory-to-implement */ + TpBaseContactListRequestSubscriptionFunc request_subscription; + TpBaseContactListActOnContactsFunc authorize_publication; + TpBaseContactListActOnContactsFunc remove_contacts; + TpBaseContactListActOnContactsFunc unsubscribe; + TpBaseContactListActOnContactsFunc unpublish; + /* optional-to-implement */ + TpBaseContactListActOnContactsFunc store_contacts; + TpBaseContactListBooleanFunc can_change_subscriptions; + TpBaseContactListBooleanFunc get_request_uses_message; +}; + +GType tp_mutable_contact_list_get_type (void) G_GNUC_CONST; + +gboolean tp_base_contact_list_can_change_subscriptions ( + TpBaseContactList *self); + +gboolean tp_base_contact_list_get_request_uses_message ( + TpBaseContactList *self); + +void tp_base_contact_list_request_subscription (TpBaseContactList *self, TpHandleSet *contacts, - GError **error); + const gchar *message); -void tp_base_contact_list_class_implement_authorize_publication ( - TpBaseContactListClass *cls, - TpBaseContactListActOnContactsFunc impl); +void tp_base_contact_list_authorize_publication (TpBaseContactList *self, + TpHandleSet *contacts); -void tp_base_contact_list_class_implement_just_store_contacts ( - TpBaseContactListClass *cls, - TpBaseContactListActOnContactsFunc impl); +void tp_base_contact_list_store_contacts (TpBaseContactList *self, + TpHandleSet *contacts); -void tp_base_contact_list_class_implement_remove_contacts ( - TpBaseContactListClass *cls, - TpBaseContactListActOnContactsFunc impl); +void tp_base_contact_list_remove_contacts (TpBaseContactList *self, + TpHandleSet *contacts); -void tp_base_contact_list_class_implement_unsubscribe ( - TpBaseContactListClass *cls, - TpBaseContactListActOnContactsFunc impl); +void tp_base_contact_list_unsubscribe (TpBaseContactList *self, + TpHandleSet *contacts); -void tp_base_contact_list_class_implement_unpublish ( - TpBaseContactListClass *cls, - TpBaseContactListActOnContactsFunc impl); +void tp_base_contact_list_unpublish (TpBaseContactList *self, + TpHandleSet *contacts); /* ---- contact blocking ---- */ |