Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/virtualdesktopinfo.h
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | Copyright 2016 Eike Hein <hein.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 VIRTUALDESKTOPINFO_H | ||||
22 | #define VIRTUALDESKTOPINFO_H | ||||
23 | | ||||
24 | #include <QObject> | ||||
25 | | ||||
26 | #include "taskmanager_export.h" | ||||
27 | | ||||
28 | namespace TaskManager | ||||
29 | { | ||||
30 | | ||||
31 | /** | ||||
32 | * @short Provides basic virtual desktop information. | ||||
33 | * | ||||
34 | * This class provides basic information about the virtual desktops present | ||||
35 | * in the session as a set of notifiable properties. | ||||
36 | * | ||||
37 | * @NOTE: This is a placeholder, to be moved into KWindowSystem (which it | ||||
38 | * wraps) or the Task Manager applet backend (which used to fill this role | ||||
39 | * in the past). | ||||
40 | * | ||||
41 | * @see KWindowSystem | ||||
42 | * | ||||
43 | * @author Eike Hein <hein@kde.org> | ||||
44 | **/ | ||||
45 | | ||||
46 | class TASKMANAGER_EXPORT VirtualDesktopInfo : public QObject | ||||
47 | { | ||||
48 | Q_OBJECT | ||||
49 | | ||||
50 | Q_PROPERTY(int currentDesktop READ currentDesktop NOTIFY currentDesktopChanged) | ||||
51 | Q_PROPERTY(int numberOfDesktops READ numberOfDesktops NOTIFY numberOfDesktopsChanged) | ||||
52 | Q_PROPERTY(QStringList desktopNames READ desktopNames NOTIFY desktopNamesChanged) | ||||
53 | | ||||
54 | public: | ||||
55 | explicit VirtualDesktopInfo(QObject *parent = 0); | ||||
56 | virtual ~VirtualDesktopInfo(); | ||||
57 | | ||||
58 | /** | ||||
59 | * The currently active virtual desktop. | ||||
60 | * | ||||
61 | * @returns the number of the currently active virtual desktop. | ||||
62 | **/ | ||||
63 | int currentDesktop() const; | ||||
64 | | ||||
65 | /** | ||||
66 | * The number of virtual desktops present in the session. | ||||
67 | * | ||||
68 | * @returns the number of virtual desktops present in the session. | ||||
69 | **/ | ||||
70 | int numberOfDesktops() const; | ||||
71 | | ||||
72 | /** | ||||
73 | * The names of all virtual desktops present in the session. Note that | ||||
74 | * virtual desktops are indexed starting at 1, so the name for virtual | ||||
75 | * desktop 1 is at index 0 in this list. | ||||
76 | * | ||||
77 | * @returns a the list of names for the virtual desktops present in the | ||||
78 | * session. | ||||
79 | **/ | ||||
80 | QStringList desktopNames() const; | ||||
81 | | ||||
82 | Q_SIGNALS: | ||||
83 | void currentDesktopChanged() const; | ||||
84 | void numberOfDesktopsChanged() const; | ||||
85 | void desktopNamesChanged() const; | ||||
86 | }; | ||||
87 | | ||||
88 | } | ||||
89 | | ||||
90 | #endif |