Top |
TpAccount * | account | Read |
GObject * | channel-factory | Read / Write / Construct |
GHashTable_gchararray+GValue_* | hints | Read |
GVariant * | hints-vardict | Read |
GHashTable_gchararray+GValue_* | immutable-properties | Read / Write / Construct Only |
GVariant * | immutable-properties-vardict | Read |
gchar * | preferred-handler | Read |
gint64 | user-action-time | Read |
Requesting a channel from the channel dispatcher can take some time, so an object is created in the channel dispatcher to represent each request. Objects of the TpChannelRequest class provide access to one of those objects.
TpChannelRequest * tp_channel_request_new (TpDBusDaemon *bus_daemon
,const gchar *object_path
,GHashTable *immutable_properties
,GError **error
);
tp_channel_request_new
is deprecated and should not be used in newly-written code.
Since 0.19.9. New code should get TpChannelRequest objects from a TpBaseClient
Convenience function to create a new channel request proxy.
If the channel request was newly created, the client making the request
is responsible for calling tp_cli_channel_request_call_proceed()
when it
is ready for the channel request to proceed.
void
tp_channel_request_init_known_interfaces
(void
);
Ensure that the known interfaces for TpChannelRequest 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_REQUEST
.
Since: 0.7.32
void tp_channel_request_set_channel_factory (TpChannelRequest *self
,TpClientChannelFactory *factory
);
tp_channel_request_set_channel_factory
is deprecated and should not be used in newly-written code.
since 0.15.5. Use “factory” instead.
Change the value of the “channel-factory” property.
Since: 0.13.14
const GHashTable *
tp_channel_request_get_immutable_properties
(TpChannelRequest *self
);
Return the “immutable-properties” construct-only property
Since: 0.13.14
GVariant *
tp_channel_request_dup_immutable_properties
(TpChannelRequest *self
);
Return the “immutable-properties-vardict” property.
Since: 0.19.10
TpAccount *
tp_channel_request_get_account (TpChannelRequest *self
);
Return the value of the “account” construct-only property
Since: 0.15.3
gint64
tp_channel_request_get_user_action_time
(TpChannelRequest *self
);
return the “user-action-time” construct-only property
Since: 0.15.3
const gchar *
tp_channel_request_get_preferred_handler
(TpChannelRequest *self
);
return the “preferred-handler” construct-only property
Since: 0.15.3
const GHashTable *
tp_channel_request_get_hints (TpChannelRequest *self
);
Return the “hints” property
Since: 0.13.14
GVariant *
tp_channel_request_dup_hints (TpChannelRequest *self
);
Return the “hints-vardict” property
Since: 0.19.10
void (*tp_cli_channel_request_callback_for_cancel) (TpChannelRequest *proxy
,const GError *error
,gpointer user_data
,GObject *weak_object
);
Signature of the callback called when a Cancel method call succeeds or fails.
TpProxyPendingCall * tp_cli_channel_request_call_cancel (TpChannelRequest *proxy
,gint timeout_ms
,tp_cli_channel_request_callback_for_cancel callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
);
Start a Cancel method call.
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Cancel the channel request. The precise effect depends on the current progress of the request.</p> <p>If the connection manager has not already been asked to create a channel, then <tp:member-ref>Failed</tp:member-ref> is emitted immediately, and the channel request is removed.</p> <p>If the connection manager has already been asked to create a channel but has not produced one yet (e.g. if <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.CreateChannel</tp:dbus-ref> has been called, but has not yet returned), then the ChannelDispatcher will remember that the request has been cancelled. When the channel appears, it will be closed (if it was newly created and can be closed), and will not be dispatched to a handler.</p> <p>If the connection manager has already returned a channel, but the channel has not yet been dispatched to a handler then the channel dispatcher will not dispatch that channel to a handler. If the channel was newly created for this request, the channel dispatcher will close it with <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">Close</tp:dbus-ref>; otherwise, the channel dispatcher will ignore it. In either case, <tp:member-ref>Failed</tp:member-ref> will be emitted when processing has been completed.</p> <p>If <tp:member-ref>Failed</tp:member-ref> is emitted in response to this method, the error SHOULD be <code>org.freedesktop.Telepathy.Error.Cancelled</code>.</p> <p>If the channel has already been dispatched to a handler, then it's too late to call this method, and the channel request will no longer exist.</p>
proxy |
the TpProxy |
|
timeout_ms |
the timeout in milliseconds, or -1 to use the default |
|
callback |
called when the method call succeeds or fails;
may be |
|
user_data |
user-supplied data passed to the callback;
must be |
|
destroy |
called with the user_data as argument, after the
call has succeeded, failed or been cancelled;
must be |
|
weak_object |
If not |
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_request_callback_for_proceed) (TpChannelRequest *proxy
,const GError *error
,gpointer user_data
,GObject *weak_object
);
Signature of the callback called when a Proceed method call succeeds or fails.
TpProxyPendingCall * tp_cli_channel_request_call_proceed (TpChannelRequest *proxy
,gint timeout_ms
,tp_cli_channel_request_callback_for_proceed callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
);
Start a Proceed method call.
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Proceed with the channel request.</p> <tp:rationale> <p>The client that created this object calls this method when it has connected signal handlers for <tp:member-ref>Succeeded</tp:member-ref> and <tp:member-ref>Failed</tp:member-ref>.</p> </tp:rationale> <p>Clients other than the client which created the ChannelRequest MUST NOT call this method.</p> <p>This method SHOULD return immediately; on success, the request might still fail, but this will be indicated asynchronously by the <tp:member-ref>Failed</tp:member-ref> signal.</p> <p>Proceed cannot fail, unless clients have got the life-cycle of a ChannelRequest seriously wrong (e.g. a client calls this method twice, or a client that did not create the ChannelRequest calls this method). If it fails, clients SHOULD assume that the whole ChannelRequest has become useless.</p>
proxy |
the TpProxy |
|
timeout_ms |
the timeout in milliseconds, or -1 to use the default |
|
callback |
called when the method call succeeds or fails;
may be |
|
user_data |
user-supplied data passed to the callback;
must be |
|
destroy |
called with the user_data as argument, after the
call has succeeded, failed or been cancelled;
must be |
|
weak_object |
If not |
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_request_signal_callback_failed) (TpChannelRequest *proxy
,const gchar *arg_Error
,const gchar *arg_Message
,gpointer user_data
,GObject *weak_object
);
Represents the signature of a callback for the signal Failed.
proxy |
The proxy on which |
|
arg_Error |
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The name of a D-Bus error. This can come from various sources, including the error raised by <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface.Requests">CreateChannel</tp:dbus-ref>, or an error generated to represent failure to establish the <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>.</p> |
|
arg_Message |
If the first argument of the D-Bus error message was a string, that string. Otherwise, an empty string. |
|
user_data |
User-supplied data |
|
weak_object |
User-supplied weakly referenced object |
TpProxySignalConnection * tp_cli_channel_request_connect_to_failed (TpChannelRequest *proxy
,tp_cli_channel_request_signal_callback_failed callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
,GError **error
);
Connect a handler to the signal Failed.
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The channel request has failed. It is no longer present, and further methods must not be called on it.</p>
proxy |
A TpChannelRequest or subclass |
|
callback |
Callback to be called when the signal is received |
|
user_data |
User-supplied data for the callback |
|
destroy |
Destructor for the user-supplied data, which
will be called when this signal is disconnected, or
before this function returns |
|
weak_object |
A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected |
|
error |
If not |
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_request_signal_callback_succeeded) (TpChannelRequest *proxy
,gpointer user_data
,GObject *weak_object
);
Represents the signature of a callback for the signal Succeeded.
proxy |
The proxy on which |
|
user_data |
User-supplied data |
|
weak_object |
User-supplied weakly referenced object |
TpProxySignalConnection * tp_cli_channel_request_connect_to_succeeded (TpChannelRequest *proxy
,tp_cli_channel_request_signal_callback_succeeded callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
,GError **error
);
Connect a handler to the signal Succeeded.
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The channel request has succeeded. It is no longer present, and further methods must not be called on it.</p>
proxy |
A TpChannelRequest or subclass |
|
callback |
Callback to be called when the signal is received |
|
user_data |
User-supplied data for the callback |
|
destroy |
Destructor for the user-supplied data, which
will be called when this signal is disconnected, or
before this function returns |
|
weak_object |
A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected |
|
error |
If not |
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_request_signal_callback_succeeded_with_channel) (TpChannelRequest *proxy
,const gchar *arg_Connection
,GHashTable *arg_Connection_Properties
,const gchar *arg_Channel
,GHashTable *arg_Channel_Properties
,gpointer user_data
,GObject *weak_object
);
Represents the signature of a callback for the signal SucceededWithChannel.
proxy |
The proxy on which |
|
arg_Connection |
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The Connection owning the channel.</p> |
|
arg_Connection_Properties |
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A subset of the Connection's properties, currently unused. This parameter may be used in future.</p> |
|
arg_Channel |
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The channel which has been created.</p> |
|
arg_Channel_Properties |
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The same immutable properties of the Channel that would appear in a <tp:dbus-ref namespace="ofdT.Connection.Interface.Requests">NewChannels</tp:dbus-ref> signal.</p> |
|
user_data |
User-supplied data |
|
weak_object |
User-supplied weakly referenced object |
TpProxySignalConnection * tp_cli_channel_request_connect_to_succeeded_with_channel (TpChannelRequest *proxy
,tp_cli_channel_request_signal_callback_succeeded_with_channel callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
,GError **error
);
Connect a handler to the signal SucceededWithChannel.
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Variant of the <tp:dbus-ref namespace="ofdT.ChannelRequest">Succeeded</tp:dbus-ref> signal allowing to get the channel which has been created.</p> <p>This signal MUST be emitted if the <tp:dbus-ref namespace="ofdT">ChannelDispatcher</tp:dbus-ref>'s <tp:dbus-ref namespace="ofdT.ChannelDispatcher">SupportsRequestHints</tp:dbus-ref> property is true. If supported, it MUST be emitted before the <tp:member-ref>Succeeded</tp:member-ref> signal.</p>
proxy |
A TpChannelRequest or subclass |
|
callback |
Callback to be called when the signal is received |
|
user_data |
User-supplied data for the callback |
|
destroy |
Destructor for the user-supplied data, which
will be called when this signal is disconnected, or
before this function returns |
|
weak_object |
A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected |
|
error |
If not |
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.
struct TpChannelRequest;
Requesting a channel from the channel dispatcher can take some time, so an object is created in the channel dispatcher to represent each request. This proxy represents one of those objects.
Any client can call tp_cli_channel_request_call_cancel()
at any time to
attempt to cancel the request.
On success, the “succeeded” signal will be emitted.
Immediately after that, the “invalidated” signal will be emitted,
with the domain TP_DBUS_ERRORS
and the error code
TP_DBUS_ERROR_OBJECT_REMOVED
(this is not an error condition, it merely
indicates that the channel request no longer exists).
On failure, the “invalidated” signal will be emitted with some
other suitable error, usually from the TP_ERROR
domain.
If the channel dispatcher crashes or exits, the “invalidated”
signal will be emitted with the domain TP_DBUS_ERRORS
and the error code
TP_DBUS_ERROR_NAME_OWNER_LOST
.
Creating a TpChannelRequest directly is deprecated: it should only be created via a TpAccountChannelRequest or a TpBaseClient.
Since 0.16, TpChannelRequest always has a non-NULL
“factory”,
and its “factory” will be propagated to the TpAccount,
TpConnection and TpChannel.
Since: 0.7.32
“account”
property“account” TpAccount *
The TpAccount on which this request was made, not guaranteed to be prepared.
Read-only.
Owner: TpChannelRequest
Flags: Read
Since: 0.15.3
“channel-factory”
property “channel-factory” GObject *
The object implementing the TpClientChannelFactoryInterface interface
that will be used to create channel proxies when the
“succeeded-with-channel” signal is fired.
This property can be changed using
tp_channel_request_set_channel_factory()
.
If no channel factory is specified then TpAutomaticProxyFactory is used.
TpChannelRequest:channel-factory
is deprecated and should not be used in newly-written code.
since 0.15.5. Use “factory” instead.
Owner: TpChannelRequest
Flags: Read / Write / Construct
Since: 0.13.14
“hints”
property “hints” GHashTable_gchararray+GValue_*
A TP_HASH_TYPE_STRING_VARIANT_MAP of metadata provided by
the channel requester; or NULL
if “immutable-properties”
is not defined or if no hints has been defined.
Read-only.
Owner: TpChannelRequest
Flags: Read
Since: 0.13.14
“hints-vardict”
property “hints-vardict” GVariant *
A G_VARIANT_TYPE_VARDICT
of metadata provided by
the channel requester; or NULL
if “immutable-properties”
is not defined or if no hints have been defined.
Read-only.
Owner: TpChannelRequest
Flags: Read
Allowed values: GVariant<a{sv}>
Default value: NULL
Since: 0.19.10
“immutable-properties”
property “immutable-properties” GHashTable_gchararray+GValue_*
The immutable D-Bus properties of this channel request, represented by a GHashTable where the keys are D-Bus interface name + "." + property name, and the values are GValue instances.
Note that this property is set only if the immutable properties have been set during the construction of the TpChannelRequest.
Read-only except during construction.
Owner: TpChannelRequest
Flags: Read / Write / Construct Only
Since: 0.13.14
“immutable-properties-vardict”
property “immutable-properties-vardict” GVariant *
The immutable D-Bus properties of this channel request, represented by a
G_VARIANT_TYPE_VARDICT
where the keys are
D-Bus interface name + "." + property name.
Note that this property is set only if the immutable properties have been set during the construction of the TpChannelRequest.
Read-only except during construction.
Owner: TpChannelRequest
Flags: Read
Allowed values: GVariant<a{sv}>
Default value: NULL
Since: 0.19.10
“preferred-handler”
property “preferred-handler” gchar *
Either the well-known bus name (starting with TP_CLIENT_BUS_NAME_BASE)
of the preferred handler for this channel request,
or NULL
to indicate that any handler would be acceptable.
Read-only.
Owner: TpChannelRequest
Flags: Read
Default value: NULL
Since: 0.15.3
“user-action-time”
property “user-action-time” gint64
The time at which user action occurred, or TP_USER_ACTION_TIME_NOT_USER_ACTION if this channel request is for some reason not involving user action.
Read-only.
Owner: TpChannelRequest
Flags: Read
Allowed values: >= 0
Default value: 0
Since: 0.15.3
“succeeded”
signalvoid user_function (TpChannelRequest *self, gpointer user_data)
Emitted when the channel request succeeds.
TpChannelRequest::succeeded
is deprecated and should not be used in newly-written code.
since 0.13.14. Use “succeeded-with-channel”, which provides the resulting channel, instead.
self |
the channel request proxy |
|
user_data |
user data set when the signal handler was connected. |
Flags: Has Details
“succeeded-with-channel”
signalvoid user_function (TpChannelRequest *self, TpConnection *connection, TpChannel *channel, gpointer user_data)
Emitted when the channel request succeeds.
With telepathy-mission-control version 5.7.1 and earlier, connection
and
channel
will be NULL
. When using newer versions, they will be correctly
set to the newly-created channel, and the connection which owns it.
The TpChannel is created using “channel-factory” or
“factory” but the features of the factory are NOT prepared.
It's up to the user to prepare the features returned by
tp_simple_client_factory_dup_channel_features()
himself.
self |
the channel request proxy |
|
connection |
the TpConnection of |
|
channel |
the TpChannel created, or |
|
user_data |
user data set when the signal handler was connected. |
Flags: Has Details
Since: 0.13.14