Telepathy::Client::Account Class Reference
[Account and Account Manager proxies]

#include <TelepathyQt4/Client/Account>

Inheritance diagram for Telepathy::Client::Account:

Inheritance graph
[legend]
Collaboration diagram for Telepathy::Client::Account:

Collaboration graph
[legend]

List of all members.

Public Types

enum  Feature { FeatureCore = 0, FeatureAvatar = 1, FeatureProtocolInfo = 2, _Padding = 0xFFFFFFFF }

Signals

void displayNameChanged (const QString &)
void iconChanged (const QString &)
void nicknameChanged (const QString &)
void normalizedNameChanged (const QString &)
void validityChanged (bool)
void stateChanged (bool)
void connectsAutomaticallyPropertyChanged (bool)
void parametersChanged (const QVariantMap &)
void automaticPresenceChanged (const Telepathy::SimplePresence &) const
void currentPresenceChanged (const Telepathy::SimplePresence &) const
void requestedPresenceChanged (const Telepathy::SimplePresence &) const
void avatarChanged (const Telepathy::Avatar &)
void connectionStatusChanged (Telepathy::ConnectionStatus, Telepathy::ConnectionStatusReason)
void haveConnectionChanged (bool haveConnection)

Public Member Functions

 Account (AccountManager *am, const QString &objectPath, QObject *parent=0)
virtual ~Account ()
AccountManagermanager () const
bool isValidAccount () const
bool isEnabled () const
PendingOperationsetEnabled (bool value)
QString cmName () const
QString protocol () const
QString displayName () const
PendingOperationsetDisplayName (const QString &value)
QString icon () const
PendingOperationsetIcon (const QString &value)
QString nickname () const
PendingOperationsetNickname (const QString &value)
const Telepathy::Avataravatar () const
PendingOperationsetAvatar (const Telepathy::Avatar &avatar)
QVariantMap parameters () const
PendingOperationupdateParameters (const QVariantMap &set, const QStringList &unset)
ProtocolInfoprotocolInfo () const
bool connectsAutomatically () const
PendingOperationsetConnectsAutomatically (bool value)
Telepathy::ConnectionStatus connectionStatus () const
Telepathy::ConnectionStatusReason connectionStatusReason () const
bool haveConnection () const
QSharedPointer< Connectionconnection () const
Telepathy::SimplePresence automaticPresence () const
PendingOperationsetAutomaticPresence (const Telepathy::SimplePresence &value)
Telepathy::SimplePresence currentPresence () const
Telepathy::SimplePresence requestedPresence () const
PendingOperationsetRequestedPresence (const Telepathy::SimplePresence &value)
QString uniqueIdentifier () const
QString connectionObjectPath () const
QString normalizedName () const
PendingOperationremove ()
bool isReady (const QSet< uint > &features=QSet< uint >()) const
PendingReadybecomeReady (const QSet< uint > &requestedFeatures=QSet< uint >())
QSet< uint > requestedFeatures () const
QSet< uint > actualFeatures () const
QSet< uint > missingFeatures () const
QStringList interfaces () const
template<class Interface >
Interface * optionalInterface (InterfaceSupportedChecking check=CheckInterfaceSupported) const
DBus::PropertiesInterfacepropertiesInterface () const
AccountInterfaceAvatarInterfaceavatarInterface (InterfaceSupportedChecking check=CheckInterfaceSupported) const

Protected Member Functions

AccountInterfacebaseInterface () const

Friends

struct Private


Detailed Description

Object representing a Telepathy account.

If the Telepathy account is deleted from the AccountManager, this object will not be deleted automatically; however, it will emit invalidated() and will cease to be useful.


Member Enumeration Documentation

Enumerator:
FeatureCore 
FeatureAvatar 
FeatureProtocolInfo 
_Padding 


Constructor & Destructor Documentation

Telepathy::Client::Account::Account ( AccountManager am,
const QString &  objectPath,
QObject *  parent = 0 
)

Construct a new Account object.

Parameters:
am Account manager.
objectPath Account object path.
parent Object parent.

Telepathy::Client::Account::~Account (  )  [virtual]

Class destructor.


Member Function Documentation

QSet< uint > Telepathy::Client::Account::actualFeatures (  )  const

Telepathy::SimplePresence Telepathy::Client::Account::automaticPresence (  )  const

Set the presence status that this account should have if it is brought online.

Returns:
Presence status that will be set when this account is put online.

void Telepathy::Client::Account::automaticPresenceChanged ( const Telepathy::SimplePresence  )  const [signal]

const Telepathy::Avatar & Telepathy::Client::Account::avatar (  )  const

Get this account avatar.

Note that in order to make this method works you should call Account::becomeReady(FeatureAvatar) and wait for it to finish successfully.

Returns:
Account avatar.

References FeatureAvatar, isReady(), and Telepathy::warning().

void Telepathy::Client::Account::avatarChanged ( const Telepathy::Avatar  )  [signal]

AccountInterfaceAvatarInterface * Telepathy::Client::Account::avatarInterface ( InterfaceSupportedChecking  check = CheckInterfaceSupported  )  const [inline]

Convenience function for getting a Avatar interface proxy.

AccountInterface * Telepathy::Client::Account::baseInterface (  )  const [protected]

Get the AccountInterface for this Account. This method is protected since the convenience methods provided by this class should generally be used instead of calling D-Bus methods directly.

Returns:
A pointer to the existing AccountInterface for this Account.

Referenced by remove(), and updateParameters().

PendingReady * Telepathy::Client::Account::becomeReady ( const QSet< uint > &  requestedFeatures = QSet<uint>()  ) 

Return a pending ready account which will succeed when this object finishes its initial setup, or will fail if a fatal error occurs during this initial setup.

If an empty set is used FeatureCore will be considered as the requested feature.

Parameters:
requestedFeatures The features which should be enabled.
Returns:
A PendingReady object which will emit finished when this object has finished or failed its initial setup.

QString Telepathy::Client::Account::cmName (  )  const

Get this account connection manager name.

Returns:
Account connection manager name.

QSharedPointer< Connection > Telepathy::Client::Account::connection (  )  const

Get the Connection object for this account.

Note that the Connection object won't be cached by account, and should be done by the application itself.

Remember to call Connection::becomeReady on the new connection, to make sure it is ready before using it.

Returns:
Connection object, or 0 if an error occurred.

References Telepathy::Client::DBusProxy::dbusConnection(), and Telepathy::Client::DBusProxy::objectPath().

QString Telepathy::Client::Account::connectionObjectPath (  )  const

Get the connection object path of this account.

Returns:
Account connection object path.

Telepathy::ConnectionStatus Telepathy::Client::Account::connectionStatus (  )  const

Get the connection status of this account.

Returns:
Value indication the status of this account conneciton.

void Telepathy::Client::Account::connectionStatusChanged ( Telepathy::ConnectionStatus  ,
Telepathy::ConnectionStatusReason   
) [signal]

Telepathy::ConnectionStatusReason Telepathy::Client::Account::connectionStatusReason (  )  const

Get the connection status reason of this account.

Returns:
Value indication the status reason of this account conneciton.

bool Telepathy::Client::Account::connectsAutomatically (  )  const

Get whether this account should be put online automatically whenever possible.

Returns:
true if it should try to connect automatically, false otherwise.

void Telepathy::Client::Account::connectsAutomaticallyPropertyChanged ( bool   )  [signal]

Telepathy::SimplePresence Telepathy::Client::Account::currentPresence (  )  const

Get the actual presence of this account.

Returns:
The actual presence of this account.
See also:
requestedPresence(), automaticPresence()

void Telepathy::Client::Account::currentPresenceChanged ( const Telepathy::SimplePresence  )  const [signal]

QString Telepathy::Client::Account::displayName (  )  const

Get this account display name.

Returns:
Account display name.

void Telepathy::Client::Account::displayNameChanged ( const QString &   )  [signal]

bool Telepathy::Client::Account::haveConnection (  )  const

Return whether this account have a connection object that can be retrieved using connection().

Returns:
true if a connection object can be retrieved, false otherwise

void Telepathy::Client::Account::haveConnectionChanged ( bool  haveConnection  )  [signal]

QString Telepathy::Client::Account::icon (  )  const

Get this account icon name.

Returns:
Account icon name.

void Telepathy::Client::Account::iconChanged ( const QString &   )  [signal]

QStringList Telepathy::Client::Account::interfaces (  )  const

Referenced by optionalInterface().

bool Telepathy::Client::Account::isEnabled (  )  const

Get whether this account is enabled.

Gives the users the possibility to prevent an account from being used. This flag does not change the validity of the account.

Returns:
true if the account is enabled, false otherwise.

bool Telepathy::Client::Account::isReady ( const QSet< uint > &  features = QSet<uint>()  )  const

Return whether this object has finished its initial setup.

This is mostly useful as a sanity check, in code that shouldn't be run until the object is ready. To wait for the object to be ready, call becomeReady() and connect to the finished signal on the result.

Parameters:
features The features which should be tested
Returns:
true if the object has finished its initial setup for basic functionality plus the given features

Referenced by avatar(), and protocolInfo().

bool Telepathy::Client::Account::isValidAccount (  )  const

Get whether this is a valid account.

If true, this account is considered by the account manager to be complete and usable. If false, user action is required to make it usable, and it will never attempt to connect (for instance, this might be caused by the absence of a required parameter).

Returns:
true if the account is valid, false otherwise.

AccountManager * Telepathy::Client::Account::manager (  )  const

Get the AccountManager from which this Account was created.

Returns:
A pointer to the AccountManager object that owns this Account.

QSet< uint > Telepathy::Client::Account::missingFeatures (  )  const

QString Telepathy::Client::Account::nickname (  )  const

Get this account nickname.

Returns:
Account nickname.

void Telepathy::Client::Account::nicknameChanged ( const QString &   )  [signal]

QString Telepathy::Client::Account::normalizedName (  )  const

void Telepathy::Client::Account::normalizedNameChanged ( const QString &   )  [signal]

template<class Interface >
Telepathy::Client::Account::optionalInterface ( InterfaceSupportedChecking  check = CheckInterfaceSupported  )  const [inline]

Get a pointer to a valid instance of a given Account optional interface class, associated with the same remote object the Account is associated with, and destroyed at the same time the Account is destroyed.

If the list returned by interfaces() doesn't contain the name of the interface requested 0 is returned. This check can be bypassed by specifying BypassInterfaceCheck for check, in which case a valid instance is always returned.

If the object is not ready, the list returned by interfaces() isn't guaranteed to yet represent the full set of interfaces supported by the remote object. Hence the check might fail even if the remote object actually supports the requested interface; using BypassInterfaceCheck is suggested when the Account is not suitably ready.

See also:
OptionalInterfaceFactory::interface
Template Parameters:
Interface Class of the optional interface to get.
Parameters:
check Should an instance be returned even if it can't be determined that the remote object supports the requested interface.
Returns:
Pointer to an instance of the interface class, or 0.

References interfaces().

QVariantMap Telepathy::Client::Account::parameters (  )  const

Get this account parameters.

Returns:
Account parameters.

void Telepathy::Client::Account::parametersChanged ( const QVariantMap &   )  [signal]

DBus::propertiesInterface * Telepathy::Client::Account::propertiesInterface (  )  const [inline]

Convenience function for getting a Properties interface proxy. The Account interface relies on properties, so this interface is always assumed to be present.

References Telepathy::Client::DBusProxy::BypassInterfaceCheck.

Referenced by setAutomaticPresence(), setAvatar(), setConnectsAutomatically(), setDisplayName(), setEnabled(), setIcon(), setNickname(), and setRequestedPresence().

QString Telepathy::Client::Account::protocol (  )  const

Get this account protocol name.

Returns:
Account protocol name.

ProtocolInfo * Telepathy::Client::Account::protocolInfo (  )  const

Get the protocol info for this account protocol.

Note that in order to make this method works you should call Account::becomeReady(FeatureProtocolInfo) and wait for it to finish successfully.

Returns:
ProtocolInfo for this account protocol.

References FeatureProtocolInfo, isReady(), and Telepathy::warning().

PendingOperation * Telepathy::Client::Account::remove (  ) 

Delete this account.

Returns:
A PendingOperation which will emit PendingOperation::finished when the call has finished.

References baseInterface().

QSet< uint > Telepathy::Client::Account::requestedFeatures (  )  const

Telepathy::SimplePresence Telepathy::Client::Account::requestedPresence (  )  const

Get the requested presence of this account.

When this is changed, the account manager should attempt to manipulate the connection manager to make CurrentPresence match RequestedPresence as closely as possible.

Returns:
The requested presence of this account.
See also:
currentPresence(), automaticPresence()

void Telepathy::Client::Account::requestedPresenceChanged ( const Telepathy::SimplePresence  )  const [signal]

PendingOperation * Telepathy::Client::Account::setAutomaticPresence ( const Telepathy::SimplePresence value  ) 

Set the presence status that this account should have if it is brought online.

Parameters:
value Presence status to set when this account is put online.
Returns:
A PendingOperation which will emit PendingOperation::finished when the call has finished.
See also:
setRequestedPresence()

References propertiesInterface(), and TELEPATHY_INTERFACE_ACCOUNT.

PendingOperation * Telepathy::Client::Account::setAvatar ( const Telepathy::Avatar avatar  ) 

Set this account avatar.

Parameters:
avatar The avatar's MIME type and data.
Returns:
A PendingOperation which will emit PendingOperation::finished when the call has finished.

References propertiesInterface(), TELEPATHY_ERROR_NOT_IMPLEMENTED, and TELEPATHY_INTERFACE_ACCOUNT_INTERFACE_AVATAR.

PendingOperation * Telepathy::Client::Account::setConnectsAutomatically ( bool  value  ) 

Set whether this account should be put online automatically whenever possible.

Parameters:
value Value indicating if this account should be put online whenever possible.
Returns:
A PendingOperation which will emit PendingOperation::finished when the call has finished.

References propertiesInterface(), and TELEPATHY_INTERFACE_ACCOUNT.

PendingOperation * Telepathy::Client::Account::setDisplayName ( const QString &  value  ) 

Set this account display name.

Parameters:
value Account display name.
Returns:
A PendingOperation which will emit PendingOperation::finished when the call has finished.

References propertiesInterface(), and TELEPATHY_INTERFACE_ACCOUNT.

PendingOperation * Telepathy::Client::Account::setEnabled ( bool  value  ) 

Set whether this account is enabled.

Parameters:
value Whether this account should be enabled or disabled.
Returns:
A PendingOperation which will emit PendingOperation::finished when the call has finished.

References propertiesInterface(), and TELEPATHY_INTERFACE_ACCOUNT.

PendingOperation * Telepathy::Client::Account::setIcon ( const QString &  value  ) 

Set this account icon.

Parameters:
value Account icon name.
Returns:
A PendingOperation which will emit PendingOperation::finished when the call has finished.

References propertiesInterface(), and TELEPATHY_INTERFACE_ACCOUNT.

PendingOperation * Telepathy::Client::Account::setNickname ( const QString &  value  ) 

Set the account nickname.

Parameters:
value Account nickname.
Returns:
A PendingOperation which will emit PendingOperation::finished when the call has finished.

References propertiesInterface(), and TELEPATHY_INTERFACE_ACCOUNT.

PendingOperation * Telepathy::Client::Account::setRequestedPresence ( const Telepathy::SimplePresence value  ) 

Set the requested presence.

Parameters:
value The requested presence.
Returns:
A PendingOperation which will emit PendingOperation::finished when the call has finished.
See also:
setAutomaticPresence()

References propertiesInterface(), and TELEPATHY_INTERFACE_ACCOUNT.

void Telepathy::Client::Account::stateChanged ( bool   )  [signal]

QString Telepathy::Client::Account::uniqueIdentifier (  )  const

Get the unique identifier for this account.

This identifier should be unique per AccountManager implementation, i.e. at least per QDBusConnection.

Returns:
Account unique identifier.

References Telepathy::Client::DBusProxy::objectPath().

PendingOperation * Telepathy::Client::Account::updateParameters ( const QVariantMap &  set,
const QStringList &  unset 
)

Update this account parameters.

Parameters:
set Parameters to set.
unset Parameters to unset.
Returns:
A PendingOperation which will emit PendingOperation::finished when the call has finished.

References baseInterface().

void Telepathy::Client::Account::validityChanged ( bool   )  [signal]


Friends And Related Function Documentation

friend struct Private [friend]


Generated on Thu Mar 5 18:52:04 2009 for TelepathyQt4-0.1.1 by  doxygen 1.5.8