KDeclarative

kwindowsystemproxy.h
1 /*
2  SPDX-FileCopyrightText: 2015 Kai Uwe Broulik <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6 
7 #ifndef KWINDOWSYSTEMPROXY_H
8 #define KWINDOWSYSTEMPROXY_H
9 
10 #include <QObject>
11 #include <QString>
12 
13 class QMetaMethod;
14 class QWindow;
15 
43 {
44  Q_OBJECT
45 
49  Q_PROPERTY(int currentDesktop READ currentDesktop WRITE setCurrentDesktop NOTIFY currentDesktopChanged)
53  Q_PROPERTY(QString currentDesktopName READ currentDesktopName NOTIFY currentDesktopNameChanged)
57  Q_PROPERTY(int numberOfDesktops READ numberOfDesktops NOTIFY numberOfDesktopsChanged)
61  Q_PROPERTY(bool showingDesktop READ showingDesktop WRITE setShowingDesktop NOTIFY showingDesktopChanged)
67  Q_PROPERTY(bool compositingActive READ compositingActive NOTIFY compositingActiveChanged)
68 
69 public:
70  explicit KWindowSystemProxy(QObject *parent = nullptr);
71  ~KWindowSystemProxy() override;
72 
73  int currentDesktop() const;
74  void setCurrentDesktop(int desktop);
75 
76  QString currentDesktopName() const;
77  int numberOfDesktops() const;
78 
79  bool showingDesktop() const;
80  void setShowingDesktop(bool showingDesktop);
81 
82  bool compositingActive() const;
83 
88  Q_INVOKABLE bool hasWindow(QWindow *window) const;
89 
101  Q_INVOKABLE void forceActivateWindow(QWindow *window, long time = 0);
102 
110  Q_INVOKABLE void setOnAllDesktops(QWindow *window, bool onAllDesktops);
117  Q_INVOKABLE void setOnDesktop(QWindow *window, int desktop);
124  Q_INVOKABLE void setOnActivities(QWindow *window, const QStringList &activities);
125 
132  Q_INVOKABLE QString desktopName(int desktop) const;
138  Q_INVOKABLE void setDesktopName(int desktop, const QString &name);
139 
140 Q_SIGNALS:
141  void currentDesktopChanged(int desktop);
142  void currentDesktopNameChanged();
143 
144  void desktopNamesChanged();
145  void numberOfDesktopsChanged(int numberOfDesktops);
146  void showingDesktopChanged(bool showingDesktop);
147  void compositingActiveChanged(bool compositingActive);
148 
149 protected:
150  void connectNotify(const QMetaMethod &signal) override;
151 
152 private:
153  bool m_initialized;
154 
155 };
156 
157 #endif // KWINDOWSYSTEMPROXY_H
Q_INVOKABLE void forceActivateWindow(QWindow *window, long time=0)
Sets window window to be the active window.
Q_INVOKABLE void setDesktopName(int desktop, const QString &name)
Sets the name of the specified desktop.
This item exposes various properties of KWindowSystem for use inside a QML environment.
Q_SIGNALSQ_SIGNALS
Q_INVOKABLE bool hasWindow(QWindow *window) const
Test to see if window still managed at present.
Q_OBJECTQ_OBJECT
Q_INVOKABLE void setOnAllDesktops(QWindow *window, bool onAllDesktops)
Sets window window to be present on all virtual desktops if onAllDesktops true.
Q_INVOKABLE QString desktopName(int desktop) const
Returns the name of the specified desktop.
Q_PROPERTY(...)
Q_INVOKABLEQ_INVOKABLE
Q_INVOKABLE void setOnDesktop(QWindow *window, int desktop)
Moves window window to desktop desktop.
QObject * parent() const const
Q_INVOKABLE void setOnActivities(QWindow *window, const QStringList &activities)
Moves window window to activities activities.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 13 2020 22:38:57 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.