The QML Gallery plugin contains features that can be used to search and retrieve documents from the Document Gallery.
Searching is performed by creating a filter based on a GalleryFilter element. Search parameters can be set by specifying property values which refer to meta-data relating to the documents. For example, a meta-data key might be "author". Then by setting the filter property to "author" and the value to "torvalds" the filter is ready to enable a search.
Other filters enable case sensitivity options or the comparator property can be set to define the matching condition of the filter.
There is nothing to prevent the developer creating a number of filters. Then she could use either a GalleryFilterUnion or a GalleryFilterIntersection to find the result of OR-ing or AND-ing the criteria to create a more complex search criterion.
GalleryItems are elements that are a means to request information about a single item from a gallery. The information may include monitoring the state of the request, reading the meta-data for the document or writing meta-data.
When a request is made the state property contains the current state of the request including whether it is active or cancelled. The result property contains the result of the request including error conditions or a success flag.
Progress of the request is available through the integer item property currentProgress out of the maximum value maximumProgress.
GalleryItem can emit signals for the events onSucceeded() , onCancelled() , onFailed() and onFinished() .
The GalleryQueryModel element is used to perform the requests on a document gallery. The following snippet of QML from the GalleryQueryModel documentation is worth a closer look because it puts together several of the elements discussed in this overview.
import QtMobility.gallery 1.0 ... model: GalleryQueryModel { gallery: DocumentGallery {} itemType: "Image" properties: ["thumbnailImage"] filter: GalleryFilter { property: "fileName"; value: "*.jpg"; comparator: GalleryFilter.Wildcard } } ...
The DocumentGalleryItem element allows you to request information about a single item from the document gallery | |
The GalleryQueryRequest 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 GalleryLessThanEqualsFilter 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. |