Changeset View
Changeset View
Standalone View
Standalone View
kcms/workspaceoptions/kcm.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright (C) 2018 <furkantokac34@gmail.com> | ||||
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, write to the Free Software | ||||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
17 | */ | ||||
18 | #ifndef _KCM_WORKSPACE_H | ||||
19 | #define _KCM_WORKSPACE_H | ||||
20 | | ||||
21 | #include <KQuickAddons/ConfigModule> | ||||
22 | | ||||
23 | class KCMWorkspaceOptions : public KQuickAddons::ConfigModule | ||||
24 | { | ||||
25 | Q_OBJECT | ||||
26 | Q_PROPERTY(bool toolTip READ getToolTip WRITE setToolTip NOTIFY toolTipChanged) | ||||
27 | Q_PROPERTY(bool visualFeedback READ getVisualFeedback WRITE setVisualFeedback NOTIFY visualFeedbackChanged) | ||||
28 | | ||||
29 | public: | ||||
30 | KCMWorkspaceOptions(QObject* parent, const QVariantList& args); | ||||
31 | ~KCMWorkspaceOptions() {} | ||||
32 | | ||||
33 | // QML Properties | ||||
34 | bool getToolTip() const; | ||||
35 | void setToolTip(bool state); | ||||
36 | | ||||
37 | bool getVisualFeedback() const; | ||||
38 | void setVisualFeedback(bool state); | ||||
39 | | ||||
40 | public Q_SLOTS: | ||||
41 | void load(); | ||||
42 | void save(); | ||||
43 | void defaults(); | ||||
44 | | ||||
45 | Q_SIGNALS: | ||||
46 | void toolTipChanged(); | ||||
47 | void visualFeedbackChanged(); | ||||
48 | | ||||
49 | private: | ||||
50 | void handleNeedsSave(); | ||||
51 | | ||||
52 | // QML variables | ||||
53 | bool m_ostateToolTip; // Original state | ||||
54 | bool m_stateToolTip; // Current state | ||||
55 | | ||||
56 | bool m_ostateVisualFeedback; | ||||
57 | bool m_stateVisualFeedback; | ||||
58 | }; | ||||
59 | | ||||
60 | #endif // _KCM_WORKSPACE_H |