mirror of
https://github.com/Qortal/Brooklyn.git
synced 2025-02-12 02:05:54 +00:00
69 lines
2.6 KiB
C++
69 lines
2.6 KiB
C++
/*
|
|
SPDX-FileCopyrightText: 2013 Marco Martin <mart@kde.org>
|
|
|
|
SPDX-License-Identifier: LGPL-2.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <KDeclarative/ConfigPropertyMap>
|
|
#include <PlasmaQuick/ConfigModel>
|
|
#include <PlasmaQuick/ConfigView>
|
|
|
|
namespace Plasma
|
|
{
|
|
class Containment;
|
|
}
|
|
|
|
class QAbstractItemModel;
|
|
class CurrentContainmentActionsModel;
|
|
|
|
// TODO: out of the library?
|
|
class ContainmentConfigView : public PlasmaQuick::ConfigView
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(PlasmaQuick::ConfigModel *containmentActionConfigModel READ containmentActionConfigModel CONSTANT)
|
|
Q_PROPERTY(QAbstractItemModel *currentContainmentActionsModel READ currentContainmentActionsModel CONSTANT)
|
|
Q_PROPERTY(PlasmaQuick::ConfigModel *wallpaperConfigModel READ wallpaperConfigModel CONSTANT)
|
|
Q_PROPERTY(PlasmaQuick::ConfigModel *containmentPluginsConfigModel READ containmentPluginsConfigModel CONSTANT)
|
|
Q_PROPERTY(KDeclarative::ConfigPropertyMap *wallpaperConfiguration READ wallpaperConfiguration NOTIFY wallpaperConfigurationChanged)
|
|
Q_PROPERTY(QString currentWallpaper READ currentWallpaper WRITE setCurrentWallpaper NOTIFY currentWallpaperChanged)
|
|
Q_PROPERTY(QString containmentPlugin READ containmentPlugin WRITE setContainmentPlugin NOTIFY containmentPluginChanged)
|
|
|
|
public:
|
|
explicit ContainmentConfigView(Plasma::Containment *interface, QWindow *parent = nullptr);
|
|
~ContainmentConfigView() override;
|
|
|
|
void init() override;
|
|
|
|
PlasmaQuick::ConfigModel *containmentActionConfigModel();
|
|
QAbstractItemModel *currentContainmentActionsModel();
|
|
PlasmaQuick::ConfigModel *wallpaperConfigModel();
|
|
PlasmaQuick::ConfigModel *containmentPluginsConfigModel();
|
|
QString currentWallpaper() const;
|
|
void setCurrentWallpaper(const QString &wallpaper);
|
|
KDeclarative::ConfigPropertyMap *wallpaperConfiguration() const;
|
|
QString containmentPlugin() const;
|
|
void setContainmentPlugin(const QString &plugin);
|
|
|
|
Q_INVOKABLE void applyWallpaper();
|
|
|
|
Q_SIGNALS:
|
|
void currentWallpaperChanged();
|
|
void wallpaperConfigurationChanged();
|
|
void containmentPluginChanged();
|
|
|
|
protected:
|
|
void syncWallpaperObjects();
|
|
|
|
private:
|
|
Plasma::Containment *m_containment = nullptr;
|
|
PlasmaQuick::ConfigModel *m_wallpaperConfigModel = nullptr;
|
|
PlasmaQuick::ConfigModel *m_containmentActionConfigModel = nullptr;
|
|
PlasmaQuick::ConfigModel *m_containmentPluginsConfigModel = nullptr;
|
|
CurrentContainmentActionsModel *m_currentContainmentActionsModel = nullptr;
|
|
QString m_currentWallpaper;
|
|
KDeclarative::ConfigPropertyMap *m_currentWallpaperConfig = nullptr;
|
|
KDeclarative::ConfigPropertyMap *m_ownWallpaperConfig = nullptr;
|
|
};
|