File indexing completed on 2025-01-05 03:52:04
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2006-04-04 0007 * Description : a tool to generate HTML image galleries 0008 * 0009 * SPDX-FileCopyrightText: 2006-2010 by Aurelien Gateau <aurelien dot gateau at free dot fr> 0010 * SPDX-FileCopyrightText: 2012-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0011 * 0012 * SPDX-License-Identifier: GPL-2.0-or-later 0013 * 0014 * ============================================================ */ 0015 0016 #ifndef DIGIKAM_GALLERY_INFO_H 0017 #define DIGIKAM_GALLERY_INFO_H 0018 0019 // Qt includes 0020 0021 #include <QList> 0022 #include <QUrl> 0023 #include <QDebug> 0024 0025 // Local includes 0026 0027 #include "galleryconfig.h" 0028 #include "dinfointerface.h" 0029 0030 using namespace Digikam; 0031 0032 namespace DigikamGenericHtmlGalleryPlugin 0033 { 0034 0035 /** 0036 * This class stores all the export settings. It is initialized by the 0037 * Wizard and read by the Generator. 0038 */ 0039 class GalleryInfo : public GalleryConfig 0040 { 0041 Q_OBJECT 0042 0043 public: 0044 0045 enum ImageGetOption 0046 { 0047 ALBUMS = 0, 0048 IMAGES 0049 }; 0050 0051 public: 0052 0053 explicit GalleryInfo(DInfoInterface* const iface = nullptr); 0054 ~GalleryInfo() override; 0055 0056 QString fullFormatString() const; 0057 0058 QString thumbnailFormatString() const; 0059 0060 QString getThemeParameterValue(const QString& theme, const QString& parameter, 0061 const QString& defaultValue) const; 0062 0063 void setThemeParameterValue(const QString& theme, const QString& parameter, 0064 const QString& value); 0065 0066 public: 0067 0068 ImageGetOption m_getOption; // Type of image selection (albums or images list). 0069 0070 DInfoInterface::DAlbumIDs m_albumList; // Albums list for ImageGetOption::ALBUMS selection. 0071 0072 QList<QUrl> m_imageList; // Images list for ImageGetOption::IMAGES selection. 0073 0074 DInfoInterface* m_iface; // Interface to handle items information. 0075 0076 private: 0077 0078 /** 0079 * KConfigXT enums are mapped to ints. 0080 * This method returns the string associated to the enum value. 0081 */ 0082 QString getEnumString(const QString& itemName) const; 0083 }; 0084 0085 //! qDebug() stream operator. Writes property @a t to the debug output in a nicely formatted way. 0086 QDebug operator<<(QDebug dbg, const GalleryInfo& t); 0087 0088 } // namespace DigikamGenericHtmlGalleryPlugin 0089 0090 #endif // DIGIKAM_GALLERY_INFO_H