Qt Mobility Reference Documentation

Document Gallery

Note: This API and documentation is a Technology Preview and is still subject to change.

Namespace

The QtMobility APIs are placed into the QtMobility namespace. This is done to facilitate the future migration of Mobility APIs into Qt. See the Quickstart guide for an example on how the namespace impacts on application development.

Overview

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 four requests; QGalleryQueryRequest takes a type, a parent item, and some filtering criteria (QGalleryFilter) and returns meta-data for all matching items in a QGalleryItemList. QGalleryItemRequest takes an item ID and returns meta-data for just that item. QGalleryUrlRequest takes the URL of an item and resolves the ID and type of that item. And QGalleryRemoveRequest takes an item ID and removes that item from the gallery.

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 items in a gallery is the QGalleryItemList class which provides accessors for reading and writing the meta-data of a set of items.

A QGalleryItemList cannot be created directly, instead an instance must be requested from a gallery using one of the gallery request classes.

Requests

The gallery request classes inherit from QGalleryAbstractRequest and are used to fetch items from a gallery, or to initiate service provided by a gallery.

QGalleryAbstractRequest

Base class for gallery requests

QGalleryCountRequest

Request for the number of items in a gallery matching some criteria

QGalleryItemRequest

Request for an item from a gallery

QGalleryQueryRequest

Request for a set of items from a gallery

QGalleryRemoveRequest

Request which removes items from a gallery

Filters

The filter classes provide a way to describe meta-data criteria items must satisfy to be included in the results of some requests.

QGalleryFilter

Filtering criteria for gallery requests

QGalleryIntersectionFilter

Filter which matches the intersection of two or more meta-data filters

QGalleryMetaDataFilter

Filter which accepts items with meta-data properties matching a specific value

QGalleryUnionFilter

Filter which matches the union of two or more meta-data filters

Galleries

The gallery classes provide instances of different gallery types. Currently the only gallery type is the Document Gallery.

QAbstractGallery

Base class for gallery implementations

QDocumentGallery

Gallery of documents

Examples

Document Sharing

Media Browser


Copyright © 2009-2010 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Mobility Project 1.1.0