| 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 | #include "qdocumentgallery.h" |
| 43 | #include "qabstractgallery_p.h" |
| 44 | |
| 45 | #include <QtCore/qstringlist.h> |
| 46 | |
| 47 | QT_BEGIN_NAMESPACE_DOCGALLERY |
| 48 | |
| 49 | /*! |
| 50 | \class QDocumentGallery |
| 51 | |
| 52 | \ingroup gallery |
| 53 | \ingroup gallery-galleries |
| 54 | |
| 55 | \inmodule QtDocGallery |
| 56 | |
| 57 | \brief The QDocumentGallery class provides access to a gallery of documents |
| 58 | and media present on a device. |
| 59 | |
| 60 | \section2 Requests |
| 61 | |
| 62 | Requests are the interface through which queries and actions are executed |
| 63 | against a QDocumentGallery. |
| 64 | |
| 65 | \list |
| 66 | |
| 67 | \li QGalleryQueryRequest can be used with QDocumentGallery to find and |
| 68 | navigate items present on a device. |
| 69 | |
| 70 | \li QGalleryItemRequest provides an API to query information about a single |
| 71 | item in a QDocumentGallery. |
| 72 | |
| 73 | \li QGalleryTypeRequest provides a query for information about an item type |
| 74 | supported by QDocumentGallery. |
| 75 | |
| 76 | \endlist |
| 77 | |
| 78 | \section2 Item types |
| 79 | |
| 80 | The items present in a QDocumentGallery can be of both file type such as |
| 81 | documents and media, or categorical type such as genres or albums. |
| 82 | |
| 83 | \section3 File types |
| 84 | |
| 85 | \list |
| 86 | \li \l File |
| 87 | \li \l Folder |
| 88 | \li \l Document |
| 89 | \li \l Text |
| 90 | \li \l Audio |
| 91 | \li \l Image |
| 92 | \li \l Video |
| 93 | \li \l Playlist |
| 94 | \endlist |
| 95 | |
| 96 | \section3 Categorical types |
| 97 | |
| 98 | \list |
| 99 | \li \l Artist |
| 100 | \li \l AlbumArtist |
| 101 | \li \l Album |
| 102 | \li \l AudioGenre |
| 103 | \li \l PhotoAlbum |
| 104 | \endlist |
| 105 | |
| 106 | \section2 Properties |
| 107 | |
| 108 | The item meta-data stored in a QDocumentGallery is addressed through |
| 109 | properties. |
| 110 | |
| 111 | The set of properties addressable differs between item type but some |
| 112 | properties are shared by most types. |
| 113 | |
| 114 | \section3 Common item properties |
| 115 | |
| 116 | Currently for the Tracker back-end, only the \l title property is available |
| 117 | for the categorical types. |
| 118 | |
| 119 | \list |
| 120 | \li \l author |
| 121 | \li \l comments |
| 122 | \li \l copyright |
| 123 | \li \l description |
| 124 | \li \l keywords |
| 125 | \li \l language |
| 126 | \li \l rating |
| 127 | \li \l subject |
| 128 | \li \l title |
| 129 | \li \l url |
| 130 | \endlist |
| 131 | |
| 132 | \section3 Common type properties |
| 133 | |
| 134 | \list |
| 135 | \li \l count |
| 136 | \endlist |
| 137 | */ |
| 138 | |
| 139 | /*! |
| 140 | \enum QDocumentGallery::Error |
| 141 | This enum defines errors in a Gallery. |
| 142 | |
| 143 | \value NoError No error. |
| 144 | \value NoGallery No Gallery defined or found. |
| 145 | \value NotSupported Gallery is not supported. |
| 146 | \value ConnectionError Connection to gallery is broken. |
| 147 | \value ItemIdError Id of a item is wrong. |
| 148 | \value ItemTypeError Type of an item is wrong. |
| 149 | \value FilterError Error in filter found. |
| 150 | */ |
| 151 | |
| 152 | /*! |
| 153 | \variable QDocumentGallery::File |
| 154 | |
| 155 | This type matches all files in the document gallery. |
| 156 | |
| 157 | Properties typically available from files include: |
| 158 | |
| 159 | \list |
| 160 | \li \l fileExtension |
| 161 | \li \l fileName |
| 162 | \li \l filePath |
| 163 | \li \l fileSize |
| 164 | \li \l lastModified |
| 165 | \li \l lastAccessed |
| 166 | \li \l mimeType |
| 167 | \li \l path |
| 168 | \endlist |
| 169 | */ |
| 170 | |
| 171 | Q_DEFINE_GALLERY_TYPE(QDocumentGallery, File) |
| 172 | |
| 173 | /*! |
| 174 | \variable QDocumentGallery::Folder |
| 175 | |
| 176 | This type matches all file-system folders in the document gallery. |
| 177 | |
| 178 | In addition to the properties derived from the \l File type folders may |
| 179 | also provide: |
| 180 | |
| 181 | */ |
| 182 | |
| 183 | Q_DEFINE_GALLERY_TYPE(QDocumentGallery, Folder) |
| 184 | |
| 185 | /*! |
| 186 | \variable QDocumentGallery::Document |
| 187 | |
| 188 | This type matches all document files in the document gallery. |
| 189 | |
| 190 | In addition to the properties derived from the \l File type documents may |
| 191 | also provide: |
| 192 | |
| 193 | \list |
| 194 | \li \l created |
| 195 | \li \l pageCount |
| 196 | \li \l wordCount |
| 197 | \endlist |
| 198 | */ |
| 199 | |
| 200 | Q_DEFINE_GALLERY_TYPE(QDocumentGallery, Document) |
| 201 | |
| 202 | /*! |
| 203 | \variable QDocumentGallery::Text |
| 204 | |
| 205 | This type matches all plain text files, e.g. HTML files, in the document |
| 206 | gallery. |
| 207 | |
| 208 | In addition to the properties derived from the \l File type text files may |
| 209 | also provide: |
| 210 | |
| 211 | \list |
| 212 | \li \l wordCount |
| 213 | \endlist |
| 214 | */ |
| 215 | |
| 216 | Q_DEFINE_GALLERY_TYPE(QDocumentGallery, Text) |
| 217 | |
| 218 | /*! |
| 219 | \variable QDocumentGallery::Audio |
| 220 | |
| 221 | This type matches all audio files in the document gallery. |
| 222 | |
| 223 | In addition to the properties derived from the \l File type audio files may |
| 224 | also provide: |
| 225 | |
| 226 | \list |
| 227 | \li \l albumArtist |
| 228 | \li \l albumTitle |
| 229 | \li \l artist |
| 230 | \li \l audioBitRate |
| 231 | \li \l audioCodec |
| 232 | \li \l channelCount |
| 233 | \li \l composer |
| 234 | \li \l discNumber |
| 235 | \li \l genre |
| 236 | \li \l duration |
| 237 | \li \l lastPlayed |
| 238 | \li \l lyrics |
| 239 | \li \l performer |
| 240 | \li \l playCount |
| 241 | \li \l producer |
| 242 | \li \l sampleRate |
| 243 | \li \l trackNumber |
| 244 | \endlist |
| 245 | */ |
| 246 | |
| 247 | Q_DEFINE_GALLERY_TYPE(QDocumentGallery, Audio) |
| 248 | |
| 249 | /*! |
| 250 | \variable QDocumentGallery::Image |
| 251 | |
| 252 | This type matches all image files in the document gallery. |
| 253 | |
| 254 | In addition to the properties derived from the \l File type image files may |
| 255 | also provide: |
| 256 | |
| 257 | \list |
| 258 | \li \l altitude |
| 259 | \li \l cameraManufacturer |
| 260 | \li \l cameraModel |
| 261 | \li \l dateTaken |
| 262 | \li \l exposureProgram |
| 263 | \li \l exposureTime |
| 264 | \li \l flashEnabled |
| 265 | \li \l fNumber |
| 266 | \li \l focalLength |
| 267 | \li \l height |
| 268 | \li \l longitude |
| 269 | \li \l latitude |
| 270 | \li \l meteringMode |
| 271 | \li \l orientation |
| 272 | \li \l width |
| 273 | \li \l whiteBalance |
| 274 | \endlist |
| 275 | */ |
| 276 | |
| 277 | Q_DEFINE_GALLERY_TYPE(QDocumentGallery, Image) |
| 278 | |
| 279 | /*! |
| 280 | \variable QDocumentGallery::Video |
| 281 | |
| 282 | This type matches all video files in the document gallery. |
| 283 | |
| 284 | In addition to the properties derived from the \l File type video files may |
| 285 | also provide: |
| 286 | |
| 287 | \list |
| 288 | \li \l audioBitRate |
| 289 | \li \l audioCodec |
| 290 | \li \l channelCount |
| 291 | \li \l director |
| 292 | \li \l duration |
| 293 | \li \l frameRate |
| 294 | \li \l height |
| 295 | \li \l lastPlayed |
| 296 | \li \l performer |
| 297 | \li \l playCount |
| 298 | \li \l producer |
| 299 | \li \l resumePosition |
| 300 | \li \l sampleRate |
| 301 | \li \l videoBitRate |
| 302 | \li \l videoCodec |
| 303 | \li \l width |
| 304 | \endlist |
| 305 | */ |
| 306 | |
| 307 | Q_DEFINE_GALLERY_TYPE(QDocumentGallery, Video) |
| 308 | |
| 309 | /*! |
| 310 | \variable QDocumentGallery::Playlist |
| 311 | |
| 312 | This type matches all playlist files in the document gallery. |
| 313 | |
| 314 | In addition to the properties derived from the \l File type playlist files |
| 315 | may also provide: |
| 316 | |
| 317 | \list |
| 318 | \li \l duration |
| 319 | \li \l trackCount |
| 320 | \endlist |
| 321 | |
| 322 | */ |
| 323 | |
| 324 | Q_DEFINE_GALLERY_TYPE(QDocumentGallery, Playlist) |
| 325 | |
| 326 | /*! |
| 327 | \variable QDocumentGallery::Artist |
| 328 | |
| 329 | This type matches all artists in the document gallery. |
| 330 | |
| 331 | Properties typically available from artists include: |
| 332 | |
| 333 | \list |
| 334 | \li \l artist |
| 335 | \li \l duration |
| 336 | \li \l trackCount |
| 337 | \endlist |
| 338 | */ |
| 339 | |
| 340 | Q_DEFINE_GALLERY_TYPE(QDocumentGallery, Artist) |
| 341 | |
| 342 | /*! |
| 343 | \variable QDocumentGallery::AlbumArtist |
| 344 | |
| 345 | This type matches all album artists in the document gallery. |
| 346 | |
| 347 | Properties typically available from album artists include: |
| 348 | |
| 349 | \list |
| 350 | \li \l albumArtist |
| 351 | \li \l artist |
| 352 | \li \l duration |
| 353 | \li \l trackCount |
| 354 | \endlist |
| 355 | */ |
| 356 | |
| 357 | Q_DEFINE_GALLERY_TYPE(QDocumentGallery, AlbumArtist) |
| 358 | |
| 359 | /*! |
| 360 | \variable QDocumentGallery::Album |
| 361 | |
| 362 | This type matches all albums in the document gallery. |
| 363 | |
| 364 | Properties typically available from albums include: |
| 365 | |
| 366 | \list |
| 367 | \li \l albumArtist |
| 368 | \li \l albumTitle |
| 369 | \li \l artist |
| 370 | \li \l duration |
| 371 | \li \l trackCount |
| 372 | \endlist |
| 373 | */ |
| 374 | |
| 375 | Q_DEFINE_GALLERY_TYPE(QDocumentGallery, Album) |
| 376 | |
| 377 | /*! |
| 378 | \variable QDocumentGallery::AudioGenre |
| 379 | |
| 380 | This type matches all audio genres in the document gallery. |
| 381 | |
| 382 | Properties typically available from genres include: |
| 383 | |
| 384 | \list |
| 385 | \li \l duration |
| 386 | \li \l genre |
| 387 | \li \l trackCount |
| 388 | \endlist |
| 389 | */ |
| 390 | |
| 391 | Q_DEFINE_GALLERY_TYPE(QDocumentGallery, AudioGenre) |
| 392 | |
| 393 | /*! |
| 394 | \variable QDocumentGallery::PhotoAlbum |
| 395 | |
| 396 | This type matches all photo albums in the document gallery. |
| 397 | |
| 398 | \list |
| 399 | \li \l count |
| 400 | \endlist |
| 401 | */ |
| 402 | |
| 403 | Q_DEFINE_GALLERY_TYPE(QDocumentGallery, PhotoAlbum) |
| 404 | |
| 405 | // Common |
| 406 | |
| 407 | /*! |
| 408 | \variable QDocumentGallery::url |
| 409 | |
| 410 | This property contains canonical url of an item in the document gallery. |
| 411 | */ |
| 412 | |
| 413 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, url) |
| 414 | |
| 415 | /*! |
| 416 | \variable QDocumentGallery::author |
| 417 | |
| 418 | This property contains the name of the author of an item in the document |
| 419 | gallery. |
| 420 | */ |
| 421 | |
| 422 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, author) |
| 423 | |
| 424 | /*! |
| 425 | \variable QDocumentGallery::copyright |
| 426 | |
| 427 | This property contains a copyright statement for an item in the document |
| 428 | gallery. |
| 429 | */ |
| 430 | |
| 431 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, copyright) |
| 432 | |
| 433 | /*! |
| 434 | \variable QDocumentGallery::description |
| 435 | |
| 436 | This property contains a description of an item in the document gallery. |
| 437 | */ |
| 438 | |
| 439 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, description) |
| 440 | |
| 441 | /*! |
| 442 | \variable QDocumentGallery::comments |
| 443 | |
| 444 | This property contains a user comment about an item in the document gallery. |
| 445 | */ |
| 446 | |
| 447 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, ) |
| 448 | |
| 449 | /*! |
| 450 | \variable QDocumentGallery::rating |
| 451 | |
| 452 | This property contains a rating for an item in the document gallery. |
| 453 | */ |
| 454 | |
| 455 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, rating) |
| 456 | |
| 457 | /*! |
| 458 | \variable QDocumentGallery::title |
| 459 | |
| 460 | This property contains the title of an item in the document gallery. |
| 461 | */ |
| 462 | |
| 463 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, title) |
| 464 | |
| 465 | /*! |
| 466 | \variable QDocumentGallery::subject |
| 467 | |
| 468 | This property contains the subject of item in the document gallery. |
| 469 | */ |
| 470 | |
| 471 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, subject) |
| 472 | |
| 473 | /*! |
| 474 | \variable QDocumentGallery::keywords |
| 475 | |
| 476 | This property contains keywords relevant to an item in the document gallery. |
| 477 | */ |
| 478 | |
| 479 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, keywords) |
| 480 | |
| 481 | /*! |
| 482 | \variable QDocumentGallery::language |
| 483 | |
| 484 | This property contains the language of the content of an item in the |
| 485 | document gallery. |
| 486 | */ |
| 487 | |
| 488 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, language) |
| 489 | |
| 490 | // File |
| 491 | |
| 492 | /*! |
| 493 | \variable QDocumentGallery::path |
| 494 | |
| 495 | This property contains the absolute path excluding the file name of a file |
| 496 | in the document gallery. |
| 497 | */ |
| 498 | |
| 499 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, path) |
| 500 | |
| 501 | /*! |
| 502 | \variable QDocumentGallery::filePath |
| 503 | |
| 504 | This property contains the absolute path including the file name of a file |
| 505 | in the document gallery. |
| 506 | */ |
| 507 | |
| 508 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, filePath) |
| 509 | |
| 510 | /*! |
| 511 | \variable QDocumentGallery::fileName |
| 512 | |
| 513 | This property contains the file name excluding the path of a file in |
| 514 | the document gallery. |
| 515 | */ |
| 516 | |
| 517 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, fileName) |
| 518 | |
| 519 | /*! |
| 520 | \variable QDocumentGallery::fileExtension |
| 521 | |
| 522 | This property contains the file extension of a file. |
| 523 | */ |
| 524 | |
| 525 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, fileExtension) |
| 526 | |
| 527 | /*! |
| 528 | \variable QDocumentGallery::fileSize |
| 529 | |
| 530 | This property contains the size in bytes of a file. |
| 531 | */ |
| 532 | |
| 533 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, fileSize) |
| 534 | |
| 535 | /*! |
| 536 | \variable QDocumentGallery::mimeType |
| 537 | |
| 538 | This property contains the MIME type of a file. |
| 539 | */ |
| 540 | |
| 541 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, mimeType) |
| 542 | |
| 543 | /*! |
| 544 | \variable QDocumentGallery::lastModified |
| 545 | |
| 546 | This property contains the date and time a file was last modified. |
| 547 | */ |
| 548 | |
| 549 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, lastModified) |
| 550 | |
| 551 | /*! |
| 552 | \variable QDocumentGallery::lastAccessed |
| 553 | |
| 554 | This property contains the date and time a file was last accessed. |
| 555 | */ |
| 556 | |
| 557 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, lastAccessed) |
| 558 | |
| 559 | // Document |
| 560 | |
| 561 | /*! |
| 562 | \variable QDocumentGallery::pageCount |
| 563 | |
| 564 | This property contains the number of pages in a document. |
| 565 | */ |
| 566 | |
| 567 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, pageCount) |
| 568 | |
| 569 | /*! |
| 570 | \variable QDocumentGallery::wordCount |
| 571 | |
| 572 | This property contains the number of words in document. |
| 573 | */ |
| 574 | |
| 575 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, wordCount) |
| 576 | |
| 577 | /*! |
| 578 | \variable QDocumentGallery::created |
| 579 | |
| 580 | This property contains the date and time a document was created. |
| 581 | */ |
| 582 | |
| 583 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, created) |
| 584 | |
| 585 | // Media |
| 586 | |
| 587 | /*! |
| 588 | \variable QDocumentGallery::duration |
| 589 | |
| 590 | This property contains the duration of an audio or video file. |
| 591 | */ |
| 592 | |
| 593 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, duration) |
| 594 | |
| 595 | /*! |
| 596 | \variable QDocumentGallery::producer |
| 597 | |
| 598 | This property contains the name of the producer of a media file. |
| 599 | |
| 600 | Note that this property for \l Audio is not supported by Tracker. |
| 601 | */ |
| 602 | |
| 603 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, producer) |
| 604 | |
| 605 | /*! |
| 606 | \variable QDocumentGallery::lastPlayed |
| 607 | |
| 608 | This property contains the date and time an audio or video file was last |
| 609 | played. |
| 610 | */ |
| 611 | |
| 612 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, lastPlayed) |
| 613 | |
| 614 | /*! |
| 615 | \variable QDocumentGallery::playCount |
| 616 | |
| 617 | This property contains the number of times an audio or video file has been |
| 618 | played. |
| 619 | */ |
| 620 | |
| 621 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, playCount) |
| 622 | |
| 623 | /*! |
| 624 | \variable QDocumentGallery::performer |
| 625 | |
| 626 | This property contains the names of performers in a media file. |
| 627 | */ |
| 628 | |
| 629 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, performer) |
| 630 | |
| 631 | // Audio |
| 632 | |
| 633 | /*! |
| 634 | \variable QDocumentGallery::audioCodec |
| 635 | |
| 636 | This property contains the name of the codec used to encode audio in a media |
| 637 | file. |
| 638 | */ |
| 639 | |
| 640 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, audioCodec) |
| 641 | |
| 642 | /*! |
| 643 | \variable QDocumentGallery::audioBitRate |
| 644 | |
| 645 | This property contains the bit rate of the audio in a media file. |
| 646 | */ |
| 647 | |
| 648 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, audioBitRate) |
| 649 | |
| 650 | /*! |
| 651 | \variable QDocumentGallery::sampleRate |
| 652 | |
| 653 | This property contains the sample rate of the audio in a media file. |
| 654 | */ |
| 655 | |
| 656 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, sampleRate) |
| 657 | /*! |
| 658 | \variable QDocumentGallery::channelCount |
| 659 | |
| 660 | This property contains the number of audio channels in a media file. |
| 661 | */ |
| 662 | |
| 663 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, channelCount) |
| 664 | |
| 665 | // Music |
| 666 | |
| 667 | /*! |
| 668 | \variable QDocumentGallery::artist |
| 669 | |
| 670 | This property contains the names of artists contributing to a music track. |
| 671 | */ |
| 672 | |
| 673 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, artist) |
| 674 | |
| 675 | /*! |
| 676 | \variable QDocumentGallery::albumArtist |
| 677 | |
| 678 | This property contains the name of the title artist of a music album. |
| 679 | */ |
| 680 | |
| 681 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, albumArtist) |
| 682 | |
| 683 | /*! |
| 684 | \variable QDocumentGallery::albumTitle |
| 685 | |
| 686 | This property contains the title of the album a music track belongs to. |
| 687 | */ |
| 688 | |
| 689 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, albumTitle) |
| 690 | |
| 691 | /*! |
| 692 | \variable QDocumentGallery::composer |
| 693 | |
| 694 | This property contains the name of the composer of a music track. |
| 695 | */ |
| 696 | |
| 697 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, composer) |
| 698 | |
| 699 | /*! |
| 700 | \variable QDocumentGallery::genre |
| 701 | |
| 702 | This property contains the genre of a media file. |
| 703 | */ |
| 704 | |
| 705 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, genre) |
| 706 | |
| 707 | /*! |
| 708 | \variable QDocumentGallery::lyrics |
| 709 | |
| 710 | This property contains the lyrics to a music track. |
| 711 | */ |
| 712 | |
| 713 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, lyrics) |
| 714 | |
| 715 | /*! |
| 716 | \variable QDocumentGallery::trackCount |
| 717 | |
| 718 | This property contains the number of music tracks in an album. |
| 719 | */ |
| 720 | |
| 721 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, trackCount) |
| 722 | |
| 723 | /*! |
| 724 | \variable QDocumentGallery::trackNumber |
| 725 | |
| 726 | This property contains the track number of a music track in an album. |
| 727 | */ |
| 728 | |
| 729 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, trackNumber) |
| 730 | |
| 731 | /*! |
| 732 | \variable QDocumentGallery::discNumber |
| 733 | |
| 734 | This property contains the disc number of an album in a set. |
| 735 | */ |
| 736 | |
| 737 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, discNumber) |
| 738 | |
| 739 | // Image, Video common. |
| 740 | |
| 741 | /*! |
| 742 | \variable QDocumentGallery::width |
| 743 | |
| 744 | This property contains the width in pixels of an image or video file. |
| 745 | */ |
| 746 | |
| 747 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, width) |
| 748 | |
| 749 | /*! |
| 750 | \variable QDocumentGallery::height |
| 751 | |
| 752 | This property contains the height in pixels of an image or video file. |
| 753 | */ |
| 754 | |
| 755 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, height) |
| 756 | |
| 757 | // Image |
| 758 | /*! |
| 759 | \variable QDocumentGallery::orientation |
| 760 | |
| 761 | This property contains the orientation of an image. |
| 762 | */ |
| 763 | |
| 764 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, orientation) |
| 765 | |
| 766 | // Photo |
| 767 | |
| 768 | /*! |
| 769 | \variable QDocumentGallery::dateTaken |
| 770 | |
| 771 | This property contains the date and time a photo was taken. |
| 772 | */ |
| 773 | |
| 774 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, dateTaken) |
| 775 | |
| 776 | /*! |
| 777 | \variable QDocumentGallery::cameraManufacturer |
| 778 | |
| 779 | This property contains the manufacturer name of the camera used to take a |
| 780 | photo. |
| 781 | */ |
| 782 | |
| 783 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, cameraManufacturer) |
| 784 | |
| 785 | /*! |
| 786 | \variable QDocumentGallery::cameraModel |
| 787 | |
| 788 | This property contains the model name of the camera used to take a photo. |
| 789 | */ |
| 790 | |
| 791 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, cameraModel) |
| 792 | |
| 793 | /*! |
| 794 | \variable QDocumentGallery::exposureProgram |
| 795 | |
| 796 | This property contains the name of the exposure program used when taking a |
| 797 | photo. |
| 798 | |
| 799 | Note that this property is not supported by Tracker. |
| 800 | */ |
| 801 | |
| 802 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, exposureProgram) |
| 803 | |
| 804 | /*! |
| 805 | \variable QDocumentGallery::exposureTime |
| 806 | |
| 807 | This property contains the exposure time of a photo in seconds. |
| 808 | */ |
| 809 | |
| 810 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, exposureTime) |
| 811 | |
| 812 | /*! |
| 813 | \variable QDocumentGallery::fNumber |
| 814 | |
| 815 | This property contains the F-number of a photo. |
| 816 | */ |
| 817 | |
| 818 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, fNumber) |
| 819 | |
| 820 | /*! |
| 821 | \variable QDocumentGallery::flashEnabled |
| 822 | |
| 823 | This property contains whether a flash was used when taking a photo. |
| 824 | */ |
| 825 | |
| 826 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, flashEnabled) |
| 827 | |
| 828 | /*! |
| 829 | \variable QDocumentGallery::focalLength |
| 830 | |
| 831 | This property contains the focal length used when taking a photo. |
| 832 | */ |
| 833 | |
| 834 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, focalLength) |
| 835 | |
| 836 | /*! |
| 837 | \variable QDocumentGallery::meteringMode |
| 838 | |
| 839 | This property contains the metering mode used when taking a photo. |
| 840 | */ |
| 841 | |
| 842 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, meteringMode) |
| 843 | |
| 844 | /*! |
| 845 | \variable QDocumentGallery::whiteBalance |
| 846 | |
| 847 | This property contains the white balance setting used when taking a photo. |
| 848 | */ |
| 849 | |
| 850 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, whiteBalance) |
| 851 | |
| 852 | /*! |
| 853 | \variable QDocumentGallery::latitude |
| 854 | |
| 855 | This property contains the latitude of the location where the photo was captured. |
| 856 | */ |
| 857 | |
| 858 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, latitude) |
| 859 | |
| 860 | /*! |
| 861 | \variable QDocumentGallery::longitude |
| 862 | |
| 863 | This property contains the longitude of the location where the photo was captured. |
| 864 | */ |
| 865 | |
| 866 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, longitude) |
| 867 | |
| 868 | /*! |
| 869 | \variable QDocumentGallery::altitude |
| 870 | |
| 871 | This property contains the altitude of the location where the photo was captured. |
| 872 | */ |
| 873 | |
| 874 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, altitude) |
| 875 | |
| 876 | // Video |
| 877 | |
| 878 | /*! |
| 879 | \variable QDocumentGallery::frameRate |
| 880 | |
| 881 | This property contains the frame rate of a video. |
| 882 | */ |
| 883 | |
| 884 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, frameRate) |
| 885 | |
| 886 | /*! |
| 887 | \variable QDocumentGallery::videoCodec |
| 888 | |
| 889 | This property contains the codec used to encode the video in a media file. |
| 890 | */ |
| 891 | |
| 892 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, videoCodec) |
| 893 | |
| 894 | /*! |
| 895 | \variable QDocumentGallery::videoBitRate |
| 896 | |
| 897 | This property contains the bit rate of the video in a media file. |
| 898 | */ |
| 899 | |
| 900 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, videoBitRate) |
| 901 | |
| 902 | /*! |
| 903 | \variable QDocumentGallery::resumePosition |
| 904 | |
| 905 | This property contains the position in a video where playback was |
| 906 | interrupted. |
| 907 | */ |
| 908 | |
| 909 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, resumePosition) |
| 910 | |
| 911 | /*! |
| 912 | \variable QDocumentGallery::director |
| 913 | |
| 914 | This property contains the name of the director of a video. |
| 915 | */ |
| 916 | |
| 917 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, director) |
| 918 | |
| 919 | // Type |
| 920 | |
| 921 | /*! |
| 922 | \variable QDocumentGallery::count |
| 923 | |
| 924 | This property contains the number of items within the scope of a parent |
| 925 | item or an item type. |
| 926 | */ |
| 927 | |
| 928 | Q_DEFINE_GALLERY_PROPERTY(QDocumentGallery, count) |
| 929 | |
| 930 | /*! |
| 931 | \fn QDocumentGallery::QDocumentGallery(QObject *parent) |
| 932 | |
| 933 | Constructs a new document gallery. |
| 934 | |
| 935 | The \a parent is passed to QAbstractGallery. |
| 936 | */ |
| 937 | |
| 938 | /*! |
| 939 | \fn QDocumentGallery::~QDocumentGallery() |
| 940 | |
| 941 | Destroys a document gallery. |
| 942 | */ |
| 943 | |
| 944 | /*! |
| 945 | \fn QDocumentGallery::isRequestSupported(QGalleryAbstractRequest::RequestType type) const |
| 946 | |
| 947 | \reimp |
| 948 | */ |
| 949 | |
| 950 | /*! |
| 951 | \fn QDocumentGallery::itemTypePropertyNames(const QString &itemType) const; |
| 952 | |
| 953 | Returns a list of names of properties that are valid for an \a itemType. |
| 954 | */ |
| 955 | |
| 956 | /*! |
| 957 | \fn QDocumentGallery::propertyAttributes(const QString &propertyName, const QString &itemType) const |
| 958 | |
| 959 | Returns the attributes of a property of \a itemType identified by |
| 960 | \a propertyName |
| 961 | */ |
| 962 | |
| 963 | /*! |
| 964 | \fn QDocumentGallery::createResponse(QGalleryAbstractRequest *request) |
| 965 | |
| 966 | \reimp |
| 967 | */ |
| 968 | |
| 969 | |
| 970 | #ifdef QT_DOCUMENT_GALLERY_NULL |
| 971 | |
| 972 | QDocumentGallery::QDocumentGallery(QObject *parent) |
| 973 | : QAbstractGallery(parent) |
| 974 | { |
| 975 | } |
| 976 | |
| 977 | QDocumentGallery::~QDocumentGallery() |
| 978 | { |
| 979 | } |
| 980 | |
| 981 | bool QDocumentGallery::isRequestSupported(QGalleryAbstractRequest::RequestType) const |
| 982 | { |
| 983 | return false; |
| 984 | } |
| 985 | |
| 986 | QStringList QDocumentGallery::itemTypePropertyNames(const QString &) const |
| 987 | { |
| 988 | return QStringList(); |
| 989 | } |
| 990 | |
| 991 | QGalleryProperty::Attributes QDocumentGallery::propertyAttributes(const QString &, const QString &) const |
| 992 | { |
| 993 | return QGalleryProperty::Attributes(); |
| 994 | } |
| 995 | |
| 996 | QGalleryAbstractResponse *QDocumentGallery::createResponse(QGalleryAbstractRequest *) |
| 997 | { |
| 998 | return 0; |
| 999 | } |
| 1000 | |
| 1001 | #endif // QT_DOCUMENT_GALLERY_NULL |
| 1002 | |
| 1003 | #include "moc_qdocumentgallery.cpp" |
| 1004 | |
| 1005 | QT_END_NAMESPACE_DOCGALLERY |
| 1006 | |