File indexing completed on 2025-02-09 06:41:24

0001 /*
0002     SPDX-FileCopyrightText: 2013 Marco Martin <mart@kde.org>
0003     SPDX-FileCopyrightText: 2015 Eike Hein <hein@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef CONFIGCATEGORY_P_H
0009 #define CONFIGCATEGORY_P_H
0010 
0011 #include <QObject>
0012 
0013 //
0014 //  W A R N I N G
0015 //  -------------
0016 //
0017 // This file is not part of the public Plasma API.  It exists purely as an
0018 // implementation detail.  This header file may change from version to
0019 // version without notice, or even be removed.
0020 //
0021 // We mean it.
0022 //
0023 
0024 namespace PlasmaQuick
0025 {
0026 // This class represents a single row item of the ConfigModel model in a QML friendly manner.
0027 // the properties contains all the data needed to represent an icon in the sidebar of a configuration dialog, of applets or containments
0028 class ConfigCategory : public QObject
0029 {
0030     Q_OBJECT
0031     Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
0032     Q_PROPERTY(QString icon READ icon WRITE setIcon NOTIFY iconChanged)
0033     Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged)
0034     Q_PROPERTY(QString pluginName READ pluginName WRITE setPluginName NOTIFY pluginNameChanged)
0035     Q_PROPERTY(bool includeMargins READ includeMargins WRITE setIncludeMargins NOTIFY includeMarginsChanged)
0036     Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged)
0037 
0038 public:
0039     ConfigCategory(QObject *parent = nullptr);
0040     ~ConfigCategory() override;
0041 
0042     QString name() const;
0043     void setName(const QString &name);
0044 
0045     QString icon() const;
0046     void setIcon(const QString &icon);
0047 
0048     QString source() const;
0049     void setSource(const QString &source);
0050 
0051     QString pluginName() const;
0052     void setPluginName(const QString &pluginName);
0053 
0054     bool includeMargins() const;
0055     void setIncludeMargins(bool includeMargins);
0056 
0057     bool visible() const;
0058     void setVisible(bool visible);
0059 
0060 Q_SIGNALS:
0061     void nameChanged();
0062     void iconChanged();
0063     void sourceChanged();
0064     void pluginNameChanged();
0065     void includeMarginsChanged();
0066     void visibleChanged();
0067 
0068 private:
0069     QString m_name;
0070     QString m_icon;
0071     QString m_source;
0072     QString m_pluginName;
0073     bool m_includeMargins;
0074     bool m_visible;
0075 };
0076 
0077 }
0078 
0079 #endif // multiple inclusion guard