2 * Copyright 2006-2007 by Aaron Seigo <aseigo@kde.org>
3 * Copyright 2007 by Riccardo Iaconelli <riccardo@kde.org>
4 * Copyright 2008 by Ménard Alexis <darktears31@gmail.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Library General Public License as
8 * published by the Free Software Foundation; either version 2, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details
16 * You should have received a copy of the GNU Library General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef PLASMA_APPLET_H
23 #define PLASMA_APPLET_H
25 #include <QtGui/QGraphicsItem>
26 #include <QtGui/QGraphicsWidget>
27 #include <QtGui/QIcon>
29 #include <kconfiggroup.h>
30 #include <kgenericfactory.h>
31 #include <kplugininfo.h>
32 #include <kshortcut.h>
34 #include <plasma/configloader.h>
35 #include <plasma/packagestructure.h>
36 #include <plasma/plasma.h>
37 #include <plasma/animator.h>
38 #include <plasma/version.h>
39 #include <plasma/framesvg.h>
45 class KActionCollection
;
60 * @class Applet plasma/applet.h <Plasma/Applet>
62 * @short The base Applet class
64 * Applet provides several important roles for add-ons widgets in Plasma.
66 * First, it is the base class for the plugin system and therefore is the
67 * interface to applets for host applications. It also handles the life time
68 * management of data engines (e.g. all data engines accessed via
69 * Applet::dataEngine(const QString&) are properly deref'd on Applet
70 * destruction), background painting (allowing for consistent and complex
71 * look and feel in just one line of code for applets), loading and starting
72 * of scripting support for each applet, providing access to the associated
73 * plasmoid package (if any) and access to configuration data.
75 * See techbase.kde.org for tutorial on writing Applets using this class.
77 class PLASMA_EXPORT Applet
: public QGraphicsWidget
80 Q_PROPERTY(bool hasConfigurationInterface READ hasConfigurationInterface
)
81 Q_PROPERTY(QString name READ name
)
82 Q_PROPERTY(QString category READ category
)
83 Q_PROPERTY(ImmutabilityType immutability READ immutability WRITE setImmutability
)
84 Q_PROPERTY(bool hasFailedToLaunch READ hasFailedToLaunch WRITE setFailedToLaunch
)
85 Q_PROPERTY(bool isBusy READ isBusy WRITE setBusy
)
86 Q_PROPERTY(bool configurationRequired READ configurationRequired WRITE setConfigurationRequired
)
87 Q_PROPERTY(QRectF geometry READ geometry WRITE setGeometry
)
88 Q_PROPERTY(bool shouldConserveResources READ shouldConserveResources
)
91 typedef QList
<Applet
*> List
;
92 typedef QHash
<QString
, Applet
*> Dict
;
95 * Description on how draw a background for the applet
98 NoBackground
= 0, /**< Not drawing a background under the
99 applet, the applet has its own implementation */
100 StandardBackground
= 1, /**< The standard background from the theme is drawn */
101 TranslucentBackground
= 2, /**< An alternate version of the background is drawn,
102 usually more translucent */
103 DefaultBackground
= StandardBackground
/**< Default settings:
104 both standard background */
106 Q_DECLARE_FLAGS(BackgroundHints
, BackgroundHint
)
111 * @return a package structure representing a Theme
113 static PackageStructure::Ptr
packageStructure();
116 * @return the id of this applet
121 * Returns the KConfigGroup to access the applets configuration.
123 * This config object will write to an instance
124 * specific config file named \<appletname\>\<instanceid\>rc
125 * in the Plasma appdata directory.
127 KConfigGroup
config() const;
130 * Returns a config group with the name provided. This ensures
131 * that the group name is properly namespaced to avoid collision
132 * with other applets that may be sharing this config file
134 * @param group the name of the group to access
136 KConfigGroup
config(const QString
&group
) const;
139 * Saves state information about this applet that will
140 * be accessed when next instantiated in the restore(KConfigGroup&) method.
142 * This method does not need to be reimplmented by Applet
143 * subclasses, but can be useful for Applet specializations
144 * (such as Containment) to do so.
146 * Applet subclasses may instead want to reimplement saveState().
148 virtual void save(KConfigGroup
&group
) const;
151 * Restores state information about this applet saved previously
152 * in save(KConfigGroup&).
154 * This method does not need to be reimplmented by Applet
155 * subclasses, but can be useful for Applet specializations
156 * (such as Containment) to do so.
158 virtual void restore(KConfigGroup
&group
);
161 * Returns a KConfigGroup object to be shared by all applets of this
164 * This config object will write to an applet-specific config object
165 * named plasma_\<appletname\>rc in the local config directory.
167 KConfigGroup
globalConfig() const;
170 * Returns the config skeleton object from this applet's package,
173 * @return config skeleton object, or 0 if none
175 ConfigLoader
*configScheme() const;
178 * Loads the given DataEngine
180 * Tries to load the data engine given by @p name. Each engine is
181 * only loaded once, and that instance is re-used on all subsequent
184 * If the data engine was not found, an invalid data engine is returned
185 * (see DataEngine::isValid()).
187 * Note that you should <em>not</em> delete the returned engine.
189 * @param name Name of the data engine to load
190 * @return pointer to the data engine if it was loaded,
191 * or an invalid data engine if the requested engine
192 * could not be loaded
194 Q_INVOKABLE DataEngine
*dataEngine(const QString
&name
) const;
197 * Accessor for the associated Package object if any.
198 * Generally, only Plasmoids come in a Package.
200 * @return the Package object, or 0 if none
202 const Package
*package() const;
205 * Returns the view this widget is visible on, or 0 if none can be found.
206 * @warning do NOT assume this will always return a view!
207 * a null view probably means that either plasma isn't finished loading, or your applet is
208 * on an activity that's not being shown anywhere.
210 QGraphicsView
*view() const;
213 * Maps a QRect from a view's coordinates to local coordinates.
214 * @param view the view from which rect should be mapped
215 * @param rect the rect to be mapped
217 QRectF
mapFromView(const QGraphicsView
*view
, const QRect
&rect
) const;
220 * Maps a QRectF from local coordinates to a view's coordinates.
221 * @param view the view to which rect should be mapped
222 * @param rect the rect to be mapped
224 QRect
mapToView(const QGraphicsView
*view
, const QRectF
&rect
) const;
227 * Reccomended position for a popup window like a menu or a tooltip
229 * @param s size of the popup
230 * @returns reccomended position
232 QPoint
popupPosition(const QSize
&s
) const;
235 * Called when any of the geometry constraints have been updated.
236 * This method calls constraintsEvent, which may be reimplemented,
237 * once the Applet has been prepared for updating the constraints.
239 * @param constraints the type of constraints that were updated
241 void updateConstraints(Plasma::Constraints constraints
= Plasma::AllConstraints
);
244 * Returns the current form factor the applet is being displayed in.
246 * @see Plasma::FormFactor
248 virtual FormFactor
formFactor() const;
251 * Returns the location of the scene which is displaying applet.
253 * @see Plasma::Location
255 virtual Location
location() const;
258 * Returns the workspace context which the applet is operating in
260 Context
*context() const;
263 * @return the preferred aspect ratio mode for placement and resizing
265 Plasma::AspectRatioMode
aspectRatioMode() const;
268 * Sets the preferred aspect ratio mode for placement and resizing
270 void setAspectRatioMode(Plasma::AspectRatioMode
);
273 * Returns a list of all known applets.
275 * @param category Only applets matchin this category will be returned.
276 * Useful in conjunction with knownCategories.
277 * If "Misc" is passed in, then applets without a
278 * Categories= entry are also returned.
279 * If an empty string is passed in, all applets are
281 * @param parentApp the application to filter applets on. Uses the
282 * X-KDE-ParentApp entry (if any) in the plugin info.
283 * The default value of QString() will result in a
284 * list containing only applets not specifically
285 * registered to an application.
286 * @return list of applets
288 static KPluginInfo::List
listAppletInfo(const QString
&category
= QString(),
289 const QString
&parentApp
= QString());
292 * Returns a list of all known applets associated with a certain mimetype.
294 * @return list of applets
296 static KPluginInfo::List
listAppletInfoForMimetype(const QString
&mimetype
);
299 * Returns a list of all the categories used by
302 * @param parentApp the application to filter applets on. Uses the
303 * X-KDE-ParentApp entry (if any) in the plugin info.
304 * The default value of QString() will result in a
305 * list containing only applets not specifically
306 * registered to an application.
307 * @return list of categories
308 * @param visibleOnly true if it should only return applets that are marked as visible
310 static QStringList
listCategories(const QString
&parentApp
= QString(),
311 bool visibleOnly
= true);
314 * Attempts to load an applet
316 * Returns a pointer to the applet if successful.
317 * The caller takes responsibility for the applet, including
318 * deleting it when no longer needed.
320 * @param name the plugin name, as returned by KPluginInfo::pluginName()
321 * @param appletId unique ID to assign the applet, or zero to have one
322 * assigned automatically.
323 * @param args to send the applet extra arguments
324 * @return a pointer to the loaded applet, or 0 on load failure
326 static Applet
*load(const QString
&name
, uint appletId
= 0,
327 const QVariantList
&args
= QVariantList());
330 * Attempts to load an applet
332 * Returns a pointer to the applet if successful.
333 * The caller takes responsibility for the applet, including
334 * deleting it when no longer needed.
336 * @param info KPluginInfo object for the desired applet
337 * @param appletId unique ID to assign the applet, or zero to have one
338 * assigned automatically.
339 * @param args to send the applet extra arguments
340 * @return a pointer to the loaded applet, or 0 on load failure
342 static Applet
*load(const KPluginInfo
&info
, uint appletId
= 0,
343 const QVariantList
&args
= QVariantList());
346 * Get the category of the given applet
348 * @param applet a KPluginInfo object for the applet
350 static QString
category(const KPluginInfo
&applet
);
353 * Get the category of the given applet
355 * @param appletName the name of the applet
357 static QString
category(const QString
&appletName
);
360 * This method is called when the interface should be painted.
362 * @param painter the QPainter to use to do the paintiner
363 * @param option the style options object
364 * @param contentsRect the rect to paint within; automatically adjusted for
365 * the background, if any
367 virtual void paintInterface(QPainter
*painter
,
368 const QStyleOptionGraphicsItem
*option
,
369 const QRect
&contentsRect
);
372 * Returns the user-visible name for the applet, as specified in the
375 * @return the user-visible name for the applet.
377 QString
name() const;
380 * @return the font currently set for this widget
385 * Returns the plugin name for the applet
387 QString
pluginName() const;
390 * Whether the applet should conserve resources. If true, try to avoid doing stuff which
391 * is computationally heavy. Try to conserve power and resources.
393 * @return true if it should conserve resources, false if it does not.
395 bool shouldConserveResources() const;
398 * Returns the icon related to this applet
400 QString
icon() const;
403 * Returns the category the applet is in, as specified in the
406 QString
category() const;
409 * @return The type of immutability of this applet
411 ImmutabilityType
immutability() const;
413 void paintWindowFrame(QPainter
*painter
,
414 const QStyleOptionGraphicsItem
*option
, QWidget
*widget
);
417 * If for some reason, the applet fails to get up on its feet (the
418 * library couldn't be loaded, necessary hardware support wasn't found,
419 * etc..) this method returns true
421 bool hasFailedToLaunch() const;
424 * @return true if the applet is busy and is showing an indicator widget for that
429 * @return true if the applet currently needs to be configured,
432 bool configurationRequired() const;
435 * @return true if this plasmoid provides a GUI configuration
437 bool hasConfigurationInterface() const;
440 * Returns a list of context-related QAction instances.
442 * This is used e.g. within the \a DesktopView to display a
445 * @return A list of actions. The default implementation returns an
448 virtual QList
<QAction
*> contextualActions();
451 * Returns the QAction with the given name from our collection
453 QAction
*action(QString name
) const;
456 * Adds the action to our collection under the given name
458 void addAction(QString name
, QAction
*action
);
461 * Sets the BackgroundHints for this applet @see BackgroundHint
463 * @param hints the BackgroundHint combination for this applet
465 void setBackgroundHints(const BackgroundHints hints
);
468 * @return BackgroundHints flags combination telling if the standard background is shown
469 * and if it has a drop shadow
471 BackgroundHints
backgroundHints() const;
474 * @return true if this Applet is currently being used as a Containment, false otherwise
476 bool isContainment() const;
479 * This method returns screen coordinates for the widget; this method can be somewhat
480 * expensive and should ONLY be called when screen coordinates are required. For
481 * example when positioning top level widgets on top of the view to create the
482 * appearance of unit. This should NOT be used for popups (@see popupPosition) or
483 * for normal widget use (use Plasma:: widgets or QGraphicsProxyWidget instead).
485 * @return a rect of the applet in screen coordinates.
487 QRect
screenRect() const;
490 * Reimplemented from QGraphicsItem
494 Type
= Plasma::AppletType
498 * @return the Containment, if any, this applet belongs to
500 Containment
*containment() const;
503 * Sets the global shorcut to associate with this widget.
505 void setGlobalShortcut(const KShortcut
&shortcut
);
508 * @return the global shortcut associated with this wiget, or
509 * an empty shortcut if no global shortcut is associated.
511 KShortcut
globalShortcut() const;
514 * @return true is there is a popup assoiated with this Applet
515 * showing, such as the dialog of a PopupApplet. May be reimplemented
516 * for custom popup implementations.
518 virtual bool isPopupShowing() const;
521 * associate actions with this widget, including ones added after this call.
522 * needed to make keyboard shortcuts work.
524 virtual void addAssociatedWidget(QWidget
*widget
);
527 * un-associate actions from this widget, including ones added after this call.
528 * needed to make keyboard shortcuts work.
530 virtual void removeAssociatedWidget(QWidget
*widget
);
533 * Gets called when and extender item has to be initialized after a plasma restart. If you
534 * create ExtenderItems in your applet, you should implement this function to again create
535 * the widget that should be shown in this extender item. This function might look something
539 * SuperCoolWidget *widget = new SuperCoolWidget();
540 * dataEngine("engine")->connectSource(item->config("dataSourceName"), widget);
541 * item->setWidget(widget);
544 * You can also add one or more custom qactions to this extender item in this function.
546 * Note that by default, not all ExtenderItems are persistent. Only items that are detached,
547 * will have their configuration stored when plasma exits.
549 virtual void initExtenderItem(ExtenderItem
*item
);
552 * @param parent the QGraphicsItem this applet is parented to
553 * @param serviceId the name of the .desktop file containing the
554 * information about the widget
555 * @param appletId a unique id used to differentiate between multiple
556 * instances of the same Applet type
558 explicit Applet(QGraphicsItem
*parent
= 0,
559 const QString
&serviceId
= QString(),
563 * @param parent the QGraphicsItem this applet is parented to
564 * @param serviceId the name of the .desktop file containing the
565 * information about the widget
566 * @param appletId a unique id used to differentiate between multiple
567 * instances of the same Applet type
568 * @param args a list of strings containing two entries: the service id
572 explicit Applet(QGraphicsItem
*parent
,
573 const QString
&serviceId
,
575 const QVariantList
&args
580 * @return true if destroy() was called; useful for Applets which should avoid
581 * certain tasks if they are about to be deleted permanently
583 bool destroyed() const;
586 * Reimplement this method so provide a configuration interface,
587 * parented to the supplied widget. Ownership of the widgets is passed
588 * to the parent widget.
590 * @param parent the dialog which is the parent of the configuration
593 virtual void createConfigurationInterface(KConfigDialog
*parent
);
596 * returns true if the applet is allowed to perform functions covered by the given constraint
597 * eg. isAllowed("FileDialog") returns true iff applets are allowed to show filedialogs.
599 bool isAllowed(const QString
&constraint
);
603 * This signal indicates that an application launch, window
604 * creation or window focus event was triggered. This is used, for instance,
605 * to ensure that the Dashboard view in Plasma hides when such an event is
606 * triggered by an item it is displaying.
608 void releaseVisualFocus();
611 * Emitted whenever the applet makes a geometry change, so that views
612 * can coordinate themselves with these changes if they desire.
614 void geometryChanged();
617 * Emitted when the user completes a transformation of the applet.
619 void appletTransformedByUser();
622 * Emitted when the applet changes its own geometry or transform.
624 void appletTransformedItself();
627 * Emitted by Applet subclasses when they change a sizeHint and wants to announce the change
629 void sizeHintChanged(Qt::SizeHint which
);
632 * Emitted when an applet has changed values in its configuration
633 * and wishes for them to be saved at the next save point. As this implies
634 * disk activity, this signal should be used with care.
636 * @note This does not need to be emitted from saveState by individual
639 void configNeedsSaving();
642 * Emitted when activation is requested due to, for example, a global
643 * keyboard shortcut. By default the wiget is given focus.
648 * Emitted when the user clicked on a button of the message overlay
650 * @see Plasma::MessageButton
653 void messageButtonPressed(const MessageButton button
);
656 * Emitted when the applet is deleted
658 void appletDestroyed(Plasma::Applet
*applet
);
663 * Sets the immutability type for this applet (not immutable,
664 * user immutable or system immutable)
665 * @arg immutable the new immutability type of this applet
667 void setImmutability(const ImmutabilityType immutable
);
670 * Destroys the applet; it will be removed nicely and deleted.
671 * Its configuration will also be deleted.
673 virtual void destroy();
676 * Lets the user interact with the plasmoid options.
677 * Called when the user selects the configure entry
678 * from the context menu.
680 * Unless there is good reason for overriding this method,
681 * Applet subclasses should actually override createConfigurationInterface
682 * instead. A good example of when this isn't plausible is
683 * when using a dialog prepared by another library, such
684 * as KPropertiesDialog from libkfile.
686 virtual void showConfigurationInterface();
689 * Causes this applet to raise above all other applets.
694 * Causes this applet to lower below all the other applets.
699 * Sends all pending contraints updates to the applet. Will usually
700 * be called automatically, but can also be called manually if needed.
702 void flushPendingConstraintsEvents();
705 * This method is called once the applet is loaded and added to a Corona.
706 * If the applet requires a QGraphicsScene or has an particularly intensive
707 * set of initialization routines to go through, consider implementing it
708 * in this method instead of the constructor.
710 * Note: paintInterface may get called before init() depending on initialization
711 * order. Painting is managed by the canvas (QGraphisScene), and may schedule a
712 * paint event prior to init() being called.
717 * Called when applet configuration values has changed.
719 virtual void configChanged();
722 * Shows a busy indicator that overlays the applet
723 * @param busy show or hide the busy indicator
725 void setBusy(bool busy
);
728 * @return the list of arguments which the applet was called
731 QVariantList
startupArguments() const;
735 * This constructor is to be used with the plugin loading systems
736 * found in KPluginInfo and KService. The argument list is expected
737 * to have two elements: the KService service ID for the desktop entry
738 * and an applet ID which must be a base 10 number.
740 * @param parent a QObject parent; you probably want to pass in 0
741 * @param args a list of strings containing two entries: the service id
744 Applet(QObject
*parent
, const QVariantList
&args
);
747 * Call this method when the applet fails to launch properly. An
748 * optional reason can be provided.
750 * Not that all children items will be deleted when this method is
751 * called. If you have pointers to these items, you will need to
752 * reset them after calling this method.
754 * @param failed true when the applet failed, false when it succeeded
755 * @param reason an optional reason to show the user why the applet
758 void setFailedToLaunch(bool failed
, const QString
&reason
= QString());
761 * When called, the Applet should write any information needed as part
762 * of the Applet's running state to the configuration object in config()
763 * and/or globalConfig().
765 * Applets that always sync their settings/state with the config
766 * objects when these settings/states change do not need to reimplement
769 virtual void saveState(KConfigGroup
&config
) const;
772 * Sets whether or not this applet provides a user interface for
773 * configuring the applet.
775 * It defaults to false, and if true is passed in you should
776 * also reimplement createConfigurationInterface()
778 * @param hasInterface whether or not there is a user interface available
780 void setHasConfigurationInterface(bool hasInterface
);
783 * When the applet needs to be configured before being usable, this
784 * method can be called to show a standard interface prompting the user
785 * to configure the applet
787 * @param needsConfiguring true if the applet needs to be configured,
788 * or false if it doesn't
789 * @param reason a translated message for the user explaining that the
790 * applet needs configuring; this should note what needs
793 void setConfigurationRequired(bool needsConfiguring
, const QString
&reason
= QString());
796 * Shows a message as an overlay of the applet: the message has an
797 * icon, text and (optional) buttons
799 * @param icon the icon that will be shown
800 * @param message the message string that will be shown.
801 * If the message is empty nothng will be shown
802 * and if there was a message already it will be hidden
803 * @param buttons an OR combination of all the buttons needed
805 * @see Plasma::MessageButtons
806 * @see messageButtonPressed
809 void showMessage(const QIcon
&icon
, const QString
&message
, const MessageButtons buttons
);
812 * Called when any of the geometry constraints have been updated.
814 * This is always called prior to painting and should be used as an
815 * opportunity to layout the widget, calculate sizings, etc.
817 * Do not call update() from this method; an update() will be triggered
818 * at the appropriate time for the applet.
820 * @param constraints the type of constraints that were updated
821 * @property constraint
823 virtual void constraintsEvent(Plasma::Constraints constraints
);
826 * Register the widgets that manage mouse clicks but you still want
827 * to be able to drag the applet around when holding the mouse pointer
830 * Calling this results in an eventFilter being places on the widget.
832 * @param item the item to watch for mouse move
834 void registerAsDragHandle(QGraphicsItem
*item
);
837 * Unregister a widget registered with registerAsDragHandle.
839 * @param item the item to unregister
841 void unregisterAsDragHandle(QGraphicsItem
*item
);
844 * @param item the item to look for if it is registered or not
845 * @return true if it is registered, false otherwise
847 bool isRegisteredAsDragHandle(QGraphicsItem
*item
);
850 * @return the extender of this applet.
852 Extender
*extender() const;
855 * @internal event filter; used for focus watching
857 bool eventFilter(QObject
*o
, QEvent
*e
);
860 * @internal scene event filter; used to manage applet dragging
862 bool sceneEventFilter (QGraphicsItem
*watched
, QEvent
*event
);
865 * @internal manage the mouse movement to drag the applet around
867 void mouseMoveEvent(QGraphicsSceneMouseEvent
*event
);
870 * Reimplemented from QGraphicsItem
872 void focusInEvent(QFocusEvent
*event
);
875 * Reimplemented from QGraphicsItem
877 void resizeEvent(QGraphicsSceneResizeEvent
*event
);
880 * Reimplemented from QGraphicsItem
882 QVariant
itemChange(GraphicsItemChange change
, const QVariant
&value
);
885 * Reimplemented from QGraphicsItem
887 QPainterPath
shape() const;
890 * Reimplemented from QGraphicsLayoutItem
892 QSizeF
sizeHint(Qt::SizeHint which
, const QSizeF
& constraint
= QSizeF()) const;
895 * Reimplemented from QGraphicsLayoutItem
897 void hoverEnterEvent(QGraphicsSceneHoverEvent
*event
);
900 * Reimplemented from QGraphicsLayoutItem
902 void hoverLeaveEvent(QGraphicsSceneHoverEvent
*event
);
905 * Reimplemented from QObject
907 void timerEvent (QTimerEvent
*event
);
910 Q_PRIVATE_SLOT(d
, void setFocus())
911 Q_PRIVATE_SLOT(d
, void checkImmutability())
912 Q_PRIVATE_SLOT(d
, void themeChanged())
913 Q_PRIVATE_SLOT(d
, void appletAnimationComplete(QGraphicsItem
*item
,
914 Plasma::Animator::Animation anim
))
915 Q_PRIVATE_SLOT(d
, void selectItemToDestroy())
916 Q_PRIVATE_SLOT(d
, void updateRect(const QRectF
& rect
))
917 Q_PRIVATE_SLOT(d
, void destroyMessageOverlay())
918 Q_PRIVATE_SLOT(d
, void clearShortcutEditorPtr())
919 Q_PRIVATE_SLOT(d
, void configDialogFinished())
922 * Reimplemented from QGraphicsItem
924 void paint(QPainter
*painter
, const QStyleOptionGraphicsItem
*option
, QWidget
*widget
= 0);
926 AppletPrivate
*const d
;
928 //Corona needs to access setFailedToLaunch and init
930 friend class CoronaPrivate
;
931 friend class Containment
;
932 friend class ContainmentPrivate
;
933 friend class AppletScript
;
934 friend class AppletHandle
;
935 friend class AppletPrivate
;
936 friend class PopupApplet
;
937 friend class PopupAppletPrivate
;
939 friend class Extender
;
940 friend class ExtenderPrivate
;
941 friend class ExtenderItem
;
944 } // Plasma namespace
946 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Applet::BackgroundHints
)
949 * Register an applet when it is contained in a loadable module
951 #define K_EXPORT_PLASMA_APPLET(libname, classname) \
952 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
953 K_EXPORT_PLUGIN(factory("plasma_applet_" #libname)) \
954 K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
956 #endif // multiple inclusion guard