telepathy-glib Reference Manual | ||||
---|---|---|---|---|
Top | Description |
#include <telepathy-glib/contacts-mixin.h> TpContactsMixin; TpContactsMixinClass; void tp_contacts_mixin_add_contact_attributes_iface (GObject *obj
,const gchar *interface
,TpContactsMixinFillContactAttributesFunc fill_contact_attributes
); void tp_contacts_mixin_class_init (GObjectClass *obj_cls
,glong offset
); void tp_contacts_mixin_finalize (GObject *obj
); void tp_contacts_mixin_iface_init (gpointer g_iface
,gpointer iface_data
); void tp_contacts_mixin_init (GObject *obj
,gsize offset
); void tp_contacts_mixin_set_contact_attribute (GHashTable *contact_attributes
,TpHandle handle
,const gchar *attribute
,GValue *value
); void (*TpContactsMixinFillContactAttributesFunc) (GObject *obj
,const GArray *contacts
,GHashTable *attributes_hash
);
This mixin can be added to a TpBaseConnection subclass to implement the Contacts interface in a generic way.
To use the contacts mixin, include a TpContactsMixinClass somewhere in
your class structure and a TpContactsMixin somewhere in your instance
structure, and call tp_contacts_mixin_class_init()
from your class_init
function, tp_contacts_mixin_init()
from your init function or constructor,
and tp_contacts_mixin_finalize()
from your dispose or finalize function.
To use the contacts mixin as the implementation of TpSvcConnectionInterfaceContacts, in the function you pass to G_IMPLEMENT_INTERFACE, you should call tp_contacts_mixin_iface_init. TpContactsMixin implements all of the D-Bus methods and properties in the Contacts interface.
To add interfaces with contact attributes to this interface use tp_contacts_mixin_add_contact_attributes_iface:
typedef struct { } TpContactsMixin;
Structure to be included in the instance structure of objects that
use this mixin. Initialize it with tp_contacts_mixin_init()
.
There are no public fields.
typedef struct { } TpContactsMixinClass;
Structure to be included in the class structure of objects that
use this mixin. Initialize it with tp_contacts_mixin_class_init()
.
There are no public fields.
void tp_contacts_mixin_add_contact_attributes_iface (GObject *obj
,const gchar *interface
,TpContactsMixinFillContactAttributesFunc fill_contact_attributes
);
Declare that the given interface has contact attributes which can be added to the attributes hash using the filler function. All the handles in the handle array passed to the filler function are guaranteed to be valid and referenced.
|
An instance of the implementation that uses this mixin |
|
Name of the interface that has ContactAttributes |
|
Contact attribute filler function |
Since 0.7.14
void tp_contacts_mixin_class_init (GObjectClass *obj_cls
,glong offset
);
Initialize the contacts mixin. Should be called from the implementation's class_init function like so:
1 2 |
tp_contacts_mixin_class_init ((GObjectClass *) klass, G_STRUCT_OFFSET (SomeObjectClass, contacts_mixin)); |
|
The class of the implementation that uses this mixin |
|
The byte offset of the TpContactsMixinClass within the class structure |
Since 0.7.14
void tp_contacts_mixin_finalize (GObject *obj
);
Free resources held by the contacts mixin.
|
An object with this mixin. |
Since 0.7.14
void tp_contacts_mixin_iface_init (gpointer g_iface
,gpointer iface_data
);
Fill in the vtable entries needed to implement the contacts interface using this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE.
|
A pointer to the TpSvcConnectionInterfaceContacts in an object class |
|
Ignored |
Since 0.7.14
void tp_contacts_mixin_init (GObject *obj
,gsize offset
);
Initialize the contacts mixin. Should be called from the implementation's instance init function like so:
1 2 |
tp_contacts_mixin_init ((GObject *) self, G_STRUCT_OFFSET (SomeObject, contacts_mixin)); |
|
An instance of the implementation that uses this mixin |
|
The byte offset of the TpContactsMixin within the object structure |
Since 0.7.14
void tp_contacts_mixin_set_contact_attribute (GHashTable *contact_attributes
,TpHandle handle
,const gchar *attribute
,GValue *value
);
Utility function to set attribute for handle to value in the attributes hash as passed to a TpContactsMixinFillContactAttributesFunc.
|
contacts attribute hash as passed to TpContactsMixinFillContactAttributesFunc |
|
Handle to set the attribute on |
|
attribute name |
|
slice allocated GValue containing the value of the attribute, for instance with tp_g_value_slice_new. Ownership of the GValue is taken over by the mixin |
Since 0.7.14
void (*TpContactsMixinFillContactAttributesFunc) (GObject *obj
,const GArray *contacts
,GHashTable *attributes_hash
);
This function is called to supply contact attributes pertaining to
a particular interface, for a list of contacts.
All the handles in contacts
are guaranteed to be valid and
referenced.
|
An object implementing the Contacts interface with this mixin |
|
The contact handles for which attributes are requested |
|
hash of handle => hash of attributes, containing all the contacts in the contacts array |