The QtMobility APIs are placed into the QtMobility namespace. This is done to facilitate the future migration of QtMobility APIs into Qt. See the Quickstart guide for an example on how the namespace impacts on application development.
The Document Gallery provides an API for navigating and querying documents using their meta-data. The common use case would be populating the media selection views of a music player, or image viewer. It also provides API's for querying and editing the meta-data of individual documents.
Typically all files in user directories should be available in the document gallery. The principal types are Audio, Video, Image, and (Office) Document, but files can also be categorized as a File, Folder, Text, or Playlist. There are also some meta-types composed from the meta-data of files, these are Artist, Album, AudioGenre, and PhotoAlbum.
The document gallery API is composed of a set of asynchronous request (QGalleryAbstractRequest) classes which talk to the system file indexing service, this would be tracker on Maemo platforms, the meta-data system (MDS) on Symbian and potentially Windows Search, or Spotlight on macs. There are three requests; QGalleryQueryRequest takes a type, a parent item, and some filtering criteria (QGalleryFilter) and returns meta-data for all matching items. QGalleryItemRequest takes an item ID and returns meta-data for just that item. And QGalleryTypeRequest takes an item type and returns meta-data describing that type.
The requests operate on implementations of the QAbstractGallery. The default implementation is QDocumentGallery, but it's possible to create alternative implementations which talk to a media server or web services.
The primary interface to the results of a request is the QGalleryResultSet class which provides accessors for reading and writing the meta-data of a set of items.
A QGalleryResultSet cannot be created directly and may not need to be accessed directly, instead an instance must be requested from a gallery using one of the gallery request classes which typically also provide convenience functions for accessing the items in a result set.
The gallery request classes inherit from QGalleryAbstractRequest and are used to fetch items from a gallery, or to initiate service provided by a gallery.
Base class for gallery requests | |
Request for the properties of a single item from a gallery | |
Request for a set of items from a gallery | |
Interface for requesting the properties of a type from a gallery |
The filter classes provide a way to describe meta-data criteria items must satisfy to be included in the results of some requests.
Filtering criteria for gallery requests | |
Filter which matches the intersection of two or more meta-data filters | |
Filter which accepts items with meta-data properties matching a specific value | |
Filter which matches the union of two or more meta-data filters |
The gallery classes provide instances of different gallery types. Currently the only gallery type is the Document Gallery.
Base class for gallery implementations | |
Access to a gallery of documents and media present on a device |
The QGalleryQueryModel class implements a QAbstractItemModel using QGalleryQueryRequest. This is a convenience class which simplifies the process of presenting gallery items in a list view.
QML elements providing access to the document gallery are implemented in the Gallery QML Plugin.
The DocumentGalleryItem element allows you to request information about a single item from the document gallery | |
The DocumentGalleryModel element is used to specify a model containing items from the document gallery. | |
The DocumentGalleryType element allows you to request information about an item type from the document gallery. | |
The GalleryContainsFilter element provides a filter which tests if a meta-data property contains a string. | |
The GalleryEndsWithFilter element provides a filter which tests if a meta-data property ends with a string. | |
The GalleryEqualsFilter element provides a filter which tests if a meta-data property is equal to a value. | |
The GalleryFilterIntersection elements provides a intersection of gallery filters. | |
The GalleryFilterUnion elements provides a union of gallery filters. | |
The GalleryGreaterThanEqualsFilter element provides a filter which tests if a meta-data property is greater than or equal to a value. | |
The GalleryGreaterThanFilter element provides a filter which tests if a meta-data property is greater than a value. | |
The GalleryLessThanEqualsFilter element provides a filter which tests if a meta-data property is less than or equal to a value. | |
The GalleryLessThanFilter element provides a filter which tests if a meta-data property is less than a value. | |
The GalleryStartsWithFilter element provides a filter which tests if a meta-data property starts with a string. | |
The GalleryWildcardFilter element provides a filter which tests a meta-data property against a value using wildcard matching. |