QOrganizerManager ClassThe QOrganizerManager class provides an interface which allows clients with access to organizer item and collection information stored in a particular backend. More... #include <QOrganizerManager> Inherits: QObject. Public Types
Public Functions
Signals
Static Public Members
Macros
Additional Inherited Members
Detailed DescriptionThe QOrganizerManager class provides an interface which allows clients with access to organizer item and collection information stored in a particular backend. This class provides synchronous methods to retrieve and manipulate organizer item information, collection information, as well as functionality reporting and error information reporting. Clients can also use the use-case-specific classes derived from QOrganizerAbstractRequest to retrieve and manipulate organizer items and collections in an asynchronous manner. However, certain functionality (e.g. backend functionality reporting) can not be accessed using the asynchronous APIs. See the synchronous and asynchronous API information from the organizer module API documentation for more details. When constructing a QOrganizerManager instance, certain parameters can be given to provide more control, e.g. to specify the version of the backend it wants to construct. Note that the parameters returned when calling managerParameters() are not necessarily the same as the ones passed in, since certain parameters might be discarded or added by the backend. Member Type Documentation
|
Constant | Value | Description |
---|---|---|
QOrganizerManager::NoError | 0 | The most recent operation was successful |
QOrganizerManager::DoesNotExistError | 1 | The most recent operation failed because the requested organizer item or detail definition does not exist |
QOrganizerManager::AlreadyExistsError | 2 | The most recent operation failed because the specified organizer item or detail definition already exists |
QOrganizerManager::InvalidDetailError | 3 | The most recent operation failed because the specified organizer detail definition already exists |
QOrganizerManager::LockedError | 4 | The most recent operation failed because the datastore specified is currently locked |
QOrganizerManager::DetailAccessError | 5 | The most recent operation failed because a detail was modified or removed and its access method does not allow that |
QOrganizerManager::PermissionsError | 6 | The most recent operation failed because the caller does not have permission to perform the operation |
QOrganizerManager::OutOfMemoryError | 7 | The most recent operation failed due to running out of memory |
QOrganizerManager::NotSupportedError | 8 | The most recent operation failed because the requested operation is not supported in the specified store |
QOrganizerManager::BadArgumentError | 9 | The most recent operation failed because one or more of the parameters to the operation were invalid |
QOrganizerManager::UnspecifiedError | 10 | The most recent operation failed for an undocumented reason |
QOrganizerManager::LimitReachedError | 11 | The most recent operation failed because the limit for that type of object has been reached |
QOrganizerManager::InvalidItemTypeError | 12 | The most recent operation failed because the item given was of an invalid type for the operation |
QOrganizerManager::InvalidCollectionError | 13 | The most recent operation failed because the collection is invalid |
QOrganizerManager::InvalidOccurrenceError | 14 | The most recent operation failed because it was an attempt to save an occurrence without a correct InstanceOrigin detail |
QOrganizerManager::TimeoutError | 15 | The most recent operation failed because it took longer than expected. It may be possible to try again. |
QOrganizerManager::InvalidStorageLocationError | 16 | The most recent operation failed because the storage location is invalid |
QOrganizerManager::MissingPlatformRequirementsError | 17 | Backend implementation might have certain requirements to work and if they're not met this error is returned. Check backend specific documentation. |
Backend specific documentation might have more details on exact error cases.
This enumeration describes the operation that has been done to the item or collection modified.
Constant | Value | Description |
---|---|---|
QOrganizerManager::Add | 0 | The item / collection has been added. |
QOrganizerManager::Change | 1 | The item / collection has been changed. |
QOrganizerManager::Remove | 2 | The item / collection has been removed. |
Constructs a QOrganizerManager whose backend is identified by managerName with the given parameters, and the parent object is parent.
The default backend, i.e. the first one returned by the availableManagers() function, for the platform will be created, if the managerName is empty. If the backend identified by managerName does not exist, an invalid backend is created.
Constructs a QOrganizerManager whose parent object is parent.
The default backend, i.e. the first one returned by the availableManagers() function, for the platform will be created.
Frees the memory used by the QOrganizerManager.
Returns a list of available manager names that can be used to construct a QOrganizerManager.
Returns a URI that describes a manager name, parameters, and version with which to instantiate a manager object, from the given managerName and params.
Returns the collection identified by the given collectionId which is managed by this manager.
Returns a list of all of the collections managed by this manager.
This signal is emitted at some point once the collections identified by collectionIds have been added to a datastore managed by this manager.
This signal will not be emitted if the dataChanged() signal was previously emitted for these changes.
See also dataChanged().
This signal is emitted at some point once the metadata for the collections identified by collectionIds have been modified in a datastore managed by this manager.
This signal will not be emitted if items in the collections have been added, modified, or removed.
This signal will not be emitted if the dataChanged() signal was previously emitted for these changes.
See also dataChanged().
This signal is emitted at some point once the collections have been modified in a datastore managed by this manager. In the collectionIds list, the collection ID tells which item has been modified with the corresponding operation.
This signal will not be emitted if the dataChanged() signal was previously emitted for these changes.
See also dataChanged().
This signal is emitted at some point once the collections identified by collectionIds have been removed from a datastore managed by this manager.
This signal will not be emitted if the dataChanged() signal was previously emitted for these changes.
See also dataChanged().
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.
See also itemsAdded(), itemsChanged(), and itemsRemoved().
Returns the default collection managed by this manager. There is always only one default collection for each backend.
Return the error code of the most recent operation.
See also errorMap().
Returns per-input error codes for the most recent operation.
This function only returns meaningful information if the most recent operation was a batch operation.
Each key in the map is the index of the element in the input list for which the error (whose error code is stored in the value for that key in the map) occurred during the batch operation.
See also error(), saveItems(), and removeItems().
Return a list of QOrganizerItemId extracted from the items.
Constructs a QOrganizerManager whose name, parameters, and version are specified in the given uri, and whose parent object is parent.
Returns the organizer item in the database identified by itemId, or an empty item if the specified item does not exist.
The fetchHint allows clients to specify which pieces of information they are interested or not interested in, to allow backends to optimise data retrieval if possible. Note that it is simply a hint; backends can ignore the fetchHint and return the full item. If a client makes changes to an organizer item which has been retrieved with a fetch hint, they should save it back using a partial save, masked by the same set of detail types in order to avoid information loss.
Returns a list of item IDs of persisted organizer items 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 startDateTime and endDateTime, inclusive.
A default-constructed (invalid) startDateTime specifies an open start date time (matches anything which occurs up until the endDateTime), and a default-constructed (invalid) endDateTime specifies an open end date time (matches anything which occurs after the startDateTime). If both the startDateTime and endDateTime are invalid, this function will return the IDs of all items which match the filter criteria.
Note that certain backends may ignore the given filter.
Returns a list of a maximum of maxCount organizer item instances which are occurrences of the given parentItem recurring item, which occur between the given startDateTime and the given endDateTime date, inclusive.
A default-constructed (invalid) startDateTime specifies an open start date time (matches anything which occurs up until the endDateTime), and a default-constructed (invalid) endDateTime specifies an open end date time (matches anything which occurs after the startDateTime). If both the startDateTime and endDateTime are invalid, this function will return the IDs of all items.
Note that backends will decide how many occurrences are returned if maxCount is negative.
The fetchHint allows clients to specify which pieces of information they are interested or not interested in, to allow backends to optimise data retrieval if possible. Note that it is simply a hint; backends can ignore the fetchHint and return the full item. If a client makes changes to an organizer item which has been retrieved with a fetch hint, they should save it back using a partial save, masked by the same set of detail types in order to avoid information loss.
Returns the organizer items in the database identified by itemIds.
The items fetched by the backend should have a one-to-one correspondence to the IDs passed into this class. That is, the nth item in the returned list should have an ID which is equal to the nth ID in the list of IDs. Any invalid ID should correspond to an empty QOrganizerItem.
The fetchHint allows clients to specify which pieces of information they are interested or not interested in, to allow backends to optimise data retrieval if possible. Note that it is simply a hint; backends can ignore the fetchHint and return the full item. If a client makes changes to an organizer item which has been retrieved with a fetch hint, they should save it back using a partial save, masked by the same set of detail types in order to avoid information loss.
Calling errorMap() will return the per-input errors for the fetch. The QOrganizerManager::error() function will only return QOrganizerManager::NoError if all organizer items are fetched successfully.
Returns a list of a maximum of maxCount organizer items and occurrences that match the given filter, which occur in the range specified by the given startDateTime and endDateTime, inclusive, and sorted according to the given list of sortOrders.
A default-constructed (invalid) startDateTime specifies an open start date time (matches anything which occurs up until the endDateTime), and a default-constructed (invalid) endDateTime specifies an open end date time (matches anything which occurs after the startDateTime). If both the startDateTime and endDateTime are invalid, this function will return the IDs of all items which match the filter criteria.
If no sort order is provided, the list is returned sorted by date.
Note that certain backends may ignore the given filter.
Note that backends will decide how many items are returned if maxCount is negative.
The fetchHint allows clients to specify which pieces of information they are interested or not interested in, to allow backends to optimise data retrieval if possible. Note that it is simply a hint; backends can ignore the fetchHint and return the full item. If a client makes changes to an organizer item which has been retrieved with a fetch hint, they should save it back using a partial save, masked by the same set of detail types in order to avoid information loss.
This signal is emitted at some point once the items identified by itemIds have been added to a datastore managed by this manager.
This signal will not be emitted if the dataChanged() signal was previously emitted for these changes.
See also dataChanged().
This signal is emitted at some point once the items identified by itemIds have been modified in a datastore managed by this manager.
This signal will not be emitted if the dataChanged() signal was previously emitted for these changes.
See also dataChanged().
Returns a list of organizer items 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 startDateTime and endDateTime, inclusive.
A default-constructed (invalid) startDateTime specifies an open start date time (matches anything which occurs up until the endDateTime), and a default-constructed (invalid) endDateTime specifies an open end date time (matches anything which occurs after the startDateTime). If both the startDateTime and endDateTime are invalid, this function will return the IDs of all items which match the filter criteria.
This function will only return parent items and persisted exceptions which match the specified criteria; not generated occurrences.
Note that certain backends may ignore the given filter.
The fetchHint allows clients to specify which pieces of information they are interested or not interested in, to allow backends to optimise data retrieval if possible. Note that it is simply a hint; backends can ignore the fetchHint and return the full item. If a client makes changes to an organizer item which has been retrieved with a fetch hint, they should save it back using a partial save, masked by the same set of detail types in order to avoid information loss.
This signal is emitted at some point once the items have been modified in a datastore managed by this manager. In the itemIds list, the item ID tells which item has been modified with the corresponding operation.
This signal will not be emitted if the dataChanged() signal was previously emitted for these changes.
See also dataChanged().
This signal is emitted at some point once the items identified by itemIds have been removed from a datastore managed by this manager.
This signal will not be emitted if the dataChanged() signal was previously emitted for these changes.
See also dataChanged().
Returns the manager name for the backend.
Return the parameters used by the backend.
Note that if certain paramters are invalid, or discarded by the backend, they will not be returned. Also, the backend might add certain parameters when being constructed.
Return the URI describing the backend.
This is now obsoleted, and will be removed soon. Please parse the version from managerParameters().
Splits the given uri into the manager name and parameters that it describes, and places the information into the memory addressed by pManagerName and pParams respectively. Returns true if uri could be split successfully, otherwise returns false.
Removes the collection identified by the given collectionId (and all items in the collection) from the manager. Returns true on success, false on failure.
If the given collectionId does not exist, the operation will fail and QOrganizerManager::DoesNotExistError will be returned when calling error().
If the given collectionId refers to the default collection, the operation will fail and QOrganizerManager::PermissionsError will be returned when calling error().
Removes all the item whose ID is itemId, and all its occurrences. Returns true if the item and occurrences are successfully removed, or false otherwise.
See also removeItems.
Remove the organizer item from the database. If item is a generated occurrence, the start date of the occurrence is added to its parent item's exception date list. Returns true if the organizer item was removed successfully, otherwise returns false.
See also removeItems.
Removes all the items whose ID is contained in the given list of itemIds, and all the occurrences whose parent ID is containd in the itemIds. Returns true if all the items and occurrences are successfully removed, or false otherwise.
Calling errorMap() will return the per-input errors for the operation. The error() function will only return QOrganizerManager::NoError if all organizer items were saved successfully.
See also removeItem.
Removes every organizer item which is contained in the list of organizer items items. If the list contains generated occurrences the start date of the occurrence is added to its parent item's exception date list. Returns true if all organizer items were removed successfully, otherwise false.
Calling errorMap() will return the per-input errors for the latest batch function. The QOrganizerManager::error() function will only return QOrganizerManager::NoError if all organizer items were removed successfully.
If the given list of organizer items is empty, the function will return false and calling error() will return QOrganizerManager::BadArgumentError. If the list is non-empty and contains items which are not a valid organizer item in the manager, the function will remove any valid organizer items in the items list, insert QOrganizerManager::DoesNotExist entries into the error map for the indices of invalid id in the items list, return false, and set the overall operation error to QOrganizerManager::DoesNotExistError.
See also QOrganizerManager::removeItem().
Saves the given collection to the backend, and returns true on success or false otherwise.
Note that certain backends may not allow modification nor adding new collections, in such cases the operation will fail and result a QOrganizerManager::PermissionsError error.
A new collection will be created in the backend store if the collection ID of it is null. Otherwise, an existing collection with the same ID will be updated. If the given collection ID does not exist in the backend, it will result a QOrganizerManager::DoesNotExistError error.
Note that upon successful saving, the backend may update the collection, e.g. collection ID for newly saved collections.
Saves the given item to the backend, and returns true on success or false otherwise.
A new organizer item will be created in the backend store if the item ID of it is null. Otherwise, an existing item with the same ID will be updated. If the given item ID does not exist in the backend, it will result a QOrganizerManager::DoesNotExistError error.
If the collection ID of the item is null, it will be saved to the default collection. If the given collection ID doesn't exist, the saving will fail.
If the detailMask is empty, only the details currently existing in the item will be saved. Otherwise, only details masked by the detailMask will be saved or updated, others are kept untouched. It's useful to avoid information loss if the items are retrieved with a fetch hint.
Note that upon successful saving, the backend may update the item, e.g. item ID for newly saved items, GUID, timestamp, version, etc.
See also saveItems.
Saves the given list of items to the backend, and returns true on success or false otherwise.
A new organizer item will be created in the backend store if the item ID of it is null. Otherwise, an existing item with the same ID will be updated. If the given item ID does not exist in the backend, it will result a QOrganizerManager::DoesNotExistError error.
If the collection ID of the item is null, it will be saved to the default collection. If the given collection ID doesn't exist, the saving will fail.
If the detailMask is empty, only the details currently existing in the item will be saved. Otherwise, only details masked by the detailMask will be saved or updated, others are kept untouched. It's useful to avoid information loss if the items are retrieved with a fetch hint.
Note that upon successful saving, the backend may update the item, e.g. item ID for newly saved items, GUID, timestamp, version, etc.
Calling errorMap() will return the per-input errors for the operation. The error() function will only return QOrganizerManager::NoError if all organizer items were saved successfully.
See also saveItem.
Returns the list of supported filters by this manager.
Returns the list of details that are supported by this manager for the given itemType.
Returns the list of organizer item types supported by this manager.