ContactAttribute
Since: BlackBerry 10.0.0
#include <bb/pim/contacts/ContactAttribute>
To link against this class, add the following line to your .pro file: LIBS += -lbbpim
The ContactAttribute class represents a property of a Contact.
A ContactAttribute is a single piece of information about a Contact, such as a phone number or email address. A ContactAttribute has a kind, which specifies high-level metadata about the attribute. Kinds of attributes are represented by the AttributeKind::Type enumeration and include email, phone number, name, and so on. A ContactAttribute also has a sub-kind, which specifies additional, more granular metadata about the attribute. Sub-kinds are represented by the AttributeSubKind::Type enumeration and include values such as Work (for emails), Home (for phone numbers), and so on.
There is no limit to the number of attributes a Contact can have. You specify the values for a ContactAttribute by using a ContactAttributeBuilder.
Overview
Public Functions Index
ContactAttribute () | |
ContactAttribute (const ContactAttribute ©) | |
~ContactAttribute () | |
QString | attributeDisplayLabel () const |
ContactAttributeBuilder | edit () |
QString | groupKey () const |
int | id () const |
bool | isEnhancement () const |
bool | isPrimaryAttribute () const |
bool | isValid () const |
AttributeKind::Type | kind () const |
QString | label () const |
QUrl | launchUrl () const |
bool | operator!= (const ContactAttribute &operand) const |
ContactAttribute & | operator= (const ContactAttribute &operand) |
bool | operator== (const ContactAttribute &operand) const |
QList< AccountId > | sources () const |
AttributeSubKind::Type | subKind () const |
QString | value () const |
QDateTime | valueAsDateTime () const |
Static Public Functions Index
QString | determineAttributeDisplayLabel (AttributeKind::Type kind, AttributeSubKind::Type subkind, QString label) |
Public Functions
Copy constructor.
This function constructs a ContactAttribute containing exactly the same values as the provided ContactAttribute.
Parameters | |
---|---|
copy |
The ContactAttribute to be copied. |
BlackBerry 10.0.0
Destructor.
BlackBerry 10.0.0
QString
Retrieves the localized display label of this ContactAttribute.
If you've set a custom label for the attribute using ContactAttributeBuilder::setLabel(), then this function returns that label. If there isn't a label for the kind/sub-kind combination, then this function returns an empty QString.
The localized display label of this ContactAttribute, or an empty QString if there isn't a label for the kind/sub-kind combination.
BlackBerry 10.0.0
ContactAttributeBuilder
Edits the contents of this ContactAttribute.
This function returns a ContactAttributeBuilder that you can use to change the values of this ContactAttribute.
A ContactAttributeBuilder that you can use to change the values of this ContactAttribute.
BlackBerry 10.0.0
QString
Retrieves the group key of this ContactAttribute.
The group key is designed to group different types of attributes together. For example, consider a set of attributes that describe an employee. This set might contain different attributes for the company name, the employee's start date, and the employee's salary. If these attributes all share the same group key, then they can be seen as belonging together to make up a meaningful set of data.
The group key of this ContactAttribute.
BlackBerry 10.0.0
int
Retrieves the ID of this ContactAttribute.
The ID uniquely identifies a ContactAttribute in a particular source account. The ID is assigned automatically by the database when a ContactAttribute is persisted using the ContactService. You can't set the ID of a ContactAttribute manually.
The ID of this ContactAttribute.
BlackBerry 10.0.0
bool
Attribute is a contact enhancement.
This attribute is an enhancement discovered through cloud services.
true if this ContactAttribute is an enhancement, false otherwise.
BlackBerry 10.0.0
bool
Indicates whether this ContactAttribute is a primary attribute.
An attribute can be a primary attribute only if its kind is either Name or OrganizationAffiliation. When a contact has more than one source provider, the contact might have multiple first names, last names, and company names. The system selects one first name as the primary attribute to make UI display choices easier.
true if this ContactAttribute is a primary attribute, false otherwise.
BlackBerry 10.0.0
bool
Indicates whether this ContactAttribute is valid.
For a ContactAttribute to be considered valid, it must contain at least a valid kind, valid sub-kind, and non-empty value.
true if this ContactAttribute is valid, false otherwise.
BlackBerry 10.0.0
AttributeKind::Type
Retrieves the kind of this ContactAttribute.
The kind specifies metadata about the type of an attribute. The kind is represented by the AttributeKind::Type enumeration and can be values such as Name, Email, Phone, and so on.
QString
Retrieves the label of this ContactAttribute.
You can use this value as a custom label for the ContactAttribute, if needed.
The label of this ContactAttribute.
BlackBerry 10.0.0
QUrl
Retrieves the URL that's associated with this ContactAttribute.
You can think of this property as a hyperlink that points to related information about the attribute.
The URL that's associated with this ContactAttribute.
BlackBerry 10.0.0
bool
Inequality operator.
This operator determines if this ContactAttribute has any different values from another ContactAttribute.
Parameters | |
---|---|
operand |
The ContactAttribute from which to compare. |
true if any of the values are not considered equal, false otherwise.
BlackBerry 10.0.0
ContactAttribute &
Assignment operator.
This operator copies all values from the provided ContactAttribute into this ContactAttribute.
Parameters | |
---|---|
operand |
The ContactAttribute from which to copy all values. |
A ContactAttribute with all copied data
BlackBerry 10.0.0
bool
Equality operator.
This operator determines if this ContactAttribute has the same values as another ContactAttribute.
Parameters | |
---|---|
operand |
The ContactAttribute from which to compare. |
true if the values are considered equal, false otherwise.
BlackBerry 10.0.0
QList< AccountId >
Retrieves a list of account IDs for this ContactAttribute.
This function retrieves a list of all accounts that use this ContactAttribute.
A list of account IDs for this ContactAttribute.
BlackBerry 10.0.0
AttributeSubKind::Type
Retrieves the sub-kind of this ContactAttribute.
Similar to the kind of an attribute, the sub-kind refers to a sub-type of an attribute. The sub-kind is represented by the AttributeSubKind::Type enumeration. For example, if the kind of attribute is a phone number, then possible sub-kinds might be Work, Home, and so on. By using combinations of kinds and sub-kinds, you can specify a wide range of attributes for contacts.
QString
Retrieves the string value of this ContactAttribute.
The string value of this ContactAttribute.
BlackBerry 10.0.0
QDateTime
Retrieves the value of this ContactAttribute as a date/time value.
If this ContactAttribute can't be represented as a date/time value, then an invalid QDateTime is returned.
The value of this ContactAttribute as a date/time value, or an invalid QDateTime if this ContactAttribute can't be represented as a date/time value.
BlackBerry 10.0.0
Static Public Functions
QString
Retrieves the localized display label of this ContactAttribute, based on the provided kind, sub-kind, and label, to use to display the ContactAttribute.
This function is similar to attributeDisplayLabel(), but tries to find a displayable label based on the provided kind, sub-kind, and label, instead of those of this ContactAttribute. This function tries to find a displayable label for the ContactAttribute for UI display purposes. If none is returned, then it's up to the caller to find a proper display label to use.
Parameters | |
---|---|
kind |
The attribute kind. |
subkind |
The attribute sub-kind. |
label |
The default label value. This value is returned if the label parameter is not empty. |
A localized display label if one is found, or an empty QString if one is not found.
BlackBerry 10.0.0