Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwindesktopng/virtualdesktops.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright (C) 2018 Eike Hein <hein@kde.org> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or modify | ||||
5 | * it under the terms of the GNU General Public License as published by | ||||
6 | * the Free Software Foundation; either version 2 of the License, or | ||||
7 | * (at your option) any later version. | ||||
8 | * | ||||
9 | * This program is distributed in the hope that it will be useful, | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | * GNU General Public License for more details. | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU General Public License | ||||
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
16 | */ | ||||
17 | | ||||
18 | #ifndef VIRTUALDESKTOPS_H | ||||
19 | #define VIRTUALDESKTOPS_H | ||||
20 | | ||||
21 | #include <KQuickAddons/ConfigModule> | ||||
22 | | ||||
23 | namespace KWin { | ||||
24 | | ||||
25 | class DesktopsModel; | ||||
26 | | ||||
27 | class VirtualDesktops : public KQuickAddons::ConfigModule | ||||
28 | { | ||||
29 | Q_OBJECT | ||||
30 | | ||||
31 | Q_PROPERTY(QAbstractItemModel* desktopsModel READ desktopsModel CONSTANT) | ||||
32 | Q_PROPERTY(int rows READ rows WRITE setRows NOTIFY rowsChanged) | ||||
33 | | ||||
34 | public: | ||||
35 | explicit VirtualDesktops(QObject* parent = nullptr, const QVariantList &list = QVariantList()); | ||||
36 | ~VirtualDesktops() override; | ||||
37 | | ||||
38 | QAbstractItemModel *desktopsModel() const; | ||||
39 | | ||||
40 | int rows() const; | ||||
41 | void setRows(int rows); | ||||
42 | | ||||
43 | public Q_SLOTS: | ||||
44 | void load() override; | ||||
45 | void save() override; | ||||
46 | void defaults() override; | ||||
47 | | ||||
48 | Q_SIGNALS: | ||||
49 | void rowsChanged() const; | ||||
50 | | ||||
51 | private: | ||||
52 | KWin::DesktopsModel *m_desktopsModel; | ||||
53 | int m_rows; | ||||
54 | }; | ||||
55 | | ||||
56 | } | ||||
57 | | ||||
58 | #endif |