MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9
   Home · All Classes · All Namespaces · Modules · Functions · Files

The AccountFactory class is responsible for constructing Account objects according to application-defined settings. More...

#include <TelepathyQt4/AccountFactory>

Inherits Tp::FixedFeatureFactory.

Inherited by Tp::PendingChannel::Private::FakeAccountFactory.

List of all members.

Public Member Functions

  • virtual ~AccountFactory ()
  • PendingReady * proxy (const QString &busName, const QString &objectPath, const ConnectionFactoryConstPtr &connFactory, const ChannelFactoryConstPtr &chanFactory, const ContactFactoryConstPtr &contactFactory) const

Static Public Member Functions

Protected Member Functions


Detailed Description

The AccountFactory class is responsible for constructing Account objects according to application-defined settings.

The class is used by AccountManager and other classes which construct Account proxy instances to enable sharing instances of application-defined Account subclasses with certain features always ready.


Constructor & Destructor Documentation

Tp::AccountFactory::~AccountFactory (  )  [virtual]

Class destructor.

Tp::AccountFactory::AccountFactory ( const QDBusConnection bus,
const Features features  
) [protected]

Construct a new AccountFactory object.

As in create(), it should be noted that unlike Account::becomeReady(), FeatureCore isn't assumed. If no features are specified, no Account::becomeReady() call is made at all and the proxy won't be Account::isReady().

Parameters:
bus  The QDBusConnection for proxies constructed using this factory to use.
features  The features to make ready on constructed Accounts.

Member Function Documentation

AccountFactoryPtr Tp::AccountFactory::create ( const QDBusConnection bus,
const Features features = Features()  
) [static]

Create a new AccountFactory object.

Optionally, the features to make ready on all constructed proxies can be specified. The default is to make no features ready. It should be noted that unlike Account::becomeReady(), FeatureCore isn't assumed. If no features are specified, which is the default behavior, no Account::becomeReady() call is made at all and the proxy won't be Account::isReady().

Parameters:
bus  The QDBusConnection for proxies constructed using this factory to use.
features  The features to make ready on constructed Accounts.
Returns:
An AccountFactoryPtr object pointing to the newly created AccountFactory object.
PendingReady * Tp::AccountFactory::proxy ( const QString busName,
const QString objectPath,
const ConnectionFactoryConstPtr &  connFactory,
const ChannelFactoryConstPtr &  chanFactory,
const ContactFactoryConstPtr &  contactFactory  
) const

Constructs an Account proxy and begins making it ready.

If a valid proxy already exists in the factory cache for the given combination of busName and objectPath, it is returned instead. All newly created proxies are automatically cached until they're either DBusProxy::invalidated() or the last reference to them outside the factory has been dropped.

The proxy can be accessed immediately after this function returns using PendingReady::proxy(). The ready operation only finishes, however, when the features specified by features(), if any, are made ready as much as possible. If the service doesn't support a given feature, they won't obviously be ready even if the operation finished successfully, as is the case for Account::becomeReady().

Parameters:
busName  The bus/service name of the D-Bus account object the proxy is constructed for. (Usually TP_QT4_ACCOUNT_MANAGER_BUS_NAME).
objectPath  The object path of the account.
connFactory  The connection factory to use for the Account.
chanFactory  The channel factory to use for the Account.
contactFactory  The channel factory to use for the Account.
Returns:
A PendingReady operation with the proxy in PendingReady::proxy().
AccountPtr Tp::AccountFactory::construct ( const QString busName,
const QString objectPath,
const ConnectionFactoryConstPtr &  connFactory,
const ChannelFactoryConstPtr &  chanFactory,
const ContactFactoryConstPtr &  contactFactory  
) const [protected, virtual]

Can be used by subclasses to override the Account subclass constructed by the factory.

This is automatically called by proxy() to construct proxy instances if no valid cached proxy is found.

The default implementation constructs Tp::Account objects.

Parameters:
busName  The bus/service name of the D-Bus account object the proxy is constructed for. (Usually TP_QT4_ACCOUNT_MANAGER_BUS_NAME).
objectPath  The object path of the account.
connFactory  The connection factory to use for the Account.
chanFactory  The channel factory to use for the Account.
contactFactory  The channel factory to use for the Account.
Returns:
A pointer to the constructed Account object.
QString Tp::AccountFactory::finalBusNameFrom ( const QString uniqueOrWellKnown  )  const [protected, virtual]

Identity transform, as is appropriate for Account objects.

Parameters:
uniqueOrWellKnown  The name to transform.
Returns:
uniqueOrWellKnown

Implements Tp::DBusProxyFactory.


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt4 0.6.5