Changeset View
Changeset View
Standalone View
Standalone View
src/server/filtered_display.h
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | Copyright 2017 David Edmundson <davidedmundson@kde.org> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU Lesser General Public | ||||
6 | License as published by the Free Software Foundation; either | ||||
7 | version 2.1 of the License, or (at your option) version 3, or any | ||||
8 | later version accepted by the membership of KDE e.V. (or its | ||||
9 | successor approved by the membership of KDE e.V.), which shall | ||||
10 | act as a proxy defined in Section 6 of version 3 of the license. | ||||
11 | | ||||
12 | This library is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
15 | Lesser General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU Lesser General Public | ||||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | *********************************************************************/ | ||||
20 | | ||||
21 | #ifndef KWAYLAND_SERVER_FILTERED_DISPLAY_H | ||||
22 | #define KWAYLAND_SERVER_FILTERED_DISPLAY_H | ||||
23 | | ||||
24 | #include "global.h" | ||||
25 | #include "display.h" | ||||
26 | | ||||
27 | #include <KWayland/Server/kwaylandserver_export.h> | ||||
28 | | ||||
29 | namespace KWayland | ||||
30 | { | ||||
31 | namespace Server | ||||
32 | { | ||||
33 | | ||||
34 | /** | ||||
35 | * Server Implementation that allows one to restrict which globals are available to which clients | ||||
36 | * | ||||
37 | * Users of this class must implement the virtual @method allowInterface method. | ||||
38 | * | ||||
39 | * @since 5.FIXME | ||||
40 | */ | ||||
41 | class KWAYLANDSERVER_EXPORT FilteredDisplay : public Display | ||||
42 | { | ||||
43 | Q_OBJECT | ||||
44 | public: | ||||
45 | FilteredDisplay(QObject *parent); | ||||
46 | ~FilteredDisplay(); | ||||
47 | | ||||
48 | /** | ||||
49 | * Return whether the @arg client can see the interface with the given @arg interfaceName | ||||
50 | * | ||||
51 | * When false will not see these globals for a given interface in the registry, | ||||
52 | * and any manual attempts to bind will fail | ||||
53 | * | ||||
54 | * @return true if the client should be able to access the global with the following interfaceName | ||||
55 | */ | ||||
56 | virtual bool allowInterface(ClientConnection *client, const QByteArray &interfaceName) = 0; | ||||
57 | private: | ||||
58 | class Private; | ||||
59 | QScopedPointer<Private> d; | ||||
60 | }; | ||||
61 | | ||||
62 | } | ||||
63 | } | ||||
64 | | ||||
65 | #endif |