File indexing completed on 2024-05-05 05:29:13

0001 /*
0002  * SPDX-FileCopyrightText: 2016 Kai Uwe Broulik <kde@privat.broulik.de>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005  *
0006  */
0007 
0008 #pragma once
0009 
0010 #include <QObject>
0011 
0012 class UnityLauncher : public QObject
0013 {
0014     Q_OBJECT
0015     Q_PROPERTY(QString launcherId READ launcherId WRITE setLauncherId)
0016     Q_PROPERTY(bool progressVisible READ progressVisible WRITE setProgressVisible)
0017     Q_PROPERTY(int progress READ progress WRITE setProgress)
0018 
0019 public:
0020     explicit UnityLauncher(QObject *parent = nullptr);
0021     ~UnityLauncher() override;
0022 
0023     QString launcherId() const;
0024     void setLauncherId(const QString &launcherId);
0025 
0026     bool progressVisible() const;
0027     void setProgressVisible(bool progressVisible);
0028 
0029     int progress() const;
0030     void setProgress(int progress);
0031 
0032 private:
0033     void update(const QVariantMap &properties);
0034 
0035     QString m_launcherId;
0036     bool m_progressVisible = false;
0037     int m_progress = 0;
0038 };