File indexing completed on 2024-05-12 05:38:48

0001 /*
0002     SPDX-FileCopyrightText: 2014 Martin Klapetek <mklapetek@kde.org>
0003     SPDX-FileCopyrightText: 2016 Sebastian Kügler <sebas@kde.org>
0004     SPDX-FileCopyrightText: 2023 Natalie Clarius <natalie.clarius@kde.org>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #pragma once
0010 
0011 #include <QObject>
0012 #include <QQmlEngine>
0013 #include <QQuickView>
0014 #include <QRect>
0015 #include <QString>
0016 
0017 #include <memory>
0018 
0019 class QQuickView;
0020 
0021 class QTimer;
0022 
0023 namespace PowerDevil
0024 {
0025 class Osd : public QObject
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     using QObject::QObject;
0031 
0032     void showActionSelector(const QString &currentProfile = QString());
0033     void hideOsd();
0034 
0035 Q_SIGNALS:
0036     void osdActionSelected(QString action);
0037 
0038 private Q_SLOTS:
0039     void onOsdActionSelected(const QString &action);
0040 
0041 private:
0042     QQmlEngine m_engine;
0043     std::unique_ptr<QQuickView> m_osdActionSelector;
0044 };
0045 
0046 } // namespace PowerDevil