File: shelldbusobject.h

package info (click to toggle)
plasma-mobile 6.3.6-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 18,612 kB
  • sloc: xml: 38,470; cpp: 18,437; javascript: 139; sh: 82; makefile: 5
file content (86 lines) | stat: -rw-r--r-- 2,776 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include <QObject>
#include <QString>
#include <qqmlregistration.h>

#include "startupfeedbackmodel.h"

class ShellDBusObject : public QObject
{
    Q_OBJECT
    QML_ELEMENT
    QML_SINGLETON
    Q_CLASSINFO("D-Bus Interface", "org.kde.plasmashell")
    Q_PROPERTY(StartupFeedbackModel *startupFeedbackModel READ startupFeedbackModel CONSTANT)

public:
    ShellDBusObject(QObject *parent = nullptr);

    // called by QML
    Q_INVOKABLE void registerObject();

    StartupFeedbackModel *startupFeedbackModel();

Q_SIGNALS:
    Q_SCRIPTABLE void doNotDisturbChanged();
    Q_SCRIPTABLE void isActionDrawerOpenChanged();
    Q_SCRIPTABLE void isVolumeOSDOpenChanged();
    Q_SCRIPTABLE void isNotificationPopupDrawerOpenChanged();
    Q_SCRIPTABLE void panelStateChanged();
    Q_SCRIPTABLE void isTaskSwitcherVisibleChanged();
    Q_SCRIPTABLE void openActionDrawerRequested();
    Q_SCRIPTABLE void closeActionDrawerRequested();
    Q_SCRIPTABLE void appLaunchMaximizePanelAnimationTriggered(int screen, QString color);
    Q_SCRIPTABLE void openHomeScreenRequested();
    Q_SCRIPTABLE void resetHomeScreenPositionRequested();
    Q_SCRIPTABLE void showVolumeOSDRequested();

public Q_SLOTS:
    Q_SCRIPTABLE bool doNotDisturb();
    Q_SCRIPTABLE void setDoNotDisturb(bool value);

    // TODO: Account for multiple action drawers?
    Q_SCRIPTABLE bool isActionDrawerOpen();
    Q_SCRIPTABLE void setIsActionDrawerOpen(bool value);

    Q_SCRIPTABLE bool isVolumeOSDOpen();
    Q_SCRIPTABLE void setIsVolumeOSDOpen(bool value);

    Q_SCRIPTABLE bool isNotificationPopupDrawerOpen();
    Q_SCRIPTABLE void setIsNotificationPopupDrawerOpen(bool value);

    Q_SCRIPTABLE QString panelState();
    Q_SCRIPTABLE void setPanelState(QString state);


    Q_SCRIPTABLE bool isTaskSwitcherVisible();
    Q_SCRIPTABLE void setIsTaskSwitcherVisible(bool value);

    Q_SCRIPTABLE void openActionDrawer();
    Q_SCRIPTABLE void closeActionDrawer();

    Q_SCRIPTABLE void
    openAppLaunchAnimationWithPosition(int screen, QString splashIcon, QString title, QString storageId, qreal x, qreal y, qreal sourceIconSize);
    Q_SCRIPTABLE void triggerAppLaunchMaximizePanelAnimation(int screen, QString color);

    Q_SCRIPTABLE void openHomeScreen();
    Q_SCRIPTABLE void resetHomeScreenPosition();
    Q_SCRIPTABLE void showVolumeOSD();

private:
    bool m_initialized{false};

    bool m_doNotDisturb{false};
    bool m_isActionDrawerOpen{false};
    bool m_isVolumeOSDOpen{false};
    bool m_isNotificationPopupDrawerOpen{false};
    bool m_isTaskSwitcherVisible{false};

    QString m_panelState{};

    StartupFeedbackModel *m_startupFeedbackModel{nullptr};
};