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

Plasma

  • Plasma
  • AppletScript
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
Plasma::AppletScript Class Reference

#include <Plasma/Scripting/AppletScript>

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

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)
 
Containment::Type containmentType () const
 
virtual QList< QAction * > contextualActions ()
 
bool drawWallpaper () const
 
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 setContainmentType (Containment::Type type)
 
void setDrawWallpaper (bool drawWallpaper)
 
void setFailedToLaunch (bool failed, const QString &reason=QString())
 
void setHasConfigurationInterface (bool hasInterface)
 
virtual QPainterPath shape () const
 
Q_INVOKABLE QSizeF size () const
 
- Public Member Functions inherited from Plasma::ScriptEngine
 ~ScriptEngine ()
 
virtual bool init ()
 

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)
 
- Protected Member Functions inherited from Plasma::ScriptEngine
 ScriptEngine (QObject *parent=0)
 

Detailed Description

Provides a restricted interface for scripted applets.

Definition at line 51 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 ( )
virtualslot

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.

Containment::Type Plasma::AppletScript::containmentType ( ) const
See also
Containment
Since
4.7

Definition at line 278 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
Parameters
enginename 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.

bool Plasma::AppletScript::drawWallpaper ( ) const
Returns
true if the applet is a containment AND if the wallpaper is enabled
See also
Containment
Since
4.7

Definition at line 258 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.

Parameters
animationthe 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
protectedvirtual
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
protectedvirtual
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::setContainmentType ( Containment::Type  type)
See also
Containment
Since
4.7

Definition at line 289 of file appletscript.cpp.

void Plasma::AppletScript::setDrawWallpaper ( bool  drawWallpaper)

set if the containment draws its own wallpaper: it has no effect if the applet is not a containment

See also
Containment
Since
4.7

Definition at line 269 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.

Parameters
hasInterfacetrue 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 ( )
virtualslot

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 155 of file appletscript.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
  • appletscript.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal