1/****************************************************************************
2**
3** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4** Contact: http://www.qt-project.org/legal
5**
6** This file is part of the QtDocGallery module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and
14** conditions see http://qt.digia.com/licensing. For further information
15** use the contact form at http://qt.digia.com/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 2.1 requirements
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**
25** In addition, as a special exception, Digia gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**
29** GNU General Public License Usage
30** Alternatively, this file may be used under the terms of the GNU
31** General Public License version 3.0 as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL included in the
33** packaging of this file. Please review the following information to
34** ensure the GNU General Public License version 3.0 requirements will be
35** met: http://www.gnu.org/copyleft/gpl.html.
36**
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QDOCUMENTGALLERY_H
43#define QDOCUMENTGALLERY_H
44
45#include <qabstractgallery.h>
46#include <qgalleryproperty.h>
47#include <qgallerytype.h>
48
49QT_BEGIN_NAMESPACE_DOCGALLERY
50
51class QDocumentGalleryPrivate;
52
53class Q_GALLERY_EXPORT QDocumentGallery : public QAbstractGallery
54{
55 Q_OBJECT
56public:
57 static const QGalleryType File;
58 static const QGalleryType Folder;
59 static const QGalleryType Document;
60 static const QGalleryType Text;
61 static const QGalleryType Audio;
62 static const QGalleryType Image;
63 static const QGalleryType Video;
64 static const QGalleryType Playlist;
65 static const QGalleryType Artist;
66 static const QGalleryType AlbumArtist;
67 static const QGalleryType Album;
68 static const QGalleryType AudioGenre;
69 static const QGalleryType PhotoAlbum;
70
71 // Common
72 static const QGalleryProperty url;
73 static const QGalleryProperty author;
74 static const QGalleryProperty copyright;
75 static const QGalleryProperty description;
76 static const QGalleryProperty comments;
77 static const QGalleryProperty rating;
78 static const QGalleryProperty title;
79 static const QGalleryProperty subject;
80 static const QGalleryProperty keywords;
81 static const QGalleryProperty language;
82
83 // File
84 static const QGalleryProperty path;
85 static const QGalleryProperty filePath;
86 static const QGalleryProperty fileName;
87 static const QGalleryProperty fileExtension;
88 static const QGalleryProperty fileSize;
89 static const QGalleryProperty mimeType;
90 static const QGalleryProperty lastModified;
91 static const QGalleryProperty lastAccessed;
92
93 // Document
94 static const QGalleryProperty pageCount;
95 static const QGalleryProperty wordCount;
96 static const QGalleryProperty created;
97
98 // Media
99 static const QGalleryProperty duration;
100 static const QGalleryProperty producer;
101 static const QGalleryProperty lastPlayed;
102 static const QGalleryProperty playCount;
103 static const QGalleryProperty performer;
104
105 // Audio
106 static const QGalleryProperty audioCodec;
107 static const QGalleryProperty audioBitRate;
108 static const QGalleryProperty sampleRate;
109 static const QGalleryProperty channelCount;
110
111 // Music
112 static const QGalleryProperty artist;
113 static const QGalleryProperty albumArtist;
114 static const QGalleryProperty albumTitle;
115 static const QGalleryProperty composer;
116 static const QGalleryProperty genre;
117 static const QGalleryProperty lyrics;
118 static const QGalleryProperty trackCount;
119 static const QGalleryProperty trackNumber;
120 static const QGalleryProperty discNumber;
121
122 // Image, Video common.
123 static const QGalleryProperty width;
124 static const QGalleryProperty height;
125
126 // Image
127 static const QGalleryProperty orientation;
128
129 // Photo
130 static const QGalleryProperty dateTaken;
131 static const QGalleryProperty cameraManufacturer;
132 static const QGalleryProperty cameraModel;
133 static const QGalleryProperty exposureProgram;
134 static const QGalleryProperty exposureTime;
135 static const QGalleryProperty fNumber;
136 static const QGalleryProperty flashEnabled;
137 static const QGalleryProperty focalLength;
138 static const QGalleryProperty meteringMode;
139 static const QGalleryProperty whiteBalance;
140
141 static const QGalleryProperty latitude;
142 static const QGalleryProperty longitude;
143 static const QGalleryProperty altitude;
144
145 // Video
146 static const QGalleryProperty frameRate;
147 static const QGalleryProperty videoCodec;
148 static const QGalleryProperty videoBitRate;
149 static const QGalleryProperty resumePosition;
150 static const QGalleryProperty director;
151
152 // Type
153 static const QGalleryProperty count;
154
155 enum Error
156 {
157 NoError = QGalleryAbstractRequest::NoError,
158 NoGallery = QGalleryAbstractRequest::NoGallery,
159 NotSupported = QGalleryAbstractRequest::NotSupported,
160 ConnectionError = QGalleryAbstractRequest::GalleryError,
161 ItemIdError,
162 ItemTypeError,
163 FilterError
164 };
165
166 QDocumentGallery(QObject *parent = Q_NULLPTR);
167 ~QDocumentGallery();
168
169 bool isRequestSupported(QGalleryAbstractRequest::RequestType type) const;
170
171 QStringList itemTypePropertyNames(const QString &itemType) const;
172 QGalleryProperty::Attributes propertyAttributes(
173 const QString &propertyName, const QString &itemType) const;
174
175protected:
176 QGalleryAbstractResponse *createResponse(QGalleryAbstractRequest *request);
177
178private:
179 Q_DECLARE_PRIVATE(QDocumentGallery)
180};
181
182QT_END_NAMESPACE_DOCGALLERY
183
184#endif
185

source code of qtdocgallery/src/gallery/qdocumentgallery.h