telepathy-glib Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
#include <telepathy-glib/channel-request.h> TpChannelRequest; TpChannelRequestClass; TpChannelRequest * tp_channel_request_new (TpDBusDaemon *bus_daemon
,const gchar *object_path
,GHashTable *immutable_properties
,GError **error
); void tp_channel_request_init_known_interfaces (void
); void (*tp_cli_channel_request_callback_for_cancel) (TpChannelRequest *proxy
,const GError *error
,gpointer user_data
,GObject *weak_object
); 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
); void (*tp_cli_channel_request_callback_for_proceed) (TpChannelRequest *proxy
,const GError *error
,gpointer user_data
,GObject *weak_object
); 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
); void (*tp_cli_channel_request_signal_callback_failed) (TpChannelRequest *proxy
,const gchar *arg_Error
,const gchar *arg_Message
,gpointer user_data
,GObject *weak_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
); void (*tp_cli_channel_request_signal_callback_succeeded) (TpChannelRequest *proxy
,gpointer user_data
,GObject *weak_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
);
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.
typedef struct _TpChannelRequest 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_ERRORS
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
.
This proxy is usable but incomplete: accessors for the Account,
UserActionTime, PreferredHandler, Requests and Interfaces properties will
be added in a later version of telepathy-glib, along with a mechanism
similar to tp_connection_call_when_ready()
.
Until suitable convenience methods are implemented, the generic
tp_cli_dbus_properties_call_get_all()
method can be used to get those
properties.
Since 0.7.32
TpChannelRequest * tp_channel_request_new (TpDBusDaemon *bus_daemon
,const gchar *object_path
,GHashTable *immutable_properties
,GError **error
);
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.
The immutable_properties
argument is not yet used.
|
Proxy for the D-Bus daemon |
|
The non-NULL object path of this channel request |
|
As many as are known of the immutable D-Bus
properties of this channel request, or NULL if none are known
|
|
Used to raise an error if NULL is returned
|
Returns : |
a new reference to an channel request proxy, or NULL if
object_path is not syntactically valid or the channel dispatcher is
not running
|
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_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.
|
the proxy on which the call was made |
|
NULL on success, or an error on failure
|
|
user-supplied data |
|
user-supplied object |
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>
|
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_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.
|
the proxy on which the call was made |
|
NULL on success, or an error on failure
|
|
user-supplied data |
|
user-supplied object |
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>
|
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_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.
|
The proxy on which tp_cli_channel_request_connect_to_failed()
was called
|
|
<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> |
|
If the first argument of the D-Bus error message was a string, that string. Otherwise, an empty string. |
|
User-supplied data |
|
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>
|
A TpChannelRequest 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_request_signal_callback_succeeded) (TpChannelRequest *proxy
,gpointer user_data
,GObject *weak_object
);
Represents the signature of a callback for the signal Succeeded.
|
The proxy on which tp_cli_channel_request_connect_to_succeeded()
was called
|
|
User-supplied data |
|
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>
|
A TpChannelRequest 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.
|
"succeeded"
signalvoid user_function (TpChannelRequest *self, gpointer user_data) : Run Last / Has Details
Emitted when the channel request succeeds.
|
the channel request proxy |
|
user data set when the signal handler was connected. |