File indexing completed on 2025-01-05 03:52:03
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: 2012-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #ifndef DIGIKAM_GALLERY_CONFIG_H 0016 #define DIGIKAM_GALLERY_CONFIG_H 0017 0018 // Qt includes 0019 0020 #include <QUrl> 0021 #include <QString> 0022 0023 // KDE includes 0024 0025 #include <kconfigskeleton.h> 0026 0027 namespace DigikamGenericHtmlGalleryPlugin 0028 { 0029 0030 class GalleryConfig : public KConfigSkeleton 0031 { 0032 Q_OBJECT 0033 0034 public: 0035 0036 class EnumFullFormat 0037 { 0038 public: 0039 0040 enum type 0041 { 0042 JPEG, 0043 PNG, 0044 COUNT 0045 }; 0046 }; 0047 0048 class EnumThumbnailFormat 0049 { 0050 public: 0051 0052 enum type 0053 { 0054 JPEG, 0055 PNG, 0056 COUNT 0057 }; 0058 }; 0059 0060 // Web Browser to use 0061 enum EnumWebBrowser 0062 { 0063 NOBROWSER = 0, 0064 INTERNAL, 0065 DESKTOP, 0066 COUNT 0067 }; 0068 0069 public: 0070 0071 explicit GalleryConfig(QObject* const parent = nullptr); 0072 ~GalleryConfig() override; 0073 0074 void setTheme(const QString&); 0075 QString theme() const; 0076 0077 void setUseOriginalImageAsFullImage(bool); 0078 bool useOriginalImageAsFullImage() const; 0079 0080 void setFullResize(bool); 0081 bool fullResize() const; 0082 0083 void setFullSize(int); 0084 int fullSize() const; 0085 0086 void setFullFormat(int); 0087 int fullFormat() const; 0088 0089 void setFullQuality(int); 0090 int fullQuality() const; 0091 0092 void setCopyOriginalImage(bool); 0093 bool copyOriginalImage() const; 0094 0095 void setThumbnailSize(int); 0096 int thumbnailSize() const; 0097 0098 void setThumbnailFormat(int); 0099 int thumbnailFormat() const; 0100 0101 void setThumbnailQuality(int); 0102 int thumbnailQuality() const; 0103 0104 void setThumbnailSquare(bool); 0105 bool thumbnailSquare() const; 0106 0107 void setDestUrl(const QUrl&); 0108 QUrl destUrl() const; 0109 0110 void setOpenInBrowser(int); 0111 int openInBrowser() const; 0112 0113 void setImageSelectionTitle(const QString&); 0114 QString imageSelectionTitle() const; 0115 0116 protected: 0117 0118 QString m_theme; 0119 bool m_useOriginalImageAsFullImage; 0120 bool m_fullResize; 0121 int m_fullSize; 0122 int m_fullFormat; 0123 int m_fullQuality; 0124 bool m_copyOriginalImage; 0125 int m_thumbnailSize; 0126 int m_thumbnailFormat; 0127 int m_thumbnailQuality; 0128 bool m_thumbnailSquare; 0129 QUrl m_destUrl; 0130 int m_openInBrowser; 0131 QString m_imageSelectionTitle; // Gallery title to use for GalleryInfo::ImageGetOption::IMAGES selection. 0132 }; 0133 0134 } // namespace DigikamGenericHtmlGalleryPlugin 0135 0136 #endif // DIGIKAM_GALLERY_CONFIG_H