TpClientFactory

TpClientFactory — a factory for TpContacts and plain subclasses of TpProxy

Functions

TpClientFactory * tp_client_factory_new ()
TpClientFactory * tp_client_factory_dup ()
void tp_client_factory_set_default ()
gboolean tp_client_factory_can_set_default ()
GDBusConnection * tp_client_factory_get_dbus_connection ()
TpAccountManager * tp_client_factory_ensure_account_manager ()
TpChannelDispatcher * tp_client_factory_ensure_channel_dispatcher ()
TpLogger * tp_client_factory_ensure_logger ()
TpAccount * tp_client_factory_ensure_account ()
GArray * tp_client_factory_dup_account_features ()
void tp_client_factory_add_account_features ()
void tp_client_factory_add_account_features_varargs ()
TpConnection * tp_client_factory_ensure_connection ()
GArray * tp_client_factory_dup_connection_features ()
void tp_client_factory_add_connection_features ()
void tp_client_factory_add_connection_features_varargs ()
TpChannel * tp_client_factory_ensure_channel ()
GArray * tp_client_factory_dup_channel_features ()
void tp_client_factory_add_channel_features ()
void tp_client_factory_add_channel_features_varargs ()
TpContact * tp_client_factory_ensure_contact ()
void tp_client_factory_upgrade_contacts_async ()
gboolean tp_client_factory_upgrade_contacts_finish ()
void tp_client_factory_ensure_contact_by_id_async ()
TpContact * tp_client_factory_ensure_contact_by_id_finish ()
GArray * tp_client_factory_dup_contact_features ()
void tp_client_factory_add_contact_features ()
void tp_client_factory_add_contact_features_varargs ()
TpProtocol * tp_client_factory_ensure_protocol ()
GArray * tp_client_factory_dup_protocol_features ()
void tp_client_factory_add_protocol_features ()
void tp_client_factory_add_protocol_features_varargs ()
TpTLSCertificate * tp_client_factory_ensure_tls_certificate ()
void tp_client_factory_add_tls_certificate_features ()
void tp_client_factory_add_tls_certificate_features_varargs ()
GArray * tp_client_factory_dup_tls_certificate_features ()
TpDebugClient * tp_client_factory_ensure_debug_client ()
TpConnectionManager * tp_client_factory_ensure_connection_manager ()

Properties

GDBusConnection * dbus-connection Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── TpClientFactory
        ╰── TpAutomaticClientFactory

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This factory constructs various TpProxy subclasses as well as TpContact, which guarantees that at most one instance of those objects will exist for a given remote object or contact. It also stores the desired features for contacts and each type of proxy.

Note that the factory will not prepare the desired features: it is the caller's responsibility to do so. By default, only core features are requested.

Currently supported classes are TpAccount, TpConnection, TpChannel and TpContact. Those objects should always be acquired through a factory or a "larger" object (e.g. getting the TpConnection from a TpAccount), rather than being constructed directly.

One can subclass TpClientFactory and override some of its virtual methods to construct more specialized objects. See TpAutomaticClientFactory for a subclass which automatically constructs subclasses of TpChannel for common channel types.

An application using its own factory subclass would look like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
int main(int argc, char *argv[])
{
  TpClientFactory *factory;
  TpAccountManager *manager;

  factory = my_factory_new ();
  tp_client_factory_set_default (factory);

  ...
  manager = tp_account_manager_dup ();
  tp_proxy_prepare_async (manager, am_features, callback, user_data);
  ...
}

The call to tp_client_factory_set_default() near the beginning of main() will ensure that any libraries or plugins which also use Telepathy (and call tp_client_factory_dup()) will share your TpClientFactory.

Functions

tp_client_factory_new ()

TpClientFactory *
tp_client_factory_new (GDBusConnection *dbus_connection);

Creates a new TpClientFactory instance.

Parameters

dbus_connection

a GDBusConnection

 

Returns

a new TpClientFactory

Since 0.99.1


tp_client_factory_dup ()

TpClientFactory *
tp_client_factory_dup (GError **error);

Get a reference to a TpClientFactory singleton. It can fail and block only if the session GDBusConnection singleton doesn't exist yet. It is thus recommended to call g_bus_get() before using a TpClientFactory if the application must not block.

By default it will create a TpAutomaticClientFactory.

Parameters

error

Used to raise an error if getting the session GDBusConnection fails

 

Returns

a reference to a TpClientFactory singleton.

[transfer full]

Since 0.99.10


tp_client_factory_set_default ()

void
tp_client_factory_set_default (TpClientFactory *self);

Define the TpClientFactory singleton that will be returned by tp_client_factory_dup().

This function may only be called before the first call to tp_client_factory_dup(), and may not be called more than once. Applications which use a custom TpClientFactory and want it to be the default factory should call this.

Only a weak reference is taken on self . It is the caller's responsibility to keep it alive. If self is disposed after calling this function, the next call to tp_client_factory_dup() will return a newly created TpClientFactory.

Parameters

self

a TpClientFactory

 

Since 0.99.10


tp_client_factory_can_set_default ()

gboolean
tp_client_factory_can_set_default (void);

Check if tp_client_factory_set_default() has already successfully been called.

Returns

TRUE if tp_client_factory_set_default() has already successfully been called in this process, FALSE otherwise.

Since 0.99.10


tp_client_factory_get_dbus_connection ()

GDBusConnection *
tp_client_factory_get_dbus_connection (TpClientFactory *self);

Parameters

self

a TpClientFactory object

 

Returns

the “dbus-connection” property.

[transfer none]

Since 0.99.10


tp_client_factory_ensure_account_manager ()

TpAccountManager *
tp_client_factory_ensure_account_manager
                               (TpClientFactory *self);

Parameters

self

a TpClientFactory object

 

Returns

a reference to a TpAccountManager singleton.

[transfer full]

Since 0.99.10


tp_client_factory_ensure_channel_dispatcher ()

TpChannelDispatcher *
tp_client_factory_ensure_channel_dispatcher
                               (TpClientFactory *self);

Parameters

self

a TpClientFactory object

 

Returns

a reference to a TpChannelDispatcher singleton.

[transfer full]

Since 0.99.10


tp_client_factory_ensure_logger ()

TpLogger *
tp_client_factory_ensure_logger (TpClientFactory *self);

Parameters

self

a TpClientFactory object

 

Returns

a reference to a TpLogger singleton.

[transfer full]

Since 0.99.10


tp_client_factory_ensure_account ()

TpAccount *
tp_client_factory_ensure_account (TpClientFactory *self,
                                  const gchar *object_path,
                                  GVariant *immutable_properties,
                                  GError **error);

Returns a TpAccount proxy for the account at object_path . The returned TpAccount is cached; the same TpAccount object will be returned by this function repeatedly, as long as at least one reference exists.

Note that the returned TpAccount is not guaranteed to be ready; the caller is responsible for calling tp_proxy_prepare_async() with the desired features (as given by tp_client_factory_dup_account_features()).

This function is rather low-level. tp_account_manager_dup_usable_accounts() and “usability-changed” are more appropriate for most applications.

immutable_properties is consumed if it is floating.

Parameters

self

a TpClientFactory object

 

object_path

the object path of an account

 

immutable_properties

a G_VARIANT_TYPE_VARDICT containing the immutable properties of the account, or NULL.

[allow-none]

error

Used to raise an error if object_path is not valid

 

Returns

a reference to a TpAccount; see tp_account_new().

[transfer full]

Since 0.99.1


tp_client_factory_dup_account_features ()

GArray *
tp_client_factory_dup_account_features
                               (TpClientFactory *self,
                                TpAccount *account);

Return a zero-terminated GArray containing the TpAccount features that should be prepared on account .

Parameters

self

a TpClientFactory object

 

account

a TpAccount

 

Returns

a newly allocated GArray.

[transfer full][element-type GLib.Quark]

Since 0.99.1


tp_client_factory_add_account_features ()

void
tp_client_factory_add_account_features
                               (TpClientFactory *self,
                                const GQuark *features);

Add features to the desired features to be prepared on TpAccount objects. Those features will be added to the features already returned be tp_client_factory_dup_account_features().

It is not necessary to add TP_ACCOUNT_FEATURE_CORE as it is already included by default.

Note that these features will not be added to existing TpAccount objects; the user must call tp_proxy_prepare_async() themself.

Parameters

self

a TpClientFactory object

 

features

an array of desired features, ending with 0; NULL is equivalent to an array containing only 0.

[transfer none][array zero-terminated=1][allow-none]

Since 0.99.1


tp_client_factory_add_account_features_varargs ()

void
tp_client_factory_add_account_features_varargs
                               (TpClientFactory *self,
                                GQuark feature,
                                ...);

The same as tp_client_factory_add_account_features(), but with a more convenient calling convention from C.

Parameters

self

a TpClientFactory

 

feature

the first feature

 

...

the second and subsequent features, if any, ending with 0

 

Since 0.99.1


tp_client_factory_ensure_connection ()

TpConnection *
tp_client_factory_ensure_connection (TpClientFactory *self,
                                     const gchar *object_path,
                                     GVariant *immutable_properties,
                                     GError **error);

Returns a TpConnection proxy for the connection at object_path . The returned TpConnection is cached; the same TpConnection object will be returned by this function repeatedly, as long as at least one reference exists.

Note that the returned TpConnection is not guaranteed to be ready; the caller is responsible for calling tp_proxy_prepare_async() with the desired features (as given by tp_client_factory_dup_connection_features()).

This function is rather low-level. “connection” is more appropriate for most applications.

immutable_properties is consumed if it is floating.

Parameters

self

a TpClientFactory object

 

object_path

the object path of a connection

 

immutable_properties

a G_VARIANT_TYPE_VARDICT containing the immutable properties of the connection, or NULL.

[allow-none]

error

Used to raise an error if object_path is not valid

 

Returns

a reference to a TpConnection; see tp_connection_new().

[transfer full]

Since 0.99.1


tp_client_factory_dup_connection_features ()

GArray *
tp_client_factory_dup_connection_features
                               (TpClientFactory *self,
                                TpConnection *connection);

Return a zero-terminated GArray containing the TpConnection features that should be prepared on connection .

Parameters

self

a TpClientFactory object

 

connection

a TpConnection

 

Returns

a newly allocated GArray.

[transfer full][element-type GLib.Quark]

Since 0.99.1


tp_client_factory_add_connection_features ()

void
tp_client_factory_add_connection_features
                               (TpClientFactory *self,
                                const GQuark *features);

Add features to the desired features to be prepared on TpConnection objects. Those features will be added to the features already returned be tp_client_factory_dup_connection_features().

It is not necessary to add TP_CONNECTION_FEATURE_CORE as it is already included by default.

Note that these features will not be added to existing TpConnection objects; the user must call tp_proxy_prepare_async() themself.

Parameters

self

a TpClientFactory object

 

features

an array of desired features, ending with 0; NULL is equivalent to an array containing only 0.

[transfer none][array zero-terminated=1][allow-none]

Since 0.99.1


tp_client_factory_add_connection_features_varargs ()

void
tp_client_factory_add_connection_features_varargs
                               (TpClientFactory *self,
                                GQuark feature,
                                ...);

The same as tp_client_factory_add_connection_features(), but with a more convenient calling convention from C.

Parameters

self

a TpClientFactory

 

feature

the first feature

 

...

the second and subsequent features, if any, ending with 0

 

Since 0.99.1


tp_client_factory_ensure_channel ()

TpChannel *
tp_client_factory_ensure_channel (TpClientFactory *self,
                                  TpConnection *connection,
                                  const gchar *object_path,
                                  GVariant *immutable_properties,
                                  GError **error);

Returns a TpChannel proxy for the channel at object_path on connection . The returned TpChannel is cached; the same TpChannel object will be returned by this function repeatedly, as long as at least one reference exists.

Note that the returned TpChannel is not guaranteed to be ready; the caller is responsible for calling tp_proxy_prepare_async() with the desired features (as given by tp_client_factory_dup_channel_features()).

This function is rather low-level. TpAccountChannelRequest and TpBaseClient are more appropriate ways to obtain channels for most applications.

immutable_properties is consumed if it is floating.

Parameters

self

a TpClientFactory

 

connection

a TpConnection whose “factory” is this object

 

object_path

the object path of a channel on connection

 

immutable_properties

a G_VARIANT_TYPE_VARDICT containing the immutable properties of the account, or NULL.

[allow-none]

error

Used to raise an error if object_path is not valid

 

Returns

a reference to a TpChannel; see tp_channel_new_from_properties().

[transfer full]

Since 0.99.1


tp_client_factory_dup_channel_features ()

GArray *
tp_client_factory_dup_channel_features
                               (TpClientFactory *self,
                                TpChannel *channel);

Return a zero-terminated GArray containing the TpChannel features that should be prepared on channel .

Parameters

self

a TpClientFactory object

 

channel

a TpChannel

 

Returns

a newly allocated GArray.

[transfer full][element-type GLib.Quark]

Since 0.99.1


tp_client_factory_add_channel_features ()

void
tp_client_factory_add_channel_features
                               (TpClientFactory *self,
                                const GQuark *features);

Add features to the desired features to be prepared on TpChannel objects. Those features will be added to the features already returned be tp_client_factory_dup_channel_features().

It is not necessary to add TP_CHANNEL_FEATURE_CORE as it is already included by default.

Note that these features will not be added to existing TpChannel objects; the user must call tp_proxy_prepare_async() themself.

Parameters

self

a TpClientFactory object

 

features

an array of desired features, ending with 0; NULL is equivalent to an array containing only 0.

[transfer none][array zero-terminated=1][allow-none]

Since 0.99.1


tp_client_factory_add_channel_features_varargs ()

void
tp_client_factory_add_channel_features_varargs
                               (TpClientFactory *self,
                                GQuark feature,
                                ...);

The same as tp_client_factory_add_channel_features(), but with a more convenient calling convention from C.

Parameters

self

a TpClientFactory

 

feature

the first feature

 

...

the second and subsequent features, if any, ending with 0

 

Since 0.99.1


tp_client_factory_ensure_contact ()

TpContact *
tp_client_factory_ensure_contact (TpClientFactory *self,
                                  TpConnection *connection,
                                  TpHandle handle,
                                  const gchar *identifier);

Returns a TpContact representing identifier (and handle ) on connection . The returned TpContact is cached; the same TpContact object will be returned by this function repeatedly, as long as at least one reference exists.

Note that the returned TpContact is not guaranteed to be ready; the caller is responsible for calling tp_connection_upgrade_contacts() with the desired features (as given by tp_client_factory_dup_contact_features()).

Parameters

self

a TpClientFactory object

 

connection

a TpConnection whose “factory” is this object

 

handle

a TpHandle

 

identifier

a string representing the contact's identifier

 

Returns

a reference to a TpContact.

[transfer full]

Since 0.99.1


tp_client_factory_upgrade_contacts_async ()

void
tp_client_factory_upgrade_contacts_async
                               (TpClientFactory *self,
                                TpConnection *connection,
                                guint n_contacts,
                                TpContact * const *contacts,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Same as tp_connection_upgrade_contacts_async(), but prepare contacts with all features previously passed to tp_client_factory_add_contact_features().

Parameters

self

a TpClientFactory object

 

connection

a TpConnection whose “factory” is this object

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects associated with self .

[array length=n_contacts]

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since 0.19.1


tp_client_factory_upgrade_contacts_finish ()

gboolean
tp_client_factory_upgrade_contacts_finish
                               (TpClientFactory *self,
                                GAsyncResult *result,
                                GPtrArray **contacts,
                                GError **error);

Finishes tp_client_factory_upgrade_contacts_async()

Parameters

self

a TpClientFactory

 

result

a GAsyncResult

 

contacts

a location to set a GPtrArray of upgraded TpContact, or NULL.

[element-type TelepathyGLib.Contact][transfer container][out][allow-none]

error

a GError to fill

 

Returns

TRUE on success, FALSE otherwise.

Since 0.19.1


tp_client_factory_ensure_contact_by_id_async ()

void
tp_client_factory_ensure_contact_by_id_async
                               (TpClientFactory *self,
                                TpConnection *connection,
                                const gchar *identifier,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Same as tp_connection_dup_contact_by_id_async(), but prepare the contact with all features previously passed to tp_client_factory_add_contact_features().

Parameters

self

a TpClientFactory object

 

connection

a TpConnection

 

identifier

a string representing the contact's identifier

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since 0.19.1


tp_client_factory_ensure_contact_by_id_finish ()

TpContact *
tp_client_factory_ensure_contact_by_id_finish
                               (TpClientFactory *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_client_factory_ensure_contact_by_id_async()

Parameters

self

a TpClientFactory

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a TpContact or NULL on error.

[transfer full]

Since 0.19.1


tp_client_factory_dup_contact_features ()

GArray *
tp_client_factory_dup_contact_features
                               (TpClientFactory *self,
                                TpConnection *connection);

Return a GArray containing the contact feature GQuarks that should be prepared on all contacts of connection .

Parameters

self

a TpClientFactory object

 

connection

a TpConnection

 

Returns

a newly allocated GArray.

[transfer full][element-type GLib.Quark]

Since 0.99.1


tp_client_factory_add_contact_features ()

void
tp_client_factory_add_contact_features
                               (TpClientFactory *self,
                                const GQuark *features);

Add features to the desired features to be prepared on TpContact objects. Those features will be added to the features already returned be tp_client_factory_dup_contact_features().

Note that these features will not be added to existing TpContact objects; the user must call tp_connection_upgrade_contacts() themself.

Parameters

self

a TpClientFactory object

 

features

an array of desired features.

[transfer none][array zero-terminated=1][allow-none]

Since 0.99.1


tp_client_factory_add_contact_features_varargs ()

void
tp_client_factory_add_contact_features_varargs
                               (TpClientFactory *self,
                                GQuark feature,
                                ...);

The same as tp_client_factory_add_contact_features(), but with a more convenient calling convention from C.

Parameters

self

a TpClientFactory

 

feature

the first feature

 

...

the second and subsequent features, if any, ending with 0

 

Since 0.99.1


tp_client_factory_ensure_protocol ()

TpProtocol *
tp_client_factory_ensure_protocol (TpClientFactory *self,
                                   const gchar *cm_name,
                                   const gchar *protocol_name,
                                   GVariant *immutable_properties,
                                   GError **error);

Returns a TpProtocol proxy for the protocol protocol_name on connection manager cm_name . The returned TpProtocol is cached; the same TpProtocol object will be returned by this function repeatedly, as long as at least one reference exists.

Note that the returned TpProtocol is not guaranteed to be ready; the caller is responsible for calling tp_proxy_prepare_async() with the desired features (as given by tp_client_factory_dup_protocol_features()).

immutable_properties is consumed if it is floating.

Parameters

self

a TpClientFactory

 

cm_name

the connection manager name (such as "gabble")

 

protocol_name

the protocol name (such as "jabber")

 

immutable_properties

a G_VARIANT_TYPE_VARDICT containing the immutable properties of the protocol, or NULL.

[allow-none]

error

Used to raise an error if cm_name or protocol_name is invalid

 

Returns

a reference to a TpProtocol, or NULL on invalid arguments.

[transfer full]

Since 0.99.8


tp_client_factory_dup_protocol_features ()

GArray *
tp_client_factory_dup_protocol_features
                               (TpClientFactory *self,
                                TpProtocol *protocol);

Return a zero-terminated GArray containing the TpProtocol features that should be prepared on protocol .

Parameters

self

a TpClientFactory object

 

protocol

a TpProtocol

 

Returns

a newly allocated GArray.

[transfer full][element-type GLib.Quark]

Since 0.99.8


tp_client_factory_add_protocol_features ()

void
tp_client_factory_add_protocol_features
                               (TpClientFactory *self,
                                const GQuark *features);

Add features to the desired features to be prepared on TpProtocol objects. Those features will be added to the features already returned be tp_client_factory_dup_protocol_features().

It is not necessary to add TP_PROTOCOL_FEATURE_CORE as it is already included by default.

Note that these features will not be added to existing TpProtocol objects; the user must call tp_proxy_prepare_async() themself.

Parameters

self

a TpClientFactory object

 

features

an array of desired features, ending with 0; NULL is equivalent to an array containing only 0.

[transfer none][array zero-terminated=1][allow-none]

Since 0.99.8


tp_client_factory_add_protocol_features_varargs ()

void
tp_client_factory_add_protocol_features_varargs
                               (TpClientFactory *self,
                                GQuark feature,
                                ...);

The same as tp_client_factory_add_protocol_features(), but with a more convenient calling convention from C.

Parameters

self

a TpClientFactory

 

feature

the first feature

 

...

the second and subsequent features, if any, ending with 0

 

Since 0.99.8


tp_client_factory_ensure_tls_certificate ()

TpTLSCertificate *
tp_client_factory_ensure_tls_certificate
                               (TpClientFactory *self,
                                TpProxy *conn_or_chan,
                                const gchar *object_path,
                                GError **error);

Returns a TpTLSCertificate proxy for the channel or connection conn_or_chan . The returned TpTLSCertificate is cached; the same TpTLSCertificate object will be returned by this function repeatedly, as long as at least one reference exists.

Note that the returned TpTLSCertificate is not guaranteed to be ready; the caller is responsible for calling tp_proxy_prepare_async() with the desired features (as given by tp_client_factory_dup_tls_certificate_features()).

Parameters

self

a TpClientFactory

 

conn_or_chan

a TpConnection or TpChannel parent for this object, whose invalidation will also result in invalidation of the returned object

 

object_path

the object path of this TLS certificate

 

error

Used to raise an error

 

Returns

a reference to a TpTLSCertificate, or NULL on invalid arguments.

[transfer full]

Since 0.99.8


tp_client_factory_add_tls_certificate_features ()

void
tp_client_factory_add_tls_certificate_features
                               (TpClientFactory *self,
                                const GQuark *features);

Add features to the desired features to be prepared on TpTLSCertificate objects. Those features will be added to the features already returned be tp_client_factory_dup_tls_certificate_features().

It is not necessary to add TP_TLS_CERTIFICATE_FEATURE_CORE as it is already included by default.

Note that these features will not be added to existing TpTLSCertificate objects; the user must call tp_proxy_prepare_async() themself.

Parameters

self

a TpClientFactory object

 

features

an array of desired features, ending with 0; NULL is equivalent to an array containing only 0.

[transfer none][array zero-terminated=1][allow-none]

Since 0.99.8


tp_client_factory_add_tls_certificate_features_varargs ()

void
tp_client_factory_add_tls_certificate_features_varargs
                               (TpClientFactory *self,
                                GQuark feature,
                                ...);

The same as tp_client_factory_add_tls_certificate_features(), but with a more convenient calling convention from C.

Parameters

self

a TpClientFactory

 

feature

the first feature

 

...

the second and subsequent features, if any, ending with 0

 

Since 0.99.8


tp_client_factory_dup_tls_certificate_features ()

GArray *
tp_client_factory_dup_tls_certificate_features
                               (TpClientFactory *self,
                                TpTLSCertificate *certificate);

Return a zero-terminated GArray containing the TpTLSCertificate features that should be prepared on protocol .

Parameters

self

a TpClientFactory object

 

certificate

a TpTLSCertificate

 

Returns

a newly allocated GArray.

[transfer full][element-type GLib.Quark]

Since 0.99.8


tp_client_factory_ensure_debug_client ()

TpDebugClient *
tp_client_factory_ensure_debug_client (TpClientFactory *self,
                                       const gchar *unique_name,
                                       GError **error);

The returned TpDebugClient is cached; the same TpDebugClient object will be returned by this function repeatedly, as long as at least one reference exists.

Note that the returned TpDebugClient is not guaranteed to be ready; the caller is responsible for calling tp_proxy_prepare_async() with the desired features.

Parameters

self

a TpClientFactory

 

unique_name

the unique name of the process to be debugged; may not be NULL or a well-known name

 

error

Used to raise an error

 

Returns

a reference to a TpDebugClient, or NULL on invalid arguments.

[transfer full]

Since 0.99.10


tp_client_factory_ensure_connection_manager ()

TpConnectionManager *
tp_client_factory_ensure_connection_manager
                               (TpClientFactory *self,
                                const gchar *name,
                                const gchar *manager_filename,
                                GError **error);

The returned TpConnectionManager is cached; the same TpConnectionManager object will be returned by this function repeatedly, as long as at least one reference exists.

Note that the returned TpConnectionManager is not guaranteed to be ready; the caller is responsible for calling tp_proxy_prepare_async() with the desired features.

Parameters

self

a TpClientFactory

 

name

The connection manager name (such as "gabble")

 

manager_filename

The “manager-file” property, which may (and generally should) be NULL.

[allow-none]

error

Used to raise an error

 

Returns

a reference to a TpConnectionManager, or NULL on invalid arguments.

[transfer full]

Since 0.99.10

Types and Values

TpClientFactory

typedef struct _TpClientFactory TpClientFactory;

Data structure representing a TpClientFactory

Since 0.99.1


struct TpClientFactoryClass

struct TpClientFactoryClass {
    GObjectClass parent_class;

    /* TpAccount */
    TpAccount * (*create_account) (TpClientFactory *self,
        const gchar *object_path,
        GVariant *immutable_properties,
        GError **error);
    GArray * (*dup_account_features) (TpClientFactory *self,
        TpAccount *account);

    /* TpConnection */
    TpConnection * (*create_connection) (TpClientFactory *self,
        const gchar *object_path,
        GVariant *immutable_properties,
        GError **error);
    GArray * (*dup_connection_features) (TpClientFactory *self,
        TpConnection *connection);

    /* TpChannel */
    TpChannel * (*create_channel) (TpClientFactory *self,
        TpConnection *conn,
        const gchar *object_path,
        GVariant *immutable_properties,
        GError **error);
    GArray * (*dup_channel_features) (TpClientFactory *self,
        TpChannel *channel);

    /* TpContact */
    TpContact * (*create_contact) (TpClientFactory *self,
        TpConnection *connection,
        TpHandle handle,
        const gchar *identifier);
    GArray * (*dup_contact_features) (TpClientFactory *self,
        TpConnection *connection);

    /* TpProcotol */
    TpProtocol * (*create_protocol) (TpClientFactory *self,
        const gchar *cm_name,
        const gchar *protocol_name,
        GVariant *immutable_properties,
        GError **error);
    GArray * (*dup_protocol_features) (TpClientFactory *self,
        TpProtocol *protocol);

    /* TpTLSCertificate */
    TpTLSCertificate * (*create_tls_certificate) (TpClientFactory *self,
        TpProxy *conn_or_chan,
        const gchar *object_path,
        GError **error);
    GArray * (*dup_tls_certificate_features) (TpClientFactory *self,
        TpTLSCertificate *certificate);
};

The class structure for TpClientFactory.

TpClientFactory maintains a cache of previously-constructed proxy objects, so the implementations of create_account , create_connection , create_channel , create_contact and create_protocol may assume that a new object should be created when they are called. The default implementations create unadorned instances of the relevant classes; subclasses of the factory may choose to create more interesting proxy subclasses.

The default implementation of dup_channel_features returns TP_CHANNEL_FEATURE_CORE, plus all features passed to tp_client_factory_add_channel_features() by the application. Subclasses may override this method to prepare more interesting features from subclasses of TpChannel, for instance. The default implementations of the other dup_x_features methods behave similarly.

Members

GObjectClass parent_class;

the parent

 

create_account ()

create a TpAccount; see tp_client_factory_ensure_account()

 

dup_account_features ()

implementation of tp_client_factory_dup_account_features()

 

create_connection ()

create a TpConnection; see tp_client_factory_ensure_connection()

 

dup_connection_features ()

implementation of tp_client_factory_dup_connection_features()

 

create_channel ()

create a TpChannel; see tp_client_factory_ensure_channel()

 

dup_channel_features ()

implementation of tp_client_factory_dup_channel_features()

 

create_contact ()

create a TpContact; see tp_client_factory_ensure_contact()

 

dup_contact_features ()

implementation of tp_client_factory_dup_contact_features()

 

create_protocol ()

create a TpProtocol; see tp_client_factory_ensure_protocol()

 

dup_protocol_features ()

implementation of tp_client_factory_dup_protocol_features()

 

create_tls_certificate ()

create a TpTLSCertificate; see tp_client_factory_ensure_tls_certificate()

 

dup_tls_certificate_features ()

implementation of tp_client_factory_dup_tls_certificate_features()

 

Since 0.99.1

Property Details

The “dbus-connection” property

  “dbus-connection”          GDBusConnection *

The D-Bus connection for this object.

Flags: Read / Write / Construct Only

See Also

TpAutomaticClientFactory