Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QContact Class Reference

The QContact class provides an addressbook contact. More...

    #include <QContact>

Public Functions

QContact ()
QContact ( const QContact & other )
~QContact ()
QList<QContactActionDescriptor> availableActions ( const QString & vendorName = QString(), int implementationVersion = -1 ) const
void clearDetails ()
QContactDetail detail ( const QString & definitionName ) const
T detail () const
QContactDetail detailWithAction ( const QString & actionName ) const
QList<QContactDetail> details ( const QString & definitionName = QString() ) const
QList<T> details () const
QList<T> details ( const QString & fieldName, const QString & value ) const
QList<QContactDetail> details ( const QString & definitionName, const QString & fieldName, const QString & value ) const
QList<QContactDetail> detailsWithAction ( const QString & actionName ) const
QString displayLabel () const
QContactId id () const
bool isEmpty () const
bool isPreferredDetail ( const QString & actionName, const QContactDetail & detail ) const
QContactLocalId localId () const
QContactDetail preferredDetail ( const QString & actionName ) const
QList<QContactId> relatedContacts ( const QString & relationshipType = QString(), QContactRelationshipFilter::Role role = QContactRelationshipFilter::Either ) const
QList<QContactRelationship> relationshipOrder () const
QList<QContactRelationship> relationships ( const QString & relationshipType = QString() ) const
bool removeDetail ( QContactDetail * detail )
bool saveDetail ( QContactDetail * detail )
void setId ( const QContactId & id )
bool setPreferredDetail ( const QString & actionName, const QContactDetail & preferredDetail )
void setRelationshipOrder ( const QList<QContactRelationship> & reordered )
void setType ( const QString & type )
void setType ( const QContactType & type )
QString type () const
bool operator!= ( const QContact & other ) const
QContact & operator= ( const QContact & other )
bool operator== ( const QContact & other ) const

Detailed Description

The QContact class provides an addressbook contact.

A QContact consists of zero or more details.

An instance of the QContact class represents an in-memory contact, and may not reflect the state of that contact found in persistent storage until the appropriate synchronisation method is called on the QContactManager (i.e., saveContact, removeContact).

See also QContactManager and QContactDetail.


Member Function Documentation

QContact::QContact ()

Construct an empty contact.

QContact::QContact ( const QContact & other )

Initializes this QContact from other

QContact::~QContact ()

Frees the memory used by this QContact

QList<QContactActionDescriptor> QContact::availableActions ( const QString & vendorName = QString(), int implementationVersion = -1 ) const

Return a list of actions available to be performed on this contact which are offered by the vendor whose name is the given vendorName, where the action instance has the implementation version given by implementationVersion. If vendorName is empty, actions from any vendor are supplied; if implementationVersion is -1, action implementations of any version will be returned.

void QContact::clearDetails ()

Removes all details of the contact. This function does not modify the id or type of the contact. Calling isEmpty() after calling this function will return true.

QContactDetail QContact::detail ( const QString & definitionName ) const

Returns the first detail stored in the contact which is of the given definitionName

T QContact::detail () const

Returns the first detail of the template type

QContactDetail QContact::detailWithAction ( const QString & actionName ) const

Retrieve the first detail for which the given actionName is available

QList<QContactDetail> QContact::details ( const QString & definitionName = QString() ) const

Returns a list of details of the given definitionName

QList<T> QContact::details () const

Returns a list of details of the template type

QList<T> QContact::details ( const QString & fieldName, const QString & value ) const

Returns a list of details of the template type which match the fieldName and value criteria

QList<QContactDetail> QContact::details ( const QString & definitionName, const QString & fieldName, const QString & value ) const

Returns a list of details of the given definitionName, fieldName and field value

QList<QContactDetail> QContact::detailsWithAction ( const QString & actionName ) const

Retrieve any details for which the given actionName is available

QString QContact::displayLabel () const

Returns the read-only display label of this contact. A contact which has been retrieved from a manager will have a display label synthesized for it.

QContactId QContact::id () const

Returns the QContactId that identifies this contact

See also setId().

bool QContact::isEmpty () const

Returns true if this QContact is empty, false if not.

An empty QContact has an empty label and no extra details. The type of the contact is irrelevant.

bool QContact::isPreferredDetail ( const QString & actionName, const QContactDetail & detail ) const

Returns true if the given detail is a preferred detail for the given actionName, or for any action if the actionName is empty

QContactLocalId QContact::localId () const

Returns the QContactLocalId that identifies this contact within its manager

QContactDetail QContact::preferredDetail ( const QString & actionName ) const

Returns the preferred detail for a given actionName

See also setPreferredDetail().

QList<QContactId> QContact::relatedContacts ( const QString & relationshipType = QString(), QContactRelationshipFilter::Role role = QContactRelationshipFilter::Either ) const

Returns a list of ids of contacts which are related to this contact in a relationship of the given relationshipType, where those other contacts participate in the relationship in the given role

QList<QContactRelationship> QContact::relationshipOrder () const

Returns the ordered list of relationships in which the contact is involved. By default, this list is equal to the cached list of relationships which is available by calling relationships().

See also setRelationshipOrder().

QList<QContactRelationship> QContact::relationships ( const QString & relationshipType = QString() ) const

Returns a list of relationships of the given relationshipType in which the contact was a participant at the time that it was retrieved from the manager

bool QContact::removeDetail ( QContactDetail * detail )

Removes the detail from the contact.

Any preference for the given field is also removed. The Id of the detail is removed, to signify that it is no longer part of the contact.

If the detail is the contact type for this contact, the type will be reset to QContactType::TypeContact, and the function will return success.

If the detail is a display label, the operation will fail and return false.

Returns true if the detail was removed successfully, false if an error occurred

bool QContact::saveDetail ( QContactDetail * detail )

Saves the given detail in the list of stored details, and sets its Id. If another detail of the same type and Id has been previously saved in this contact, that detail is overwritten. Otherwise, a new Id is generated and set in the detail, and the detail is added to the list.

If detail is a contact type, the existing contact type will be overwritten with detail. There is never more than one contact type in a contact.

If detail is a display label, the operation will fail. The display label can never be updated manually and must be synthesized by the backend.

Returns true if the detail was saved successfully, otherwise returns false

void QContact::setId ( const QContactId & id )

Sets the id of this contact to id. Note that this only affects this structure, not any corresponding structures stored by a QContactManager.

If you change the id of a contact and save the contact in a manager, the previously existing contact will still exist. You can do this to create copies (possibly modified) of an existing contact.

Returns true if the id was set successfully, otherwise returns false.

See also id().

bool QContact::setPreferredDetail ( const QString & actionName, const QContactDetail & preferredDetail )

Set a particular detail as the preferredDetail for a given actionName. Returns true if the detail was successfully set as the preferred detail for the action identified by actionName, otherwise returns false

See also preferredDetail().

void QContact::setRelationshipOrder ( const QList<QContactRelationship> & reordered )

Sets the order of importance of the relationships for this contact by saving a reordered list of relationships which involve the contact. The list must include all of the relationships in which the contact is involved, and must not include any relationships which do not involve the contact. In order for the ordering preference to be persisted, the contact must be saved in its manager.

It is possible that relationships will have been added or removed from the contact stored in the manager, thus rendering the relationship cache of the contact in memory stale. If this happens, attempting to save the contact after reordering its relationships will result in an error occurring. The updated relationships list must be retrieved from the manager, reordered and set in the contact before the contact can be saved successfully.

See also relationships() and relationshipOrder().

void QContact::setType ( const QString & type )

Sets the type of the contact to the given type.

See also type().

void QContact::setType ( const QContactType & type )

Sets the type of the contact to the given type.

QString QContact::type () const

Returns the type of the contact. Every contact has exactly one type which is either set manually (by saving a modified copy of the QCotnactType in the contact, or by calling setType()) or synthesized automatically.

See also setType().

bool QContact::operator!= ( const QContact & other ) const

Returns true if this contacts Id or details are different to those of the other contact

QContact & QContact::operator= ( const QContact & other )

Replace the contents of this QContact with other

bool QContact::operator== ( const QContact & other ) const

Returns true if this contact is equal to the other contact, false if either the id or stored details are not the same

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtmobility-1.0-tp
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web