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

Plasma

Plasma::ContainmentActions

Plasma::ContainmentActions Class Reference

The base ContainmentActions class. More...

#include <Plasma/ContainmentActions>

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

List of all members.

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
void restore (const KConfigGroup &config)
virtual void save (KConfigGroup &config)

Static Public Member Functions

static QString eventToString (QEvent *event)
static KPluginInfo::List listContainmentActionsInfo ()
static ContainmentActions * load (Containment *parent, const KPluginInfo &info, const QVariantList &args=QVariantList())
static ContainmentActions * load (Containment *parent, const QString &name, 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 46 of file containmentactions.cpp.

Plasma::ContainmentActions::~ContainmentActions (  ) 

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

Definition at line 52 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 134 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. So far the event could 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:
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

Definition at line 209 of file containmentactions.cpp.

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

Reimplemented from QObject.

Definition at line 292 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  )  [protected, virtual]

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

Parameters:
config Config 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 72 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:
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

Definition at line 117 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:
parent the parent containment. Required; if you send null you'll get back null.
name the plugin name, as returned by KPluginInfo::pluginName()
args to send the containmentactions extra arguments
Returns:
a pointer to the loaded containmentactions, or 0 on load failure

Definition at line 80 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 125 of file containmentactions.cpp.

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

pastes the clipboard at a given location

Definition at line 284 of file containmentactions.cpp.

QString Plasma::ContainmentActions::pluginName (  )  const

Returns the plugin name for the containmentactions.

void Plasma::ContainmentActions::restore ( const 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

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:
config Config 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:
needsConfiguring true if the applet needs to be configured, or false if it doesn't

Definition at line 219 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

Plasma

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • 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
  • KUtils
  • Nepomuk
  • Plasma
  •     Sodep
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal