|  |  |  | telepathy-glib API Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
#include <telepathy-glib/text-mixin.h>
                    TpTextMixin;
struct              TpTextMixinClass;
GQuark              tp_text_mixin_class_get_offset_quark
                                                        (void);
GQuark              tp_text_mixin_get_offset_quark      (void);
void                tp_text_mixin_class_init            (GObjectClass *obj_cls,
                                                         glong offset);
void                tp_text_mixin_init                  (GObject *obj,
                                                         glong offset,
                                                         TpHandleRepoIface *contacts_repo);
void                tp_text_mixin_set_message_types     (GObject *obj,
                                                         ...);
void                tp_text_mixin_finalize              (GObject *obj);
gboolean            tp_text_mixin_receive_with_flags    (GObject *obj,
                                                         TpChannelTextMessageType type,
                                                         TpHandle sender,
                                                         time_t timestamp,
                                                         const char *text,
                                                         TpChannelTextMessageFlags flags);
gboolean            tp_text_mixin_receive               (GObject *obj,
                                                         TpChannelTextMessageType type,
                                                         TpHandle sender,
                                                         time_t timestamp,
                                                         const char *text);
gboolean            tp_text_mixin_acknowledge_pending_messages
                                                        (GObject *obj,
                                                         const GArray *ids,
                                                         GError **error);
gboolean            tp_text_mixin_list_pending_messages (GObject *obj,
                                                         gboolean clear,
                                                         GPtrArray **ret,
                                                         GError **error);
gboolean            tp_text_mixin_get_message_types     (GObject *obj,
                                                         GArray **ret,
                                                         GError **error);
void                tp_text_mixin_clear                 (GObject *obj);
gboolean            tp_text_mixin_has_pending_messages  (GObject *obj,
                                                         TpHandle *first_sender);
void                tp_text_mixin_set_rescued           (GObject *obj);
void                tp_text_mixin_iface_init            (gpointer g_iface,
                                                         gpointer iface_data);
This mixin can be added to a channel GObject class to implement the text channel type in a general way. It implements the pending message queue and GetMessageTypes, so the implementation should only need to implement Send.
To use the text mixin, include a TpTextMixinClass somewhere in your
class structure and a TpTextMixin somewhere in your instance structure,
and call tp_text_mixin_class_init() from your class_init function,
tp_text_mixin_init() from your init function or constructor, and
tp_text_mixin_finalize() from your dispose or finalize function.
To use the text mixin as the implementation of
TpSvcChannelTypeText, in the function you pass to G_IMPLEMENT_INTERFACE,
you should first call tp_text_mixin_iface_init(), then call
tp_svc_channel_type_text_implement_send() to register your implementation
of the Send method.
typedef struct _TpTextMixin TpTextMixin;
TpTextMixin is deprecated and should not be used in newly-written code.
Structure to be included in the instance structure of objects that
use this mixin. Initialize it with tp_text_mixin_init().
There are no public fields.
struct TpTextMixinClass {
};
TpTextMixinClass is deprecated and should not be used in newly-written code.
Structure to be included in the class structure of objects that
use this mixin. Initialize it with tp_text_mixin_class_init().
There are no public fields.
GQuark              tp_text_mixin_class_get_offset_quark
                                                        (void);
tp_text_mixin_class_get_offset_quark is deprecated and should not be used in newly-written code. Use TpMessageMixin instead.
| Returns : | the quark used for storing mixin offset on a GObjectClass | 
GQuark              tp_text_mixin_get_offset_quark      (void);
tp_text_mixin_get_offset_quark is deprecated and should not be used in newly-written code. Use TpMessageMixin instead.
| Returns : | the quark used for storing mixin offset on a GObject | 
void tp_text_mixin_class_init (GObjectClass *obj_cls,glong offset);
tp_text_mixin_class_init is deprecated and should not be used in newly-written code. Use TpMessageMixin instead.
Initialize the text mixin. Should be called from the implementation's class_init function like so:
| 1 2 | tp_text_mixin_class_init ((GObjectClass *) klass, G_STRUCT_OFFSET (SomeObjectClass, text_mixin)); | 
| 
 | The class of the implementation that uses this mixin | 
| 
 | The byte offset of the TpTextMixinClass within the class structure | 
void tp_text_mixin_init (GObject *obj,glong offset,TpHandleRepoIface *contacts_repo);
tp_text_mixin_init is deprecated and should not be used in newly-written code. Use tp_message_mixin_init() instead.
Initialize the text mixin. Should be called from the implementation's instance init function like so:
| 1 2 3 | tp_text_mixin_init ((GObject *) self, G_STRUCT_OFFSET (SomeObject, text_mixin), self->contact_repo); | 
| 
 | An instance of the implementation that uses this mixin | 
| 
 | The byte offset of the TpTextMixin within the object structure | 
| 
 | The connection's TP_HANDLE_TYPE_CONTACTrepository | 
void tp_text_mixin_set_message_types (GObject *obj,...);
tp_text_mixin_set_message_types is deprecated and should not be used in newly-written code. Use TpMessageMixin instead.
Set the supported message types.
| 
 | An object with this mixin | 
| 
 | guints representing members of TpChannelTextMessageType, terminated by G_MAXUINT | 
void                tp_text_mixin_finalize              (GObject *obj);
tp_text_mixin_finalize is deprecated and should not be used in newly-written code. Use tp_message_mixin_finalize() instead.
Free resources held by the text mixin.
| 
 | An object with this mixin. | 
gboolean tp_text_mixin_receive_with_flags (GObject *obj,TpChannelTextMessageType type,TpHandle sender,time_t timestamp,const char *text,TpChannelTextMessageFlags flags);
tp_text_mixin_receive_with_flags is deprecated and should not be used in newly-written code. Use tp_message_mixin_take_received() instead.
Add a message to the pending queue and emit Received.
| 
 | An object with the text mixin | 
| 
 | The type of message received from the underlying protocol | 
| 
 | The handle of the message sender | 
| 
 | The time the message was received | 
| 
 | The text of the message | 
| 
 | the message's flags | 
| Returns : | TRUEon success;FALSEif the message was lost due to the memory
limit. | 
gboolean tp_text_mixin_receive (GObject *obj,TpChannelTextMessageType type,TpHandle sender,time_t timestamp,const char *text);
tp_text_mixin_receive is deprecated and should not be used in newly-written code. Use tp_message_mixin_take_received() instead.
Add a message to the pending queue and emit Received. Exactly equivalent
to tp_text_mixin_receive_with_flags() with flags == 0.
| 
 | An object with the text mixin | 
| 
 | The type of message received from the underlying protocol | 
| 
 | The handle of the message sender | 
| 
 | The time the message was received | 
| 
 | The text of the message | 
| Returns : | TRUEon success;FALSEif the message was lost due to the memory
limit. | 
gboolean tp_text_mixin_acknowledge_pending_messages (GObject *obj,const GArray *ids,GError **error);
tp_text_mixin_acknowledge_pending_messages is deprecated and should not be used in newly-written code. Use TpMessageMixin instead.
Implements D-Bus method AcknowledgePendingMessages on interface org.freedesktop.Telepathy.Channel.Type.Text
| 
 | An object with this mixin | 
| 
 | An array of guint representing message IDs | 
| 
 | Used to return a pointer to a GError detailing any error that occurred, D-Bus will throw the error only if this function returns false. | 
| Returns : | TRUE if successful, FALSE if an error was thrown. | 
gboolean tp_text_mixin_list_pending_messages (GObject *obj,gboolean clear,GPtrArray **ret,GError **error);
tp_text_mixin_list_pending_messages is deprecated and should not be used in newly-written code. Use TpMessageMixin instead.
Implements D-Bus method ListPendingMessages on interface org.freedesktop.Telepathy.Channel.Type.Text
| 
 | An object with this mixin | 
| 
 | If TRUE, delete the pending messages from the queue | 
| 
 | Used to return a pointer to a new GPtrArray of D-Bus structures | 
| 
 | Used to return a pointer to a GError detailing any error that occurred, D-Bus will throw the error only if this function returns false. | 
| Returns : | TRUE if successful, FALSE if an error was thrown. | 
gboolean tp_text_mixin_get_message_types (GObject *obj,GArray **ret,GError **error);
tp_text_mixin_get_message_types is deprecated and should not be used in newly-written code. Use TpMessageMixin instead.
Return a newly allocated GArray of guint, representing message types
taken from TpChannelTextMessageType, through ret.
| 
 | An object with this mixin | 
| 
 | A pointer to where a GArray of guint will be placed on success | 
| 
 | A pointer to where an error will be placed on failure | 
| Returns : | TRUEon success | 
void                tp_text_mixin_clear                 (GObject *obj);
tp_text_mixin_clear is deprecated and should not be used in newly-written code. Use tp_message_mixin_clear() instead.
Clear the pending message queue, deleting all messages.
| 
 | An object with this mixin | 
gboolean tp_text_mixin_has_pending_messages (GObject *obj,TpHandle *first_sender);
tp_text_mixin_has_pending_messages is deprecated and should not be used in newly-written code. Use tp_message_mixin_has_pending_messages() instead.
Return whether the channel obj has unacknowledged messages. If so, and
first_sender is not NULL, the handle of the sender of the first message
is placed in it, without incrementing the handle's reference count.
void                tp_text_mixin_set_rescued           (GObject *obj);
tp_text_mixin_set_rescued is deprecated and should not be used in newly-written code. Use tp_message_mixin_set_rescued() instead.
Mark all pending messages as having been "rescued" from a channel that previously closed.
| 
 | An object with this mixin | 
void tp_text_mixin_iface_init (gpointer g_iface,gpointer iface_data);
tp_text_mixin_iface_init is deprecated and should not be used in newly-written code. Use tp_message_mixin_text_iface_init() instead.
Fill in this mixin's AcknowledgePendingMessages, GetMessageTypes and
ListPendingMessages implementations in the given interface vtable.
In addition to calling this function during interface initialization, the
implementor is expected to call tp_svc_channel_type_text_implement_send(),
providing a Send implementation.
| 
 | A pointer to the TpSvcChannelTypeTextClass in an object class | 
| 
 | Ignored |