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  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

OrganizerModel

The OrganizerModel element provides access to organizer items from the organizer store. More...

Inherits QtObject

Properties

Signals

Methods

Detailed Description

OrganizerModel 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 Documentation

ImportError : enumeration

Defines the errors cases for OrganizerModel::importItems() -function.

  • OrganizerModel::ImportNoError Completed succesfully, no error.
  • OrganizerModel::ImportUnspecifiedError Unspecified error.
  • OrganizerModel::ImportIOError Input/output error.
  • OrganizerModel::ImportOutOfMemoryError Out of memory error.
  • OrganizerModel::ImportNotReadyError Not ready for importing. Only one import operation can be active at a time.
  • OrganizerModel::ImportParseError Error during parsing.

StorageLocation : enumeration

Defines the different storage locations for saving items and model population purposes.

  • OrganizerModel::UserDataStorage A storage location where user data is usually stored.
  • OrganizerModel::SystemStorage A storage location where system files are usually stored.

Depending on the platform, the access rights for different storage locations might vary.

See also OrganizerModel::storageLocations, OrganizerModel::saveCollection(), and OrganizerModel::saveItem().


autoUpdate : bool

This property indicates whether or not the organizer model should be updated automatically, default value is true.

See also OrganizerModel::update().


read-onlyavailableManagers : list<string>

This property holds the list of available manager names. This property is read only.


read-onlycollections : list<Collection>

This property holds a list of collections in the organizer model.

See also Collection.


endPeriod : date

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.


read-onlyerror : string

This property holds the latest error code returned by the organizer manager.

This property is read only.


fetchHint : FetchHint

This property holds the fetch hint instance used by the organizer model.

See also FetchHint.


filter : Filter

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.


read-onlyitemCount : int

This property holds the size of organizer items the OrganizerModel currently holds.

This property is read only.


read-onlyitems : list<OrganizerItem>

This property holds a list of organizer items in the organizer model.

See also OrganizerItem.


manager : string

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


read-onlymanagerName : string

This property holds the manager name of the organizer backend engine. This property is read only.

See also QOrganizerManager::fromUri().


read-onlysortOrders : list<SortOrder>

This property holds a list of sort orders used by the organizer model.

See also SortOrder.


startPeriod : date

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.


storageLocations : int

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 Documentation

OrganizerModel::importCompleted()

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


OrganizerModel::modelChanged()

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.


OrganizerModel::onItemsFetched(int requestId, list<OrganizerItem> fetchedItems)

This handler is called when request of the given requestId is finished with the fetchedItems.

See also fetchItems.


OrganizerModel::storageLocationsChanged()

This signal is emitted, when OrganizerModel::storageLocations property changes.

See also OrganizerModel::storageLocations.


Method Documentation

Collection OrganizerModel::collection(string collectionId)

Returns the Collection object which collection id is the given collectionId and null if collection id is not found.


Collection OrganizerModel::defaultCollection()

Returns the default Collection object.


OrganizerItem OrganizerModel::item(string itemId)

Returns the OrganizerItem object with the given itemId.


bool OrganizerModel::containsItems(date start, date end)

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


OrganizerModel::cancelUpdate()

Cancel the running organizer model content update request.

See also OrganizerModel::autoUpdate and OrganizerModel::update.


OrganizerModel::exportItems(url url, list<string> profiles)

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.


OrganizerModel::fetchCollections()

Fetch asynchronously a list of organizer collections from the organizer backend.


OrganizerModel::importItems(url url, list<string> profiles)

Import organizer items from a vcalendar by the given url and optional profiles. Only one import operation can be active at a time.


int OrganizerModel::fetchItems(stringlist itemIds)

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.


list<OrganizerItem> OrganizerModel::itemsByTimePeriod(date start, date end)

Returns the list of organizer items between the given start and end period.


list<bool> OrganizerModel::containsItems(date start, date end, int interval)

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.


list<string> OrganizerModel::itemIds(date start, date end)

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


OrganizerModel::removeCollection(string collectionId)

Removes asynchronously the organizer collection with the given collectionId from the backend.


OrganizerModel::removeItem(OrganizerItem item)

Removes the given organizer item from the backend.


OrganizerModel::removeItem(string itemId)

Removes the organizer item with the given itemId from the backend.


OrganizerModel::removeItems(list<OrganizerItem> items)

Removes asynchronously the organizer items in the given items list from the backend.


OrganizerModel::removeItems(list<string> itemId)

Removes asynchronously the organizer items with the given ids from the backend.


OrganizerModel::saveCollection(Collection collection, StorageLocation storageLocation = UserDataStorage)

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.


OrganizerModel::saveItem(OrganizerItem item, StorageLocation storageLocation = UserDataStorage)

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.


OrganizerModel::update()

Manually update the organizer model content including both items and collections.

See also OrganizerModel::updateItems, OrganizerModel::updateCollections, and OrganizerModel::autoUpdate.


OrganizerModel::updateCollections()

Manually update the organizer model collections.

See also OrganizerModel::update, OrganizerModel::updateItems, and OrganizerModel::autoUpdate.


OrganizerModel::updateItems()

Manually update the organizer model items.

See also OrganizerModel::update, OrganizerModel::updateCollections, and OrganizerModel::autoUpdate.


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 5.0-snapshot
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