Changeset View
Changeset View
Standalone View
Standalone View
tabletmodemanager.h
Show All 21 Lines | |||||
22 | #ifndef KWIN_TABLETMODEMANAGER_H | 22 | #ifndef KWIN_TABLETMODEMANAGER_H | ||
23 | #define KWIN_TABLETMODEMANAGER_H | 23 | #define KWIN_TABLETMODEMANAGER_H | ||
24 | 24 | | |||
25 | #include <QObject> | 25 | #include <QObject> | ||
26 | #include <kwinglobals.h> | 26 | #include <kwinglobals.h> | ||
27 | 27 | | |||
28 | namespace KWin { | 28 | namespace KWin { | ||
29 | 29 | | |||
30 | class TabletModeInputEventSpy; | | |||
31 | | ||||
32 | class TabletModeManager : public QObject | 30 | class TabletModeManager : public QObject | ||
33 | { | 31 | { | ||
34 | Q_OBJECT | 32 | Q_OBJECT | ||
35 | Q_CLASSINFO("D-Bus Interface", "org.kde.KWin.TabletModeManager") | 33 | Q_CLASSINFO("D-Bus Interface", "org.kde.KWin.TabletModeManager") | ||
36 | //assuming such a switch is not pluggable for now | 34 | //assuming such a switch is not pluggable for now | ||
37 | Q_PROPERTY(bool tabletModeAvailable READ isTabletModeAvailable NOTIFY tabletModeAvailableChanged) | 35 | Q_PROPERTY(bool tabletModeAvailable READ isTabletModeAvailable NOTIFY tabletModeAvailableChanged) | ||
38 | Q_PROPERTY(bool tabletMode READ isTablet NOTIFY tabletModeChanged) | 36 | Q_PROPERTY(bool tabletMode READ isTablet NOTIFY tabletModeChanged) | ||
39 | 37 | | |||
40 | public: | 38 | public: | ||
41 | ~TabletModeManager() = default; | 39 | ~TabletModeManager() = default; | ||
42 | 40 | | |||
43 | bool isTabletModeAvailable() const; | 41 | bool isTabletModeAvailable() const; | ||
44 | 42 | | |||
45 | bool isTablet() const; | 43 | bool isTablet() const; | ||
46 | void setIsTablet(bool tablet); | 44 | void setIsTablet(bool tablet); | ||
47 | 45 | | |||
48 | Q_SIGNALS: | 46 | Q_SIGNALS: | ||
49 | void tabletModeAvailableChanged(bool available); | 47 | void tabletModeAvailableChanged(bool available); | ||
50 | void tabletModeChanged(bool tabletMode); | 48 | void tabletModeChanged(bool tabletMode); | ||
51 | 49 | | |||
52 | private: | 50 | private: | ||
53 | bool m_tabletModeAvailable = false; | 51 | bool m_tabletModeAvailable = false; | ||
54 | bool m_isTabletMode = false; | 52 | bool m_isTabletMode = false; | ||
55 | TabletModeInputEventSpy *m_spy; | 53 | bool m_detecting = false; | ||
56 | KWIN_SINGLETON_VARIABLE(TabletModeManager, s_manager) | 54 | KWIN_SINGLETON_VARIABLE(TabletModeManager, s_manager) | ||
57 | }; | 55 | }; | ||
58 | } | 56 | } | ||
59 | 57 | | |||
60 | #endif // KWIN_TABLETMODEMANAGER_H | 58 | #endif // KWIN_TABLETMODEMANAGER_H |