1 | /* |
2 | * SPDX-FileCopyrightText: 2024 Nathan Misner <nathan@infochunk.com> |
3 | * |
4 | * SPDX-License-Identifier: LGPL-2.0-or-later |
5 | */ |
6 | |
7 | #ifndef KIRIGAMI_SMOOTHSCROLLWATCHER_H |
8 | #define KIRIGAMI_SMOOTHSCROLLWATCHER_H |
9 | |
10 | #include <QObject> |
11 | |
12 | #include "kirigamiplatform_export.h" |
13 | |
14 | namespace Kirigami |
15 | { |
16 | namespace Platform |
17 | { |
18 | /* |
19 | * This class reports on the status of the SmoothScroll DBus interface, |
20 | * which sends a message when the smooth scroll setting gets changed. |
21 | */ |
22 | class KIRIGAMIPLATFORM_EXPORT SmoothScrollWatcher : public QObject |
23 | { |
24 | Q_OBJECT |
25 | Q_PROPERTY(bool enabled READ enabled NOTIFY enabledChanged FINAL) |
26 | |
27 | public: |
28 | SmoothScrollWatcher(QObject *parent = nullptr); |
29 | ~SmoothScrollWatcher(); |
30 | |
31 | bool enabled() const; |
32 | |
33 | static SmoothScrollWatcher *self(); |
34 | |
35 | Q_SIGNALS: |
36 | void enabledChanged(bool value); |
37 | |
38 | private: |
39 | bool m_enabled; |
40 | |
41 | private Q_SLOTS: |
42 | void setEnabled(bool value); |
43 | }; |
44 | |
45 | } |
46 | } |
47 | |
48 | #endif // KIRIGAMI_SMOOTHSCROLLWATCHER_H |
49 | |