Account

Since: BlackBerry 10.0.0

#include <bb/pim/account/Account>

To link against this class, add the following line to your .pro file: LIBS += -lbbpim

An Account.

This class represents an Account record.


Overview

Public Types Index

enum KeyValue

InvalidKey = -1

Public Functions Index

Account ()
Account (const Provider &provider)
Account (const Account &other)
~Account ()
QVariantcapabilitiesProperty (const QString &key, Property::Field property=Property::Value) const
QStringdisplayName () const
QStringexternalSetupInvokeTarget () const
AccountKeyid () const
Property::EnterpriseTypeisEnterprise () const
boolisExternalData () const
ResultisReadyForCreation () const
boolisServiceAccessReadOnly (Service::Type service) const
boolisServiceSupported (Service::Type service) const
boolisSocial () const
boolisValid () const
boolisValidSet () const
Account &operator= (const Account &other)
Providerprovider () const
QVariantMaprawData () const
voidsetCapabilitiesValue (const QString &key, const QVariant &fvalue)
voidsetDisplayName (const QString &displayName)
voidsetExternalData (bool externalData)
voidsetExternalEnterprise (Property::EnterpriseType enterprise)
voidsetExternalSetupInvokeTarget (QString const &target)
voidsetServiceSupported (Service::Type service, bool serviceSupported)
voidsetSettingsValue (const QString &key, const QVariant &fvalue)
QVariantsettingsProperty (const QString &key, Property::Field property=Property::Value) const
QStringvalidSetError () const

Protected Functions Index

voidsetEnterprise (Property::EnterpriseType enterprise)
voidsetId (AccountKey id)
voidsetProvider (const Provider &provider)
voidsetRawData (const QVariantMap &rawData)
voidsetServiceAccessReadOnly (Service::Type service, bool serviceAccessReadOnly)
voidsetSocial (bool social)
voidsetValid (bool valid)

Public Types

KeyValue

Predefined AccountKey value.

Since:

BlackBerry 10.0.0

InvalidKey = -1

Specifies an invalid AccountKey.

Since:

BlackBerry 10.0.0

Public Functions

Account ()

Default constructor meant to be used as a utility constructor for assignment operations.

Using this constructor to build an Account object will result in an Account object that is invalid. In other words, calling isValid() on the created object will return false. This constructor is used to create an empty Account object for the purposes of assigning another valid Account object to it.

Since:

BlackBerry 10.0.0

Account (

Creates a new Account object.

Using this constructor to build an Account object will result in an Account object with all properties set to the defaults, as defined by the provider. This Account object can be used directly in a call to the AccountService::createAccount() function. Note: A call to the isValid() function for the Account object will still return false as this account is not created until a call to the AccountService::createAccount() function is made.

Parameters
provider

The provider whose default properties are used to create the object.

Since:

BlackBerry 10.0.0

Account (

Creates a copy of an existing Account object.

Parameters
other

The Account object to be copied.

Since:

BlackBerry 10.0.0

~Account ()

Destructor.

Since:

BlackBerry 10.0.0

QVariant capabilitiesProperty (

Accessor for the Account object's capabilities map.

Provides access to the capabilities map field contained in the entry key. If the field is not found, it checks in the provider's map. If the field is not found in the provider's map, it will return QVariant::Invalid.

Parameters
key

The key used to search the capabilities map in order to obtain the capabilities map entry. The keys that are considered valid depend on the associated provider. Use the Provider::capabilitiesKeys() function to obtain a list of keys.

property

The key used to search the capabilities map entry in order to obtain the field to be returned.

Return:

Returns the Account object's capabilities field requested. If the capabilities field is not found, it will return QVariant::Invalid.

Since:

BlackBerry 10.0.0

QString displayName ()

Represents the Account object's displayName property.

Provides access to the Account object's displayName property.

Return:

Returns a QString containing the Account object's displayName property.

Since:

BlackBerry 10.0.0

QString externalSetupInvokeTarget ()

For external Provider accounts, returns the Invocation Target for the Account setup card.

Return:

Returns a QString containing the invocation target for the Account setup card for external Provider accounts. For normal accounts returns an empty QString.

Since:

BlackBerry 10.2.0

AccountKey id ()

Represents the Account object's id property.

Provides access to the Account object's id property.

Return:

Returns the value of the Account object's id property.

Since:

BlackBerry 10.0.0

Property::EnterpriseType isEnterprise ()

Determines the Account object's enterprise account type.

Returns whether this is an enterprise account. Note: The value of Property::EnterpriseUnknown for Property::EnterpriseType is not currently used and, as such, applications should not need to add any code to check for this case.

Return:

Returns the Property::EnterpriseType of the Account object.

Since:

BlackBerry 10.0.0

bool isExternalData ()

Determines if the Account object's stores its data externally.

Return:

Returns true if the Account object stores its data externally, and false otherwise.

Since:

BlackBerry 10.2.0

Result isReadyForCreation ()

Object correctness with regards to account creation.

Determines whether or not creating an account with the current Account object is possible. In other words, if all required fields are present and valid. Note: This function is called by the function AccountService::createAccount.

Return:

Returns a Result object with its success property set to true, when enough information is available in the Account object to successfully create an account. When enough information to successfully create an account is not available in the Account object or the information available is not properly set, this function returns a Result object with its success property set to false, and its message property set to the issues that need to be resolved in the Account object so that account creation is possible with this Account object.

Since:

BlackBerry 10.0.0

bool isServiceAccessReadOnly (

Accessor for read-only capability of service.

Returns whether the service is read-only for the account. If it's not, it implies the service is read-write. Note that the outcome of this function is useless if the service is not supported. The latter can be obtained by calling the Account::isServiceSupported() function with service as argument.

Parameters
service

The service for which we seek the read-only capability from for this Account object. Possible values are listed in the Service::Type enumeration.

Return:

Returns true if service is read-only for the Account object, and false otherwise.

Since:

BlackBerry 10.0.0

bool isServiceSupported (

Accessor for support capability of service.

Returns whether the service is supported for the account. A supported service implies the account will continuously synchronize all data for that service.

Parameters
service

The service for which we seek the supported capability from for this Account object. Possible values are listed in the Service::Type enumeration.

Return:

Returns true if service is supported for the Account object, and false otherwise.

Since:

BlackBerry 10.0.0

bool isSocial ()

Determines if the Account object is a social account.

Return:

Returns true if the Account object is a social account, and false otherwise.

Since:

BlackBerry 10.0.0

bool isValid ()

Object correctness.

Determines whether or not the Account object returned from AccountService function calls has acceptable attribute values.

Return:

Returns true if the Account object is valid, and false otherwise.

Since:

BlackBerry 10.0.0

bool isValidSet ()

Setter correctness.

Determines whether or not the previous Account object set operation succeeded or failed. Note: If the previous set operation failed, the Account object will not incorporate the result for that previous set operation, leaving the Account object in the same state as before the previous set operation was called.

Return:

Returns true if previous set operation succeeded, and false otherwise.

Since:

BlackBerry 10.0.0

Account & operator= (

Copies the data of an existing Account object to this object.

Parameters
other

The Account object to be copied.

Return:

The Account instance.

Since:

BlackBerry 10.0.0

Provider provider ()

Represents the Account object's Provider object.

Provides access to the Account object's Provider object.

Return:

Returns the Provider object associated with the Account object.

Since:

BlackBerry 10.0.0

QVariantMap rawData ()

Represents the Account object's raw data.

Provides access to the Account object's raw data.

Return:

Returns a QVariantMap containing the Account object's raw data.

Since:

BlackBerry 10.0.0

void setCapabilitiesValue (

Set function for the Account object's capabilities map.

Assigns the value of the fvalue parameter to the Account object's capabilities map using a key value pair, if and only if the following conditions are met: (1) The key must exist in the associated provider. (2) The data type of fvalue must match the data type of the account field where it is being assigned.

If one of the above conditions is not met, the value of the capabilities map will not be changed. In this case, a call to the isValidSet() function will return false and a call to the validSetError() function will indicate this particular error.

Parameters
key

The key used to search the capabilities map in order to obtain the capabilities map entry to be changed. The key types that are considered valid depend on the associated provider. Use the Provider::capabilitiesKeys() function to obtain a list of keys.

fvalue

The value to set into the capabilities map entry.

Since:

BlackBerry 10.0.0

void setDisplayName (

Set function for Account object's displayName property.

Assigns the value displayName to the Account object's displayName property.

Parameters
displayName

The value to assign to Account object's displayName property.

Since:

BlackBerry 10.0.0

void setExternalData (
  • boolexternalData)

Set function for Account object's external data property.

Assigns the value externalData to the Account object's external data property. An Account would set this true if they did not want any PIM data ( beyond account meta data ) stored within the PIM database store for the account. Could be the account has no data OR it is stored and managed externally. Calling this method is ONLY allowed when Provider is "external"; for other Providers the isValidSet() returns false with an appropriate validSetError() message .

Parameters
externalData

The value to assign to Account object's external data property. The default value is False for this property.

Since:

BlackBerry 10.2.0

void setExternalEnterprise (

Set function for external Account object's enterprise value.

Assigns the value enterprise to the Account object's enterprise value. A caller would set this if the account is External, and it is an enterprise only account Calling this method is ONLY allowed when Provider is "external"; for other Providers the isValidSet() returns false with an appropriate validSetError() message. Also, an AccountPermissionError exception is raised when this method is called by a caller who does not have enterprise permissions.

Parameters
enterprise

The value to assign to external Account object's enterprise value. The default value is NonEnterprise for external accounts.

Since:

BlackBerry 10.2.0

void setExternalSetupInvokeTarget (

Set function for Account object's external invoke target property.

Assigns the value target to the Account object's external Invoke Target property. An Account would set this if the account is External, and it has a Account Setup Card to be invoked upon account creation or editting. Calling this method is ONLY allowed when Provider is "external"; for other Providers the isValidSet() returns false with an appropriate validSetError() message .

Parameters
target

The value to assign to Account object's external Invoke Target property. The default value is empty for this property.

Since:

BlackBerry 10.2.0

void setServiceSupported (

Set function for support capability of service.

Assigns the value of serviceSupported to the account's support capability for service. If serviceSupported is true, it implies service is supported. A supported service implies the account will continuously synchronize all data for that service. To turn on synchronization for a specific service, you need to set the support capability of the service to true by calling this function and then by calling the AccountService::updateAccount() function (or the AccountService::createAccount() function for initial creation).

Note: Attempting to set the support capability of a service for an account whose provider does not support the service will result in a failed set operation. In this case, a call to the isValidSet() function will return false and a call to validSetError() will indicate this particular error.

Parameters
service

The service for which we are setting the support capability.

serviceSupported

The value to set.

Since:

BlackBerry 10.0.0

void setSettingsValue (

Set function for the Account object's settings map.

Assigns the value of the fvalue parameter to the Account object's settings map using a key value pair, if and only if the following conditions are met: (1) The key must exist in the associated provider. (2) The data type of fvalue must match the data type of the account field where it is being assigned.

If one of the above conditions is not met, the value of the settings map will not be changed. In this case, a call to the isValidSet() function will return false and a call to the validSetError() function will indicate this particular error.

Parameters
key

The key used to search the settings map in order to obtain the settings map entry to be changed. The keys that are considered valid depend on the associated provider. Use the Provider::settingsKeys() function to obtain a list of keys.

fvalue

The value to set into the settings map entry.

Since:

BlackBerry 10.0.0

QVariant settingsProperty (

Accessor for the Account object's settings map.

Provides access to the settings map field contained in the entry key. If the field is not found, it checks in the provider's map. If the field is not found in the provider's map, it will return QVariant::Invalid.

Parameters
key

The key used to search the settings map in order to obtain the settings map entry. The keys that are considered valid depend on the associated provider. Use the Provider::settingsKeys() function to obtain a list of keys.

property

The key used to search the settings map entry in order to obtain the field to be returned.

Return:

Returns the Account object's settings field requested. If the settings field is not found, it will return QVariant::Invalid.

Since:

BlackBerry 10.0.0

QString validSetError ()

Accessor for the setter correctness error.

Provides access to the error message corresponding to the previous setter operation. Error messages are only generated from failed set operations. Calling this function when the set operation succeeds will result in an empty string being returned.

Return:

Returns the error message corresponding to the previous setter operation if that operation failed, and an empty string otherwise.

Since:

BlackBerry 10.0.0

Protected Functions

void setEnterprise (

Set function for Account object's enterprise property.

Assigns the value of enterprise to the Account object's enterprise property.

Parameters
enterprise

The value to set.

Since:

BlackBerry 10.0.0

void setId (
  • AccountKeyid)

Set function for Account object's id property.

Assigns the value id to the Account object's id property.

Parameters
id

The value to assign to Account object's id property.

Since:

BlackBerry 10.0.0

void setProvider (

Set function for Account object's associated Provider object.

Assigns the value of provider to the Account object's associated Provider object. By doing this, the Account object inherits all its properties from the associated Provider object.

Parameters
provider

The value to set.

Since:

BlackBerry 10.0.0

void setRawData (

Set function for Account object's raw data.

Assigns the value of rawData to the Account object's raw data.

Parameters
rawData

The value to set.

Since:

BlackBerry 10.0.0

void setServiceAccessReadOnly (

Set function for read-only capability of service.

Assigns the value of serviceAccessReadOnly to the account's read-only capability for service. If serviceAccessReadOnly is true, it implies service is read-only.

Parameters
service

The service for which we are setting the read-only capability. Possible values are listed in the Service::Type enumeration.

serviceAccessReadOnly

The value to set.

Since:

BlackBerry 10.0.0

void setSocial (
  • boolsocial)

Set function for Account object's social property.

Assigns the value of social to the Account object's social property.

Parameters
social

The value to set.

Since:

BlackBerry 10.0.0

void setValid (
  • boolvalid)

Set function for Account object's state of correctness.

Assigns the value of valid to the object's state of correctness.

Parameters
valid

The value to set.

Since:

BlackBerry 10.0.0

Last modified: 2014-03-13

comments powered by Disqus