Top |
Connection Requests interfaceConnection Requests interface — client-side wrappers for the Requests interface |
This interface allows a client to request new channels from a connection, and to listen to signals indicating that channels have been created and closed.
This section documents the auto-generated C wrappers for the Requests interface, used with TpConnection objects.
TpProxyPendingCall * tp_cli_connection_interface_requests_call_create_channel (TpConnection *proxy
,gint timeout_ms
,GHashTable *in_Request
,tp_cli_connection_interface_requests_callback_for_create_channel callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
);
Start a CreateChannel method call.
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that an entirely new channel is created.</p>
proxy |
the TpProxy |
|
timeout_ms |
the timeout in milliseconds, or -1 to use the default |
|
in_Request |
Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary containing desirable properties, which MUST include <tp:dbus-ref namespace="im.telepathy.v1.Channel">ChannelType</tp:dbus-ref>. Some properties are defined such that only an exact match makes sense, and connection managers MUST NOT satisfy a request with a channel where that property does not match; some properties are defined such that the connection manager MAY treat the request as merely a hint, and make a best-effort attempt to satisfy it. This is documented separately for each property.</p> <p>If this dictionary contains a property whose semantics are not known to the connection manager, this method MUST fail without side-effects (in particular it must not create a new channel).</p> <tp:rationale> <p>This is necessary if we want to be able to invent properties in future that, when used in a request, are hard requirements rather than just hints. A connection manager that did not know the semantics of those properties could incorrectly return a new channel that did not satisfy the requirements.</p> </tp:rationale> <p>The connection manager MUST NOT respond successfully, and SHOULD NOT create a new channel or cause any other side-effects, unless it can create a new channel that satisfies the client's requirements.</p> <p>Properties that will be set by this argument need not have write access after the channel has been created - indeed, it is expected that most will be read-only.</p> |
|
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.
TpProxyPendingCall * tp_cli_connection_interface_requests_call_ensure_channel (TpConnection *proxy
,gint timeout_ms
,GHashTable *in_Request
,tp_cli_connection_interface_requests_callback_for_ensure_channel callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
);
Start a EnsureChannel method call.
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that channels are ensured to exist.</p> <tp:rationale> <p>The connection manager is in the best position to determine which existing channels could satisfy which requests.</p> </tp:rationale>
proxy |
the TpProxy |
|
timeout_ms |
the timeout in milliseconds, or -1 to use the default |
|
in_Request |
Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary containing desirable properties, with the same semantics as the corresponding parameter to <tp:member-ref>CreateChannel</tp:member-ref>.</p> |
|
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_connection_interface_requests_callback_for_create_channel) (TpConnection *proxy
,const gchar *out_Channel
,GHashTable *out_Properties
,const GError *error
,gpointer user_data
,GObject *weak_object
);
Signature of the callback called when a CreateChannel method call succeeds or fails.
proxy |
the proxy on which the call was made |
|
out_Channel |
Used to return an 'out' argument if |
|
out_Properties |
Used to return an 'out' argument if |
|
error |
|
|
user_data |
user-supplied data |
|
weak_object |
user-supplied object |
void (*tp_cli_connection_interface_requests_callback_for_ensure_channel) (TpConnection *proxy
,gboolean out_Yours
,const gchar *out_Channel
,GHashTable *out_Properties
,const GError *error
,gpointer user_data
,GObject *weak_object
);
Signature of the callback called when a EnsureChannel method call succeeds or fails.
proxy |
the proxy on which the call was made |
|
out_Yours |
Used to return an 'out' argument if |
|
out_Channel |
Used to return an 'out' argument if |
|
out_Properties |
Used to return an 'out' argument if |
|
error |
|
|
user_data |
user-supplied data |
|
weak_object |
user-supplied object |
TpProxySignalConnection * tp_cli_connection_interface_requests_connect_to_channel_closed (TpConnection *proxy
,tp_cli_connection_interface_requests_signal_callback_channel_closed callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
,GError **error
);
Connect a handler to the signal ChannelClosed.
Emitted when a channel is closed and hence disappears from the <tp:member-ref>Channels</tp:member-ref> property. <tp:rationale> This is redundant with the <tp:dbus-ref namespace="im.telepathy.v1.Channel">Closed</tp:dbus-ref> signal on the channel itself, but it does provide full change notification for the Channels property. </tp:rationale>
proxy |
A TpConnection 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 |
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.
TpProxySignalConnection * tp_cli_connection_interface_requests_connect_to_new_channel (TpConnection *proxy
,tp_cli_connection_interface_requests_signal_callback_new_channel callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
,GError **error
);
Connect a handler to the signal NewChannel.
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A new channel has been created.</p> <p>Unlike in some previous Telepathy versions, the connection manager cannot emit a single signal for multiple channels. For example, joining a MUC Tube in XMPP requires joining the corresponding MUC (chatroom). Either the connection manager should announce a new <tp:dbus-ref namespace="imt1.Channel.Type">Text</tp:dbus-ref> channel separately, or not expose the Text channel on the bus until it's actually requested (or an incoming message appears).</p> <tp:rationale> <p>Signalling the creation of multiple channels together makes writing simple clients much more complicated, can result in lost messages, and isn't nearly as useful in practice as it sounds.</p> </tp:rationale>
proxy |
A TpConnection 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 |
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_connection_interface_requests_signal_callback_channel_closed) (TpConnection *proxy
,const gchar *arg_Removed
,gpointer user_data
,GObject *weak_object
);
Represents the signature of a callback for the signal ChannelClosed.
proxy |
The proxy on which |
|
arg_Removed |
The channel which has been removed from the Channels property |
|
user_data |
User-supplied data |
|
weak_object |
User-supplied weakly referenced object |
void (*tp_cli_connection_interface_requests_signal_callback_new_channel) (TpConnection *proxy
,const gchar *arg_Channel
,GHashTable *arg_Properties
,gpointer user_data
,GObject *weak_object
);
Represents the signature of a callback for the signal NewChannel.
proxy |
The proxy on which |
|
arg_Channel |
The object path of the channel. |
|
arg_Properties |
<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The same properties of the channel that would appear in the <tp:type>Channel_Details</tp:type> struct.</p> |
|
user_data |
User-supplied data |
|
weak_object |
User-supplied weakly referenced object |