1 /* ============================================================ 2 * 3 * This file is a part of digiKam project 4 * https://www.digikam.org 5 * 6 * Date : 2006-04-04 7 * Description : a tool to generate HTML image galleries 8 * 9 * Copyright (C) 2006-2010 by Aurelien Gateau <aurelien dot gateau at free dot fr> 10 * Copyright (C) 2012-2021 by Gilles Caulier <caulier dot gilles at gmail dot com> 11 * 12 * This program is free software; you can redistribute it 13 * and/or modify it under the terms of the GNU General 14 * Public License as published by the Free Software Foundation; 15 * either version 2, or (at your option) any later version. 16 * 17 * This program is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU General Public License for more details. 21 * 22 * ============================================================ */ 23 24 #ifndef DIGIKAM_GALLERY_INFO_H 25 #define DIGIKAM_GALLERY_INFO_H 26 27 // Qt includes 28 29 #include <QList> 30 #include <QUrl> 31 #include <QDebug> 32 33 // Local includes 34 35 #include "galleryconfig.h" 36 #include "dinfointerface.h" 37 38 using namespace Digikam; 39 40 namespace DigikamGenericHtmlGalleryPlugin 41 { 42 43 /** 44 * This class stores all the export settings. It is initialized by the 45 * Wizard and read by the Generator. 46 */ 47 class GalleryInfo : public GalleryConfig 48 { 49 Q_OBJECT 50 51 public: 52 53 enum ImageGetOption 54 { 55 ALBUMS = 0, 56 IMAGES 57 }; 58 59 public: 60 61 explicit GalleryInfo(DInfoInterface* const iface = nullptr); 62 ~GalleryInfo() override; 63 64 QString fullFormatString() const; 65 66 QString thumbnailFormatString() const; 67 68 QString getThemeParameterValue(const QString& theme, const QString& parameter, 69 const QString& defaultValue) const; 70 71 void setThemeParameterValue(const QString& theme, const QString& parameter, 72 const QString& value); 73 74 public: 75 76 ImageGetOption m_getOption; // Type of image selection (albums or images list). 77 78 DInfoInterface::DAlbumIDs m_albumList; // Albums list for ImageGetOption::ALBUMS selection. 79 80 QList<QUrl> m_imageList; // Images list for ImageGetOption::IMAGES selection. 81 82 DInfoInterface* m_iface; // Interface to handle items information. 83 84 private: 85 86 /** 87 * KConfigXT enums are mapped to ints. 88 * This method returns the string associated to the enum value. 89 */ 90 QString getEnumString(const QString& itemName) const; 91 }; 92 93 //! qDebug() stream operator. Writes property @a t to the debug output in a nicely formatted way. 94 QDebug operator<<(QDebug dbg, const GalleryInfo& t); 95 96 } // namespace DigikamGenericHtmlGalleryPlugin 97 98 #endif // DIGIKAM_GALLERY_INFO_H 99