Mission Control Plugins Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Prerequisites |
McpDispatchOperationMcpDispatchOperation — Dispatch operation object, implemented by Mission Control |
#include <mission-control-plugins/mission-control-plugins.h> gboolean mcp_dispatch_operation_find_channel_by_type (McpDispatchOperation *self
,TpClientFactory *client_factory
,guint start_from
,TpHandleType handle_type
,GQuark channel_type
,guint *ret_index
,gchar **ret_dup_path
,GHashTable **ret_ref_immutable_properties
,TpChannel **ret_ref_channel
); TpConnection * mcp_dispatch_operation_ref_connection (McpDispatchOperation *self
,TpClientFactory *client_factory
); TpChannel * mcp_dispatch_operation_ref_nth_channel (McpDispatchOperation *self
,TpClientFactory *client_factory
,guint n
); const gchar * mcp_dispatch_operation_get_account_path (McpDispatchOperation *self
); const gchar * mcp_dispatch_operation_get_connection_path (McpDispatchOperation *self
); const gchar * mcp_dispatch_operation_get_protocol (McpDispatchOperation *self
); const gchar * mcp_dispatch_operation_get_cm_name (McpDispatchOperation *self
); guint mcp_dispatch_operation_get_n_channels (McpDispatchOperation *self
); const gchar * mcp_dispatch_operation_get_nth_channel_path (McpDispatchOperation *self
,guint n
); GHashTable * mcp_dispatch_operation_ref_nth_channel_properties (McpDispatchOperation *self
,guint n
); McpDispatchOperationDelay * mcp_dispatch_operation_start_delay (McpDispatchOperation *self
); void mcp_dispatch_operation_end_delay (McpDispatchOperation *self
,McpDispatchOperationDelay *delay
); void mcp_dispatch_operation_close_channels (McpDispatchOperation *self
,gboolean wait_for_observers
); void mcp_dispatch_operation_destroy_channels (McpDispatchOperation *self
,gboolean wait_for_observers
); McpDispatchOperationDelay; McpDispatchOperationIface; McpDispatchOperation;
This object represents a Telepathy ChannelDispatchOperation object, as used by Approvers. A ChannelDispatchOperation represents a bundle of one or more Telepathy Channels being dispatched to user interfaces or other clients.
The virtual method mcd_dispatch_operation_policy_check()
receives an object
provided by Mission Control that implements this interface. It can be
used to inspect the channels, delay dispatching of the bundle until the
plugin is ready to continue, or close the channels in various ways.
Only Mission Control should implement this interface.
gboolean mcp_dispatch_operation_find_channel_by_type (McpDispatchOperation *self
,TpClientFactory *client_factory
,guint start_from
,TpHandleType handle_type
,GQuark channel_type
,guint *ret_index
,gchar **ret_dup_path
,GHashTable **ret_ref_immutable_properties
,TpChannel **ret_ref_channel
);
Attempt to find a channel matching the given handle type and channel type in the bundle. This is an easy way to test whether the bundle contains any channels of interest to a particular plugin.
|
a dispatch operation |
|
used to construct ret_ref_channel . In high-level
language bindings using gobject-introspection, this must not be NULL .
In C, this may be NULL , but only if ret_ref_channel is also NULL . |
|
index at which to start searching, usually 0 |
|
the handle type to match |
|
the channel type to match |
|
if not NULL , used to return the index of the first matching
channel, suitable for use with
mcp_dispatch_operation_get_nth_channel_path() etc. |
|
if not NULL , used to return the object path of the first
matching channel, which must be freed with g_free()
|
|
if not NULL , used to return a reference to
immutable properties, as if via
mcp_dispatch_operation_ref_nth_channel_properties() , which must be
released with g_hash_table_unref()
|
|
if not NULL , used to return a TpChannel, which is not
guaranteed to be ready immediately, and must be released with
g_object_unref()
|
Returns : |
TRUE if a matching channel was found, or FALSE (without touching
ret_index , ret_dup_path , ret_ref_immutable_properties or
ret_ref_channel ) if not |
TpConnection * mcp_dispatch_operation_ref_connection (McpDispatchOperation *self
,TpClientFactory *client_factory
);
Return a TpConnection object. It is not guaranteed to be prepared;
use tp_proxy_prepare_async()
.
|
a dispatch operation |
|
the client factory to use to construct the TpConnection |
Returns : |
a reference to a TpConnection, which must be released with
g_object_unref() by the caller |
TpChannel * mcp_dispatch_operation_ref_nth_channel (McpDispatchOperation *self
,TpClientFactory *client_factory
,guint n
);
Return a TpChannel object. It is not guaranteed to be prepared;
use tp_proxy_prepare_async()
.
|
a dispatch operation |
|
index of the channel to inspect |
Returns : |
a reference to a TpChannel, which must be released with
g_object_unref() by the caller, or NULL if n is too large |
const gchar * mcp_dispatch_operation_get_account_path
(McpDispatchOperation *self
);
|
a dispatch operation |
Returns : |
the D-Bus object path of the Account with which the channels are
associated. The string is owned by self and must not be freed; it is
only valid as long as a reference to self is held. |
const gchar * mcp_dispatch_operation_get_connection_path
(McpDispatchOperation *self
);
|
a dispatch operation |
Returns : |
the D-Bus object path of the Connection with which the channels are
associated. The string is owned by self and must not be freed; it is
only valid as long as a reference to self is held. |
const gchar * mcp_dispatch_operation_get_protocol (McpDispatchOperation *self
);
|
a dispatch operation |
Returns : |
the Telepathy identifier for the protocol, such as 'jabber' or
'icq' (the Protocol type in telepathy-spec). The string is owned by self
and must not be freed; it is only valid as long as a reference to self
is held. |
const gchar * mcp_dispatch_operation_get_cm_name (McpDispatchOperation *self
);
|
a dispatch operation |
Returns : |
the short name of the Telepathy connection manager, such as
'gabble' or 'haze' (the Connection_Manager_Name type in telepathy-spec).
The string is owned by self and must not be freed; it is only valid as
long as a reference to self is held. |
guint mcp_dispatch_operation_get_n_channels
(McpDispatchOperation *self
);
|
a dispatch operation |
Returns : |
the number of channels in this dispatch operation. |
const gchar * mcp_dispatch_operation_get_nth_channel_path (McpDispatchOperation *self
,guint n
);
|
a dispatch operation |
|
index of the channel to inspect |
Returns : |
the D-Bus object path of the n 'th channel (starting from 0), or
NULL if n is greater than or equal to
mcp_dispatch_operation_get_n_channels() .
The string is owned by self and must not be freed; it is only valid as
long as a reference to self is held. |
GHashTable * mcp_dispatch_operation_ref_nth_channel_properties (McpDispatchOperation *self
,guint n
);
Return the immutable properties of the n
'th channel (starting from 0), or
NULL
if n
is greater than or equal to
mcp_dispatch_operation_get_n_channels()
.
The keys of the hash table are strings and the values are in GValue
structures, using the same representation as dbus-glib, tp_asv_get_string()
etc. Do not add or remove entries in this hash table.
|
a dispatch operation |
|
index of the channel to inspect |
Returns : |
a reference to a hash table, which must be released with
g_hash_table_unref() by the caller |
McpDispatchOperationDelay * mcp_dispatch_operation_start_delay
(McpDispatchOperation *self
);
Start to delay the dispatch operation, for instance while waiting for
an asynchronous operation to finish. The returned token must be passed to
mcp_dispatch_operation_end_delay()
exactly once, at which point dispatching
will continue and the token becomes invalid.
This is similar to an Observer delaying the return from ObserveChannels, except that there is no time limit - a dispatch operation policy plugin can delay the dispatch operation indefinitely.
|
a dispatch operation |
Returns : |
a token which can be used to end the delay |
void mcp_dispatch_operation_end_delay (McpDispatchOperation *self
,McpDispatchOperationDelay *delay
);
Stop delaying the dispatch operation, allowing dispatching to proceed.
|
a dispatch operation |
|
a token obtained by calling mcp_dispatch_operation_start_delay()
on self previously |
void mcp_dispatch_operation_close_channels (McpDispatchOperation *self
,gboolean wait_for_observers
);
Close all channels in this bundle by using the Close D-Bus method.
Plugins that terminate an audio or audio/video call should
use tp_call_channel_hangup_async()
instead.
void mcp_dispatch_operation_destroy_channels (McpDispatchOperation *self
,gboolean wait_for_observers
);
Close all channels in this bundle destructively, by using the Destroy D-Bus method if implemented, or the Close D-Bus method if not.
Plugins that terminate an audio or audio/video call should
use tp_call_channel_hangup_async()
instead.