/* SPDX-FileCopyrightText: 2019 Marco Martin SPDX-License-Identifier: LGPL-2.0-or-later */ #pragma once #include "itemcontainer.h" #include #include namespace PlasmaQuick { class AppletQuickItem; } class AppletContainer : public ItemContainer { Q_OBJECT QML_ELEMENT Q_INTERFACES(QQmlParserStatus) Q_PROPERTY(PlasmaQuick::AppletQuickItem *applet READ applet NOTIFY appletChanged) Q_PROPERTY(QQmlComponent *busyIndicatorComponent READ busyIndicatorComponent WRITE setBusyIndicatorComponent NOTIFY busyIndicatorComponentChanged) Q_PROPERTY(QQmlComponent *configurationRequiredComponent READ configurationRequiredComponent WRITE setConfigurationRequiredComponent NOTIFY configurationRequiredComponentChanged) public: AppletContainer(QQuickItem *parent = nullptr); ~AppletContainer(); PlasmaQuick::AppletQuickItem *applet(); // TODO: appletItem()? QQmlComponent *busyIndicatorComponent() const; void setBusyIndicatorComponent(QQmlComponent *comp); QQmlComponent *configurationRequiredComponent() const; void setConfigurationRequiredComponent(QQmlComponent *comp); protected: void componentComplete() override; Q_SIGNALS: void appletChanged(); void busyIndicatorComponentChanged(); void configurationRequiredComponentChanged(); private: void connectBusyIndicator(); void connectConfigurationRequired(); QPointer m_appletItem; QPointer m_busyIndicatorComponent; QQuickItem *m_busyIndicatorItem = nullptr; QPointer m_configurationRequiredComponent; QQuickItem *m_configurationRequiredItem = nullptr; };