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  · 

QOrganizerManagerEngine Class Reference

The QOrganizerManagerEngine class provides the interface for all implementations of the organizer item manager backend functionality. More...

 #include <QOrganizerManagerEngine>

Inherits QObject.

Inherited by QOrganizerItemInvalidEngine.

Public Functions

QOrganizerManagerEngine ()
virtual bool cancelRequest ( QOrganizerAbstractRequest * req )
virtual QOrganizerCollection collection ( const QOrganizerCollectionId & collectionId, QOrganizerManager::Error * error ) const
virtual QList<QOrganizerCollection> collections ( QOrganizerManager::Error * error ) const
virtual QOrganizerCollection compatibleCollection ( const QOrganizerCollection & original, QOrganizerManager::Error * error ) const
virtual QOrganizerItem compatibleItem ( const QOrganizerItem & original, QOrganizerManager::Error * error ) const
virtual QOrganizerCollection defaultCollection ( QOrganizerManager::Error * error ) const
virtual QOrganizerItemDetailDefinition detailDefinition ( const QString & definitionName, const QString & organizeritemType, QOrganizerManager::Error * error ) const
virtual QMap<QString, QOrganizerItemDetailDefinition> detailDefinitions ( const QString & organizeritemType, QOrganizerManager::Error * error ) const
virtual bool hasFeature ( QOrganizerManager::ManagerFeature feature, const QString & organizeritemType ) const
virtual bool isFilterSupported ( const QOrganizerItemFilter & filter ) const
virtual QOrganizerItem item ( const QOrganizerItemId & organizeritemId, const QOrganizerItemFetchHint & fetchHint, QOrganizerManager::Error * error ) const
virtual QList<QOrganizerItemId> itemIds ( const QDateTime & startDate, const QDateTime & endDate, const QOrganizerItemFilter & filter, const QList<QOrganizerItemSortOrder> & sortOrders, QOrganizerManager::Error * error ) const
virtual QList<QOrganizerItem> itemOccurrences ( const QOrganizerItem & parentItem, const QDateTime & periodStart, const QDateTime & periodEnd, int maxCount, const QOrganizerItemFetchHint & fetchHint, QOrganizerManager::Error * error ) const
virtual QList<QOrganizerItem> items ( const QDateTime & startDate, const QDateTime & endDate, const QOrganizerItemFilter & filter, const QList<QOrganizerItemSortOrder> & sortOrders, const QOrganizerItemFetchHint & fetchHint, QOrganizerManager::Error * error ) const
virtual QList<QOrganizerItem> itemsForExport ( const QDateTime & startDate, const QDateTime & endDate, const QOrganizerItemFilter & filter, const QList<QOrganizerItemSortOrder> & sortOrders, const QOrganizerItemFetchHint & fetchHint, QOrganizerManager::Error * error ) const
virtual QString managerName () const = 0
virtual QMap<QString, QString> managerParameters () const
QString managerUri () const
virtual int managerVersion () const = 0
virtual bool removeCollection ( const QOrganizerCollectionId & collectionId, QOrganizerManager::Error * error )
virtual bool removeDetailDefinition ( const QString & definitionName, const QString & organizeritemType, QOrganizerManager::Error * error )
virtual bool removeItem ( const QOrganizerItemId & organizeritemId, QOrganizerManager::Error * error )
virtual bool removeItems ( const QList<QOrganizerItemId> & organizeritemIds, QMap<int, QOrganizerManager::Error> * errorMap, QOrganizerManager::Error * error )
virtual void requestDestroyed ( QOrganizerAbstractRequest * req )
virtual bool saveCollection ( QOrganizerCollection * collection, QOrganizerManager::Error * error )
virtual bool saveDetailDefinition ( const QOrganizerItemDetailDefinition & def, const QString & organizeritemType, QOrganizerManager::Error * error )
virtual bool saveItem ( QOrganizerItem * organizeritem, QOrganizerManager::Error * error )
virtual bool saveItems ( QList<QOrganizerItem> * organizeritems, QMap<int, QOrganizerManager::Error> * errorMap, QOrganizerManager::Error * error )
virtual bool startRequest ( QOrganizerAbstractRequest * req )
virtual QStringList supportedItemTypes () const
virtual bool validateCollection ( const QOrganizerCollection & collection, QOrganizerManager::Error * error ) const
virtual bool validateDefinition ( const QOrganizerItemDetailDefinition & definition, QOrganizerManager::Error * error ) const
virtual bool validateItem ( const QOrganizerItem & organizeritem, QOrganizerManager::Error * error ) const
virtual bool waitForRequestFinished ( QOrganizerAbstractRequest * req, int msecs )
  • 29 public functions inherited from QObject

Signals

void collectionsAdded ( const QList<QOrganizerCollectionId> & collectionIds )
void collectionsChanged ( const QList<QOrganizerCollectionId> & collectionIds )
void collectionsRemoved ( const QList<QOrganizerCollectionId> & collectionIds )
void dataChanged ()
void itemsAdded ( const QList<QOrganizerItemId> & organizeritemIds )
void itemsChanged ( const QList<QOrganizerItemId> & organizeritemIds )
void itemsRemoved ( const QList<QOrganizerItemId> & 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 )
const QOrganizerCollectionEngineId * engineCollectionId ( const QOrganizerCollectionId & id )
const QOrganizerItemEngineId * engineItemId ( const QOrganizerItemId & id )
bool isItemBetweenDates ( const QOrganizerItem & item, const QDateTime & startPeriod, const QDateTime & endPeriod )
QMap<QString, QMap<QString, QOrganizerItemDetailDefinition> > schemaDefinitions ( int version = 1 )
void setDetailAccessConstraints ( QOrganizerItemDetail * detail, QOrganizerItemDetail::AccessConstraints constraints )
bool testFilter ( const QOrganizerItemFilter & filter, const QOrganizerItem & organizeritem )
void updateCollectionFetchRequest ( QOrganizerCollectionFetchRequest * req, const QList<QOrganizerCollection> & result, QOrganizerManager::Error error, QOrganizerAbstractRequest::State newState )
void updateCollectionRemoveRequest ( QOrganizerCollectionRemoveRequest * req, QOrganizerManager::Error error, const QMap<int, QOrganizerManager::Error> & errorMap, QOrganizerAbstractRequest::State newState )
void updateCollectionSaveRequest ( QOrganizerCollectionSaveRequest * req, const QList<QOrganizerCollection> & result, QOrganizerManager::Error error, const QMap<int, QOrganizerManager::Error> & errorMap, QOrganizerAbstractRequest::State newState )
void updateDefinitionFetchRequest ( QOrganizerItemDetailDefinitionFetchRequest * req, const QMap<QString, QOrganizerItemDetailDefinition> & result, QOrganizerManager::Error error, const QMap<int, QOrganizerManager::Error> & errorMap, QOrganizerAbstractRequest::State newState )
void updateDefinitionRemoveRequest ( QOrganizerItemDetailDefinitionRemoveRequest * req, QOrganizerManager::Error error, const QMap<int, QOrganizerManager::Error> & errorMap, QOrganizerAbstractRequest::State newState )
void updateDefinitionSaveRequest ( QOrganizerItemDetailDefinitionSaveRequest * req, const QList<QOrganizerItemDetailDefinition> & result, QOrganizerManager::Error error, const QMap<int, QOrganizerManager::Error> & errorMap, QOrganizerAbstractRequest::State newState )
void updateItemFetchForExportRequest ( QOrganizerItemFetchForExportRequest * req, const QList<QOrganizerItem> & result, QOrganizerManager::Error error, QOrganizerAbstractRequest::State newState )
void updateItemFetchRequest ( QOrganizerItemFetchRequest * req, const QList<QOrganizerItem> & result, QOrganizerManager::Error error, QOrganizerAbstractRequest::State newState )
void updateItemIdFetchRequest ( QOrganizerItemIdFetchRequest * req, const QList<QOrganizerItemId> & result, QOrganizerManager::Error error, QOrganizerAbstractRequest::State newState )
void updateItemOccurrenceFetchRequest ( QOrganizerItemOccurrenceFetchRequest * req, const QList<QOrganizerItem> & result, QOrganizerManager::Error error, QOrganizerAbstractRequest::State newState )
void updateItemRemoveRequest ( QOrganizerItemRemoveRequest * req, QOrganizerManager::Error error, const QMap<int, QOrganizerManager::Error> & errorMap, QOrganizerAbstractRequest::State newState )
void updateItemSaveRequest ( QOrganizerItemSaveRequest * req, const QList<QOrganizerItem> & result, QOrganizerManager::Error error, const QMap<int, QOrganizerManager::Error> & errorMap, QOrganizerAbstractRequest::State newState )
void updateRequestState ( QOrganizerAbstractRequest * req, QOrganizerAbstractRequest::State state )
  • 4 static public members inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QOrganizerManagerEngine class provides the interface for all implementations of the organizer item manager backend functionality.

Instances of this class are usually provided by a QOrganizerManagerEngineFactory, 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 QOrganizerManager and QOrganizerManagerEngineFactory.

Member Function Documentation

QOrganizerManagerEngine::QOrganizerManagerEngine ()

A default, empty constructor.

void QOrganizerManagerEngine::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 QOrganizerManagerEngine::cancelRequest ( QOrganizerAbstractRequest * 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 QOrganizerAbstractRequest::cancel().

QOrganizerItemFilter QOrganizerManagerEngine::canonicalizedFilter ( const QOrganizerItemFilter & filter ) [static]

Given an input filter, returns the canonical version of the filter.

Some of the following transformations may be applied:

QOrganizerCollection QOrganizerManagerEngine::collection ( const QOrganizerCollectionId & collectionId, QOrganizerManager::Error * error ) const [virtual]

Returns the collection identified by the given collectionId in the manager. Any errors encountered during this operation should be stored to error. If the given collectionId does not specify a valid collection, error will be set to QOrganizerManager::DoesNotExistError.

QList<QOrganizerCollection> QOrganizerManagerEngine::collections ( QOrganizerManager::Error * error ) const [virtual]

Returns the list of all of the collections managed by this manager. Any errors encountered during this operation should be stored to error.

void QOrganizerManagerEngine::collectionsAdded ( const QList<QOrganizerCollectionId> & collectionIds ) [signal]

This signal should be emitted at some point once the collections identified by collectionIds have been added to a datastore managed by this engine. This signal must not be emitted if the dataChanged() signal was previously emitted for these changes.

void QOrganizerManagerEngine::collectionsChanged ( const QList<QOrganizerCollectionId> & collectionIds ) [signal]

This signal should be emitted at some point once the metadata for the collections identified by collectionIds have been modified in a datastore managed by this engine. This signal is not emitted if one of the items in this collection has changed - itemsChanged() will be emitted instead. This signal must not be emitted if the dataChanged() signal was previously emitted for these changes.

void QOrganizerManagerEngine::collectionsRemoved ( const QList<QOrganizerCollectionId> & collectionIds ) [signal]

This signal should be emitted at some point once the collections identified by collectionIds have been removed from a datastore managed by this engine. This signal must not be emitted if the dataChanged() signal was previously emitted for these changes.

int QOrganizerManagerEngine::compareItem ( const QOrganizerItem & a, const QOrganizerItem & b, const QList<QOrganizerItemSortOrder> & sortOrders ) [static]

Compares two organizer items (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 QOrganizerManagerEngine::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.

QOrganizerCollection QOrganizerManagerEngine::compatibleCollection ( const QOrganizerCollection & original, QOrganizerManager::Error * error ) const [virtual]

Returns a pruned or modified version of the original collection which is valid and can be saved in the manager. The returned item might have meta data removed or arbitrarily changed. Any error which occurs will be saved to error. By default, modifiable collections are not supported, and so this function always returns false. Any engine which supports mutable collections should reimplement this function.

QOrganizerItem QOrganizerManagerEngine::compatibleItem ( const QOrganizerItem & original, QOrganizerManager::Error * error ) const [virtual]

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. Any error which occurs will be saved to error.

void QOrganizerManagerEngine::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().

QOrganizerCollection QOrganizerManagerEngine::defaultCollection ( QOrganizerManager::Error * error ) const [virtual]

Returns the default collection of the manager. Any errors encountered during this operation should be stored to error.

QOrganizerItemDetailDefinition QOrganizerManagerEngine::detailDefinition ( const QString & definitionName, const QString & organizeritemType, QOrganizerManager::Error * error ) const [virtual]

Returns the definition identified by the given definitionName that is valid for organizer items 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> QOrganizerManagerEngine::detailDefinitions ( const QString & organizeritemType, QOrganizerManager::Error * error ) const [virtual]

Returns the registered detail definitions which are valid for organizer items whose type is of the given organizeritemType in this engine.

Any errors encountered during this operation should be stored to error.

const QOrganizerCollectionEngineId * QOrganizerManagerEngine::engineCollectionId ( const QOrganizerCollectionId & id ) [static]

Returns the engine id from the given id. The caller does not take ownership of the pointer, and should not delete returned id or undefined behavior may occur.

const QOrganizerItemEngineId * QOrganizerManagerEngine::engineItemId ( const QOrganizerItemId & id ) [static]

Returns the engine id from the given id. The caller does not take ownership of the pointer, and should not delete returned id or undefined behavior may occur.

bool QOrganizerManagerEngine::hasFeature ( QOrganizerManager::ManagerFeature feature, const QString & organizeritemType ) const [virtual]

Returns true if the given feature is supported by this engine for organizer items of the given organizeritemType

bool QOrganizerManagerEngine::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.

bool QOrganizerManagerEngine::isItemBetweenDates ( const QOrganizerItem & item, const QDateTime & startPeriod, const QDateTime & endPeriod ) [static]

Returns true if the given item (or an occurrence of the item) occurs within the range specified by the startPeriod and the endPeriod, inclusive. A default-constructed startPeriod signifies that the lower bound of the range is infinitely small (i.e., will match anything up to the endPeriod) and a default-constructed endPeriod signifies that the upper bound of the range is infinitely large (i.e., will match anything which occurs after the startPeriod).

QOrganizerItem QOrganizerManagerEngine::item ( const QOrganizerItemId & organizeritemId, const QOrganizerItemFetchHint & fetchHint, QOrganizerManager::Error * error ) const [virtual]

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 QOrganizerManager::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 in the matching organizer items will be returned.

See also QOrganizerItemFetchHint.

QList<QOrganizerItemId> QOrganizerManagerEngine::itemIds ( const QDateTime & startDate, const QDateTime & endDate, const QOrganizerItemFilter & filter, const QList<QOrganizerItemSortOrder> & sortOrders, QOrganizerManager::Error * error ) const [virtual]

Returns a list of organizer item ids that match the given filter, sorted according to the given list of sortOrders, for any item which occurs (or has an occurrence which occurs) in the range specified by the given startDate and endDate. A default-constructed (invalid) startDate specifies an open start date (matches anything which occurs up until the endDate), and a default-constructed (invalid) endDate specifies an open end date (matches anything which occurs after the startDate). If both the startDate and endDate are invalid, this function will return the ids of all items which match the filter criteria.

Depending on the backend, this filtering operation may involve retrieving all the organizer items. Any error which occurs will be saved in error.

QList<QOrganizerItem> QOrganizerManagerEngine::itemOccurrences ( const QOrganizerItem & parentItem, const QDateTime & periodStart, const QDateTime & periodEnd, int maxCount, const QOrganizerItemFetchHint & fetchHint, QOrganizerManager::Error * error ) const [virtual]

Return the list of a maximum of maxCount organizer item instances which are occurrences of the given parentItem 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 QOrganizerManager::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 parentItem is an item of type QOrganizerItemType::TypeEvent, a list of items of type QOrganizerItemType::TypeEventOccurrence will be returned, representing the expansion of the parent item according to its QOrganizerItemRecurrence detail. Similarly, a parentItem of type QOrganizerItemType::TypeTodo will result in a list of QOrganizerItemType::TypeTodoOccurrence items. If the parentItem is of any other type, it is returned by itself from the backend.

The occurrence-typed items returned should have a QOrganizerItemParent detail that refers to the parent item 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 parentItem does not exist in the backend, or if there are no instances matching the criteria, an empty list should be returned.

The fetchHint parameter is a hint to the manager about which details the client is interested in. It allows the manager to optimize retrieval of occurrences. The manager may ignore the fetchHint, but if it does so each item occurrence it returns must include all of the details associated with it in the database.

QList<QOrganizerItem> QOrganizerManagerEngine::items ( const QDateTime & startDate, const QDateTime & endDate, const QOrganizerItemFilter & filter, const QList<QOrganizerItemSortOrder> & sortOrders, const QOrganizerItemFetchHint & fetchHint, QOrganizerManager::Error * error ) const [virtual]

Returns the list of organizer items which match the given filter stored in the manager sorted according to the given list of sortOrders, for any item or item occurrence which occurs in the range specified by the given startDate and endDate. A default-constructed (invalid) startDate specifies an open start date (matches anything which occurs up until the endDate), and a default-constructed (invalid) endDate specifies an open end date (matches anything which occurs after the startDate). If both the startDate and endDate are invalid, this function will return all items which match the filter criteria.

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 in the matching organizer items will be returned.

See also QOrganizerItemFetchHint.

void QOrganizerManagerEngine::itemsAdded ( const QList<QOrganizerItemId> & organizeritemIds ) [signal]

This signal is emitted some time after a set of organizer items 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 organizer items, the timing cannot be determined.

The list of ids of organizer items added is given by organizeritemIds. There may be one or more ids in the list.

See also dataChanged().

void QOrganizerManagerEngine::itemsChanged ( const QList<QOrganizerItemId> & organizeritemIds ) [signal]

This signal is emitted some time after a set of organizer items 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 organizer items, the timing cannot be determined.

The list of ids of changed organizer items is given by organizeritemIds. There may be one or more ids in the list.

See also dataChanged().

QList<QOrganizerItem> QOrganizerManagerEngine::itemsForExport ( const QDateTime & startDate, const QDateTime & endDate, const QOrganizerItemFilter & filter, const QList<QOrganizerItemSortOrder> & sortOrders, const QOrganizerItemFetchHint & fetchHint, QOrganizerManager::Error * error ) const [virtual]

Returns the list of organizer items which match the given filter stored in the manager sorted according to the given list of sortOrders, for any persisted item which occurs (or has an occurrence which occurs) in the range specified by the given startDate and endDate. A default-constructed (invalid) startDate specifies an open start date (matches anything which occurs up until the endDate), and a default-constructed (invalid) endDate specifies an open end date (matches anything which occurs after the startDate). If both the startDate and endDate are invalid, this function will return all items which match the filter criteria.

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 in the matching organizer items will be returned.

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 ID.

See also QOrganizerItemFetchHint.

void QOrganizerManagerEngine::itemsRemoved ( const QList<QOrganizerItemId> & organizeritemIds ) [signal]

This signal is emitted some time after a set of organizer items 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 organizer items, the timing cannot be determined.

The list of ids of removed organizer items is given by organizeritemIds. There may be one or more ids in the list.

See also dataChanged().

QString QOrganizerManagerEngine::managerName () const [pure virtual]

Returns the manager name for this QOrganizerManagerEngine

QMap<QString, QString> QOrganizerManagerEngine::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 QOrganizerManagerEngine::managerUri () const

Returns the unique URI of this manager, which is built from the manager name and the parameters used to construct it.

int QOrganizerManagerEngine::managerVersion () const [pure virtual]

Returns the engine backend implementation version number

bool QOrganizerManagerEngine::removeCollection ( const QOrganizerCollectionId & collectionId, QOrganizerManager::Error * error ) [virtual]

Returns true if the removing of the collectionId was successfull otherwise false. Any errors encountered during this operation should be stored to error.

bool QOrganizerManagerEngine::removeDetailDefinition ( const QString & definitionName, const QString & organizeritemType, QOrganizerManager::Error * error ) [virtual]

Removes the definition identified by the given definitionName from the database, where it was valid for organizer items 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.

bool QOrganizerManagerEngine::removeItem ( const QOrganizerItemId & organizeritemId, QOrganizerManager::Error * error ) [virtual]

Remove the item identified by organizeritemId from the database. 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.

bool QOrganizerManagerEngine::removeItems ( const QList<QOrganizerItemId> & organizeritemIds, QMap<int, QOrganizerManager::Error> * errorMap, QOrganizerManager::Error * error ) [virtual]

Remove every item whose id is contained in the list of organizer items ids organizeritemIds. Returns true if all organizer items were removed successfully, otherwise false.

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 QOrganizerManager::error() function will only return QOrganizerManager::NoError if all organizer items were removed successfully.

If the list contains ids which do not identify a valid item in the manager, the function will remove any organizer items which are identified by ids in the organizeritemIds list, insert QOrganizerManager::DoesNotExist entries into the errorMap for the indices of invalid ids in the organizeritemIds list, return false, and set the overall operation error to QOrganizerManager::DoesNotExistError.

Any errors encountered during this operation should be stored to error.

See also QOrganizerManager::removeItem().

void QOrganizerManagerEngine::requestDestroyed ( QOrganizerAbstractRequest * 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<QOrganizerAbstractRequest*> (or QMap<QOrganizerAbstractRequest, 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 QOrganizerAbstractRequest::updateXXXXXXRequest functions. And be careful of lock ordering problems :D

bool QOrganizerManagerEngine::saveCollection ( QOrganizerCollection * collection, QOrganizerManager::Error * error ) [virtual]

Returns true if the saving of the collection was successfull otherwise false. Any errors encountered during this operation should be stored to error.

bool QOrganizerManagerEngine::saveDetailDefinition ( const QOrganizerItemDetailDefinition & def, const QString & organizeritemType, QOrganizerManager::Error * error ) [virtual]

Persists the given definition def in the database, which is valid for organizer items 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.

bool QOrganizerManagerEngine::saveItem ( QOrganizerItem * organizeritem, QOrganizerManager::Error * error ) [virtual]

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 id of zero, otherwise updates the organizer item 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 QOrganizerManager::DoesNotExistError.

The organizeritem will be added to the collection identified by the collectionId specified in the item (accessible via item->organizerId()) if it exists, and the item conforms to the schema supported for that collection. If the collection exists but the item does not conform to the schema supported for that collection, the function will return false, and the error will be set to QOrganizerManager::InvalidDetailError.

If the collectionId is not the default (zero) id, but does not identify a valid collection, the function will return false, and error will be set to QOrganizerManager::InvalidCollectionError. If the collectionId is the default (zero) id, the item should be saved in the collection in which it is already saved (if it is already saved in this manager), or in the default collection (if it is a new item in this manager).

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().

bool QOrganizerManagerEngine::saveItems ( QList<QOrganizerItem> * organizeritems, QMap<int, QOrganizerManager::Error> * errorMap, QOrganizerManager::Error * error ) [virtual]

Adds the list of organizer items given by organizeritems list to the database. Returns true if the organizer items 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 QOrganizerManager::error() function will only return QOrganizerManager::NoError if all organizer items 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.

Each item in the given list organizeritems will be added to the collection identified in the item (accessible via item->collectionId()) if it exists, and if the item conform to the schema supported for that collection. If the collection exists but the item does not conform to the schema supported for that collection, the function will return false, and the error in the errorMap for the item at that index will be set to QOrganizerManager::InvalidDetailError.

If the collectionId is not the default (zero) id, but does not identify a valid collection, the function will return false, and error will be set to QOrganizerManager::InvalidCollectionError. If the collectionId is the default (zero) id, the item should be saved in the collection in which it is already saved (if they are already saved in this manager), or in the default collection (if they are new items in this manager).

Any errors encountered during this operation should be stored to error.

See also QOrganizerManager::saveItem().

QMap<QString, QMap<QString, QOrganizerItemDetailDefinition> > QOrganizerManagerEngine::schemaDefinitions ( int version = 1 ) [static]

Returns the default schema definitions for the given version of the schema. Version 1 of the schema corresponds to version 1.1 of the Qt Mobility APIs.

void QOrganizerManagerEngine::setDetailAccessConstraints ( QOrganizerItemDetail * detail, QOrganizerItemDetail::AccessConstraints constraints ) [static]

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.

bool QOrganizerManagerEngine::startRequest ( QOrganizerAbstractRequest * 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 QOrganizerAbstractRequest::start().

QStringList QOrganizerManagerEngine::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 QOrganizerManagerEngine::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.

void QOrganizerManagerEngine::updateCollectionFetchRequest ( QOrganizerCollectionFetchRequest * req, const QList<QOrganizerCollection> & result, QOrganizerManager::Error error, QOrganizerAbstractRequest::State newState ) [static]

Updates the given QOrganizerCollectionFetchRequest 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.

void QOrganizerManagerEngine::updateCollectionRemoveRequest ( QOrganizerCollectionRemoveRequest * req, QOrganizerManager::Error error, const QMap<int, QOrganizerManager::Error> & errorMap, QOrganizerAbstractRequest::State newState ) [static]

Updates the given QOrganizerCollectionRemoveRequest 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.

void QOrganizerManagerEngine::updateCollectionSaveRequest ( QOrganizerCollectionSaveRequest * req, const QList<QOrganizerCollection> & result, QOrganizerManager::Error error, const QMap<int, QOrganizerManager::Error> & errorMap, QOrganizerAbstractRequest::State newState ) [static]

Updates the given QOrganizerCollectionSaveRequest 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.

void QOrganizerManagerEngine::updateDefinitionFetchRequest ( QOrganizerItemDetailDefinitionFetchRequest * req, const QMap<QString, QOrganizerItemDetailDefinition> & result, QOrganizerManager::Error error, const QMap<int, QOrganizerManager::Error> & errorMap, QOrganizerAbstractRequest::State newState ) [static]

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.

void QOrganizerManagerEngine::updateDefinitionRemoveRequest ( QOrganizerItemDetailDefinitionRemoveRequest * req, QOrganizerManager::Error error, const QMap<int, QOrganizerManager::Error> & errorMap, QOrganizerAbstractRequest::State newState ) [static]

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.

void QOrganizerManagerEngine::updateDefinitionSaveRequest ( QOrganizerItemDetailDefinitionSaveRequest * req, const QList<QOrganizerItemDetailDefinition> & result, QOrganizerManager::Error error, const QMap<int, QOrganizerManager::Error> & errorMap, QOrganizerAbstractRequest::State newState ) [static]

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.

void QOrganizerManagerEngine::updateItemFetchForExportRequest ( QOrganizerItemFetchForExportRequest * req, const QList<QOrganizerItem> & result, QOrganizerManager::Error error, QOrganizerAbstractRequest::State newState ) [static]

Updates the given QOrganizerItemFetchForExportRequest 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.

void QOrganizerManagerEngine::updateItemFetchRequest ( QOrganizerItemFetchRequest * req, const QList<QOrganizerItem> & result, QOrganizerManager::Error error, QOrganizerAbstractRequest::State newState ) [static]

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.

void QOrganizerManagerEngine::updateItemIdFetchRequest ( QOrganizerItemIdFetchRequest * req, const QList<QOrganizerItemId> & result, QOrganizerManager::Error error, QOrganizerAbstractRequest::State newState ) [static]

Updates the given QOrganizerItemIdFetchRequest 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.

void QOrganizerManagerEngine::updateItemOccurrenceFetchRequest ( QOrganizerItemOccurrenceFetchRequest * req, const QList<QOrganizerItem> & result, QOrganizerManager::Error error, QOrganizerAbstractRequest::State newState ) [static]

Updates the given QOrganizerItemOccurrenceFetchRequest 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.

void QOrganizerManagerEngine::updateItemRemoveRequest ( QOrganizerItemRemoveRequest * req, QOrganizerManager::Error error, const QMap<int, QOrganizerManager::Error> & errorMap, QOrganizerAbstractRequest::State newState ) [static]

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.

void QOrganizerManagerEngine::updateItemSaveRequest ( QOrganizerItemSaveRequest * req, const QList<QOrganizerItem> & result, QOrganizerManager::Error error, const QMap<int, QOrganizerManager::Error> & errorMap, QOrganizerAbstractRequest::State newState ) [static]

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.

void QOrganizerManagerEngine::updateRequestState ( QOrganizerAbstractRequest * req, QOrganizerAbstractRequest::State state ) [static]

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.

bool QOrganizerManagerEngine::validateCollection ( const QOrganizerCollection & collection, QOrganizerManager::Error * error ) const [virtual]

Returns true if the collection is valid and can be saved in the engine. By default, modifiable collections are not supported, so this function returns false, and error is set to QOrganizerManager::NotSupportedError. Engines which do implement mutable collections should reimplement this function.

bool QOrganizerManagerEngine::validateDefinition ( const QOrganizerItemDetailDefinition & definition, QOrganizerManager::Error * error ) const [virtual]

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 QOrganizerManagerEngine::validateItem ( const QOrganizerItem & organizeritem, QOrganizerManager::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 QOrganizerManagerEngine::waitForRequestFinished ( QOrganizerAbstractRequest * 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 QOrganizerAbstractRequest::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().

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

[0]; s.parentNode.insertBefore(ga, s); })();
Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 22
  2. Une nouvelle ère d'IHM 3D pour les automobiles, un concept proposé par Digia et implémenté avec Qt 3
  3. PySide devient un add-on Qt et rejoint le Qt Project et le modèle d'open gouvernance 1
  4. Qt Creator 2.5 est sorti en beta, l'EDI supporte maintenant plus de fonctionnalités de C++11 2
  5. Vingt sociétés montrent leurs décodeurs basés sur Qt au IPTV World Forum, en en exploitant diverses facettes (déclaratif, Web, widgets) 0
  6. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 5
  7. Thread travailleur avec Qt en utilisant les signaux et les slots, un article de Christophe Dumez traduit par Thibaut Cuvelier 1
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 49
  4. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  5. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 16
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
Page suivante

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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.1
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