KDE 4.4 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

ContainmentActions Class Reference

from PyKDE4.plasma import *

Inherits: QObject
Namespace: Plasma.ContainmentActions

Detailed Description

ContainmentActions plasma/containmentactions.h <Plasma/ContainmentActions>

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


Methods

 __init__ (self, QObject parent=0)
 __init__ (self, QObject parent, QVariantList args)
 configurationAccepted (self)
bool configurationRequired (self)
Plasma.Containment containment (self)
 contextEvent (self, QEvent event)
[QAction] contextualActions (self)
QWidget createConfigurationInterface (self, QWidget parent)
Plasma.DataEngine dataEngine (self, QString name)
bool event (self, QEvent e)
QString eventToString (self, QEvent event)
QString icon (self)
 init (self, KConfigGroup config)
bool isInitialized (self)
KPluginInfo.List listContainmentActionsInfo (self)
Plasma.ContainmentActions load (self, Plasma.Containment parent, QString name, QVariantList args=QVariantList())
Plasma.ContainmentActions load (self, Plasma.Containment parent, KPluginInfo info, QVariantList args=QVariantList())
QString name (self)
Plasma.PackageStructure.Ptr packageStructure (self)
 paste (self, QPointF scenePos, QPoint screenPos)
QString pluginName (self)
 restore (self, KConfigGroup config)
 save (self, KConfigGroup config)
 setConfigurationRequired (self, bool needsConfiguring=1)

Method Documentation

__init__ (  self,
QObject  parent=0
)

Default constructor for an empty or null containmentactions

__init__ (  self,
QObject  parent,
QVariantList  args
)

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:
parent  a QObject parent; you probably want to pass in 0
args  a list of strings containing one entry: the service id

configurationAccepted (   self )

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

bool configurationRequired (   self )

Returns:
true if the containmentactions currently needs to be configured, otherwise, false

Plasma.Containment containment (   self )

Returns:
the containment the plugin is associated with.

contextEvent (  self,
QEvent  event
)

Implement this to respond to events. The user can configure whatever button and modifier they like, so please don't look at those parameters. So far the event could be a QGraphicsSceneMouseEvent or a QGraphicsSceneWheelEvent.

[QAction] contextualActions (   self )

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.

QWidget createConfigurationInterface (  self,
QWidget  parent
)

Returns the widget used in the configuration dialog. Add the configuration interface of the containmentactions to this widget.

Plasma.DataEngine dataEngine (  self,
QString  name
)

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 <em>not</em> delete the returned engine.

Parameters:
name  Name 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

bool event (  self,
QEvent  e
)
QString eventToString (  self,
QEvent  event
)

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

Returns:
the string representation of the event

QString icon (   self )

Returns the icon related to this containmentactions

init (  self,
KConfigGroup  config
)

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

Parameters:
config  Config group to load settings

bool isInitialized (   self )

Returns:
true if initialized (usually by calling restore), false otherwise

KPluginInfo.List listContainmentActionsInfo (   self )

Returns a list of all known containmentactions plugins.

Returns:
list of containmentactions plugins

Plasma.ContainmentActions load (  self,
Plasma.Containment  parent,
QString  name,
QVariantList  args=QVariantList()
)

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:
parent  the parent containment. Required; if you send null you'll get back null.
info  KPluginInfo object for the desired containmentactions
args  to send the containmentactions extra arguments

Returns:
a pointer to the loaded containmentactions, or 0 on load failure

Plasma.ContainmentActions load (  self,
Plasma.Containment  parent,
KPluginInfo  info,
QVariantList  args=QVariantList()
)

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:
parent  the parent containment. Required; if you send null you'll get back null.
info  KPluginInfo object for the desired containmentactions
args  to send the containmentactions extra arguments

Returns:
a pointer to the loaded containmentactions, or 0 on load failure

QString name (   self )

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

Returns:
the user-visible name for the containmentactions.

Plasma.PackageStructure.Ptr packageStructure (   self )

Returns the Package specialization for containmentactions.

paste (  self,
QPointF  scenePos,
QPoint  screenPos
)

pastes the clipboard at a given location

QString pluginName (   self )

Returns the plugin name for the containmentactions

restore (  self,
KConfigGroup  config
)

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

Parameters:
config  Config group to load settings

See also:
init

save (  self,
KConfigGroup  config
)

This method is called when settings need to be saved.

Parameters:
config  Config group to save settings

setConfigurationRequired (  self,
bool  needsConfiguring=1
)

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

Parameters:
needsConfiguring  true if the applet needs to be configured, or false if it doesn't

  • Full Index

Modules

  • akonadi
  • dnssd
  • kdecore
  • kdeui
  • khtml
  • kio
  • knewstuff
  • kparts
  • kutils
  • nepomuk
  • phonon
  • plasma
  • polkitqt
  • solid
  • soprano
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal