File indexing completed on 2025-02-09 06:41:24
0001 /* 0002 SPDX-FileCopyrightText: 2023 Marco Martin <mart@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef PLASMOIDATTACHED_P_H 0008 #define PLASMOIDATTACHED_P_H 0009 0010 #include <QAction> 0011 #include <QObject> 0012 #include <QQmlEngine> 0013 0014 // 0015 // W A R N I N G 0016 // ------------- 0017 // 0018 // This file is not part of the public Plasma API. It exists purely as an 0019 // implementation detail. This header file may change from version to 0020 // version without notice, or even be removed. 0021 // 0022 // We mean it. 0023 // 0024 0025 namespace Plasma 0026 { 0027 class Applet; 0028 class Containment; 0029 } 0030 0031 namespace PlasmaQuick 0032 { 0033 // Class used exclusively to generate the Plasmoid.* attached proeprties, which are Applet instances 0034 class PlasmoidAttached : public QObject 0035 { 0036 Q_OBJECT 0037 0038 public: 0039 /** TODO: When the migration to the new action api is done, remove this enum 0040 */ 0041 enum ActionPriority { 0042 LowPriorityAction = QAction::LowPriority, 0043 NormalPriorityAction = QAction::NormalPriority, 0044 HighPriorityAction = QAction::HighPriority, 0045 }; 0046 Q_ENUM(ActionPriority) 0047 0048 PlasmoidAttached(QObject *parent = nullptr); 0049 ~PlasmoidAttached() override; 0050 0051 ////NEEDED BY QML TO CREATE ATTACHED PROPERTIES 0052 static Plasma::Applet *qmlAttachedProperties(QObject *object); 0053 }; 0054 0055 // Class used exclusively to generate the Plasmoid.* attached proeprties, which are Applet instances 0056 class ContainmentAttached : public QObject 0057 { 0058 Q_OBJECT 0059 0060 public: 0061 ContainmentAttached(QObject *parent = nullptr); 0062 ~ContainmentAttached() override; 0063 0064 ////NEEDED BY QML TO CREATE ATTACHED PROPERTIES 0065 static Plasma::Containment *qmlAttachedProperties(QObject *object); 0066 }; 0067 0068 } 0069 0070 QML_DECLARE_TYPEINFO(PlasmaQuick::PlasmoidAttached, QML_HAS_ATTACHED_PROPERTIES) 0071 QML_DECLARE_TYPEINFO(PlasmaQuick::ContainmentAttached, QML_HAS_ATTACHED_PROPERTIES) 0072 0073 #endif