File: containmentconfigview.h

package info (click to toggle)
plasma-workspace 4%3A5.27.5-2%2Bdeb12u2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 102,040 kB
  • sloc: cpp: 121,800; xml: 3,238; python: 645; perl: 586; sh: 254; javascript: 113; ruby: 62; makefile: 15; ansic: 13
file content (68 lines) | stat: -rw-r--r-- 2,597 bytes parent folder | download
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
/*
    SPDX-FileCopyrightText: 2013 Marco Martin <mart@kde.org>

    SPDX-License-Identifier: LGPL-2.0-or-later
*/

#pragma once

#include <PlasmaQuick/ConfigModel>
#include <PlasmaQuick/ConfigView>
#include <QQmlPropertyMap>

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(QQmlPropertyMap *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);
    QQmlPropertyMap *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;
    QQmlPropertyMap *m_currentWallpaperConfig = nullptr;
    QQmlPropertyMap *m_ownWallpaperConfig = nullptr;
};