File indexing completed on 2024-05-12 05:36:51
0001 /* 0002 * SPDX-FileCopyrightText: 2020 David Redondo <kde@david-redondo.de> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 #pragma once 0008 0009 #include <QObject> 0010 #include <qqmlregistration.h> 0011 0012 class FaceLoader; 0013 class KConfigGroup; 0014 0015 class WidgetExporter : public QObject 0016 { 0017 Q_OBJECT 0018 Q_PROPERTY(bool plasmashellAvailable MEMBER m_plasmashellAvailable NOTIFY plasmashellAvailableChanged) 0019 QML_ELEMENT 0020 QML_SINGLETON 0021 0022 public: 0023 explicit WidgetExporter(QObject *parent = nullptr); 0024 0025 Q_INVOKABLE void exportAsWidget(FaceLoader *loader) const; 0026 Q_SIGNALS: 0027 void plasmashellAvailableChanged(); 0028 0029 private: 0030 bool m_plasmashellAvailable; 0031 QString configEntriesScript(const KConfigGroup &group, const QStringList &path = {}) const; 0032 };