The QContactManagerEngineV2 class provides the interface for implementations of the contact manager backend functionality. More...
#include <QContactManagerEngineV2>
Inherits: QContactManagerEngine.
Inherited by: QContactInvalidEngine.
QContactManagerEngineV2 () | |
virtual QList<QContact> | contacts ( const QList<QContactLocalId> & localIds, const QContactFetchHint & fetchHint, QMap<int, QContactManager::Error> * errorMap, QContactManager::Error * error ) const |
virtual bool | saveContacts ( QList<QContact> * contacts, const QStringList & definitionMask, QMap<int, QContactManager::Error> * errorMap, QContactManager::Error * error ) |
virtual QList<QContact> | contacts ( const QContactFilter & filter, const QList<QContactSortOrder> & sortOrders, const QContactFetchHint & fetchHint, QContactManager::Error * error ) const |
virtual bool | saveContacts ( QList<QContact> * contacts, QMap<int, QContactManager::Error> * errorMap, QContactManager::Error * error ) |
void | updateContactFetchByIdRequest ( QContactFetchByIdRequest * req, const QList<QContact> & result, QContactManager::Error error, const QMap<int, QContactManager::Error> & errorMap, QContactAbstractRequest::State newState ) |
The QContactManagerEngineV2 class provides the interface for implementations of the contact manager backend functionality.
Instances of this class are usually provided by a QContactManagerEngineFactory, which is loaded from a plugin.
The default implementation of this interface provides a basic level of functionality for some functions so that specific engines can simply implement the functionality that is supported by the specific contacts engine that is being adapted.
More information on writing a contacts engine plugin is available in the Qt Contacts Manager Engines documentation.
Engines that support the QContactManagerEngine interface but not the QContactManagerEngineV2 interface will be wrapped by the QContactManager by a class that emulates the extra functionality of the QContactManagerEngineV2 interface.
See also QContactManagerEngine, QContactManager, and QContactManagerEngineFactory.
Constructs an empty QContactManagerEngineV2.
Reimplemented from QContactManagerEngine::contacts().
Returns the list of contacts with the ids given by localIds. There is a one-to-one correspondence between the returned contacts and the supplied localIds.
If there is an invalid id in localIds, then an empty QContact will take its place in the returned list and an entry will be inserted into errorMap.
The overall operation error will be saved in error.
The fetchHint parameter describes the optimization hints that a manager may take. If the fetchHint is the default constructed hint, all existing details, relationships and action preferences in the matching contacts will be returned.
If a non-default fetch hint is supplied, and the client wishes to make changes to the contacts, they should ensure that only a detail definition hint is supplied and that when saving it back, a definition mask should be used which corresponds to the detail definition hint. This is to ensure that no data is lost by overwriting an existing contact with a restricted version of it.
See also QContactFetchHint.
Reimplemented from QContactManagerEngine::saveContacts().
For each contact in contacts, either add it to the database or update an existing one.
This function accepts a definitionMask, which specifies which details of the contacts should be updated. Details with definition names not included in the definitionMask will not be updated or added.
The manager should populate errorMap (the map of indices of the contacts list to the error which occurred when saving the contact at that index) for every index for which the contact could not be saved, if it is able.
The supplied errorMap parameter may be null, if the client does not desire detailed error information. If supplied, it will be empty upon entry to this function.
The QContactManager::error() function will only return QContactManager::NoError if all contacts were saved successfully.
For each newly saved contact that was successful, the id of the contact in the contacts list will be updated with the new value. If a failure occurs when saving a new contact, the id will be cleared.
Any errors encountered during this operation should be stored to error.
Updates the given QContactFetchByIdRequest req with the latest results result, and operation error error, and map of input index to individual error errorMap. In addition, the state of the request will be changed to newState.
It then causes the request to emit its resultsAvailable() signal to notify clients of the request progress.
If the new request state is different from the previous state, the stateChanged() signal will also be emitted from the request.