diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-06-04 14:28:31 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-06-04 15:55:50 +0100 |
commit | ea561549e90c251a951f0200387de57c22c2ebc8 (patch) | |
tree | 451836735074b5d5d4c2dedf4ede19af7cc0c691 /telepathy-glib/base-contact-list.h | |
parent | 29d64267eb9494792f57d12e6624d20a9cff35a6 (diff) | |
download | telepathy-glib-ea561549e90c251a951f0200387de57c22c2ebc8.tar.gz |
TpBaseContactList: move blocking to TpBlockableContactListInterface
Also remove the get_contact_blocked virtual method, which is redundant
with tp_base_contact_list_get_blocked_contacts.
Diffstat (limited to 'telepathy-glib/base-contact-list.h')
-rw-r--r-- | telepathy-glib/base-contact-list.h | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/telepathy-glib/base-contact-list.h b/telepathy-glib/base-contact-list.h index 2a265fa31..fbd3e1bb1 100644 --- a/telepathy-glib/base-contact-list.h +++ b/telepathy-glib/base-contact-list.h @@ -181,33 +181,45 @@ void tp_base_contact_list_unpublish (TpBaseContactList *self, /* ---- contact blocking ---- */ +#define TP_TYPE_BLOCKABLE_CONTACT_LIST \ + (tp_blockable_contact_list_get_type ()) +GType tp_blockable_contact_list_get_type (void) G_GNUC_CONST; + +#define TP_IS_BLOCKABLE_CONTACT_LIST(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + TP_TYPE_BLOCKABLE_CONTACT_LIST)) + +#define TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE(obj) \ + (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ + TP_TYPE_BLOCKABLE_CONTACT_LIST, TpBlockableContactListInterface)) + +typedef struct _TpBlockableContactListInterface + TpBlockableContactListInterface; + void tp_base_contact_list_contact_blocking_changed ( TpBaseContactList *self, TpHandleSet *changed); -void tp_base_contact_list_class_implement_can_block ( - TpBaseContactListClass *cls, - TpBaseContactListBooleanFunc check); +gboolean tp_base_contact_list_can_block (TpBaseContactList *self); -void tp_base_contact_list_class_implement_get_blocked_contacts ( - TpBaseContactListClass *cls, - TpBaseContactListGetContactsFunc impl); - -typedef gboolean (*TpBaseContactListContactBooleanFunc) ( - TpBaseContactList *self, - TpHandle contact); +TpHandleSet *tp_base_contact_list_get_blocked_contacts ( + TpBaseContactList *self); -void tp_base_contact_list_class_implement_get_contact_blocked ( - TpBaseContactListClass *cls, - TpBaseContactListContactBooleanFunc impl); +void tp_base_contact_list_block_contacts (TpBaseContactList *self, + TpHandleSet *contacts); -void tp_base_contact_list_class_implement_block_contacts ( - TpBaseContactListClass *cls, - TpBaseContactListActOnContactsFunc impl); +void tp_base_contact_list_unblock_contacts (TpBaseContactList *self, + TpHandleSet *contacts); -void tp_base_contact_list_class_implement_unblock_contacts ( - TpBaseContactListClass *cls, - TpBaseContactListActOnContactsFunc impl); +struct _TpBlockableContactListInterface { + GTypeInterface parent; + /* mandatory to implement */ + TpBaseContactListGetContactsFunc get_blocked_contacts; + TpBaseContactListActOnContactsFunc block_contacts; + TpBaseContactListActOnContactsFunc unblock_contacts; + /* optional to implement */ + TpBaseContactListBooleanFunc can_block; +}; /* ---- Called by subclasses for ContactGroups ---- */ |