Changeset View
Changeset View
Standalone View
Standalone View
kcms/launch/launchfeedback.h
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org> | 2 | * Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org> | ||
3 | * Copyright (C) 2017 Eike Hein <hein@kde.org> | 3 | * Copyright (C) 2017 Eike Hein <hein@kde.org> | ||
4 | * Copyright (c) 2019 Cyril Rossi <cyril.rossi@enioka.com> | ||||
4 | * | 5 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | 8 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | 9 | * (at your option) any later version. | ||
9 | * | 10 | * | ||
10 | * This program is distributed in the hope that it will be useful, | 11 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | 14 | * GNU General Public License for more details. | ||
14 | * | 15 | * | ||
15 | * You should have received a copy of the GNU General Public License | 16 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software | ||
17 | */ | 18 | */ | ||
18 | 19 | | |||
19 | #ifndef LAUNCHFEEDBACK_H | 20 | #ifndef LAUNCHFEEDBACK_H | ||
20 | #define LAUNCHFEEDBACK_H | 21 | #define LAUNCHFEEDBACK_H | ||
21 | 22 | | |||
22 | #include <KQuickAddons/ConfigModule> | 23 | #include <KQuickAddons/ManagedConfigModule> | ||
23 | 24 | | |||
24 | class LaunchFeedback : public KQuickAddons::ConfigModule | 25 | class LaunchFeedbackSettings; | ||
26 | | ||||
27 | class LaunchFeedback : public KQuickAddons::ManagedConfigModule | ||||
25 | { | 28 | { | ||
26 | Q_OBJECT | 29 | Q_OBJECT | ||
27 | 30 | | |||
28 | Q_PROPERTY(int busyCursorCurrentIndex READ busyCursorCurrentIndex WRITE setBusyCursorCurrentIndex NOTIFY busyCursorCurrentIndexChanged) | 31 | Q_PROPERTY(LaunchFeedbackSettings *launchFeedbackSettings READ launchFeedbackSettings CONSTANT) | ||
29 | | ||||
30 | Q_PROPERTY(bool taskManagerNotification READ taskManagerNotification WRITE setTaskManagerNotification NOTIFY taskManagerNotificationChanged) | | |||
31 | | ||||
32 | Q_PROPERTY(int notificationTimeout READ notificationTimeout WRITE setNotificationTimeout NOTIFY notificationTimeoutChanged) | | |||
33 | 32 | | |||
34 | public: | 33 | public: | ||
34 | enum class CursorFeedbackType { | ||||
35 | None, | ||||
36 | Static, | ||||
37 | Blinking, | ||||
38 | Bouncing, | ||||
39 | }; | ||||
40 | Q_ENUM(CursorFeedbackType) | ||||
41 | | ||||
35 | explicit LaunchFeedback(QObject* parent = nullptr, const QVariantList &list = QVariantList()); | 42 | explicit LaunchFeedback(QObject *parent = nullptr, const QVariantList &list = QVariantList()); | ||
36 | ~LaunchFeedback() override; | 43 | ~LaunchFeedback() override; | ||
37 | 44 | | |||
38 | int busyCursorCurrentIndex() const; | 45 | LaunchFeedbackSettings *launchFeedbackSettings() const; | ||
39 | void setBusyCursorCurrentIndex(int index); | | |||
40 | | ||||
41 | bool taskManagerNotification() const; | | |||
42 | void setTaskManagerNotification(bool enabled); | | |||
43 | | ||||
44 | int notificationTimeout() const; | | |||
45 | void setNotificationTimeout(int duration); | | |||
46 | 46 | | |||
47 | public Q_SLOTS: | 47 | public Q_SLOTS: | ||
48 | void load() override; | | |||
49 | void save() override; | 48 | void save() override; | ||
50 | void defaults() override; | | |||
51 | | ||||
52 | Q_SIGNALS: | | |||
53 | void busyCursorCurrentIndexChanged() const; | | |||
54 | | ||||
55 | void taskManagerNotificationChanged() const; | | |||
56 | | ||||
57 | void notificationTimeoutChanged() const; | | |||
58 | 49 | | |||
59 | private: | 50 | private: | ||
60 | void updateNeedsSave(); | 51 | LaunchFeedbackSettings *m_settings; | ||
61 | | ||||
62 | int m_busyCursorCurrentIndex; | | |||
63 | | ||||
64 | bool m_taskManagerNotification; | | |||
65 | | ||||
66 | int m_notificationTimeout; | | |||
67 | }; | 52 | }; | ||
68 | 53 | | |||
69 | #endif | 54 | #endif |