File indexing completed on 2022-09-27 16:03:53

0001 /*
0002     SPDX-FileCopyrightText: 2014 Marco Martin <mart@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef ALTERNATIVESHELPER_H
0008 #define ALTERNATIVESHELPER_H
0009 
0010 // Qt
0011 #include <QQuickItem>
0012 
0013 // Plasma
0014 #include <Plasma/Applet>
0015 
0016 class AlternativesHelper : public QObject
0017 {
0018     Q_OBJECT
0019     Q_PROPERTY(QStringList appletProvides READ appletProvides CONSTANT)
0020     Q_PROPERTY(QString currentPlugin READ currentPlugin CONSTANT)
0021     Q_PROPERTY(QQuickItem *applet READ applet CONSTANT)
0022 
0023 public:
0024     AlternativesHelper(Plasma::Applet *applet, QObject *parent = 0);
0025     ~AlternativesHelper() override;
0026 
0027     QQuickItem *applet() const;
0028     QStringList appletProvides() const;
0029     QString currentPlugin() const;
0030 
0031     Q_INVOKABLE void loadAlternative(const QString &plugin);
0032 
0033 private:
0034     Plasma::Applet *m_applet;
0035 };
0036 
0037 #endif