1/********************************************************************
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5Copyright (C) 2012 Martin Gräßlin <mgraesslin@kde.org>
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program. If not, see <http://www.gnu.org/licenses/>.
19*********************************************************************/
20
21#ifndef KWIN_DBUS_INTERFACE_H
22#define KWIN_DBUS_INTERFACE_H
23
24#include <QObject>
25#include <QtDBus/QtDBus>
26class QByteArray;
27template<class T> class QList;
28template<class Key, class Value> class QMap;
29class QString;
30class QStringList;
31class QVariant;
32
33namespace KWin
34{
35
36/**
37 * @brief This class is a wrapper for the org.kde.KWin D-Bus interface.
38 *
39 * The main purpose of this class is to be exported on the D-Bus as object /KWin.
40 * It is a pure wrapper to provide the deprecated D-Bus methods which have been
41 * removed from Workspace which used to implement the complete D-Bus interface.
42 *
43 * Nowadays the D-Bus interfaces are distributed, parts of it are exported on
44 * /Compositor, parts on /Effects and parts on /KWin. The implementation in this
45 * class just delegates the method calls to the actual implementation in one of the
46 * three singletons.
47 *
48 * @author Martin Gräßlin <mgraesslin@kde.org>
49 * @todo KDE5: remove the methods provided on /Effects and /Compositor
50 **/
51class DBusInterface: public QObject
52{
53 Q_OBJECT
54 Q_CLASSINFO("D-Bus Interface", "org.kde.KWin")
55public:
56 explicit DBusInterface(QObject *parent);
57 virtual ~DBusInterface();
58
59public: // PROPERTIES
60public Q_SLOTS: // METHODS
61 Q_NOREPLY void cascadeDesktop();
62 /**
63 * @deprecated
64 **/
65 void circulateDesktopApplications();
66 int currentDesktop();
67 QList<int> decorationSupportedColors();
68 /**
69 * @deprecated
70 **/
71 void doNotManage(const QString &name);
72 Q_NOREPLY void killWindow();
73 void nextDesktop();
74 void previousDesktop();
75 Q_NOREPLY void reconfigure();
76 bool setCurrentDesktop(int desktop);
77 /**
78 * @deprecated
79 **/
80 void showWindowMenuAt(qlonglong winId, int x, int y);
81 bool startActivity(const QString &in0);
82 bool stopActivity(const QString &in0);
83 QString supportInformation();
84 Q_NOREPLY void unclutterDesktop();
85 // from compositor
86 /**
87 * @deprecated
88 **/
89 bool compositingActive();
90 /**
91 * @deprecated
92 **/
93 QString compositingNotPossibleReason();
94 /**
95 * @deprecated
96 **/
97 bool compositingPossible();
98 /**
99 * @deprecated
100 **/
101 QString compositingType();
102 /**
103 * @deprecated
104 **/
105 bool openGLIsBroken();
106 /**
107 * @deprecated
108 **/
109 Q_NOREPLY void toggleCompositing();
110 /**
111 * @deprecated
112 **/
113 bool waitForCompositingSetup();
114 // from effectshandler
115 /**
116 * @deprecated
117 **/
118 QStringList activeEffects();
119 /**
120 * @deprecated
121 **/
122 QStringList listOfEffects();
123 /**
124 * @deprecated
125 **/
126 void loadEffect(const QString &name);
127 /**
128 * @deprecated
129 **/
130 QStringList loadedEffects();
131 /**
132 * @deprecated
133 **/
134 void reconfigureEffect(const QString &name);
135 /**
136 * @deprecated
137 **/
138 QString supportInformationForEffect(const QString &name);
139 /**
140 * @deprecated
141 **/
142 void toggleEffect(const QString &name);
143 /**
144 * @deprecated
145 **/
146 void unloadEffect(const QString &name);
147
148Q_SIGNALS: // SIGNALS
149 /**
150 * @deprecated
151 **/
152 void compositingToggled(bool active);
153private Q_SLOTS:
154 void becomeKWinService(const QString &service);
155};
156
157} // namespace
158
159#endif // KWIN_DBUS_INTERFACE_H
160