QOrganizerItemManagerEngine Class Reference
The QOrganizerItemManagerEngine class provides the interface for all implementations of the organizer item manager backend functionality. More...
#include <QOrganizerItemManagerEngine>
Inherited by QOrganizerItemInvalidEngine and QOrganizerItemMemoryEngine.
Public Functions
| QOrganizerItemManagerEngine () |
virtual bool | cancelRequest ( QOrganizerItemAbstractRequest * req ) |
virtual QOrganizerItem | compatibleItem ( const QOrganizerItem & original, QOrganizerItemManager::Error * error ) const |
virtual QOrganizerItemDetailDefinition | detailDefinition ( const QString & definitionName, const QString & organizeritemType, QOrganizerItemManager::Error * error ) const |
virtual QMap<QString, QOrganizerItemDetailDefinition> | detailDefinitions ( const QString & organizeritemType, QOrganizerItemManager::Error * error ) const |
virtual bool | hasFeature ( QOrganizerItemManager::ManagerFeature feature, const QString & organizeritemType ) const |
virtual bool | isFilterSupported ( const QOrganizerItemFilter & filter ) const |
virtual QOrganizerItem | item ( const QOrganizerItemLocalId & organizeritemId, const QOrganizerItemFetchHint & fetchHint, QOrganizerItemManager::Error * error ) const |
virtual QList<QOrganizerItemLocalId> | itemIds ( const QOrganizerItemFilter & filter, const QList<QOrganizerItemSortOrder> & sortOrders, QOrganizerItemManager::Error * error ) const |
virtual QList<QOrganizerItem> | itemInstances ( const QOrganizerItemFilter & filter, const QList<QOrganizerItemSortOrder> & sortOrders, const QOrganizerItemFetchHint & fetchHint, QOrganizerItemManager::Error * error ) const |
virtual QList<QOrganizerItem> | itemInstances ( const QOrganizerItem & generator, const QDateTime & periodStart, const QDateTime & periodEnd, int maxCount, QOrganizerItemManager::Error * error ) const |
virtual QList<QOrganizerItem> | items ( const QOrganizerItemFilter & filter, const QList<QOrganizerItemSortOrder> & sortOrders, const QOrganizerItemFetchHint & fetchHint, QOrganizerItemManager::Error * error ) const |
virtual QString | managerName () const = 0 |
virtual QMap<QString, QString> | managerParameters () const |
QString | managerUri () const |
virtual int | managerVersion () const = 0 |
virtual bool | removeDetailDefinition ( const QString & definitionName, const QString & organizeritemType, QOrganizerItemManager::Error * error ) |
virtual bool | removeItem ( const QOrganizerItemLocalId & organizeritemId, QOrganizerItemManager::Error * error ) |
virtual bool | removeItems ( const QList<QOrganizerItemLocalId> & organizeritemIds, QMap<int, QOrganizerItemManager::Error> * errorMap, QOrganizerItemManager::Error * error ) |
virtual void | requestDestroyed ( QOrganizerItemAbstractRequest * req ) |
virtual bool | saveDetailDefinition ( const QOrganizerItemDetailDefinition & def, const QString & organizeritemType, QOrganizerItemManager::Error * error ) |
virtual bool | saveItem ( QOrganizerItem * organizeritem, QOrganizerItemManager::Error * error ) |
virtual bool | saveItems ( QList<QOrganizerItem> * organizeritems, QMap<int, QOrganizerItemManager::Error> * errorMap, QOrganizerItemManager::Error * error ) |
virtual bool | startRequest ( QOrganizerItemAbstractRequest * req ) |
virtual QList<QVariant::Type> | supportedDataTypes () const |
virtual QStringList | supportedItemTypes () const |
virtual bool | validateDefinition ( const QOrganizerItemDetailDefinition & definition, QOrganizerItemManager::Error * error ) const |
virtual bool | validateItem ( const QOrganizerItem & organizeritem, QOrganizerItemManager::Error * error ) const |
virtual bool | waitForRequestFinished ( QOrganizerItemAbstractRequest * req, int msecs ) |
Signals
void | dataChanged () |
void | itemsAdded ( const QList<QOrganizerItemLocalId> & organizeritemIds ) |
void | itemsChanged ( const QList<QOrganizerItemLocalId> & organizeritemIds ) |
void | itemsRemoved ( const QList<QOrganizerItemLocalId> & organizeritemIds ) |
Static Public Members
void | addSorted ( QList<QOrganizerItem> * sorted, const QOrganizerItem & toAdd, const QList<QOrganizerItemSortOrder> & sortOrders ) |
QOrganizerItemFilter | canonicalizedFilter ( const QOrganizerItemFilter & filter ) |
int | compareItem ( const QOrganizerItem & a, const QOrganizerItem & b, const QList<QOrganizerItemSortOrder> & sortOrders ) |
int | compareVariant ( const QVariant & first, const QVariant & second, Qt::CaseSensitivity sensitivity ) |
QMap<QString, QMap<QString, QOrganizerItemDetailDefinition> > | schemaDefinitions () |
void | setDetailAccessConstraints ( QOrganizerItemDetail * detail, QOrganizerItemDetail::AccessConstraints constraints ) |
QList<QOrganizerItemLocalId> | sortItems ( const QList<QOrganizerItem> & cs, const QList<QOrganizerItemSortOrder> & sortOrders ) |
bool | testFilter ( const QOrganizerItemFilter & filter, const QOrganizerItem & organizeritem ) |
void | updateDefinitionFetchRequest ( QOrganizerItemDetailDefinitionFetchRequest * req, const QMap<QString, QOrganizerItemDetailDefinition> & result, QOrganizerItemManager::Error error, const QMap<int, QOrganizerItemManager::Error> & errorMap, QOrganizerItemAbstractRequest::State newState ) |
void | updateDefinitionRemoveRequest ( QOrganizerItemDetailDefinitionRemoveRequest * req, QOrganizerItemManager::Error error, const QMap<int, QOrganizerItemManager::Error> & errorMap, QOrganizerItemAbstractRequest::State newState ) |
void | updateDefinitionSaveRequest ( QOrganizerItemDetailDefinitionSaveRequest * req, const QList<QOrganizerItemDetailDefinition> & result, QOrganizerItemManager::Error error, const QMap<int, QOrganizerItemManager::Error> & errorMap, QOrganizerItemAbstractRequest::State newState ) |
void | updateItemFetchRequest ( QOrganizerItemFetchRequest * req, const QList<QOrganizerItem> & result, QOrganizerItemManager::Error error, QOrganizerItemAbstractRequest::State newState ) |
void | updateItemInstanceFetchRequest ( QOrganizerItemInstanceFetchRequest * req, const QList<QOrganizerItem> & result, QOrganizerItemManager::Error error, QOrganizerItemAbstractRequest::State newState ) |
void | updateItemLocalIdFetchRequest ( QOrganizerItemLocalIdFetchRequest * req, const QList<QOrganizerItemLocalId> & result, QOrganizerItemManager::Error error, QOrganizerItemAbstractRequest::State newState ) |
void | updateItemRemoveRequest ( QOrganizerItemRemoveRequest * req, QOrganizerItemManager::Error error, const QMap<int, QOrganizerItemManager::Error> & errorMap, QOrganizerItemAbstractRequest::State newState ) |
void | updateItemSaveRequest ( QOrganizerItemSaveRequest * req, const QList<QOrganizerItem> & result, QOrganizerItemManager::Error error, const QMap<int, QOrganizerItemManager::Error> & errorMap, QOrganizerItemAbstractRequest::State newState ) |
void | updateRequestState ( QOrganizerItemAbstractRequest * req, QOrganizerItemAbstractRequest::State state ) |
Detailed Description
The QOrganizerItemManagerEngine class provides the interface for all implementations of the organizer item manager backend functionality.
Instances of this class are usually provided by a QOrganizerItemManagerEngineFactory, 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 organizer items engine that is being adapted.
More information on writing a organizer items engine plugin is available in the Qt Organizer Manager Engines documentation.
See also QOrganizerItemManager and QOrganizerItemManagerEngineFactory.
Member Function Documentation
QOrganizerItemManagerEngine::QOrganizerItemManagerEngine ()
A default, empty constructor.
void QOrganizerItemManagerEngine::addSorted ( QList<QOrganizerItem> * sorted, const QOrganizerItem & toAdd, const QList<QOrganizerItemSortOrder> & sortOrders ) [static]
Performs insertion sort of the item toAdd into the sorted list, according to the provided sortOrders list. The first QOrganizerItemSortOrder in the list has the highest priority; if the item toAdd is deemed equal to another in the sorted list, the second QOrganizerItemSortOrder in the list is used (and so on until either the item is inserted or there are no more sort order objects in the list).
bool QOrganizerItemManagerEngine::cancelRequest ( QOrganizerItemAbstractRequest * req ) [virtual]
Asks the manager engine to cancel the given request req which was previously started and is currently in a cancellable state. Returns true if cancellation of the request was started successfully, otherwise returns false.
See also startRequest() and QOrganizerItemAbstractRequest::cancel().
Given an input filter, returns the canonical version of the filter.
Some of the following transformations may be applied:
int QOrganizerItemManagerEngine::compareItem ( const QOrganizerItem & a, const QOrganizerItem & b, const QList<QOrganizerItemSortOrder> & sortOrders ) [static]
Compares two organizeritems (a and b) using the given list of sortOrders. Returns a negative number if a should appear before b according to the sort order, a positive number if a should appear after b according to the sort order, and zero if the two are unable to be sorted.
int QOrganizerItemManagerEngine::compareVariant ( const QVariant & first, const QVariant & second, Qt::CaseSensitivity sensitivity ) [static]
Compares first against second. If the types are strings (QVariant::String), the sensitivity argument controls case sensitivity when comparing.
Returns: <0 if first is less than second 0 if first is equal to second >0 if first is greater than second.
The results are undefined if the variants are different types, or cannot be compared.
Returns a pruned or modified version of the original item which is valid and can be saved in the manager. The returned item might have details removed or arbitrarily changed. The cache of relationships in the item are ignored entirely when considering compatibility with the backend, as they are saved and validated separately. Any error which occurs will be saved to error.
void QOrganizerItemManagerEngine::dataChanged () [signal]
This signal is emitted some time after changes occur to the data managed by this engine, and the engine is unable to determine which changes occurred, or if the engine considers the changes to be radical enough to require clients to reload all data.
If this signal is emitted, no other signals may be emitted for the associated changes.
As it is possible that other processes (or other devices) may have caused the changes, the timing can not be determined.
See also itemsAdded(), itemsChanged(), and itemsRemoved().
QOrganizerItemDetailDefinition QOrganizerItemManagerEngine::detailDefinition ( const QString & definitionName, const QString & organizeritemType, QOrganizerItemManager::Error * error ) const [virtual]
Returns the definition identified by the given definitionName that is valid for organizeritems whose type is of the given organizeritemType in this store, or a default-constructed QOrganizerItemDetailDefinition if no such definition exists
Any errors encountered during this operation should be stored to error.
QMap<QString, QOrganizerItemDetailDefinition> QOrganizerItemManagerEngine::detailDefinitions ( const QString & organizeritemType, QOrganizerItemManager::Error * error ) const [virtual]
Returns the registered detail definitions which are valid for organizeritems whose type is of the given organizeritemType in this engine.
Any errors encountered during this operation should be stored to error.
bool QOrganizerItemManagerEngine::hasFeature ( QOrganizerItemManager::ManagerFeature feature, const QString & organizeritemType ) const [virtual]
Returns true if the given feature is supported by this engine for organizeritems of the given organizeritemType
bool QOrganizerItemManagerEngine::isFilterSupported ( const QOrganizerItemFilter & filter ) const [virtual]
Returns a whether the supplied filter can be implemented natively by this engine. If not, the base class implementation will emulate the functionality.
Returns the organizer item in the database identified by organizeritemId.
If the item does not exist, an empty, default constructed QOrganizerItem will be returned, and the error will be set to QOrganizerItemManager::DoesNotExistError.
Any operation error which occurs 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 and relationships in the matching item will be returned. A client should not make changes to an item which has been retrieved using a fetch hint other than the default fetch hint. Doing so will result in information loss when saving the item back to the manager (as the "new" restricted item will replace the previously saved item in the backend).
See also QOrganizerItemFetchHint.
Returns a list of organizer item 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 organizeritems. Any error which occurs will be saved in error.
Return the list of organizer item instances which match the given filter, sorted according to the given sortOrders. The client may instruct the manager that it does not require all possible information about each instance by specifying a fetch hint fetchHint; the manager can choose to ignore the fetch hint, but if it does so, it must return all possible information about each instance.
Items of type QOrganizerItemType::TypeEvent or QOrganizerItemType::TypeTodo should NOT be included in the list of returned items. Instead, these items should be expanded according to their recurrence specification and the resultant occurrence items (of type QOrganizerItemType::TypeEventOccurrence and QOrganizerItemType::TypeTodoOccurrence) should be returned.
The occurrence-typed returned items should have a QOrganizerItemInstanceOrigin detail that points to the generator and the original instance that the event would have occurred on (if it is an exception). No returned item should contain a QOrganizerItemRecurrence detail.
If there are no instances matching the criteria, an empty list should be returned. Any error which occurs should be saved to error.
QList<QOrganizerItem> QOrganizerItemManagerEngine::itemInstances ( const QOrganizerItem & generator, const QDateTime & periodStart, const QDateTime & periodEnd, int maxCount, QOrganizerItemManager::Error * error ) const [virtual]
Return the list of a maximum of maxCount organizer item instances which are occurrences of the given generator recurring item, which occur between the given periodStart date and the given periodEnd date.
If periodStart is after periodEnd, the operation will fail, and error will be set to QOrganizerItemManager::BadArgumentError. If maxCount is negative, it is backend specific as to how many occurrences will be returned. Some backends may return no instances, others may return some limited number of occurrences.
If the generator is an item of type QOrganizerItemType::TypeEvent, a list of items of type QOrganizerItemType::TypeEventOccurrence will be returned, representing the expansion of the generator according to its QOrganizerItemRecurrence detail. Similarly, a generator of type QOrganizerItemType::TypeTodo will result in a list of QOrganizerItemType::TypeTodoOccurrence items. If the generator is of any other type, it is returned by itself from the backend.
The occurrence-typed items returned should have a QOrganizerItemInstanceOrigin detail that refers to the generator and the original instance that the event would have occurred on (if it is an exception). No returned item should contain a QOrganizerItemRecurrence detail.
If the generator does not exist in the backend, or if there are no instances matching the criteria, an empty list should be returned.
Returns the list of organizeritems which match the given filter stored in the manager sorted according to the given list of sortOrders.
Any operation error which occurs 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 and relationships in the matching organizeritems will be returned. A client should not make changes to an item which has been retrieved using a fetch hint other than the default fetch hint. Doing so will result in information loss when saving the item back to the manager (as the "new" restricted item will replace the previously saved item in the backend).
Items of type EventOccurrence and TodoOccurrence should only be returned when they represent an exceptional occurrence; ie. if the client has specifically saved the item occurrence in the manager. Occurrence-typed items that are generated purely from a recurrence specification of another detail should not be returned in this list.
All items returned should have a non-zero local ID.
See also QOrganizerItemFetchHint.
void QOrganizerItemManagerEngine::itemsAdded ( const QList<QOrganizerItemLocalId> & organizeritemIds ) [signal]
This signal is emitted some time after a set of organizeritems has been added to this engine where the dataChanged() signal was not emitted for those changes. As it is possible that other processes (or other devices) may have added the organizeritems, the timing cannot be determined.
The list of ids of organizeritems added is given by organizeritemIds. There may be one or more ids in the list.
See also dataChanged().
void QOrganizerItemManagerEngine::itemsChanged ( const QList<QOrganizerItemLocalId> & organizeritemIds ) [signal]
This signal is emitted some time after a set of organizeritems has been modified in this engine where the dataChanged() signal was not emitted for those changes. As it is possible that other processes (or other devices) may have modified the organizeritems, the timing cannot be determined.
The list of ids of changed organizeritems is given by organizeritemIds. There may be one or more ids in the list.
See also dataChanged().
void QOrganizerItemManagerEngine::itemsRemoved ( const QList<QOrganizerItemLocalId> & organizeritemIds ) [signal]
This signal is emitted some time after a set of organizeritems has been removed from this engine where the dataChanged() signal was not emitted for those changes. As it is possible that other processes (or other devices) may have removed the organizeritems, the timing cannot be determined.
The list of ids of removed organizeritems is given by organizeritemIds. There may be one or more ids in the list.
See also dataChanged().
QString QOrganizerItemManagerEngine::managerName () const [pure virtual]
Returns the manager name for this QOrganizerItemManagerEngine
QMap<QString, QString> QOrganizerItemManagerEngine::managerParameters () const [virtual]
Returns the parameters with which this engine was constructed. Note that the engine may have discarded unused or invalid parameters at the time of construction, and these will not be returned.
QString QOrganizerItemManagerEngine::managerUri () const
Returns the unique URI of this manager, which is built from the manager name and the parameters used to construct it.
int QOrganizerItemManagerEngine::managerVersion () const [pure virtual]
Returns the engine backend implementation version number
bool QOrganizerItemManagerEngine::removeDetailDefinition ( const QString & definitionName, const QString & organizeritemType, QOrganizerItemManager::Error * error ) [virtual]
Removes the definition identified by the given definitionName from the database, where it was valid for organizeritems whose type was the given organizeritemType.
Returns true if the definition was removed successfully, otherwise returns false.
The backend must emit the appropriate signals to inform clients of changes to the database resulting from this operation.
Any errors encountered during this operation should be stored to error.
Remove the item identified by organizeritemId from the database, and also removes any relationships in which the item was involved. Returns true if the item was removed successfully, otherwise returns false.
Any error which occurs will be saved in error.
The default implementation will convert this into a call to removeItems.
Remove every item whose id is contained in the list of organizeritems ids organizeritemIds. Returns true if all organizeritems were removed successfully, otherwise false.
Any item that was removed successfully will have the relationships in which it was involved removed also.
The manager might populate errorMap (the map of indices of the organizeritemIds list to the error which occurred when saving the item at that index) for every index for which the item could not be removed, if it is able. The QOrganizerItemManager::error() function will only return QOrganizerItemManager::NoError if all organizeritems were removed successfully.
If the list contains ids which do not identify a valid item in the manager, the function will remove any organizeritems which are identified by ids in the organizeritemIds list, insert QOrganizerItemManager::DoesNotExist entries into the errorMap for the indices of invalid ids in the organizeritemIds list, return false, and set the overall operation error to QOrganizerItemManager::DoesNotExistError.
Any errors encountered during this operation should be stored to error.
See also QOrganizerItemManager::removeItem().
void QOrganizerItemManagerEngine::requestDestroyed ( QOrganizerItemAbstractRequest * req ) [virtual]
Notifies the manager engine that the given request req has been destroyed.
This notifies the engine that:
- the client doesn't care about the request any more. The engine can still complete it, but completion is not required.
- it can't reliably access any properties of the request pointer any more. The pointer will be invalid once this function returns.
This means that if there is a worker thread, the engine needs to let that thread know that the request object is not valid and block until that thread acknowledges it. One way to do this is to have a QSet<QOrganizerItemAbstractRequest*> (or QMap<QOrganizerItemAbstractRequest, MyCustomRequestState>) that tracks active requests, and insert into that set in startRequest, and remove in requestDestroyed (or when it finishes or is cancelled). Protect that set/map with a mutex, and make sure you take the mutex in the worker thread before calling any of the QOrganizerItemAbstractRequest::updateXXXXXXRequest functions. And be careful of lock ordering problems :D
bool QOrganizerItemManagerEngine::saveDetailDefinition ( const QOrganizerItemDetailDefinition & def, const QString & organizeritemType, QOrganizerItemManager::Error * error ) [virtual]
Persists the given definition def in the database, which is valid for organizeritems whose type is the given organizeritemType.
Returns true if the definition was saved successfully, and otherwise returns false.
The backend must emit the appropriate signals to inform clients of changes to the database resulting from this operation.
Any errors encountered during this operation should be stored to error.
Adds the given organizeritem to the database if organizeritem 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, otherwise updates the organizeritem in the database which has the same id to be the given organizeritem. If the id is non-zero but does not identify any item stored in the manager, the function will return false and error will be set to QOrganizerItemManager::DoesNotExistError.
Returns true if the save operation completed successfully, otherwise returns false. Any error which occurs will be saved in error.
The default implementation will convert this into a call to saveItems.
See also managerUri().
Adds the list of organizeritems given by organizeritems list to the database. Returns true if the organizeritems were saved successfully, otherwise false.
The engine might populate errorMap (the map of indices of the organizeritems list to the error which occurred when saving the item at that index) for every index for which the item could not be saved, if it is able. The QOrganizerItemManager::error() function will only return QOrganizerItemManager::NoError if all organizeritems were saved successfully.
For each newly saved item that was successful, the id of the item in the organizeritems list will be updated with the new value. If a failure occurs when saving a new item, the id will be cleared.
Any errors encountered during this operation should be stored to error.
See also QOrganizerItemManager::saveItem().
QMap<QString, QMap<QString, QOrganizerItemDetailDefinition> > QOrganizerItemManagerEngine::schemaDefinitions () [static]
Returns the base schema definitions
Sets the access constraints of detail to the supplied constraints.
This function is provided to allow engine implementations to report the access constraints of retrieved details, without generally allowing the access constraints to be modified after retrieval.
Application code should not call this function, since validation of the detail will happen in the engine in any case.
Sorts the given list of organizeritems cs according to the provided sortOrders
bool QOrganizerItemManagerEngine::startRequest ( QOrganizerItemAbstractRequest * req ) [virtual]
Asks the manager engine to begin the given request req which is currently in a (re)startable state. Returns true if the request was started successfully, else returns false.
Generally, the engine queues the request and processes it at some later time (probably in another thread).
Once a request is started, the engine should call the updateRequestState and/or the specific updateXXXXXRequest functions to mark it in the active state.
If the engine is particularly fast, or the operation involves only in memory data, the request can be processed and completed without queueing it.
Note that when the client is threaded, and the request might live on a different thread, the engine needs to be careful with locking. In particular, the request might be deleted while the engine is still working on it. In this case, the requestDestroyed function will be called while the request is still valid, and that function should block until the worker thread (etc.) has been notified not to touch that request any more.
See also QOrganizerItemAbstractRequest::start().
QList<QVariant::Type> QOrganizerItemManagerEngine::supportedDataTypes () const [virtual]
Returns the list of data types supported by this engine.
QStringList QOrganizerItemManagerEngine::supportedItemTypes () const [virtual]
Returns the list of item types which are supported by this engine. This is a convenience function, equivalent to retrieving the allowable values for the QOrganizerItemType::FieldType field of the QOrganizerItemType definition which is valid in this engine.
bool QOrganizerItemManagerEngine::testFilter ( const QOrganizerItemFilter & filter, const QOrganizerItem & organizeritem ) [static]
Returns true if the supplied item organizeritem matches the supplied filter filter.
This function will test each condition in the filter, possibly recursing.
Updates the given QOrganizerItemDetailDefinitionFetchRequest req with the latest results result, 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.
Updates the given QOrganizerItemDetailDefinitionRemoveRequest req with the 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.
Updates the given QOrganizerItemDetailDefinitionSaveRequest req with the latest results result, 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.
Updates the given QOrganizerItemFetchRequest req with the latest results result, and operation error error. 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.
Updates the given QOrganizerItemInstanceFetchRequest req with the latest results result, and operation error error. 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.
Updates the given QOrganizerItemLocalIdFetchRequest req with the latest results result, and operation error error. 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.
Updates the given QOrganizerItemRemoveRequest req with the 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.
Updates the given QOrganizerItemSaveRequest req with the latest results result, 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.
Updates the given asynchronous request req by setting the new state of the request. If the new state is different, the stateChanged() signal will be emitted by the request.
Checks that the given detail definition definition seems valid, with a correct id, defined fields, and any specified value types are supported by this engine. This function is called before trying to save a definition.
Returns true if the definition seems valid, otherwise returns false.
Any errors encountered during this operation should be stored to error.
bool QOrganizerItemManagerEngine::validateItem ( const QOrganizerItem & organizeritem, QOrganizerItemManager::Error * error ) const [virtual]
Checks that the given item organizeritem does not have details which don't conform to a valid definition, violate uniqueness constraints, or contain values for nonexistent fields, and that the values contained are of the correct type for each field, and are allowable values for that field.
Note that this function is unable to ensure that the access constraints (such as CreateOnly and ReadOnly) are observed; backend specific code must be written if you wish to enforce these constraints.
Returns true if the organizeritem is valid according to the definitions for its details, otherwise returns false.
Any errors encountered during this operation should be stored to error.
bool QOrganizerItemManagerEngine::waitForRequestFinished ( QOrganizerItemAbstractRequest * req, int msecs ) [virtual]
Blocks until the manager engine has completed the given request req which was previously started, or until msecs milliseconds have passed. Returns true if the request was completed, and false if the request was not in the QOrganizerItemAbstractRequest::Active state or no progress could be reported.
It is important that this function is implemented by the engine, at least merely as a delay, since clients may call it in a loop.
See also startRequest().