ContainmentActions Class Reference
from PyKDE4.plasma import *
Inherits: QObject
Namespace: Plasma
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
Method Documentation
__init__ | ( | self, | ||
QObject | parent=0 | |||
) |
Default constructor for an empty or null containmentactions
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.
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 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
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.
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
Static Method Documentation
Turns a mouse or wheel event into a string suitable for a ContainmentActions
- Returns:
- the string representation of the event
[KPluginInfo] listContainmentActionsInfo | ( | ) |
Returns a list of all known containmentactions plugins.
- Returns:
- list of containmentactions plugins
Plasma.ContainmentActions load | ( | Plasma.Containment | parent, | |
QString | name, | |||
[QVariant] | 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 | ( | Plasma.Containment | parent, | |
KPluginInfo | info, | |||
[QVariant] | 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
KSharedPtr |
( | ) |
Returns the Package specialization for containmentactions.