OrganizerModelThe OrganizerModel element provides access to organizer items from the organizer store. More... Inherits QtObject Properties
Signals
Methods
Detailed DescriptionOrganizerModel provides a model of organizer items from the organizer store. The contents of the model can be specified with filter, sortOrders and fetchHint properties. Whether the model is automatically updated when the store or C++ organizer item changes, can be controlled with OrganizerModel::autoUpdate property. There are two ways of accessing the organizer item data: via the model by using views and delegates, or alternatively via items list property. Of the two, the model access is preferred. Direct list access (i.e. non-model) is not guaranteed to be in order set by sortOrder. At the moment the model roles provided by OrganizerModel are display and item. Through the item role can access any data provided by the OrganizerItem element. Note: Both the startPeriod and endPeriod are set by default to the current time (when the OrganizerModel was created). In most cases, both (or at least one) of the startPeriod and endPeriod should be set; otherwise, the OrganizerModel will contain zero items because the startPeriod and endPeriod are the same value. For example, if only endPeriod is provided, the OrganizerModel will contain all items from now (the time of the OrganizerModel's creation) to the endPeriod time. See also OrganizerItem and QOrganizerManager. Property DocumentationDefines the errors cases for OrganizerModel::importItems() -function.
Defines the different storage locations for saving items and model population purposes.
Depending on the platform, the access rights for different storage locations might vary. See also OrganizerModel::storageLocations, OrganizerModel::saveCollection(), and OrganizerModel::saveItem(). This property indicates whether or not the organizer model should be updated automatically, default value is true. See also OrganizerModel::update(). This property holds the list of available manager names. This property is read only. This property holds a list of collections in the organizer model. See also Collection. This property holds the end date and time period used by the organizer model to fetch organizer items. The default value is the datetime of OrganizerModel creation. This property holds the latest error code returned by the organizer manager. This property is read only. This property holds the fetch hint instance used by the organizer model. See also FetchHint. This property holds the filter instance used by the organizer model. Set filter property to 'null', when you want to reset it to default value. See also Filter. This property holds the size of organizer items the OrganizerModel currently holds. This property is read only. This property holds a list of organizer items in the organizer model. See also OrganizerItem. This property holds the manager name or manager uri of the organizer backend engine. The manager uri format: qtorganizer:<managerid>:<key>=<value>&<key>=<value>. For example, memory organizer engine has an optional id parameter, if user want to share the same memory engine with multiple OrganizerModel instances, the manager property should declared like this: model : OrganizerModel {
manager:"qtorganizer:memory:id=organizer1
}
instead of just the manager name: model : OrganizerModel {
manager:"memory"
}
See also QOrganizerManager::fromUri(). This property holds the manager name of the organizer backend engine. This property is read only. See also QOrganizerManager::fromUri(). This property holds a list of sort orders used by the organizer model. See also SortOrder. This property holds the start date and time period used by the organizer model to fetch organizer items. The default value is the datetime of OrganizerModel creation. This property indicates which storage locations are used to populate the declarative model. As the type of property is int, it can be utilized as flag with several values. storageLocations is a backend specific feature. Some backends support it and some might just ignore it. If backend is having some specific requirements and they're not met, backend returns StorageLocationsNotExistingError. See also OrganizerModel::StorageLocation. Signal DocumentationThis signal is emitted, when OrganizerModel::importItems() completes. The success of operation can be seen on error which is defined in OrganizerModel::ImportError. url indicates the file, which was imported. If the operation was succesful, items are now imported to backend. If OrganizerModel::autoUpdate is enabled, OrganizerModel::modelChanged will be emitted when imported items are also visible on OrganizerModel's data model. This signal is emitted, when there are changes in items contained by OrganizerModel's data model. Items have either been added, removed or modified. This signal is also always emitted during OrganizerModel construction when data model is ready for use, even in cases when data model is not having any items in it. This handler is called when request of the given requestId is finished with the fetchedItems. See also fetchItems. This signal is emitted, when OrganizerModel::storageLocations property changes. See also OrganizerModel::storageLocations. Method DocumentationReturns the Collection object which collection id is the given collectionId and null if collection id is not found. Returns the default Collection object. Returns the OrganizerItem object with the given itemId. Returns true if there is at least one OrganizerItem between the given date range. Both the start and end parameters are optional, if no end parameter, returns true if there are item(s) after start, if neither start nor end date time provided, returns true if items in the current model is not empty, otherwise return false. See also itemIds(). Cancel the running organizer model content update request. See also OrganizerModel::autoUpdate and OrganizerModel::update. Export organizer items into a vcalendar file to the given url by optional profiles. At the moment only the local file url is supported in export method. Fetch asynchronously a list of organizer collections from the organizer backend. Import organizer items from a vcalendar by the given url and optional profiles. Only one import operation can be active at a time. Starts a request to fetch items by the given itemIds, and returns the unique ID of this request. -1 is returned if the request can't be started. Note that the items fetched won't be added to the model, but can be accessed through the onItemsFetched handler. See also onItemsFetched. Returns the list of organizer items between the given start and end period. Returns a list of booleans telling if there is any item falling in the given time range. For example, if the start time is 2011-12-08 14:00:00, the end time is 2011-12-08 20:00:00, and the interval is 3600 (seconds), a list of size 6 is returned, telling if there is any item falling in the range of 14:00:00 to 15:00:00, 15:00:00 to 16:00:00, ..., 19:00:00 to 20:00:00. Returns the list of organizer item ids between the given date range start and end, excluding generated occurrences. Both the start and end parameters are optional, if no end parameter, returns all item ids from start, if neither start nor end date time provided, returns all item ids in the current model. See also containsItems(). Removes asynchronously the organizer collection with the given collectionId from the backend. Removes the given organizer item from the backend. Removes the organizer item with the given itemId from the backend. Removes asynchronously the organizer items in the given items list from the backend. Removes asynchronously the organizer items with the given ids from the backend. Saves asynchronously the given collection into the organizer backend. The location for storing collection can be defined with optional storageLocation for new collections. If optional storageLocation is not given, collection will be stored to UserDataStorage. When collection is updated, ie saved again, storageLocation is ignored and collection is saved to the same location where it was originally saved. Saves asynchronously the given item into the organizer backend. The location for storing item can be defined with optional storageLocation for new items. If optional storageLocation is not given, item will be stored to UserDataStorage. When item is updated, ie saved again, storageLocation is ignored and item is saved to the same location where it was originally saved. Manually update the organizer model content including both items and collections. See also OrganizerModel::updateItems, OrganizerModel::updateCollections, and OrganizerModel::autoUpdate. Manually update the organizer model collections. See also OrganizerModel::update, OrganizerModel::updateItems, and OrganizerModel::autoUpdate. Manually update the organizer model items. See also OrganizerModel::update, OrganizerModel::updateCollections, and OrganizerModel::autoUpdate. |