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

Plasma

  • 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
31class QAction;
32
33namespace Plasma
34{
35
36class DataEngine;
37class Containment;
38class ContainmentActionsPrivate;
39
54
55class 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) \
274K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
275K_EXPORT_PLUGIN(factory("plasma_containmentactions_" #libname)) \
276K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
277
278#endif // PLASMA_CONTAINMENTACTIONS_H
Plasma::ContainmentActions::pluginName
QString pluginName
Definition containmentactions.h:59
Plasma::ContainmentActions::contextEvent
virtual void contextEvent(QEvent *event)
Implement this to respond to events.
Definition containmentactions.cpp:198
Plasma::ContainmentActions::configurationAccepted
virtual void configurationAccepted()
This method is called when the user's configuration changes are accepted.
Definition containmentactions.cpp:193
Plasma::ContainmentActions::createConfigurationInterface
virtual QWidget * createConfigurationInterface(QWidget *parent)
Returns the widget used in the configuration dialog.
Definition containmentactions.cpp:187
Plasma::ContainmentActions::contextualActions
virtual QList< QAction * > contextualActions()
Implement this to provide a list of actions that can be added to another menu for example,...
Definition containmentactions.cpp:203
Plasma::ContainmentActions::listContainmentActionsInfo
static KPluginInfo::List listContainmentActionsInfo()
Returns a list of all known containmentactions plugins.
Definition containmentactions.cpp:73
Plasma::ContainmentActions::paste
void paste(QPointF scenePos, QPoint screenPos)
pastes the clipboard at a given location
Definition containmentactions.cpp:293
Plasma::ContainmentActions::icon
QString icon
Definition containmentactions.h:60
Plasma::ContainmentActions::init
virtual void init(const KConfigGroup &config)
This method is called once the containmentactions is loaded or settings are changed.
Definition containmentactions.cpp:177
Plasma::ContainmentActions::ContainmentActionsPackage
friend class ContainmentActionsPackage
Definition containmentactions.h:263
Plasma::ContainmentActions::event
bool event(QEvent *e)
@reimplemented
Definition containmentactions.cpp:383
Plasma::ContainmentActions::popupPosition
QPoint popupPosition(const QSize &s, QEvent *event)
Returns a popup position appropriate to the event and the size.
Definition containmentactions.cpp:348
Plasma::ContainmentActions::ContainmentActions
ContainmentActions(QObject *parent=0)
Default constructor for an empty or null containmentactions.
Definition containmentactions.cpp:47
Plasma::ContainmentActions::configurationRequired
bool configurationRequired() const
Definition containmentactions.cpp:214
Plasma::ContainmentActions::setConfigurationRequired
void setConfigurationRequired(bool needsConfiguring=true)
When the containmentactions needs to be configured before being usable, this method can be called to ...
Definition containmentactions.cpp:219
Plasma::ContainmentActions::name
QString name
Definition containmentactions.h:58
Plasma::ContainmentActions::restore
void restore(const KConfigGroup &config)
This method should be called once the plugin is loaded or settings are changed.
Definition containmentactions.cpp:171
Plasma::ContainmentActions::load
static ContainmentActions * load(Containment *parent, const QString &name, const QVariantList &args=QVariantList())
Attempts to load a containmentactions.
Definition containmentactions.cpp:81
Plasma::ContainmentActions::dataEngine
Q_INVOKABLE DataEngine * dataEngine(const QString &name) const
Loads the given DataEngine.
Definition containmentactions.cpp:209
Plasma::ContainmentActions::containment
Containment * containment()
Definition containmentactions.cpp:131
Plasma::ContainmentActions::ContainmentActionsPrivate
friend class ContainmentActionsPrivate
Definition containmentactions.h:264
Plasma::ContainmentActions::isInitialized
bool isInitialized() const
Definition containmentactions.cpp:166
Plasma::ContainmentActions::setContainment
void setContainment(Containment *newContainment)
newContainment the containment the plugin should be associated with.
Definition containmentactions.cpp:389
Plasma::ContainmentActions::packageStructure
static PackageStructure::Ptr packageStructure()
Returns the Package specialization for containmentactions.
Definition containmentactions.cpp:122
Plasma::ContainmentActions::eventToString
static QString eventToString(QEvent *event)
Turns a mouse or wheel event into a string suitable for a ContainmentActions.
Definition containmentactions.cpp:225
Plasma::ContainmentActions::save
virtual void save(KConfigGroup &config)
This method is called when settings need to be saved.
Definition containmentactions.cpp:182
Plasma::Containment
The base class for plugins that provide backgrounds and applet grouping containers.
Definition containment.h:73
Plasma::DataEngine
Data provider for plasmoids (Plasma plugins)
Definition dataengine.h:59
Plasma::PackageStructure
A description of the expected file structure of a given package type.
Definition packagestructure.h:73
QObject
QWidget
Plasma
Namespace for everything in libplasma.
Definition abstractdialogmanager.cpp:25
packagestructure.h
plasma.h
version.h
<Plasma/Version>
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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