TelepathyGLib.ConnectionManager

g GObject.Object GObject.Object TelepathyGLib.Proxy TelepathyGLib.Proxy GObject.Object->TelepathyGLib.Proxy TelepathyGLib.ConnectionManager TelepathyGLib.ConnectionManager TelepathyGLib.Proxy->TelepathyGLib.ConnectionManager

Subclasses:

None

Methods

Inherited:

TelepathyGLib.Proxy (11), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

check_valid_name (name)

class

check_valid_protocol_name (name)

class

get_feature_quark_core ()

class

init_known_interfaces ()

class

new (dbus, name, manager_filename)

dup_protocol_names ()

dup_protocols ()

get_info_source ()

get_name ()

get_protocol (protocol)

get_protocol_object (protocol)

has_protocol (protocol)

is_running ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

TelepathyGLib.Proxy (5)

Name

Type

Flags

Short Description

always-introspect

bool

r/w

Opportunistically introspect the CM when it’s run

cm-name

str

r

The name of the connection manager, e.g. “gabble” (read-only)

connection-manager

str

r

The name of the connection manager, e.g. “gabble” (read-only) deprecated

info-source

int

r

Where we got the current information on supported protocols

manager-file

str

r/w/c

The .manager filename

Signals

Inherited:

TelepathyGLib.Proxy (2), GObject.Object (1)

Name

Short Description

activated

Emitted when the connection manager’s well-known name appears on the bus.

exited

Emitted when the connection manager’s well-known name disappears from the bus or when activation fails.

got-info

Emitted when the connection manager’s capabilities have been discovered.

Fields

Inherited:

TelepathyGLib.Proxy (2), GObject.Object (1)

Name

Type

Access

Description

always_introspect

int

r

info_source

int

r

name

str

r

parent

TelepathyGLib.Proxy

r

protocols

TelepathyGLib.ConnectionManagerProtocol

r

reserved_flags

int

r

running

int

r

Class Details

class TelepathyGLib.ConnectionManager(**kwargs)
Bases:

TelepathyGLib.Proxy

Abstract:

No

Structure:

TelepathyGLib.ConnectionManagerClass

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 TelepathyGLib.Proxy ::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 TelepathyGLib.Proxy.prepare_async() to wait for this to happen.

Since 0.19.1, accessing the fields of this struct is deprecated, and they are no longer documented here. Use the accessors TelepathyGLib.ConnectionManager.get_name(), TelepathyGLib.ConnectionManager.is_running(), TelepathyGLib.ConnectionManager.dup_protocols(), TelepathyGLib.ConnectionManager.get_info_source() and the TelepathyGLib.ConnectionManager :always-introspect property instead.

New in version 0.7.1.

classmethod check_valid_name(name)
Parameters:

name (str) – a possible connection manager name

Raises:

GLib.Error

Returns:

True if name is valid

Return type:

bool

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.

New in version 0.7.1.

classmethod check_valid_protocol_name(name)
Parameters:

name (str) – a possible protocol name

Raises:

GLib.Error

Returns:

True if name is valid

Return type:

bool

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.

New in version 0.7.1.

classmethod get_feature_quark_core()
Return type:

int

classmethod init_known_interfaces()

Ensure that the known interfaces for TelepathyGLib.ConnectionManager 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_CONNECTION_MANAGER.

New in version 0.7.32.

classmethod new(dbus, name, manager_filename)
Parameters:
Raises:

GLib.Error

Returns:

a new reference to a connection manager proxy, or None if error is set.

Return type:

TelepathyGLib.ConnectionManager

Convenience function to create a new connection manager proxy. If its protocol and parameter information are required, you should call TelepathyGLib.Proxy.prepare_async() on the result.

dup_protocol_names()
Returns:

a #GStrv of protocol names

Return type:

[str]

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 None. Use TelepathyGLib.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.

New in version 0.7.26.

dup_protocols()
Returns:

a list of TelepathyGLib.Protocol objects representing the protocols supported by self, owned by the caller

Return type:

[TelepathyGLib.Protocol]

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 None. Use TelepathyGLib.Proxy.prepare_async() to wait for this.

The caller must free the list, for instance with g_list_free_full (l, g_object_unref).

New in version 0.17.6.

get_info_source()
Returns:

the value of the TelepathyGLib.ConnectionManager :info-source property

Return type:

TelepathyGLib.CMInfoSource

If protocol and parameter information has been obtained from the connection manager, return TelepathyGLib.CMInfoSource.LIVE; if it has been obtained from the cache in the .manager file, return TelepathyGLib.CMInfoSource.FILE. If this information has not yet been obtained, or obtaining it failed, return TelepathyGLib.CMInfoSource.NONE.

This may increase at any time that the main loop is running; the GObject.Object ::notify signal is emitted.

New in version 0.7.26.

get_name()
Returns:

the TelepathyGLib.ConnectionManager :cm-name property

Return type:

str

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 GLib.strdup() if a longer lifetime is required.

New in version 0.7.26.

get_protocol(protocol)
Parameters:

protocol (str) – the name of a protocol as defined in the Telepathy D-Bus API, e.g. “jabber” or “msn”

Returns:

a structure representing the protocol

Return type:

TelepathyGLib.ConnectionManagerProtocol

Returns a structure representing a protocol, or None if this connection manager does not support the specified protocol.

Since 0.11.11, you can get a GObject.Object version with more functionality by calling TelepathyGLib.ConnectionManager.get_protocol_object().

If this function is called before the connection manager information has been obtained, the result is always None. Use TelepathyGLib.Proxy.prepare_async() to wait for this.

The result is not necessarily valid after the main loop is re-entered. Since 0.11.3, it can be copied with TelepathyGLib.ConnectionManagerProtocol.copy() if a permanently-valid copy is needed.

New in version 0.7.26.

Deprecated since version 0.19.1: , use TelepathyGLib.ConnectionManager.get_protocol_object()

get_protocol_object(protocol)
Parameters:

protocol (str) – the name of a protocol as defined in the Telepathy D-Bus API, e.g. “jabber” or “msn”

Returns:

an object representing the protocol, or None

Return type:

TelepathyGLib.Protocol

Returns an object representing a protocol, or None 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 None. Use TelepathyGLib.Proxy.prepare_async() to wait for this.

The result should be referenced with GObject.Object.ref() if it will be kept.

New in version 0.11.11.

has_protocol(protocol)
Parameters:

protocol (str) – the name of a protocol as defined in the Telepathy D-Bus API, e.g. “jabber” or “msn”

Returns:

True if this connection manager supports protocol

Return type:

bool

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 TelepathyGLib.Proxy.prepare_async() to wait for this.

New in version 0.7.26.

is_running()
Returns:

whether the connection manager is currently running

Return type:

bool

Return True if this connection manager currently appears to be running. This may change at any time that the main loop is running; the TelepathyGLib.ConnectionManager ::activated and TelepathyGLib.ConnectionManager ::exited signals are emitted.

New in version 0.7.26.

Signal Details

TelepathyGLib.ConnectionManager.signals.activated(connection_manager)
Signal Name:

activated

Flags:

RUN_LAST, DETAILED

Parameters:

connection_manager (TelepathyGLib.ConnectionManager) – The object which received the signal

Emitted when the connection manager’s well-known name appears on the bus.

TelepathyGLib.ConnectionManager.signals.exited(connection_manager)
Signal Name:

exited

Flags:

RUN_LAST, DETAILED

Parameters:

connection_manager (TelepathyGLib.ConnectionManager) – The object which received the signal

Emitted when the connection manager’s well-known name disappears from the bus or when activation fails.

TelepathyGLib.ConnectionManager.signals.got_info(connection_manager, source)
Signal Name:

got-info

Flags:

RUN_LAST, DETAILED

Parameters:

Emitted when the connection manager’s capabilities have been discovered.

This signal is not very helpful. Using TelepathyGLib.Proxy.prepare_async() instead is recommended.

Property Details

TelepathyGLib.ConnectionManager.props.always_introspect
Name:

always-introspect

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

If True, always introspect the connection manager as it comes online, even if we already have its info from a .manager file. Default False.

TelepathyGLib.ConnectionManager.props.cm_name
Name:

cm-name

Type:

str

Default Value:

None

Flags:

READABLE

The name of the connection manager, e.g. “gabble” (read-only).

New in version 0.19.3.

TelepathyGLib.ConnectionManager.props.connection_manager
Name:

connection-manager

Type:

str

Default Value:

None

Flags:

READABLE

The name of the connection manager, e.g. “gabble” (read-only).

Deprecated since version ???: Use TelepathyGLib.ConnectionManager :cm-name instead.

TelepathyGLib.ConnectionManager.props.info_source
Name:

info-source

Type:

int

Default Value:

0

Flags:

READABLE

Where we got the current information on supported protocols (a TelepathyGLib.CMInfoSource).

Since 0.7.26, the GObject.Object ::notify signal is emitted for this property.

(Note that this is of type GObject.TYPE_UINT, not %TP_TYPE_CM_INFO_SOURCE, for historical reasons.)

TelepathyGLib.ConnectionManager.props.manager_file
Name:

manager-file

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

The absolute path of the .manager file. If set to None (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.