• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • sources
  • kde-4.12
  • kdelibs
  • plasma
containmentactions.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 Chani Armitage <chani@kde.org>
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.h>
26 
27 #include <plasma/plasma.h>
28 #include <plasma/packagestructure.h>
29 #include <plasma/version.h>
30 
31 class QAction;
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  Q_PROPERTY(QString name READ name)
59  Q_PROPERTY(QString pluginName READ pluginName)
60  Q_PROPERTY(QString icon READ icon)
61 
62  public:
66  explicit ContainmentActions(QObject * parent = 0);
67 
68  ~ContainmentActions();
69 
75  static KPluginInfo::List listContainmentActionsInfo();
76 
89  static ContainmentActions *load(Containment *parent, const QString &name, const QVariantList &args = QVariantList());
90 
103  static ContainmentActions *load(Containment *parent, const KPluginInfo &info, const QVariantList &args = QVariantList());
104 
108  static PackageStructure::Ptr packageStructure();
109 
116  QString name() const;
117 
121  QString pluginName() const;
122 
126  QString icon() const;
127 
131  bool isInitialized() const;
132 
138  void restore(const KConfigGroup &config);
139 
144  virtual void save(KConfigGroup &config);
145 
150  virtual QWidget *createConfigurationInterface(QWidget *parent);
151 
155  virtual void configurationAccepted();
156 
163  virtual void contextEvent(QEvent *event);
164 
170  virtual QList<QAction*> contextualActions();
171 
190  Q_INVOKABLE DataEngine *dataEngine(const QString &name) const;
191 
196  bool configurationRequired() const;
197 
202  static QString eventToString(QEvent *event);
203 
212  QPoint popupPosition(const QSize &s, QEvent *event);
213 
217  bool event(QEvent *e);
218 
223  void setContainment(Containment *newContainment);
224 
225  protected:
234  ContainmentActions(QObject *parent, const QVariantList &args);
235 
241  virtual void init(const KConfigGroup &config);
242 
250  void setConfigurationRequired(bool needsConfiguring = true);
251 
255  Containment *containment();
256 
260  void paste(QPointF scenePos, QPoint screenPos);
261 
262  private:
263  friend class ContainmentActionsPackage;
264  friend class ContainmentActionsPrivate;
265  ContainmentActionsPrivate *const d;
266 };
267 
268 } // Plasma namespace
269 
273 #define K_EXPORT_PLASMA_CONTAINMENTACTIONS(libname, classname) \
274 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
275 K_EXPORT_PLUGIN(factory("plasma_containmentactions_" #libname)) \
276 K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
277 
278 #endif // PLASMA_CONTAINMENTACTIONS_H
Plasma::ContainmentActions
The base ContainmentActions class.
Definition: containmentactions.h:55
QWidget
QObject
Plasma::DataEngine
Data provider for plasmoids (Plasma plugins)
Definition: dataengine.h:58
version.h
plasma.h
packagestructure.h
Plasma::Containment
The base class for plugins that provide backgrounds and applet grouping containers.
Definition: containment.h:72
Plasma::packageStructure
PackageStructure::Ptr packageStructure(const QString &language, ComponentType type)
Loads an appropriate PackageStructure for the given language and type.
Definition: scriptengine.cpp:274
Plasma::PackageStructure
A description of the expected file structure of a given package type.
Definition: packagestructure.h:72
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal