QContactManager Class Reference#include <QContactManager> Inherits QObject. Public Types
Public Functions
Signals
Static Public Members
Additional Inherited Members
Detailed DescriptionThis class provides adding, updating and removal of contacts. It also provides definitions for fields that can be found in contacts. Member Type Documentation
|
Constant | Value | Description |
---|---|---|
QContactManager::NoError | 0 | The most recent operation was successful |
QContactManager::DoesNotExistError | 1 | The most recent operation failed because the requested contact or detail definition does not exist |
QContactManager::AlreadyExistsError | 2 | The most recent operation failed because the specified contact or detail definition already exists |
QContactManager::InvalidDetailError | 3 | The most recent operation failed because the specified contact contains details which do not conform to their definition |
QContactManager::InvalidRelationshipError | 4 | The most recent operation failed because the specified relationship is circular or references an invalid local contact |
QContactManager::InvalidContactTypeError | 14 | The most recent operation failed because the contact type specified was not valid for the operation |
QContactManager::LockedError | 5 | The most recent operation failed because the datastore specified is currently locked |
QContactManager::DetailAccessError | 6 | The most recent operation failed because a detail was modified or removed and its access method does not allow that |
QContactManager::PermissionsError | 7 | The most recent operation failed because the caller does not have permission to perform the operation |
QContactManager::OutOfMemoryError | 8 | The most recent operation failed due to running out of memory |
QContactManager::VersionMismatchError | 12 | The most recent operation failed because the backend of the manager is not of the required version |
QContactManager::LimitReachedError | 13 | The most recent operation failed because the limit for that type of object has been reached |
QContactManager::NotSupportedError | 9 | The most recent operation failed because the requested operation is not supported in the specified store |
QContactManager::BadArgumentError | 10 | The most recent operation failed because one or more of the parameters to the operation were invalid |
QContactManager::UnspecifiedError | 11 | The most recent operation failed for an undocumented reason |
This enum describes the possible features that a particular manager may support
Constant | Value | Description |
---|---|---|
QContactManager::Groups | 0 | The manager supports all QContactGroup related operations, and emits the appropriate signals |
QContactManager::ActionPreferences | 1 | The manager supports saving preferred details per action per contact |
QContactManager::Relationships | 3 | The manager supports at least some types of relationships between contacts |
QContactManager::ArbitraryRelationshipTypes | 4 | The manager supports relationships of arbitrary types between contacts |
QContactManager::MutableDefinitions | 2 | The manager supports saving, updating or removing detail definitions. Some built-in definitions may still be immutable |
QContactManager::SelfContact | 5 | The manager supports the concept of saving a contact which represents the current user |
QContactManager::ChangeLogs | 7 | The manager supports reporting of timestamps of changes, and filtering and sorting by those timestamps |
QContactManager::Anonymous | 6 | The manager is isolated from other managers |
Constructs a QContactManager whose implementation is identified by managerName with the given parameters.
The parent QObject will be used as the parent of this QContactManager.
If an empty managerName is specified, the default implementation for the platform will be used.
Constructs a QContactManager whose backend has the name managerName and version implementationVersion, where the manager is constructed with the provided parameters.
The parent QObject will be used as the parent of this QContactManager.
If an empty managerName is specified, the default implementation for the platform will be instantiated. If the specified implementation version is not available, the manager with the name managerName with the default implementation version is instantiated.
Frees the memory used by the QContactManager
Returns a list of available manager ids that can be used when constructing a QContactManager. If an empty id is specified to the constructor, the first value in this list will be used instead.
Returns a URI that completely describes a manager implementation, datastore, and the parameters with which to instantiate the manager, from the given managerName, params and an optional implementationVersion
Returns the contact in the database identified by contactId
Return the list of added contact ids, sorted according to the given list of sortOrders
Returns a list of contact ids that match the given filter, sorted according to the given list of sortOrders. Depending on the backend, this filtering operation may involve retrieving all the contacts.
This signal is emitted at some point once the contacts identified by contactIds have been added to a datastore managed by this manager. This signal must not be emitted if the dataChanged() signal was previously emitted for these changes.
This signal is emitted at some point once the contacts identified by contactIds have been modified in a datastore managed by this manager. This signal must not be emitted if the dataChanged() signal was previously emitted for these changes.
This signal is emitted at some point once the contacts identified by contactIds have been removed from a datastore managed by this manager. This signal must not be emitted if the dataChanged() signal was previously emitted for these changes.
This signal is emitted by the manager if its internal state changes, and it is unable to determine the changes which occurred, or if the manager considers the changes to be radical enough to require clients to reload all data. If this signal is emitted, no other signals will be emitted for the associated changes.
Returns the definition identified by the given definitionName that is valid for the contacts whose type is the given contactType in this store, or a default-constructed QContactDetailDefinition if no such definition exists
Returns a map of identifier to detail definition for the registered detail definitions which are valid for contacts whose type is the given contactType which are valid for the contacts in this store
Return the error code of the most recent operation
Returns true if the given filter is supported natively by the manager, and false if the filter behaviour would be emulated.
Note: In some cases, the behaviour of an unsupported filter cannot be emulated. For example, a filter that requests contacts that have changed since a given time depends on having that information available. In these cases, the filter will fail.
Constructs a QContactManager whose implementation, store and parameters are specified in the given storeUri, and whose parent object is parent.
Returns true if the given feature feature is supported by the manager, for the specified type of contact contactType
Returns the engine backend implementation version number
Returns the manager name for this QContactManager
Return the parameters relevant to the creation of this QContactManager
Return the uri describing this QContactManager, consisting of the manager name and any parameters.
Returns a list of relationships in which the contact identified by the given participantId participates in the given role. If participantId is the default-constructed id, role is ignored and all relationships are returned.
Returns a list of relationships of the given relationshipType in which the contact identified by the given participantId participates in the given role. If participantId is the default-constructed id, role is ignored and all relationships of the given relationshipType are returned. If relationshipType is empty, relationships of any type are returned.
This signal is emitted at some point after relationships have been added to the manager which involve the contacts identified by affectedContactIds. This signal must not be emitted if the dataChanged() signal was previously emitted for these changes.
This signal is emitted at some point after relationships have eben removed from the manager which involve the contacts identified by affectedContactIds. This signal must not be emitted if the dataChanged() signal was previously emitted for these changes.
Remove the contact identified by contactId from the database, and also removes any relationships in which the contact was involved. Returns true if the contact was removed successfully, otherwise returns false.
Remove the list of contacts identified in idList. Returns a list of the error codes corresponding to the contact ids in the idList. The QContactManager::error() function will only return QContactManager::NoError if all contacts were removed successfully.
For each contact that was removed succesfully, the corresponding id in the list will be retained but set to zero. The id of contacts that were not successfully removed will be left alone.
Any contact that was removed successfully will have the relationships in which it was involved removed also.
See also QContactManager::removeContact().
Removes the detail definition identified by definitionName from the database, which is valid for contacts whose type is the given contactType. Returns true if the definition was removed successfully, otherwise returns false
Removes the given relationship from the manager. If the relationship exists in the manager, the relationship will be removed, the error will be set to QContactManager::NoError and this function will return true. If no such relationship exists in the manager, the error will be set to QContactManager::DoesNotExistError and this function will return false.
The priority of the relationship is ignored when determining existence of the relationship.
Removes the given relationships from the database and returns a list of error codes.
Adds the given contact to the database if contact has a default-constructed id, or an id with the manager URI set to the URI of this manager and a local id of zero.
If the manager URI of the id of the contact is neither empty nor equal to the URI of this manager, or local id of the contact is non-zero but does not exist in the manager, the operation will fail and calling error() will return QContactManager::DoesNotExistError.
Alternatively, the function will update the existing contact in the database if contact has a non-zero id and currently exists in the database.
If the contact contains one or more details whose definitions have not yet been saved with the manager, the operation will fail and calling error() will return QContactManager::UnsupportedError.
If the contact has had its relationships reordered, the manager will check to make sure that every relationship that the contact is currently involved in is included in the reordered list, and that no relationships which either do not involve the contact, or have not been saved in the manager are included in the list. If these conditions are not met, the function will return false and calling error() will return QContactManager::InvalidRelationshipError.
The manager will automatically synthesize the display label of the contact when it is saved.
Returns false on failure, or true on success. On successful save of a contact with an id of zero, its id will be set to a new, valid id with the manager URI set to the URI of this manager, and the local id set to a new, valid local id.
See also managerUri().
Adds the list of contacts given by contactList to the database. Returns a list of the error codes corresponding to the contacts in the contactList. The QContactManager::error() function will only return QContactManager::NoError if all contacts were saved successfully.
For each newly saved contact that was successful, the uid of the contact in the list will be updated with the new value. If a failure occurs when saving a new contact, the id will be cleared. If a failure occurs when updating a contact that already exists, then TODO.
See also QContactManager::saveContact().
Persists the given definition def in the database, which is valid for contacts whose type is the given contactType. Returns true if the definition was saved successfully, otherwise returns false
Saves the given relationship in the database. If the relationship already exists in the database, this function will return false and the error will be set to QContactManager::AlreadyExistsError. If the relationship is saved successfully, this function will return true and error will be set to QContactManager::NoError. Note that relationships cannot be updated directly using this function; in order to update a relationship, you must remove the old relationship, make the required modifications, and then save it.
The given relationship is invalid if it is circular (one of the destination contacts is also the source contact), or if it references a non-existent local contact (either source or destination). If the given relationship is invalid, the function will return false and the error will be set to QContactManager::InvalidRelationshipError. If the given relationship could not be saved in the database (due to backend limitations) the function will return false and error will be set to QContactManager::NotSupportedError.
If any destination contact manager URI is not set in the relationship, these will be automatically set to the URI of this manager, before the relationship is saved.
Saves the given relationships in the database and returns a list of error codes.
Returns the id of the "self" contact which has previously been set. If no "self" contact has been set, or if the self contact was removed from the manager after being set, or if the backend does not support the concept of a "self" contact, an invalid id will be returned and the error will be set to QContactManager::DoesNotExistError.
See also setSelfContactId().
This signal is emitted at some point after the id of the self-contact is changed from oldId to newId in the manager. If the newId is the invalid, zero id, then the self contact was deleted or no self contact exists. This signal must not be emitted if the dataChanged() signal was previously emitted for this change.
Sets the id of the "self" contact to the given contactId. Returns true if the "self" contact id was set successfully. If the given contactId does not identify a contact stored in this manager, the error will be set to QContactManager::DoesNotExistError and the function will return false; if the backend does not support the concept of a "self" contact then the error will be set to QContactManager::NotSupportedError and the function will return false.
See also selfContactId().
Splits the given uri into the manager, store, and parameters that it describes, and places the information into the memory addressed by pManagerId and pParams respectively. Returns true if uri could be split successfully, otherwise returns false
Returns the list of contact types which are supported by this manager. This is a convenience function, equivalent to retrieving the allowable values for the QContactType::FieldType field of the QContactType definition which is valid in this manager.
Returns the list of data types supported by the manager
Returns the list of relationship types which are supported by this manager for contacts of the given contactType. If the backend does not support the QContactManager::Relationships feature, this list should be empty. If the backend supports the QContactManager::Relationships feature and also supports the QContactManager::ArbitraryRelationshipTypes feature, the list will contain the natively supported (well-known) relationship types contained in the list, but clients are able to add relationships of any custom type also.
Returns a display label for a contact which is synthesized from its details in a platform-specific manner
Returns the version number of the Qt Mobility Contacts API
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 ! |
Copyright © 2000-2012 - www.developpez.com