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

Plasma

  • Plasma
  • ContainmentActions
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
Plasma::ContainmentActions Class Reference

#include <Plasma/ContainmentActions>

Inheritance diagram for Plasma::ContainmentActions:
Inheritance graph
[legend]

Public Member Functions

 ContainmentActions (QObject *parent=0)
 
 ~ContainmentActions ()
 
virtual void configurationAccepted ()
 
bool configurationRequired () const
 
virtual void contextEvent (QEvent *event)
 
virtual QList< QAction * > contextualActions ()
 
virtual QWidget * createConfigurationInterface (QWidget *parent)
 
Q_INVOKABLE DataEngine * dataEngine (const QString &name) const
 
bool event (QEvent *e)
 
QString icon () const
 
bool isInitialized () const
 
QString name () const
 
QString pluginName () const
 
QPoint popupPosition (const QSize &s, QEvent *event)
 
void restore (const KConfigGroup &config)
 
virtual void save (KConfigGroup &config)
 
void setContainment (Containment *newContainment)
 

Static Public Member Functions

static QString eventToString (QEvent *event)
 
static KPluginInfo::List listContainmentActionsInfo ()
 
static ContainmentActions * load (Containment *parent, const QString &name, const QVariantList &args=QVariantList())
 
static ContainmentActions * load (Containment *parent, const KPluginInfo &info, const QVariantList &args=QVariantList())
 
static PackageStructure::Ptr packageStructure ()
 

Protected Member Functions

 ContainmentActions (QObject *parent, const QVariantList &args)
 
Containment * containment ()
 
virtual void init (const KConfigGroup &config)
 
void paste (QPointF scenePos, QPoint screenPos)
 
void setConfigurationRequired (bool needsConfiguring=true)
 

Properties

QString icon
 
QString name
 
QString pluginName
 

Detailed Description

The base ContainmentActions class.

"ContainmentActions" are components that provide actions (usually displaying a contextmenu) in response to an event with a position (usually a mouse event).

ContainmentActions plugins are registered using .desktop files. These files should be named using the following naming scheme:

plasma-containmentactions-\<pluginname\>.desktop

Definition at line 55 of file containmentactions.h.

Constructor & Destructor Documentation

Plasma::ContainmentActions::ContainmentActions ( QObject *  parent = 0)
explicit

Default constructor for an empty or null containmentactions.

Definition at line 47 of file containmentactions.cpp.

Plasma::ContainmentActions::~ContainmentActions ( )

Definition at line 68 of file containmentactions.cpp.

Plasma::ContainmentActions::ContainmentActions ( QObject *  parent,
const QVariantList &  args 
)
protected

This constructor is to be used with the plugin loading systems found in KPluginInfo and KService.

The argument list is expected to have one element: the KService service ID for the desktop entry.

Parameters
parenta QObject parent; you probably want to pass in 0
argsa list of strings containing one entry: the service id

Definition at line 53 of file containmentactions.cpp.

Member Function Documentation

void Plasma::ContainmentActions::configurationAccepted ( )
virtual

This method is called when the user's configuration changes are accepted.

Definition at line 193 of file containmentactions.cpp.

bool Plasma::ContainmentActions::configurationRequired ( ) const
Returns
true if the containmentactions currently needs to be configured, otherwise, false

Definition at line 214 of file containmentactions.cpp.

Containment * Plasma::ContainmentActions::containment ( )
protected
Returns
the containment the plugin is associated with.

Definition at line 131 of file containmentactions.cpp.

void Plasma::ContainmentActions::contextEvent ( QEvent *  event)
virtual

Implement this to respond to events.

The user can configure whatever button and modifier they like, so please don't look at those parameters. The event may be a QGraphicsSceneMouseEvent or a QGraphicsSceneWheelEvent.

Definition at line 198 of file containmentactions.cpp.

QList< QAction * > Plasma::ContainmentActions::contextualActions ( )
virtual

Implement this to provide a list of actions that can be added to another menu for example, when right-clicking an applet, the "Activity Options" submenu is populated with this.

Definition at line 203 of file containmentactions.cpp.

QWidget * Plasma::ContainmentActions::createConfigurationInterface ( QWidget *  parent)
virtual

Returns the widget used in the configuration dialog.

Add the configuration interface of the containmentactions to this widget.

Definition at line 187 of file containmentactions.cpp.

DataEngine * Plasma::ContainmentActions::dataEngine ( const QString &  name) const

Loads the given DataEngine.

Tries to load the data engine given by name. Each engine is only loaded once, and that instance is re-used on all subsequent requests.

If the data engine was not found, an invalid data engine is returned (see DataEngine::isValid()).

Note that you should not delete the returned engine.

Parameters
nameName of the data engine to load
Returns
pointer to the data engine if it was loaded, or an invalid data engine if the requested engine could not be loaded

Definition at line 209 of file containmentactions.cpp.

bool Plasma::ContainmentActions::event ( QEvent *  e)

Definition at line 383 of file containmentactions.cpp.

QString Plasma::ContainmentActions::eventToString ( QEvent *  event)
static

Turns a mouse or wheel event into a string suitable for a ContainmentActions.

Returns
the string representation of the event

Definition at line 225 of file containmentactions.cpp.

QString Plasma::ContainmentActions::icon ( ) const

Returns the icon related to this containmentactions.

void Plasma::ContainmentActions::init ( const KConfigGroup &  config)
protectedvirtual

This method is called once the containmentactions is loaded or settings are changed.

Parameters
configConfig group to load settings

Definition at line 177 of file containmentactions.cpp.

bool Plasma::ContainmentActions::isInitialized ( ) const
Returns
true if initialized (usually by calling restore), false otherwise

Definition at line 166 of file containmentactions.cpp.

KPluginInfo::List Plasma::ContainmentActions::listContainmentActionsInfo ( )
static

Returns a list of all known containmentactions plugins.

Returns
list of containmentactions plugins

Definition at line 73 of file containmentactions.cpp.

ContainmentActions * Plasma::ContainmentActions::load ( Containment *  parent,
const QString &  name,
const QVariantList &  args = QVariantList() 
)
static

Attempts to load a containmentactions.

Returns a pointer to the containmentactions if successful. The caller takes responsibility for the containmentactions, including deleting it when no longer needed.

Parameters
parentthe parent containment.
Since
4.6 null is allowed.
Parameters
namethe plugin name, as returned by KPluginInfo::pluginName()
argsto send the containmentactions extra arguments
Returns
a pointer to the loaded containmentactions, or 0 on load failure

Definition at line 81 of file containmentactions.cpp.

ContainmentActions * Plasma::ContainmentActions::load ( Containment *  parent,
const KPluginInfo &  info,
const QVariantList &  args = QVariantList() 
)
static

Attempts to load a containmentactions.

Returns a pointer to the containmentactions if successful. The caller takes responsibility for the containmentactions, including deleting it when no longer needed.

Parameters
parentthe parent containment.
Since
4.6 null is allowed.
Parameters
infoKPluginInfo object for the desired containmentactions
argsto send the containmentactions extra arguments
Returns
a pointer to the loaded containmentactions, or 0 on load failure

Definition at line 114 of file containmentactions.cpp.

QString Plasma::ContainmentActions::name ( ) const

Returns the user-visible name for the containmentactions, as specified in the .desktop file.

Returns
the user-visible name for the containmentactions.
PackageStructure::Ptr Plasma::ContainmentActions::packageStructure ( )
static

Returns the Package specialization for containmentactions.

Definition at line 122 of file containmentactions.cpp.

void Plasma::ContainmentActions::paste ( QPointF  scenePos,
QPoint  screenPos 
)
protected

pastes the clipboard at a given location

Definition at line 293 of file containmentactions.cpp.

QString Plasma::ContainmentActions::pluginName ( ) const

Returns the plugin name for the containmentactions.

QPoint Plasma::ContainmentActions::popupPosition ( const QSize &  s,
QEvent *  event 
)

Returns a popup position appropriate to the event and the size.

Parameters
ssize of the popup
eventa pointer to the event that triggered the popup
Returns
the preferred top-left position for the popup
Since
4.6

Definition at line 348 of file containmentactions.cpp.

void Plasma::ContainmentActions::restore ( const KConfigGroup &  config)

This method should be called once the plugin is loaded or settings are changed.

Parameters
configConfig group to load settings
See also
init

Definition at line 171 of file containmentactions.cpp.

void Plasma::ContainmentActions::save ( KConfigGroup &  config)
virtual

This method is called when settings need to be saved.

Parameters
configConfig group to save settings

Definition at line 182 of file containmentactions.cpp.

void Plasma::ContainmentActions::setConfigurationRequired ( bool  needsConfiguring = true)
protected

When the containmentactions needs to be configured before being usable, this method can be called to denote that action is required.

Parameters
needsConfiguringtrue if the applet needs to be configured, or false if it doesn't

Definition at line 219 of file containmentactions.cpp.

void Plasma::ContainmentActions::setContainment ( Containment *  newContainment)

newContainment the containment the plugin should be associated with.

Since
4.6

Definition at line 389 of file containmentactions.cpp.

Property Documentation

QString Plasma::ContainmentActions::icon
read

Definition at line 60 of file containmentactions.h.

QString Plasma::ContainmentActions::name
read

Definition at line 58 of file containmentactions.h.

QString Plasma::ContainmentActions::pluginName
read

Definition at line 59 of file containmentactions.h.


The documentation for this class was generated from the following files:
  • containmentactions.h
  • containmentactions.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:35 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