![]() |
![]() |
![]() |
telepathy-glib API Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
#include <telepathy-glib/telepathy-glib.h> struct TpTextChannel; struct TpTextChannelClass; TpTextChannel * tp_text_channel_new (TpConnection *conn
,const gchar *object_path
,const GHashTable *immutable_properties
,GError **error
); const gchar * const * tp_text_channel_get_supported_content_types (TpTextChannel *self
); TpMessagePartSupportFlags tp_text_channel_get_message_part_support_flags (TpTextChannel *self
); TpDeliveryReportingSupportFlags tp_text_channel_get_delivery_reporting_support (TpTextChannel *self
); GList * tp_text_channel_get_pending_messages (TpTextChannel *self
); GArray * tp_text_channel_get_message_types (TpTextChannel *self
); #define TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES void tp_text_channel_send_message_async (TpTextChannel *self
,TpMessage *message
,TpMessageSendingFlags flags
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean tp_text_channel_send_message_finish (TpTextChannel *self
,GAsyncResult *result
,gchar **token
,GError **error
); void tp_text_channel_ack_messages_async (TpTextChannel *self
,const GList *messages
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean tp_text_channel_ack_messages_finish (TpTextChannel *self
,GAsyncResult *result
,GError **error
); void tp_text_channel_ack_message_async (TpTextChannel *self
,TpMessage *message
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean tp_text_channel_ack_message_finish (TpTextChannel *self
,GAsyncResult *result
,GError **error
); void tp_text_channel_set_chat_state_async (TpTextChannel *self
,TpChannelChatState state
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean tp_text_channel_set_chat_state_finish (TpTextChannel *self
,GAsyncResult *result
,GError **error
); gboolean tp_text_channel_supports_message_type (TpTextChannel *self
,TpChannelTextMessageType message_type
);
"delivery-reporting-support" guint : Read "message-part-support-flags" guint : Read "message-types" GArray_guint_* : Read "supported-content-types" GStrv : Read
"message-received" :Run Last
"message-sent" :Run Last
"pending-message-removed" :Run Last
TpTextChannel is a sub-class of TpChannel providing convenient API to send and receive TpMessage.
struct TpTextChannel;
Data structure representing a TpTextChannel.
Since 0.13.10
struct TpTextChannelClass { };
The class of a TpTextChannel.
Since 0.13.10
TpTextChannel * tp_text_channel_new (TpConnection *conn
,const gchar *object_path
,const GHashTable *immutable_properties
,GError **error
);
Convenient function to create a new TpTextChannel
|
a TpConnection; may not be NULL
|
|
the object path of the channel; may not be NULL
|
|
the immutable properties of the channel, as signalled by the NewChannel D-Bus signal or returned by the CreateChannel and EnsureChannel D-Bus methods: a mapping from strings (D-Bus interface name + "." + property name) to GValue instances. [transfer none][element-type utf8 GObject.Value] |
|
used to indicate the error if NULL is returned |
Returns : |
a newly created TpTextChannel. [transfer full] |
Since 0.13.10
const gchar * const * tp_text_channel_get_supported_content_types
(TpTextChannel *self
);
Return the "supported-content-types" property
|
a TpTextChannel |
Returns : |
(transfer none) : the value of "supported-content-types" |
Since 0.13.10
TpMessagePartSupportFlags tp_text_channel_get_message_part_support_flags
(TpTextChannel *self
);
Return the "message-part-support-flags" property
|
a TpTextChannel |
Returns : |
the value of "message-part-support-flags" |
Since 0.13.10
TpDeliveryReportingSupportFlags tp_text_channel_get_delivery_reporting_support
(TpTextChannel *self
);
Return the "delivery-reporting-support" property
|
a TpTextChannel |
Returns : |
the value of "delivery-reporting-support" property |
Since 0.13.10
GList * tp_text_channel_get_pending_messages
(TpTextChannel *self
);
Return a newly allocated list of unacknowledged TpSignalledMessage objects.
|
a TpTextChannel |
Returns : |
a GList of borrowed TpSignalledMessage. [transfer container][element-type TelepathyGLib.SignalledMessage] |
Since 0.13.10
GArray * tp_text_channel_get_message_types (TpTextChannel *self
);
Return the "message-types" property
|
a TpTextChannel |
Returns : |
the value of "message-types". [transfer none][element-type TelepathyGLib.ChannelTextMessageType] |
Since 0.13.16
#define TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES
Expands to a call to a function that returns a quark representing the incoming messages features of a TpTextChannel.
When this feature is prepared, tp_text_channel_get_pending_messages()
will
return a non-empty list if any unacknowledged messages are waiting, and the
"message-received" and "pending-message-removed"
signals will be emitted.
One can ask for a feature to be prepared using the
tp_proxy_prepare_async()
function, and waiting for it to callback.
Since 0.13.10
void tp_text_channel_send_message_async (TpTextChannel *self
,TpMessage *message
,TpMessageSendingFlags flags
,GAsyncReadyCallback callback
,gpointer user_data
);
Submit a message to the server for sending. Once the message has been
submitted to the sever, callback
will be called. You can then call
tp_text_channel_send_message_finish()
to get the result of the operation.
|
a TpTextChannel |
|
a TpClientMessage |
|
flags affecting how the message is sent |
|
a callback to call when the message has been submitted to the server |
|
data to pass to callback
|
Since 0.13.10
gboolean tp_text_channel_send_message_finish (TpTextChannel *self
,GAsyncResult *result
,gchar **token
,GError **error
);
Finishes to send a message.
token
can be used to match any incoming delivery or failure reports
against the sent message. If the returned token is NULL
the
message is not readily identifiable.
|
a TpTextChannel |
|
a GAsyncResult |
|
if not NULL , used to return the
token of the sent message. [out][transfer full]
|
|
a GError to fill |
Returns : |
TRUE if the message has been submitted to the server, FALSE
otherwise. |
Since 0.13.10
void tp_text_channel_ack_messages_async (TpTextChannel *self
,const GList *messages
,GAsyncReadyCallback callback
,gpointer user_data
);
Acknowledge all the messages in messages
.
Once the messages have been acked, callback
will be called.
You can then call tp_text_channel_ack_messages_finish()
to get the
result of the operation.
See tp_text_channel_ack_message_async()
about acknowledging messages.
|
a TpTextChannel |
|
a GList of TpSignalledMessage. [element-type TelepathyGLib.SignalledMessage] |
|
a callback to call when the message have been acked |
|
data to pass to callback
|
Since 0.13.10
gboolean tp_text_channel_ack_messages_finish (TpTextChannel *self
,GAsyncResult *result
,GError **error
);
Finishes to ack a list of messages.
|
a TpTextChannel |
|
a GAsyncResult |
|
a GError to fill |
Returns : |
TRUE if the messages have been acked, FALSE otherwise. |
Since 0.13.10
void tp_text_channel_ack_message_async (TpTextChannel *self
,TpMessage *message
,GAsyncReadyCallback callback
,gpointer user_data
);
Acknowledge message
. Once the message has been acked, callback
will be
called. You can then call tp_text_channel_ack_message_finish()
to get the
result of the operation.
A message should be acknowledged once it has been shown to the user by the Handler of the channel. So Observers and Approvers should NOT acknowledge messages themselves. Once a message has been acknowledged, it is removed from the pending-message queue and so the "pending-message-removed" signal is fired.
|
a TpTextChannel |
|
a TpSignalledMessage |
|
a callback to call when the message have been acked |
|
data to pass to callback
|
Since 0.13.10
gboolean tp_text_channel_ack_message_finish (TpTextChannel *self
,GAsyncResult *result
,GError **error
);
Finishes to ack a message.
|
a TpTextChannel |
|
a GAsyncResult |
|
a GError to fill |
Returns : |
TRUE if the message has been acked, FALSE otherwise. |
Since 0.13.10
void tp_text_channel_set_chat_state_async (TpTextChannel *self
,TpChannelChatState state
,GAsyncReadyCallback callback
,gpointer user_data
);
Set the local state on channel self
to state
.
Once the state has been set, callback
will be called.
You can then call tp_text_channel_set_chat_state_finish()
to get the
result of the operation.
|
a TpTextChannel |
|
a TpChannelChatState to set |
|
a callback to call when the chat state has been set |
|
data to pass to callback
|
Since 0.13.10
gboolean tp_text_channel_set_chat_state_finish (TpTextChannel *self
,GAsyncResult *result
,GError **error
);
Finishes to set chat state.
|
a TpTextChannel |
|
a GAsyncResult |
|
a GError to fill |
Returns : |
TRUE if the chat state has been changed, FALSE otherwise. |
Since 0.13.10
gboolean tp_text_channel_supports_message_type (TpTextChannel *self
,TpChannelTextMessageType message_type
);
Check if message of type message_type
can be sent on this channel.
|
a TpTextChannel |
|
a TpChannelTextMessageType |
Returns : |
TRUE if message of type message_type can be sent on self , FALSE
otherwise |
Since 0.13.16
"delivery-reporting-support"
property"delivery-reporting-support" guint : Read
A TpDeliveryReportingSupportFlags indicating features supported by this channel.
Default value: 0
Since 0.13.10
"message-part-support-flags"
property"message-part-support-flags" guint : Read
A TpMessagePartSupportFlags indicating the level of support for message parts on this channel.
Default value: 0
Since 0.13.10
"message-types"
property "message-types" GArray_guint_* : Read
A GArray containing the TpChannelTextMessageType which may be sent on this channel.
Since 0.13.16
"message-received"
signalvoid user_function (TpTextChannel *self,
TpSignalledMessage *message,
gpointer user_data) : Run Last
The ::message-received signal is emitted when a new message has been
received on self
.
Note that this signal is only fired once the TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES has been prepared.
|
the TpTextChannel |
|
a TpSignalledMessage |
|
user data set when the signal handler was connected. |
Since 0.13.10
"message-sent"
signalvoid user_function (TpTextChannel *self,
TpSignalledMessage *message,
guint flags,
gchar *token,
gpointer user_data) : Run Last
The ::message-sent signal is emitted when message
has been submitted for sending.
|
the TpTextChannel |
|
a TpSignalledMessage |
|
the TpMessageSendingFlags affecting how the message was sent |
|
an opaque token used to match any incoming delivery or failure
reports against this message, or NULL if the message is not
readily identifiable. |
|
user data set when the signal handler was connected. |
Since 0.13.10
"pending-message-removed"
signalvoid user_function (TpTextChannel *self,
TpSignalledMessage *message,
gpointer user_data) : Run Last
The ::pending-message-removed signal is emitted when message
has been acked and so removed from the pending messages list.
Note that this signal is only fired once the TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES has been prepared.
|
the TpTextChannel |
|
a TpSignalledMessage |
|
user data set when the signal handler was connected. |
Since 0.13.10