Changeset View
Changeset View
Standalone View
Standalone View
shell/osd.h
Show All 16 Lines | |||||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #ifndef OSD_H | 19 | #ifndef OSD_H | ||
20 | #define OSD_H | 20 | #define OSD_H | ||
21 | 21 | | |||
22 | #include <QObject> | 22 | #include <QObject> | ||
23 | #include <QString> | 23 | #include <QString> | ||
24 | 24 | | |||
25 | #include <KSharedConfig> | ||||
26 | | ||||
25 | namespace KDeclarative { | 27 | namespace KDeclarative { | ||
26 | class QmlObject; | 28 | class QmlObject; | ||
27 | } | 29 | } | ||
28 | namespace Plasma { | 30 | namespace Plasma { | ||
29 | } | 31 | } | ||
30 | 32 | | |||
31 | class QTimer; | 33 | class QTimer; | ||
32 | class ShellCorona; | 34 | class ShellCorona; | ||
33 | 35 | | |||
34 | class Osd : public QObject { | 36 | class Osd : public QObject { | ||
35 | Q_OBJECT | 37 | Q_OBJECT | ||
36 | Q_CLASSINFO("D-Bus Interface", "org.kde.osdService") | 38 | Q_CLASSINFO("D-Bus Interface", "org.kde.osdService") | ||
37 | public: | 39 | public: | ||
38 | Osd(ShellCorona *corona); | 40 | Osd(KSharedConfig::Ptr config, ShellCorona *corona); | ||
39 | ~Osd() override; | 41 | ~Osd() override; | ||
40 | 42 | | |||
41 | public Q_SLOTS: | 43 | public Q_SLOTS: | ||
42 | void brightnessChanged(int percent); | 44 | void brightnessChanged(int percent); | ||
43 | void keyboardBrightnessChanged(int percent); | 45 | void keyboardBrightnessChanged(int percent); | ||
44 | void volumeChanged(int percent); | 46 | void volumeChanged(int percent); | ||
45 | void microphoneVolumeChanged(int percent); | 47 | void microphoneVolumeChanged(int percent); | ||
46 | void mediaPlayerVolumeChanged(int percent, const QString &playerName, const QString &playerIconName); | 48 | void mediaPlayerVolumeChanged(int percent, const QString &playerName, const QString &playerIconName); | ||
Show All 18 Lines | 65 | private: | |||
65 | 67 | | |||
66 | void showProgress(const QString &icon, const int percent, const QString &additionalText = QString()); | 68 | void showProgress(const QString &icon, const int percent, const QString &additionalText = QString()); | ||
67 | void showOsd(); | 69 | void showOsd(); | ||
68 | 70 | | |||
69 | QString m_osdPath; | 71 | QString m_osdPath; | ||
70 | KDeclarative::QmlObject *m_osdObject = nullptr; | 72 | KDeclarative::QmlObject *m_osdObject = nullptr; | ||
71 | QTimer *m_osdTimer = nullptr; | 73 | QTimer *m_osdTimer = nullptr; | ||
72 | int m_timeout = 0; | 74 | int m_timeout = 0; | ||
75 | | ||||
76 | KSharedConfig::Ptr m_config; | ||||
73 | }; | 77 | }; | ||
74 | 78 | | |||
75 | #endif // OSD_H | 79 | #endif // OSD_H |