/* SPDX-FileCopyrightText: 2005 Aaron Seigo SPDX-FileCopyrightText: 2007 Riccardo Iaconelli SPDX-FileCopyrightText: 2008 Ménard Alexis SPDX-License-Identifier: LGPL-2.0-or-later */ #ifndef PLASMA_APPLET_P_H #define PLASMA_APPLET_P_H #include #include #include #include #include #include #include #include #include #include "plasma/applet.h" class KKeySequenceWidget; namespace Plasma { class Service; class AppletPrivate { public: AppletPrivate(const KPluginMetaData &info, int uniqueID, Applet *applet); virtual ~AppletPrivate(); void init(const QVariantList &args); void setDestroyed(bool destroyed); void askDestroy(); virtual void cleanUpAndDelete(); QString globalName() const; void scheduleConstraintsUpdate(Applet::Constraints c); void scheduleModificationNotification(); KConfigGroup *mainConfigGroup(); void resetConfigurationObject(); void globalShortcutChanged(); void propagateConfigChanged(); void setUiReady(); static QMap defaultActions(QObject *parent); static void contextualActions_append(QQmlListProperty *prop, QAction *action); static qsizetype contextualActions_count(QQmlListProperty *prop); static QAction *contextualActions_at(QQmlListProperty *prop, qsizetype idx); static void contextualActions_clear(QQmlListProperty *prop); static void contextualActions_replace(QQmlListProperty *prop, qsizetype idx, QAction *action); static void contextualActions_removeLast(QQmlListProperty *prop); void requestConfiguration(); static uint s_maxAppletId; uint appletId; Applet *q; // applet attributes Types::ImmutabilityType immutability; Types::ImmutabilityType oldImmutability; QString launchErrorMessage; // applet info we keep around in case its needed KPluginMetaData appletDescription; QString customTitle; QString icon; QVariantList startupArguments; // bookkeeping KConfigGroup *mainConfig; Applet::Constraints pendingConstraints; // config and package stuff KPackage::Package package; KConfigLoader *configLoader = nullptr; KConfigPropertyMap *configPropertyMap = nullptr; // It's a map to have values() as a stable list QMap actions; QList contextualActions; QAction *activationAction; QHash actionGroups; Types::ItemStatus itemStatus; // timerEvent bookkeeping QBasicTimer constraintsTimer; QBasicTimer *modificationsTimer; QPointer deleteNotification; QTimer *deleteNotificationTimer; QString configurationRequiredReason; Types::BackgroundHints backgroundHints = Types::DefaultBackground; Types::BackgroundHints userBackgroundHints = Types::DefaultBackground; Applet::ConstraintHints constraintHints = Applet::NoHint; // a great green field of booleans :) bool userBackgroundHintsInitialized = false; bool hasConfigurationInterface : 1; bool failed : 1; bool transient : 1; bool needsConfig : 1; bool started : 1; bool globalShortcutEnabled : 1; bool userConfiguring : 1; bool busy : 1; }; } // Plasma namespace #endif