Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwindesktop/virtualdesktops.h
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2018 Eike Hein <hein@kde.org> | 2 | * Copyright (C) 2018 Eike Hein <hein@kde.org> | ||
3 | * Copyright (C) 2018 Vlad Zagorodniy <vladzzag@gmail.com> | ||||
3 | * | 4 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | 5 | * 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 | * 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 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | 8 | * (at your option) any later version. | ||
8 | * | 9 | * | ||
9 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. | ||
13 | * | 14 | * | ||
14 | * You should have received a copy of the GNU General Public License | 15 | * 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 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | 17 | */ | ||
17 | 18 | | |||
18 | #ifndef VIRTUALDESKTOPS_H | 19 | #ifndef VIRTUALDESKTOPS_H | ||
19 | #define VIRTUALDESKTOPS_H | 20 | #define VIRTUALDESKTOPS_H | ||
20 | 21 | | |||
21 | #include <KQuickAddons/ConfigModule> | 22 | #include <KQuickAddons/ConfigModule> | ||
22 | #include <KSharedConfig> | 23 | #include <KSharedConfig> | ||
23 | 24 | | |||
24 | namespace KWin | 25 | namespace KWin | ||
25 | { | 26 | { | ||
26 | 27 | | |||
28 | class AnimationsModel; | ||||
27 | class DesktopsModel; | 29 | class DesktopsModel; | ||
28 | 30 | | |||
29 | class VirtualDesktops : public KQuickAddons::ConfigModule | 31 | class VirtualDesktops : public KQuickAddons::ConfigModule | ||
30 | { | 32 | { | ||
31 | Q_OBJECT | 33 | Q_OBJECT | ||
32 | 34 | | |||
33 | Q_PROPERTY(QAbstractItemModel* desktopsModel READ desktopsModel CONSTANT) | 35 | Q_PROPERTY(QAbstractItemModel* desktopsModel READ desktopsModel CONSTANT) | ||
34 | Q_PROPERTY(bool navWraps READ navWraps WRITE setNavWraps NOTIFY navWrapsChanged) | 36 | Q_PROPERTY(bool navWraps READ navWraps WRITE setNavWraps NOTIFY navWrapsChanged) | ||
35 | Q_PROPERTY(bool osdEnabled READ osdEnabled WRITE setOsdEnabled NOTIFY osdEnabledChanged) | 37 | Q_PROPERTY(bool osdEnabled READ osdEnabled WRITE setOsdEnabled NOTIFY osdEnabledChanged) | ||
36 | Q_PROPERTY(int osdDuration READ osdDuration WRITE setOsdDuration NOTIFY osdDurationChanged) | 38 | Q_PROPERTY(int osdDuration READ osdDuration WRITE setOsdDuration NOTIFY osdDurationChanged) | ||
37 | Q_PROPERTY(bool osdTextOnly READ osdTextOnly WRITE setOsdTextOnly NOTIFY osdTextOnlyChanged) | 39 | Q_PROPERTY(bool osdTextOnly READ osdTextOnly WRITE setOsdTextOnly NOTIFY osdTextOnlyChanged) | ||
40 | Q_PROPERTY(QAbstractItemModel *animationsModel READ animationsModel CONSTANT) | ||||
38 | 41 | | |||
39 | public: | 42 | public: | ||
40 | explicit VirtualDesktops(QObject *parent = nullptr, const QVariantList &list = QVariantList()); | 43 | explicit VirtualDesktops(QObject *parent = nullptr, const QVariantList &list = QVariantList()); | ||
41 | ~VirtualDesktops() override; | 44 | ~VirtualDesktops() override; | ||
42 | 45 | | |||
43 | QAbstractItemModel *desktopsModel() const; | 46 | QAbstractItemModel *desktopsModel() const; | ||
44 | 47 | | |||
45 | bool navWraps() const; | 48 | bool navWraps() const; | ||
46 | void setNavWraps(bool wraps); | 49 | void setNavWraps(bool wraps); | ||
47 | 50 | | |||
48 | bool osdEnabled() const; | 51 | bool osdEnabled() const; | ||
49 | void setOsdEnabled(bool enabled); | 52 | void setOsdEnabled(bool enabled); | ||
50 | 53 | | |||
51 | int osdDuration() const; | 54 | int osdDuration() const; | ||
52 | void setOsdDuration(int duration); | 55 | void setOsdDuration(int duration); | ||
53 | 56 | | |||
54 | int osdTextOnly() const; | 57 | int osdTextOnly() const; | ||
55 | void setOsdTextOnly(bool textOnly); | 58 | void setOsdTextOnly(bool textOnly); | ||
56 | 59 | | |||
60 | QAbstractItemModel *animationsModel() const; | ||||
61 | | ||||
57 | Q_SIGNALS: | 62 | Q_SIGNALS: | ||
58 | void navWrapsChanged() const; | 63 | void navWrapsChanged() const; | ||
59 | void osdEnabledChanged() const; | 64 | void osdEnabledChanged() const; | ||
60 | void osdDurationChanged() const; | 65 | void osdDurationChanged() const; | ||
61 | void osdTextOnlyChanged() const; | 66 | void osdTextOnlyChanged() const; | ||
62 | 67 | | |||
63 | public Q_SLOTS: | 68 | public Q_SLOTS: | ||
64 | void load() override; | 69 | void load() override; | ||
65 | void save() override; | 70 | void save() override; | ||
66 | void defaults() override; | 71 | void defaults() override; | ||
67 | 72 | | |||
73 | void configureAnimation(); | ||||
74 | void showAboutAnimation(); | ||||
75 | | ||||
68 | private Q_SLOTS: | 76 | private Q_SLOTS: | ||
69 | void updateNeedsSave(); | 77 | void updateNeedsSave(); | ||
70 | 78 | | |||
71 | private: | 79 | private: | ||
72 | KSharedConfigPtr m_kwinConfig; | 80 | KSharedConfigPtr m_kwinConfig; | ||
73 | DesktopsModel *m_desktopsModel; | 81 | DesktopsModel *m_desktopsModel; | ||
74 | bool m_navWraps; | 82 | bool m_navWraps; | ||
75 | bool m_osdEnabled; | 83 | bool m_osdEnabled; | ||
76 | int m_osdDuration; | 84 | int m_osdDuration; | ||
77 | bool m_osdTextOnly; | 85 | bool m_osdTextOnly; | ||
86 | AnimationsModel *m_animationsModel; | ||||
78 | }; | 87 | }; | ||
79 | 88 | | |||
80 | } | 89 | } | ||
81 | 90 | | |||
82 | #endif | 91 | #endif |