Plasma

containmentactions.h
1 /*
2  * Copyright (c) 2009 Chani Armitage <[email protected]>
3 
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Library General Public License as
6  * published by the Free Software Foundation; either version 2, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef PLASMA_CONTAINMENTACTIONS_H
21 #define PLASMA_CONTAINMENTACTIONS_H
22 
23 #include <QList>
24 
25 #include <KPluginInfo>
26 
27 #include <plasma/plasma.h>
28 #include <plasma/version.h>
29 
30 class QAction;
31 class KPluginMetaData;
32 
33 namespace Plasma
34 {
35 
36 class DataEngine;
37 class Containment;
38 class ContainmentActionsPrivate;
39 
55 class PLASMA_EXPORT ContainmentActions : public QObject
56 {
57  Q_OBJECT
58 
59 public:
63  explicit ContainmentActions(QObject *parent = nullptr);
64 
66 
67 #if PLASMA_ENABLE_DEPRECATED_SINCE(5, 67)
68 
75  PLASMA_DEPRECATED_VERSION(5, 67, "use metadata()")
76  KPluginInfo pluginInfo() const;
77 #endif
78 
84  KPluginMetaData metadata() const;
85 
91  virtual void restore(const KConfigGroup &config);
92 
97  virtual void save(KConfigGroup &config);
98 
103  virtual QWidget *createConfigurationInterface(QWidget *parent);
104 
108  virtual void configurationAccepted();
109 
116  virtual void performNextAction();
117 
124  virtual void performPreviousAction();
125 
131  virtual QList<QAction *> contextualActions();
132 
137  static QString eventToString(QEvent *event);
138 
143  void setContainment(Containment *newContainment);
144 
148  Containment *containment();
149 
150 protected:
159  ContainmentActions(QObject *parent, const QVariantList &args);
160 
161 private:
162  ContainmentActionsPrivate *const d;
163 };
164 
165 } // Plasma namespace
166 
171 #define K_EXPORT_PLASMA_CONTAINMENTACTIONS_WITH_JSON(libname, classname, jsonFile) \
172  K_PLUGIN_FACTORY_WITH_JSON(factory, jsonFile, registerPlugin<classname>();) \
173  K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
174 
175 Q_DECLARE_METATYPE(Plasma::ContainmentActions *)
176 
177 #endif // PLASMA_CONTAINMENTACTIONS_H
The base ContainmentActions class.
Namespace for everything in libplasma.
Definition: datamodel.cpp:27
<Plasma/Version>
The base class for plugins that provide backgrounds and applet grouping containers.
Definition: containment.h:58
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jul 9 2020 22:40:33 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.