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

Plasma

  • Plasma
  • AppletScript
Public Slots | Signals | Public Member Functions | Protected Member Functions

Plasma::AppletScript Class Reference

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

#include <Plasma/Scripting/AppletScript>

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

List of all members.

Public Slots

virtual void configChanged ()
virtual void showConfigurationInterface ()

Signals

void popupEvent (bool popped) const
void saveState (KConfigGroup &group) const

Public Member Functions

 AppletScript (QObject *parent=0)
 ~AppletScript ()
Plasma::Applet * applet () const
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

Protected Member Functions

void addStandardConfigurationPages (KConfigDialog *dialog)
Q_INVOKABLE DataEngine * dataEngine (const QString &engine) const
KPluginInfo description () const
bool isRegisteredAsDragHandle (QGraphicsItem *item)
Animation * loadAnimationFromPackage (const QString &name, QObject *parent)
QString mainScript () const
const Package * package () const
void registerAsDragHandle (QGraphicsItem *item)
void showMessage (const QIcon &icon, const QString &message, const MessageButtons buttons)
KConfigDialog * standardConfigurationDialog ()
void unregisterAsDragHandle (QGraphicsItem *item)

Detailed Description

Provides a restricted interface for scripted applets.

Definition at line 50 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 40 of file appletscript.cpp.

Plasma::AppletScript::~AppletScript ( )

Definition at line 47 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 148 of file appletscript.cpp.

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

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

Definition at line 57 of file appletscript.cpp.

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

Configure was changed.

Definition at line 224 of file appletscript.cpp.

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

Definition at line 123 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:
constraintsthe type of constraints that were updated

Definition at line 81 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 86 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 228 of file appletscript.cpp.

KPluginInfo Plasma::AppletScript::description ( ) const [protected]
Returns:
the KPluginInfo associated with this plasmoid

Definition at line 246 of file appletscript.cpp.

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

Definition at line 252 of file appletscript.cpp.

bool Plasma::AppletScript::isRegisteredAsDragHandle ( QGraphicsItem *  item) [protected]
See also:
Applet

Definition at line 176 of file appletscript.cpp.

Animation * Plasma::AppletScript::loadAnimationFromPackage ( const QString &  name,
QObject *  parent 
) [protected]

Loads an animation from the applet package.

  • animation the animation to load
    Returns:
    an Animation object on success, a NULL pointer on failure
    Since:
    4.5

Definition at line 184 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 234 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 240 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:
painterthe QPainter to use
optionthe style option containing such flags as selection, level of detail, etc
contentsRectthe rect to paint within; automatically adjusted for the background, if any

Definition at line 63 of file appletscript.cpp.

void Plasma::AppletScript::popupEvent ( bool  popped) const [signal]
See also:
PopupApplet
void Plasma::AppletScript::registerAsDragHandle ( QGraphicsItem *  item) [protected]
See also:
Applet

Definition at line 162 of file appletscript.cpp.

void Plasma::AppletScript::saveState ( KConfigGroup &  group) const [signal]
See also:
Applet
void Plasma::AppletScript::setApplet ( Plasma::Applet *  applet)

Sets the applet associated with this AppletScript.

Definition at line 52 of file appletscript.cpp.

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

Definition at line 109 of file appletscript.cpp.

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

Definition at line 116 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 102 of file appletscript.cpp.

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

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

Definition at line 91 of file appletscript.cpp.

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

Show a configuration dialog.

Definition at line 130 of file appletscript.cpp.

void Plasma::AppletScript::showMessage ( const QIcon &  icon,
const QString &  message,
const MessageButtons  buttons 
) [protected]
See also:
Applet

Definition at line 1075 of file applet.cpp.

QSizeF Plasma::AppletScript::size ( ) const

Returns the area within which contents can be painted.

Definition at line 72 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 139 of file appletscript.cpp.

void Plasma::AppletScript::unregisterAsDragHandle ( QGraphicsItem *  item) [protected]
See also:
Applet

Definition at line 169 of file appletscript.cpp.


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