1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/* ============================================================
 *
 * This file is a part of digiKam project
 * https://www.digikam.org
 *
 * Date        : 2006-04-04
 * Description : a tool to generate HTML image galleries
 *
 * SPDX-FileCopyrightText: 2012-2025 by Gilles Caulier <caulier dot gilles at gmail dot com>
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 *
 * ============================================================ */

#pragma once

// Qt includes

#include <QUrl>
#include <QString>

// KDE includes

#include <kconfigskeleton.h>

namespace DigikamGenericHtmlGalleryPlugin
{

class GalleryConfig : public KConfigSkeleton
{
    Q_OBJECT

public:

    class EnumFullFormat
    {
    public:

        enum type
        {
            JPEG,
            JPG,
            PNG,
            COUNT
        };
    };

    class EnumThumbnailFormat
    {
    public:

        enum type
        {
            JPEG,
            JPG,
            PNG,
            COUNT
        };
    };

    // Web Browser to use
    enum EnumWebBrowser
    {
        NOBROWSER = 0,
        INTERNAL,
        DESKTOP,
        COUNT
    };

public:

    explicit GalleryConfig(QObject* const parent = nullptr);
    ~GalleryConfig() override = default;

    void setTheme(const QString&);
    QString theme() const;<--- Function 'theme()' should return member 'm_theme' by const reference.

    void setUseOriginalImageAsFullImage(bool);
    bool useOriginalImageAsFullImage() const;

    void setFullResize(bool);
    bool fullResize() const;

    void setFullSize(int);
    int fullSize() const;

    void setFullFormat(int);
    int fullFormat() const;

    void setFullQuality(int);
    int fullQuality() const;

    void setCopyOriginalImage(bool);
    bool copyOriginalImage() const;

    void setThumbnailSize(int);
    int thumbnailSize() const;

    void setThumbnailFormat(int);
    int thumbnailFormat() const;

    void setThumbnailQuality(int);
    int thumbnailQuality() const;

    void setThumbnailSquare(bool);
    bool thumbnailSquare() const;

    void setDestUrl(const QUrl&);
    QUrl destUrl() const;

    void setOpenInBrowser(int);
    int openInBrowser() const;

    void setImageSelectionTitle(const QString&);
    QString imageSelectionTitle() const;<--- Function 'imageSelectionTitle()' should return member 'm_imageSelectionTitle' by const reference.

protected:

    QString    m_theme;
    bool       m_useOriginalImageAsFullImage    = false;
    bool       m_fullResize                     = true;
    int        m_fullSize                       = 1024;
    int        m_fullFormat                     = EnumFullFormat::JPEG;
    int        m_fullQuality                    = 80;
    bool       m_copyOriginalImage              = false;
    int        m_thumbnailSize                  = 120;
    int        m_thumbnailFormat                = EnumThumbnailFormat::JPEG;
    int        m_thumbnailQuality               = 80;
    bool       m_thumbnailSquare                = true;
    QUrl       m_destUrl;
    int        m_openInBrowser                  = EnumWebBrowser::INTERNAL;
    QString    m_imageSelectionTitle;           ///< Gallery title to use for GalleryInfo::ImageGetOption::IMAGES selection.
};

} // namespace DigikamGenericHtmlGalleryPlugin