telepathy-glib API Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
#include <telepathy-glib/channel.h> TpChannel; struct TpChannelClass; TpChannel * tp_channel_new (TpConnection *conn
,const gchar *object_path
,const gchar *optional_channel_type
,TpHandleType optional_handle_type
,TpHandle optional_handle
,GError **error
); TpChannel * tp_channel_new_from_properties (TpConnection *conn
,const gchar *object_path
,const GHashTable *immutable_properties
,GError **error
); gboolean tp_channel_run_until_ready (TpChannel *self
,GError **error
,GMainLoop **loop
); void (*TpChannelWhenReadyCb) (TpChannel *channel
,const GError *error
,gpointer user_data
); void tp_channel_call_when_ready (TpChannel *self
,TpChannelWhenReadyCb callback
,gpointer user_data
); void tp_channel_init_known_interfaces (void
); gboolean tp_channel_is_ready (TpChannel *self
); #define TP_CHANNEL_FEATURE_CORE #define TP_CHANNEL_FEATURE_CONTACTS TpConnection * tp_channel_borrow_connection (TpChannel *self
); GHashTable * tp_channel_borrow_immutable_properties (TpChannel *self
); TpConnection * tp_channel_get_connection (TpChannel *self
); GVariant * tp_channel_dup_immutable_properties (TpChannel *self
); const gchar * tp_channel_get_channel_type (TpChannel *self
); GQuark tp_channel_get_channel_type_id (TpChannel *self
); TpHandle tp_channel_get_handle (TpChannel *self
,TpHandleType *handle_type
); const gchar * tp_channel_get_identifier (TpChannel *self
); TpContact * tp_channel_get_target_contact (TpChannel *self
); gboolean tp_channel_get_requested (TpChannel *self
); TpHandle tp_channel_get_initiator_handle (TpChannel *self
); const gchar * tp_channel_get_initiator_identifier (TpChannel *self
); TpContact * tp_channel_get_initiator_contact (TpChannel *self
); void tp_channel_join_async (TpChannel *self
,const gchar *message
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean tp_channel_join_finish (TpChannel *self
,GAsyncResult *result
,GError **error
); void tp_channel_leave_async (TpChannel *self
,TpChannelGroupChangeReason reason
,const gchar *message
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean tp_channel_leave_finish (TpChannel *self
,GAsyncResult *result
,GError **error
); void tp_channel_close_async (TpChannel *self
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean tp_channel_close_finish (TpChannel *self
,GAsyncResult *result
,GError **error
); void tp_channel_destroy_async (TpChannel *self
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean tp_channel_destroy_finish (TpChannel *self
,GAsyncResult *result
,GError **error
); #define TP_CHANNEL_FEATURE_CHAT_STATES TpChannelChatState tp_channel_get_chat_state (TpChannel *self
,TpHandle contact
); #define TP_CHANNEL_FEATURE_GROUP TpChannelGroupFlags tp_channel_group_get_flags (TpChannel *self
); TpHandle tp_channel_group_get_handle_owner (TpChannel *self
,TpHandle handle
); TpContact * tp_channel_group_get_contact_owner (TpChannel *self
,TpContact *contact
); TpHandle tp_channel_group_get_self_handle (TpChannel *self
); TpContact * tp_channel_group_get_self_contact (TpChannel *self
); const TpIntset * tp_channel_group_get_members (TpChannel *self
); GPtrArray * tp_channel_group_dup_members_contacts (TpChannel *self
); const TpIntset * tp_channel_group_get_local_pending (TpChannel *self
); GPtrArray * tp_channel_group_dup_local_pending_contacts (TpChannel *self
); const TpIntset * tp_channel_group_get_remote_pending (TpChannel *self
); GPtrArray * tp_channel_group_dup_remote_pending_contacts (TpChannel *self
); gboolean tp_channel_group_get_local_pending_info (TpChannel *self
,TpHandle local_pending
,TpHandle *actor
,TpChannelGroupChangeReason *reason
,const gchar **message
); gboolean tp_channel_group_get_local_pending_contact_info (TpChannel *self
,TpContact *local_pending
,TpContact **actor
,TpChannelGroupChangeReason *reason
,const gchar **message
); #define TP_ERRORS_REMOVED_FROM_GROUP #define TP_CHANNEL_FEATURE_PASSWORD gboolean tp_channel_password_needed (TpChannel *self
); void tp_channel_provide_password_async (TpChannel *self
,const gchar *password
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean tp_channel_provide_password_finish (TpChannel *self
,GAsyncResult *result
,GError **error
); TpProxyPendingCall * tp_cli_channel_call_close (TpChannel *proxy
,gint timeout_ms
,tp_cli_channel_callback_for_close callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
); TpProxyPendingCall * tp_cli_channel_call_get_channel_type (TpChannel *proxy
,gint timeout_ms
,tp_cli_channel_callback_for_get_channel_type callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
); TpProxyPendingCall * tp_cli_channel_call_get_handle (TpChannel *proxy
,gint timeout_ms
,tp_cli_channel_callback_for_get_handle callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
); TpProxyPendingCall * tp_cli_channel_call_get_interfaces (TpChannel *proxy
,gint timeout_ms
,tp_cli_channel_callback_for_get_interfaces callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
); void (*tp_cli_channel_callback_for_close) (TpChannel *proxy
,const GError *error
,gpointer user_data
,GObject *weak_object
); void (*tp_cli_channel_callback_for_get_channel_type) (TpChannel *proxy
,const gchar *out_Channel_Type
,const GError *error
,gpointer user_data
,GObject *weak_object
); void (*tp_cli_channel_callback_for_get_handle) (TpChannel *proxy
,guint out_Target_Handle_Type
,guint out_Target_Handle
,const GError *error
,gpointer user_data
,GObject *weak_object
); void (*tp_cli_channel_callback_for_get_interfaces) (TpChannel *proxy
,const gchar **out_Interfaces
,const GError *error
,gpointer user_data
,GObject *weak_object
); gboolean tp_cli_channel_run_close (TpChannel *proxy
,gint timeout_ms
,GError **error
,GMainLoop **loop
); gboolean tp_cli_channel_run_get_channel_type (TpChannel *proxy
,gint timeout_ms
,gchar **out_Channel_Type
,GError **error
,GMainLoop **loop
); gboolean tp_cli_channel_run_get_handle (TpChannel *proxy
,gint timeout_ms
,guint *out_Target_Handle_Type
,guint *out_Target_Handle
,GError **error
,GMainLoop **loop
); gboolean tp_cli_channel_run_get_interfaces (TpChannel *proxy
,gint timeout_ms
,gchar ***out_Interfaces
,GError **error
,GMainLoop **loop
); TpProxySignalConnection * tp_cli_channel_connect_to_closed (TpChannel *proxy
,tp_cli_channel_signal_callback_closed callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
,GError **error
); void (*tp_cli_channel_signal_callback_closed) (TpChannel *proxy
,gpointer user_data
,GObject *weak_object
); TpProxyPendingCall * tp_cli_channel_interface_destroyable_call_destroy (TpChannel *proxy
,gint timeout_ms
,tp_cli_channel_interface_destroyable_callback_for_destroy callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
); void (*tp_cli_channel_interface_destroyable_callback_for_destroy) (TpChannel *proxy
,const GError *error
,gpointer user_data
,GObject *weak_object
); gboolean tp_cli_channel_interface_destroyable_run_destroy (TpChannel *proxy
,gint timeout_ms
,GError **error
,GMainLoop **loop
);
GObject +----TpProxy +----TpChannel +----TpCallChannel +----TpDBusTubeChannel +----TpFileTransferChannel +----TpStreamTubeChannel +----TpTextChannel
"channel-properties" GHashTable_gchararray+GValue_* : Read / Write / Construct Only "channel-ready" gboolean : Read "connection" TpConnection* : Read / Write / Construct Only "group-flags" guint : Read "group-self-contact" TpContact* : Read "group-self-handle" guint : Read "identifier" gchar* : Read "initiator-contact" TpContact* : Read "initiator-handle" guint : Read "initiator-identifier" gchar* : Read "password-needed" gboolean : Read "requested" gboolean : Read "target-contact" TpContact* : Read
"chat-state-changed" :Has Details
"group-contacts-changed" :Has Details
"group-flags-changed" :Has Details
"group-members-changed" :Has Details
"group-members-changed-detailed" :Has Details
TpChannel objects provide convenient access to Telepathy channels.
Compared with a simple proxy for method calls, they add the following features:
* calling GetChannelType()
, GetInterfaces()
, GetHandles()
automatically
This section also documents the auto-generated C wrappers for the
Channel D-Bus interface. Of these, in general, only
tp_cli_channel_call_close()
and tp_cli_channel_run_close()
are useful (the
TpChannel object provides a more convenient API for the rest).
typedef struct _TpChannel TpChannel;
A proxy object for a Telepathy channel. A proxy object for a Telepathy channel. There are no interesting public struct fields.
(Changed in 0.7.12: the layout of the structure is visible, allowing subclassing.)
Since 0.7.1
struct TpChannelClass { TpProxyClass parent_class; };
The class of a TpChannel. In addition to parent_class
there are four
pointers reserved for possible future use.
(Changed in 0.7.12: the layout of the structure is visible, allowing subclassing.)
TpProxyClass |
parent class |
Since 0.7.1
TpChannel * tp_channel_new (TpConnection *conn
,const gchar *object_path
,const gchar *optional_channel_type
,TpHandleType optional_handle_type
,TpHandle optional_handle
,GError **error
);
tp_channel_new
is deprecated and should not be used in newly-written code. Use tp_simple_client_factory_ensure_channel()
instead.
|
a connection; may not be NULL
|
|
the object path of the channel; may not be NULL
|
|
the channel type if already known, or NULL if not |
|
the handle type if already known, or
TP_UNKNOWN_HANDLE_TYPE if not |
|
the handle if already known, or 0 if not
(if optional_handle_type is TP_UNKNOWN_HANDLE_TYPE or
TP_HANDLE_TYPE_NONE , this must be 0) |
|
used to indicate the error if NULL is returned |
Returns : |
a new channel proxy, or NULL on invalid arguments. |
Since 0.7.1
TpChannel * tp_channel_new_from_properties (TpConnection *conn
,const gchar *object_path
,const GHashTable *immutable_properties
,GError **error
);
tp_channel_new_from_properties
is deprecated and should not be used in newly-written code. Use tp_simple_client_factory_ensure_channel()
instead.
|
a connection; 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 new channel proxy, or NULL on invalid arguments |
Since 0.7.19
gboolean tp_channel_run_until_ready (TpChannel *self
,GError **error
,GMainLoop **loop
);
tp_channel_run_until_ready
has been deprecated since version 0.11.0 and should not be used in newly-written code. Use tp_proxy_prepare_async()
and re-enter the main
loop yourself, or restructure your program in such a way as to avoid
re-entering the main loop.
If self
is ready for use (introspection has finished, etc.), return
immediately. Otherwise, re-enter the main loop until the channel either
becomes invalid or becomes ready for use, or until the main loop stored
via loop
is cancelled.
|
a channel |
|
if not NULL and FALSE is returned, used to raise an error |
|
if not NULL , a GMainLoop is placed here while it is being run
(so calling code can call g_main_loop_quit() to abort), and NULL is
placed here after the loop has been run |
Returns : |
TRUE if the channel has been introspected and is ready for use,
FALSE if the channel has become invalid. |
Since 0.7.1
void (*TpChannelWhenReadyCb) (TpChannel *channel
,const GError *error
,gpointer user_data
);
TpChannelWhenReadyCb
is deprecated and should not be used in newly-written code. 0.17.6
Signature of a callback passed to tp_channel_call_when_ready()
, which
will be called exactly once, when the channel becomes ready or
invalid (whichever happens first)
|
the channel (which may be in the middle of being disposed,
if error is non-NULL , error->domain is TP_DBUS_ERRORS and error->code is
TP_DBUS_ERROR_PROXY_UNREFERENCED) |
|
NULL if the channel is ready for use, or the error with which
it was invalidated if it is now invalid |
|
whatever was passed to tp_channel_call_when_ready()
|
void tp_channel_call_when_ready (TpChannel *self
,TpChannelWhenReadyCb callback
,gpointer user_data
);
tp_channel_call_when_ready
has been deprecated since version 0.17.6 and should not be used in newly-written code. Use tp_proxy_prepare_async()
If self
is ready for use or has been invalidated, call callback
immediately, then return. Otherwise, arrange
for callback
to be called when self
either becomes ready for use
or becomes invalid.
This is a less general form of tp_proxy_prepare_async()
, which should be
used in new code. (One important difference is that this function can call
callback
before it has returned, whereas tp_proxy_prepare_async()
always
calls callback
from the main loop.)
|
a channel |
|
called when the channel becomes ready or invalidated, whichever happens first |
|
arbitrary user-supplied data passed to the callback |
Since 0.7.7
void tp_channel_init_known_interfaces (void
);
Ensure that the known interfaces for TpChannel have been set up.
This is done automatically when necessary, but for correct
overriding of library interfaces by local extensions, you should
call this function before calling
tp_proxy_or_subclass_hook_on_interface_add()
with first argument
TP_TYPE_CHANNEL
.
Since 0.7.6
gboolean tp_channel_is_ready (TpChannel *self
);
tp_channel_is_ready
has been deprecated since version 0.17.6 and should not be used in newly-written code. use tp_proxy_is_prepared()
with
TP_CHANNEL_FEATURE_CORE
Returns the same thing as the "channel-ready" property.
New code should use tp_proxy_is_prepared()
, which is a more general form of
this method.
For group channels, this method is equivalent to checking for the
combination of TP_CHANNEL_FEATURE_CORE
and TP_CHANNEL_FEATURE_GROUP
; for
non-group channels, it's equivalent to checking for
TP_CHANNEL_FEATURE_CORE
.
One important difference is that after "invalidated" is
signalled, "channel-ready" keeps its current value - which might
be TRUE
, if the channel was successfully prepared before it became
invalidated - but tp_proxy_is_prepared()
returns FALSE
for all features.
|
a channel |
Returns : |
TRUE if introspection has completed |
Since 0.7.12
#define TP_CHANNEL_FEATURE_CORE
Expands to a call to a function that returns a quark for the "core" feature on a TpChannel.
When this feature is prepared, the basic Channel properties of the Channel have been retrieved and are available for use.
Specifically, this implies that:
"channel-type" is set
"handle-type" and "handle" are set
any extra interfaces will have been set up in TpProxy (i.e. "interfaces" contains at least all extra Channel interfaces)
(These are a subset of the guarantees offered by the older
"channel-ready"
and tp_channel_call_when_ready()
mechanisms, which are now equivalent to
(TP_CHANNEL_FEATURE_CORE
, TP_CHANNEL_FEATURE_GROUP
) if the channel is
a group, or just TP_CHANNEL_FEATURE_CORE
otherwise.)
One can ask for a feature to be prepared using the
tp_proxy_prepare_async()
function, and waiting for it to callback.
Since 0.11.3
#define TP_CHANNEL_FEATURE_CONTACTS
Expands to a call to a function that returns a quark representing the Contacts features of a TpChannel.
When this feature is prepared, the TpContact objects of this channel are
guaranteed to have all of the features previously passed to
tp_simple_client_factory_add_contact_features()
prepared.
On older connection managers, this feature may fail to prepare.
One can ask for a feature to be prepared using the
tp_proxy_prepare_async()
function, and waiting for it to callback.
Since 0.15.6
TpConnection * tp_channel_borrow_connection (TpChannel *self
);
tp_channel_borrow_connection
is deprecated and should not be used in newly-written code. Since 0.19.9. New code should use
tp_channel_get_connection()
instead.
Returns the connection for this channel. The returned pointer is only valid
while this channel is valid - reference it with g_object_ref()
if needed.
|
a channel |
Returns : |
the value of "connection". [transfer none] |
Since 0.7.12
GHashTable * tp_channel_borrow_immutable_properties
(TpChannel *self
);
tp_channel_borrow_immutable_properties
is deprecated and should not be used in newly-written code. Since 0.19.9. New code should use
tp_channel_dup_immutable_properties()
instead.
Returns the immutable D-Bus properties of this channel, the same as "channel-properties".
The returned hash table should not be altered, and is not necessarily
valid after the main loop is next re-entered. Copy it with
g_boxed_copy()
(its type is TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP
)
if a copy that remains valid must be kept.
If the "channel-properties" property was not set during
construction (e.g. by calling tp_channel_new_from_properties()
), a
reasonable but possibly incomplete version will be made up from the values
of individual properties; reading this property repeatedly may yield
progressively more complete values until the TP_CHANNEL_FEATURE_CORE
feature is prepared.
|
a channel |
Returns : |
a GHashTable where the keys are strings, D-Bus interface name + "." + property name, and the values are GValue instances. [transfer none][element-type utf8 GObject.Value] |
TpConnection * tp_channel_get_connection (TpChannel *self
);
Returns the connection for this channel. The returned pointer is only valid
while this channel is valid - reference it with g_object_ref()
if needed.
|
a channel |
Returns : |
the value of "connection". [transfer none] |
Since 0.19.9
GVariant * tp_channel_dup_immutable_properties (TpChannel *self
);
Returns the immutable D-Bus properties of this channel, in a variant of type
G_VARIANT_TYPE_VARDICT
where the keys are strings,
D-Bus interface name + "." + property name. Use g_variant_lookup()
or
g_variant_lookup_value()
for convenient access to the values.
If the "channel-properties" property was not set during
construction (e.g. by calling tp_channel_new_from_properties()
), a
reasonable but possibly incomplete version will be made up from the values
of individual properties; reading this property repeatedly may yield
progressively more complete values until the TP_CHANNEL_FEATURE_CORE
feature is prepared.
This function should be used only by TpChannel subclasses, otherwise it is recommended to use individual property getters instead.
|
a channel |
Returns : |
a dictionary where the keys are strings, D-Bus interface name + "." + property name. [transfer full] |
Since 0.19.9
const gchar * tp_channel_get_channel_type (TpChannel *self
);
Get the D-Bus interface name representing this channel's type, if it has been discovered.
This is the same as the "channel-type" property; it isn't
guaranteed to be non-NULL
until the TP_CHANNEL_FEATURE_CORE
feature has
been prepared.
|
a channel |
Returns : |
the channel type, if the channel is ready; either the channel
type or NULL , if the channel is not yet ready. |
Since 0.7.12
GQuark tp_channel_get_channel_type_id (TpChannel *self
);
Get the D-Bus interface name representing this channel's type, as a GQuark, if it has been discovered.
This is the same as the "channel-type" property, except that it
is a GQuark rather than a string. It isn't guaranteed to be nonzero until
the TP_CHANNEL_FEATURE_CORE
property is ready.
|
a channel |
Returns : |
the channel type, if the channel is ready; either the channel type or 0, if the channel is not yet ready. |
Since 0.7.12
TpHandle tp_channel_get_handle (TpChannel *self
,TpHandleType *handle_type
);
Get the handle representing the contact, chatroom, etc. with which this channel communicates for its whole lifetime, or 0 if there is no such handle or it has not yet been discovered.
This is the same as the "handle" property. It isn't
guaranteed to have its final value until the TP_CHANNEL_FEATURE_CORE
feature is ready.
If handle_type
is not NULL
, the type of handle is written into it.
This will be TP_UNKNOWN_HANDLE_TYPE
if the handle has not yet been
discovered, or TP_HANDLE_TYPE_NONE
if there is no handle with which this
channel will always communicate. This is the same as the
"handle-type" property.
|
a channel |
|
if not NULL , used to return the type of this handle. [out]
|
Returns : |
the handle |
Since 0.7.12
const gchar * tp_channel_get_identifier (TpChannel *self
);
This channel's associated identifier, or the empty string if no identifier or unknown.
This is the same as the "identifier" property, and isn't guaranteed
to be set until the TP_CHANNEL_FEATURE_CORE
property is ready.
Changed in 0.11.4: as with "identifier", this could
previously either be NULL
or the empty string if there was no suitable
value. It is now non-NULL
in all cases.
|
a channel |
Returns : |
the identifier |
Since 0.7.21
TpContact * tp_channel_get_target_contact (TpChannel *self
);
|
a channel |
Returns : |
the value of "target-contact". [transfer none] |
Since 0.15.6
gboolean tp_channel_get_requested (TpChannel *self
);
Return the "requested" property
|
a TpChannel |
Returns : |
the value of "requested" |
Since 0.11.15
TpHandle tp_channel_get_initiator_handle (TpChannel *self
);
tp_channel_get_initiator_handle
is deprecated and should not be used in newly-written code. New code should use tp_channel_get_initiator_contact()
instead.
Return the "initiator-handle" property
|
a TpChannel |
Returns : |
the value of "initiator-handle" |
Since 0.11.15
const gchar * tp_channel_get_initiator_identifier (TpChannel *self
);
tp_channel_get_initiator_identifier
is deprecated and should not be used in newly-written code. New code should use tp_channel_get_initiator_contact()
instead.
Return the "initiator-identifier" property
|
a TpChannel |
Returns : |
the value of "initiator-identifier" |
Since 0.11.15
TpContact * tp_channel_get_initiator_contact (TpChannel *self
);
|
a channel |
Returns : |
the value of "initiator-contact". [transfer none] |
Since 0.15.6
void tp_channel_join_async (TpChannel *self
,const gchar *message
,GAsyncReadyCallback callback
,gpointer user_data
);
Join channel self
with message
as join message.
When we joined the channel, callback
will be called.
You can then call tp_channel_join_finish()
to get the result of
the operation.
Note that unlike tp_channel_leave_async()
, TP_CHANNEL_FEATURE_GROUP
feature
must be prepared before calling this function.
|
a TpChannel |
|
the join message |
|
a callback to call when we joined the channel |
|
data to pass to callback
|
Since 0.15.5
gboolean tp_channel_join_finish (TpChannel *self
,GAsyncResult *result
,GError **error
);
Completes a call to tp_channel_join_async()
.
|
a TpChannel |
|
a GAsyncResult passed to the callback for tp_channel_join_async() . |
|
a GError to fill |
Returns : |
TRUE if the channel was successfully joined; FALSE otherwise |
Since 0.15.5
void tp_channel_leave_async (TpChannel *self
,TpChannelGroupChangeReason reason
,const gchar *message
,GAsyncReadyCallback callback
,gpointer user_data
);
Leave channel self
with reason
as reason and message
as leave message.
If self
doesn't implement TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP or if
for any reason we can't properly leave the channel, we close it.
When we left the channel, callback
will be called.
You can then call tp_channel_leave_finish()
to get the result of
the operation.
Note that unlike tp_channel_join_async()
, TP_CHANNEL_FEATURE_GROUP
feature
does not have to be prepared and will be prepared for you. But this is a
deprecated behaviour.
|
a TpChannel |
|
the leave reason |
|
the leave message |
|
a callback to call when we left the channel |
|
data to pass to callback
|
Since 0.13.10
gboolean tp_channel_leave_finish (TpChannel *self
,GAsyncResult *result
,GError **error
);
Completes a call to tp_channel_leave_async()
.
|
a TpChannel |
|
a GAsyncResult passed to the callback for tp_channel_leave_async() . |
|
a GError to fill |
Returns : |
TRUE if the channel has been left; FALSE otherwise |
Since 0.13.10
void tp_channel_close_async (TpChannel *self
,GAsyncReadyCallback callback
,gpointer user_data
);
Close channel self
. In most cases, it's generally cleaner to use
tp_channel_leave_async()
instead to properly leave and close the channel.
When the channel has been closed, callback
will be called.
You can then call tp_channel_close_finish()
to get the result of
the operation.
|
a TpChannel |
|
a callback to call when we closed the channel, or NULL
to ignore any reply |
|
data to pass to callback
|
Since 0.13.10
gboolean tp_channel_close_finish (TpChannel *self
,GAsyncResult *result
,GError **error
);
Finishes a call to tp_channel_leave_async()
.
|
a TpChannel |
|
a GAsyncResult passed to the callback for tp_channel_close_async() . |
|
a GError to fill |
Returns : |
TRUE if the channel has been closed; FALSE otherwise |
Since 0.13.10
void tp_channel_destroy_async (TpChannel *self
,GAsyncReadyCallback callback
,gpointer user_data
);
Destroy channel self
.
If self
doesn't implement TP_IFACE_QUARK_CHANNEL_INTERFACE_DESTROYABLE
or if for any reason we can't destroy the channel, we close it.
When the channel has been destroyed or closed, callback
will be called.
You can then call tp_channel_destroy_finish()
to get the result of
the operation.
|
a TpChannel |
|
a callback to call when we left the channel |
|
data to pass to callback
|
Since 0.15.2
gboolean tp_channel_destroy_finish (TpChannel *self
,GAsyncResult *result
,GError **error
);
Completes a call to tp_channel_destroy_async()
.
|
a TpChannel |
|
a GAsyncResult passed to the callback for tp_channel_destroy_async() . |
|
a GError to fill |
Returns : |
TRUE if the channel has been destroyed or closed; FALSE otherwise |
Since 0.15.2
#define TP_CHANNEL_FEATURE_CHAT_STATES
TP_CHANNEL_FEATURE_CHAT_STATES
is deprecated and should not be used in newly-written code. Use TP_TEXT_CHANNEL_FEATURE_CHAT_STATES instead.
Expands to a call to a function that returns a quark representing the chat states feature on a TpChannel.
When this feature is prepared, tp_channel_get_chat_state()
and the
"chat-state-changed" signal become useful.
One can ask for a feature to be prepared using the
tp_proxy_prepare_async()
function, and waiting for it to callback.
Since 0.11.3
TpChannelChatState tp_channel_get_chat_state (TpChannel *self
,TpHandle contact
);
tp_channel_get_chat_state
is deprecated and should not be used in newly-written code. Use tp_text_channel_get_chat_state()
instead.
Return the chat state for the given contact. If tp_proxy_is_prepared()
would return FALSE
for the feature TP_CHANNEL_FEATURE_CHAT_STATES
,
the result will always be TP_CHANNEL_CHAT_STATE_INACTIVE
.
|
a channel |
|
a contact handle |
Returns : |
the chat state for contact , or TP_CHANNEL_CHAT_STATE_INACTIVE
if their chat state is not known |
Since 0.11.3
#define TP_CHANNEL_FEATURE_GROUP
Expands to a call to a function that returns a quark representing the Group features of a TpChannel.
When this feature is prepared, the Group properties of the Channel have been retrieved and are available for use, and change-notification has been set up for those that can change:
the initial value of the "group-self-handle" property will have been fetched and change notification will have been set up
the initial value of the "group-flags" property will have been fetched and change notification will have been set up
(These are the same guarantees offered for Group channels by the older
"channel-ready" and tp_channel_call_when_ready()
mechanisms.)
One can ask for a feature to be prepared using the
tp_proxy_prepare_async()
function, and waiting for it to callback.
Since 0.11.3
TpChannelGroupFlags tp_channel_group_get_flags (TpChannel *self
);
Return the "group-flags" property (see the description of that property for notes on validity).
|
a channel |
Returns : |
the group flags, or 0 |
Since 0.7.12
TpHandle tp_channel_group_get_handle_owner (TpChannel *self
,TpHandle handle
);
tp_channel_group_get_handle_owner
is deprecated and should not be used in newly-written code. New code should use tp_channel_group_get_contact_owner()
instead.
Synopsis (see below for further explanation):
if self
is not a group or handle
is not a member of this channel,
result is undefined;
if TP_CHANNEL_FEATURE_GROUP
has not yet been prepared, result is
undefined;
if self
does not have flags that include
TP_CHANNEL_GROUP_FLAG_PROPERTIES
,
result is undefined;
if handle
is channel-specific and its globally valid "owner" is known,
return that owner;
if handle
is channel-specific and its globally valid "owner" is unknown,
return zero;
if handle
is globally valid, return handle
itself
Some channels (those with flags that include
TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES
) have a concept of
"channel-specific handles". These are handles that only have meaning within
the context of the channel - for instance, in XMPP Multi-User Chat,
participants in a chatroom are identified by an in-room JID consisting
of the JID of the chatroom plus a local nickname.
Depending on the protocol and configuration, it might be possible to find out what globally valid handle (i.e. an identifier that you could add to your contact list) "owns" a channel-specific handle. For instance, in most XMPP MUC chatrooms, normal users cannot see what global JID corresponds to an in-room JID, but moderators can.
This is further complicated by the fact that channels with channel-specific handles can sometimes have members with globally valid handles (for instance, if you invite someone to an XMPP MUC using their globally valid JID, you would expect to see the handle representing that JID in the Group's remote-pending set).
This function's result is undefined unless the channel is ready
and its flags include TP_CHANNEL_GROUP_FLAG_PROPERTIES
(an implementation
without extra D-Bus round trips is not possible using the older API).
|
a channel |
|
a handle which is a member of this channel |
Returns : |
the global handle that owns the given handle, or 0 |
Since 0.7.12
TpContact * tp_channel_group_get_contact_owner (TpChannel *self
,TpContact *contact
);
Synopsis (see below for further explanation):
if self
is not a group or contact
is not a member of this channel,
result is undefined;
if TP_CHANNEL_FEATURE_CONTACTS
has not yet been prepared, result is
undefined;
if self
does not have flags that include
TP_CHANNEL_GROUP_FLAG_PROPERTIES
,
result is undefined;
if contact
is channel-specific and its globally valid "owner" is known,
return that owner;
if contact
is channel-specific and its globally valid "owner" is unknown,
return NULL
;
if contact
is globally valid, return contact
itself
Some channels (those with flags that include
TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES
) have a concept of
"channel-specific contacts". These are contacts that only have meaning within
the context of the channel - for instance, in XMPP Multi-User Chat,
participants in a chatroom are identified by an in-room JID consisting
of the JID of the chatroom plus a local nickname.
Depending on the protocol and configuration, it might be possible to find out what globally valid contact (i.e. a contact that you could add to your contact list) "owns" a channel-specific contact. For instance, in most XMPP MUC chatrooms, normal users cannot see what global JID corresponds to an in-room JID, but moderators can.
This is further complicated by the fact that channels with channel-specific contacts can sometimes have members with globally valid contacts (for instance, if you invite someone to an XMPP MUC using their globally valid JID, you would expect to see the contact representing that JID in the Group's remote-pending set).
|
a channel |
|
a contact which is a member of this channel |
Returns : |
the global contact that owns the given contact,
or NULL . [transfer none]
|
Since 0.15.6
TpHandle tp_channel_group_get_self_handle (TpChannel *self
);
tp_channel_group_get_self_handle
is deprecated and should not be used in newly-written code. New code should use tp_channel_group_get_self_contact()
instead.
Return the "group-self-handle" property (see the description of that property for notes on validity).
|
a channel |
Returns : |
the handle representing the user, or 0 |
Since 0.7.12
TpContact * tp_channel_group_get_self_contact (TpChannel *self
);
|
a channel |
Returns : |
the value of "group-self-contact". [transfer none] |
Since 0.15.6
const TpIntset * tp_channel_group_get_members (TpChannel *self
);
tp_channel_group_get_members
is deprecated and should not be used in newly-written code. New code should use tp_channel_group_dup_members_contacts()
instead.
If self
is a group and the TP_CHANNEL_FEATURE_GROUP
feature has been
prepared, return a TpIntset containing its members.
If self
is a group but TP_CHANNEL_FEATURE_GROUP
has not been prepared,
the result may either be a set of members, or NULL
.
If self
is not a group, return NULL
.
|
a channel |
Returns : |
the members, or NULL . [transfer none]
|
Since 0.7.12
GPtrArray * tp_channel_group_dup_members_contacts
(TpChannel *self
);
If self
is a group and the TP_CHANNEL_FEATURE_CONTACTS
feature has been
prepared, return a GPtrArray containing its members.
If self
is a group but TP_CHANNEL_FEATURE_CONTACTS
has not been prepared,
the result may either be a set of members, or NULL
.
If self
is not a group, return NULL
.
|
a channel |
Returns : |
a new GPtrArray of TpContact, free it with g_ptr_array_unref() , or NULL . [transfer container][type GLib.PtrArray][element-type TelepathyGLib.Contact]
|
Since 0.15.6
const TpIntset * tp_channel_group_get_local_pending (TpChannel *self
);
tp_channel_group_get_local_pending
is deprecated and should not be used in newly-written code. New code should use tp_channel_group_dup_local_pending_contacts()
instead.
If self
is a group and the TP_CHANNEL_FEATURE_GROUP
feature has been
prepared, return a TpIntset containing its local-pending members.
If self
is a group but TP_CHANNEL_FEATURE_GROUP
has not been prepared,
the result may either be a set of local-pending members, or NULL
.
If self
is not a group, return NULL
.
|
a channel |
Returns : |
the local-pending members, or NULL . [transfer none]
|
Since 0.7.12
GPtrArray * tp_channel_group_dup_local_pending_contacts
(TpChannel *self
);
If self
is a group and the TP_CHANNEL_FEATURE_CONTACTS
feature has been
prepared, return a GPtrArray containing its local-pending members.
If self
is a group but TP_CHANNEL_FEATURE_CONTACTS
has not been prepared,
the result may either be a set of local-pending members, or NULL
.
If self
is not a group, return NULL
.
|
a channel |
Returns : |
a new GPtrArray of TpContact, free it with g_ptr_array_unref() , or NULL . [transfer container][type GLib.PtrArray][element-type TelepathyGLib.Contact]
|
Since 0.15.6
const TpIntset * tp_channel_group_get_remote_pending (TpChannel *self
);
tp_channel_group_get_remote_pending
is deprecated and should not be used in newly-written code. New code should use
tp_channel_group_dup_remote_pending_contacts()
instead.
If self
is a group and the TP_CHANNEL_FEATURE_GROUP
feature has been
prepared, return a TpIntset containing its remote-pending members.
If self
is a group but TP_CHANNEL_FEATURE_GROUP
has not been prepared,
the result may either be a set of remote-pending members, or NULL
.
If self
is not a group, return NULL
.
|
a channel |
Returns : |
the remote-pending members, or NULL . [transfer none]
|
Since 0.7.12
GPtrArray * tp_channel_group_dup_remote_pending_contacts
(TpChannel *self
);
If self
is a group and the TP_CHANNEL_FEATURE_CONTACTS
feature has been
prepared, return a GPtrArray containing its remote-pending members.
If self
is a group but TP_CHANNEL_FEATURE_CONTACTS
has not been prepared,
the result may either be a set of remote-pending members, or NULL
.
If self
is not a group, return NULL
.
|
a channel |
Returns : |
a new GPtrArray of TpContact, free it with g_ptr_array_unref() , or NULL . [transfer container][type GLib.PtrArray][element-type TelepathyGLib.Contact]
|
Since 0.15.6
gboolean tp_channel_group_get_local_pending_info (TpChannel *self
,TpHandle local_pending
,TpHandle *actor
,TpChannelGroupChangeReason *reason
,const gchar **message
);
tp_channel_group_get_local_pending_info
is deprecated and should not be used in newly-written code. New code should use
tp_channel_group_get_local_pending_contact_info()
instead.
If local_pending
is actually the handle of a local-pending contact,
write additional information into actor
, reason
and message
and return
TRUE
. The handle and message are not referenced or copied, and can only be
assumed to remain valid until the main loop is re-entered.
If local_pending
is not the handle of a local-pending contact,
write 0 into actor
, TP_CHANNEL_GROUP_CHANGE_REASON_NONE
into reason
and "" into message
, and return FALSE
.
|
a channel |
|
the handle of a local-pending contact about whom more information is needed |
|
either NULL or a location to return the contact
who requested the change. [out][allow-none]
|
|
either NULL or a location to return the reason
for the change. [out][allow-none]
|
|
either NULL or a location to
return the user-supplied message. [out][transfer none][allow-none]
|
Returns : |
TRUE if the contact is in fact local-pending |
Since 0.7.12
gboolean tp_channel_group_get_local_pending_contact_info (TpChannel *self
,TpContact *local_pending
,TpContact **actor
,TpChannelGroupChangeReason *reason
,const gchar **message
);
If local_pending
is actually a local-pending contact,
write additional information into actor
, reason
and message
and return
TRUE
. The contact and message are not referenced or copied, and can only be
assumed to remain valid until the main loop is re-entered.
If local_pending
is not the handle of a local-pending contact,
write NULL
into actor
, TP_CHANNEL_GROUP_CHANGE_REASON_NONE
into reason
and "" into message
, and return FALSE
.
|
a channel |
|
the TpContact of a local-pending contact about whom more information is needed |
|
either NULL or a location to
return the contact who requested the change. [out][allow-none][transfer none]
|
|
either NULL or a location to return the reason
for the change. [out][allow-none]
|
|
either NULL or a location to
return the
user-supplied message. [out][allow-none][transfer none]
|
Returns : |
TRUE if the contact is in fact local-pending |
Since 0.15.6
#define TP_ERRORS_REMOVED_FROM_GROUP (tp_errors_removed_from_group_quark ())
GError domain representing the local user being removed from a channel
with the Group interface. The code
in a GError with this domain must
be a member of TpChannelGroupChangeReason.
This error may be raised on non-Group channels with certain reason codes
if there's no better error code to use (mainly
TP_CHANNEL_GROUP_CHANGE_REASON_NONE
).
This macro expands to a function call returning a GQuark.
Since 0.7.1
#define TP_CHANNEL_FEATURE_PASSWORD
Expands to a call to a function that returns a quark representing the password feature on a TpChannel.
When this feature is prepared, tp_channel_password_needed()
and the
"password-needed" property become useful.
One can ask for a feature to be prepared using the
tp_proxy_prepare_async()
function, and waiting for it to callback.
Since 0.15.2
gboolean tp_channel_password_needed (TpChannel *self
);
Return the "password-needed" property
|
a TpChannel |
Returns : |
the value of "password-needed" |
Since 0.15.2
void tp_channel_provide_password_async (TpChannel *self
,const gchar *password
,GAsyncReadyCallback callback
,gpointer user_data
);
Provide password
so that self
can be joined.
This function must be called with the correct password in order for
channel joining to proceed if the TpChannel:password-needed property
is set.
Once the password has been provided, callback
will be
called. You can then call tp_channel_provide_password_finish()
to get the result of the operation.
|
a TpChannel |
|
the password |
|
a callback to call when password has been provided |
|
data to pass to callback
|
Since 0.15.2
gboolean tp_channel_provide_password_finish (TpChannel *self
,GAsyncResult *result
,GError **error
);
Completes a call to tp_channel_provide_password_async()
.
If the password was rejected, the operation
fails with TP_ERROR_AUTHENTICATION_FAILED.
|
a TpChannel |
|
a GAsyncResult passed to the callback for
tp_channel_provide_password_async() . |
|
a GError to fill |
Returns : |
TRUE if the password has been provided and accepted,
FALSE otherwise. |
Since 0.15.2
TpProxyPendingCall * tp_cli_channel_call_close (TpChannel *proxy
,gint timeout_ms
,tp_cli_channel_callback_for_close callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
);
Start a Close method call.
Request that the channel be closed. This is not the case until the <tp:member-ref>Closed</tp:member-ref> signal has been emitted, and depending on the connection manager this may simply remove you from the channel on the server, rather than causing it to stop existing entirely. Some channels such as contact list channels may not be closed.
|
the TpProxy |
|
the timeout in milliseconds, or -1 to use the default |
|
called when the method call succeeds or fails;
may be NULL to make a "fire and forget" call with no
reply tracking |
|
user-supplied data passed to the callback;
must be NULL if callback is NULL
|
|
called with the user_data as argument, after the
call has succeeded, failed or been cancelled;
must be NULL if callback is NULL
|
|
If not NULL , a GObject which will be
weakly referenced; if it is destroyed, this call
will automatically be cancelled. Must be NULL if
callback is NULL
|
Returns : |
a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid. |
TpProxyPendingCall * tp_cli_channel_call_get_channel_type (TpChannel *proxy
,gint timeout_ms
,tp_cli_channel_callback_for_get_channel_type callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
);
tp_cli_channel_call_get_channel_type
is deprecated and should not be used in newly-written code. Use the ChannelType property if possible.
Start a GetChannelType method call.
Returns the interface name for the type of this channel. Clients SHOULD use the <tp:member-ref>ChannelType</tp:member-ref> property instead, falling back to this method only if necessary. <tp:rationale> The GetAll method lets clients retrieve all properties in one round-trip. </tp:rationale>
|
the TpProxy |
|
the timeout in milliseconds, or -1 to use the default |
|
called when the method call succeeds or fails;
may be NULL to make a "fire and forget" call with no
reply tracking |
|
user-supplied data passed to the callback;
must be NULL if callback is NULL
|
|
called with the user_data as argument, after the
call has succeeded, failed or been cancelled;
must be NULL if callback is NULL
|
|
If not NULL , a GObject which will be
weakly referenced; if it is destroyed, this call
will automatically be cancelled. Must be NULL if
callback is NULL
|
Returns : |
a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid. |
TpProxyPendingCall * tp_cli_channel_call_get_handle (TpChannel *proxy
,gint timeout_ms
,tp_cli_channel_callback_for_get_handle callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
);
tp_cli_channel_call_get_handle
is deprecated and should not be used in newly-written code. Use the TargetHandleType and TargetHandle properties if possible.
Start a GetHandle method call.
Returns the handle type and number if this channel represents a communication with a particular contact, room or server-stored list, or zero if it is transient and defined only by its contents. Clients SHOULD use the <tp:member-ref>TargetHandle</tp:member-ref> and <tp:member-ref>TargetHandleType</tp:member-ref> properties instead, falling back to this method only if necessary. <tp:rationale> The GetAll method lets clients retrieve all properties in one round-trip. </tp:rationale>
|
the TpProxy |
|
the timeout in milliseconds, or -1 to use the default |
|
called when the method call succeeds or fails;
may be NULL to make a "fire and forget" call with no
reply tracking |
|
user-supplied data passed to the callback;
must be NULL if callback is NULL
|
|
called with the user_data as argument, after the
call has succeeded, failed or been cancelled;
must be NULL if callback is NULL
|
|
If not NULL , a GObject which will be
weakly referenced; if it is destroyed, this call
will automatically be cancelled. Must be NULL if
callback is NULL
|
Returns : |
a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid. |
TpProxyPendingCall * tp_cli_channel_call_get_interfaces (TpChannel *proxy
,gint timeout_ms
,tp_cli_channel_callback_for_get_interfaces callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
);
tp_cli_channel_call_get_interfaces
is deprecated and should not be used in newly-written code. Use the Interfaces property if possible.
Start a GetInterfaces method call.
Get the optional interfaces implemented by the channel. Clients SHOULD use the <tp:member-ref>Interfaces</tp:member-ref> property instead, falling back to this method only if necessary. <tp:rationale> The GetAll method lets clients retrieve all properties in one round-trip. </tp:rationale>
|
the TpProxy |
|
the timeout in milliseconds, or -1 to use the default |
|
called when the method call succeeds or fails;
may be NULL to make a "fire and forget" call with no
reply tracking |
|
user-supplied data passed to the callback;
must be NULL if callback is NULL
|
|
called with the user_data as argument, after the
call has succeeded, failed or been cancelled;
must be NULL if callback is NULL
|
|
If not NULL , a GObject which will be
weakly referenced; if it is destroyed, this call
will automatically be cancelled. Must be NULL if
callback is NULL
|
Returns : |
a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid. |
void (*tp_cli_channel_callback_for_close) (TpChannel *proxy
,const GError *error
,gpointer user_data
,GObject *weak_object
);
Signature of the callback called when a Close method call succeeds or fails.
|
the proxy on which the call was made |
|
NULL on success, or an error on failure |
|
user-supplied data |
|
user-supplied object |
void (*tp_cli_channel_callback_for_get_channel_type) (TpChannel *proxy
,const gchar *out_Channel_Type
,const GError *error
,gpointer user_data
,GObject *weak_object
);
tp_cli_channel_callback_for_get_channel_type
is deprecated and should not be used in newly-written code. Use the ChannelType property if possible.
Signature of the callback called when a GetChannelType method call succeeds or fails.
|
the proxy on which the call was made |
|
Used to return an 'out' argument if error is NULL : The interface name |
|
NULL on success, or an error on failure |
|
user-supplied data |
|
user-supplied object |
void (*tp_cli_channel_callback_for_get_handle) (TpChannel *proxy
,guint out_Target_Handle_Type
,guint out_Target_Handle
,const GError *error
,gpointer user_data
,GObject *weak_object
);
tp_cli_channel_callback_for_get_handle
is deprecated and should not be used in newly-written code. Use the TargetHandleType and TargetHandle properties if possible.
Signature of the callback called when a GetHandle method call succeeds or fails.
|
the proxy on which the call was made |
|
Used to return an 'out' argument if error is NULL : The same as TargetHandleType. (TpHandleType) |
|
Used to return an 'out' argument if error is NULL : The same as TargetHandle. (TpHandle) |
|
NULL on success, or an error on failure |
|
user-supplied data |
|
user-supplied object |
void (*tp_cli_channel_callback_for_get_interfaces) (TpChannel *proxy
,const gchar **out_Interfaces
,const GError *error
,gpointer user_data
,GObject *weak_object
);
tp_cli_channel_callback_for_get_interfaces
is deprecated and should not be used in newly-written code. Use the Interfaces property if possible.
Signature of the callback called when a GetInterfaces method call succeeds or fails.
|
the proxy on which the call was made |
|
Used to return an 'out' argument if error is NULL : An array of the D-Bus interface names |
|
NULL on success, or an error on failure |
|
user-supplied data |
|
user-supplied object |
gboolean tp_cli_channel_run_close (TpChannel *proxy
,gint timeout_ms
,GError **error
,GMainLoop **loop
);
tp_cli_channel_run_close
is deprecated and should not be used in newly-written code.
Call the method Close and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.
Request that the channel be closed. This is not the case until the <tp:member-ref>Closed</tp:member-ref> signal has been emitted, and depending on the connection manager this may simply remove you from the channel on the server, rather than causing it to stop existing entirely. Some channels such as contact list channels may not be closed.
|
A TpChannel or subclass |
|
Timeout in milliseconds, or -1 for default |
|
If not NULL , used to return errors if FALSE
is returned |
|
If not NULL , set before re-entering
the main loop, to point to a GMainLoop
which can be used to cancel this call with
g_main_loop_quit() , causing a return of
FALSE with error set to TP_DBUS_ERROR_CANCELLED
|
Returns : |
TRUE on success, FALSE and sets error on error |
gboolean tp_cli_channel_run_get_channel_type (TpChannel *proxy
,gint timeout_ms
,gchar **out_Channel_Type
,GError **error
,GMainLoop **loop
);
tp_cli_channel_run_get_channel_type
is deprecated and should not be used in newly-written code. Use the ChannelType property if possible.
Call the method GetChannelType and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.
Returns the interface name for the type of this channel. Clients SHOULD use the <tp:member-ref>ChannelType</tp:member-ref> property instead, falling back to this method only if necessary. <tp:rationale> The GetAll method lets clients retrieve all properties in one round-trip. </tp:rationale>
|
A TpChannel or subclass |
|
Timeout in milliseconds, or -1 for default |
|
Used to return an 'out' argument if TRUE is returned: The interface name |
|
If not NULL , used to return errors if FALSE
is returned |
|
If not NULL , set before re-entering
the main loop, to point to a GMainLoop
which can be used to cancel this call with
g_main_loop_quit() , causing a return of
FALSE with error set to TP_DBUS_ERROR_CANCELLED
|
Returns : |
TRUE on success, FALSE and sets error on error |
gboolean tp_cli_channel_run_get_handle (TpChannel *proxy
,gint timeout_ms
,guint *out_Target_Handle_Type
,guint *out_Target_Handle
,GError **error
,GMainLoop **loop
);
tp_cli_channel_run_get_handle
is deprecated and should not be used in newly-written code. Use the TargetHandleType and TargetHandle properties if possible.
Call the method GetHandle and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.
Returns the handle type and number if this channel represents a communication with a particular contact, room or server-stored list, or zero if it is transient and defined only by its contents. Clients SHOULD use the <tp:member-ref>TargetHandle</tp:member-ref> and <tp:member-ref>TargetHandleType</tp:member-ref> properties instead, falling back to this method only if necessary. <tp:rationale> The GetAll method lets clients retrieve all properties in one round-trip. </tp:rationale>
|
A TpChannel or subclass |
|
Timeout in milliseconds, or -1 for default |
|
Used to return an 'out' argument if TRUE is returned: The same as TargetHandleType. |
|
Used to return an 'out' argument if TRUE is returned: The same as TargetHandle. |
|
If not NULL , used to return errors if FALSE
is returned |
|
If not NULL , set before re-entering
the main loop, to point to a GMainLoop
which can be used to cancel this call with
g_main_loop_quit() , causing a return of
FALSE with error set to TP_DBUS_ERROR_CANCELLED
|
Returns : |
TRUE on success, FALSE and sets error on error |
gboolean tp_cli_channel_run_get_interfaces (TpChannel *proxy
,gint timeout_ms
,gchar ***out_Interfaces
,GError **error
,GMainLoop **loop
);
tp_cli_channel_run_get_interfaces
is deprecated and should not be used in newly-written code. Use the Interfaces property if possible.
Call the method GetInterfaces and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.
Get the optional interfaces implemented by the channel. Clients SHOULD use the <tp:member-ref>Interfaces</tp:member-ref> property instead, falling back to this method only if necessary. <tp:rationale> The GetAll method lets clients retrieve all properties in one round-trip. </tp:rationale>
|
A TpChannel or subclass |
|
Timeout in milliseconds, or -1 for default |
|
Used to return an 'out' argument if TRUE is returned: An array of the D-Bus interface names |
|
If not NULL , used to return errors if FALSE
is returned |
|
If not NULL , set before re-entering
the main loop, to point to a GMainLoop
which can be used to cancel this call with
g_main_loop_quit() , causing a return of
FALSE with error set to TP_DBUS_ERROR_CANCELLED
|
Returns : |
TRUE on success, FALSE and sets error on error |
TpProxySignalConnection * tp_cli_channel_connect_to_closed (TpChannel *proxy
,tp_cli_channel_signal_callback_closed callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
,GError **error
);
Connect a handler to the signal Closed.
Emitted when the channel has been closed. Method calls on the channel are no longer valid after this signal has been emitted, and the connection manager may then remove the object from the bus at any point.
|
A TpChannel or subclass |
|
Callback to be called when the signal is received |
|
User-supplied data for the callback |
|
Destructor for the user-supplied data, which
will be called when this signal is disconnected, or
before this function returns NULL
|
|
A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected |
|
If not NULL , used to raise an error if NULL is
returned |
Returns : |
a TpProxySignalConnection containing all of the
above, which can be used to disconnect the signal; or
NULL if the proxy does not have the desired interface
or has become invalid. |
void (*tp_cli_channel_signal_callback_closed) (TpChannel *proxy
,gpointer user_data
,GObject *weak_object
);
Represents the signature of a callback for the signal Closed.
|
The proxy on which tp_cli_channel_connect_to_closed()
was called |
|
User-supplied data |
|
User-supplied weakly referenced object |
TpProxyPendingCall * tp_cli_channel_interface_destroyable_call_destroy (TpChannel *proxy
,gint timeout_ms
,tp_cli_channel_interface_destroyable_callback_for_destroy callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
);
Start a Destroy method call.
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Close the channel abruptly, possibly with loss of data. The connection manager MUST NOT re-create the channel unless/until more events occur.</p> <tp:rationale> <p>The main motivating situation for this method is that when a Text channel with pending messages is closed with Close, it comes back as an incoming channel (to avoid a race between Close and an incoming message). If Destroy is called on a Text channel, the CM should delete all pending messages and close the channel, and the channel shouldn't be re-created until/unless another message arrives.</p> </tp:rationale> <p>Most clients SHOULD call <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Close</tp:dbus-ref> instead. However, if a client explicitly intends to destroy the channel with possible loss of data, it SHOULD call this method if this interface is supported (according to the <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Interfaces</tp:dbus-ref> property), falling back to Close if not.</p> <p>In particular, channel dispatchers SHOULD use this method if available when terminating channels that cannot be handled correctly (for instance, if no handler has been installed for a channel type, or if the handler crashes repeatedly).</p> <p>Connection managers do not need to implement this interface on channels where Close and Destroy would be equivalent.</p> <tp:rationale> <p>Callers need to be able to fall back to Close in any case.</p> </tp:rationale>
|
the TpProxy |
|
the timeout in milliseconds, or -1 to use the default |
|
called when the method call succeeds or fails;
may be NULL to make a "fire and forget" call with no
reply tracking |
|
user-supplied data passed to the callback;
must be NULL if callback is NULL
|
|
called with the user_data as argument, after the
call has succeeded, failed or been cancelled;
must be NULL if callback is NULL
|
|
If not NULL , a GObject which will be
weakly referenced; if it is destroyed, this call
will automatically be cancelled. Must be NULL if
callback is NULL
|
Returns : |
a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid. |
void (*tp_cli_channel_interface_destroyable_callback_for_destroy) (TpChannel *proxy
,const GError *error
,gpointer user_data
,GObject *weak_object
);
Signature of the callback called when a Destroy method call succeeds or fails.
|
the proxy on which the call was made |
|
NULL on success, or an error on failure |
|
user-supplied data |
|
user-supplied object |
gboolean tp_cli_channel_interface_destroyable_run_destroy (TpChannel *proxy
,gint timeout_ms
,GError **error
,GMainLoop **loop
);
tp_cli_channel_interface_destroyable_run_destroy
is deprecated and should not be used in newly-written code.
Call the method Destroy and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Close the channel abruptly, possibly with loss of data. The connection manager MUST NOT re-create the channel unless/until more events occur.</p> <tp:rationale> <p>The main motivating situation for this method is that when a Text channel with pending messages is closed with Close, it comes back as an incoming channel (to avoid a race between Close and an incoming message). If Destroy is called on a Text channel, the CM should delete all pending messages and close the channel, and the channel shouldn't be re-created until/unless another message arrives.</p> </tp:rationale> <p>Most clients SHOULD call <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Close</tp:dbus-ref> instead. However, if a client explicitly intends to destroy the channel with possible loss of data, it SHOULD call this method if this interface is supported (according to the <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Interfaces</tp:dbus-ref> property), falling back to Close if not.</p> <p>In particular, channel dispatchers SHOULD use this method if available when terminating channels that cannot be handled correctly (for instance, if no handler has been installed for a channel type, or if the handler crashes repeatedly).</p> <p>Connection managers do not need to implement this interface on channels where Close and Destroy would be equivalent.</p> <tp:rationale> <p>Callers need to be able to fall back to Close in any case.</p> </tp:rationale>
|
A TpChannel or subclass |
|
Timeout in milliseconds, or -1 for default |
|
If not NULL , used to return errors if FALSE
is returned |
|
If not NULL , set before re-entering
the main loop, to point to a GMainLoop
which can be used to cancel this call with
g_main_loop_quit() , causing a return of
FALSE with error set to TP_DBUS_ERROR_CANCELLED
|
Returns : |
TRUE on success, FALSE and sets error on error |
"channel-properties"
property "channel-properties" GHashTable_gchararray+GValue_* : Read / Write / Construct Only
The immutable D-Bus properties of this channel, represented by a GHashTable where the keys are D-Bus interface name + "." + property name, and the values are GValue instances.
Read-only except during construction. If this is not provided
during construction, a reasonable (but possibly incomplete) version
will be made up from the values of individual properties; reading this
property repeatedly may yield progressively more complete values until
tp_proxy_prepare_async()
has finished preparing TP_CHANNEL_FEATURE_CORE
.
"channel-ready"
property "channel-ready" gboolean : Read
TpChannel:channel-ready
has been deprecated since version 0.17.6 and should not be used in newly-written code. use tp_proxy_is_prepared()
with
TP_CHANNEL_FEATURE_CORE
for checks, or tp_proxy_prepare_async()
for
notification
Initially FALSE
; changes to TRUE
when tp_proxy_prepare_async()
has
finished preparing TP_CHANNEL_FEATURE_CORE
, and if the channel is a
group, TP_CHANNEL_FEATURE_GROUP
.
This is a less general form of tp_proxy_is_prepared()
, which should be
used in new code.
One important difference is that after "invalidated" is
signalled, "channel-ready" keeps its current value - which might
be TRUE
, if the channel was successfully prepared before it became
invalidated - but tp_proxy_is_prepared()
returns FALSE
for all features.
Change notification is via notify::channel-ready.
Default value: FALSE
"connection"
property"connection" TpConnection* : Read / Write / Construct Only
The TpConnection to which this TpChannel belongs. Used for e.g. handle manipulation.
"group-flags"
property "group-flags" guint : Read
If the TP_CHANNEL_FEATURE_GROUP
feature has been prepared successfully,
TpChannelGroupFlags indicating the capabilities and behaviour of that
group.
Otherwise, this may be 0.
Change notification is via notify::group-flags or TpChannel::group-flags-changed.
Default value: 0
Since 0.7.12
"group-self-contact"
property"group-self-contact" TpContact* : Read
If this channel is a group and TP_CHANNEL_FEATURE_CONTACTS
has been
prepared, and the user is a member of the group, the TpContact
representing them in this group.
Otherwise, the result may be either a contact representing the user,
or NULL
.
Change notification is via notify::group-self-contact.
Since 0.15.6
"group-self-handle"
property "group-self-handle" guint : Read
TpChannel:group-self-handle
is deprecated and should not be used in newly-written code. Use "group-self-contact" instead.
If this channel is a group and TP_CHANNEL_FEATURE_GROUP
has been
prepared, and the user is a member of the group, the TpHandle
representing them in this group.
Otherwise, the result may be either a handle representing the user, or 0.
Change notification is via notify::group-self-handle.
Default value: 0
Since 0.7.12
"identifier"
property "identifier" gchar* : Read
This channel's associated identifier, or the empty string if it has
handle type TP_HANDLE_TYPE_NONE
.
For channels where "handle" is non-zero, this is the result of inspecting "handle".
This is not guaranteed to be set until tp_proxy_prepare_async()
has
finished preparing TP_CHANNEL_FEATURE_CORE
; until then, it may be
the empty string.
Changed in 0.11.4: this property is never NULL
. Previously,
it was NULL
before an identifier was known, or when a channel
with no TargetID D-Bus property had TargetHandleType TP_HANDLE_TYPE_NONE
.
Default value: ""
"initiator-contact"
property"initiator-contact" TpContact* : Read
The TpContact of the initiator of this channel, or NULL
if there is no
particular initiator.
If the channel was initiated by a remote contact, this represents
that contact, and "requested" will be FALSE
. For instance,
for an incoming call this property indicates the caller, and for a
chatroom invitation this property indicates who sent the invitation.
If the channel was requested by the local user, "requested"
will be TRUE
, and this property may be the "group-self-contact"
or "self-contact".
If the channel appeared for some other reason (for instance as a
side-effect of connecting to the server), this property may be NULL
.
This is not guaranteed to be set until tp_proxy_prepare_async()
has
finished preparing TP_CHANNEL_FEATURE_CONTACTS
; until then, it may be
NULL
.
Since 0.15.6
"initiator-handle"
property "initiator-handle" guint : Read
TpChannel:initiator-handle
is deprecated and should not be used in newly-written code. Use "initiator-contact" instead.
The TP_HANDLE_TYPE_CONTACT
TpHandle of the initiator of this
channel, or 0 if there is no particular initiator.
If the channel was initiated by a remote contact, this handle represents
that contact, and "requested" will be FALSE
. For instance,
for an incoming call this property indicates the caller, and for a
chatroom invitation this property indicates who sent the invitation.
If the channel was requested by the local user, "requested"
will be TRUE
, and this property may be the "group-self-handle"
or "self-handle".
If the channel appeared for some other reason (for instance as a side-effect of connecting to the server), this property may be 0.
This is not guaranteed to be set until tp_proxy_prepare_async()
has
finished preparing TP_CHANNEL_FEATURE_CORE
; until then, it may be 0.
Default value: 0
Since 0.11.15
"initiator-identifier"
property "initiator-identifier" gchar* : Read
TpChannel:initiator-identifier
is deprecated and should not be used in newly-written code. Use "initiator-contact" instead.
If "initiator-handle" is 0, this will always be "". Otherwise, this will be the "identifier" of the contact with that handle.
This is not guaranteed to be set until tp_proxy_prepare_async()
has
finished preparing TP_CHANNEL_FEATURE_CORE
; until then, it may be
the empty string.
Default value: ""
Since 0.11.15
"password-needed"
property "password-needed" gboolean : Read
If TRUE
, tp_channel_provide_password_async()
has to be called
to be able to join the channel.
This is not guaranteed to be meaningful until tp_proxy_prepare_async()
has
finished preparing TP_CHANNEL_FEATURE_PASSWORD
; until then, it may return
FALSE
even if the channel is actually protected by a password.
Preparing TP_CHANNEL_FEATURE_PASSWORD
also ensures that the
notify::password-needed signal will be fired when this property changes.
Default value: FALSE
Since 0.15.2
"requested"
property "requested" gboolean : Read
TRUE
if this channel was created in response to a local request, such
as a call to tp_account_channel_request_create_channel_async()
. FALSE
if this channel was initiated by a remote contact
(the "initiator-handle"), or if it appeared as a side-effect
of some other action.
For instance, this is FALSE
on incoming calls and file transfers,
remotely-initiated 1-1 text conversations, and invitations to chatrooms,
and TRUE
on outgoing calls and file transfers, locally-initiated 1-1
text conversations, and chatrooms joined by local user action.
This is not guaranteed to be meaningful until tp_proxy_prepare_async()
has
finished preparing TP_CHANNEL_FEATURE_CORE
; until then, it may return
FALSE
even if the channel was actually requested.
Default value: FALSE
Since 0.11.15
"target-contact"
property"target-contact" TpContact* : Read
If this channel is for communication with a single contact (that is,
"handle-type" is TP_HANDLE_TYPE_CONTACT
), then a TpContact
representing the remote contact. For chat rooms, contact search channels and
other channels without a single remote contact, NULL
.
This is not guaranteed to be set until tp_proxy_prepare_async()
has
finished preparing TP_CHANNEL_FEATURE_CONTACTS
; until then, it may be
NULL
.
Since 0.15.6
"chat-state-changed"
signalvoid user_function (TpChannel *self,
guint contact,
guint state,
gpointer user_data) : Has Details
TpChannel::chat-state-changed
is deprecated and should not be used in newly-written code. Use "contact-chat-state-changed" instead
Emitted when a contact's chat state changes after tp_proxy_prepare_async()
has finished preparing the feature TP_CHANNEL_FEATURE_CHAT_STATES
.
|
a channel |
|
a contact handle for the local user or another contact |
|
the new TpChannelChatState for the contact |
|
user data set when the signal handler was connected. |
Since 0.11.3
"group-contacts-changed"
signalvoid user_function (TpChannel *self,
GPtrArray *added,
GPtrArray *removed,
GPtrArray *local_pending,
GPtrArray *remote_pending,
TpContact *actor,
gpointer user_data) : Has Details
Emitted when the group members change in a Group channel.
This is not guaranteed to be emitted until tp_proxy_prepare_async()
has
finished preparing TP_CHANNEL_FEATURE_CONTACTS
; until then, it may be
omitted.
|
a channel |
|
a GPtrArray of TpContact containing the full members added. [type GLib.PtrArray][element-type TelepathyGLib.Contact] |
|
a GPtrArray of TpContact containing the members (full, local-pending or remote-pending) removed. [type GLib.PtrArray][element-type TelepathyGLib.Contact] |
|
a GPtrArray of TpContact containing the local-pending members added. [type GLib.PtrArray][element-type TelepathyGLib.Contact] |
|
a GPtrArray of TpContact containing the remote-pending members added. [type GLib.PtrArray][element-type TelepathyGLib.Contact] |
|
a TpContact for the "actor" handle in details
|
|
a GHashTable mapping (gchar *) to GValue containing details about the change, as described in the specification of the MembersChangedDetailed signal. [type GLib.HashTable][element-type utf8 GObject.Value] |
|
user data set when the signal handler was connected. |
Since 0.15.6
"group-flags-changed"
signalvoid user_function (TpChannel *self,
guint added,
guint removed,
gpointer user_data) : Has Details
Emitted when the "group-flags" property changes while the channel is ready.
|
a channel |
|
TpChannelGroupFlags which are newly set |
|
TpChannelGroupFlags which are no longer set |
|
user data set when the signal handler was connected. |
Since 0.7.12
"group-members-changed"
signalvoid user_function (TpChannel *self,
gchar *message,
GArray_guint_ *added,
GArray_guint_ *removed,
GArray_guint_ *local_pending,
GArray_guint_ *remote_pending,
guint actor,
guint reason,
gpointer user_data) : Has Details
TpChannel::group-members-changed
is deprecated and should not be used in newly-written code. Use "group-contacts-changed" instead.
Emitted when the group members change in a Group channel that is ready.
|
a channel |
|
an optional textual message |
|
a GArray of guint containing the full members added |
|
a GArray of guint containing the members (full, local-pending or remote-pending) removed |
|
a GArray of guint containing the local-pending members added |
|
a GArray of guint containing the remote-pending members added |
|
the TpHandle of the contact causing the change, or 0 |
|
the reason for the change as a TpChannelGroupChangeReason |
|
user data set when the signal handler was connected. |
Since 0.7.12
"group-members-changed-detailed"
signalvoid user_function (TpChannel *self,
GArray_guint_ *added,
GArray_guint_ *removed,
GArray_guint_ *local_pending,
GArray_guint_ *remote_pending,
gpointer user_data) : Has Details
TpChannel::group-members-changed-detailed
is deprecated and should not be used in newly-written code. Use "group-contacts-changed" instead.
Emitted when the group members change in a Group channel that is ready. Contains a superset of the information in the TpChannel::group-members-changed signal, and is emitted at the same time; applications can connect to this signal and ignore the other.
|
a channel |
|
a GArray of guint containing the full members added. [type GLib.Array][element-type uint] |
|
a GArray of guint containing the members (full, local-pending or remote-pending) removed. [type GLib.Array][element-type uint] |
|
a GArray of guint containing the local-pending members added. [type GLib.Array][element-type uint] |
|
a GArray of guint containing the remote-pending members added. [type GLib.Array][element-type uint] |
|
a GHashTable mapping (gchar *) to GValue containing details about the change, as described in the specification of the MembersChangedDetailed signal. [type GLib.HashTable][element-type utf8 GObject.Value] |
|
user data set when the signal handler was connected. |
Since 0.7.21