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

Plasma

Plasma::AppletScript

Plasma::AppletScript Class Reference

Provides a restricted interface for scripted applets. More...

#include <Plasma/Scripting/AppletScript>

Inheritance diagram for Plasma::AppletScript:
Plasma::ScriptEngine QObject

List of all members.

Public Slots

virtual void configChanged ()
virtual void showConfigurationInterface ()

Public Member Functions

Plasma::Applet * applet () const
 AppletScript (QObject *parent=0)
void configNeedsSaving () const
virtual void constraintsEvent (Plasma::Constraints constraints)
virtual QList< QAction * > contextualActions ()
Extender * extender () const
virtual void paintInterface (QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect &contentsRect)
void setApplet (Plasma::Applet *applet)
void setConfigurationRequired (bool req, const QString &reason=QString())
void setFailedToLaunch (bool failed, const QString &reason=QString())
void setHasConfigurationInterface (bool hasInterface)
virtual QPainterPath shape () const
Q_INVOKABLE QSizeF size () const
 ~AppletScript ()

Protected Member Functions

void addStandardConfigurationPages (KConfigDialog *dialog)
Q_INVOKABLE DataEngine * dataEngine (const QString &engine) const
QString mainScript () const
const Package * package () const
KConfigDialog * standardConfigurationDialog ()

Detailed Description

Provides a restricted interface for scripted applets.

Definition at line 48 of file appletscript.h.


Constructor & Destructor Documentation

Plasma::AppletScript::AppletScript ( QObject *  parent = 0  )  [explicit]

Default constructor for an AppletScript.

Subclasses should not attempt to access the Plasma::Applet associated with this AppletScript in the constructor. All such set up that requires the Applet itself should be done in the init() method.

Definition at line 37 of file appletscript.cpp.

Plasma::AppletScript::~AppletScript (  ) 

Definition at line 44 of file appletscript.cpp.


Member Function Documentation

void Plasma::AppletScript::addStandardConfigurationPages ( KConfigDialog *  dialog  )  [protected]

This method should be called after a scripting applet has added its own pages to a configuration dialog.

Since:
4.3.1

Definition at line 143 of file appletscript.cpp.

Applet * Plasma::AppletScript::applet (  )  const

Returns the Plasma::Applet associated with this script component.

Definition at line 54 of file appletscript.cpp.

void Plasma::AppletScript::configChanged (  )  [virtual, slot]

Configure was changed.

Definition at line 152 of file appletscript.cpp.

void Plasma::AppletScript::configNeedsSaving (  )  const
See also:
Applet

Definition at line 120 of file appletscript.cpp.

void Plasma::AppletScript::constraintsEvent ( Plasma::Constraints  constraints  )  [virtual]

Called when any of the geometry constraints have been updated.

This is always called prior to painting and should be used as an opportunity to layout the widget, calculate sizings, etc.

Do not call update() from this method; an update() will be triggered at the appropriate time for the applet.

Parameters:
constraints the type of constraints that were updated

Definition at line 78 of file appletscript.cpp.

QList< QAction * > Plasma::AppletScript::contextualActions (  )  [virtual]

Returns a list of context-related QAction instances.

Returns:
A list of actions. The default implementation returns an empty list.

Definition at line 83 of file appletscript.cpp.

DataEngine * Plasma::AppletScript::dataEngine ( const QString &  engine  )  const [protected]
  • engine name of the engine
    Returns:
    a data engine associated with this plasmoid

Definition at line 156 of file appletscript.cpp.

Extender * Plasma::AppletScript::extender (  )  const
See also:
Applet

Definition at line 174 of file appletscript.cpp.

QString Plasma::AppletScript::mainScript (  )  const [protected, virtual]
Returns:
absolute path to the main script file for this plasmoid

Reimplemented from Plasma::ScriptEngine.

Definition at line 162 of file appletscript.cpp.

const Package * Plasma::AppletScript::package (  )  const [protected, virtual]
Returns:
the Package associated with this plasmoid which can be used to request resources, such as images and interface files.

Reimplemented from Plasma::ScriptEngine.

Definition at line 168 of file appletscript.cpp.

void Plasma::AppletScript::paintInterface ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
const QRect &  contentsRect 
) [virtual]

Called when the script should paint the applet.

Parameters:
painter the QPainter to use
option the style option containing such flags as selection, level of detail, etc
contentsRect the rect to paint within; automatically adjusted for the background, if any

Definition at line 60 of file appletscript.cpp.

void Plasma::AppletScript::setApplet ( Plasma::Applet *  applet  ) 

Sets the applet associated with this AppletScript.

Definition at line 49 of file appletscript.cpp.

void Plasma::AppletScript::setConfigurationRequired ( bool  req,
const QString &  reason = QString() 
)
See also:
Applet

Definition at line 106 of file appletscript.cpp.

void Plasma::AppletScript::setFailedToLaunch ( bool  failed,
const QString &  reason = QString() 
)
See also:
Applet

Definition at line 113 of file appletscript.cpp.

void Plasma::AppletScript::setHasConfigurationInterface ( bool  hasInterface  ) 

Sets whether or not this script has a configuration interface or not.

  • hasInterface true if the applet is user configurable

Definition at line 99 of file appletscript.cpp.

QPainterPath Plasma::AppletScript::shape (  )  const [virtual]

Returns the shape of the widget, defaults to the bounding rect.

Definition at line 88 of file appletscript.cpp.

void Plasma::AppletScript::showConfigurationInterface (  )  [virtual, slot]

Show a configuration dialog.

Definition at line 127 of file appletscript.cpp.

QSizeF Plasma::AppletScript::size (  )  const

Returns the area within which contents can be painted.

Definition at line 69 of file appletscript.cpp.

KConfigDialog * Plasma::AppletScript::standardConfigurationDialog (  )  [protected]
Returns:
a standard Plasma applet configuration dialog, ready to have pages added to it.

Note that the dialog returned is set to delete on close.

Definition at line 134 of file appletscript.cpp.


The documentation for this class was generated from the following files:
  • appletscript.h
  • appletscript.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
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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