Top |
gboolean | always-introspect | Read / Write |
gchar * | cm-name | Read |
guint | info-source | Read |
gchar * | manager-file | Read / Write / Construct |
struct | TpConnectionManager |
struct | TpConnectionManagerClass |
#define | TP_CONNECTION_MANAGER_FEATURE_CORE |
enum | TpCMInfoSource |
TpConnectionManagerParam |
GBoxed ╰── TpConnectionManagerParam GEnum ╰── TpCMInfoSource GObject ╰── TpProxy ╰── TpConnectionManager
TpConnectionManager objects represent Telepathy connection managers. They can be used to open connections.
void tp_list_connection_managers_async (TpClientFactory *factory
,GAsyncReadyCallback callback
,gpointer user_data
);
List the available (running or installed) connection managers,
asynchronously, and wait for their TP_CONNECTION_MANAGER_FEATURE_CORE
feature to be ready.
factory
will be used to create the TpConnectionManager objects using
tp_client_factory_ensure_connection_manager()
.
factory |
||
callback |
a callback to call with a list of CMs |
|
user_data |
data to pass to |
Since 0.17.6
GList * tp_list_connection_managers_finish (GAsyncResult *result
,GError **error
);
Finish listing the available connection managers.
Free the list after use, for instance with
g_list_free_full (list, g_object_unref)
.
result |
the result of |
|
error |
used to raise an error if the operation failed |
a newly allocated list of references to TpConnectionManager objects.
[transfer full][element-type TelepathyGLib.ConnectionManager]
Since 0.17.6
const gchar *
tp_connection_manager_get_name (TpConnectionManager *self
);
Return the internal name of this connection manager in the Telepathy D-Bus API, e.g. "gabble" or "haze". This is often the name of the binary without the "telepathy-" prefix.
The returned string is valid as long as self
is. Copy it with g_strdup()
if a longer lifetime is required.
Since 0.7.26
#define TP_TYPE_CM_INFO_SOURCE (tp_cm_info_source_get_type ())
The GEnumClass type of a TpCMInfoSource.
Since 0.11.5
TpCMInfoSource
tp_connection_manager_get_info_source (TpConnectionManager *self
);
If protocol and parameter information has been obtained from the connection
manager, return TP_CM_INFO_SOURCE_LIVE
; if it has been obtained from the
cache in the .manager file, return TP_CM_INFO_SOURCE_FILE
. If this
information has not yet been obtained, or obtaining it failed, return
TP_CM_INFO_SOURCE_NONE
.
This may increase at any time that the main loop is running; the “notify” signal is emitted.
Since 0.7.26
gboolean
tp_connection_manager_activate (TpConnectionManager *self
);
Attempt to run and introspect the connection manager, asynchronously. Since 0.7.26 this function is not generally very useful, since the connection manager will now be activated automatically if necessary.
If the CM was already running, do nothing and return FALSE
.
On success, emit “activated” when the CM appears on the bus, and “got-info” when its capabilities have been (re-)discovered.
On failure, emit “exited” without first emitting activated.
TRUE
if activation was needed and is now in progress, FALSE
if the connection manager was already running and no additional signals
will be emitted.
Since 0.7.1
gboolean
tp_connection_manager_is_running (TpConnectionManager *self
);
Return TRUE
if this connection manager currently appears to be running.
This may change at any time that the main loop is running; the
“activated” and “exited” signals
are emitted.
Since 0.7.26
GList *
tp_connection_manager_dup_protocols (TpConnectionManager *self
);
Return objects representing all protocols supported by this connection manager.
If this function is called before the connection manager information has
been obtained, the result is always NULL
. Use tp_proxy_prepare_async()
to wait for this.
The caller must free the list, for instance with
g_list_free_full (l, g_object_unref)
.
a list
of TpProtocol objects representing the protocols supported by self
,
owned by the caller.
[transfer full][element-type TelepathyGLib.Protocol]
Since 0.17.6
gchar **
tp_connection_manager_dup_protocol_names
(TpConnectionManager *self
);
Returns a list of protocol names supported by this connection manager. These are the internal protocol names used by the Telepathy specification (e.g. "jabber" and "msn"), rather than user-visible names in any particular locale.
If this function is called before the connection manager information has
been obtained, the result is always NULL
. Use
tp_proxy_prepare_async()
to wait for this.
The result is copied and must be freed by the caller, but it is not necessarily still true after the main loop is re-entered.
Since 0.7.26
gboolean tp_connection_manager_has_protocol (TpConnectionManager *self
,const gchar *protocol
);
Return whether protocol
is supported by this connection manager.
If this function is called before the connection manager information has
been obtained, the result is always FALSE
. Use tp_proxy_prepare_async()
to wait for this.
self |
a connection manager |
|
protocol |
the name of a protocol as defined in the Telepathy D-Bus API, e.g. "jabber" or "msn" |
Since 0.7.26
TpProtocol * tp_connection_manager_get_protocol (TpConnectionManager *self
,const gchar *protocol
);
Returns an object representing a protocol, or NULL
if this connection
manager does not support the specified protocol.
If this function is called before the connection manager information has
been obtained, the result is always NULL
. Use tp_proxy_prepare_async()
to wait for this.
The result should be referenced with g_object_ref()
if it will be kept.
self |
a connection manager |
|
protocol |
the name of a protocol as defined in the Telepathy D-Bus API, e.g. "jabber" or "msn" |
Since 0.11.11
const gchar *
tp_connection_manager_param_get_name (const TpConnectionManagerParam *param
);
Since 0.7.26
const gchar *
tp_connection_manager_param_get_dbus_signature
(const TpConnectionManagerParam *param
);
Since 0.7.26
gboolean
tp_connection_manager_param_is_required
(const TpConnectionManagerParam *param
);
Since 0.7.26
gboolean
tp_connection_manager_param_is_required_for_registration
(const TpConnectionManagerParam *param
);
TRUE
if the parameter is required when registering a new account
(by setting the special "register" parameter to TRUE
)
Since 0.7.26
gboolean
tp_connection_manager_param_is_secret (const TpConnectionManagerParam *param
);
Since 0.7.26
gboolean
tp_connection_manager_param_is_dbus_property
(const TpConnectionManagerParam *param
);
Since 0.7.26
GVariant *
tp_connection_manager_param_dup_default_variant
(const TpConnectionManagerParam *param
);
Get the default value for this parameter.
Use g_variant_get_type()
to check that the type is what you expect.
For instance, a string parameter should have type
G_VARIANT_TYPE_STRING
.
Since 0.19.0
gboolean tp_connection_manager_check_valid_name (const gchar *name
,GError **error
);
Check that the given string is a valid connection manager name, i.e. that it consists entirely of ASCII letters, digits and underscores, and starts with a letter.
name |
a possible connection manager name |
|
error |
used to raise |
Since 0.7.1
gboolean tp_connection_manager_check_valid_protocol_name (const gchar *name
,GError **error
);
Check that the given string is a valid protocol name, i.e. that it consists entirely of ASCII letters, digits and hyphen/minus, and starts with a letter or underscore.
name |
a possible protocol name |
|
error |
used to raise |
Since 0.7.1
TpConnectionManagerParam *
tp_connection_manager_param_copy (const TpConnectionManagerParam *in
);
a newly (slice) allocated TpConnectionManagerParam, free with
tp_connection_manager_param_free()
Since 0.11.3
void
tp_connection_manager_param_free (TpConnectionManagerParam *param
);
Frees param
, which was copied with tp_connection_manager_param_copy()
.
Since 0.11.3
GVariantType *
tp_connection_manager_param_dup_variant_type
(const TpConnectionManagerParam *param
);
Since 0.23.1
struct TpConnectionManager;
A proxy object for a Telepathy connection manager.
This might represent a connection manager which is currently running (in which case it can be introspected) or not (in which case its capabilities can be read from .manager files in the filesystem). Accordingly, this object never emits “invalidated” unless all references to it are discarded.
Various fields and methods on this object do not work until
TP_CONNECTION_MANAGER_FEATURE_CORE
is prepared. Use
tp_proxy_prepare_async()
to wait for this to happen.
Since 0.7.1
struct TpConnectionManagerClass { };
The class of a TpConnectionManager.
Since 0.7.1
#define TP_CONNECTION_MANAGER_FEATURE_CORE
Expands to a call to a function that returns a quark for the "core" feature on a TpConnectionManager.
After this feature is prepared, basic information about the connection
manager's protocols (tp_connection_manager_dup_protocols()
), and their
available parameters, will have been retrieved, either by activating the
connection manager over D-Bus or by reading the .manager file in which
that information is cached.
Since 0.11.11, this feature also finds any extra interfaces that
this connection manager has, and adds them to “interfaces” (where
they can be queried with tp_proxy_has_interface()
).
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
Describes possible sources of information on connection managers' supported protocols.
Since 0.11.5, there is a corresponding GEnumClass type,
TP_TYPE_CM_INFO_SOURCE
.
Since 0.7.1
“always-introspect”
property“always-introspect” gboolean
If TRUE
, always introspect the connection manager as it comes online,
even if we already have its info from a .manager file. Default FALSE
.
Flags: Read / Write
Default value: FALSE
“cm-name”
property“cm-name” gchar *
The name of the connection manager, e.g. "gabble" (read-only).
Flags: Read
Default value: NULL
Since 0.19.3
“info-source”
property“info-source” guint
Where we got the current information on supported protocols (a TpCMInfoSource).
Since 0.7.26, the “notify” signal is emitted for this property.
(Note that this is of type G_TYPE_UINT
, not TP_TYPE_CM_INFO_SOURCE
,
for historical reasons.)
Flags: Read
Allowed values: <= 2
Default value: 0
“manager-file”
property“manager-file” gchar *
The absolute path of the .manager file. If set to NULL
(the default),
the XDG data directories will be searched for a .manager file of the
correct name.
If set to the empty string, no .manager file will be read.
Flags: Read / Write / Construct
Default value: NULL
“activated”
signalvoid user_function (TpConnectionManager *self, gpointer user_data)
Emitted when the connection manager's well-known name appears on the bus.
self |
the connection manager proxy |
|
user_data |
user data set when the signal handler was connected. |
Flags: Has Details
“exited”
signalvoid user_function (TpConnectionManager *self, gpointer user_data)
Emitted when the connection manager's well-known name disappears from the bus or when activation fails.
self |
the connection manager proxy |
|
user_data |
user data set when the signal handler was connected. |
Flags: Has Details
“got-info”
signalvoid user_function (TpConnectionManager *self, guint source, gpointer user_data)
Emitted when the connection manager's capabilities have been discovered.
This signal is not very helpful. Using
tp_proxy_prepare_async()
instead is recommended.
self |
the connection manager proxy |
|
source |
||
user_data |
user data set when the signal handler was connected. |
Flags: Has Details