/* SPDX-FileCopyrightText: 2014 Martin Klapetek SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once #include #include #include #include #include namespace PlasmaQuick { class SharedQmlEngine; } class QTimer; class ShellCorona; class Osd : public QObject { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.osdService") public: Osd(const KSharedConfig::Ptr &config, ShellCorona *corona); ~Osd() override; public Q_SLOTS: void brightnessChanged(int percent); void screenBrightnessChanged(int percent, const QString &displayId, const QString &displayLabel, int priority, const QRect &screenRect); void keyboardBrightnessChanged(int percent); void volumeChanged(int percent); void volumeChanged(int percent, int maximumPercent); void microphoneVolumeChanged(int percent); void mediaPlayerVolumeChanged(int percent, const QString &playerName, const QString &playerIconName); void kbdLayoutChanged(const QString &layoutName); void virtualDesktopChanged(const QString ¤tVirtualDesktopName); void touchpadEnabledChanged(bool touchpadEnabled); void wifiEnabledChanged(bool wifiEnabled); void bluetoothEnabledChanged(bool bluetoothEnabled); void wwanEnabledChanged(bool wwanEnabled); void virtualKeyboardEnabledChanged(bool virtualKeyboardEnabled); void powerManagementInhibitedChanged(bool inhibited); void powerProfileChanged(const QString &profile); void showText(const QString &icon, const QString &text); Q_SIGNALS: void osdProgress(const QString &icon, const int percent, const int maximumPercent, const QString &additionalText); void osdText(const QString &icon, const QString &text); private Q_SLOTS: void hideOsd(); private: bool init(); void showProgress(const QString &icon, const int percent, const int maximumPercent, const QString &additionalText = QString()); void showOsd(); ShellCorona *m_corona; PlasmaQuick::SharedQmlEngine *m_osdObject = nullptr; QTimer *m_osdTimer = nullptr; int m_timeout = 0; KConfigGroup m_osdConfigGroup; struct ScreenBrightnessInfo { QString id; QString label; QRect screenRect; int priority; int percent; }; QMap m_screenBrightnessInfo; };