<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://techbase.kde.org/skins/common/feed.css?0.2"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://techbase.kde.org/api.php?action=feedcontributions&amp;user=Aseigo&amp;feedformat=atom</id>
		<title>KDE TechBase - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://techbase.kde.org/api.php?action=feedcontributions&amp;user=Aseigo&amp;feedformat=atom"/>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Special:Contributions/Aseigo"/>
		<updated>2013-05-18T14:14:02Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.20.2</generator>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject"/>
				<updated>2013-02-07T09:46:31Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Geometry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= The Global plasmoid Object =&lt;br /&gt;
There is a global object available to the Plasmoid called, appropriately, &amp;quot;plasmoid&amp;quot;. It has a number of useful properties (some of which are read only, but many of which are read/write), functions, constant values and callbacks. Each are enumerated below.&lt;br /&gt;
All of those are valid for both JavaScript and QML bindings.&lt;br /&gt;
&lt;br /&gt;
= Callbacks  =&lt;br /&gt;
&lt;br /&gt;
See the section on Events above.&lt;br /&gt;
&lt;br /&gt;
There are some events that are generated by Plasma for the Plasmoid. These can often be caught by providing a function assigned to a specific name in the plasmoid object. For instance, to get notified of form factor changes, one would provide a formFactorChanged method as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
plasmoid.formFactorChanged = function() { &lt;br /&gt;
&lt;br /&gt;
    print(&amp;quot;the form factor has changed to: &amp;quot; + plasmoid.formFactor())&lt;br /&gt;
&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following callbacks are used to notify the Plasmoid of changes in its running environment:&lt;br /&gt;
&lt;br /&gt;
* '''configChanged()'''&lt;br /&gt;
* '''currentActivityChanged()'''&lt;br /&gt;
* '''formFactorChanged()'''&lt;br /&gt;
* '''immutabilityChanged()'''&lt;br /&gt;
* '''locationChanged()'''&lt;br /&gt;
* '''sizeChanged()'''&lt;br /&gt;
&lt;br /&gt;
Other callbacks include:&lt;br /&gt;
* '''dataUpdated(String source, Map[String, Any] data)''': used to pass in DataEngine updates&lt;br /&gt;
* '''activate()''': called when the widget is activated by the user, e.g. by a keyboard shortcut. Useful for setting the focus on a specific input widget, for instance. (API v2)&lt;br /&gt;
* '''initExtenderItem(Extender extender)''': Called when an Extender should be set up. (API v2)&lt;br /&gt;
* '''popupEvent(boolean shown)''': called on PopupApplets when the popup is shown or hidden. (API v2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In API v2, all of these callbacks can also be used as events. So, for instance, instead of implementing plasmoid.popupEvent, one could also write:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
plasmoid.addEventListener('popupEvent', function(shown) { print('shown? ' + shown) } )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This would also suppress any calls to plasmoid.popupEvent.&lt;br /&gt;
&lt;br /&gt;
Further documentation on these callbacks can be found in the relevant sections below.&lt;br /&gt;
&lt;br /&gt;
= Environment  =&lt;br /&gt;
&lt;br /&gt;
A set of read-only properties (and in most cases notification functions) that tell the Plasmoid about its current environment: &lt;br /&gt;
&lt;br /&gt;
* '''apiVersion''': the integer version of the Simplified JavaScript API in the current execution environment; can be used to change behaviour or usage of functions depending on the version number.&lt;br /&gt;
&lt;br /&gt;
* '''formFactor''': one of Planar (e.g. on a desktop or in an application main view), Horizontal, Vertical or MediaCenter. When the form factor changes, the plasmoid.formFactorChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''size''': the size of the Plasmoid, expressed in QSizeF (explained below). when it changes, plasmoid.sizeChanged() will be called.&lt;br /&gt;
&lt;br /&gt;
* '''location''': one of Floating (no specific location), Desktop (on the application's main view are), FullScreen, LeftEdge, RightEdge, TopEdge or ButtomEdge. When the location changes, the plasmoid.locationChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''immutable''': this property is set to true when the Plasmoid is set to not be movable or otherwise changeable, and false otherwise. Configuration is still usually allowed in this state. When the immutability changes, the plasmoid.immutabilityChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''currentActivity''': the current contextual activity name. When the current activity changes, the plasmoid.currentActivityChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''shouldConserveResources''': true if the plasmoid should not be doing anything that would create too much draw on power, e.g. when on a device with low battery power it may be a good idea not to run a computationally expensive but optional animation&lt;br /&gt;
&lt;br /&gt;
* '''userConfiguring''': true if the user configuration interface is currently being displayed.&lt;br /&gt;
&lt;br /&gt;
= Properties  =&lt;br /&gt;
A set of read/write properties that allow the Plasmoid to set various visual or functional properties: &lt;br /&gt;
&lt;br /&gt;
* ''AspectRatioMode'' '''aspectRatioMode''': defines how to treat the aspect ratio of a Plasmoid when resizing it. See the [[http://lxr.kde.org/source/kde/kde-runtime/plasma/scriptengines/javascript/plasmoid/appletinterface.h#120|AspectRatioMode]] documentation for values and their meaning. &lt;br /&gt;
&lt;br /&gt;
* ''BackgroundHints'' '''backgroundHints''': defines how the background of the widget is rendered. See the [[#BackgroundHints|BackgroundHints]] documentation for values and their meaning. &lt;br /&gt;
&lt;br /&gt;
* ''boolean'' '''busy''': set to true when the Plasmoid is currently processing or waiting for data and the user interface should be blocked while doing so; will generally show a full-Plasmoid animated overlay to denote business&lt;br /&gt;
&lt;br /&gt;
* ''SizePolicy'' '''horizontalSizePolicy''': behaviour of the plasmoid in an horizontal layout such as a panel. It may be: &lt;br /&gt;
** ''Fixed'':  The QWidget::sizeHint() is the only acceptable alternative, so the widget can never grow or shrink (e.g. the vertical direction of a push button).&lt;br /&gt;
** ''Minimum'': The sizeHint() is minimal, and sufficient. The widget can be expanded, but there is no advantage to it being larger (e.g. the horizontal direction of a push button). It cannot be smaller than the size provided by sizeHint().&lt;br /&gt;
** ''Maximum'': The sizeHint() is a maximum. The widget can be shrunk any amount without detriment if other widgets need the space (e.g. a separator line). It cannot be larger than the size provided by sizeHint().&lt;br /&gt;
** ''Preferred'': The sizeHint() is best, but the widget can be shrunk and still be useful. The widget can be expanded, but there is no advantage to it being larger than sizeHint() (the default QWidget policy).&lt;br /&gt;
** ''Expanding'': The sizeHint() is a sensible size, but the widget can be shrunk and still be useful. The widget can make use of extra space, so it should get as much space as possible (e.g. the horizontal direction of a horizontal slider).&lt;br /&gt;
** ''MinimumExpanding'':  The sizeHint() is minimal, and sufficient. The widget can make use of extra space, so it should get as much space as possible (e.g. the horizontal direction of a horizontal slider).&lt;br /&gt;
** ''Ignored'': The sizeHint() is ignored. The widget will get as much space as possible.&lt;br /&gt;
&lt;br /&gt;
* ''SizePolicy'' '''verticalSizePolicy''': behaviour of the plasmoid in a vertical layout such as a panel.&lt;br /&gt;
&lt;br /&gt;
== PopupApplet specific ==&lt;br /&gt;
* ''QIcon'' '''popupIcon''': it will be used instead of the applet content when the applet is in a panel&lt;br /&gt;
* ''Object'' '''popupIconToolTip''': it contains the icon, mainText and subtext for the tooltip the applet will have when collapsed in an icon, properties:&lt;br /&gt;
** ''variant'' '''image''': the icon, it may be an icon name, an image path, a QIcon, QImage or a QPixmap&lt;br /&gt;
** ''String'' '''mainText''': the tooltip title&lt;br /&gt;
** ''String'' '''subText''': the tooltip descriptive subtext&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
      var data = new Object&lt;br /&gt;
      data[&amp;quot;image&amp;quot;] = &amp;quot;konqueror&amp;quot;&lt;br /&gt;
      data[&amp;quot;mainText&amp;quot;] = &amp;quot;ToolTip title&amp;quot;&lt;br /&gt;
      data[&amp;quot;subText&amp;quot;] = &amp;quot;ToolTip descriptive sub text&amp;quot;&lt;br /&gt;
      plasmoid.popupIconToolTip = data&lt;br /&gt;
  &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''bool'' '''passivePopup''': if true when the popup is opened other windows can gain focus and the popup won't close&lt;br /&gt;
&lt;br /&gt;
* ''bool'' '''popupShowing''': true when the popupapplet is iconified and its popup is open&lt;br /&gt;
&lt;br /&gt;
== Containment specific ==&lt;br /&gt;
* ''Array(Object)'' '''applets''': List of all applets in the containment&lt;br /&gt;
* ''bool'' '''drawWallpaper''': Enable/disable the wallpaper painting by the containment&lt;br /&gt;
* ''enum'' '''containmentType''': one of&lt;br /&gt;
** ''DesktopContainment'': A desktop containment&lt;br /&gt;
** ''PanelContainment'': A desktop panel&lt;br /&gt;
** ''CustomContainment'': A containment that is neither a desktop nor a panel  but something application specific&lt;br /&gt;
** ''CustomPanelContainment'': A customized desktop panel&lt;br /&gt;
&lt;br /&gt;
* ''int'' '''screen''': Number of the screen this containment is in&lt;br /&gt;
* ''string'' '''activityName''': The name of the activity this containment belongs to.&lt;br /&gt;
* ''string'' '''activityId''': The id of the activity this containment belongs to.&lt;br /&gt;
&lt;br /&gt;
The following API is only available from declarative containments.&lt;br /&gt;
* ''ToolBox'' '''toolBox()''': The toolbox of the Containment. The ToolBox is rendered as a separate item on the scene and provides access to the following properties:&lt;br /&gt;
** ''Array(QAction)'' '''actions''': A list of actions provided by the Containment.&lt;br /&gt;
&lt;br /&gt;
= Geometry  =&lt;br /&gt;
&lt;br /&gt;
Read Only Properties: &lt;br /&gt;
&lt;br /&gt;
* ''QRectF'' '''rect''': the current rect of the Plasmoid; note that the top left may be not be the origin point (0,0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* '''resize(width, height)''' - must not be called on widget creation (that will break external resizing; e.g. user interaction), and should only be called as a last resort during runtime. Almost always content should scale to the size of the plasmoid.&lt;br /&gt;
* '''setMinimumSize(width, height)''' - Not to be used from QML, where top level minimumWidth and minimumHeight properties are used instead&lt;br /&gt;
* '''setPreferredSize(width, height)''' - Not to be used from QML&lt;br /&gt;
* '''setBackgroundHints(background)''' - use '''NoBackground''' as value if you want to remove the default plasmoid background box.&lt;br /&gt;
* '''popupIcon(QIcon(&amp;quot;some icon&amp;quot;))''' - set icon to show when the plasmoid is added to the taskbar. NOTE if the plasmoid is made in QML, you MUST specify a default size for the main Item. This size will be used for the plasmoid when added to the taskbar&lt;br /&gt;
&lt;br /&gt;
= Painting and Layout  =&lt;br /&gt;
&lt;br /&gt;
To paint directly on to the canvas, a widget may implement the paintInterface function in the plasmoid object: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
    plasmoid.paintInterface = function(painter) { /* painting code goes here*/ }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
See the Painting section below for information about helpful classes and functions that can be used when implementing a paintInterface function. &lt;br /&gt;
&lt;br /&gt;
Read/Write Properties: &lt;br /&gt;
&lt;br /&gt;
* ''Layout'' '''layout''': the QGraphicsLayout associated with the Plasmoid for laying out top level items; this property is read-write, though the property is not usually set as one can simply do &amp;quot;new LinearLayout&amp;quot; (or one of the other layout classes provided) and it will be automatically associated with the Plasmoid.&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* '''update()''': triggers a full repaint of the Plasmoid.&lt;br /&gt;
* '''update(QRectF rect)''' triggers a repaint of the rect area of the Plasmoid.&lt;br /&gt;
* '''failedToLaunch(bool failed[, string reason])''' sets the launch status of the Plasmoid; if set to true, the script will stop executing and the reason message, if any, will be displayed to the user.&lt;br /&gt;
&lt;br /&gt;
= Access To Packaged Files  =&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* ''string'' '''file(string type[, string fileName])''': returns the path to a file in the Plasmoid package of the given type, optionally with a file name to match, e.g. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var path = plasmoid.file(&amp;quot;mainscript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
or &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var pm = new QPixmap(plasmoid.file(&amp;quot;images&amp;quot;, &amp;quot;mypixmap.png&amp;quot;))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''bool'' '''include(string filename)''': attempts to include the script defined from the package's code directory&lt;br /&gt;
&lt;br /&gt;
= Configuration Data  =&lt;br /&gt;
Configuration values can be defined using [[Development/Tutorials/Using_KConfig_XT|KConfig XT]] XML files in the {{path|contents/config/}} directory of the Plasmoid's package. The default file that is looked for and used is {{path|contents/config/main.xml}}.&lt;br /&gt;
&lt;br /&gt;
== Accessing Configuration Data  ==&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''activeConfig''': The current active configuration description. For instance, setting it to &amp;quot;foo&amp;quot; would cause the Plasmoid to try and reference the {{path|contents/config/foo.xml}} KConfigXT file. Setting this to an empty string will switch to the main.xml file.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''any'' '''readConfig(String key)''': reads the value from the configuration data for the given key as defined by the currently active configuration.&lt;br /&gt;
&lt;br /&gt;
* '''writeConfig(String key, any value) ''': writes a value to the configuration store under the given key&lt;br /&gt;
&lt;br /&gt;
== User Customization  ==&lt;br /&gt;
&lt;br /&gt;
User customization can be offered by providing a Qt Designer file called {{path|contents/ui/config.ui}} in the Plasmoid's package.&lt;br /&gt;
&lt;br /&gt;
Callbacks:&lt;br /&gt;
* '''configChanged()''': callback function called when the configuration is changed external to the Plasmoid, e.g. when the user changes settings in a configuration dialog.&lt;br /&gt;
&lt;br /&gt;
= Context menu =&lt;br /&gt;
&lt;br /&gt;
It's possible to add some items to the popup menu of the Plasmoid.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setAction(String name, String text, String icon, String shortcut)''': adds an item to the context menu with the given text and icon;&lt;br /&gt;
 In pure JavaScript plasmoids you need to define '''plasmoid.action_&amp;lt;name&amp;gt;''' function, where &amp;lt;name&amp;gt; is the first argument for setAction call, and this function will be called each time user clicks the item.&lt;br /&gt;
 Similarly in QML plasmoids you must define a function '''action_&amp;lt;name&amp;gt;''' in the root qml item that will handle the action click.&lt;br /&gt;
* '''setActionSeparator(String name)''': (API v5) adds a separator item to the context menu&lt;br /&gt;
* '''removeAction(String name)''': removes the item with &amp;lt;name&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Getting_Started/Build/Distributions/openSUSE</id>
		<title>Getting Started/Build/Distributions/openSUSE</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Getting_Started/Build/Distributions/openSUSE"/>
				<updated>2013-02-04T19:10:32Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Required Packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
openSUSE has a very strong and active KDE team with a lot of information on their own wiki:&lt;br /&gt;
* [http://en.opensuse.org/Portal:KDE openSUSE KDE Portal]&lt;br /&gt;
* [http://en.opensuse.org/KDE_repositories openSUSE KDE package repositories]&lt;br /&gt;
* [http://en.opensuse.org/openSUSE:KDE_developers_guide openSUSE KDE Developers Guide] (Outdated)&lt;br /&gt;
* [http://en.opensuse.org/KDE openSUSE wiki KDE page]&lt;br /&gt;
&lt;br /&gt;
= Required Packages =&lt;br /&gt;
Use the following command to install the needed packages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
zypper si -d kdelibs4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Build =&lt;br /&gt;
&lt;br /&gt;
This section describes how you can get kde to compile so that you can log in graphically (using kdm, the KDE display manager) and call konqueror (contained in KDEBASE, KDE's base package).&lt;br /&gt;
&lt;br /&gt;
== kdesupport ==&lt;br /&gt;
&lt;br /&gt;
You can install kdesupport and its dependencies from SUSE by adding the KDE:Distro:Stable repository from&lt;br /&gt;
the [http://download.opensuse.org/repositories/KDE:/Distro:/Stable/ openSUSE Build Service] to your repositories. For openSUSE 12.1 add this Repository to YaST/zypper:&lt;br /&gt;
 http://download.opensuse.org/repositories/KDE:/Distro:/Stable/openSUSE_12.1/&lt;br /&gt;
&lt;br /&gt;
For older versions of openSUSE do:&lt;br /&gt;
 su&lt;br /&gt;
 zypper ar -f http://download.opensuse.org/repositories/KDE:/Distro:/Stable/[YOUR openSUSE VERSION]&lt;br /&gt;
&lt;br /&gt;
Now install kdesupport from openSUSE:&lt;br /&gt;
 zypper install libqca2-devel libsoprano-devel libqimageblitz-devel strigi-devel&lt;br /&gt;
&lt;br /&gt;
Please remember to skip any instructions from [[Getting_Started/Build]] that refer to kdesupport. Start to compile with kdelibs.&lt;br /&gt;
&lt;br /&gt;
= Using openSUSE Unstable Repositories =&lt;br /&gt;
&lt;br /&gt;
openSUSE, via its Build Service, provides a so-called unstable repository which contains weekly snapshots from KDE SVN trunk. These allow you to run a system install of unstable, but does not allow you to keep a stable system install while testing unstable in parallel.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
You need a supported openSUSE version, that is, at the time of writing, openSUSE 11.4 or 12.1 or openSUSE Factory (the always-on-development branch of openSUSE).&lt;br /&gt;
&lt;br /&gt;
== Installing packages from the unstable repository ==&lt;br /&gt;
&lt;br /&gt;
Add the repository manually and perform an installation from the command line. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Addition of the repository ===&lt;br /&gt;
&lt;br /&gt;
Add the repository. To do so, enter as root&lt;br /&gt;
&lt;br /&gt;
 zypper ar -f http://download.opensuse.org/repositories/KDE:/Unstable:/SC/YOUR_openSUSE_VERSION/ [ALIAS]&lt;br /&gt;
&lt;br /&gt;
where YOUR_openSUSE_VERSION is either openSUSE_11.4, openSUSE_12.1, or openSUSE_Factory depending on what you are running. And ALIAS is whatever name you want to assign to the repository.&lt;br /&gt;
&lt;br /&gt;
After that upgrade the packages to the unstable version:&lt;br /&gt;
&lt;br /&gt;
 zypper dup --from [ALIAS]&lt;br /&gt;
&lt;br /&gt;
=== Post-installation steps ===&lt;br /&gt;
&lt;br /&gt;
You may want to add some additional repositories to have compatible non KDE SC packages available. &lt;br /&gt;
&lt;br /&gt;
 zypper ar -f http://download.opensuse.org/repositories/KDE:/UpdatedApps/YOUR_openSUSE_VERSION/ [ALIAS]&lt;br /&gt;
 zypper ar -f http://download.opensuse.org/repositories/KDE:/Extra/YOUR_openSUSE_VERSION/_KDE_Unstable_SC/ [ALIAS]&lt;br /&gt;
&lt;br /&gt;
followed by the installation the packages you need:&lt;br /&gt;
&lt;br /&gt;
 zypper install [package]&lt;br /&gt;
&lt;br /&gt;
Return to [[Getting_Started/Build|Building KDE]].&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting</id>
		<title>KDE System Administration/PlasmaDesktopScripting</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting"/>
				<updated>2013-01-28T17:04:54Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Locating Applications and Paths */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ECMA Script Interaction With Plasma Shells ==&lt;br /&gt;
&lt;br /&gt;
It is possible to control and interact with a Plasma user interface shell such as a plasma-desktop or (starting in KDE SC 4.5) plasma-netbook session using ECMA Script (aka JavaScript). This scripting mechanism exposes containments (Desktop Activities and Panels), widgets and various other aspects of plasma-desktop configuration using the widely known and used ECMA Script language. The QtScript engine is used for the runtime environment.&lt;br /&gt;
&lt;br /&gt;
This document describes the API that is provided along with how to&lt;br /&gt;
run such scripts in plasma-desktop.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
A set of examples can be found [https://projects.kde.org/projects/kde/kdeexamples/repository/revisions/master/show/plasma/javascript/plasma-shell-scripting here] that demonstrate the use of various aspects of Plasma shell scripting.&lt;br /&gt;
&lt;br /&gt;
Contributions of additional examples are welcome and an be sent to the Plasma development mailing list (plasma-devel at kde.org) for inclusion if you do not have commit rights to the kdeexamples module.&lt;br /&gt;
&lt;br /&gt;
== Running Scripts ==&lt;br /&gt;
There are three ways that scripts can be executed in plasma-desktop:&lt;br /&gt;
&lt;br /&gt;
* '''on first run''': when plasma-desktop is started without any pre-existing configuration, any scripts in $APPDATA/plasma-desktop/init/ with a &amp;quot;.js&amp;quot; suffix are run. If there is more than one script, they are run sequentially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''on update''': when plasma-desktop is started, it will check in&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
`kde4-config --path data`/plasma-desktop/updates/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
with a &amp;quot;.js&amp;quot; suffix for scripts that have not yet been run. If there is more than one script which has not been run yet they will be executed serially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
A record of which update scripts have been run is kept in the application's config file in the [Updates] group. This means that if the plasma-desktop configuraiton file is removed, all the update scripts will be run again.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''interactively''': an interactive scripting dialog can be requested either via the KRunner window (Alt+F2, by default, or via the &amp;quot;Run Command&amp;quot; entry in various desktop menus) by entering &amp;quot;desktop console&amp;quot; as the search term. It can also be triggered directly via dbus with &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;qdbus org.kde.plasma-desktop /MainApplication showInteractiveConsole&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|This method is not available for plasma-netbook.}}&lt;br /&gt;
&lt;br /&gt;
:ECMA Script may be entered directly into this window for execution and output appears in the lower half of the window. Ctrl+E is a shortcut to run scripts, and scripts can be saved to and loaded from disk.&lt;br /&gt;
&lt;br /&gt;
:Scripts from files can also be loaded using KRunner with &amp;quot;desktop console /path/to/file&amp;quot; or via dbus with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;qdbus org.kde.plasma-desktop /MainApplication loadScriptInInteractiveConsole /path/to/file&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&lt;br /&gt;
Templates are named packages that contain scripts. This provides a way for common functionality to be easily reused, helping to increase consistency and lower maintenance costs. Templates can be loaded from other scripts by name and they are also used to populate some parts of the user interface, such as the entries in the Add Panels menu.&lt;br /&gt;
&lt;br /&gt;
A template is a small set of files in a specified file hierarchy (or, in Plasma terms, a &amp;quot;Package&amp;quot;). In particular, a Template package contains the following files:&lt;br /&gt;
&lt;br /&gt;
* metadata.desktop: a .desktop file describing the template&lt;br /&gt;
* contents/layout.js: a Javascript file containing the actual script&lt;br /&gt;
&lt;br /&gt;
Templates are stored under share/apps/plasma/layout-templates and may be installed using `plasmapkg -t layout-template -i /path/to/package`. Template packages may also be provided as a .zip file with a .plasmalayout suffix.&lt;br /&gt;
&lt;br /&gt;
The metadata.desktop file contains the usual .desktop entries such as Name and Icon but must also contain Type=Service and ServiceTypes=Plasma/LayoutTemplate entries. If the layout is specific to a given Plasma application, such as plasma-desktop, this can be specific using X-Plasma-Shell. X-Plasma-ContainmentCategories defines what kind of layout it is with possible values being panel and desktop. Finally a X-KDE-PluginInfo-Name entry is required to provide a globally unique internal name for the Template. Here is an example of a Template that provides a Panel layout for Plasma Netbook:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Panel&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-netbook&lt;br /&gt;
X-Plasma-ContainmentCategories=panel&lt;br /&gt;
X-KDE-PluginInfo-Author=Aaron Seigo&lt;br /&gt;
X-KDE-PluginInfo-Email=aseigo@kde.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.CoolNetbookPanel&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://plasma.kde.org/&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running a template, two global variables will be accessible in read-only mode: templateName and templateComment. They will contain the Name and Comment fields of the above desktop file, and are translated if a localization is available.&lt;br /&gt;
&lt;br /&gt;
=== Examples of Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Creating panels ====&lt;br /&gt;
A good example of the use of templates is the use case that triggered the creation of this feature: the desire to make it easy for users to re-create the default panel that is created on first start. There is a Template called org.kde.plasma-desktop.defaultPanel that ships with the KDE Plasma Workspace which contains the layout for the initial default panel. This is referenced by the default Plasma Desktop init script and, because it is marked as a Panel Template in the metadata.desktop file it also shows up to the user in the Add Panels menu. When selected by the user from the menu, the exact same panel that is created on desktop start up is created for them, complete with Plasma Widgets and configuration.&lt;br /&gt;
&lt;br /&gt;
==== Automating tasks ====&lt;br /&gt;
Another example of the usefulness of templates is the &amp;quot;Find Widgets&amp;quot; template. This template, which first shipped with Plasma Desktop v4.5, provides a function for finding widgets by name. It appears in the toolbar &amp;quot;Load&amp;quot; and &amp;quot;Use&amp;quot; menus in the Desktop Console in plasma-desktop, and makes finding widgets as simple as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var template = loadTemplate('org.kde.plasma-desktop.findWidgets')&lt;br /&gt;
template.findWidgets('systemtray')&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Activity templates ====&lt;br /&gt;
Probably the most user visible use of templates are &amp;quot;Activity templates&amp;quot;. The structure of Activity templates is similar to the other use of templates, but a few extra features are provided in the metadata.desktop file. Here is an example of such an activity template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Activity Template&lt;br /&gt;
Icon=user-desktop&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-desktop&lt;br /&gt;
X-Plasma-ContainmentCategories=desktop&lt;br /&gt;
X-Plasma-ContainmentLayout-ExecuteOnCreation=dolphin $desktop, gwenview $pictures&lt;br /&gt;
X-Plasma-ContainmentLayout-ShowAsExisting=true&lt;br /&gt;
X-KDE-PluginInfo-Author=John Doe&lt;br /&gt;
X-KDE-PluginInfo-Email=john@doe.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.plasma-desktop.CoolTemplate&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://john.doe.org&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The layout itself is still created from the layout.js file as usual, but this template also shows as a precreated activity to the user thanks to the &amp;lt;tt&amp;gt;X-Plasma-ContainmentLayout-ShowAsExisting&amp;lt;/tt&amp;gt; key. Additionally, it starts applications in the newly created activity using the &amp;lt;tt&amp;gt;X-Plasma-ContainmentLayout-ExecuteOnCreation&amp;lt;/tt&amp;gt; key.&lt;br /&gt;
&lt;br /&gt;
That key is a list of commands to execute, and it supports the following variables:&lt;br /&gt;
* $desktop&lt;br /&gt;
* $autostart&lt;br /&gt;
* $documents&lt;br /&gt;
* $music&lt;br /&gt;
* $video&lt;br /&gt;
* $downloads&lt;br /&gt;
* $pictures&lt;br /&gt;
&lt;br /&gt;
They all expand into the path toward the user corresponding default folder.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
In addition to the normal ECMA Script API and the Qt-specific extensions (such as signal/slot support) provided by QtScript, the following API is provided for use by scripts.&lt;br /&gt;
&lt;br /&gt;
All of the API below, unless otherwise noted with a version noticed, appear as below in the KDE Software Compilation v4.4.0 and later. API that is not noted as being part of a given class or object is part of the global namespace.&lt;br /&gt;
&lt;br /&gt;
{{note|API compatibility is guaranteed from version to version starting with KDE Software Compilation v4.4.0.}}&lt;br /&gt;
&lt;br /&gt;
=== Version Numbers ===&lt;br /&gt;
&lt;br /&gt;
Starting with KDE SC 4.5, the version number of both the scripting API and the application is available to the script via the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''applicationVersion''': the version of the application, e.g. 0.3&lt;br /&gt;
* ''String'' '''platformVersion''': the version of the KDE Platform, e.g. 0.3&lt;br /&gt;
* ''number'' '''scriptingVersion''': the version of the scripting API; e.g. in KDE SC 4.5 this is 2&lt;br /&gt;
&lt;br /&gt;
=== Activities ===&lt;br /&gt;
Activities are the desktop layer in a plasma-desktop session and may contain widgts. In sightly more technical terms, they are desktop containments. Activities can be created, enumerated, modified and destroyed.&lt;br /&gt;
&lt;br /&gt;
New Activities can be created using the Activity constructor, like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var activity = new Activity(&amp;quot;folderview&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file). See the documentation on the Containment object class below.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''activityIds''': returns a list of integer ids of all existing Plasma activities&lt;br /&gt;
* ''Array[String]'' '''knownActivityTypes''':  (scripting version &amp;gt;= 2) a list of types of activities that can be created. This is useful to check if an Activity type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Activity'' '''activityById(number id)''': return an object representing the activity with the given id&lt;br /&gt;
* ''Activity'' '''activityForScreen(number screen[, number dekstop])''': returns an object representing the activity  currently associated with the given screen and, optionally, the given desktop.&lt;br /&gt;
* ''Array[Activity]'' '''activities()''': returns an array of all activities that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Panels ===&lt;br /&gt;
Panels can be created, enumerated, modified and destroyed. A panel object combines both a containment as well as the container itself, allowing for full control of things such as where it appears on screen and the hiding features associated with them.&lt;br /&gt;
&lt;br /&gt;
New Panels can be created using the Panel constructor, like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var panel = new Panel(&amp;quot;dock&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file).&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''panelIds''': returns a list of integer ids of all existing Plasma panels&lt;br /&gt;
* ''Array[String]'' '''knownPanelTypes''':  (scripting version &amp;gt;= 2) a list of types of panels that can be created. This is useful to check if a Panel type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Panel'' '''panelById(int id)''': returns an object representing the Panel that matches the given id&lt;br /&gt;
* ''Array[Panels]'' '''panels()''': returns an array of all panels that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Activities and Panels ===&lt;br /&gt;
Activity and Panel objects, once created by the script, or as returned by activityById, activityForScreen,&lt;br /&gt;
or panelById) provide the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id: the integer id of this activity&lt;br /&gt;
* ''String'' '''formFactor''': returns the form factor of the activity, e.g. &amp;quot;planar&amp;quot; for most desktop activities,&amp;quot;mediacenter&amp;quot; for media centers and either &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; for panels.&lt;br /&gt;
* ''Array[number]'' '''widgetIds''': a list of integer ids of all the widgets in this Activity&lt;br /&gt;
* ''Array[String]'' '''configKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''configGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
&lt;br /&gt;
as well as the following read/write properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''desktop''': the virtual desktop this activity is associated with, or -1 for none&lt;br /&gt;
* ''number'' '''screen''': the screen this activity is associated with, or -1 for none&lt;br /&gt;
* ''String'' '''name''': the name of this activity&lt;br /&gt;
* ''String'' '''wallpaperPlugin''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin to use with the Activity&lt;br /&gt;
* ''String'' '''wallpaperMode''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin mode to use with the Activity&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': (scriptingVersion &amp;gt;= 2) the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this activity and all widgets inside of it&lt;br /&gt;
* ''Widget'' '''widgetById(number id)''': returns an object representing the widget with the given id&lt;br /&gt;
* ''Widget'' '''addWidget(String name)''': adds a new widget to the activity; the name maps to the &amp;lt;tt&amp;gt;X-KDE-PluginInfo-Name=&amp;lt;/tt&amp;gt; entry in the widget's .desktop file&lt;br /&gt;
* ''Widget'' '''addWidget(Widget widget)''': adds an existing widget to this activity; useful for moving widgets between Activities and Panels&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this Activity or Panel on the screen&lt;br /&gt;
* '''readConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the config with default for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the config&lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': (scriptingVersion &amp;gt;= 2) causes the Activity or Panel to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of panels and activities of the same type.&lt;br /&gt;
* ''Array[Widget]'' '''widgets([String type])''': (scriptingVersion &amp;gt;= 2) returns all the widgets in the Panel or Activity. If the optional type is specified, only widgets matching that type will be returned.&lt;br /&gt;
&lt;br /&gt;
In addition to all of the above properties and functions, Panel objects also provide the folowing read/write properties:&lt;br /&gt;
* ''number'' '''length''': the number of pixels along the screen edge used&lt;br /&gt;
* ''number'' '''height''': the height (or for vertical panels, the width) of the panel&lt;br /&gt;
* ''String'' '''hiding''': the hiding mode of the panel, one of &amp;quot;none&amp;quot; (for no hiding), &amp;quot;autohide&amp;quot;, &amp;quot;windowscover&amp;quot; or &amp;quot;windowsbelow&amp;quot;&lt;br /&gt;
* ''String'' '''alignment''': right, left or center alignment of the panel (for vertical panels, right corrsponds to top and left to bottom)&lt;br /&gt;
* ''String'' '''location''': returns the location of the activity (only relevant for Panels); valid values include &amp;quot;top&amp;quot;, &amp;quot;bottom&amp;quot;, &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot; and &amp;quot;floating&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Widgets ===&lt;br /&gt;
Widgets may be enumerated by calling the widgetIds property on a Activity or Panel object. With a widget id in hand, a Widget object can be retrieved by calling widgetById(id) on an Activity or Panel object. New Widgets can be created with add addWidget(String) function provided by Activity and Panel objects.&lt;br /&gt;
&lt;br /&gt;
==== Checking if a widget is installed ====&lt;br /&gt;
A list of all installed widget types can be retrieved the following read-only property:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''knownWidgetTypes''' (scripting version &amp;gt;= 2)&lt;br /&gt;
&lt;br /&gt;
This can be used most conveniently with the indexOf() method, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (knownWidgeTypes.indexOf('someWidgetPluginName') &amp;gt; -1) {&lt;br /&gt;
    print(&amp;quot;It is installed on this system!&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
    print(&amp;quot;It is not installed :(&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Widget Object API ====&lt;br /&gt;
A Widget object provides the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id''': the id of the widget&lt;br /&gt;
* ''String'' '''type''': the plugin type of this widget&lt;br /&gt;
* ''Array[String]'' '''configKeys''': a list of all keys that are set in the current configuration&lt;br /&gt;
* ''Array[String]'' '''configGroups''': a list of all the groups in the current configuration&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
as well as the following read-write properties:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of widgets of the same type.&lt;br /&gt;
* ''QRectF'' '''geometry''': the geometry of the widget (settable)&lt;br /&gt;
* ''String'' '''globalShortcut''': the shortcut sequence (in the format used by QKeySequence, e.g. &amp;quot;Alt+F1&amp;quot;) associated with this widget&lt;br /&gt;
* ''number'' '''index''': the layout index of the widget; in a Panel this corresponds to the order the widget appears in. Changing the value of the index will change the position of the widget in Panels and may do so in some Activities as well.&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this widget&lt;br /&gt;
* '''readConfig(String key, any default)''': reads the value of key in the config with default for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': sets key to value in the config&lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': causes the widget to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this widget on the screen&lt;br /&gt;
&lt;br /&gt;
=== Screen Geometry ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''number'' '''screenCount''': returns the number of screens connected to the computer&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QRectF'' '''screenGeometry(number screen)''': returns a rect object representing the geometry of a screen&lt;br /&gt;
&lt;br /&gt;
=== Wallpaper Plugins ===&lt;br /&gt;
&lt;br /&gt;
* ''Array[String =&amp;gt; Array[String]]'' '''knownWallpaperPlugins()''': (scripting version &amp;gt;= 4) returns a list of all installed wallpaper plugins. The keys of the array are the wallpaper plugin names. The values are arrays containing the modes available for that wallpaper plugin. The mode array may be empty, as most wallpaper plugins only offer one mode.&lt;br /&gt;
&lt;br /&gt;
=== Locating Applications and Paths ===&lt;br /&gt;
* ''boolean'' '''applicationExists(String name)''': (scripting version &amp;gt;= 4) searches $PATH first, then tries in the application menu system by application storage name (aka the .desktop file name), then Name= entries for apps with installed .desktop files, then GenericName= entries for same&lt;br /&gt;
* ''mixed'' '''defaultApplication(String kind [, boolean storageId = false])''': (scripting version &amp;gt;= 4) returns the executable (or if storageId is true, then the app menu system id, e.g. its .desktop file name) of the default app. The &amp;quot;kind&amp;quot; parameter may be a well-known application type including &amp;quot;browser&amp;quot;, &amp;quot;mailer&amp;quot;, &amp;quot;filemanager&amp;quot;, &amp;quot;terminal&amp;quot;, &amp;quot;imClient&amp;quot; and &amp;quot;windowmanager&amp;quot; (or any other entry in share/apps/kcm_componentchooser/kcm_*.desktop); it may also be a mimetype (e.g. &amp;quot;application/pdf&amp;quot;). On failure, it returns false.&lt;br /&gt;
* ''String'' '''applicationPath(String name)''':  (scripting version &amp;gt;= 4) returns the full local path to a given application or .desktop file if it exists. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var desktopfile = &amp;quot;firefox.desktop&amp;quot;&lt;br /&gt;
var executable  = &amp;quot;firefox&amp;quot;&lt;br /&gt;
if (applicationExists(executable)) {  &lt;br /&gt;
    print (executable + &amp;quot; exists &amp;quot; + &amp;quot; with this path:  &amp;quot; + applicationPath(executable))&lt;br /&gt;
    print (executable + &amp;quot; .desktop file is located here :    &amp;quot; + applicationPath(desktopfile))&lt;br /&gt;
} else{&lt;br /&gt;
    print (executable + &amp;quot; does not exist &amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''userDataPath([String type, String path])''':  (scripting version &amp;gt;= 4) returns the default path for user data. Called with no parameters, it returns the user's home directory. If only one string is passed in, the standard directory for that type of data in the user's home directory will be located; the following values are recognized:&lt;br /&gt;
** documents&lt;br /&gt;
** music&lt;br /&gt;
** video&lt;br /&gt;
** downloads&lt;br /&gt;
** pictures&lt;br /&gt;
** autostart&lt;br /&gt;
** desktop (should be considered deprecated for Plasma workspaces)&lt;br /&gt;
&lt;br /&gt;
If a second string is passed in, it is considered a request for a specific path and the following types are recognized:&lt;br /&gt;
** apps - Applications menu (.desktop files).&lt;br /&gt;
** autostart - Autostart directories (both XDG and kde-specific)&lt;br /&gt;
** cache - Cached information (e.g. favicons, web-pages)&lt;br /&gt;
** cgi - CGIs to run from kdehelp.&lt;br /&gt;
** config - Configuration files.&lt;br /&gt;
** data - Where applications store data.&lt;br /&gt;
** emoticons - Emoticons themes&lt;br /&gt;
** exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account.&lt;br /&gt;
** html - HTML documentation.&lt;br /&gt;
** icon - Icons, see KIconLoader.&lt;br /&gt;
** kcfg - KConfigXT config files.&lt;br /&gt;
** lib - Libraries.&lt;br /&gt;
** locale - Translation files for KLocale.&lt;br /&gt;
** mime - Mime types defined by KDE-specific .desktop files.&lt;br /&gt;
** module - Module (dynamically loaded library).&lt;br /&gt;
** qtplugins - Qt plugins (dynamically loaded objects for Qt)&lt;br /&gt;
** services - Services.&lt;br /&gt;
** servicetypes - Service types.&lt;br /&gt;
** sound - Application sounds.&lt;br /&gt;
** templates - Templates for the &amp;quot;Create new file&amp;quot; functionality.&lt;br /&gt;
** wallpaper - Wallpapers.&lt;br /&gt;
** tmp - Temporary files (specific for both current host and current user)&lt;br /&gt;
** socket - UNIX Sockets (specific for both current host and current user)&lt;br /&gt;
** xdgconf-menu - Freedesktop.org standard location for menu layout (.menu) files.&lt;br /&gt;
** xdgdata-apps - Freedesktop.org standard location for application desktop files.&lt;br /&gt;
** xdgdata-dirs - Freedesktop.org standard location for menu descriptions (.directory files).&lt;br /&gt;
** xdgdata-mime - Freedesktop.org standard location for MIME type definitions.&lt;br /&gt;
** xdgdata-icon - Freedesktop.org standard location for icons.&lt;br /&gt;
** xdgdata-pixmap - Gnome-compatibility location for pixmaps.&lt;br /&gt;
&lt;br /&gt;
The second parameter should be a specific resource to find the path to. An example might be userDataPath(&amp;quot;data&amp;quot;, &amp;quot;plasma-desktop&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Misc. Global Properties and Functions ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''locked''': whether the desktop shell and widgets are locked or not (settable)&lt;br /&gt;
* ''string'' '''theme''': (scripting version &amp;gt;= 3) the name of the desktop theme to use for the interface, e.g. default, Air, Oxygen, etc.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''hasBattery''': whether or not the system has the ability to run on battery power, e.g. a laptop or mobile device&lt;br /&gt;
* ''boolean'' '''multihead''': (scripting version &amp;gt;= 3) true if the system is running with multiple screens in a &amp;quot;Xaphod&amp;quot; multiple display server configuration&lt;br /&gt;
* ''int'' '''multiheadScreen''': (scripting version &amp;gt;= 3) if multihead is true, contains the (real) screen id of the current screen&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''sleep(number ms)''': sleeps the script for the specified number of millseconds&lt;br /&gt;
&lt;br /&gt;
=== QRectF ===&lt;br /&gt;
A rectangle class is also provided for use with Widget, Panel and screen geometry properties and functions.&lt;br /&gt;
&lt;br /&gt;
Read-only properites:&lt;br /&gt;
* ''boolean'' '''empty''': true if the rectangle's width or height is less than, or equal to, 0; an empty rectangle is also invalid&lt;br /&gt;
* ''boolean'' '''null''': true if the rectangle has both the width and the height set to 0; a null rectangle is also empty and not valid&lt;br /&gt;
* ''boolean'' '''valid''':  true if the rectangle has a width &amp;gt; 0 and height 0.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''left'''&lt;br /&gt;
* ''number'' '''top'''&lt;br /&gt;
* ''number'' '''bottom'''&lt;br /&gt;
* ''number'' '''right'''&lt;br /&gt;
* ''number'' '''height'''&lt;br /&gt;
* ''number'' '''width'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
&lt;br /&gt;
Constructors:&lt;br /&gt;
* '''QRectF'''&lt;br /&gt;
* '''QRectF(number x, number y, number width, number height)''': Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''adjust(number dx1, number dy1, number dx2, number dy2)''': adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle&lt;br /&gt;
* ''QRectF'' '''adjusted(number dx1, number dy1, number dx2, number dy2)''': returns a new QRectF with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of the rectangle&lt;br /&gt;
* '''translate(number dx, number dy)''': translates the rect by dx, dy&lt;br /&gt;
* '''setCoords(number x1, number y1, number x2, number y2)''': sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).&lt;br /&gt;
* '''setRect(number x, number y, number width, number height)''': sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
* ''boolean'' '''contains(number x, number y)''': returns true if the rect contains the point (x, y)&lt;br /&gt;
* '''moveBottom(number delta)'': moves the bottom by delta pixels&lt;br /&gt;
* '''moveLeft(number delta)''': moves the left by delta pixels&lt;br /&gt;
* '''moveRight(number delta)''': moves the right by delta pixels&lt;br /&gt;
* '''moveTo(number x, number y)''': moves the top left of the rect to point (x, y)&lt;br /&gt;
* '''moveTop(number delta)''': moves the top by delta pixels&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Keys ==&lt;br /&gt;
Here you find a list of commonly used configuration keys to use with the '''writeConfig''' command. Where the documentation notes that a key is in a subgroup, remember to first use '''currentConfigGroup'''.&lt;br /&gt;
&lt;br /&gt;
=== Common configuration keys ===&lt;br /&gt;
Here are some keys that can be used with all widgets:&lt;br /&gt;
&lt;br /&gt;
* '''Share''' (true/false): Whether or not the widget is to be announces throughout the network (Share tab)&lt;br /&gt;
&lt;br /&gt;
=== Common time and date keys ===&lt;br /&gt;
Most of the settings listed below apply to all widgets dealing with date and time (clock, digital-clock, binary-clock, …)&lt;br /&gt;
Settings for individual plasmoids can be found in their respective category and usually only affect the plasmoid’s appearance.&lt;br /&gt;
* '''announceInterval''' (number ≥ 0): Interval in minutes that the time is read out loud&lt;br /&gt;
* '''calendarType''' (local/coptic/ethopian/gregorian/gregorian-proleptic/hebrew/hijri/indian-national/jalali/japanese/julian/minguo/thai): Calendar system to be used, defaults to local&lt;br /&gt;
* '''defaultTimezone''' (Local/…): Time zone to be used&lt;br /&gt;
* '''displayHolidays''' (true/false): Whether holidays are to be displayed&lt;br /&gt;
* '''holidayRegions''' (tbd): tbd&lt;br /&gt;
* '''holidayRegionaDaysOff''' (tbd): tbd&lt;br /&gt;
* '''timeZones''' (Europe/Andorra,…): Comma-separated list of timezones to be used (e. g. Europe/Andorra,Indian/Antananarivo,Asia/Aqtau)&lt;br /&gt;
&lt;br /&gt;
=== Analog clock (clock) ===&lt;br /&gt;
* '''showSecondHand''' (true/false): self-explanatory&lt;br /&gt;
* '''showTimezoneString''' (true/false): self-explanatory&lt;br /&gt;
&lt;br /&gt;
=== Battery status (battery) ===&lt;br /&gt;
* '''showBatteryString''' (true/false): Whether or not battery status is shown as overlay for the battery icon (if in systemtray or panel)&lt;br /&gt;
* '''showMultipleBatteries''' (true/false): Whether or not battery status is shown for each battery separately&lt;br /&gt;
&lt;br /&gt;
=== Digital clock (digital-clock) ===&lt;br /&gt;
* '''plainClockColor''' (rrr,ggg,bbb): Color set for clock font (e. g. 192,0,0 - to be used with useCustomColor=true!)&lt;br /&gt;
* '''plainClockDrawShadow''' (true/false): Whether a shadow is to bed drawn (defaults to true)&lt;br /&gt;
* '''plainClockShadowColor''' (rrr,ggg,bbb): Color set for clock shadow (e. g. 64,97,128 - to be used with useCustomShadowColor=true!)&lt;br /&gt;
* '''plainClockFont''' (tbd): Font to be used for clock (e. g. Serif,12,-1,5,75,0,0,0,0,0)&lt;br /&gt;
* '''showDate''' (true/false): self-explanatory&lt;br /&gt;
* '''showDay''' (true/false): self-explanatory&lt;br /&gt;
* '''showSeconds''' (true/false): self-explanatory&lt;br /&gt;
* '''showTimezone''' (true/false): self-explanatory&lt;br /&gt;
* '''showYear''' (true/false): self-explanatory&lt;br /&gt;
* '''useCustomColor''' (true/false): Whether or not a custom color is to be used (use with plainClockColor=rrr,ggg,bbb!)&lt;br /&gt;
* '''useCustomShadowColor''' (true/false): Whether or not a custom shadow color is to be used (use with plainClockShadowColor=rrr,ggg,bbb!)&lt;br /&gt;
&lt;br /&gt;
=== Folderview (folderview) ===&lt;br /&gt;
* '''alignToGrid''' (true/false): self-explanatory&lt;br /&gt;
* '''customIconSize''' (16/22/24/32/48/…): Use custom icon size for files/folders (use only default/common icon sizes, powers of 2)&lt;br /&gt;
* '''customLabel''': Use custom title rather than default path or place name&lt;br /&gt;
* '''drawShadows''' (true/false): Whether or not file labels are to draw shadows&lt;br /&gt;
* '''filter''' (0/1/2): Defines whether a filter is to be used or not (0 = No filter, 1 = Show only matching files, 2 = Hide matching files)&lt;br /&gt;
* '''filterFiles''': Wildcard filter to filter file names&lt;br /&gt;
* '''mimeFilter''': Comma-separated list of mimetypes to be filtered (shown/hidden depends on filter-setting)&lt;br /&gt;
* '''iconsLocked''' (true/false): Whether or not icons can be moved&lt;br /&gt;
* '''numTextLines''' (number &amp;gt; 0): Amount of lines a file name can have before it is truncated&lt;br /&gt;
* '''url''': Folder URL to be displayed (e. g. desktop:/// or file:///home/yourusername)&lt;br /&gt;
* '''sortColumn''' (-1/0/1/2/3/4/5): The way files and folders are sorted (-1 = No sorting, 0 = By name, 1 = By size, 2 = By type, 3 = By date)&lt;br /&gt;
* '''sortDirsFirst''' (true/false): Whether or not folders are displayed before files (defaults to true)&lt;br /&gt;
* '''textColor''' (rrr,ggg,bbb): Color the icon labels will have&lt;br /&gt;
&lt;br /&gt;
=== Kickoff menu (launcher) ===&lt;br /&gt;
* '''SwitchTabsOnHover''' (true/false): self-explanatory&lt;br /&gt;
* '''ShowAppsByName''' (true/false): Apps are sorted by name rather than by description&lt;br /&gt;
&lt;br /&gt;
=== Pager (pager) ===&lt;br /&gt;
* '''displayedText''' (0/1/2): Text to be shown on individual virtual desktops (0 = Workspace number, 1 = Workspace title, 2 = None)&lt;br /&gt;
* '''ShowWindowIcons''' (true/false): Whether or not the application icon is to be shown on each individual window&lt;br /&gt;
* '''currentDesktopSelected''' (0/1/2): Defines what should happen if the user clicks on the virtual desktop that is currently active (0 = Nothing, 1 = Show Workspace, i. e. minimize windows, 2 = Show Dashboard)&lt;br /&gt;
* '''rows''' (number &amp;gt; 0): Amount of rows the pager should have. (Note: ''This is a global option, so you need to use '''writeGlobalConfig''' instead'')&lt;br /&gt;
&lt;br /&gt;
=== Notifications (notifications) ===&lt;br /&gt;
{{note|This applet is likely to be embedded to system tray. For Systrem Tray specific tasks, i. e. how to add, manage and remove plasmoids inside it, see sections below}}&lt;br /&gt;
* '''AutoHidePopup''' (true/false): Whether or not popups are to be hidden automatiaclly&lt;br /&gt;
* '''ShowJobs''' (true/false): Whether or not jobs are to be shown (e. g. file transfer progress)&lt;br /&gt;
* '''ShowNotifications''' (true/false): Whether or not notifications are to be shown&lt;br /&gt;
&lt;br /&gt;
=== Removable media notifier (notifier) ===&lt;br /&gt;
* '''ShowDevices''' (0/1/2): Defines what kind of devices are to be shown (0 = Removable media only, 1 = Non-removable media only, 2 = All)&lt;br /&gt;
{{note|Auto-mount settings and device actions are not stored in this Plasmoid’s settings.}}&lt;br /&gt;
&lt;br /&gt;
=== Taskbar (tasks) ===&lt;br /&gt;
* '''groupingStrategy''' (0/1/2): Defines how taskbar entries are to be grouped (0 = Never, 1 = Manually, 2 = By Program Name)&lt;br /&gt;
* '''groupWhenFull''' (true/false): Only group when taskbar is full (to be used with groupingStrategy=2 only!)&lt;br /&gt;
* '''highlightWindows''' (true/false): Highlight a window if your mouse cursor is hovering its taskbar entry (requires Desktop Compositing and “Highlight windows” effect enabled to work)&lt;br /&gt;
* '''maxRows''' (number &amp;gt; 0): Amount of rows taskbar entries can take&lt;br /&gt;
* '''forceRows''' (true/false): Force row setting for taskbar entries&lt;br /&gt;
* '''showOnlyCurrentActivity''' (true/false): Show only windows from current activity&lt;br /&gt;
* '''showOnlyCurrentDesktop''' (true/false): Show only windows from current virtual desktop&lt;br /&gt;
* '''showOnlyCurrentScreen''' (true/false): Show only windows from current screen (multi monitor setup)&lt;br /&gt;
* '''showTooltip''' (true/false): Whether or not tooltips are to be shown&lt;br /&gt;
* '''sortingStrategy''' (0/1/2/3): How taskbar entries are to be sorted (0 = Never, 1 = Manually, 2 = Alphabetically, 3 = By Desktop)&lt;br /&gt;
&lt;br /&gt;
=== System Tray ===&lt;br /&gt;
The System Tray has some unique behaviors since it can host widgets and configuring it is not as easy as most other widgets, particularly when adding and removing widgets. This section will help you deal with its specific behavior.&lt;br /&gt;
&lt;br /&gt;
==== Generic System Tray configuration keys ====&lt;br /&gt;
* '''DefaultAppletAdded''' (true/false): Remembers whether the default plasmoids (networkmanagement, device manager, notifications) have already been added(??)&lt;br /&gt;
* '''ShowApplicationStatus''' (true/false): Show system tray icons of applications that belong to the group “Applications”&lt;br /&gt;
* '''ShowCommunications''' (true/false): Show system tray icons of applications that belong to the group “Applications” (i. e. Messenger, IRC chat)&lt;br /&gt;
* '''ShowHardware''' (true/false): Show system tray icons of applications that belong to the group “Hardware” (i. e. volume control, printer applet)&lt;br /&gt;
* '''ShowSystemServices''' (true/false): Show system tray icons of applications that belong to the group “System Services” (i. e. Nepomuk Indexing Agent)&lt;br /&gt;
* '''ShowUnknown''' (true/false): Show system tray icons that do not belong into one of the categories mentioned above (or that do not use KDE’s system tray protocol and thus do not provide such information)&lt;br /&gt;
* '''alwaysShown''': Comma-separated list of widgets and entries that are to be shown all the time (e. g. KMix,notifier)&lt;br /&gt;
* '''hidden''': Comma-separated list of widgets and entries that are to be hidden all the time (e. g. Nepomuk Indexing Agent,Klipper,kmail)&lt;br /&gt;
{{note|Although notifications appear to be part of the System Tray, they are handled by a separate plasmoid which is embedded to the system tray. For its configuration keys, see section above}}&lt;br /&gt;
&lt;br /&gt;
==== Add a widget to systemtray ====&lt;br /&gt;
You can not add widgets to the systemtray in a similar way like you would add them to a panel or containment using addWidget. Instead, to add, manage and remove them, you need to utilize writeConfig changing the currentConfigGroup.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
systray = panel.addWidget(&amp;quot;systemtray&amp;quot;)	// First add a systemtray to your panel&lt;br /&gt;
systray.currentConfigGroup = Array(&amp;quot;Applets&amp;quot;,&amp;quot;0&amp;quot;) // then change the currentConfig Group&lt;br /&gt;
&lt;br /&gt;
// to the subnode [Applets][0]. Use any number you like(?)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can “create” the plasmoid by adding a “plugin” configuration entry&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
systray.writeConfig(&amp;quot;plugin&amp;quot;,&amp;quot;notifier&amp;quot;) // This will add a Device Notifier Plasmoid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can modify the plasmoid’s configuration by using writeConfig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
systray.writeConfig(&amp;quot;property&amp;quot;,&amp;quot;value&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To change back to the top configuration level and thus edit the systemtray plasmoid itself pass an empty array to currentConfigGroup.&lt;br /&gt;
&lt;br /&gt;
==== Edit existing widgets in systemtray ====&lt;br /&gt;
&lt;br /&gt;
==== Remove a widget from systemtray ====&lt;br /&gt;
&lt;br /&gt;
To remove a widget, simply delete the corresponding configuration group.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting</id>
		<title>KDE System Administration/PlasmaDesktopScripting</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting"/>
				<updated>2013-01-28T15:53:17Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Locating Applications and Paths */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ECMA Script Interaction With Plasma Shells ==&lt;br /&gt;
&lt;br /&gt;
It is possible to control and interact with a Plasma user interface shell such as a plasma-desktop or (starting in KDE SC 4.5) plasma-netbook session using ECMA Script (aka JavaScript). This scripting mechanism exposes containments (Desktop Activities and Panels), widgets and various other aspects of plasma-desktop configuration using the widely known and used ECMA Script language. The QtScript engine is used for the runtime environment.&lt;br /&gt;
&lt;br /&gt;
This document describes the API that is provided along with how to&lt;br /&gt;
run such scripts in plasma-desktop.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
A set of examples can be found [https://projects.kde.org/projects/kde/kdeexamples/repository/revisions/master/show/plasma/javascript/plasma-shell-scripting here] that demonstrate the use of various aspects of Plasma shell scripting.&lt;br /&gt;
&lt;br /&gt;
Contributions of additional examples are welcome and an be sent to the Plasma development mailing list (plasma-devel at kde.org) for inclusion if you do not have commit rights to the kdeexamples module.&lt;br /&gt;
&lt;br /&gt;
== Running Scripts ==&lt;br /&gt;
There are three ways that scripts can be executed in plasma-desktop:&lt;br /&gt;
&lt;br /&gt;
* '''on first run''': when plasma-desktop is started without any pre-existing configuration, any scripts in $APPDATA/plasma-desktop/init/ with a &amp;quot;.js&amp;quot; suffix are run. If there is more than one script, they are run sequentially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''on update''': when plasma-desktop is started, it will check in&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
`kde4-config --path data`/plasma-desktop/updates/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
with a &amp;quot;.js&amp;quot; suffix for scripts that have not yet been run. If there is more than one script which has not been run yet they will be executed serially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
A record of which update scripts have been run is kept in the application's config file in the [Updates] group. This means that if the plasma-desktop configuraiton file is removed, all the update scripts will be run again.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''interactively''': an interactive scripting dialog can be requested either via the KRunner window (Alt+F2, by default, or via the &amp;quot;Run Command&amp;quot; entry in various desktop menus) by entering &amp;quot;desktop console&amp;quot; as the search term. It can also be triggered directly via dbus with &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;qdbus org.kde.plasma-desktop /MainApplication showInteractiveConsole&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|This method is not available for plasma-netbook.}}&lt;br /&gt;
&lt;br /&gt;
:ECMA Script may be entered directly into this window for execution and output appears in the lower half of the window. Ctrl+E is a shortcut to run scripts, and scripts can be saved to and loaded from disk.&lt;br /&gt;
&lt;br /&gt;
:Scripts from files can also be loaded using KRunner with &amp;quot;desktop console /path/to/file&amp;quot; or via dbus with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;qdbus org.kde.plasma-desktop /MainApplication loadScriptInInteractiveConsole /path/to/file&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&lt;br /&gt;
Templates are named packages that contain scripts. This provides a way for common functionality to be easily reused, helping to increase consistency and lower maintenance costs. Templates can be loaded from other scripts by name and they are also used to populate some parts of the user interface, such as the entries in the Add Panels menu.&lt;br /&gt;
&lt;br /&gt;
A template is a small set of files in a specified file hierarchy (or, in Plasma terms, a &amp;quot;Package&amp;quot;). In particular, a Template package contains the following files:&lt;br /&gt;
&lt;br /&gt;
* metadata.desktop: a .desktop file describing the template&lt;br /&gt;
* contents/layout.js: a Javascript file containing the actual script&lt;br /&gt;
&lt;br /&gt;
Templates are stored under share/apps/plasma/layout-templates and may be installed using `plasmapkg -t layout-template -i /path/to/package`. Template packages may also be provided as a .zip file with a .plasmalayout suffix.&lt;br /&gt;
&lt;br /&gt;
The metadata.desktop file contains the usual .desktop entries such as Name and Icon but must also contain Type=Service and ServiceTypes=Plasma/LayoutTemplate entries. If the layout is specific to a given Plasma application, such as plasma-desktop, this can be specific using X-Plasma-Shell. X-Plasma-ContainmentCategories defines what kind of layout it is with possible values being panel and desktop. Finally a X-KDE-PluginInfo-Name entry is required to provide a globally unique internal name for the Template. Here is an example of a Template that provides a Panel layout for Plasma Netbook:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Panel&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-netbook&lt;br /&gt;
X-Plasma-ContainmentCategories=panel&lt;br /&gt;
X-KDE-PluginInfo-Author=Aaron Seigo&lt;br /&gt;
X-KDE-PluginInfo-Email=aseigo@kde.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.CoolNetbookPanel&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://plasma.kde.org/&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running a template, two global variables will be accessible in read-only mode: templateName and templateComment. They will contain the Name and Comment fields of the above desktop file, and are translated if a localization is available.&lt;br /&gt;
&lt;br /&gt;
=== Examples of Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Creating panels ====&lt;br /&gt;
A good example of the use of templates is the use case that triggered the creation of this feature: the desire to make it easy for users to re-create the default panel that is created on first start. There is a Template called org.kde.plasma-desktop.defaultPanel that ships with the KDE Plasma Workspace which contains the layout for the initial default panel. This is referenced by the default Plasma Desktop init script and, because it is marked as a Panel Template in the metadata.desktop file it also shows up to the user in the Add Panels menu. When selected by the user from the menu, the exact same panel that is created on desktop start up is created for them, complete with Plasma Widgets and configuration.&lt;br /&gt;
&lt;br /&gt;
==== Automating tasks ====&lt;br /&gt;
Another example of the usefulness of templates is the &amp;quot;Find Widgets&amp;quot; template. This template, which first shipped with Plasma Desktop v4.5, provides a function for finding widgets by name. It appears in the toolbar &amp;quot;Load&amp;quot; and &amp;quot;Use&amp;quot; menus in the Desktop Console in plasma-desktop, and makes finding widgets as simple as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var template = loadTemplate('org.kde.plasma-desktop.findWidgets')&lt;br /&gt;
template.findWidgets('systemtray')&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Activity templates ====&lt;br /&gt;
Probably the most user visible use of templates are &amp;quot;Activity templates&amp;quot;. The structure of Activity templates is similar to the other use of templates, but a few extra features are provided in the metadata.desktop file. Here is an example of such an activity template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Activity Template&lt;br /&gt;
Icon=user-desktop&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-desktop&lt;br /&gt;
X-Plasma-ContainmentCategories=desktop&lt;br /&gt;
X-Plasma-ContainmentLayout-ExecuteOnCreation=dolphin $desktop, gwenview $pictures&lt;br /&gt;
X-Plasma-ContainmentLayout-ShowAsExisting=true&lt;br /&gt;
X-KDE-PluginInfo-Author=John Doe&lt;br /&gt;
X-KDE-PluginInfo-Email=john@doe.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.plasma-desktop.CoolTemplate&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://john.doe.org&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The layout itself is still created from the layout.js file as usual, but this template also shows as a precreated activity to the user thanks to the &amp;lt;tt&amp;gt;X-Plasma-ContainmentLayout-ShowAsExisting&amp;lt;/tt&amp;gt; key. Additionally, it starts applications in the newly created activity using the &amp;lt;tt&amp;gt;X-Plasma-ContainmentLayout-ExecuteOnCreation&amp;lt;/tt&amp;gt; key.&lt;br /&gt;
&lt;br /&gt;
That key is a list of commands to execute, and it supports the following variables:&lt;br /&gt;
* $desktop&lt;br /&gt;
* $autostart&lt;br /&gt;
* $documents&lt;br /&gt;
* $music&lt;br /&gt;
* $video&lt;br /&gt;
* $downloads&lt;br /&gt;
* $pictures&lt;br /&gt;
&lt;br /&gt;
They all expand into the path toward the user corresponding default folder.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
In addition to the normal ECMA Script API and the Qt-specific extensions (such as signal/slot support) provided by QtScript, the following API is provided for use by scripts.&lt;br /&gt;
&lt;br /&gt;
All of the API below, unless otherwise noted with a version noticed, appear as below in the KDE Software Compilation v4.4.0 and later. API that is not noted as being part of a given class or object is part of the global namespace.&lt;br /&gt;
&lt;br /&gt;
{{note|API compatibility is guaranteed from version to version starting with KDE Software Compilation v4.4.0.}}&lt;br /&gt;
&lt;br /&gt;
=== Version Numbers ===&lt;br /&gt;
&lt;br /&gt;
Starting with KDE SC 4.5, the version number of both the scripting API and the application is available to the script via the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''applicationVersion''': the version of the application, e.g. 0.3&lt;br /&gt;
* ''String'' '''platformVersion''': the version of the KDE Platform, e.g. 0.3&lt;br /&gt;
* ''number'' '''scriptingVersion''': the version of the scripting API; e.g. in KDE SC 4.5 this is 2&lt;br /&gt;
&lt;br /&gt;
=== Activities ===&lt;br /&gt;
Activities are the desktop layer in a plasma-desktop session and may contain widgts. In sightly more technical terms, they are desktop containments. Activities can be created, enumerated, modified and destroyed.&lt;br /&gt;
&lt;br /&gt;
New Activities can be created using the Activity constructor, like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var activity = new Activity(&amp;quot;folderview&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file). See the documentation on the Containment object class below.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''activityIds''': returns a list of integer ids of all existing Plasma activities&lt;br /&gt;
* ''Array[String]'' '''knownActivityTypes''':  (scripting version &amp;gt;= 2) a list of types of activities that can be created. This is useful to check if an Activity type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Activity'' '''activityById(number id)''': return an object representing the activity with the given id&lt;br /&gt;
* ''Activity'' '''activityForScreen(number screen[, number dekstop])''': returns an object representing the activity  currently associated with the given screen and, optionally, the given desktop.&lt;br /&gt;
* ''Array[Activity]'' '''activities()''': returns an array of all activities that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Panels ===&lt;br /&gt;
Panels can be created, enumerated, modified and destroyed. A panel object combines both a containment as well as the container itself, allowing for full control of things such as where it appears on screen and the hiding features associated with them.&lt;br /&gt;
&lt;br /&gt;
New Panels can be created using the Panel constructor, like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var panel = new Panel(&amp;quot;dock&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file).&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''panelIds''': returns a list of integer ids of all existing Plasma panels&lt;br /&gt;
* ''Array[String]'' '''knownPanelTypes''':  (scripting version &amp;gt;= 2) a list of types of panels that can be created. This is useful to check if a Panel type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Panel'' '''panelById(int id)''': returns an object representing the Panel that matches the given id&lt;br /&gt;
* ''Array[Panels]'' '''panels()''': returns an array of all panels that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Activities and Panels ===&lt;br /&gt;
Activity and Panel objects, once created by the script, or as returned by activityById, activityForScreen,&lt;br /&gt;
or panelById) provide the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id: the integer id of this activity&lt;br /&gt;
* ''String'' '''formFactor''': returns the form factor of the activity, e.g. &amp;quot;planar&amp;quot; for most desktop activities,&amp;quot;mediacenter&amp;quot; for media centers and either &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; for panels.&lt;br /&gt;
* ''Array[number]'' '''widgetIds''': a list of integer ids of all the widgets in this Activity&lt;br /&gt;
* ''Array[String]'' '''configKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''configGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
&lt;br /&gt;
as well as the following read/write properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''desktop''': the virtual desktop this activity is associated with, or -1 for none&lt;br /&gt;
* ''number'' '''screen''': the screen this activity is associated with, or -1 for none&lt;br /&gt;
* ''String'' '''name''': the name of this activity&lt;br /&gt;
* ''String'' '''wallpaperPlugin''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin to use with the Activity&lt;br /&gt;
* ''String'' '''wallpaperMode''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin mode to use with the Activity&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': (scriptingVersion &amp;gt;= 2) the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this activity and all widgets inside of it&lt;br /&gt;
* ''Widget'' '''widgetById(number id)''': returns an object representing the widget with the given id&lt;br /&gt;
* ''Widget'' '''addWidget(String name)''': adds a new widget to the activity; the name maps to the &amp;lt;tt&amp;gt;X-KDE-PluginInfo-Name=&amp;lt;/tt&amp;gt; entry in the widget's .desktop file&lt;br /&gt;
* ''Widget'' '''addWidget(Widget widget)''': adds an existing widget to this activity; useful for moving widgets between Activities and Panels&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this Activity or Panel on the screen&lt;br /&gt;
* '''readConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the config with default for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the config&lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': (scriptingVersion &amp;gt;= 2) causes the Activity or Panel to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of panels and activities of the same type.&lt;br /&gt;
* ''Array[Widget]'' '''widgets([String type])''': (scriptingVersion &amp;gt;= 2) returns all the widgets in the Panel or Activity. If the optional type is specified, only widgets matching that type will be returned.&lt;br /&gt;
&lt;br /&gt;
In addition to all of the above properties and functions, Panel objects also provide the folowing read/write properties:&lt;br /&gt;
* ''number'' '''length''': the number of pixels along the screen edge used&lt;br /&gt;
* ''number'' '''height''': the height (or for vertical panels, the width) of the panel&lt;br /&gt;
* ''String'' '''hiding''': the hiding mode of the panel, one of &amp;quot;none&amp;quot; (for no hiding), &amp;quot;autohide&amp;quot;, &amp;quot;windowscover&amp;quot; or &amp;quot;windowsbelow&amp;quot;&lt;br /&gt;
* ''String'' '''alignment''': right, left or center alignment of the panel (for vertical panels, right corrsponds to top and left to bottom)&lt;br /&gt;
* ''String'' '''location''': returns the location of the activity (only relevant for Panels); valid values include &amp;quot;top&amp;quot;, &amp;quot;bottom&amp;quot;, &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot; and &amp;quot;floating&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Widgets ===&lt;br /&gt;
Widgets may be enumerated by calling the widgetIds property on a Activity or Panel object. With a widget id in hand, a Widget object can be retrieved by calling widgetById(id) on an Activity or Panel object. New Widgets can be created with add addWidget(String) function provided by Activity and Panel objects.&lt;br /&gt;
&lt;br /&gt;
==== Checking if a widget is installed ====&lt;br /&gt;
A list of all installed widget types can be retrieved the following read-only property:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''knownWidgetTypes''' (scripting version &amp;gt;= 2)&lt;br /&gt;
&lt;br /&gt;
This can be used most conveniently with the indexOf() method, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (knownWidgeTypes.indexOf('someWidgetPluginName') &amp;gt; -1) {&lt;br /&gt;
    print(&amp;quot;It is installed on this system!&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
    print(&amp;quot;It is not installed :(&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Widget Object API ====&lt;br /&gt;
A Widget object provides the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id''': the id of the widget&lt;br /&gt;
* ''String'' '''type''': the plugin type of this widget&lt;br /&gt;
* ''Array[String]'' '''configKeys''': a list of all keys that are set in the current configuration&lt;br /&gt;
* ''Array[String]'' '''configGroups''': a list of all the groups in the current configuration&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
as well as the following read-write properties:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of widgets of the same type.&lt;br /&gt;
* ''QRectF'' '''geometry''': the geometry of the widget (settable)&lt;br /&gt;
* ''String'' '''globalShortcut''': the shortcut sequence (in the format used by QKeySequence, e.g. &amp;quot;Alt+F1&amp;quot;) associated with this widget&lt;br /&gt;
* ''number'' '''index''': the layout index of the widget; in a Panel this corresponds to the order the widget appears in. Changing the value of the index will change the position of the widget in Panels and may do so in some Activities as well.&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this widget&lt;br /&gt;
* '''readConfig(String key, any default)''': reads the value of key in the config with default for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': sets key to value in the config&lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': causes the widget to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this widget on the screen&lt;br /&gt;
&lt;br /&gt;
=== Screen Geometry ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''number'' '''screenCount''': returns the number of screens connected to the computer&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QRectF'' '''screenGeometry(number screen)''': returns a rect object representing the geometry of a screen&lt;br /&gt;
&lt;br /&gt;
=== Wallpaper Plugins ===&lt;br /&gt;
&lt;br /&gt;
* ''Array[String =&amp;gt; Array[String]]'' '''knownWallpaperPlugins()''': (scripting version &amp;gt;= 4) returns a list of all installed wallpaper plugins. The keys of the array are the wallpaper plugin names. The values are arrays containing the modes available for that wallpaper plugin. The mode array may be empty, as most wallpaper plugins only offer one mode.&lt;br /&gt;
&lt;br /&gt;
=== Locating Applications and Paths ===&lt;br /&gt;
* ''boolean'' '''applicationExists(String name)''': (scripting version &amp;gt;= 4) searches $PATH first, then tries in the application menu system by application storage name (aka the .desktop file name), then Name= entries for apps with installed .desktop files, then GenericName= entries for same&lt;br /&gt;
* ''mixed'' '''defaultApplication(String kind [, boolean storageId = false])''': (scripting version &amp;gt;= 4) returns the executable (or if storageId is true, then the app menu system id, e.g. its .desktop file name) of the default app. The &amp;quot;kind&amp;quot; parameter may be a well-known application type including &amp;quot;browser&amp;quot;, &amp;quot;mailer&amp;quot;, &amp;quot;filemanager&amp;quot;, &amp;quot;terminal&amp;quot;, &amp;quot;imClient&amp;quot; and &amp;quot;windowmanager&amp;quot; (or any other entry in share/apps/kcm_componentchooser/kcm_*.desktop); it may also be a mimetype (e.g. &amp;quot;application/pdf&amp;quot;). On failure, it returns false.&lt;br /&gt;
* ''String'' '''applicationPath(String name)''':  (scripting version &amp;gt;= 4) returns the full local path to a given application or .desktop file if it exists. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var desktopfile = &amp;quot;firefox.desktop&amp;quot;&lt;br /&gt;
var executable  = &amp;quot;firefox&amp;quot;&lt;br /&gt;
if (applicationExists(executable)) {  &lt;br /&gt;
    print (executable + &amp;quot; exists &amp;quot; + &amp;quot; with this path:  &amp;quot; + applicationPath(executable))&lt;br /&gt;
    print (executable + &amp;quot; .desktop file is located here :    &amp;quot; + applicationPath(desktopfile))&lt;br /&gt;
} else{&lt;br /&gt;
    print (application + &amp;quot; does not exist &amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''userDataPath([String type, String path])''':  (scripting version &amp;gt;= 4) returns the default path for user data. Called with no parameters, it returns the user's home directory. If only one string is passed in, the standard directory for that type of data in the user's home directory will be located; the following values are recognized:&lt;br /&gt;
** documents&lt;br /&gt;
** music&lt;br /&gt;
** video&lt;br /&gt;
** downloads&lt;br /&gt;
** pictures&lt;br /&gt;
** autostart&lt;br /&gt;
** desktop (should be considered deprecated for Plasma workspaces)&lt;br /&gt;
&lt;br /&gt;
If a second string is passed in, it is considered a request for a specific path and the following types are recognized:&lt;br /&gt;
** apps - Applications menu (.desktop files).&lt;br /&gt;
** autostart - Autostart directories (both XDG and kde-specific)&lt;br /&gt;
** cache - Cached information (e.g. favicons, web-pages)&lt;br /&gt;
** cgi - CGIs to run from kdehelp.&lt;br /&gt;
** config - Configuration files.&lt;br /&gt;
** data - Where applications store data.&lt;br /&gt;
** emoticons - Emoticons themes&lt;br /&gt;
** exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account.&lt;br /&gt;
** html - HTML documentation.&lt;br /&gt;
** icon - Icons, see KIconLoader.&lt;br /&gt;
** kcfg - KConfigXT config files.&lt;br /&gt;
** lib - Libraries.&lt;br /&gt;
** locale - Translation files for KLocale.&lt;br /&gt;
** mime - Mime types defined by KDE-specific .desktop files.&lt;br /&gt;
** module - Module (dynamically loaded library).&lt;br /&gt;
** qtplugins - Qt plugins (dynamically loaded objects for Qt)&lt;br /&gt;
** services - Services.&lt;br /&gt;
** servicetypes - Service types.&lt;br /&gt;
** sound - Application sounds.&lt;br /&gt;
** templates - Templates for the &amp;quot;Create new file&amp;quot; functionality.&lt;br /&gt;
** wallpaper - Wallpapers.&lt;br /&gt;
** tmp - Temporary files (specific for both current host and current user)&lt;br /&gt;
** socket - UNIX Sockets (specific for both current host and current user)&lt;br /&gt;
** xdgconf-menu - Freedesktop.org standard location for menu layout (.menu) files.&lt;br /&gt;
** xdgdata-apps - Freedesktop.org standard location for application desktop files.&lt;br /&gt;
** xdgdata-dirs - Freedesktop.org standard location for menu descriptions (.directory files).&lt;br /&gt;
** xdgdata-mime - Freedesktop.org standard location for MIME type definitions.&lt;br /&gt;
** xdgdata-icon - Freedesktop.org standard location for icons.&lt;br /&gt;
** xdgdata-pixmap - Gnome-compatibility location for pixmaps.&lt;br /&gt;
&lt;br /&gt;
The second parameter should be a specific resource to find the path to. An example might be userDataPath(&amp;quot;data&amp;quot;, &amp;quot;plasma-desktop&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Misc. Global Properties and Functions ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''locked''': whether the desktop shell and widgets are locked or not (settable)&lt;br /&gt;
* ''string'' '''theme''': (scripting version &amp;gt;= 3) the name of the desktop theme to use for the interface, e.g. default, Air, Oxygen, etc.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''hasBattery''': whether or not the system has the ability to run on battery power, e.g. a laptop or mobile device&lt;br /&gt;
* ''boolean'' '''multihead''': (scripting version &amp;gt;= 3) true if the system is running with multiple screens in a &amp;quot;Xaphod&amp;quot; multiple display server configuration&lt;br /&gt;
* ''int'' '''multiheadScreen''': (scripting version &amp;gt;= 3) if multihead is true, contains the (real) screen id of the current screen&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''sleep(number ms)''': sleeps the script for the specified number of millseconds&lt;br /&gt;
&lt;br /&gt;
=== QRectF ===&lt;br /&gt;
A rectangle class is also provided for use with Widget, Panel and screen geometry properties and functions.&lt;br /&gt;
&lt;br /&gt;
Read-only properites:&lt;br /&gt;
* ''boolean'' '''empty''': true if the rectangle's width or height is less than, or equal to, 0; an empty rectangle is also invalid&lt;br /&gt;
* ''boolean'' '''null''': true if the rectangle has both the width and the height set to 0; a null rectangle is also empty and not valid&lt;br /&gt;
* ''boolean'' '''valid''':  true if the rectangle has a width &amp;gt; 0 and height 0.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''left'''&lt;br /&gt;
* ''number'' '''top'''&lt;br /&gt;
* ''number'' '''bottom'''&lt;br /&gt;
* ''number'' '''right'''&lt;br /&gt;
* ''number'' '''height'''&lt;br /&gt;
* ''number'' '''width'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
&lt;br /&gt;
Constructors:&lt;br /&gt;
* '''QRectF'''&lt;br /&gt;
* '''QRectF(number x, number y, number width, number height)''': Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''adjust(number dx1, number dy1, number dx2, number dy2)''': adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle&lt;br /&gt;
* ''QRectF'' '''adjusted(number dx1, number dy1, number dx2, number dy2)''': returns a new QRectF with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of the rectangle&lt;br /&gt;
* '''translate(number dx, number dy)''': translates the rect by dx, dy&lt;br /&gt;
* '''setCoords(number x1, number y1, number x2, number y2)''': sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).&lt;br /&gt;
* '''setRect(number x, number y, number width, number height)''': sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
* ''boolean'' '''contains(number x, number y)''': returns true if the rect contains the point (x, y)&lt;br /&gt;
* '''moveBottom(number delta)'': moves the bottom by delta pixels&lt;br /&gt;
* '''moveLeft(number delta)''': moves the left by delta pixels&lt;br /&gt;
* '''moveRight(number delta)''': moves the right by delta pixels&lt;br /&gt;
* '''moveTo(number x, number y)''': moves the top left of the rect to point (x, y)&lt;br /&gt;
* '''moveTop(number delta)''': moves the top by delta pixels&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Keys ==&lt;br /&gt;
Here you find a list of commonly used configuration keys to use with the '''writeConfig''' command. Where the documentation notes that a key is in a subgroup, remember to first use '''currentConfigGroup'''.&lt;br /&gt;
&lt;br /&gt;
=== Common configuration keys ===&lt;br /&gt;
Here are some keys that can be used with all widgets:&lt;br /&gt;
&lt;br /&gt;
* '''Share''' (true/false): Whether or not the widget is to be announces throughout the network (Share tab)&lt;br /&gt;
&lt;br /&gt;
=== Common time and date keys ===&lt;br /&gt;
Most of the settings listed below apply to all widgets dealing with date and time (clock, digital-clock, binary-clock, …)&lt;br /&gt;
Settings for individual plasmoids can be found in their respective category and usually only affect the plasmoid’s appearance.&lt;br /&gt;
* '''announceInterval''' (number ≥ 0): Interval in minutes that the time is read out loud&lt;br /&gt;
* '''calendarType''' (local/coptic/ethopian/gregorian/gregorian-proleptic/hebrew/hijri/indian-national/jalali/japanese/julian/minguo/thai): Calendar system to be used, defaults to local&lt;br /&gt;
* '''defaultTimezone''' (Local/…): Time zone to be used&lt;br /&gt;
* '''displayHolidays''' (true/false): Whether holidays are to be displayed&lt;br /&gt;
* '''holidayRegions''' (tbd): tbd&lt;br /&gt;
* '''holidayRegionaDaysOff''' (tbd): tbd&lt;br /&gt;
* '''timeZones''' (Europe/Andorra,…): Comma-separated list of timezones to be used (e. g. Europe/Andorra,Indian/Antananarivo,Asia/Aqtau)&lt;br /&gt;
&lt;br /&gt;
=== Analog clock (clock) ===&lt;br /&gt;
* '''showSecondHand''' (true/false): self-explanatory&lt;br /&gt;
* '''showTimezoneString''' (true/false): self-explanatory&lt;br /&gt;
&lt;br /&gt;
=== Battery status (battery) ===&lt;br /&gt;
* '''showBatteryString''' (true/false): Whether or not battery status is shown as overlay for the battery icon (if in systemtray or panel)&lt;br /&gt;
* '''showMultipleBatteries''' (true/false): Whether or not battery status is shown for each battery separately&lt;br /&gt;
&lt;br /&gt;
=== Digital clock (digital-clock) ===&lt;br /&gt;
* '''plainClockColor''' (rrr,ggg,bbb): Color set for clock font (e. g. 192,0,0 - to be used with useCustomColor=true!)&lt;br /&gt;
* '''plainClockDrawShadow''' (true/false): Whether a shadow is to bed drawn (defaults to true)&lt;br /&gt;
* '''plainClockShadowColor''' (rrr,ggg,bbb): Color set for clock shadow (e. g. 64,97,128 - to be used with useCustomShadowColor=true!)&lt;br /&gt;
* '''plainClockFont''' (tbd): Font to be used for clock (e. g. Serif,12,-1,5,75,0,0,0,0,0)&lt;br /&gt;
* '''showDate''' (true/false): self-explanatory&lt;br /&gt;
* '''showDay''' (true/false): self-explanatory&lt;br /&gt;
* '''showSeconds''' (true/false): self-explanatory&lt;br /&gt;
* '''showTimezone''' (true/false): self-explanatory&lt;br /&gt;
* '''showYear''' (true/false): self-explanatory&lt;br /&gt;
* '''useCustomColor''' (true/false): Whether or not a custom color is to be used (use with plainClockColor=rrr,ggg,bbb!)&lt;br /&gt;
* '''useCustomShadowColor''' (true/false): Whether or not a custom shadow color is to be used (use with plainClockShadowColor=rrr,ggg,bbb!)&lt;br /&gt;
&lt;br /&gt;
=== Folderview (folderview) ===&lt;br /&gt;
* '''alignToGrid''' (true/false): self-explanatory&lt;br /&gt;
* '''customIconSize''' (16/22/24/32/48/…): Use custom icon size for files/folders (use only default/common icon sizes, powers of 2)&lt;br /&gt;
* '''customLabel''': Use custom title rather than default path or place name&lt;br /&gt;
* '''drawShadows''' (true/false): Whether or not file labels are to draw shadows&lt;br /&gt;
* '''filter''' (0/1/2): Defines whether a filter is to be used or not (0 = No filter, 1 = Show only matching files, 2 = Hide matching files)&lt;br /&gt;
* '''filterFiles''': Wildcard filter to filter file names&lt;br /&gt;
* '''mimeFilter''': Comma-separated list of mimetypes to be filtered (shown/hidden depends on filter-setting)&lt;br /&gt;
* '''iconsLocked''' (true/false): Whether or not icons can be moved&lt;br /&gt;
* '''numTextLines''' (number &amp;gt; 0): Amount of lines a file name can have before it is truncated&lt;br /&gt;
* '''url''': Folder URL to be displayed (e. g. desktop:/// or file:///home/yourusername)&lt;br /&gt;
* '''sortColumn''' (-1/0/1/2/3/4/5): The way files and folders are sorted (-1 = No sorting, 0 = By name, 1 = By size, 2 = By type, 3 = By date)&lt;br /&gt;
* '''sortDirsFirst''' (true/false): Whether or not folders are displayed before files (defaults to true)&lt;br /&gt;
* '''textColor''' (rrr,ggg,bbb): Color the icon labels will have&lt;br /&gt;
&lt;br /&gt;
=== Kickoff menu (launcher) ===&lt;br /&gt;
* '''SwitchTabsOnHover''' (true/false): self-explanatory&lt;br /&gt;
* '''ShowAppsByName''' (true/false): Apps are sorted by name rather than by description&lt;br /&gt;
&lt;br /&gt;
=== Pager (pager) ===&lt;br /&gt;
* '''displayedText''' (0/1/2): Text to be shown on individual virtual desktops (0 = Workspace number, 1 = Workspace title, 2 = None)&lt;br /&gt;
* '''ShowWindowIcons''' (true/false): Whether or not the application icon is to be shown on each individual window&lt;br /&gt;
* '''currentDesktopSelected''' (0/1/2): Defines what should happen if the user clicks on the virtual desktop that is currently active (0 = Nothing, 1 = Show Workspace, i. e. minimize windows, 2 = Show Dashboard)&lt;br /&gt;
* '''rows''' (number &amp;gt; 0): Amount of rows the pager should have. (Note: ''This is a global option, so you need to use '''writeGlobalConfig''' instead'')&lt;br /&gt;
&lt;br /&gt;
=== Notifications (notifications) ===&lt;br /&gt;
{{note|This applet is likely to be embedded to system tray. For Systrem Tray specific tasks, i. e. how to add, manage and remove plasmoids inside it, see sections below}}&lt;br /&gt;
* '''AutoHidePopup''' (true/false): Whether or not popups are to be hidden automatiaclly&lt;br /&gt;
* '''ShowJobs''' (true/false): Whether or not jobs are to be shown (e. g. file transfer progress)&lt;br /&gt;
* '''ShowNotifications''' (true/false): Whether or not notifications are to be shown&lt;br /&gt;
&lt;br /&gt;
=== Removable media notifier (notifier) ===&lt;br /&gt;
* '''ShowDevices''' (0/1/2): Defines what kind of devices are to be shown (0 = Removable media only, 1 = Non-removable media only, 2 = All)&lt;br /&gt;
{{note|Auto-mount settings and device actions are not stored in this Plasmoid’s settings.}}&lt;br /&gt;
&lt;br /&gt;
=== Taskbar (tasks) ===&lt;br /&gt;
* '''groupingStrategy''' (0/1/2): Defines how taskbar entries are to be grouped (0 = Never, 1 = Manually, 2 = By Program Name)&lt;br /&gt;
* '''groupWhenFull''' (true/false): Only group when taskbar is full (to be used with groupingStrategy=2 only!)&lt;br /&gt;
* '''highlightWindows''' (true/false): Highlight a window if your mouse cursor is hovering its taskbar entry (requires Desktop Compositing and “Highlight windows” effect enabled to work)&lt;br /&gt;
* '''maxRows''' (number &amp;gt; 0): Amount of rows taskbar entries can take&lt;br /&gt;
* '''forceRows''' (true/false): Force row setting for taskbar entries&lt;br /&gt;
* '''showOnlyCurrentActivity''' (true/false): Show only windows from current activity&lt;br /&gt;
* '''showOnlyCurrentDesktop''' (true/false): Show only windows from current virtual desktop&lt;br /&gt;
* '''showOnlyCurrentScreen''' (true/false): Show only windows from current screen (multi monitor setup)&lt;br /&gt;
* '''showTooltip''' (true/false): Whether or not tooltips are to be shown&lt;br /&gt;
* '''sortingStrategy''' (0/1/2/3): How taskbar entries are to be sorted (0 = Never, 1 = Manually, 2 = Alphabetically, 3 = By Desktop)&lt;br /&gt;
&lt;br /&gt;
=== System Tray ===&lt;br /&gt;
The System Tray has some unique behaviors since it can host widgets and configuring it is not as easy as most other widgets, particularly when adding and removing widgets. This section will help you deal with its specific behavior.&lt;br /&gt;
&lt;br /&gt;
==== Generic System Tray configuration keys ====&lt;br /&gt;
* '''DefaultAppletAdded''' (true/false): Remembers whether the default plasmoids (networkmanagement, device manager, notifications) have already been added(??)&lt;br /&gt;
* '''ShowApplicationStatus''' (true/false): Show system tray icons of applications that belong to the group “Applications”&lt;br /&gt;
* '''ShowCommunications''' (true/false): Show system tray icons of applications that belong to the group “Applications” (i. e. Messenger, IRC chat)&lt;br /&gt;
* '''ShowHardware''' (true/false): Show system tray icons of applications that belong to the group “Hardware” (i. e. volume control, printer applet)&lt;br /&gt;
* '''ShowSystemServices''' (true/false): Show system tray icons of applications that belong to the group “System Services” (i. e. Nepomuk Indexing Agent)&lt;br /&gt;
* '''ShowUnknown''' (true/false): Show system tray icons that do not belong into one of the categories mentioned above (or that do not use KDE’s system tray protocol and thus do not provide such information)&lt;br /&gt;
* '''alwaysShown''': Comma-separated list of widgets and entries that are to be shown all the time (e. g. KMix,notifier)&lt;br /&gt;
* '''hidden''': Comma-separated list of widgets and entries that are to be hidden all the time (e. g. Nepomuk Indexing Agent,Klipper,kmail)&lt;br /&gt;
{{note|Although notifications appear to be part of the System Tray, they are handled by a separate plasmoid which is embedded to the system tray. For its configuration keys, see section above}}&lt;br /&gt;
&lt;br /&gt;
==== Add a widget to systemtray ====&lt;br /&gt;
You can not add widgets to the systemtray in a similar way like you would add them to a panel or containment using addWidget. Instead, to add, manage and remove them, you need to utilize writeConfig changing the currentConfigGroup.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
systray = panel.addWidget(&amp;quot;systemtray&amp;quot;)	// First add a systemtray to your panel&lt;br /&gt;
systray.currentConfigGroup = Array(&amp;quot;Applets&amp;quot;,&amp;quot;0&amp;quot;) // then change the currentConfig Group&lt;br /&gt;
&lt;br /&gt;
// to the subnode [Applets][0]. Use any number you like(?)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can “create” the plasmoid by adding a “plugin” configuration entry&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
systray.writeConfig(&amp;quot;plugin&amp;quot;,&amp;quot;notifier&amp;quot;) // This will add a Device Notifier Plasmoid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can modify the plasmoid’s configuration by using writeConfig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
systray.writeConfig(&amp;quot;property&amp;quot;,&amp;quot;value&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To change back to the top configuration level and thus edit the systemtray plasmoid itself pass an empty array to currentConfigGroup.&lt;br /&gt;
&lt;br /&gt;
==== Edit existing widgets in systemtray ====&lt;br /&gt;
&lt;br /&gt;
==== Remove a widget from systemtray ====&lt;br /&gt;
&lt;br /&gt;
To remove a widget, simply delete the corresponding configuration group.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting</id>
		<title>KDE System Administration/PlasmaDesktopScripting</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting"/>
				<updated>2012-10-01T12:18:30Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Widgets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ECMA Script Interaction With Plasma Shells ==&lt;br /&gt;
&lt;br /&gt;
It is possible to control and interact with a Plasma user interface shell such as a plasma-desktop or (starting in KDE SC 4.5) plasma-netbook session using ECMA Script (aka JavaScript). This scripting mechanism exposes containments (Desktop Activities and Panels), widgets and various other aspects of plasma-desktop configuration using the widely known and used ECMA Script language. The QtScript engine is used for the runtime environment.&lt;br /&gt;
&lt;br /&gt;
This document describes the API that is provided along with how to&lt;br /&gt;
run such scripts in plasma-desktop.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
A set of examples can be found [https://projects.kde.org/projects/kde/kdeexamples/repository/revisions/master/show/plasma/javascript/plasma-shell-scripting here] that demonstrate the use of various aspects of Plasma shell scripting.&lt;br /&gt;
&lt;br /&gt;
Contributions of additional examples are welcome and an be sent to the Plasma development mailing list (plasma-devel at kde.org) for inclusion if you do not have commit rights to the kdeexamples module.&lt;br /&gt;
&lt;br /&gt;
== Running Scripts ==&lt;br /&gt;
There are three ways that scripts can be executed in plasma-desktop:&lt;br /&gt;
&lt;br /&gt;
* '''on first run''': when plasma-desktop is started without any pre-existing configuration, any scripts in $APPDATA/plasma-desktop/init/ with a &amp;quot;.js&amp;quot; suffix are run. If there is more than one script, they are run sequentially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''on update''': when plasma-desktop is started, it will check in&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
`kde4-config --path data`/plasma-desktop/updates/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
with a &amp;quot;.js&amp;quot; suffix for scripts that have not yet been run. If there is more than one script which has not been run yet they will be executed serially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
A record of which update scripts have been run is kept in the application's config file in the [Updates] group. This means that if the plasma-desktop configuraiton file is removed, all the update scripts will be run again.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''interactively''': an interactive scripting dialog can be requested either via the KRunner window (Alt+F2, by default, or via the &amp;quot;Run Command&amp;quot; entry in various desktop menus) by entering &amp;quot;desktop console&amp;quot; as the search term. It can also be triggered directly via dbus with &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;qdbus org.kde.plasma-desktop /MainApplication showInteractiveConsole&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|This method is not available for plasma-netbook.}}&lt;br /&gt;
&lt;br /&gt;
:ECMA Script may be entered directly into this window for execution and output appears in the lower half of the window. Ctrl+E is a shortcut to run scripts, and scripts can be saved to and loaded from disk.&lt;br /&gt;
&lt;br /&gt;
:Scripts from files can also be loaded using KRunner with &amp;quot;desktop console /path/to/file&amp;quot; or via dbus with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;qdbus org.kde.plasma-desktop /MainApplication loadScriptInInteractiveConsole /path/to/file&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&lt;br /&gt;
Templates are named packages that contain scripts. This provides a way for common functionality to be easily reused, helping to increase consistency and lower maintenance costs. Templates can be loaded from other scripts by name and they are also used to populate some parts of the user interface, such as the entries in the Add Panels menu.&lt;br /&gt;
&lt;br /&gt;
A template is a small set of files in a specified file hierarchy (or, in Plasma terms, a &amp;quot;Package&amp;quot;). In particular, a Template package contains the following files:&lt;br /&gt;
&lt;br /&gt;
* metadata.desktop: a .desktop file describing the template&lt;br /&gt;
* contents/layout.js: a Javascript file containing the actual script&lt;br /&gt;
&lt;br /&gt;
Templates are stored under share/apps/plasma/layout-templates and may be installed using `plasmapkg -t layout-template -i /path/to/package`. Template packages may also be provided as a .zip file with a .plasmalayout suffix.&lt;br /&gt;
&lt;br /&gt;
The metadata.desktop file contains the usual .desktop entries such as Name and Icon but must also contain Type=Service and ServiceTypes=Plasma/LayoutTemplate entries. If the layout is specific to a given Plasma application, such as plasma-desktop, this can be specific using X-Plasma-Shell. X-Plasma-ContainmentCategories defines what kind of layout it is with possible values being panel and desktop. Finally a X-KDE-PluginInfo-Name entry is required to provide a globally unique internal name for the Template. Here is an example of a Template that provides a Panel layout for Plasma Netbook:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Panel&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-netbook&lt;br /&gt;
X-Plasma-ContainmentCategories=panel&lt;br /&gt;
X-KDE-PluginInfo-Author=Aaron Seigo&lt;br /&gt;
X-KDE-PluginInfo-Email=aseigo@kde.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.CoolNetbookPanel&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://plasma.kde.org/&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running a template, two global variables will be accessible in read-only mode: templateName and templateComment. They will contain the Name and Comment fields of the above desktop file, and are translated if a localization is available.&lt;br /&gt;
&lt;br /&gt;
=== Examples of Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Creating panels ====&lt;br /&gt;
A good example of the use of templates is the use case that triggered the creation of this feature: the desire to make it easy for users to re-create the default panel that is created on first start. There is a Template called org.kde.plasma-desktop.defaultPanel that ships with the KDE Plasma Workspace which contains the layout for the initial default panel. This is referenced by the default Plasma Desktop init script and, because it is marked as a Panel Template in the metadata.desktop file it also shows up to the user in the Add Panels menu. When selected by the user from the menu, the exact same panel that is created on desktop start up is created for them, complete with Plasma Widgets and configuration.&lt;br /&gt;
&lt;br /&gt;
==== Automating tasks ====&lt;br /&gt;
Another example of the usefulness of templates is the &amp;quot;Find Widgets&amp;quot; template. This template, which first shipped with Plasma Desktop v4.5, provides a function for finding widgets by name. It appears in the toolbar &amp;quot;Load&amp;quot; and &amp;quot;Use&amp;quot; menus in the Desktop Console in plasma-desktop, and makes finding widgets as simple as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var template = loadTemplate('org.kde.plasma-desktop.findWidgets')&lt;br /&gt;
template.findWidgets('systemtray')&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Activity templates ====&lt;br /&gt;
Probably the most user visible use of templates are &amp;quot;Activity templates&amp;quot;. The structure of Activity templates is similar to the other use of templates, but a few extra features are provided in the metadata.desktop file. Here is an example of such an activity template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Activity Template&lt;br /&gt;
Icon=user-desktop&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-desktop&lt;br /&gt;
X-Plasma-ContainmentCategories=desktop&lt;br /&gt;
X-Plasma-ContainmentLayout-ExecuteOnCreation=dolphin $desktop, gwenview $pictures&lt;br /&gt;
X-Plasma-ContainmentLayout-ShowAsExisting=true&lt;br /&gt;
X-KDE-PluginInfo-Author=John Doe&lt;br /&gt;
X-KDE-PluginInfo-Email=john@doe.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.plasma-desktop.CoolTemplate&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://john.doe.org&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The layout itself is still created from the layout.js file as usual, but this template also shows as a precreated activity to the user thanks to the &amp;lt;tt&amp;gt;X-Plasma-ContainmentLayout-ShowAsExisting&amp;lt;/tt&amp;gt; key. Additionally, it starts applications in the newly created activity using the &amp;lt;tt&amp;gt;X-Plasma-ContainmentLayout-ExecuteOnCreation&amp;lt;/tt&amp;gt; key.&lt;br /&gt;
&lt;br /&gt;
That key is a list of commands to execute, and it supports the following variables:&lt;br /&gt;
* $desktop&lt;br /&gt;
* $autostart&lt;br /&gt;
* $documents&lt;br /&gt;
* $music&lt;br /&gt;
* $video&lt;br /&gt;
* $downloads&lt;br /&gt;
* $pictures&lt;br /&gt;
&lt;br /&gt;
They all expand into the path toward the user corresponding default folder.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
In addition to the normal ECMA Script API and the Qt-specific extensions (such as signal/slot support) provided by QtScript, the following API is provided for use by scripts.&lt;br /&gt;
&lt;br /&gt;
All of the API below, unless otherwise noted with a version noticed, appear as below in the KDE Software Compilation v4.4.0 and later. API that is not noted as being part of a given class or object is part of the global namespace.&lt;br /&gt;
&lt;br /&gt;
{{note|API compatibility is guaranteed from version to version starting with KDE Software Compilation v4.4.0.}}&lt;br /&gt;
&lt;br /&gt;
=== Version Numbers ===&lt;br /&gt;
&lt;br /&gt;
Starting with KDE SC 4.5, the version number of both the scripting API and the application is available to the script via the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''applicationVersion''': the version of the application, e.g. 0.3&lt;br /&gt;
* ''String'' '''platformVersion''': the version of the KDE Platform, e.g. 0.3&lt;br /&gt;
* ''number'' '''scriptingVersion''': the version of the scripting API; e.g. in KDE SC 4.5 this is 2&lt;br /&gt;
&lt;br /&gt;
=== Activities ===&lt;br /&gt;
Activities are the desktop layer in a plasma-desktop session and may contain widgts. In sightly more technical terms, they are desktop containments. Activities can be created, enumerated, modified and destroyed.&lt;br /&gt;
&lt;br /&gt;
New Activities can be created using the Activity constructor, like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var activity = new Activity(&amp;quot;folderview&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file). See the documentation on the Containment object class below.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''activityIds''': returns a list of integer ids of all existing Plasma activities&lt;br /&gt;
* ''Array[String]'' '''knownActivityTypes''':  (scripting version &amp;gt;= 2) a list of types of activities that can be created. This is useful to check if an Activity type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Activity'' '''activityById(number id)''': return an object representing the activity with the given id&lt;br /&gt;
* ''Activity'' '''activityForScreen(number screen[, number dekstop])''': returns an object representing the activity  currently associated with the given screen and, optionally, the given desktop.&lt;br /&gt;
* ''Array[Activity]'' '''activities()''': returns an array of all activities that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Panels ===&lt;br /&gt;
Panels can be created, enumerated, modified and destroyed. A panel object combines both a containment as well as the container itself, allowing for full control of things such as where it appears on screen and the hiding features associated with them.&lt;br /&gt;
&lt;br /&gt;
New Panels can be created using the Panel constructor, like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var panel = new Panel(&amp;quot;dock&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file).&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''panelIds''': returns a list of integer ids of all existing Plasma panels&lt;br /&gt;
* ''Array[String]'' '''knownPanelTypes''':  (scripting version &amp;gt;= 2) a list of types of panels that can be created. This is useful to check if a Panel type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Panel'' '''panelById(int id)''': returns an object representing the Panel that matches the given id&lt;br /&gt;
* ''Array[Panels]'' '''panels()''': returns an array of all panels that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Activities and Panels ===&lt;br /&gt;
Activity and Panel objects, once created by the script, or as returned by activityById, activityForScreen,&lt;br /&gt;
or panelById) provide the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id: the integer id of this activity&lt;br /&gt;
* ''String'' '''formFactor''': returns the form factor of the activity, e.g. &amp;quot;planar&amp;quot; for most desktop activities,&amp;quot;mediacenter&amp;quot; for media centers and either &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; for panels.&lt;br /&gt;
* ''Array[number]'' '''widgetIds''': a list of integer ids of all the widgets in this Activity&lt;br /&gt;
* ''Array[String]'' '''configKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''configGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
&lt;br /&gt;
as well as the following read/write properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''desktop''': the virtual desktop this activity is associated with, or -1 for none&lt;br /&gt;
* ''number'' '''screen''': the screen this activity is associated with, or -1 for none&lt;br /&gt;
* ''String'' '''name''': the name of this activity&lt;br /&gt;
* ''String'' '''wallpaperPlugin''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin to use with the Activity&lt;br /&gt;
* ''String'' '''wallpaperMode''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin mode to use with the Activity&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': (scriptingVersion &amp;gt;= 2) the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this activity and all widgets inside of it&lt;br /&gt;
* ''Widget'' '''widgetById(number id)''': returns an object representing the widget with the given id&lt;br /&gt;
* ''Widget'' '''addWidget(String name)''': adds a new widget to the activity; the name maps to the &amp;lt;tt&amp;gt;X-KDE-PluginInfo-Name=&amp;lt;/tt&amp;gt; entry in the widget's .desktop file&lt;br /&gt;
* ''Widget'' '''addWidget(Widget widget)''': adds an existing widget to this activity; useful for moving widgets between Activities and Panels&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this Activity or Panel on the screen&lt;br /&gt;
* '''readConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the config with default for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the config&lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': (scriptingVersion &amp;gt;= 2) causes the Activity or Panel to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of panels and activities of the same type.&lt;br /&gt;
* ''Array[Widget]'' '''widgets([String type])''': (scriptingVersion &amp;gt;= 2) returns all the widgets in the Panel or Activity. If the optional type is specified, only widgets matching that type will be returned.&lt;br /&gt;
&lt;br /&gt;
In addition to all of the above properties and functions, Panel objects also provide the folowing read/write properties:&lt;br /&gt;
* ''number'' '''length''': the number of pixels along the screen edge used&lt;br /&gt;
* ''number'' '''height''': the height (or for vertical panels, the width) of the panel&lt;br /&gt;
* ''String'' '''hiding''': the hiding mode of the panel, one of &amp;quot;none&amp;quot; (for no hiding), &amp;quot;autohide&amp;quot;, &amp;quot;windowscover&amp;quot; or &amp;quot;windowsbelow&amp;quot;&lt;br /&gt;
* ''String'' '''alignment''': right, left or center alignment of the panel (for vertical panels, right corrsponds to top and left to bottom)&lt;br /&gt;
* ''String'' '''location''': returns the location of the activity (only relevant for Panels); valid values include &amp;quot;top&amp;quot;, &amp;quot;bottom&amp;quot;, &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot; and &amp;quot;floating&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Widgets ===&lt;br /&gt;
Widgets may be enumerated by calling the widgetIds property on a Activity or Panel object. With a widget id in hand, a Widget object can be retrieved by calling widgetById(id) on an Activity or Panel object. New Widgets can be created with add addWidget(String) function provided by Activity and Panel objects.&lt;br /&gt;
&lt;br /&gt;
==== Checking if a widget is installed ====&lt;br /&gt;
A list of all installed widget types can be retrieved the following read-only property:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''knownWidgetTypes''' (scripting version &amp;gt;= 2)&lt;br /&gt;
&lt;br /&gt;
This can be used most conveniently with the indexOf() method, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (knownWidgeTypes.indexOf('someWidgetPluginName') &amp;gt; -1) {&lt;br /&gt;
    print(&amp;quot;It is installed on this system!&amp;quot;);&lt;br /&gt;
} else {&lt;br /&gt;
    print(&amp;quot;It is not installed :(&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Widget Object API ====&lt;br /&gt;
A Widget object provides the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id''': the id of the widget&lt;br /&gt;
* ''String'' '''type''': the plugin type of this widget&lt;br /&gt;
* ''Array[String]'' '''configKeys''': a list of all keys that are set in the current configuration&lt;br /&gt;
* ''Array[String]'' '''configGroups''': a list of all the groups in the current configuration&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
as well as the following read-write properties:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of widgets of the same type.&lt;br /&gt;
* ''QRectF'' '''geometry''': the geometry of the widget (settable)&lt;br /&gt;
* ''String'' '''globalShortcut''': the shortcut sequence (in the format used by QKeySequence, e.g. &amp;quot;Alt+F1&amp;quot;) associated with this widget&lt;br /&gt;
* ''number'' '''index''': the layout index of the widget; in a Panel this corresponds to the order the widget appears in. Changing the value of the index will change the position of the widget in Panels and may do so in some Activities as well.&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this widget&lt;br /&gt;
* '''readConfig(String key, any default)''': reads the value of key in the config with default for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': sets key to value in the config&lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': causes the widget to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this widget on the screen&lt;br /&gt;
&lt;br /&gt;
=== Screen Geometry ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''number'' '''screenCount''': returns the number of screens connected to the computer&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QRectF'' '''screenGeometry(number screen)''': returns a rect object representing the geometry of a screen&lt;br /&gt;
&lt;br /&gt;
=== Wallpaper Plugins ===&lt;br /&gt;
&lt;br /&gt;
* ''Array[String =&amp;gt; Array[String]]'' '''knownWallpaperPlugins()''': (scripting version &amp;gt;= 4) returns a list of all installed wallpaper plugins. The keys of the array are the wallpaper plugin names. The values are arrays containing the modes available for that wallpaper plugin. The mode array may be empty, as most wallpaper plugins only offer one mode.&lt;br /&gt;
&lt;br /&gt;
=== Locating Applications and Paths ===&lt;br /&gt;
* ''boolean'' '''applicationExists(String name)''': (scripting version &amp;gt;= 4) searches $PATH first, then tries in the application menu system by application storage name (aka the .desktop file name), then Name= entries for apps with installed .desktop files, then GenericName= entries for same&lt;br /&gt;
* ''mixed'' '''defaultApplication(String kind [, boolean storageId = false])''': (scripting version &amp;gt;= 4) returns the executable (or if storageId is true, then the app menu system id, e.g. its .desktop file name) of the default app. The &amp;quot;kind&amp;quot; parameter may be a well-known application type including &amp;quot;browser&amp;quot;, &amp;quot;mailer&amp;quot;, &amp;quot;filemanager&amp;quot;, &amp;quot;terminal&amp;quot;, &amp;quot;imClient&amp;quot; and &amp;quot;windowmanager&amp;quot; (or any other entry in share/apps/kcm_componentchooser/kcm_*.desktop); it may also be a mimetype (e.g. &amp;quot;application/pdf&amp;quot;). On failure, it returns false.&lt;br /&gt;
* ''String'' '''applicationPath(String name)''':  (scripting version &amp;gt;= 4) returns the full local path to a given application or .desktop file if it exists.&lt;br /&gt;
* ''String'' '''userDataPath([String type, String path])''':  (scripting version &amp;gt;= 4) returns the default path for user data. Called with no parameters, it returns the user's home directory. If only one string is passed in, the standard directory for that type of data in the user's home directory will be located; the following values are recognized:&lt;br /&gt;
** documents&lt;br /&gt;
** music&lt;br /&gt;
** video&lt;br /&gt;
** downloads&lt;br /&gt;
** pictures&lt;br /&gt;
** autostart&lt;br /&gt;
** desktop (should be considered deprecated for Plasma workspaces)&lt;br /&gt;
&lt;br /&gt;
If a second string is passed in, it is considered a request for a specific path and the following types are recognized:&lt;br /&gt;
** apps - Applications menu (.desktop files).&lt;br /&gt;
** autostart - Autostart directories (both XDG and kde-specific)&lt;br /&gt;
** cache - Cached information (e.g. favicons, web-pages)&lt;br /&gt;
** cgi - CGIs to run from kdehelp.&lt;br /&gt;
** config - Configuration files.&lt;br /&gt;
** data - Where applications store data.&lt;br /&gt;
** emoticons - Emoticons themes&lt;br /&gt;
** exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account.&lt;br /&gt;
** html - HTML documentation.&lt;br /&gt;
** icon - Icons, see KIconLoader.&lt;br /&gt;
** kcfg - KConfigXT config files.&lt;br /&gt;
** lib - Libraries.&lt;br /&gt;
** locale - Translation files for KLocale.&lt;br /&gt;
** mime - Mime types defined by KDE-specific .desktop files.&lt;br /&gt;
** module - Module (dynamically loaded library).&lt;br /&gt;
** qtplugins - Qt plugins (dynamically loaded objects for Qt)&lt;br /&gt;
** services - Services.&lt;br /&gt;
** servicetypes - Service types.&lt;br /&gt;
** sound - Application sounds.&lt;br /&gt;
** templates - Templates for the &amp;quot;Create new file&amp;quot; functionality.&lt;br /&gt;
** wallpaper - Wallpapers.&lt;br /&gt;
** tmp - Temporary files (specific for both current host and current user)&lt;br /&gt;
** socket - UNIX Sockets (specific for both current host and current user)&lt;br /&gt;
** xdgconf-menu - Freedesktop.org standard location for menu layout (.menu) files.&lt;br /&gt;
** xdgdata-apps - Freedesktop.org standard location for application desktop files.&lt;br /&gt;
** xdgdata-dirs - Freedesktop.org standard location for menu descriptions (.directory files).&lt;br /&gt;
** xdgdata-mime - Freedesktop.org standard location for MIME type definitions.&lt;br /&gt;
** xdgdata-icon - Freedesktop.org standard location for icons.&lt;br /&gt;
** xdgdata-pixmap - Gnome-compatibility location for pixmaps.&lt;br /&gt;
&lt;br /&gt;
The second parameter should be a specific resource to find the path to. An example might be userDataPath(&amp;quot;data&amp;quot;, &amp;quot;plasma-desktop&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Misc. Global Properties and Functions ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''locked''': whether the desktop shell and widgets are locked or not (settable)&lt;br /&gt;
* ''string'' '''theme''': (scripting version &amp;gt;= 3) the name of the desktop theme to use for the interface, e.g. default, Air, Oxygen, etc.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''hasBattery''': whether or not the system has the ability to run on battery power, e.g. a laptop or mobile device&lt;br /&gt;
* ''boolean'' '''multihead''': (scripting version &amp;gt;= 3) true if the system is running with multiple screens in a &amp;quot;Xaphod&amp;quot; multiple display server configuration&lt;br /&gt;
* ''int'' '''multiheadScreen''': (scripting version &amp;gt;= 3) if multihead is true, contains the (real) screen id of the current screen&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''sleep(number ms)''': sleeps the script for the specified number of millseconds&lt;br /&gt;
&lt;br /&gt;
=== QRectF ===&lt;br /&gt;
A rectangle class is also provided for use with Widget, Panel and screen geometry properties and functions.&lt;br /&gt;
&lt;br /&gt;
Read-only properites:&lt;br /&gt;
* ''boolean'' '''empty''': true if the rectangle's width or height is less than, or equal to, 0; an empty rectangle is also invalid&lt;br /&gt;
* ''boolean'' '''null''': true if the rectangle has both the width and the height set to 0; a null rectangle is also empty and not valid&lt;br /&gt;
* ''boolean'' '''valid''':  true if the rectangle has a width &amp;gt; 0 and height 0.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''left'''&lt;br /&gt;
* ''number'' '''top'''&lt;br /&gt;
* ''number'' '''bottom'''&lt;br /&gt;
* ''number'' '''right'''&lt;br /&gt;
* ''number'' '''height'''&lt;br /&gt;
* ''number'' '''width'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
&lt;br /&gt;
Constructors:&lt;br /&gt;
* '''QRectF'''&lt;br /&gt;
* '''QRectF(number x, number y, number width, number height)''': Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''adjust(number dx1, number dy1, number dx2, number dy2)''': adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle&lt;br /&gt;
* ''QRectF'' '''adjusted(number dx1, number dy1, number dx2, number dy2)''': returns a new QRectF with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of the rectangle&lt;br /&gt;
* '''translate(number dx, number dy)''': translates the rect by dx, dy&lt;br /&gt;
* '''setCoords(number x1, number y1, number x2, number y2)''': sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).&lt;br /&gt;
* '''setRect(number x, number y, number width, number height)''': sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
* ''boolean'' '''contains(number x, number y)''': returns true if the rect contains the point (x, y)&lt;br /&gt;
* '''moveBottom(number delta)'': moves the bottom by delta pixels&lt;br /&gt;
* '''moveLeft(number delta)''': moves the left by delta pixels&lt;br /&gt;
* '''moveRight(number delta)''': moves the right by delta pixels&lt;br /&gt;
* '''moveTo(number x, number y)''': moves the top left of the rect to point (x, y)&lt;br /&gt;
* '''moveTop(number delta)''': moves the top by delta pixels&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Keys ==&lt;br /&gt;
Here you find a list of commonly used configuration keys to use with the '''writeConfig''' command. Where the documentation notes that a key is in a subgroup, remember to first use '''currentConfigGroup'''.&lt;br /&gt;
&lt;br /&gt;
=== Common configuration keys ===&lt;br /&gt;
Here are some keys that can be used with all widgets:&lt;br /&gt;
&lt;br /&gt;
* '''Share''' (true/false): Whether or not the widget is to be announces throughout the network (Share tab)&lt;br /&gt;
&lt;br /&gt;
=== Common time and date keys ===&lt;br /&gt;
Most of the settings listed below apply to all widgets dealing with date and time (clock, digital-clock, binary-clock, …)&lt;br /&gt;
Settings for individual plasmoids can be found in their respective category and usually only affect the plasmoid’s appearance.&lt;br /&gt;
* '''announceInterval''' (number ≥ 0): Interval in minutes that the time is read out loud&lt;br /&gt;
* '''calendarType''' (local/coptic/ethopian/gregorian/gregorian-proleptic/hebrew/hijri/indian-national/jalali/japanese/julian/minguo/thai): Calendar system to be used, defaults to local&lt;br /&gt;
* '''defaultTimezone''' (Local/…): Time zone to be used&lt;br /&gt;
* '''displayHolidays''' (true/false): Whether holidays are to be displayed&lt;br /&gt;
* '''holidayRegions''' (tbd): tbd&lt;br /&gt;
* '''holidayRegionaDaysOff''' (tbd): tbd&lt;br /&gt;
* '''timeZones''' (Europe/Andorra,…): Comma-separated list of timezones to be used (e. g. Europe/Andorra,Indian/Antananarivo,Asia/Aqtau)&lt;br /&gt;
&lt;br /&gt;
=== Analog clock (clock) ===&lt;br /&gt;
* '''showSecondHand''' (true/false): self-explanatory&lt;br /&gt;
* '''showTimezoneString''' (true/false): self-explanatory&lt;br /&gt;
&lt;br /&gt;
=== Battery status (battery) ===&lt;br /&gt;
* '''showBatteryString''' (true/false): Whether or not battery status is shown as overlay for the battery icon (if in systemtray or panel)&lt;br /&gt;
* '''showMultipleBatteries''' (true/false): Whether or not battery status is shown for each battery separately&lt;br /&gt;
&lt;br /&gt;
=== Digital clock (digital-clock) ===&lt;br /&gt;
* '''plainClockColor''' (rrr,ggg,bbb): Color set for clock font (e. g. 192,0,0 - to be used with useCustomColor=true!)&lt;br /&gt;
* '''plainClockDrawShadow''' (true/false): Whether a shadow is to bed drawn (defaults to true)&lt;br /&gt;
* '''plainClockShadowColor''' (rrr,ggg,bbb): Color set for clock shadow (e. g. 64,97,128 - to be used with useCustomShadowColor=true!)&lt;br /&gt;
* '''plainClockFont''' (tbd): Font to be used for clock (e. g. Serif,12,-1,5,75,0,0,0,0,0)&lt;br /&gt;
* '''showDate''' (true/false): self-explanatory&lt;br /&gt;
* '''showDay''' (true/false): self-explanatory&lt;br /&gt;
* '''showSeconds''' (true/false): self-explanatory&lt;br /&gt;
* '''showTimezone''' (true/false): self-explanatory&lt;br /&gt;
* '''showYear''' (true/false): self-explanatory&lt;br /&gt;
* '''useCustomColor''' (true/false): Whether or not a custom color is to be used (use with plainClockColor=rrr,ggg,bbb!)&lt;br /&gt;
* '''useCustomShadowColor''' (true/false): Whether or not a custom shadow color is to be used (use with plainClockShadowColor=rrr,ggg,bbb!)&lt;br /&gt;
&lt;br /&gt;
=== Folderview (folderview) ===&lt;br /&gt;
* '''alignToGrid''' (true/false): self-explanatory&lt;br /&gt;
* '''customIconSize''' (16/22/24/32/48/…): Use custom icon size for files/folders (use only default/common icon sizes, powers of 2)&lt;br /&gt;
* '''customLabel''': Use custom title rather than default path or place name&lt;br /&gt;
* '''drawShadows''' (true/false): Whether or not file labels are to draw shadows&lt;br /&gt;
* '''filter''' (0/1/2): Defines whether a filter is to be used or not (0 = No filter, 1 = Show only matching files, 2 = Hide matching files)&lt;br /&gt;
* '''filterFiles''': Wildcard filter to filter file names&lt;br /&gt;
* '''mimeFilter''': Comma-separated list of mimetypes to be filtered (shown/hidden depends on filter-setting)&lt;br /&gt;
* '''iconsLocked''' (true/false): Whether or not icons can be moved&lt;br /&gt;
* '''numTextLines''' (number &amp;gt; 0): Amount of lines a file name can have before it is truncated&lt;br /&gt;
* '''url''': Folder URL to be displayed (e. g. desktop:/// or file:///home/yourusername)&lt;br /&gt;
* '''sortColumn''' (-1/0/1/2/3/4/5): The way files and folders are sorted (-1 = No sorting, 0 = By name, 1 = By size, 2 = By type, 3 = By date)&lt;br /&gt;
* '''sortDirsFirst''' (true/false): Whether or not folders are displayed before files (defaults to true)&lt;br /&gt;
* '''textColor''' (rrr,ggg,bbb): Color the icon labels will have&lt;br /&gt;
&lt;br /&gt;
=== Kickoff menu (launcher) ===&lt;br /&gt;
* '''SwitchTabsOnHover''' (true/false): self-explanatory&lt;br /&gt;
* '''ShowAppsByName''' (true/false): Apps are sorted by name rather than by description&lt;br /&gt;
&lt;br /&gt;
=== Pager (pager) ===&lt;br /&gt;
* '''displayedText''' (0/1/2): Text to be shown on individual virtual desktops (0 = Workspace number, 1 = Workspace title, 2 = None)&lt;br /&gt;
* '''ShowWindowIcons''' (true/false): Whether or not the application icon is to be shown on each individual window&lt;br /&gt;
* '''currentDesktopSelected''' (0/1/2): Defines what should happen if the user clicks on the virtual desktop that is currently active (0 = Nothing, 1 = Show Workspace, i. e. minimize windows, 2 = Show Dashboard)&lt;br /&gt;
* '''rows''' (number &amp;gt; 0): Amount of rows the pager should have. (Note: ''This is a global option, so you need to use '''writeGlobalConfig''' instead'')&lt;br /&gt;
&lt;br /&gt;
=== Notifications (notifications) ===&lt;br /&gt;
{{note|This applet is likely to be embedded to system tray. For Systrem Tray specific tasks, i. e. how to add, manage and remove plasmoids inside it, see sections below}}&lt;br /&gt;
* '''AutoHidePopup''' (true/false): Whether or not popups are to be hidden automatiaclly&lt;br /&gt;
* '''ShowJobs''' (true/false): Whether or not jobs are to be shown (e. g. file transfer progress)&lt;br /&gt;
* '''ShowNotifications''' (true/false): Whether or not notifications are to be shown&lt;br /&gt;
&lt;br /&gt;
=== Removable media notifier (notifier) ===&lt;br /&gt;
* '''ShowDevices''' (0/1/2): Defines what kind of devices are to be shown (0 = Removable media only, 1 = Non-removable media only, 2 = All)&lt;br /&gt;
{{note|Auto-mount settings and device actions are not stored in this Plasmoid’s settings.}}&lt;br /&gt;
&lt;br /&gt;
=== Taskbar (tasks) ===&lt;br /&gt;
* '''groupingStrategy''' (0/1/2): Defines how taskbar entries are to be grouped (0 = Never, 1 = Manually, 2 = By Program Name)&lt;br /&gt;
* '''groupWhenFull''' (true/false): Only group when taskbar is full (to be used with groupingStrategy=2 only!)&lt;br /&gt;
* '''highlightWindows''' (true/false): Highlight a window if your mouse cursor is hovering its taskbar entry (requires Desktop Compositing and “Highlight windows” effect enabled to work)&lt;br /&gt;
* '''maxRows''' (number &amp;gt; 0): Amount of rows taskbar entries can take&lt;br /&gt;
* '''forceRows''' (true/false): Force row setting for taskbar entries&lt;br /&gt;
* '''showOnlyCurrentActivity''' (true/false): Show only windows from current activity&lt;br /&gt;
* '''showOnlyCurrentDesktop''' (true/false): Show only windows from current virtual desktop&lt;br /&gt;
* '''showOnlyCurrentScreen''' (true/false): Show only windows from current screen (multi monitor setup)&lt;br /&gt;
* '''showTooltip''' (true/false): Whether or not tooltips are to be shown&lt;br /&gt;
* '''sortingStrategy''' (0/1/2/3): How taskbar entries are to be sorted (0 = Never, 1 = Manually, 2 = Alphabetically, 3 = By Desktop)&lt;br /&gt;
&lt;br /&gt;
=== System Tray ===&lt;br /&gt;
The System Tray has some unique behaviors since it can host widgets and configuring it is not as easy as most other widgets, particularly when adding and removing widgets. This section will help you deal with its specific behavior.&lt;br /&gt;
&lt;br /&gt;
==== Generic System Tray configuration keys ====&lt;br /&gt;
* '''DefaultAppletAdded''' (true/false): Remembers whether the default plasmoids (networkmanagement, device manager, notifications) have already been added(??)&lt;br /&gt;
* '''ShowApplicationStatus''' (true/false): Show system tray icons of applications that belong to the group “Applications”&lt;br /&gt;
* '''ShowCommunications''' (true/false): Show system tray icons of applications that belong to the group “Applications” (i. e. Messenger, IRC chat)&lt;br /&gt;
* '''ShowHardware''' (true/false): Show system tray icons of applications that belong to the group “Hardware” (i. e. volume control, printer applet)&lt;br /&gt;
* '''ShowSystemServices''' (true/false): Show system tray icons of applications that belong to the group “System Services” (i. e. Nepomuk Indexing Agent)&lt;br /&gt;
* '''ShowUnknown''' (true/false): Show system tray icons that do not belong into one of the categories mentioned above (or that do not use KDE’s system tray protocol and thus do not provide such information)&lt;br /&gt;
* '''alwaysShown''': Comma-separated list of widgets and entries that are to be shown all the time (e. g. KMix,notifier)&lt;br /&gt;
* '''hidden''': Comma-separated list of widgets and entries that are to be hidden all the time (e. g. Nepomuk Indexing Agent,Klipper,kmail)&lt;br /&gt;
{{note|Although notifications appear to be part of the System Tray, they are handled by a separate plasmoid which is embedded to the system tray. For its configuration keys, see section above}}&lt;br /&gt;
&lt;br /&gt;
==== Add a widget to systemtray ====&lt;br /&gt;
You can not add widgets to the systemtray in a similar way like you would add them to a panel or containment using addWidget. Instead, to add, manage and remove them, you need to utilize writeConfig changing the currentConfigGroup.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
systray = panel.addWidget(&amp;quot;systemtray&amp;quot;)	// First add a systemtray to your panel&lt;br /&gt;
systray.currentConfigGroup = Array(&amp;quot;Applets&amp;quot;,&amp;quot;0&amp;quot;) // then change the currentConfig Group&lt;br /&gt;
&lt;br /&gt;
// to the subnode [Applets][0]. Use any number you like(?)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can “create” the plasmoid by adding a “plugin” configuration entry&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
systray.writeConfig(&amp;quot;plugin&amp;quot;,&amp;quot;notifier&amp;quot;) // This will add a Device Notifier Plasmoid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You can modify the plasmoid’s configuration by using writeConfig.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
systray.writeConfig(&amp;quot;property&amp;quot;,&amp;quot;value&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To change back to the top configuration level and thus edit the systemtray plasmoid itself pass an empty array to currentConfigGroup.&lt;br /&gt;
&lt;br /&gt;
==== Edit existing widgets in systemtray ====&lt;br /&gt;
&lt;br /&gt;
==== Remove a widget from systemtray ====&lt;br /&gt;
&lt;br /&gt;
To remove a widget, simply delete the corresponding configuration group.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Services/Plugins</id>
		<title>Development/Tutorials/Services/Plugins</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Services/Plugins"/>
				<updated>2011-11-15T10:46:12Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* The plugin loading stuff */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:I18n/Language Navigation Bar|Development/Tutorials/Services/Plugins}}&lt;br /&gt;
&lt;br /&gt;
{{TutorialBrowser|&lt;br /&gt;
&lt;br /&gt;
series=Services|&lt;br /&gt;
&lt;br /&gt;
name=Creating and Loading Plugins Using KService|&lt;br /&gt;
&lt;br /&gt;
pre=[[../Traders|Traders: Querying the System]]&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
Before starting with the code let's see which advantages we can undertake&lt;br /&gt;
developing a plugin structured application. First of all an application capable &lt;br /&gt;
of managing plugins can extend its features with apparently no limits. Anyway, rather than developing a plugin structured application because &amp;quot;it's so coool!!&amp;quot; the developer should think about the real advantages of this kind of development. For instance we can think about an archive manager application: the main program can delegate the creation/extraction/editing of each type of archive to specific plugins. This way we give modularity to the application so that supporting brand new archive types in the future will simply consist in writing the specific plugin and not rewriting the whole application. Ok, then let's stop talking.. and start coding =).&lt;br /&gt;
&lt;br /&gt;
== The Text Editor Example ==&lt;br /&gt;
So, even if an archiving application would be nicer to look at, here we will examine a simple text editing application capable of plugin loading.&lt;br /&gt;
Each plugin will simply give a specific text editing feature.&lt;br /&gt;
&lt;br /&gt;
== Creating a Plugin Interface Class ==&lt;br /&gt;
The main step in order to create a plugin structure is to define its base class.&lt;br /&gt;
This class will be inherited by every plugin and should give access to the key resources of the main application. In this example the main plugin class will inherit a KXMLGUIClient since every plugin will give access to its features through a gui element (a KAction in this case).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;kdemacros.h&amp;gt;&lt;br /&gt;
#include &amp;lt;kxmlguiclient.h&amp;gt;&lt;br /&gt;
#include &amp;lt;QObject&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class KTextEdit;&lt;br /&gt;
&lt;br /&gt;
class KDE_EXPORT Plugin : public QObject , public KXMLGUIClient&lt;br /&gt;
{&lt;br /&gt;
    Q_OBJECT&lt;br /&gt;
&lt;br /&gt;
    public:&lt;br /&gt;
        Plugin(QObject *parent);&lt;br /&gt;
        virtual ~Plugin();&lt;br /&gt;
&lt;br /&gt;
        /**&lt;br /&gt;
         * @return KTextEdit pointing to the main application editor widget&lt;br /&gt;
         */&lt;br /&gt;
        KTextEdit* editorInterface();&lt;br /&gt;
&lt;br /&gt;
        /**&lt;br /&gt;
         * @internal Used by the main application to correctly set the editor.&lt;br /&gt;
         * Do not call from within the reimplementation.&lt;br /&gt;
         */&lt;br /&gt;
        void setEditorInterface(KTextEdit *);&lt;br /&gt;
&lt;br /&gt;
    private:&lt;br /&gt;
        class PluginPrivate;&lt;br /&gt;
        PluginPrivate *d;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This base class will give the useful pointers needed by each plugin in order to manipulate the main application data. In this case we only give access to the main editor interface through editorInterface().&lt;br /&gt;
&lt;br /&gt;
Here follows the implementation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;plugin.h&amp;quot;&lt;br /&gt;
#include &amp;lt;KTextEdit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class Plugin::PluginPrivate {&lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
    PluginPrivate(Plugin *q):&lt;br /&gt;
                  q(q),&lt;br /&gt;
                  m_editor(0){}&lt;br /&gt;
&lt;br /&gt;
    Plugin *q;&lt;br /&gt;
    KTextEdit *m_editor;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
Plugin::Plugin(QObject *parent) : QObject(parent),&lt;br /&gt;
                                  d(new PluginPrivate(this))&lt;br /&gt;
{}&lt;br /&gt;
&lt;br /&gt;
Plugin::~Plugin()&lt;br /&gt;
{&lt;br /&gt;
    delete d; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
KTextEdit* Plugin::editorInterface()&lt;br /&gt;
{&lt;br /&gt;
    return d-&amp;gt;m_editor;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plugin::setEditorInterface(KTextEdit *editor)&lt;br /&gt;
{&lt;br /&gt;
    d-&amp;gt;m_editor = editor;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where plugin.h is the header file seen before.&lt;br /&gt;
The setEditorInterface allows the main application to set the pointer to the main KTextEditor. This way each programmer will be able to access the main text editing interface and interact with it as well.&lt;br /&gt;
&lt;br /&gt;
== The Plugin Factory Macro ==&lt;br /&gt;
Every plugin will be made &amp;quot;visible and available&amp;quot; through the use of a macro.&lt;br /&gt;
So we better put this macro in our own myplugin_macros.h as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;kdemacros.h&amp;gt;&lt;br /&gt;
#include &amp;lt;KPluginFactory&amp;gt;&lt;br /&gt;
#include &amp;lt;KPluginLoader&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define TEXTEDITOR_PLUGIN_EXPORT( c ) \&lt;br /&gt;
  K_PLUGIN_FACTORY( TextEditorFactory, registerPlugin&amp;lt; c &amp;gt;(); ) \&lt;br /&gt;
  K_EXPORT_PLUGIN( TextEditorFactory(&amp;quot;c&amp;quot;) ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This macro simply unifies two KDE macros that allow us the exportation of the plugin.&lt;br /&gt;
&lt;br /&gt;
== Loading Plugins ==&lt;br /&gt;
Now let's get prepared to make our application find and load every compatible plugin. We'll make use of a simple helper that uses standard KDE methods in order to locate and load plugins. Here follows header and implementation&lt;br /&gt;
&lt;br /&gt;
=== PLUGINLOADER.H ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;QObject&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;plugintest_macros.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class Plugin;&lt;br /&gt;
&lt;br /&gt;
class PluginLoader : public QObject&lt;br /&gt;
{&lt;br /&gt;
    Q_OBJECT&lt;br /&gt;
    public:&lt;br /&gt;
        PluginLoader(QObject * parent);&lt;br /&gt;
        virtual ~PluginLoader();&lt;br /&gt;
&lt;br /&gt;
        void loadAllPlugins();&lt;br /&gt;
&lt;br /&gt;
    signals:&lt;br /&gt;
        void pluginLoaded(Plugin * plugin);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PLUGINLOADER.CPP ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;pluginloader.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;plugin.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;KServiceTypeTrader&amp;gt;&lt;br /&gt;
#include &amp;lt;KDebug&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PluginLoader::PluginLoader(QObject * parent)&lt;br /&gt;
  : QObject(parent)&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
PluginLoader::~PluginLoader()&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void PluginLoader::loadAllPlugins()&lt;br /&gt;
{&lt;br /&gt;
    kDebug() &amp;lt;&amp;lt; &amp;quot;Load all plugins&amp;quot;;&lt;br /&gt;
    KService::List offers = KServiceTypeTrader::self()-&amp;gt;query(&amp;quot;TextEditor/Plugin&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    KService::List::const_iterator iter;&lt;br /&gt;
    for(iter = offers.begin(); iter &amp;lt; offers.end(); ++iter)&lt;br /&gt;
    {&lt;br /&gt;
       QString error;&lt;br /&gt;
       KService::Ptr service = *iter;&lt;br /&gt;
&lt;br /&gt;
        KPluginFactory *factory = KPluginLoader(service-&amp;gt;library()).factory();&lt;br /&gt;
&lt;br /&gt;
        if (!factory)&lt;br /&gt;
        {&lt;br /&gt;
            //KMessageBox::error(0, i18n(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;p&amp;gt;KPluginFactory could not load the plugin:&amp;lt;br /&amp;gt;&amp;lt;i&amp;gt;%1&amp;lt;/i&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;,&lt;br /&gt;
              //                         service-&amp;gt;library()));&lt;br /&gt;
            kError(5001) &amp;lt;&amp;lt; &amp;quot;KPluginFactory could not load the plugin:&amp;quot; &amp;lt;&amp;lt; service-&amp;gt;library();&lt;br /&gt;
            continue;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
       Plugin *plugin = factory-&amp;gt;create&amp;lt;Plugin&amp;gt;(this);&lt;br /&gt;
&lt;br /&gt;
       if (plugin) {&lt;br /&gt;
           kDebug() &amp;lt;&amp;lt; &amp;quot;Load plugin:&amp;quot; &amp;lt;&amp;lt; service-&amp;gt;name();&lt;br /&gt;
           emit pluginLoaded(plugin);&lt;br /&gt;
       } else {&lt;br /&gt;
           kDebug() &amp;lt;&amp;lt; error;&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code shown simply queries SyCoCa for a plugin for the TextEditor. When creating a plugin a .desktop file is provided with the Service Type the plugin is designed for. We'll see later how to set the proper Service Type for our custom plugin. We emit the pluginLoaded signal when the plugin is properly loaded so that the application will integrate it in the GUI.&lt;br /&gt;
&lt;br /&gt;
== Handling plugins by the Main Application ==&lt;br /&gt;
I'll just show pieces of code that handle plugin loading in the main window.&lt;br /&gt;
Let's assume we have a pointer to our KTextEdit simply called editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
void MyMainWindow::loadPlugins()&lt;br /&gt;
{&lt;br /&gt;
    PluginLoader *loader = new PluginLoader(this);&lt;br /&gt;
    connect(loader, SIGNAL(pluginLoaded(Plugin*)), this, SLOT(addPlugin(Plugin*)));&lt;br /&gt;
    loader-&amp;gt;loadAllPlugins();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So with this piece of code we ask PluginLoader to load all plugins and call the slot pluginLoaded we'll see now to implement the plugins in the interface.&lt;br /&gt;
The loadPlugins method is supposed to be called at the beginning of the application in order to load everything before the user can start using it. Of course you can decide what to do with your plugins and ignore this suggestion :).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp-qt&amp;quot;&amp;gt;&lt;br /&gt;
void MyMainWindow::addPlugin(Plugin *plugin)&lt;br /&gt;
{&lt;br /&gt;
    editor = plugin-&amp;gt;editorInterface();&lt;br /&gt;
    guiFactory()-&amp;gt;addClient(plugin);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Since our plugin inherits KXMLGuiClient we can provide any kind of gui client supported and KDE will automagically load it into our application. So this code snippet simply integrates our plugin with the main window.&lt;br /&gt;
&lt;br /&gt;
== A Simple Plugin Example ==&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-UIElements</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-UIElements</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-UIElements"/>
				<updated>2011-11-11T09:34:14Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Common Properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= User Interface Elements =&lt;br /&gt;
&lt;br /&gt;
The Plasma framework provides a set of standard user interface elements such as pushbuttons and checkboxes for use in Plasmoids, and these are available from the Simplified Javascript API as well. These elements follow the Plasma style and other conventions so that widgets blend well both visually and functionally with other Plasma elements. &lt;br /&gt;
&lt;br /&gt;
Note that some UI elements have functions that are synonymous with a read-write property. In those cases, the function can serve as a slot and be connected to signals for easy setting of the property.&lt;br /&gt;
&lt;br /&gt;
= DataEngine-Aware UI Elements =&lt;br /&gt;
Some of the UI elements are able to accept data directly from DataEngines. These widgets will have a dataUpdated function and can be passed into the DataEngine::connectSource method successfully.&lt;br /&gt;
&lt;br /&gt;
DataEngine-aware UI elements include:&lt;br /&gt;
&lt;br /&gt;
* Label&lt;br /&gt;
* TextEdit&lt;br /&gt;
* Meter&lt;br /&gt;
&lt;br /&gt;
= Common Properties  =&lt;br /&gt;
&lt;br /&gt;
By default, all of the Plasma user interface elements have the following properties: &lt;br /&gt;
&lt;br /&gt;
* ''String'' '''objectName'''&lt;br /&gt;
* ''number'' '''opacity'''&lt;br /&gt;
* ''boolean'' '''enabled'''&lt;br /&gt;
* ''boolean'' '''visible'''&lt;br /&gt;
* ''QPointF'' '''pos'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
* ''number'' '''z'''&lt;br /&gt;
* ''number'' '''rotation'''&lt;br /&gt;
* ''number'' '''scale'''&lt;br /&gt;
* ''QPointF'' '''transformOriginPoint'''&lt;br /&gt;
* ''QPalette'' '''palette'''&lt;br /&gt;
* ''QFont'' '''font'''&lt;br /&gt;
* ''QSizeF'' '''size'''&lt;br /&gt;
* ''QtFocusPolicy'' '''focusPolicy'''&lt;br /&gt;
* ''QRectF'' '''geometry'''&lt;br /&gt;
&lt;br /&gt;
Importantly, most elements also support:&lt;br /&gt;
&lt;br /&gt;
* ''QSizeF'' '''preferredSize''': this size is used to control the default sizing of windows and other containers that the element may be shown in. This is particularly useful for, e.g., popupWidget in PopupApplets.&lt;br /&gt;
&lt;br /&gt;
= Common Signals  =&lt;br /&gt;
&lt;br /&gt;
* '''opacityChanged()'''&lt;br /&gt;
* '''visibleChanged()'''&lt;br /&gt;
* '''enabledChanged()'''&lt;br /&gt;
* '''xChanged()'''&lt;br /&gt;
* '''yChanged()'''&lt;br /&gt;
* '''zChanged()'''&lt;br /&gt;
* '''rotationChanged()'''&lt;br /&gt;
* '''scaleChanged() '''&lt;br /&gt;
&lt;br /&gt;
= UI Element Gallery  =&lt;br /&gt;
&lt;br /&gt;
== CSS Styleable UI Elements ==&lt;br /&gt;
&lt;br /&gt;
Most UI Elements are able to have their appearance adjust using a CSS stylesheet. All of these elements have the following read/write property:&lt;br /&gt;
&lt;br /&gt;
*''String'' '''styleSheet''': A CSS stylesheet describing visual properties to apply to the widget; see [http://doc.trolltech.com/4.5/stylesheet.html the Qt Documentation for more information]&lt;br /&gt;
&lt;br /&gt;
=== CheckBox ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
* ''boolean'' '''checked'''&lt;br /&gt;
* '''toggled(bool)'''&lt;br /&gt;
&lt;br /&gt;
=== ComboBox ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''number'' '''count''': (API v 3) the number of items in the combobox&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text''': the text of the currently selected item in the combobox&lt;br /&gt;
* ''number'' currentIndex:  (API v 3) the index of the current item&lt;br /&gt;
&lt;br /&gt;
Funtions:&lt;br /&gt;
* '''clear()'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''activated(String)'''&lt;br /&gt;
* '''textChanged(String)'''&lt;br /&gt;
* '''currentIndexChanged(number)'''&lt;br /&gt;
&lt;br /&gt;
=== Frame ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''Shadow'' '''frameShadow'''&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
&lt;br /&gt;
Enumerations:&lt;br /&gt;
* '''Shadow'''&lt;br /&gt;
* '''Plain'''&lt;br /&gt;
* '''Raised'''&lt;br /&gt;
* '''Sunken'''&lt;br /&gt;
&lt;br /&gt;
=== GroupBox ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
&lt;br /&gt;
=== Label ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
* ''number'' '''alignment''' (see [[#QtAlignment]] for the valid values)&lt;br /&gt;
* ''boolean'' '''hasScaledContents'''&lt;br /&gt;
* ''boolean'' '''textIsSelectable''' (since 4.4.1)&lt;br /&gt;
* ''boolean'' '''wordWrap''' (API v2)&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''dataUpdated(String, Data)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''linkActivated(String)''': emitted when a link is clicked; includes the URL of link that is clicked; this is only available when textIsSelectable&lt;br /&gt;
* '''linkHovered(String)''': emitted when a link is hovered&lt;br /&gt;
&lt;br /&gt;
=== LineEdit ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''boolean'' '''clearButtonShown'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''editingFinished()'''&lt;br /&gt;
* '''returnPressed()'''&lt;br /&gt;
* '''textEdited(String)'''&lt;br /&gt;
* '''textChanged(String)'''&lt;br /&gt;
&lt;br /&gt;
=== PushButton ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
* ''QAction'' '''action'''&lt;br /&gt;
* ''QIcon'' '''icon'''&lt;br /&gt;
* ''boolean'' '''checkable'''&lt;br /&gt;
* ''boolean'' '''checked'''&lt;br /&gt;
* ''boolean'' '''down'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''pressed()'''&lt;br /&gt;
* '''released()'''&lt;br /&gt;
* '''clicked()'''&lt;br /&gt;
* '''toggled(bool)'''&lt;br /&gt;
&lt;br /&gt;
=== RadioButton ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
* ''boolean'' '''checked'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''toggled(bool)'''&lt;br /&gt;
&lt;br /&gt;
=== ScrollWidget ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''QGraphicsWidget'' '''widget'''&lt;br /&gt;
* ''number'' '''horizontalScrollBarPolicy'''&lt;br /&gt;
* ''number'' '''verticalScrollBarPolicy'''&lt;br /&gt;
* ''QPointF'' '''scrollPosition'''&lt;br /&gt;
* ''QSizeF'' '''contentsSize'''&lt;br /&gt;
* ''QRectF'' '''viewportGeometry'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''ensureRectVisible(QRectF)'''&lt;br /&gt;
* '''ensureItemVisible(QGraphicsItem)'''&lt;br /&gt;
* '''registerAsDragHandle(QGraphicsWidget)'''&lt;br /&gt;
* '''unregisterAsDragHandle(QGraphicsWidget)'''&lt;br /&gt;
&lt;br /&gt;
=== ScrollBar ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''singleStep'''&lt;br /&gt;
* ''number'' '''pageStep'''&lt;br /&gt;
* ''number'' '''value'''&lt;br /&gt;
* ''number'' '''minimum'''&lt;br /&gt;
* ''number'' '''maximum'''&lt;br /&gt;
* ''QtOrientation'' '''setOrientation'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setValue(number)'''&lt;br /&gt;
* '''setOrientation(QtOrientation)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''valueChanged(number)'''&lt;br /&gt;
&lt;br /&gt;
=== Slider ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''maximum'''&lt;br /&gt;
* ''number'' '''minimum'''&lt;br /&gt;
* ''number'' '''value'''&lt;br /&gt;
* ''number'' '''orientation'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''sliderMoved(number)'''&lt;br /&gt;
* '''valueChanged(number)'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setMaximum(number)'''&lt;br /&gt;
* '''setMinimum(number)'''&lt;br /&gt;
* '''setRange(number, number)'''&lt;br /&gt;
* '''setValue(number)'''&lt;br /&gt;
* '''setOrientation(QtOrientation)'''&lt;br /&gt;
&lt;br /&gt;
=== SpinBox ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''maximum'''&lt;br /&gt;
* ''number'' '''minimum'''&lt;br /&gt;
* ''number'' '''value'''&lt;br /&gt;
&lt;br /&gt;
Functins:&lt;br /&gt;
* '''setMaximum(number)'''&lt;br /&gt;
* '''setMinimum(number)'''&lt;br /&gt;
* '''setRange(number, number)'''&lt;br /&gt;
* '''setValue(number)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''sliderMoved(number)'''&lt;br /&gt;
* '''valueChanged(number)'''&lt;br /&gt;
* '''editingFinished()'''&lt;br /&gt;
&lt;br /&gt;
=== TabBar ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''currentIndex'''&lt;br /&gt;
* ''number'' '''count'''&lt;br /&gt;
* ''boolean'' '''tabBarShown'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setCurrentIndex(number)'''&lt;br /&gt;
* '''insertTab(number, QIcon,String,QGraphicsLayoutItem)'''&lt;br /&gt;
* '''insertTab(number, QIcon,String)'''&lt;br /&gt;
* '''insertTab(number, String,QGraphicsLayoutItem)'''&lt;br /&gt;
* '''insertTab(number, String)'''&lt;br /&gt;
* '''addTab(QIcon,String,QGraphicsLayoutItem)'''&lt;br /&gt;
* '''addTab(QIcon,String)'''&lt;br /&gt;
* '''addTab(String,QGraphicsLayoutItem)'''&lt;br /&gt;
* '''addTab(String)'''&lt;br /&gt;
* '''removeTab(number)'''&lt;br /&gt;
* '''takeTab(number)'''&lt;br /&gt;
* '''tabAt(number)'''&lt;br /&gt;
* '''setTabText(number, String)'''&lt;br /&gt;
* '''tabText(number)'''&lt;br /&gt;
* '''setTabIcon(number, QIcon)'''&lt;br /&gt;
* '''tabIcon(number)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''currentChanged(number)'''&lt;br /&gt;
&lt;br /&gt;
=== TextEdit ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''boolean'' '''readOnly'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''dataUpdated(String, Data)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''textChanged()'''&lt;br /&gt;
&lt;br /&gt;
=== ToolButton ===&lt;br /&gt;
:Read-write properties:&lt;br /&gt;
&lt;br /&gt;
* ''''QAction'' '''action''': the action associated with this '''ToolButton'''&lt;br /&gt;
* ''''boolean'' '''autoRaise''': whether or not the ToolButton should raise automatically when the user interacts with it'''&lt;br /&gt;
* ''''String'' '''image''': path to an icon or image (e.g. in the widget's Package) to show on the ToolButton&lt;br /&gt;
* ''''String'' '''text''': the text shown on the ToolButton&lt;br /&gt;
&lt;br /&gt;
API v2 adds:&lt;br /&gt;
* ''''boolean'' '''down''': whether or not the ToolButton is in the down position (since protocol version 2)&lt;br /&gt;
&lt;br /&gt;
:Signals:&lt;br /&gt;
* '''clicked()'''&lt;br /&gt;
* '''pressed()'''&lt;br /&gt;
* '''released()'''&lt;br /&gt;
&lt;br /&gt;
=== TreeView ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''QAbstractModel'' '''model'''&lt;br /&gt;
&lt;br /&gt;
=== VideoWidget ===&lt;br /&gt;
Read-writeproperties:&lt;br /&gt;
* ''String'' '''url'''&lt;br /&gt;
* ''number'' '''currentTime'''&lt;br /&gt;
* ''number'' '''totalTime'''&lt;br /&gt;
* ''number'' '''remainingTime'''&lt;br /&gt;
* ''Controls'' '''usedControls'''&lt;br /&gt;
* ''boolean'' '''controlsVisible'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''play()'''&lt;br /&gt;
* '''pause()'''&lt;br /&gt;
* '''stop()'''&lt;br /&gt;
* '''seek(number)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''tick(number)'''&lt;br /&gt;
* '''aboutToFinish()'''&lt;br /&gt;
* '''nextRequested()'''&lt;br /&gt;
* '''previousRequested()'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enumerations:&lt;br /&gt;
* Controls&lt;br /&gt;
** NoControls&lt;br /&gt;
** Play&lt;br /&gt;
** Pause&lt;br /&gt;
** Stop&lt;br /&gt;
** PlayPause&lt;br /&gt;
** Previous&lt;br /&gt;
** Next&lt;br /&gt;
** Progress&lt;br /&gt;
** Volume&lt;br /&gt;
** OpenFile&lt;br /&gt;
** DefaultControls&lt;br /&gt;
&lt;br /&gt;
== Other UI Elements ==&lt;br /&gt;
&lt;br /&gt;
=== BusyWidget ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''running'''&lt;br /&gt;
* ''String'' '''label'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''clicked()'''&lt;br /&gt;
&lt;br /&gt;
=== FlashingLabel ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''autohide'''&lt;br /&gt;
* ''QColor'' '''color'''&lt;br /&gt;
* ''number'' '''duration'''&lt;br /&gt;
&lt;br /&gt;
Functins:&lt;br /&gt;
* '''kill()'''&lt;br /&gt;
* '''fadeIn()'''&lt;br /&gt;
* '''fadeOut()'''&lt;br /&gt;
* '''flash(String, number, QTextOption)'''&lt;br /&gt;
* '''flash(String ,number)'''&lt;br /&gt;
* '''flash(String)'''&lt;br /&gt;
* '''flash(QPixmap, number, QtAlignment)'''&lt;br /&gt;
* '''flash(QPixmap, number)'''&lt;br /&gt;
* '''flash(QPixmap)'''&lt;br /&gt;
&lt;br /&gt;
=== GraphicsWidget (API v3) ===&lt;br /&gt;
This is just a plain element with no painting or other features. It is useful primarily as a place holder, especially to contain layouts for other elements.&lt;br /&gt;
&lt;br /&gt;
=== IconWidget ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''QSizeF'' '''iconSize''' - the actual size of the icon given the size of the IconWidget, space reserved (if any) for text displayed, etc.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''infoText'''&lt;br /&gt;
* ''QIcon'' '''icon'''&lt;br /&gt;
* ''QColor'' '''textBackgroundColor'''&lt;br /&gt;
* ''String'' '''svg'''&lt;br /&gt;
* ''QAction'' '''action'''&lt;br /&gt;
* ''QtOrientation'' '''orientation'''&lt;br /&gt;
* ''number'' '''numDisplayLines'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setPressed(boolean)'''&lt;br /&gt;
* '''setUnpressed()'''&lt;br /&gt;
* '''setIcon(String)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''pressed(bool)'''&lt;br /&gt;
* '''clicked()'''&lt;br /&gt;
* '''doubleClicked()'''&lt;br /&gt;
* '''activated()'''&lt;br /&gt;
* '''changed()'''&lt;br /&gt;
&lt;br /&gt;
=== ItemBackground ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''QRectF'' '''target'''&lt;br /&gt;
* ''QGraphicsItem'' '''targetItem'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''appearanceChanged()'''&lt;br /&gt;
* '''animationStep(qreal)'''&lt;br /&gt;
* '''targetReached(QRectF)'''&lt;br /&gt;
* '''targetItemReached(QGraphicsItem)'''&lt;br /&gt;
&lt;br /&gt;
=== Meter ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''minimum'''&lt;br /&gt;
* ''number'' '''maximum'''&lt;br /&gt;
* ''number'' '''value'''&lt;br /&gt;
* ''String'' '''svg'''&lt;br /&gt;
* ''MeterType'' '''meterType'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''dataUpdated(String, Data)'''&lt;br /&gt;
&lt;br /&gt;
Enumerations:&lt;br /&gt;
* '''MeterType'''&lt;br /&gt;
** BarMeterHorizontal&lt;br /&gt;
** BarMeterVertical&lt;br /&gt;
** AnalogMeter&lt;br /&gt;
&lt;br /&gt;
=== Separator ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''QtOrientation'' '''orientation'''&lt;br /&gt;
&lt;br /&gt;
=== SignalPlotter ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''title'''&lt;br /&gt;
* ''String'' '''unit'''&lt;br /&gt;
* ''boolean'' '''useAutoRange'''&lt;br /&gt;
* ''number'' '''horizontalScale'''&lt;br /&gt;
* ''boolean'' '''showVerticalLines'''&lt;br /&gt;
* ''QColor'' '''verticalLinesColor'''&lt;br /&gt;
* ''number'' '''verticalLinesDistance'''&lt;br /&gt;
* ''boolean'' '''verticalLinesScroll'''&lt;br /&gt;
* ''boolean'' '''showHorizontalLines'''&lt;br /&gt;
* ''QColor'' '''horizontalLinesColor'''&lt;br /&gt;
* ''QColor'' '''fontColor'''&lt;br /&gt;
* ''number'' '''horizontalLinesCount'''&lt;br /&gt;
* ''boolean'' '''showLabels'''&lt;br /&gt;
* ''boolean'' '''showTopBar'''&lt;br /&gt;
* ''QColor'' '''backgroundColor'''&lt;br /&gt;
* ''String'' '''svgBackground'''&lt;br /&gt;
* ''boolean'' '''thinFrame'''&lt;br /&gt;
* ''boolean'' '''stackPlots'''&lt;br /&gt;
&lt;br /&gt;
=== SvgWidget ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''Svg'' '''svg'''&lt;br /&gt;
* ''String'' '''elementID'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''clicked(QtMouseButton)'''&lt;br /&gt;
&lt;br /&gt;
=== WebView ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''QSizeF'' '''contentsSize'''&lt;br /&gt;
* ''QRectF'' '''viewportGeometry'''&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''Url'' '''url'''&lt;br /&gt;
* ''String'' '''html'''&lt;br /&gt;
* ''boolean'' '''dragToScroll'''&lt;br /&gt;
* ''QPointF'' '''scrollPosition'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''loadProgress(number)'''&lt;br /&gt;
* '''loadFinished(bool)'''&lt;br /&gt;
&lt;br /&gt;
= Layouts  =&lt;br /&gt;
&lt;br /&gt;
== LinearLayout ==&lt;br /&gt;
* ''number'' '''spacing'''&lt;br /&gt;
* ''QtOrientation'' '''orientation''' (''QtVertical'' or ''QtHorizontal'')&lt;br /&gt;
* ''function'' '''removeAt'''&lt;br /&gt;
* ''function'' '''addStretch'''&lt;br /&gt;
* ''function'' '''setStretchFactor'''&lt;br /&gt;
* ''function'' '''setAlignment'''&lt;br /&gt;
* ''function'' '''insertStretch'''&lt;br /&gt;
* ''function'' '''setItemSpacing'''&lt;br /&gt;
* ''function'' '''setContentsMargins'''&lt;br /&gt;
* ''function'' '''addItem'''&lt;br /&gt;
* ''function'' '''removeItem'''&lt;br /&gt;
* ''function'' '''insertItem'''&lt;br /&gt;
* ''function'' '''toString'''&lt;br /&gt;
* ''function'' '''activate''' (API v3)&lt;br /&gt;
&lt;br /&gt;
== AnchorLayout ==&lt;br /&gt;
* ''number'' '''horizontalSpacing'''&lt;br /&gt;
* ''number'' '''verticalSpacing'''&lt;br /&gt;
* ''function'' '''setSpacing'''&lt;br /&gt;
* ''function'' '''removeAt'''&lt;br /&gt;
* ''function'' '''addAnchor'''&lt;br /&gt;
* ''function'' '''anchor'''&lt;br /&gt;
* ''function'' '''addAnchors'''&lt;br /&gt;
* ''function'' '''addCornerAnchors'''&lt;br /&gt;
* ''function'' '''toString'''&lt;br /&gt;
* ''function'' '''activate''' (API v3)&lt;br /&gt;
&lt;br /&gt;
== GridLayout ==&lt;br /&gt;
* ''number '''horizontalSpacing'''&lt;br /&gt;
* ''number '''verticalSpacing'''&lt;br /&gt;
* ''function'' '''rowSpacing'''&lt;br /&gt;
* ''function'' '''setRowSpacing'''&lt;br /&gt;
* ''function'' '''columnSpacing'''&lt;br /&gt;
* ''function'' '''setColumnSpacing'''&lt;br /&gt;
* ''function'' '''rowMinimumHeight'''&lt;br /&gt;
* ''function'' '''setRowMinimumHeight'''&lt;br /&gt;
* ''function'' '''rowPreferredHeight'''&lt;br /&gt;
* ''function'' '''setRowPreferredHeight'''&lt;br /&gt;
* ''function'' '''rowMaximumHeight'''&lt;br /&gt;
* ''function'' '''setRowMaximumHeight'''&lt;br /&gt;
* ''function'' '''rowFixedHeight'''&lt;br /&gt;
* ''function'' '''setRowFixedHeight'''&lt;br /&gt;
* ''function'' '''columnMinimumWidth'''&lt;br /&gt;
* ''function'' '''setColumnMinimumWidth'''&lt;br /&gt;
* ''function'' '''columnPreferredWidth'''&lt;br /&gt;
* ''function'' '''setColumnPreferredWidth'''&lt;br /&gt;
* ''function'' '''columnMaximumWidth'''&lt;br /&gt;
* ''function'' '''setColumnMaximumWidth'''&lt;br /&gt;
* ''function'' '''columnFixedWidth'''&lt;br /&gt;
* ''function'' '''setColumnFixedWidth'''&lt;br /&gt;
* ''function'' '''remoteAt'''&lt;br /&gt;
* ''function'' '''setAlignment'''&lt;br /&gt;
* ''function'' '''setSpacing'''&lt;br /&gt;
* ''function'' '''setContentsMargins'''&lt;br /&gt;
* ''function'' '''addItem'''&lt;br /&gt;
* ''function'' '''toString'''&lt;br /&gt;
* ''function'' '''activate''' (API v3)&lt;br /&gt;
&lt;br /&gt;
= Undocumented Properties and Functions  =&lt;br /&gt;
&lt;br /&gt;
There are a handful of other undocumented properties and functions available to UI elements. These are not supported or guaranteed to exist in future versions however, and as such should not be used or relied upon.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/PackageOverview</id>
		<title>Development/Tutorials/Plasma/PackageOverview</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/PackageOverview"/>
				<updated>2011-11-09T12:18:29Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with &amp;quot;== Introduction ==  Many times in a Plasma based application or addon there is the need to reference a set of files for consistent and easy access and redistribution. For instanc...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Many times in a Plasma based application or addon there is the need to reference a set of files for consistent and easy access and redistribution. For instance, Plasma widgets (or &amp;quot;Plasmoids&amp;quot;) written in an interpreted language (e.g. QML, Javascript, HTML, Ruby or Python) are often made up of several files containing code, images, configuration descriptions and other resources. These are distributed and shipped as one compressed file and at run time the contents are made easily available to the Plasmoid. This is the role that the Plasma Package plays.&lt;br /&gt;
&lt;br /&gt;
A Plasma Package allows easy deployment and later referencing of a group of platform-independent files. Plasma Packages are used with wallpaper images and plugins, themes, Plasmoids, DataEngines, Runners, QML file sets, Plasma desktop scripting templates and other similar contexts. Plasma Package is therefore quite flexible and with very few rules can be extended to cover a wide variety of uses in applications that need a way to redistribute and/or reference sets of files easily.&lt;br /&gt;
&lt;br /&gt;
Plasma Package is intended to be a simple system that does not include things more complex packaging systems such as the Debian package format or RPM provides. While Plasma Packages do not have the concept of things such as dependencies or architecture targets, it also does not require a complex system with a database and (slow) management applications.&lt;br /&gt;
&lt;br /&gt;
== Plasma Package Format ==&lt;br /&gt;
&lt;br /&gt;
Plasma Packages usually have two things in common: a {{path|metadata.desktop}} file and a {{path|contents/}} directory.&lt;br /&gt;
&lt;br /&gt;
The {{path|metadata.desktop}} is an INI format file which contains a description of the contents of the package. This includes translatable strings for user visible text such as a name and description as well as content that is programmatically useful such as, in the case of Plasmoids, the scripting API used to write the Plasmoid the Package contains. &lt;br /&gt;
&lt;br /&gt;
In the case of Plasmoids, the metadata.desktop contains the following mandatory fields:&lt;br /&gt;
&lt;br /&gt;
* Name of the Plasmoid&lt;br /&gt;
* Author&lt;br /&gt;
* A version number for the Plasmoid&lt;br /&gt;
* Icon&lt;br /&gt;
** can be an icon from the user KDE theme;&lt;br /&gt;
** can be a file name (with extension) if you want to use a custom icon;&lt;br /&gt;
** omit this line if you do not want an icon.&lt;br /&gt;
* Used License&lt;br /&gt;
** This will be from a pre-selected list of possibilities. &lt;br /&gt;
** You can use a custom licence, specifying it in a file called COPYING.&lt;br /&gt;
** Should Plasma refuse to load improperly licensed Plasmoids?&lt;br /&gt;
* The API the plasmoid is written in (e.g. javascript, webkit, ruby, python, edje ..)&lt;br /&gt;
* Description of the Plasmoid giving the user a nice overview of the Plasmoid capabilities&lt;br /&gt;
&lt;br /&gt;
Optionally these fields can be added:&lt;br /&gt;
* Category of widget that the Plasmoids belongs to, see [Projects/Plasma/PIG|the Plasma Interface Guidelies] for a lit of recognized category names&lt;br /&gt;
* Homepage for more information to the Plasmoid&lt;br /&gt;
* EMail of the author&lt;br /&gt;
* Release notes&lt;br /&gt;
* Required scripting version&lt;br /&gt;
* A minimum version number for Plasma&lt;br /&gt;
* path to the main code file, relative to contents/&lt;br /&gt;
* default size of the plasmoid (if unset, the default is 200,200)&lt;br /&gt;
&lt;br /&gt;
An example file can be seen here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Name=Analog Clock&lt;br /&gt;
Comment=An SVG themable clock&lt;br /&gt;
Icon=chronometer&lt;br /&gt;
Type=Service&lt;br /&gt;
&lt;br /&gt;
X-Plasma-API=javascript&lt;br /&gt;
X-Plasma-MainScript=code/main.js&lt;br /&gt;
X-Plasma-DefaultSize=150,150&lt;br /&gt;
&lt;br /&gt;
X-KDE-ServiceTypes=Plasma/Applet&lt;br /&gt;
X-KDE-PluginInfo-Author=John Doe&lt;br /&gt;
X-KDE-PluginInfo-Email=john.doe@kde.org&lt;br /&gt;
X-KDE-PluginInfo-Name=clock&lt;br /&gt;
X-KDE-PluginInfo-Version=pre0.1&lt;br /&gt;
X-KDE-PluginInfo-Website=http://plasma.kde.org/&lt;br /&gt;
X-KDE-PluginInfo-Category=Date and Time&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{path|meta.desktop}} files for other Plasma components such as DataEngines, Runners and Wallpapers are very similar. It is recommended when creating new package types to adhere to the general style above as much as possible for consistency.&lt;br /&gt;
&lt;br /&gt;
Packages may add additional top-level contents directories. This is used by Plasmoids to allow device-specific files to be made available. A package may also have no special content directory at all, though this is discouraged since it makes accidental overwriting of files such has the metadata or hash files very easy.&lt;br /&gt;
&lt;br /&gt;
What appears within the contents directories is up to the Package itself. For Plasmoids, the following structure is supported:&lt;br /&gt;
&lt;br /&gt;
* $PlasmoidName-$PlasmoidVersion/ (root)&lt;br /&gt;
** {{path|metadata.desktop}}&lt;br /&gt;
** contents/&lt;br /&gt;
*** code/ ''files containing scripting code''&lt;br /&gt;
**** main ''the main file that will be loaded at plasmoid start (unless you specify a different name in metadata.desktop)''&lt;br /&gt;
*** images/ ''image files in svg, png or jpeg format''&lt;br /&gt;
*** locale/ ''translation files in a standard localization hierarchy; e.g. German translation would appear in locale/l10n/de/''&lt;br /&gt;
*** ui/ ''user interface files, such as Qt Designer layouts''&lt;br /&gt;
**** config.ui ''the main configuration dialog layout''&lt;br /&gt;
*** config/ ''KConfigXt files describing the configuration''&lt;br /&gt;
**** main.xml ''the main configuration description''&lt;br /&gt;
*** ... additional plasmoid-specific files&lt;br /&gt;
&lt;br /&gt;
Plasmoids can then reference these resources directly as if that was all that existed in the file system with simple directives such as &amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;include(&amp;quot;someOtherFile&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt; which will cause a lookup in the {{path|contents/code/}} directory. Plasmoids (and other Plasma components) are sandboxed into their respective Packages, something that Plasma::Package enforces unless allowExternalPaths is set to true.&lt;br /&gt;
&lt;br /&gt;
== Defining Formats ==&lt;br /&gt;
&lt;br /&gt;
New formats can be defined programmatically using PackageStructure plugins. PackageStructure plugins call addDirectoryDefinition and addFileDefinition methods which define a key string that can be used to reference that resource, the path within the contents directories that it is expected to exist at, supported mimetypes, descriptions suitable for showing to a user (e.g. in an IDE or package creator tool) and whether or not the resource is required. Contents directories are also defined by the PackageStructure plugin.&lt;br /&gt;
&lt;br /&gt;
The structure can be created dynamically at run-time depending on the package itself. This is accomplished by reimplementing the pathChanged method. This also allows one PackageStructure object to be re-used multiple times.&lt;br /&gt;
&lt;br /&gt;
Together, these mechanisms allow for virtually unlimited flexibility in how a Package is structured on disk and what it contains. This makes Plasma Package suitable for the wide variety of use cases it currently fulfills.&lt;br /&gt;
&lt;br /&gt;
== Signing Packages ==&lt;br /&gt;
&lt;br /&gt;
A Plasma Package may be signed with a GPG key. First, a SHA1 hash of the metadata.desktop file and the contents directories must be created and placed in a file called contents.hash that resides at the top level. A GPG signature of the contents.hash file can then be placed in a file called contents.hash.sig. This can then be used to verify the contents of the package at runtime.&lt;br /&gt;
&lt;br /&gt;
Hashes may be generated with the plasmapkg tool as of version 0.2 with the --hash command line option.&lt;br /&gt;
&lt;br /&gt;
== Compression for Redistribution ==&lt;br /&gt;
&lt;br /&gt;
A Plasma Package can be packed into one zip file that contains all the required files. The gzip format is also supported, though zip is generally recommended due to the ability to easily perform random access operations on zip archives. The resulting file is then suffixed with an appropriate identifying ending, such as &amp;quot;.plasmoid&amp;quot; in the case of plasmoids.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Installation can be done by hand, but generally this is accomplished either by using Plasma::PackageStructure::installPackage or with the plasmapkg command line utility. When a Plasma Package is installed, the archive is uncompressed and stored under the package root defined by the Package's structure definition. By default, this is {{path|$APPDATA/plasma/packages}}. By default, the {{path|metadata.desktop}} is copied into the the services directory so that it can easily be found later by KTrader to find all Plasmoids whether they are written in C++ or an interpreted language.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma</id>
		<title>Development/Tutorials/Plasma</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma"/>
				<updated>2011-11-09T11:23:37Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:I18n/Language Navigation Bar|Development/Tutorials/Plasma}}&lt;br /&gt;
&lt;br /&gt;
== QML ==&lt;br /&gt;
Plasmoids that use the QML (aka QtQuick) declarative language to describe their user interface while having the logic of the applet, in JavaScript (QML is essentially a forge between CSS and JavaScript). &lt;br /&gt;
&lt;br /&gt;
This is now the '''recommended''' method of creating plasmoids, where possible. The plasmoid, or applet serves as the visualization for the data which a Plasma::DataEngine contains.&lt;br /&gt;
&lt;br /&gt;
It allows easily the declaring of an interface and to easily create things like ListViews with native Plasma theming. It is what Plasma is leaning the most towards, especially in the Mobile, MediaCenter and KDM shells.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in QML''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/Basic_ListView|Basic List Plasmoid]]&lt;br /&gt;
:''Make a QML ListView which displays basic text objects as items. Utilizes native Plasma theming and animations.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/API|API Reference]]&lt;br /&gt;
:''The QML Plasmoid API. Useful for referencing what is available in the runtime, what are the differences with the pure JavaScript ScriptEngine, the differences between pure Qt QML and Plasma, and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
== C++ ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted|Getting Started With Plasmoids]]&lt;br /&gt;
:''Creating your first plasmoid in C++ with SVG background, icon and text''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted..Some_More|Getting Started With Plasmoids..Some more]] :''A few more starter's tips.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/UsingExtenders|How to use extenders in your Plasmoid]]&lt;br /&gt;
:''A simple example that shows how to use extenders in a Plasmoid.''&lt;br /&gt;
&lt;br /&gt;
;[http://www.linux-magazine.com/w3/issue/114/036-040_plasma.pdf Creating Plasmoids]&lt;br /&gt;
:''May 2010 article from Linux Magazine''&lt;br /&gt;
&lt;br /&gt;
;[http://www.ibm.com/developerworks/linux/library/l-kde-plasmoids/index.html Create Plasmoids using KDevelop]&lt;br /&gt;
:''Article explaining the structure of Plasma and how to create a Plasmoid''&lt;br /&gt;
&lt;br /&gt;
;[http://community.kde.org/User:Mxttie#Adding_configuration Adding configuration to your plasmoid]&lt;br /&gt;
:''Article explaining how to add a configuration dialog to your plasmoid.''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/DataEngines|Writing a DataEngine]]&lt;br /&gt;
:''DataEngines provide a standardized interface to various (read only) data sources for visualizations to use. Learn what a DataEngine is and how to write one of your own.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Services|Writing a Service]]&lt;br /&gt;
:''Services provide a standardized interface for visualizations to perform &amp;quot;write operations&amp;quot;. This can be for example, uploading pasted test to a pastebin service..''&lt;br /&gt;
&lt;br /&gt;
=== PackageStructures ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PackageStructure|Writing a PackageStructure Plugin]]&lt;br /&gt;
:''PackageStructure plugins allow custom Packages to be defined, installed, removed and listed as well as provide access their contents at runtime. Packages may contain any kind of data addons, including scripts.''&lt;br /&gt;
&lt;br /&gt;
=== Runners ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/AbstractRunner|Creating Runners]]&lt;br /&gt;
:''Runners are plugins that provide action-based search functionality in the Plasma workspace &amp;quot;run command&amp;quot; dialog. These plugins can be used by any application that links again libplasma.''&lt;br /&gt;
&lt;br /&gt;
=== Wallpapers ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperHelloWorld|Wallpaper Tutorial 1]]&lt;br /&gt;
:''This tutorial shows you how to make a simple Hello World plasma wallpaper plugin.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperConfiguration|Wallpaper Tutorial 2]]&lt;br /&gt;
:''This tutorial covers how to add configuration options to the wallpaper.''&lt;br /&gt;
&lt;br /&gt;
=== Plasma Shells ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ShellDesign|Creating a Plasma Shell]]&lt;br /&gt;
:''This tutorial covers the essentials of writing a new Plasma shell from scratch. A must-read for anyone creating a new or modifying an existing Plasma Shell. Existing Plasma shells include Plasma Desktop, Plasma Netbook, Plasma Mobile, Plasma Media Center, Plasma Screensaver, Plasma KPart and Plasma KDM, and all follow the patterns documented here.''&lt;br /&gt;
&lt;br /&gt;
==  JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Plasma has built-in JavaScript (also known as ECMAScript, and often referred to as QtScript in the context of Qt) scripting support without requiring any external dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in JavaScript''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/DataEngine|Getting Data]]&lt;br /&gt;
:''How to retreive data from a data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/NowPlaying|Now Playing]]&lt;br /&gt;
:''Slightly more advanced data engine usage: displaying what's currently playing''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/SystemMonitor|System Monitor]]&lt;br /&gt;
:''How to access systemmonitor data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/CheatSheet|Cheat Sheet]]&lt;br /&gt;
:''A cheat sheet, rather than a tutorial, of things to remember and watch out for when developing JavaScript plasmoids''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/API|API Reference]]&lt;br /&gt;
:''The Simplified JavaScript Plasmoid API. Useful for referencing what is available in the runtime and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
=== Other Applications Of Javascript ===&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDestkopScripting|Scripting Plasma Shells]]&lt;br /&gt;
:The KDE Plasma Desktop and Netbook provide means to manage the desktop shell (desktop, panels, widget) via scripts written in JavaScript. This article describes how to take advantage of this feature set as well as documents the full API. This is primarily a system administration tool, but may also be of interest to power users.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/Animations|Javascript Animations]]&lt;br /&gt;
:''How to write Animations using Javascript for use in Plasma applications''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ComicPlugin|Creating Comic Plugins]]&lt;br /&gt;
:''This guide shows you how to create a comic plugin for the comic plasmoid.''&lt;br /&gt;
&lt;br /&gt;
== Python ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Python''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using DataEngines|Using DataEngines]]&lt;br /&gt;
:''How to use DataEngines from a plasmoid''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonPlasmoid|Writing a Plasmoid in Python]]&lt;br /&gt;
:''Writing a simple battery graph in python''&lt;br /&gt;
&lt;br /&gt;
=== Runners ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonRunner|Writing a KRunner plugin in Python]]&lt;br /&gt;
:''Writing a simple krunner plugin in python''&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Ruby''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/SimplePasteApplet|Writing a simple paste applet]]&lt;br /&gt;
:''A tutorial explaining how to set up a plasmoid, create a simple paste applet using widgets and add Plasma features seen elsewhere. Complete with tips for those who have never programmed before.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Blinker|Use SVG artwork in the simplest way possible]]&lt;br /&gt;
:''Follow a fellow student as he asks around about SVG usage and explains why the code examples work. This is a wiki so feel free to add your own insights until this tutorial can be considered complete.''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine using Ruby''&lt;br /&gt;
&lt;br /&gt;
== Web Technologies (HTML/JS/CSS) ==&lt;br /&gt;
;[[Development/Tutorials/Plasma/Web/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in HTML''&lt;br /&gt;
&lt;br /&gt;
== Plasma integration for applications ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Solid_Device_Actions|Creating a Device Notifier action]]&lt;br /&gt;
:''When your application is interested in removable hardware''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ApplicationShell|Integrate Plasma in Applications]]&lt;br /&gt;
:''This tutorial shows you how to make an application dashboard based on Plasma technologies.''&lt;br /&gt;
&lt;br /&gt;
== Packages ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PackageOverview|Plasma Packages]]&lt;br /&gt;
:''An overview of what makes up a Plasma Package and what they are and can be used for.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PackageStructure|Writing a PackageStructure Pluginin C++]]&lt;br /&gt;
:''PackageStructure plugins allow custom Packages to be defined, installed, removed and listed as well as provide access their contents at runtime. Packages may contain any kind of data addons, including scripts.''&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Theme|Creating a Plasma Theme Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma theme''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ThemeDetails|The Plasma Theme Structure In Detail]]&lt;br /&gt;
:''A comprehensive guide to the contents of a Plasma SVG theme, including configuration options, wallpapers, on-disk layout, names of all standard SVG files and every element in them.''&lt;br /&gt;
&lt;br /&gt;
== Activity Templates ==&lt;br /&gt;
&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDesktopScripting#Activity_templates|Creating a Plasma Activity Template Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma Activity Template''&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [[Projects/Plasma|Projects: Plasma]]&lt;br /&gt;
* [http://api.kde.org/4.x-api/kdelibs-apidocs/plasma/html/index.html Plasma api documentation]&lt;br /&gt;
* [http://techbase.kde.org/Projects/Plasma/Eclipse_Integration Plasma Eclipse Integration]&lt;br /&gt;
* The [https://mail.kde.org/mailman/listinfo/plasma-devel plasma-devel mailing list] and #plasma on IRC (irc.freenode.org).&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma</id>
		<title>Development/Tutorials/Plasma</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma"/>
				<updated>2011-11-09T11:22:47Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Themes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:I18n/Language Navigation Bar|Development/Tutorials/Plasma}}&lt;br /&gt;
&lt;br /&gt;
== QML ==&lt;br /&gt;
Plasmoids that use the QML (aka QtQuick) declarative language to describe their user interface while having the logic of the applet, in JavaScript (QML is essentially a forge between CSS and JavaScript). &lt;br /&gt;
&lt;br /&gt;
This is now the '''recommended''' method of creating plasmoids, where possible. The plasmoid, or applet serves as the visualization for the data which a Plasma::DataEngine contains.&lt;br /&gt;
&lt;br /&gt;
It allows easily the declaring of an interface and to easily create things like ListViews with native Plasma theming. It is what Plasma is leaning the most towards, especially in the Mobile, MediaCenter and KDM shells.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in QML''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/Basic_ListView|Basic List Plasmoid]]&lt;br /&gt;
:''Make a QML ListView which displays basic text objects as items. Utilizes native Plasma theming and animations.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/API|API Reference]]&lt;br /&gt;
:''The QML Plasmoid API. Useful for referencing what is available in the runtime, what are the differences with the pure JavaScript ScriptEngine, the differences between pure Qt QML and Plasma, and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
== C++ ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted|Getting Started With Plasmoids]]&lt;br /&gt;
:''Creating your first plasmoid in C++ with SVG background, icon and text''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted..Some_More|Getting Started With Plasmoids..Some more]] :''A few more starter's tips.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/UsingExtenders|How to use extenders in your Plasmoid]]&lt;br /&gt;
:''A simple example that shows how to use extenders in a Plasmoid.''&lt;br /&gt;
&lt;br /&gt;
;[http://www.linux-magazine.com/w3/issue/114/036-040_plasma.pdf Creating Plasmoids]&lt;br /&gt;
:''May 2010 article from Linux Magazine''&lt;br /&gt;
&lt;br /&gt;
;[http://www.ibm.com/developerworks/linux/library/l-kde-plasmoids/index.html Create Plasmoids using KDevelop]&lt;br /&gt;
:''Article explaining the structure of Plasma and how to create a Plasmoid''&lt;br /&gt;
&lt;br /&gt;
;[http://community.kde.org/User:Mxttie#Adding_configuration Adding configuration to your plasmoid]&lt;br /&gt;
:''Article explaining how to add a configuration dialog to your plasmoid.''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/DataEngines|Writing a DataEngine]]&lt;br /&gt;
:''DataEngines provide a standardized interface to various (read only) data sources for visualizations to use. Learn what a DataEngine is and how to write one of your own.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Services|Writing a Service]]&lt;br /&gt;
:''Services provide a standardized interface for visualizations to perform &amp;quot;write operations&amp;quot;. This can be for example, uploading pasted test to a pastebin service..''&lt;br /&gt;
&lt;br /&gt;
=== PackageStructures ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PackageStructure|Writing a PackageStructure Plugin]]&lt;br /&gt;
:''PackageStructure plugins allow custom Packages to be defined, installed, removed and listed as well as provide access their contents at runtime. Packages may contain any kind of data addons, including scripts.''&lt;br /&gt;
&lt;br /&gt;
=== Runners ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/AbstractRunner|Creating Runners]]&lt;br /&gt;
:''Runners are plugins that provide action-based search functionality in the Plasma workspace &amp;quot;run command&amp;quot; dialog. These plugins can be used by any application that links again libplasma.''&lt;br /&gt;
&lt;br /&gt;
=== Wallpapers ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperHelloWorld|Wallpaper Tutorial 1]]&lt;br /&gt;
:''This tutorial shows you how to make a simple Hello World plasma wallpaper plugin.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperConfiguration|Wallpaper Tutorial 2]]&lt;br /&gt;
:''This tutorial covers how to add configuration options to the wallpaper.''&lt;br /&gt;
&lt;br /&gt;
=== Plasma Shells ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ShellDesign|Creating a Plasma Shell]]&lt;br /&gt;
:''This tutorial covers the essentials of writing a new Plasma shell from scratch. A must-read for anyone creating a new or modifying an existing Plasma Shell. Existing Plasma shells include Plasma Desktop, Plasma Netbook, Plasma Mobile, Plasma Media Center, Plasma Screensaver, Plasma KPart and Plasma KDM, and all follow the patterns documented here.''&lt;br /&gt;
&lt;br /&gt;
==  JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Plasma has built-in JavaScript (also known as ECMAScript, and often referred to as QtScript in the context of Qt) scripting support without requiring any external dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in JavaScript''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/DataEngine|Getting Data]]&lt;br /&gt;
:''How to retreive data from a data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/NowPlaying|Now Playing]]&lt;br /&gt;
:''Slightly more advanced data engine usage: displaying what's currently playing''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/SystemMonitor|System Monitor]]&lt;br /&gt;
:''How to access systemmonitor data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/CheatSheet|Cheat Sheet]]&lt;br /&gt;
:''A cheat sheet, rather than a tutorial, of things to remember and watch out for when developing JavaScript plasmoids''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/API|API Reference]]&lt;br /&gt;
:''The Simplified JavaScript Plasmoid API. Useful for referencing what is available in the runtime and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
=== Other Applications Of Javascript ===&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDestkopScripting|Scripting Plasma Shells]]&lt;br /&gt;
:The KDE Plasma Desktop and Netbook provide means to manage the desktop shell (desktop, panels, widget) via scripts written in JavaScript. This article describes how to take advantage of this feature set as well as documents the full API. This is primarily a system administration tool, but may also be of interest to power users.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/Animations|Javascript Animations]]&lt;br /&gt;
:''How to write Animations using Javascript for use in Plasma applications''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ComicPlugin|Creating Comic Plugins]]&lt;br /&gt;
:''This guide shows you how to create a comic plugin for the comic plasmoid.''&lt;br /&gt;
&lt;br /&gt;
== Python ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Python''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using DataEngines|Using DataEngines]]&lt;br /&gt;
:''How to use DataEngines from a plasmoid''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonPlasmoid|Writing a Plasmoid in Python]]&lt;br /&gt;
:''Writing a simple battery graph in python''&lt;br /&gt;
&lt;br /&gt;
=== Runners ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonRunner|Writing a KRunner plugin in Python]]&lt;br /&gt;
:''Writing a simple krunner plugin in python''&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Ruby''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/SimplePasteApplet|Writing a simple paste applet]]&lt;br /&gt;
:''A tutorial explaining how to set up a plasmoid, create a simple paste applet using widgets and add Plasma features seen elsewhere. Complete with tips for those who have never programmed before.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Blinker|Use SVG artwork in the simplest way possible]]&lt;br /&gt;
:''Follow a fellow student as he asks around about SVG usage and explains why the code examples work. This is a wiki so feel free to add your own insights until this tutorial can be considered complete.''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine using Ruby''&lt;br /&gt;
&lt;br /&gt;
== Web Technologies (HTML/JS/CSS) ==&lt;br /&gt;
;[[Development/Tutorials/Plasma/Web/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in HTML''&lt;br /&gt;
&lt;br /&gt;
== Plasma integration for applications ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Solid_Device_Actions|Creating a Device Notifier action]]&lt;br /&gt;
:''When your application is interested in removable hardware''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ApplicationShell|Integrate Plasma in Applications]]&lt;br /&gt;
:''This tutorial shows you how to make an application dashboard based on Plasma technologies.''&lt;br /&gt;
&lt;br /&gt;
== Packages ==&lt;br /&gt;
&lt;br /&gt;
;[Development/Tutorials/Plasma/PackageOverview|Plasma Packages]]&lt;br /&gt;
:''An overview of what makes up a Plasma Package and what they are and can be used for.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PackageStructure|Writing a PackageStructure Pluginin C++]]&lt;br /&gt;
:''PackageStructure plugins allow custom Packages to be defined, installed, removed and listed as well as provide access their contents at runtime. Packages may contain any kind of data addons, including scripts.''&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Theme|Creating a Plasma Theme Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma theme''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ThemeDetails|The Plasma Theme Structure In Detail]]&lt;br /&gt;
:''A comprehensive guide to the contents of a Plasma SVG theme, including configuration options, wallpapers, on-disk layout, names of all standard SVG files and every element in them.''&lt;br /&gt;
&lt;br /&gt;
== Activity Templates ==&lt;br /&gt;
&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDesktopScripting#Activity_templates|Creating a Plasma Activity Template Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma Activity Template''&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [[Projects/Plasma|Projects: Plasma]]&lt;br /&gt;
* [http://api.kde.org/4.x-api/kdelibs-apidocs/plasma/html/index.html Plasma api documentation]&lt;br /&gt;
* [http://techbase.kde.org/Projects/Plasma/Eclipse_Integration Plasma Eclipse Integration]&lt;br /&gt;
* The [https://mail.kde.org/mailman/listinfo/plasma-devel plasma-devel mailing list] and #plasma on IRC (irc.freenode.org).&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma</id>
		<title>Development/Tutorials/Plasma</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma"/>
				<updated>2011-11-09T11:20:42Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* DataEngines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:I18n/Language Navigation Bar|Development/Tutorials/Plasma}}&lt;br /&gt;
&lt;br /&gt;
== QML ==&lt;br /&gt;
Plasmoids that use the QML (aka QtQuick) declarative language to describe their user interface while having the logic of the applet, in JavaScript (QML is essentially a forge between CSS and JavaScript). &lt;br /&gt;
&lt;br /&gt;
This is now the '''recommended''' method of creating plasmoids, where possible. The plasmoid, or applet serves as the visualization for the data which a Plasma::DataEngine contains.&lt;br /&gt;
&lt;br /&gt;
It allows easily the declaring of an interface and to easily create things like ListViews with native Plasma theming. It is what Plasma is leaning the most towards, especially in the Mobile, MediaCenter and KDM shells.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in QML''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/Basic_ListView|Basic List Plasmoid]]&lt;br /&gt;
:''Make a QML ListView which displays basic text objects as items. Utilizes native Plasma theming and animations.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/API|API Reference]]&lt;br /&gt;
:''The QML Plasmoid API. Useful for referencing what is available in the runtime, what are the differences with the pure JavaScript ScriptEngine, the differences between pure Qt QML and Plasma, and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
== C++ ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted|Getting Started With Plasmoids]]&lt;br /&gt;
:''Creating your first plasmoid in C++ with SVG background, icon and text''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted..Some_More|Getting Started With Plasmoids..Some more]] :''A few more starter's tips.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/UsingExtenders|How to use extenders in your Plasmoid]]&lt;br /&gt;
:''A simple example that shows how to use extenders in a Plasmoid.''&lt;br /&gt;
&lt;br /&gt;
;[http://www.linux-magazine.com/w3/issue/114/036-040_plasma.pdf Creating Plasmoids]&lt;br /&gt;
:''May 2010 article from Linux Magazine''&lt;br /&gt;
&lt;br /&gt;
;[http://www.ibm.com/developerworks/linux/library/l-kde-plasmoids/index.html Create Plasmoids using KDevelop]&lt;br /&gt;
:''Article explaining the structure of Plasma and how to create a Plasmoid''&lt;br /&gt;
&lt;br /&gt;
;[http://community.kde.org/User:Mxttie#Adding_configuration Adding configuration to your plasmoid]&lt;br /&gt;
:''Article explaining how to add a configuration dialog to your plasmoid.''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/DataEngines|Writing a DataEngine]]&lt;br /&gt;
:''DataEngines provide a standardized interface to various (read only) data sources for visualizations to use. Learn what a DataEngine is and how to write one of your own.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Services|Writing a Service]]&lt;br /&gt;
:''Services provide a standardized interface for visualizations to perform &amp;quot;write operations&amp;quot;. This can be for example, uploading pasted test to a pastebin service..''&lt;br /&gt;
&lt;br /&gt;
=== PackageStructures ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PackageStructure|Writing a PackageStructure Plugin]]&lt;br /&gt;
:''PackageStructure plugins allow custom Packages to be defined, installed, removed and listed as well as provide access their contents at runtime. Packages may contain any kind of data addons, including scripts.''&lt;br /&gt;
&lt;br /&gt;
=== Runners ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/AbstractRunner|Creating Runners]]&lt;br /&gt;
:''Runners are plugins that provide action-based search functionality in the Plasma workspace &amp;quot;run command&amp;quot; dialog. These plugins can be used by any application that links again libplasma.''&lt;br /&gt;
&lt;br /&gt;
=== Wallpapers ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperHelloWorld|Wallpaper Tutorial 1]]&lt;br /&gt;
:''This tutorial shows you how to make a simple Hello World plasma wallpaper plugin.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperConfiguration|Wallpaper Tutorial 2]]&lt;br /&gt;
:''This tutorial covers how to add configuration options to the wallpaper.''&lt;br /&gt;
&lt;br /&gt;
=== Plasma Shells ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ShellDesign|Creating a Plasma Shell]]&lt;br /&gt;
:''This tutorial covers the essentials of writing a new Plasma shell from scratch. A must-read for anyone creating a new or modifying an existing Plasma Shell. Existing Plasma shells include Plasma Desktop, Plasma Netbook, Plasma Mobile, Plasma Media Center, Plasma Screensaver, Plasma KPart and Plasma KDM, and all follow the patterns documented here.''&lt;br /&gt;
&lt;br /&gt;
==  JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Plasma has built-in JavaScript (also known as ECMAScript, and often referred to as QtScript in the context of Qt) scripting support without requiring any external dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in JavaScript''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/DataEngine|Getting Data]]&lt;br /&gt;
:''How to retreive data from a data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/NowPlaying|Now Playing]]&lt;br /&gt;
:''Slightly more advanced data engine usage: displaying what's currently playing''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/SystemMonitor|System Monitor]]&lt;br /&gt;
:''How to access systemmonitor data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/CheatSheet|Cheat Sheet]]&lt;br /&gt;
:''A cheat sheet, rather than a tutorial, of things to remember and watch out for when developing JavaScript plasmoids''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/API|API Reference]]&lt;br /&gt;
:''The Simplified JavaScript Plasmoid API. Useful for referencing what is available in the runtime and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
=== Other Applications Of Javascript ===&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDestkopScripting|Scripting Plasma Shells]]&lt;br /&gt;
:The KDE Plasma Desktop and Netbook provide means to manage the desktop shell (desktop, panels, widget) via scripts written in JavaScript. This article describes how to take advantage of this feature set as well as documents the full API. This is primarily a system administration tool, but may also be of interest to power users.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/Animations|Javascript Animations]]&lt;br /&gt;
:''How to write Animations using Javascript for use in Plasma applications''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ComicPlugin|Creating Comic Plugins]]&lt;br /&gt;
:''This guide shows you how to create a comic plugin for the comic plasmoid.''&lt;br /&gt;
&lt;br /&gt;
== Python ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Python''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using DataEngines|Using DataEngines]]&lt;br /&gt;
:''How to use DataEngines from a plasmoid''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonPlasmoid|Writing a Plasmoid in Python]]&lt;br /&gt;
:''Writing a simple battery graph in python''&lt;br /&gt;
&lt;br /&gt;
=== Runners ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonRunner|Writing a KRunner plugin in Python]]&lt;br /&gt;
:''Writing a simple krunner plugin in python''&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Ruby''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/SimplePasteApplet|Writing a simple paste applet]]&lt;br /&gt;
:''A tutorial explaining how to set up a plasmoid, create a simple paste applet using widgets and add Plasma features seen elsewhere. Complete with tips for those who have never programmed before.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Blinker|Use SVG artwork in the simplest way possible]]&lt;br /&gt;
:''Follow a fellow student as he asks around about SVG usage and explains why the code examples work. This is a wiki so feel free to add your own insights until this tutorial can be considered complete.''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine using Ruby''&lt;br /&gt;
&lt;br /&gt;
== Web Technologies (HTML/JS/CSS) ==&lt;br /&gt;
;[[Development/Tutorials/Plasma/Web/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in HTML''&lt;br /&gt;
&lt;br /&gt;
== Plasma integration for applications ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Solid_Device_Actions|Creating a Device Notifier action]]&lt;br /&gt;
:''When your application is interested in removable hardware''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ApplicationShell|Integrate Plasma in Applications]]&lt;br /&gt;
:''This tutorial shows you how to make an application dashboard based on Plasma technologies.''&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Theme|Creating a Plasma Theme Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma theme''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ThemeDetails|The Plasma Theme Structure In Detail]]&lt;br /&gt;
:''A comprehensive guide to the contents of a Plasma SVG theme, including configuration options, wallpapers, on-disk layout, names of all standard SVG files and every element in them.''&lt;br /&gt;
&lt;br /&gt;
== Activity Templates ==&lt;br /&gt;
&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDesktopScripting#Activity_templates|Creating a Plasma Activity Template Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma Activity Template''&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [[Projects/Plasma|Projects: Plasma]]&lt;br /&gt;
* [http://api.kde.org/4.x-api/kdelibs-apidocs/plasma/html/index.html Plasma api documentation]&lt;br /&gt;
* [http://techbase.kde.org/Projects/Plasma/Eclipse_Integration Plasma Eclipse Integration]&lt;br /&gt;
* The [https://mail.kde.org/mailman/listinfo/plasma-devel plasma-devel mailing list] and #plasma on IRC (irc.freenode.org).&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma</id>
		<title>Development/Tutorials/Plasma</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma"/>
				<updated>2011-11-09T11:19:30Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Ruby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:I18n/Language Navigation Bar|Development/Tutorials/Plasma}}&lt;br /&gt;
&lt;br /&gt;
== QML ==&lt;br /&gt;
Plasmoids that use the QML (aka QtQuick) declarative language to describe their user interface while having the logic of the applet, in JavaScript (QML is essentially a forge between CSS and JavaScript). &lt;br /&gt;
&lt;br /&gt;
This is now the '''recommended''' method of creating plasmoids, where possible. The plasmoid, or applet serves as the visualization for the data which a Plasma::DataEngine contains.&lt;br /&gt;
&lt;br /&gt;
It allows easily the declaring of an interface and to easily create things like ListViews with native Plasma theming. It is what Plasma is leaning the most towards, especially in the Mobile, MediaCenter and KDM shells.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in QML''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/Basic_ListView|Basic List Plasmoid]]&lt;br /&gt;
:''Make a QML ListView which displays basic text objects as items. Utilizes native Plasma theming and animations.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/API|API Reference]]&lt;br /&gt;
:''The QML Plasmoid API. Useful for referencing what is available in the runtime, what are the differences with the pure JavaScript ScriptEngine, the differences between pure Qt QML and Plasma, and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
== C++ ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted|Getting Started With Plasmoids]]&lt;br /&gt;
:''Creating your first plasmoid in C++ with SVG background, icon and text''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted..Some_More|Getting Started With Plasmoids..Some more]] :''A few more starter's tips.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/UsingExtenders|How to use extenders in your Plasmoid]]&lt;br /&gt;
:''A simple example that shows how to use extenders in a Plasmoid.''&lt;br /&gt;
&lt;br /&gt;
;[http://www.linux-magazine.com/w3/issue/114/036-040_plasma.pdf Creating Plasmoids]&lt;br /&gt;
:''May 2010 article from Linux Magazine''&lt;br /&gt;
&lt;br /&gt;
;[http://www.ibm.com/developerworks/linux/library/l-kde-plasmoids/index.html Create Plasmoids using KDevelop]&lt;br /&gt;
:''Article explaining the structure of Plasma and how to create a Plasmoid''&lt;br /&gt;
&lt;br /&gt;
;[http://community.kde.org/User:Mxttie#Adding_configuration Adding configuration to your plasmoid]&lt;br /&gt;
:''Article explaining how to add a configuration dialog to your plasmoid.''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/DataEngines|Writing a DataEngine]]&lt;br /&gt;
:''DataEngines provide a standardized interface to various (read only) data sources for visualizations to use. Learn what a DataEngine is and how to write one of your own.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Services|Writing a Service]]&lt;br /&gt;
:''Services provide a standardized interface for visualizations to perform &amp;quot;write operations&amp;quot;. This can be for example, uploading pasted test to a pastebin service..''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PackageStructure|Writing a PackageStructure Plugin]]&lt;br /&gt;
:''PackageStructure plugins allow custom Packages to be defined, installed, removed and listed as well as provide access their contents at runtime. Packages may contain any kind of data addons, including scripts.''&lt;br /&gt;
&lt;br /&gt;
=== Runners ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/AbstractRunner|Creating Runners]]&lt;br /&gt;
:''Runners are plugins that provide action-based search functionality in the Plasma workspace &amp;quot;run command&amp;quot; dialog. These plugins can be used by any application that links again libplasma.''&lt;br /&gt;
&lt;br /&gt;
=== Wallpapers ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperHelloWorld|Wallpaper Tutorial 1]]&lt;br /&gt;
:''This tutorial shows you how to make a simple Hello World plasma wallpaper plugin.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperConfiguration|Wallpaper Tutorial 2]]&lt;br /&gt;
:''This tutorial covers how to add configuration options to the wallpaper.''&lt;br /&gt;
&lt;br /&gt;
=== Plasma Shells ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ShellDesign|Creating a Plasma Shell]]&lt;br /&gt;
:''This tutorial covers the essentials of writing a new Plasma shell from scratch. A must-read for anyone creating a new or modifying an existing Plasma Shell. Existing Plasma shells include Plasma Desktop, Plasma Netbook, Plasma Mobile, Plasma Media Center, Plasma Screensaver, Plasma KPart and Plasma KDM, and all follow the patterns documented here.''&lt;br /&gt;
&lt;br /&gt;
==  JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Plasma has built-in JavaScript (also known as ECMAScript, and often referred to as QtScript in the context of Qt) scripting support without requiring any external dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in JavaScript''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/DataEngine|Getting Data]]&lt;br /&gt;
:''How to retreive data from a data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/NowPlaying|Now Playing]]&lt;br /&gt;
:''Slightly more advanced data engine usage: displaying what's currently playing''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/SystemMonitor|System Monitor]]&lt;br /&gt;
:''How to access systemmonitor data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/CheatSheet|Cheat Sheet]]&lt;br /&gt;
:''A cheat sheet, rather than a tutorial, of things to remember and watch out for when developing JavaScript plasmoids''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/API|API Reference]]&lt;br /&gt;
:''The Simplified JavaScript Plasmoid API. Useful for referencing what is available in the runtime and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
=== Other Applications Of Javascript ===&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDestkopScripting|Scripting Plasma Shells]]&lt;br /&gt;
:The KDE Plasma Desktop and Netbook provide means to manage the desktop shell (desktop, panels, widget) via scripts written in JavaScript. This article describes how to take advantage of this feature set as well as documents the full API. This is primarily a system administration tool, but may also be of interest to power users.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/Animations|Javascript Animations]]&lt;br /&gt;
:''How to write Animations using Javascript for use in Plasma applications''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ComicPlugin|Creating Comic Plugins]]&lt;br /&gt;
:''This guide shows you how to create a comic plugin for the comic plasmoid.''&lt;br /&gt;
&lt;br /&gt;
== Python ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Python''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using DataEngines|Using DataEngines]]&lt;br /&gt;
:''How to use DataEngines from a plasmoid''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonPlasmoid|Writing a Plasmoid in Python]]&lt;br /&gt;
:''Writing a simple battery graph in python''&lt;br /&gt;
&lt;br /&gt;
=== Runners ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonRunner|Writing a KRunner plugin in Python]]&lt;br /&gt;
:''Writing a simple krunner plugin in python''&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Ruby''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/SimplePasteApplet|Writing a simple paste applet]]&lt;br /&gt;
:''A tutorial explaining how to set up a plasmoid, create a simple paste applet using widgets and add Plasma features seen elsewhere. Complete with tips for those who have never programmed before.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Blinker|Use SVG artwork in the simplest way possible]]&lt;br /&gt;
:''Follow a fellow student as he asks around about SVG usage and explains why the code examples work. This is a wiki so feel free to add your own insights until this tutorial can be considered complete.''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine using Ruby''&lt;br /&gt;
&lt;br /&gt;
== Web Technologies (HTML/JS/CSS) ==&lt;br /&gt;
;[[Development/Tutorials/Plasma/Web/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in HTML''&lt;br /&gt;
&lt;br /&gt;
== Plasma integration for applications ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Solid_Device_Actions|Creating a Device Notifier action]]&lt;br /&gt;
:''When your application is interested in removable hardware''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ApplicationShell|Integrate Plasma in Applications]]&lt;br /&gt;
:''This tutorial shows you how to make an application dashboard based on Plasma technologies.''&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Theme|Creating a Plasma Theme Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma theme''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ThemeDetails|The Plasma Theme Structure In Detail]]&lt;br /&gt;
:''A comprehensive guide to the contents of a Plasma SVG theme, including configuration options, wallpapers, on-disk layout, names of all standard SVG files and every element in them.''&lt;br /&gt;
&lt;br /&gt;
== Activity Templates ==&lt;br /&gt;
&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDesktopScripting#Activity_templates|Creating a Plasma Activity Template Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma Activity Template''&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [[Projects/Plasma|Projects: Plasma]]&lt;br /&gt;
* [http://api.kde.org/4.x-api/kdelibs-apidocs/plasma/html/index.html Plasma api documentation]&lt;br /&gt;
* [http://techbase.kde.org/Projects/Plasma/Eclipse_Integration Plasma Eclipse Integration]&lt;br /&gt;
* The [https://mail.kde.org/mailman/listinfo/plasma-devel plasma-devel mailing list] and #plasma on IRC (irc.freenode.org).&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma</id>
		<title>Development/Tutorials/Plasma</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma"/>
				<updated>2011-11-09T11:18:56Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Python */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:I18n/Language Navigation Bar|Development/Tutorials/Plasma}}&lt;br /&gt;
&lt;br /&gt;
== QML ==&lt;br /&gt;
Plasmoids that use the QML (aka QtQuick) declarative language to describe their user interface while having the logic of the applet, in JavaScript (QML is essentially a forge between CSS and JavaScript). &lt;br /&gt;
&lt;br /&gt;
This is now the '''recommended''' method of creating plasmoids, where possible. The plasmoid, or applet serves as the visualization for the data which a Plasma::DataEngine contains.&lt;br /&gt;
&lt;br /&gt;
It allows easily the declaring of an interface and to easily create things like ListViews with native Plasma theming. It is what Plasma is leaning the most towards, especially in the Mobile, MediaCenter and KDM shells.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in QML''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/Basic_ListView|Basic List Plasmoid]]&lt;br /&gt;
:''Make a QML ListView which displays basic text objects as items. Utilizes native Plasma theming and animations.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/API|API Reference]]&lt;br /&gt;
:''The QML Plasmoid API. Useful for referencing what is available in the runtime, what are the differences with the pure JavaScript ScriptEngine, the differences between pure Qt QML and Plasma, and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
== C++ ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted|Getting Started With Plasmoids]]&lt;br /&gt;
:''Creating your first plasmoid in C++ with SVG background, icon and text''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted..Some_More|Getting Started With Plasmoids..Some more]] :''A few more starter's tips.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/UsingExtenders|How to use extenders in your Plasmoid]]&lt;br /&gt;
:''A simple example that shows how to use extenders in a Plasmoid.''&lt;br /&gt;
&lt;br /&gt;
;[http://www.linux-magazine.com/w3/issue/114/036-040_plasma.pdf Creating Plasmoids]&lt;br /&gt;
:''May 2010 article from Linux Magazine''&lt;br /&gt;
&lt;br /&gt;
;[http://www.ibm.com/developerworks/linux/library/l-kde-plasmoids/index.html Create Plasmoids using KDevelop]&lt;br /&gt;
:''Article explaining the structure of Plasma and how to create a Plasmoid''&lt;br /&gt;
&lt;br /&gt;
;[http://community.kde.org/User:Mxttie#Adding_configuration Adding configuration to your plasmoid]&lt;br /&gt;
:''Article explaining how to add a configuration dialog to your plasmoid.''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/DataEngines|Writing a DataEngine]]&lt;br /&gt;
:''DataEngines provide a standardized interface to various (read only) data sources for visualizations to use. Learn what a DataEngine is and how to write one of your own.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Services|Writing a Service]]&lt;br /&gt;
:''Services provide a standardized interface for visualizations to perform &amp;quot;write operations&amp;quot;. This can be for example, uploading pasted test to a pastebin service..''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PackageStructure|Writing a PackageStructure Plugin]]&lt;br /&gt;
:''PackageStructure plugins allow custom Packages to be defined, installed, removed and listed as well as provide access their contents at runtime. Packages may contain any kind of data addons, including scripts.''&lt;br /&gt;
&lt;br /&gt;
=== Runners ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/AbstractRunner|Creating Runners]]&lt;br /&gt;
:''Runners are plugins that provide action-based search functionality in the Plasma workspace &amp;quot;run command&amp;quot; dialog. These plugins can be used by any application that links again libplasma.''&lt;br /&gt;
&lt;br /&gt;
=== Wallpapers ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperHelloWorld|Wallpaper Tutorial 1]]&lt;br /&gt;
:''This tutorial shows you how to make a simple Hello World plasma wallpaper plugin.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperConfiguration|Wallpaper Tutorial 2]]&lt;br /&gt;
:''This tutorial covers how to add configuration options to the wallpaper.''&lt;br /&gt;
&lt;br /&gt;
=== Plasma Shells ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ShellDesign|Creating a Plasma Shell]]&lt;br /&gt;
:''This tutorial covers the essentials of writing a new Plasma shell from scratch. A must-read for anyone creating a new or modifying an existing Plasma Shell. Existing Plasma shells include Plasma Desktop, Plasma Netbook, Plasma Mobile, Plasma Media Center, Plasma Screensaver, Plasma KPart and Plasma KDM, and all follow the patterns documented here.''&lt;br /&gt;
&lt;br /&gt;
==  JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Plasma has built-in JavaScript (also known as ECMAScript, and often referred to as QtScript in the context of Qt) scripting support without requiring any external dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in JavaScript''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/DataEngine|Getting Data]]&lt;br /&gt;
:''How to retreive data from a data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/NowPlaying|Now Playing]]&lt;br /&gt;
:''Slightly more advanced data engine usage: displaying what's currently playing''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/SystemMonitor|System Monitor]]&lt;br /&gt;
:''How to access systemmonitor data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/CheatSheet|Cheat Sheet]]&lt;br /&gt;
:''A cheat sheet, rather than a tutorial, of things to remember and watch out for when developing JavaScript plasmoids''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/API|API Reference]]&lt;br /&gt;
:''The Simplified JavaScript Plasmoid API. Useful for referencing what is available in the runtime and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
=== Other Applications Of Javascript ===&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDestkopScripting|Scripting Plasma Shells]]&lt;br /&gt;
:The KDE Plasma Desktop and Netbook provide means to manage the desktop shell (desktop, panels, widget) via scripts written in JavaScript. This article describes how to take advantage of this feature set as well as documents the full API. This is primarily a system administration tool, but may also be of interest to power users.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/Animations|Javascript Animations]]&lt;br /&gt;
:''How to write Animations using Javascript for use in Plasma applications''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ComicPlugin|Creating Comic Plugins]]&lt;br /&gt;
:''This guide shows you how to create a comic plugin for the comic plasmoid.''&lt;br /&gt;
&lt;br /&gt;
== Python ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Python''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using DataEngines|Using DataEngines]]&lt;br /&gt;
:''How to use DataEngines from a plasmoid''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonPlasmoid|Writing a Plasmoid in Python]]&lt;br /&gt;
:''Writing a simple battery graph in python''&lt;br /&gt;
&lt;br /&gt;
=== Runners ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonRunner|Writing a KRunner plugin in Python]]&lt;br /&gt;
:''Writing a simple krunner plugin in python''&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Ruby''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/SimplePasteApplet|Writing a simple paste applet]]&lt;br /&gt;
:''A tutorial explaining how to set up a plasmoid, create a simple paste applet using widgets and add Plasma features seen elsewhere. Complete with tips for those who have never programmed before.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine using Ruby''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Blinker|Use SVG artwork in the simplest way possible]]&lt;br /&gt;
:''Follow a fellow student as he asks around about SVG usage and explains why the code examples work. This is a wiki so feel free to add your own insights until this tutorial can be considered complete.''&lt;br /&gt;
&lt;br /&gt;
== Web Technologies (HTML/JS/CSS) ==&lt;br /&gt;
;[[Development/Tutorials/Plasma/Web/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in HTML''&lt;br /&gt;
&lt;br /&gt;
== Plasma integration for applications ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Solid_Device_Actions|Creating a Device Notifier action]]&lt;br /&gt;
:''When your application is interested in removable hardware''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ApplicationShell|Integrate Plasma in Applications]]&lt;br /&gt;
:''This tutorial shows you how to make an application dashboard based on Plasma technologies.''&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Theme|Creating a Plasma Theme Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma theme''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ThemeDetails|The Plasma Theme Structure In Detail]]&lt;br /&gt;
:''A comprehensive guide to the contents of a Plasma SVG theme, including configuration options, wallpapers, on-disk layout, names of all standard SVG files and every element in them.''&lt;br /&gt;
&lt;br /&gt;
== Activity Templates ==&lt;br /&gt;
&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDesktopScripting#Activity_templates|Creating a Plasma Activity Template Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma Activity Template''&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [[Projects/Plasma|Projects: Plasma]]&lt;br /&gt;
* [http://api.kde.org/4.x-api/kdelibs-apidocs/plasma/html/index.html Plasma api documentation]&lt;br /&gt;
* [http://techbase.kde.org/Projects/Plasma/Eclipse_Integration Plasma Eclipse Integration]&lt;br /&gt;
* The [https://mail.kde.org/mailman/listinfo/plasma-devel plasma-devel mailing list] and #plasma on IRC (irc.freenode.org).&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma</id>
		<title>Development/Tutorials/Plasma</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma"/>
				<updated>2011-11-09T11:18:20Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* C++ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:I18n/Language Navigation Bar|Development/Tutorials/Plasma}}&lt;br /&gt;
&lt;br /&gt;
== QML ==&lt;br /&gt;
Plasmoids that use the QML (aka QtQuick) declarative language to describe their user interface while having the logic of the applet, in JavaScript (QML is essentially a forge between CSS and JavaScript). &lt;br /&gt;
&lt;br /&gt;
This is now the '''recommended''' method of creating plasmoids, where possible. The plasmoid, or applet serves as the visualization for the data which a Plasma::DataEngine contains.&lt;br /&gt;
&lt;br /&gt;
It allows easily the declaring of an interface and to easily create things like ListViews with native Plasma theming. It is what Plasma is leaning the most towards, especially in the Mobile, MediaCenter and KDM shells.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in QML''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/Basic_ListView|Basic List Plasmoid]]&lt;br /&gt;
:''Make a QML ListView which displays basic text objects as items. Utilizes native Plasma theming and animations.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/API|API Reference]]&lt;br /&gt;
:''The QML Plasmoid API. Useful for referencing what is available in the runtime, what are the differences with the pure JavaScript ScriptEngine, the differences between pure Qt QML and Plasma, and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
== C++ ==&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted|Getting Started With Plasmoids]]&lt;br /&gt;
:''Creating your first plasmoid in C++ with SVG background, icon and text''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted..Some_More|Getting Started With Plasmoids..Some more]] :''A few more starter's tips.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/UsingExtenders|How to use extenders in your Plasmoid]]&lt;br /&gt;
:''A simple example that shows how to use extenders in a Plasmoid.''&lt;br /&gt;
&lt;br /&gt;
;[http://www.linux-magazine.com/w3/issue/114/036-040_plasma.pdf Creating Plasmoids]&lt;br /&gt;
:''May 2010 article from Linux Magazine''&lt;br /&gt;
&lt;br /&gt;
;[http://www.ibm.com/developerworks/linux/library/l-kde-plasmoids/index.html Create Plasmoids using KDevelop]&lt;br /&gt;
:''Article explaining the structure of Plasma and how to create a Plasmoid''&lt;br /&gt;
&lt;br /&gt;
;[http://community.kde.org/User:Mxttie#Adding_configuration Adding configuration to your plasmoid]&lt;br /&gt;
:''Article explaining how to add a configuration dialog to your plasmoid.''&lt;br /&gt;
&lt;br /&gt;
=== DataEngines ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/DataEngines|Writing a DataEngine]]&lt;br /&gt;
:''DataEngines provide a standardized interface to various (read only) data sources for visualizations to use. Learn what a DataEngine is and how to write one of your own.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Services|Writing a Service]]&lt;br /&gt;
:''Services provide a standardized interface for visualizations to perform &amp;quot;write operations&amp;quot;. This can be for example, uploading pasted test to a pastebin service..''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PackageStructure|Writing a PackageStructure Plugin]]&lt;br /&gt;
:''PackageStructure plugins allow custom Packages to be defined, installed, removed and listed as well as provide access their contents at runtime. Packages may contain any kind of data addons, including scripts.''&lt;br /&gt;
&lt;br /&gt;
=== Runners ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/AbstractRunner|Creating Runners]]&lt;br /&gt;
:''Runners are plugins that provide action-based search functionality in the Plasma workspace &amp;quot;run command&amp;quot; dialog. These plugins can be used by any application that links again libplasma.''&lt;br /&gt;
&lt;br /&gt;
=== Wallpapers ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperHelloWorld|Wallpaper Tutorial 1]]&lt;br /&gt;
:''This tutorial shows you how to make a simple Hello World plasma wallpaper plugin.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperConfiguration|Wallpaper Tutorial 2]]&lt;br /&gt;
:''This tutorial covers how to add configuration options to the wallpaper.''&lt;br /&gt;
&lt;br /&gt;
=== Plasma Shells ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ShellDesign|Creating a Plasma Shell]]&lt;br /&gt;
:''This tutorial covers the essentials of writing a new Plasma shell from scratch. A must-read for anyone creating a new or modifying an existing Plasma Shell. Existing Plasma shells include Plasma Desktop, Plasma Netbook, Plasma Mobile, Plasma Media Center, Plasma Screensaver, Plasma KPart and Plasma KDM, and all follow the patterns documented here.''&lt;br /&gt;
&lt;br /&gt;
==  JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Plasma has built-in JavaScript (also known as ECMAScript, and often referred to as QtScript in the context of Qt) scripting support without requiring any external dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in JavaScript''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/DataEngine|Getting Data]]&lt;br /&gt;
:''How to retreive data from a data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/NowPlaying|Now Playing]]&lt;br /&gt;
:''Slightly more advanced data engine usage: displaying what's currently playing''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/SystemMonitor|System Monitor]]&lt;br /&gt;
:''How to access systemmonitor data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/CheatSheet|Cheat Sheet]]&lt;br /&gt;
:''A cheat sheet, rather than a tutorial, of things to remember and watch out for when developing JavaScript plasmoids''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/API|API Reference]]&lt;br /&gt;
:''The Simplified JavaScript Plasmoid API. Useful for referencing what is available in the runtime and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
=== Other Applications Of Javascript ===&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDestkopScripting|Scripting Plasma Shells]]&lt;br /&gt;
:The KDE Plasma Desktop and Netbook provide means to manage the desktop shell (desktop, panels, widget) via scripts written in JavaScript. This article describes how to take advantage of this feature set as well as documents the full API. This is primarily a system administration tool, but may also be of interest to power users.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/Animations|Javascript Animations]]&lt;br /&gt;
:''How to write Animations using Javascript for use in Plasma applications''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ComicPlugin|Creating Comic Plugins]]&lt;br /&gt;
:''This guide shows you how to create a comic plugin for the comic plasmoid.''&lt;br /&gt;
&lt;br /&gt;
== Python ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Python''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using DataEngines|Using DataEngines]]&lt;br /&gt;
:''How to use DataEngines from a plasmoid''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonPlasmoid|Writing a Plasmoid in Python]]&lt;br /&gt;
:''Writing a simple battery graph in python''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonRunner|Writing a KRunner plugin in Python]]&lt;br /&gt;
:''Writing a simple krunner plugin in python''&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Ruby''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/SimplePasteApplet|Writing a simple paste applet]]&lt;br /&gt;
:''A tutorial explaining how to set up a plasmoid, create a simple paste applet using widgets and add Plasma features seen elsewhere. Complete with tips for those who have never programmed before.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine using Ruby''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Blinker|Use SVG artwork in the simplest way possible]]&lt;br /&gt;
:''Follow a fellow student as he asks around about SVG usage and explains why the code examples work. This is a wiki so feel free to add your own insights until this tutorial can be considered complete.''&lt;br /&gt;
&lt;br /&gt;
== Web Technologies (HTML/JS/CSS) ==&lt;br /&gt;
;[[Development/Tutorials/Plasma/Web/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in HTML''&lt;br /&gt;
&lt;br /&gt;
== Plasma integration for applications ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Solid_Device_Actions|Creating a Device Notifier action]]&lt;br /&gt;
:''When your application is interested in removable hardware''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ApplicationShell|Integrate Plasma in Applications]]&lt;br /&gt;
:''This tutorial shows you how to make an application dashboard based on Plasma technologies.''&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Theme|Creating a Plasma Theme Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma theme''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ThemeDetails|The Plasma Theme Structure In Detail]]&lt;br /&gt;
:''A comprehensive guide to the contents of a Plasma SVG theme, including configuration options, wallpapers, on-disk layout, names of all standard SVG files and every element in them.''&lt;br /&gt;
&lt;br /&gt;
== Activity Templates ==&lt;br /&gt;
&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDesktopScripting#Activity_templates|Creating a Plasma Activity Template Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma Activity Template''&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [[Projects/Plasma|Projects: Plasma]]&lt;br /&gt;
* [http://api.kde.org/4.x-api/kdelibs-apidocs/plasma/html/index.html Plasma api documentation]&lt;br /&gt;
* [http://techbase.kde.org/Projects/Plasma/Eclipse_Integration Plasma Eclipse Integration]&lt;br /&gt;
* The [https://mail.kde.org/mailman/listinfo/plasma-devel plasma-devel mailing list] and #plasma on IRC (irc.freenode.org).&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma</id>
		<title>Development/Tutorials/Plasma</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma"/>
				<updated>2011-11-09T11:16:24Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:I18n/Language Navigation Bar|Development/Tutorials/Plasma}}&lt;br /&gt;
&lt;br /&gt;
== QML ==&lt;br /&gt;
Plasmoids that use the QML (aka QtQuick) declarative language to describe their user interface while having the logic of the applet, in JavaScript (QML is essentially a forge between CSS and JavaScript). &lt;br /&gt;
&lt;br /&gt;
This is now the '''recommended''' method of creating plasmoids, where possible. The plasmoid, or applet serves as the visualization for the data which a Plasma::DataEngine contains.&lt;br /&gt;
&lt;br /&gt;
It allows easily the declaring of an interface and to easily create things like ListViews with native Plasma theming. It is what Plasma is leaning the most towards, especially in the Mobile, MediaCenter and KDM shells.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in QML''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/Basic_ListView|Basic List Plasmoid]]&lt;br /&gt;
:''Make a QML ListView which displays basic text objects as items. Utilizes native Plasma theming and animations.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/API|API Reference]]&lt;br /&gt;
:''The QML Plasmoid API. Useful for referencing what is available in the runtime, what are the differences with the pure JavaScript ScriptEngine, the differences between pure Qt QML and Plasma, and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
== C++ ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted|Getting Started With Plasmoids]]&lt;br /&gt;
:''Creating your first plasmoid in C++ with SVG background, icon and text''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted..Some_More|Getting Started With Plasmoids..Some more]] :''A few more starter's tips.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/DataEngines|Writing a DataEngine]]&lt;br /&gt;
:''DataEngines provide a standardized interface to various (read only) data sources for visualizations to use. Learn what a DataEngine is and how to write one of your own.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Services|Writing a Service]]&lt;br /&gt;
:''Services provide a standardized interface for visualizations to perform &amp;quot;write operations&amp;quot;. This can be for example, uploading pasted test to a pastebin service..''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PackageStructure|Writing a PackageStructure Plugin]]&lt;br /&gt;
:''PackageStructure plugins allow custom Packages to be defined, installed, removed and listed as well as provide access their contents at runtime. Packages may contain any kind of data addons, including scripts.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/UsingExtenders|How to use extenders in your Plasmoid]]&lt;br /&gt;
:''A simple example that shows how to use extenders in a Plasmoid.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/AbstractRunner|Creating Runners]]&lt;br /&gt;
:''Runners are plugins that provide action-based search functionality in the Plasma workspace &amp;quot;run command&amp;quot; dialog. These plugins can be used by any application that links again libplasma.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperHelloWorld|Wallpaper Tutorial 1]]&lt;br /&gt;
:''This tutorial shows you how to make a simple Hello World plasma wallpaper plugin.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperConfiguration|Wallpaper Tutorial 2]]&lt;br /&gt;
:''This tutorial covers how to add configuration options to the wallpaper.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ShellDesign|Creating a Plasma Shell]]&lt;br /&gt;
:''This tutorial covers the essentials of writing a new Plasma shell from scratch. A must-read for anyone creating a new or modifying an existing Plasma Shell. Existing Plasma shells include Plasma Desktop, Plasma Netbook, Plasma Mobile, Plasma Media Center, Plasma Screensaver, Plasma KPart and Plasma KDM, and all follow the patterns documented here.''&lt;br /&gt;
&lt;br /&gt;
;[http://www.linux-magazine.com/w3/issue/114/036-040_plasma.pdf Creating Plasmoids]&lt;br /&gt;
:''May 2010 article from Linux Magazine''&lt;br /&gt;
&lt;br /&gt;
;[http://www.ibm.com/developerworks/linux/library/l-kde-plasmoids/index.html Create Plasmoids using KDevelop]&lt;br /&gt;
:''Article explaining the structure of Plasma and how to create a Plasmoid''&lt;br /&gt;
&lt;br /&gt;
;[http://community.kde.org/User:Mxttie#Adding_configuration Adding configuration to your plasmoid]&lt;br /&gt;
:''Article explaining how to add a configuration dialog to your plasmoid.''&lt;br /&gt;
&lt;br /&gt;
==  JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Plasma has built-in JavaScript (also known as ECMAScript, and often referred to as QtScript in the context of Qt) scripting support without requiring any external dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in JavaScript''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/DataEngine|Getting Data]]&lt;br /&gt;
:''How to retreive data from a data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/NowPlaying|Now Playing]]&lt;br /&gt;
:''Slightly more advanced data engine usage: displaying what's currently playing''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/SystemMonitor|System Monitor]]&lt;br /&gt;
:''How to access systemmonitor data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/CheatSheet|Cheat Sheet]]&lt;br /&gt;
:''A cheat sheet, rather than a tutorial, of things to remember and watch out for when developing JavaScript plasmoids''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/API|API Reference]]&lt;br /&gt;
:''The Simplified JavaScript Plasmoid API. Useful for referencing what is available in the runtime and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
=== Other Applications Of Javascript ===&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDestkopScripting|Scripting Plasma Shells]]&lt;br /&gt;
:The KDE Plasma Desktop and Netbook provide means to manage the desktop shell (desktop, panels, widget) via scripts written in JavaScript. This article describes how to take advantage of this feature set as well as documents the full API. This is primarily a system administration tool, but may also be of interest to power users.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/Animations|Javascript Animations]]&lt;br /&gt;
:''How to write Animations using Javascript for use in Plasma applications''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ComicPlugin|Creating Comic Plugins]]&lt;br /&gt;
:''This guide shows you how to create a comic plugin for the comic plasmoid.''&lt;br /&gt;
&lt;br /&gt;
== Python ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Python''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using DataEngines|Using DataEngines]]&lt;br /&gt;
:''How to use DataEngines from a plasmoid''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonPlasmoid|Writing a Plasmoid in Python]]&lt;br /&gt;
:''Writing a simple battery graph in python''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonRunner|Writing a KRunner plugin in Python]]&lt;br /&gt;
:''Writing a simple krunner plugin in python''&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Ruby''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/SimplePasteApplet|Writing a simple paste applet]]&lt;br /&gt;
:''A tutorial explaining how to set up a plasmoid, create a simple paste applet using widgets and add Plasma features seen elsewhere. Complete with tips for those who have never programmed before.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine using Ruby''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Blinker|Use SVG artwork in the simplest way possible]]&lt;br /&gt;
:''Follow a fellow student as he asks around about SVG usage and explains why the code examples work. This is a wiki so feel free to add your own insights until this tutorial can be considered complete.''&lt;br /&gt;
&lt;br /&gt;
== Web Technologies (HTML/JS/CSS) ==&lt;br /&gt;
;[[Development/Tutorials/Plasma/Web/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in HTML''&lt;br /&gt;
&lt;br /&gt;
== Plasma integration for applications ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Solid_Device_Actions|Creating a Device Notifier action]]&lt;br /&gt;
:''When your application is interested in removable hardware''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ApplicationShell|Integrate Plasma in Applications]]&lt;br /&gt;
:''This tutorial shows you how to make an application dashboard based on Plasma technologies.''&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Theme|Creating a Plasma Theme Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma theme''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ThemeDetails|The Plasma Theme Structure In Detail]]&lt;br /&gt;
:''A comprehensive guide to the contents of a Plasma SVG theme, including configuration options, wallpapers, on-disk layout, names of all standard SVG files and every element in them.''&lt;br /&gt;
&lt;br /&gt;
== Activity Templates ==&lt;br /&gt;
&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDesktopScripting#Activity_templates|Creating a Plasma Activity Template Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma Activity Template''&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [[Projects/Plasma|Projects: Plasma]]&lt;br /&gt;
* [http://api.kde.org/4.x-api/kdelibs-apidocs/plasma/html/index.html Plasma api documentation]&lt;br /&gt;
* [http://techbase.kde.org/Projects/Plasma/Eclipse_Integration Plasma Eclipse Integration]&lt;br /&gt;
* The [https://mail.kde.org/mailman/listinfo/plasma-devel plasma-devel mailing list] and #plasma on IRC (irc.freenode.org).&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma</id>
		<title>Development/Tutorials/Plasma</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma"/>
				<updated>2011-11-09T11:15:11Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:I18n/Language Navigation Bar|Development/Tutorials/Plasma}}&lt;br /&gt;
&lt;br /&gt;
== QML ==&lt;br /&gt;
Plasmoids that use the QML (aka QtQuick) declarative language to describe their user interface while having the logic of the applet, in JavaScript (QML is essentially a forge between CSS and JavaScript). &lt;br /&gt;
&lt;br /&gt;
This is now the '''recommended''' method of creating plasmoids, where possible. The plasmoid, or applet serves as the visualization for the data which a Plasma::DataEngine contains.&lt;br /&gt;
&lt;br /&gt;
It allows easily the declaring of an interface and to easily create things like ListViews with native Plasma theming. It is what Plasma is leaning the most towards, especially in the Mobile, MediaCenter and KDM shells.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in QML''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/Basic_ListView|Basic List Plasmoid]]&lt;br /&gt;
:''Make a QML ListView which displays basic text objects as items. Utilizes native Plasma theming and animations.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/QML/API|API Reference]]&lt;br /&gt;
:''The QML Plasmoid API. Useful for referencing what is available in the runtime, what are the differences with the pure JavaScript ScriptEngine, the differences between pure Qt QML and Plasma, and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
== C++ ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted|Getting Started With Plasmoids]]&lt;br /&gt;
:''Creating your first plasmoid in C++ with SVG background, icon and text''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/GettingStarted..Some_More|Getting Started With Plasmoids..Some more]] :''A few more starter's tips.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/DataEngines|Writing a DataEngine]]&lt;br /&gt;
:''DataEngines provide a standardized interface to various (read only) data sources for visualizations to use. Learn what a DataEngine is and how to write one of your own.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Services|Writing a Service]]&lt;br /&gt;
:''Services provide a standardized interface for visualizations to perform &amp;quot;write operations&amp;quot;. This can be for example, uploading pasted test to a pastebin service..''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PackageStructure|Writing a PackageStructure Plugin]]&lt;br /&gt;
:''PackageStructure plugins allow custom Packages to be defined, installed, removed and listed as well as provide access their contents at runtime. Packages may contain any kind of data addons, including scripts.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/UsingExtenders|How to use extenders in your Plasmoid]]&lt;br /&gt;
:''A simple example that shows how to use extenders in a Plasmoid.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/AbstractRunner|Creating Runners]]&lt;br /&gt;
:''Runners are plugins that provide action-based search functionality in the Plasma workspace &amp;quot;run command&amp;quot; dialog. These plugins can be used by any application that links again libplasma.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperHelloWorld|Wallpaper Tutorial 1]]&lt;br /&gt;
:''This tutorial shows you how to make a simple Hello World plasma wallpaper plugin.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/WallpaperConfiguration|Wallpaper Tutorial 2]]&lt;br /&gt;
:''This tutorial covers how to add configuration options to the wallpaper.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ShellDesign|Creating a Plasma Shell]]&lt;br /&gt;
:''This tutorial covers the essentials of writing a new Plasma shell from scratch. A must-read for anyone creating a new or modifying an existing Plasma Shell. Existing Plasma shells include Plasma Desktop, Plasma Netbook, Plasma Mobile, Plasma Media Center, Plasma Screensaver, Plasma KPart and Plasma KDM, and all follow the patterns documented here.''&lt;br /&gt;
&lt;br /&gt;
;[http://www.linux-magazine.com/w3/issue/114/036-040_plasma.pdf Creating Plasmoids]&lt;br /&gt;
:''May 2010 article from Linux Magazine''&lt;br /&gt;
&lt;br /&gt;
;[http://www.ibm.com/developerworks/linux/library/l-kde-plasmoids/index.html Create Plasmoids using KDevelop]&lt;br /&gt;
:''Article explaining the structure of Plasma and how to create a Plasmoid''&lt;br /&gt;
&lt;br /&gt;
;[http://community.kde.org/User:Mxttie#Adding_configuration Adding configuration to your plasmoid]&lt;br /&gt;
:''Article explaining how to add a configuration dialog to your plasmoid.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ApplicationShell|Integrate Plasma in Applications]]&lt;br /&gt;
:''This tutorial shows you how to make an application dashboard based on Plasma technologies.''&lt;br /&gt;
&lt;br /&gt;
==  JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Plasma has built-in JavaScript (also known as ECMAScript, and often referred to as QtScript in the context of Qt) scripting support without requiring any external dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Plasmoids ===&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in JavaScript''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/DataEngine|Getting Data]]&lt;br /&gt;
:''How to retreive data from a data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/NowPlaying|Now Playing]]&lt;br /&gt;
:''Slightly more advanced data engine usage: displaying what's currently playing''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/SystemMonitor|System Monitor]]&lt;br /&gt;
:''How to access systemmonitor data engine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/CheatSheet|Cheat Sheet]]&lt;br /&gt;
:''A cheat sheet, rather than a tutorial, of things to remember and watch out for when developing JavaScript plasmoids''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/API|API Reference]]&lt;br /&gt;
:''The Simplified JavaScript Plasmoid API. Useful for referencing what is available in the runtime and as a study aid for the tutorials above.''&lt;br /&gt;
&lt;br /&gt;
=== Other Applications Of Javascript ===&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDestkopScripting|Scripting Plasma Shells]]&lt;br /&gt;
:The KDE Plasma Desktop and Netbook provide means to manage the desktop shell (desktop, panels, widget) via scripts written in JavaScript. This article describes how to take advantage of this feature set as well as documents the full API. This is primarily a system administration tool, but may also be of interest to power users.&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/JavaScript/Animations|Javascript Animations]]&lt;br /&gt;
:''How to write Animations using Javascript for use in Plasma applications''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ComicPlugin|Creating Comic Plugins]]&lt;br /&gt;
:''This guide shows you how to create a comic plugin for the comic plasmoid.''&lt;br /&gt;
&lt;br /&gt;
== Python ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Python''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Using DataEngines|Using DataEngines]]&lt;br /&gt;
:''How to use DataEngines from a plasmoid''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Python/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonPlasmoid|Writing a Plasmoid in Python]]&lt;br /&gt;
:''Writing a simple battery graph in python''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/PythonRunner|Writing a KRunner plugin in Python]]&lt;br /&gt;
:''Writing a simple krunner plugin in python''&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in Ruby''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Using widgets|Using widgets]]&lt;br /&gt;
:''Introduction to using Plasma widgets''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/SimplePasteApplet|Writing a simple paste applet]]&lt;br /&gt;
:''A tutorial explaining how to set up a plasmoid, create a simple paste applet using widgets and add Plasma features seen elsewhere. Complete with tips for those who have never programmed before.''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Writing DataEngines|Writing DataEngines]]&lt;br /&gt;
:''How to write your own Plasma DataEngine using Ruby''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Ruby/Blinker|Use SVG artwork in the simplest way possible]]&lt;br /&gt;
:''Follow a fellow student as he asks around about SVG usage and explains why the code examples work. This is a wiki so feel free to add your own insights until this tutorial can be considered complete.''&lt;br /&gt;
&lt;br /&gt;
== Web Technologies (HTML/JS/CSS) ==&lt;br /&gt;
;[[Development/Tutorials/Plasma/Web/GettingStarted|Getting Started]]&lt;br /&gt;
:''Creating and running your first plasmoid in HTML''&lt;br /&gt;
&lt;br /&gt;
== Plasma integration for applications ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Solid_Device_Actions|Creating a Device Notifier action]]&lt;br /&gt;
:''When your application is interested in removable hardware''&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/Theme|Creating a Plasma Theme Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma theme''&lt;br /&gt;
&lt;br /&gt;
;[[Development/Tutorials/Plasma/ThemeDetails|The Plasma Theme Structure In Detail]]&lt;br /&gt;
:''A comprehensive guide to the contents of a Plasma SVG theme, including configuration options, wallpapers, on-disk layout, names of all standard SVG files and every element in them.''&lt;br /&gt;
&lt;br /&gt;
== Activity Templates ==&lt;br /&gt;
&lt;br /&gt;
;[[KDE_System_Administration/PlasmaDesktopScripting#Activity_templates|Creating a Plasma Activity Template Quickstart]]&lt;br /&gt;
:''A quick guide to creating your first Plasma Activity Template''&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [[Projects/Plasma|Projects: Plasma]]&lt;br /&gt;
* [http://api.kde.org/4.x-api/kdelibs-apidocs/plasma/html/index.html Plasma api documentation]&lt;br /&gt;
* [http://techbase.kde.org/Projects/Plasma/Eclipse_Integration Plasma Eclipse Integration]&lt;br /&gt;
* The [https://mail.kde.org/mailman/listinfo/plasma-devel plasma-devel mailing list] and #plasma on IRC (irc.freenode.org).&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject"/>
				<updated>2011-10-27T14:44:35Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Context menu */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= The Global plasmoid Object =&lt;br /&gt;
There is a global object available to the Plasmoid called, appropriately, &amp;quot;plasmoid&amp;quot;. It has a number of useful properties (some of which are read only, but many of which are read/write), functions, constant values and callbacks. Each are enumerated below.&lt;br /&gt;
All of those are valid for both JavaScript and QML bindings.&lt;br /&gt;
&lt;br /&gt;
= Callbacks  =&lt;br /&gt;
&lt;br /&gt;
See the section on Events above.&lt;br /&gt;
&lt;br /&gt;
There are some events that are generated by Plasma for the Plasmoid. These can often be caught by providing a function assigned to a specific name in the plasmoid object. For instance, to get notified of form factor changes, one would provide a formFactorChanged method as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
plasmoid.formFactorChanged = function() { &lt;br /&gt;
&lt;br /&gt;
    print(&amp;quot;the form factor has changed to: &amp;quot; + plasmoid.formFactor())&lt;br /&gt;
&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following callbacks are used to notify the Plasmoid of changes in its running environment:&lt;br /&gt;
&lt;br /&gt;
* '''configChanged()'''&lt;br /&gt;
* '''currentActivityChanged()'''&lt;br /&gt;
* '''formFactorChanged()'''&lt;br /&gt;
* '''immutabilityChanged()'''&lt;br /&gt;
* '''locationChanged()'''&lt;br /&gt;
* '''sizeChanged()'''&lt;br /&gt;
&lt;br /&gt;
Other callbacks include:&lt;br /&gt;
* '''dataUpdated(String source, Map[String, Any] data)''': used to pass in DataEngine updates&lt;br /&gt;
* '''activate()''': called when the widget is activated by the user, e.g. by a keyboard shortcut. Useful for setting the focus on a specific input widget, for instance. (API v2)&lt;br /&gt;
* '''initExtenderItem(Extender extender)''': Called when an Extender should be set up. (API v2)&lt;br /&gt;
* '''popupEvent(boolean shown)''': called on PopupApplets when the popup is shown or hidden. (API v2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In API v2, all of these callbacks can also be used as events. So, for instance, instead of implementing plasmoid.popupEvent, one could also write:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
plasmoid.addEventListener('popupEvent', function(shown) { print('shown? ' + shown) } )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This would also suppress any calls to plasmoid.popupEvent.&lt;br /&gt;
&lt;br /&gt;
Further documentation on these callbacks can be found in the relevant sections below.&lt;br /&gt;
&lt;br /&gt;
= Environment  =&lt;br /&gt;
&lt;br /&gt;
A set of read-only properties (and in most cases notification functions) that tell the Plasmoid about its current environment: &lt;br /&gt;
&lt;br /&gt;
* '''apiVersion''': the integer version of the Simplified JavaScript API in the current execution environment; can be used to change behaviour or usage of functions depending on the version number.&lt;br /&gt;
&lt;br /&gt;
* '''formFactor''': one of Planar (e.g. on a desktop or in an application main view), Horizontal, Vertical or MediaCenter. When the form factor changes, the plasmoid.formFactorChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''size''': the size of the Plasmoid, expressed in QSizeF (explained below). when it changes, plasmoid.sizeChanged() will be called.&lt;br /&gt;
&lt;br /&gt;
* '''location''': one of Floating (no specific location), Desktop (on the application's main view are), FullScreen, LeftEdge, RightEdge, TopEdge or ButtomEdge. When the location changes, the plasmoid.locationChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''immutable''': this property is set to true when the Plasmoid is set to not be movable or otherwise changeable, and false otherwise. Configuration is still usually allowed in this state. When the immutability changes, the plasmoid.immutabilityChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''currentActivity''': the current contextual activity name. When the current activity changes, the plasmoid.currentActivityChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''shouldConserveResources''': true if the plasmoid should not be doing anything that would create too much draw on power, e.g. when on a device with low battery power it may be a good idea not to run a computationally expensive but optional animation&lt;br /&gt;
&lt;br /&gt;
* '''userConfiguring''': true if the user configuration interface is currently being displayed.&lt;br /&gt;
&lt;br /&gt;
= Properties  =&lt;br /&gt;
A set of read/write properties that allow the Plasmoid to set various visual or functional properties: &lt;br /&gt;
&lt;br /&gt;
* ''AspectRatioMode'' '''aspectRatioMode''': defines how to treat the aspect ratio of a Plasmoid when resizing it. See the [[#AspectRatioMode|AspectRatioMode]] documentation for values and their meaning. &lt;br /&gt;
&lt;br /&gt;
* ''BackgroundHints'' '''backgroundHints''': defines how the background of the widget is rendered. See the [[#BackgroundHints|BackgroundHints]] documentation for values and their meaning. &lt;br /&gt;
&lt;br /&gt;
* ''boolean'' '''busy''': set to true when the Plasmoid is currently processing or waiting for data and the user interface should be blocked while doing so; will generally show a full-Plasmoid animated overlay to denote business&lt;br /&gt;
&lt;br /&gt;
= Geometry  =&lt;br /&gt;
&lt;br /&gt;
Read Only Properties: &lt;br /&gt;
&lt;br /&gt;
* ''QRectF'' '''rect''': the current rect of the Plasmoid; note that the top left may be not be the origin point (0,0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* '''resize(width, height)'''&lt;br /&gt;
* '''setMinimumSize(width, height)'''&lt;br /&gt;
* '''setPreferredSize(width, height)'''&lt;br /&gt;
* '''setBackgroundHints(background)''' - use '''NoBackground''' as value if you want to remove the default plasmoid background box.&lt;br /&gt;
* '''popupIcon(QIcon(&amp;quot;some icon&amp;quot;))''' - set icon to show when the plasmoid is added to the taskbar. NOTE if the plasmoid is made in QML, you MUST specify a default size for the main Item. This size will be used for the plasmoid when added to the taskbar&lt;br /&gt;
&lt;br /&gt;
= Painting and Layout  =&lt;br /&gt;
&lt;br /&gt;
To paint directly on to the canvas, a widget may implement the paintInterface function in the plasmoid object: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
    plasmoid.paintInterface = function(painter) { /* painting code goes here*/ }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
See the Painting section below for information about helpful classes and functions that can be used when implementing a paintInterface function. &lt;br /&gt;
&lt;br /&gt;
Read/Write Properties: &lt;br /&gt;
&lt;br /&gt;
* ''Layout'' '''layout''': the QGraphicsLayout associated with the Plasmoid for laying out top level items; this property is read-write, though the property is not usually set as one can simply do &amp;quot;new LinearLayout&amp;quot; (or one of the other layout classes provided) and it will be automatically associated with the Plasmoid.&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* '''update()''': triggers a full repaint of the Plasmoid.&lt;br /&gt;
* '''update(QRectF rect)''' triggers a repaint of the rect area of the Plasmoid.&lt;br /&gt;
* '''failedToLaunch(bool failed[, string reason])''' sets the launch status of the Plasmoid; if set to true, the script will stop executing and the reason message, if any, will be displayed to the user.&lt;br /&gt;
&lt;br /&gt;
= Access To Packaged Files  =&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* ''string'' '''file(string type[, string fileName])''': returns the path to a file in the Plasmoid package of the given type, optionally with a file name to match, e.g. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var path = plasmoid.file(&amp;quot;mainscript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
or &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var pm = new QPixmap(plasmoid.file(&amp;quot;images&amp;quot;, &amp;quot;mypixmap.png&amp;quot;))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''bool'' '''include(string filename)''': attempts to include the script defined from the package's code directory&lt;br /&gt;
&lt;br /&gt;
= Configuration Data  =&lt;br /&gt;
Configuration values can be defined using [[Development/Tutorials/Using_KConfig_XT|KConfig XT]] XML files in the {{path|contents/config/}} directory of the Plasmoid's package. The default file that is looked for and used is {{path|contents/config/main.xml}}.&lt;br /&gt;
&lt;br /&gt;
== Accessing Configuration Data  ==&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''activeConfig''': The current active configuration description. For instance, setting it to &amp;quot;foo&amp;quot; would cause the Plasmoid to try and reference the {{path|contents/config/foo.xml}} KConfigXT file. Setting this to an empty string will switch to the main.xml file.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''any'' '''readConfig(String key)''': reads the value from the configuration data for the given key as defined by the currently active configuration.&lt;br /&gt;
&lt;br /&gt;
* '''writeConfig(String key, any value) ''': writes a value to the configuration store under the given key&lt;br /&gt;
&lt;br /&gt;
== User Customization  ==&lt;br /&gt;
&lt;br /&gt;
User customization can be offered by providing a Qt Designer file called {{path|contents/ui/config.ui}} in the Plasmoid's package.&lt;br /&gt;
&lt;br /&gt;
Callbacks:&lt;br /&gt;
* '''configChanged()''': callback function called when the configuration is changed external to the Plasmoid, e.g. when the user changes settings in a configuration dialog.&lt;br /&gt;
&lt;br /&gt;
= Context menu =&lt;br /&gt;
&lt;br /&gt;
It's possible to add some items to the popup menu of the Plasmoid.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setAction(String name, String text, String icon, String shortcut)''': adds an item to the context menu with the given text and icon; you need to define '''plasmoid.action_&amp;lt;name&amp;gt;''' function, where &amp;lt;name&amp;gt; is the first argument for setAction call, and this function will be called each time user clicks the item&lt;br /&gt;
* '''setActionSeparator(String name)''': (API v5) adds a separator item to the context menu&lt;br /&gt;
* '''removeAction(String name)''': removes the item with &amp;lt;name&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject"/>
				<updated>2011-10-27T14:43:13Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Context menu */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= The Global plasmoid Object =&lt;br /&gt;
There is a global object available to the Plasmoid called, appropriately, &amp;quot;plasmoid&amp;quot;. It has a number of useful properties (some of which are read only, but many of which are read/write), functions, constant values and callbacks. Each are enumerated below.&lt;br /&gt;
All of those are valid for both JavaScript and QML bindings.&lt;br /&gt;
&lt;br /&gt;
= Callbacks  =&lt;br /&gt;
&lt;br /&gt;
See the section on Events above.&lt;br /&gt;
&lt;br /&gt;
There are some events that are generated by Plasma for the Plasmoid. These can often be caught by providing a function assigned to a specific name in the plasmoid object. For instance, to get notified of form factor changes, one would provide a formFactorChanged method as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
plasmoid.formFactorChanged = function() { &lt;br /&gt;
&lt;br /&gt;
    print(&amp;quot;the form factor has changed to: &amp;quot; + plasmoid.formFactor())&lt;br /&gt;
&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following callbacks are used to notify the Plasmoid of changes in its running environment:&lt;br /&gt;
&lt;br /&gt;
* '''configChanged()'''&lt;br /&gt;
* '''currentActivityChanged()'''&lt;br /&gt;
* '''formFactorChanged()'''&lt;br /&gt;
* '''immutabilityChanged()'''&lt;br /&gt;
* '''locationChanged()'''&lt;br /&gt;
* '''sizeChanged()'''&lt;br /&gt;
&lt;br /&gt;
Other callbacks include:&lt;br /&gt;
* '''dataUpdated(String source, Map[String, Any] data)''': used to pass in DataEngine updates&lt;br /&gt;
* '''activate()''': called when the widget is activated by the user, e.g. by a keyboard shortcut. Useful for setting the focus on a specific input widget, for instance. (API v2)&lt;br /&gt;
* '''initExtenderItem(Extender extender)''': Called when an Extender should be set up. (API v2)&lt;br /&gt;
* '''popupEvent(boolean shown)''': called on PopupApplets when the popup is shown or hidden. (API v2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In API v2, all of these callbacks can also be used as events. So, for instance, instead of implementing plasmoid.popupEvent, one could also write:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
plasmoid.addEventListener('popupEvent', function(shown) { print('shown? ' + shown) } )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This would also suppress any calls to plasmoid.popupEvent.&lt;br /&gt;
&lt;br /&gt;
Further documentation on these callbacks can be found in the relevant sections below.&lt;br /&gt;
&lt;br /&gt;
= Environment  =&lt;br /&gt;
&lt;br /&gt;
A set of read-only properties (and in most cases notification functions) that tell the Plasmoid about its current environment: &lt;br /&gt;
&lt;br /&gt;
* '''apiVersion''': the integer version of the Simplified JavaScript API in the current execution environment; can be used to change behaviour or usage of functions depending on the version number.&lt;br /&gt;
&lt;br /&gt;
* '''formFactor''': one of Planar (e.g. on a desktop or in an application main view), Horizontal, Vertical or MediaCenter. When the form factor changes, the plasmoid.formFactorChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''size''': the size of the Plasmoid, expressed in QSizeF (explained below). when it changes, plasmoid.sizeChanged() will be called.&lt;br /&gt;
&lt;br /&gt;
* '''location''': one of Floating (no specific location), Desktop (on the application's main view are), FullScreen, LeftEdge, RightEdge, TopEdge or ButtomEdge. When the location changes, the plasmoid.locationChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''immutable''': this property is set to true when the Plasmoid is set to not be movable or otherwise changeable, and false otherwise. Configuration is still usually allowed in this state. When the immutability changes, the plasmoid.immutabilityChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''currentActivity''': the current contextual activity name. When the current activity changes, the plasmoid.currentActivityChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''shouldConserveResources''': true if the plasmoid should not be doing anything that would create too much draw on power, e.g. when on a device with low battery power it may be a good idea not to run a computationally expensive but optional animation&lt;br /&gt;
&lt;br /&gt;
* '''userConfiguring''': true if the user configuration interface is currently being displayed.&lt;br /&gt;
&lt;br /&gt;
= Properties  =&lt;br /&gt;
A set of read/write properties that allow the Plasmoid to set various visual or functional properties: &lt;br /&gt;
&lt;br /&gt;
* ''AspectRatioMode'' '''aspectRatioMode''': defines how to treat the aspect ratio of a Plasmoid when resizing it. See the [[#AspectRatioMode|AspectRatioMode]] documentation for values and their meaning. &lt;br /&gt;
&lt;br /&gt;
* ''BackgroundHints'' '''backgroundHints''': defines how the background of the widget is rendered. See the [[#BackgroundHints|BackgroundHints]] documentation for values and their meaning. &lt;br /&gt;
&lt;br /&gt;
* ''boolean'' '''busy''': set to true when the Plasmoid is currently processing or waiting for data and the user interface should be blocked while doing so; will generally show a full-Plasmoid animated overlay to denote business&lt;br /&gt;
&lt;br /&gt;
= Geometry  =&lt;br /&gt;
&lt;br /&gt;
Read Only Properties: &lt;br /&gt;
&lt;br /&gt;
* ''QRectF'' '''rect''': the current rect of the Plasmoid; note that the top left may be not be the origin point (0,0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* '''resize(width, height)'''&lt;br /&gt;
* '''setMinimumSize(width, height)'''&lt;br /&gt;
* '''setPreferredSize(width, height)'''&lt;br /&gt;
* '''setBackgroundHints(background)''' - use '''NoBackground''' as value if you want to remove the default plasmoid background box.&lt;br /&gt;
* '''popupIcon(QIcon(&amp;quot;some icon&amp;quot;))''' - set icon to show when the plasmoid is added to the taskbar. NOTE if the plasmoid is made in QML, you MUST specify a default size for the main Item. This size will be used for the plasmoid when added to the taskbar&lt;br /&gt;
&lt;br /&gt;
= Painting and Layout  =&lt;br /&gt;
&lt;br /&gt;
To paint directly on to the canvas, a widget may implement the paintInterface function in the plasmoid object: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
    plasmoid.paintInterface = function(painter) { /* painting code goes here*/ }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
See the Painting section below for information about helpful classes and functions that can be used when implementing a paintInterface function. &lt;br /&gt;
&lt;br /&gt;
Read/Write Properties: &lt;br /&gt;
&lt;br /&gt;
* ''Layout'' '''layout''': the QGraphicsLayout associated with the Plasmoid for laying out top level items; this property is read-write, though the property is not usually set as one can simply do &amp;quot;new LinearLayout&amp;quot; (or one of the other layout classes provided) and it will be automatically associated with the Plasmoid.&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* '''update()''': triggers a full repaint of the Plasmoid.&lt;br /&gt;
* '''update(QRectF rect)''' triggers a repaint of the rect area of the Plasmoid.&lt;br /&gt;
* '''failedToLaunch(bool failed[, string reason])''' sets the launch status of the Plasmoid; if set to true, the script will stop executing and the reason message, if any, will be displayed to the user.&lt;br /&gt;
&lt;br /&gt;
= Access To Packaged Files  =&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* ''string'' '''file(string type[, string fileName])''': returns the path to a file in the Plasmoid package of the given type, optionally with a file name to match, e.g. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var path = plasmoid.file(&amp;quot;mainscript&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
or &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;var pm = new QPixmap(plasmoid.file(&amp;quot;images&amp;quot;, &amp;quot;mypixmap.png&amp;quot;))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''bool'' '''include(string filename)''': attempts to include the script defined from the package's code directory&lt;br /&gt;
&lt;br /&gt;
= Configuration Data  =&lt;br /&gt;
Configuration values can be defined using [[Development/Tutorials/Using_KConfig_XT|KConfig XT]] XML files in the {{path|contents/config/}} directory of the Plasmoid's package. The default file that is looked for and used is {{path|contents/config/main.xml}}.&lt;br /&gt;
&lt;br /&gt;
== Accessing Configuration Data  ==&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''activeConfig''': The current active configuration description. For instance, setting it to &amp;quot;foo&amp;quot; would cause the Plasmoid to try and reference the {{path|contents/config/foo.xml}} KConfigXT file. Setting this to an empty string will switch to the main.xml file.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''any'' '''readConfig(String key)''': reads the value from the configuration data for the given key as defined by the currently active configuration.&lt;br /&gt;
&lt;br /&gt;
* '''writeConfig(String key, any value) ''': writes a value to the configuration store under the given key&lt;br /&gt;
&lt;br /&gt;
== User Customization  ==&lt;br /&gt;
&lt;br /&gt;
User customization can be offered by providing a Qt Designer file called {{path|contents/ui/config.ui}} in the Plasmoid's package.&lt;br /&gt;
&lt;br /&gt;
Callbacks:&lt;br /&gt;
* '''configChanged()''': callback function called when the configuration is changed external to the Plasmoid, e.g. when the user changes settings in a configuration dialog.&lt;br /&gt;
&lt;br /&gt;
= Context menu =&lt;br /&gt;
&lt;br /&gt;
It's possible to add some items to the popup menu of the Plasmoid.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setAction(String name, String text, String icon, String shortcut)''': adds an item to the context menu with the given text and icon; you need to define '''plasmoid.action_&amp;lt;name&amp;gt;''' function, where &amp;lt;name&amp;gt; is the first argument for setAction call, and this function will be called each time user clicks the item&lt;br /&gt;
* '''setActionSeparator(String name)''': adds a separator item to the context menu&lt;br /&gt;
* '''removeAction(String name)''': removes the item with &amp;lt;name&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/QML/API</id>
		<title>Development/Tutorials/Plasma/QML/API</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/QML/API"/>
				<updated>2011-09-23T13:49:39Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Data Engines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction to the Plasmoid QML Declarative API  =&lt;br /&gt;
&lt;br /&gt;
This document provides an overview/reference of the Declarative QML API for Plasmoids. It isn't a full binding to all of Qt or KDE's libraries, but a focused set of bindings designed to make writing Plasmoids fast and easy, while remaining powerful.&lt;br /&gt;
&lt;br /&gt;
The API in this documentation covers the API of the Plasma specific QML components, so only the Declarative part of the API.&lt;br /&gt;
&lt;br /&gt;
The QML ScriptEngine is bassed upon the Plasma JavaScript engine, making the API of the JavaScript part identical to the one of the JavaScript plasmoids engine.&lt;br /&gt;
To see the api of the global ''Plasmoid'' object, see the [http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API#The_Global_plasmoid_Object JavaScript API] documentation.&lt;br /&gt;
(TODO: the JavaScript api paged should probably be copied and stripped down the imperative bits not present there, it would make harder to update tough)&lt;br /&gt;
&lt;br /&gt;
== What Is a Declarative Plasmoid?  ==&lt;br /&gt;
&lt;br /&gt;
To denote that this Plasmoid is a Declarative widget, ensure that in the metadata.desktop file there is this line: &lt;br /&gt;
&lt;br /&gt;
X-Plasma-API=declarativeappletscript&lt;br /&gt;
&lt;br /&gt;
What follows is a description of the Plasma declarative classes instantiable from QML.&lt;br /&gt;
&lt;br /&gt;
= Main Plasma QML Classes =&lt;br /&gt;
&lt;br /&gt;
== Data Engines ==&lt;br /&gt;
While it's possible to fetch data from a Plasma DataEngine in the same way as the [http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API#DataEngine JavaScript API], it is preferrable to use the following declarative classes:&lt;br /&gt;
&lt;br /&gt;
=== DataSource ===&lt;br /&gt;
DataSource is a receiver for a dataEngine and can be declared inside QML:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
 import org.kde.plasma.core 0.1 as PlasmaCore&lt;br /&gt;
&lt;br /&gt;
 PlasmaCore.DataSource {&lt;br /&gt;
     id: dataSource&lt;br /&gt;
     engine: &amp;quot;time&amp;quot;&lt;br /&gt;
     connectedSources: [&amp;quot;Local&amp;quot;]&lt;br /&gt;
     interval: 500&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Properties ====&lt;br /&gt;
It has the following properties:&lt;br /&gt;
* bool '''valid''' (read only): true when the DataSource is successfully connected to a data engine&lt;br /&gt;
* int '''interval''': interval of polling of the dataengine, if 0 (default value, so no need to specify if you don't need it) no polling will be executed&lt;br /&gt;
* string '''engine''': the plugin name of the dataengine to load, e.g. &amp;quot;nowplaying&amp;quot;, etc.&lt;br /&gt;
* Array(string) '''connectedSources''': all the sources of the dataengine we are connected to (and whose data will appear in the '''data''' property)&lt;br /&gt;
* Array(string) '''sources''' (read only): all the sources available from the dataengine&lt;br /&gt;
* variant map '''data''' (read only): It's the most important property, it's a map of all the data available from the dataengine: its structure will be as follows:&lt;br /&gt;
** each key of the map will be a source name, in '''connectedSources'''&lt;br /&gt;
** each value will be a variant hash, so an hash with strings as keys and any variant as value&lt;br /&gt;
** example: dataSource.data[&amp;quot;Local&amp;quot;][&amp;quot;Time&amp;quot;] indicates the '''Time''' key of the dataengine source called &amp;quot;Local&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Signals ====&lt;br /&gt;
It has the following signals:&lt;br /&gt;
&lt;br /&gt;
Note that javascript/qml applies the 'on' prefix to signals. So the actual signal name in C++ which is e.g. '''newData''(...) becomes '''onNewData'''(...).&lt;br /&gt;
&lt;br /&gt;
* '''onNewData'''(String sourceName, Plasma::DataEngine::Data data)&lt;br /&gt;
* '''onSourceAdded'''(String source)&lt;br /&gt;
* '''onSourceRemoved'''(String source)&lt;br /&gt;
* '''onSourceConnected'''(String source)&lt;br /&gt;
* '''onSourceDisconnected'''(String source)&lt;br /&gt;
* '''onIntervalChanged'''()&lt;br /&gt;
* '''onEngineChanged'''()&lt;br /&gt;
* '''onDataChanged'''()&lt;br /&gt;
* '''onConnectedSourcesChanged'''()&lt;br /&gt;
* '''onSourcesChanged'''()&lt;br /&gt;
&lt;br /&gt;
==== Methods ====&lt;br /&gt;
It has the following methods:&lt;br /&gt;
* StringList keysForSource(String source): lists all the keys corresponding to a certain source: for instance in the &amp;quot;time&amp;quot; dataengine, for the &amp;quot;Local&amp;quot; source, keys will be:&lt;br /&gt;
** &amp;quot;Timezone Continent&amp;quot;&lt;br /&gt;
** &amp;quot;Offset&amp;quot;&lt;br /&gt;
** &amp;quot;Timezone&amp;quot;&lt;br /&gt;
** &amp;quot;Time&amp;quot;&lt;br /&gt;
** &amp;quot;Date&amp;quot;&lt;br /&gt;
** &amp;quot;Timezone City&amp;quot;&lt;br /&gt;
* Service serviceForSource(String source): returns a Plasma service that corresponds a given source: see the section about services for how to use it.&lt;br /&gt;
* void connectSource(String source): adds to '''connectedSources''' the new source&lt;br /&gt;
* void disconnectSource(String source): removes that source from '''connectedSources'''&lt;br /&gt;
&lt;br /&gt;
=== Service ===&lt;br /&gt;
Due to their imperative nature, Plasma Services are not instantiated as QML classes, but rather created out of a '''DataSource''' with the method '''serviceForSource''' and used in the JavaScript portions of the QML files.&lt;br /&gt;
This following example is a simplified version from the Now Playing QML widget in the kdeexamples git repository: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var service = dataSource.serviceForSource(activeSource)&lt;br /&gt;
  var operation = service.operationDescription(&amp;quot;seek&amp;quot;)&lt;br /&gt;
  operation.seconds = 10&lt;br /&gt;
&lt;br /&gt;
  var job = service.startOperationCall(operation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here dataSource is the id of a DataSource object, and activeSource is a source contained in one of its '''connectedSources'''.&lt;br /&gt;
The service provides an operation called &amp;quot;seek&amp;quot;, with a parameter called &amp;quot;seconds&amp;quot;, that can be written on it as a property of a JavaScript object.&lt;br /&gt;
&lt;br /&gt;
=== ServiceJob ===&lt;br /&gt;
If is necessary to monitor the result of a Service operation, it's possible to connect to the '''finished''' signal provided by the job return paramenter of the '''startOperationCall''' service method.&lt;br /&gt;
The '''finished''' signal has the same job as parameter, from which is possible to check the variant '''result''' property, to check the result.&lt;br /&gt;
&lt;br /&gt;
=== DataModel ===&lt;br /&gt;
Some data engines return as their data something that can be interpreted as a list of items, rather than simple key/value pairs.&lt;br /&gt;
QML provides some item views such as '''ListView''', '''GridView''' and '''Repeater'''.&lt;br /&gt;
The '''DataModel''' QML object can provide, based on a DataSource a model suitable for those QML item views.&lt;br /&gt;
&lt;br /&gt;
It has the following properties:&lt;br /&gt;
* DataSource '''dataSource''': the id of an existing (and connected) DataSource&lt;br /&gt;
* String '''sourceFilter''': it's a regular expression. If the DataSource is connected to more than one source, only inserts data from sources matching this filter expression in the model. To, for example, have a source watch all sources beginning with say &amp;quot;name:&amp;quot;, the required regexp would be sourceFilter: &amp;quot;name:.*&amp;quot;&lt;br /&gt;
* String '''keyRoleFilter''': it's a regular expression. Only data with keys that match this filter expression will be inserted in the model&lt;br /&gt;
* int '''count''' (read only): how many items are in the model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
 ListView {&lt;br /&gt;
   model: PlasmaCore.DataModel {&lt;br /&gt;
        dataSource: microblogSource&lt;br /&gt;
        keyRoleFilter: &amp;quot;[\\d]*&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    delegate: Text {&lt;br /&gt;
        text: title&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, ''microblogSource'' is the id of a DataSource, and inserts in the model only entries that have a number as the key name (matched with [\\d]*, in this case tweets ids)&lt;br /&gt;
&lt;br /&gt;
Each item in the model will have the form of a variant hash: all the keys of the hash will be registered as model role names, in the example, &amp;quot;title&amp;quot; is a role of the model containing a string (also reachable with model[&amp;quot;title&amp;quot;]).&lt;br /&gt;
&lt;br /&gt;
A special reserved role will always be present: '''&amp;quot;DataEngineSource&amp;quot;''': it will contain the name of the data engine source that gave origin to this item. Therefore, if you want merely the string of the current source that the model is at...do model[&amp;quot;DataEngineSource&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
Note that view.currentItem holds the item currently selected. However, due to (http://bugreports.qt.nokia.com/browse/QTBUG-16347) this does not work in PathView. A workaround is to make your own.&lt;br /&gt;
&lt;br /&gt;
=== SortFilterModel ===&lt;br /&gt;
SortFilterModel is a proxy model for easy sorting and/or filtering of the items in a DataModel (or any other QAbstractItemModel subclass that has been registered in QML with setContextProperty from a C++ application)&lt;br /&gt;
Properties:&lt;br /&gt;
* model '''sourceModel'''&lt;br /&gt;
* String '''filterRegExp'''&lt;br /&gt;
* String '''filterRole'''&lt;br /&gt;
* String '''sortRole'''&lt;br /&gt;
* Qt::SortOrder '''sortOrder'''&lt;br /&gt;
* int '''count''' (read only)&lt;br /&gt;
&lt;br /&gt;
== Popup Applet ==&lt;br /&gt;
So you want your QML applet to be a popup applet, like the device notifier (an icon in the panel shows and expands the applet)?&lt;br /&gt;
&lt;br /&gt;
Why, that's easy.&lt;br /&gt;
&lt;br /&gt;
To change your plasmoid from being a regular boring one, in your '''metadata.desktop''', simply change this following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
ServiceTypes=Plasma/Applet&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
ServiceTypes=Plasma/Applet,Plasma/PopupApplet&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then in the main QML item's Component.onCompleted, do:&lt;br /&gt;
&lt;br /&gt;
NOTE: the below code presently has no affect, yet the icons seems to get retrieved from the desktop file (FIXME - is this needed? It has no affect presently).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
    plasmoid.popupIcon(&amp;quot;konqueror&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Plasma Themes ==&lt;br /&gt;
&lt;br /&gt;
=== Theme ===&lt;br /&gt;
This class instantiable from QML provides access to the Plasma Theme colors and other facilities such as fonts.&lt;br /&gt;
It has the following properties:&lt;br /&gt;
* String '''themeName''' (read only)&lt;br /&gt;
* QFont '''font''' (read only)&lt;br /&gt;
* bool '''windowTranslucentEnabled''' (read only)&lt;br /&gt;
* Url '''homepage''' (read only)&lt;br /&gt;
* bool '''useGlobalSettings''' (read only)&lt;br /&gt;
* QString '''wallpaperPath''' (read only)&lt;br /&gt;
* color '''textColor''' (read only)&lt;br /&gt;
* color '''highlightColor''' (read only)&lt;br /&gt;
* color '''backgroundColor''' (read only)&lt;br /&gt;
* color '''buttonTextColor''' (read only)&lt;br /&gt;
* color '''buttonBackgroundColor''' (read only)&lt;br /&gt;
* color '''linkColor''' (read only)&lt;br /&gt;
* color '''visitedLinkColor''' (read only)&lt;br /&gt;
* color '''visitedLinkColor''' (read only)&lt;br /&gt;
* color '''buttonHoverColor''' (read only)&lt;br /&gt;
* color '''buttonFocusColor''' (read only)&lt;br /&gt;
* color '''viewTextColor''' (read only)&lt;br /&gt;
* color '''viewBackgroundColor''' (read only)&lt;br /&gt;
* color '''viewHoverColor''' (read only)&lt;br /&gt;
* color '''viewFocusColor''' (read only)&lt;br /&gt;
* String '''styleSheet''' (read only)&lt;br /&gt;
&lt;br /&gt;
=== Svg ===&lt;br /&gt;
Declaring a Svg element instantiates a Plasma Svg instance. This class doesn't draw anything. For drawing, SvgItem is used.&lt;br /&gt;
Properties:&lt;br /&gt;
* QSize '''size'''&lt;br /&gt;
* bool '''multipleImages'''&lt;br /&gt;
* String '''imagePath''' can be anything in the '''desktoptheme/''' folder. For more information on what is available, see [http://techbase.kde.org/Projects/Plasma/Theme#Current_Theme_Elements Plasma Theme Elements]&lt;br /&gt;
* bool '''usingRenderingCache'''&lt;br /&gt;
&lt;br /&gt;
Methods:&lt;br /&gt;
* QPixmap pixmap(QString elementID)&lt;br /&gt;
* void resize(qreal width, qreal height)&lt;br /&gt;
* void resize(): resets the image to its default dimension&lt;br /&gt;
* QSize elementSize(QString elementId)&lt;br /&gt;
* QRectF elementRect(QString elementId)&lt;br /&gt;
* bool hasElement(QString elementId)&lt;br /&gt;
* bool isValid(): true if valid svg file&lt;br /&gt;
&lt;br /&gt;
Sample Code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
    PlasmaCore.Svg {&lt;br /&gt;
        id: mySvg&lt;br /&gt;
        imagePath: &amp;quot;widgets/line&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SvgItem ===&lt;br /&gt;
It's a graphical element that will actually paint a Svg instance.&lt;br /&gt;
Properties:&lt;br /&gt;
* String '''elementId''': what element to render. If null, the whole svg will be rendered&lt;br /&gt;
* Svg '''svg''': instance of the Svg class mentioned above&lt;br /&gt;
* QSizeF '''naturalSize''' (read only): default size of the Svg&lt;br /&gt;
* bool '''smooth''': paint with antialias (default false)&lt;br /&gt;
&lt;br /&gt;
Sample Code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
    PlasmaCore.SvgItem {&lt;br /&gt;
        id: mySvgItem&lt;br /&gt;
        anchors {&lt;br /&gt;
            top: parent.top&lt;br /&gt;
            left: parent.left&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        width: 300&lt;br /&gt;
        height: 3&lt;br /&gt;
&lt;br /&gt;
        svg: mySvg&lt;br /&gt;
        elementId: &amp;quot;horizontal-line&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FrameSvgItem ===&lt;br /&gt;
It's a graphical element that paints a Plasma::FrameSvg, so a rectangular image composed by 9 elements contained in a Svg file, useful for things like buttons and frames.&lt;br /&gt;
&lt;br /&gt;
Flags&lt;br /&gt;
* EnabledBorders: combination of TopBorder | BottomBorder | LeftBorder | RightBorder, NoBorder if no border of the frame is enabled&lt;br /&gt;
&lt;br /&gt;
Properties:&lt;br /&gt;
* String '''imagePath''': path of the file relative to the Plasma Theme, for instance &amp;quot;widgets/background&amp;quot;&lt;br /&gt;
* String '''prefix''': a FrameSvg can contain multiple frames, for instance a button contains &amp;quot;normal&amp;quot;, &amp;quot;raised&amp;quot; and &amp;quot;pressed&amp;quot;&lt;br /&gt;
* Margins '''margins''' (read only): the margins of the frame, see documentation below&lt;br /&gt;
* EnabledBorders '''enabledBorders''': what borders are enabled&lt;br /&gt;
&lt;br /&gt;
==== Margins ====&lt;br /&gt;
Properties:&lt;br /&gt;
* real '''left''' (read only)&lt;br /&gt;
* real '''top''' (read only)&lt;br /&gt;
* real '''right''' (read only)&lt;br /&gt;
* real '''bottom''' (read only)&lt;br /&gt;
&lt;br /&gt;
Sample Code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
PlasmaCore.FrameSvgItem {&lt;br /&gt;
    id: myFrameSvgItem&lt;br /&gt;
    anchors.fill: parent&lt;br /&gt;
    imagePath: &amp;quot;translucent/dialogs/background&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Top Level windows ==&lt;br /&gt;
&lt;br /&gt;
=== Dialog ===&lt;br /&gt;
Dialog instantiates a Plasma::Dialog, it will be a Plasma themed top level window that can contain any QML component.&lt;br /&gt;
&lt;br /&gt;
Properties:&lt;br /&gt;
* Item mainItem: the Item contained in the Dialog, it can be any QML Item instance&lt;br /&gt;
* bool '''visible''': if the window (not the mainItem) is visible&lt;br /&gt;
* int '''x''': x position of the window in screen coordinates&lt;br /&gt;
* int '''y''': y position of the window in screen coordinates&lt;br /&gt;
* int '''width''' (read only): total width of the dialog, including margins&lt;br /&gt;
* int '''height''' (read only): total height of the dialog, including margins&lt;br /&gt;
* int '''windowFlags''': Qt window flags of the Dialog&lt;br /&gt;
* Margins '''margins''' (read only): margins of the Dialog&lt;br /&gt;
&lt;br /&gt;
Methods:&lt;br /&gt;
* QPoint popupPosition(Item item, Qt::Alignment alignment=Qt::AlignLeft): the suggested position for the Dialog if it has to be correctly placed as popup of the QML item passed as parameter.&lt;br /&gt;
* void setAttribute(Qt::WindowAttribute attribute, bool on): set an attribute for the dialog window&lt;br /&gt;
&lt;br /&gt;
==== Margins ====&lt;br /&gt;
Properties:&lt;br /&gt;
* real '''left''' (read only)&lt;br /&gt;
* real '''top''' (read only)&lt;br /&gt;
* real '''right''' (read only)&lt;br /&gt;
* real '''bottom''' (read only)&lt;br /&gt;
&lt;br /&gt;
=== ToolTip ===&lt;br /&gt;
Declaring a ToolTip instance makes it possible to use Plasma tooltips with any QML item.&lt;br /&gt;
&lt;br /&gt;
Properties:&lt;br /&gt;
* Item '''target''': the QML item we want to show a tooltip of&lt;br /&gt;
* String '''mainText'''&lt;br /&gt;
* String '''subText'''&lt;br /&gt;
* String '''image''': freedesktop compliant icon name as image of the tooltip&lt;br /&gt;
&lt;br /&gt;
= Plasma QtComponents (4.8) =&lt;br /&gt;
TODO&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/KDE_System_Administration/Kiosk/Keys</id>
		<title>KDE System Administration/Kiosk/Keys</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/KDE_System_Administration/Kiosk/Keys"/>
				<updated>2011-08-09T17:36:26Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* plasma-desktop */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article contains a listing of known keys that can be used with Kiosk and what they do. How to actually use these keys and other capabilities of Kiosk such as URL restrictions, creating assigning profiles, etc. is covered in the [[../Introduction|Introduction to Kiosk]] article.&lt;br /&gt;
&lt;br /&gt;
Which configuration file to put these entries in depends on whether you wish to make them global to all applications or specific to one application. To make the restrictions valid for all applications, put them in {{path|kdeglobals}}. To enable a restriction for a specific applications place them in the application-specific configuration, e.g. {{path|konquerorrc}} for Konqueror.&lt;br /&gt;
&lt;br /&gt;
== Application Action Restrictions ==&lt;br /&gt;
&lt;br /&gt;
These keys disable actions that are commonly found in KDE applications. To use these actions, create a section in {{path|kdeglobals}} that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[KDE Action Restrictions][$i]&lt;br /&gt;
action/&amp;lt;key&amp;gt;=false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Menu !! Action&lt;br /&gt;
|-&lt;br /&gt;
|action/file_new || File || New&lt;br /&gt;
|-&lt;br /&gt;
|action/file_open || File || Open&lt;br /&gt;
|-&lt;br /&gt;
|action/file_open_recent || File || Open Recent File&lt;br /&gt;
|-&lt;br /&gt;
|action/file_save || File || Save&lt;br /&gt;
|-&lt;br /&gt;
|action/file_save_as || File || Save As&lt;br /&gt;
|-&lt;br /&gt;
|action/file_revert || File || Revert&lt;br /&gt;
|-&lt;br /&gt;
|action/file_close || File || Close&lt;br /&gt;
|-&lt;br /&gt;
|action/file_print || File || Print&lt;br /&gt;
|-&lt;br /&gt;
|action/file_print_preview || File || Print Preview&lt;br /&gt;
|-&lt;br /&gt;
|action/file_mail || File || Email File&lt;br /&gt;
|-&lt;br /&gt;
|action/file_quit || File || Quit&lt;br /&gt;
|-&lt;br /&gt;
|action/edit_undo || Edit || Undo&lt;br /&gt;
|-&lt;br /&gt;
|action/edit_redo || Edit || Redo&lt;br /&gt;
|-&lt;br /&gt;
|action/edit_cut || Edit || Cut&lt;br /&gt;
|-&lt;br /&gt;
|action/edit_copy || Edit || Copy&lt;br /&gt;
|-&lt;br /&gt;
|action/edit_paste || Edit || Paste&lt;br /&gt;
|-&lt;br /&gt;
|action/edit_select_all || Edit || Select All&lt;br /&gt;
|-&lt;br /&gt;
|action/edit_deselect || Edit || Deselect&lt;br /&gt;
|-&lt;br /&gt;
|action/edit_find || Edit || Find&lt;br /&gt;
|-&lt;br /&gt;
|action/edit_find_next || Edit || Find Next&lt;br /&gt;
|-&lt;br /&gt;
|action/edit_find_last || Edit || Find last&lt;br /&gt;
|-&lt;br /&gt;
|action/edit_replace || Edit || Replace&lt;br /&gt;
|-&lt;br /&gt;
|action/view_actual_size || View || 100% Zoom&lt;br /&gt;
|-&lt;br /&gt;
|action/view_fit_to_page || View || Fit To Page (zooming)&lt;br /&gt;
|-&lt;br /&gt;
|action/view_fit_to_width || View || Fit To Width (zooming)&lt;br /&gt;
|-&lt;br /&gt;
|action/view_fit_to_height || View || Fit To Height (zooming)&lt;br /&gt;
|-&lt;br /&gt;
|action/view_zoom_in || View || Zoom In&lt;br /&gt;
|-&lt;br /&gt;
|action/view_zoom_out || View || Zoom Out&lt;br /&gt;
|-&lt;br /&gt;
|action/view_zoom || View || Zoom&lt;br /&gt;
|-&lt;br /&gt;
|action/view_redisplay || View || Refresh&lt;br /&gt;
|-&lt;br /&gt;
|action/go_up || Go || Up&lt;br /&gt;
|-&lt;br /&gt;
|action/go_back || Go || Back&lt;br /&gt;
|-&lt;br /&gt;
|action/go_forward || Go || Forward&lt;br /&gt;
|-&lt;br /&gt;
|action/go_home || Go || Home&lt;br /&gt;
|-&lt;br /&gt;
|action/go_previous || Go || Previous&lt;br /&gt;
|-&lt;br /&gt;
|action/go_next || Go || Next&lt;br /&gt;
|-&lt;br /&gt;
|action/go_goto || Go || Go To...&lt;br /&gt;
|-&lt;br /&gt;
|action/go_goto_page || Go || Go To Page...&lt;br /&gt;
|-&lt;br /&gt;
|action/go_goto_line || Go || Go To Line...&lt;br /&gt;
|-&lt;br /&gt;
|action/go_first || Go || Go To Start&lt;br /&gt;
|-&lt;br /&gt;
|action/go_last || Go || Go To End&lt;br /&gt;
|-&lt;br /&gt;
|action/bookmarks || Bookmarks || Also disables action/bookmark_add and action/bookmark_edit&lt;br /&gt;
|-&lt;br /&gt;
|action/bookmark_add || Bookmarks || Add Bookmark&lt;br /&gt;
|-&lt;br /&gt;
|action/bookmark_edit || Bookmarks || Edit Bookmarks&lt;br /&gt;
|-&lt;br /&gt;
|action/tools_spelling || Tools || Check Spelling&lt;br /&gt;
|-&lt;br /&gt;
|action/options_show_menubar || Settings || Show/hide Menubar&lt;br /&gt;
|-&lt;br /&gt;
|action/options_show_toolbar || Settings || Show/hide Toolbar, will also disable the &amp;quot;Toolbars&amp;quot; submenu if present&lt;br /&gt;
|-&lt;br /&gt;
|action/options_show_statusbar || Settings || Show/hide statusbar&lt;br /&gt;
|-&lt;br /&gt;
|action/options_save_Settings || Settings || Save Settings&lt;br /&gt;
|-&lt;br /&gt;
|action/options_configure || Settings || Configure application&lt;br /&gt;
|-&lt;br /&gt;
|action/options_configure_keybinding || Settings || Configure Shortcuts&lt;br /&gt;
|-&lt;br /&gt;
|action/options_configure_toolbars || Settings || Configure Toolbars&lt;br /&gt;
|-&lt;br /&gt;
|action/options_configure_notifications || Settings || Configure Notifications&lt;br /&gt;
|-&lt;br /&gt;
|action/fullscreen || Settings || Enter full screen mode&lt;br /&gt;
|-&lt;br /&gt;
|action/help || Help || Not yet fully implemented&lt;br /&gt;
|-&lt;br /&gt;
|action/help_contents || Help || Application handbook&lt;br /&gt;
|-&lt;br /&gt;
|action/help_whats_this || Help || Go into &amp;quot;what's this&amp;quot; mode&lt;br /&gt;
|-&lt;br /&gt;
|action/help_report_bug || Help || Report a bug&lt;br /&gt;
|-&lt;br /&gt;
|action/help_about_app || Help || Show about application dialog&lt;br /&gt;
|-&lt;br /&gt;
|action/help_about_kde || Help || Show about KDE dialog&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== KCalc ===&lt;br /&gt;
&lt;br /&gt;
By marking the kcalcrc config file as immutable, the &amp;quot;Configure&amp;quot; button&lt;br /&gt;
will not be shown.&lt;br /&gt;
&lt;br /&gt;
=== File Manager ===&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Action&lt;br /&gt;
|-&lt;br /&gt;
|action/editfiletype || Edit associated applications&lt;br /&gt;
|-&lt;br /&gt;
|action/properties || File properties&lt;br /&gt;
|-&lt;br /&gt;
|action/openwith || Open file with action&lt;br /&gt;
|-&lt;br /&gt;
|action/openintab || Open link in a new tab&lt;br /&gt;
|-&lt;br /&gt;
|action/kdesktop_rmb || RMB menu, see note below&lt;br /&gt;
|-&lt;br /&gt;
|action/iconview_preview || Show preview thumbnails in icons, though it leaves the actual setting untouched. To disable previews (as opposed to simply disabling the user to change the setting) you also need to add the following lines to konqiconviewrc:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Settings]&lt;br /&gt;
PreviewsEnabled[$i]=false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|action/sharefile || Disables file sharing from the UI, but you may also want to disable filesharing altogether.&lt;br /&gt;
|-&lt;br /&gt;
|action/sendURL || Send Link Address&lt;br /&gt;
|-&lt;br /&gt;
|action/sendPage || Send File&lt;br /&gt;
|-&lt;br /&gt;
|action/devnew || Create New -&amp;gt; Device&lt;br /&gt;
|-&lt;br /&gt;
|action/incIconSize || Increase icon size&lt;br /&gt;
|-&lt;br /&gt;
|action/decIconSize || Decrease icon size&lt;br /&gt;
|-&lt;br /&gt;
|action/go || Entire go menu&lt;br /&gt;
|-&lt;br /&gt;
|action/configdesktop || Configure desktop in RMB menu, see also Control Module Restrictions&lt;br /&gt;
|-&lt;br /&gt;
|action/executeshellcommand || In Konqueror Tools menu, see also &amp;lt;tt&amp;gt;shell_access&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|action/show_dot || Disables the option to toggle showing hidden files, the actual setting remains unaffected.  To disable showing hidden files, add the following lines to konqiconviewrc:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[Settings]&lt;br /&gt;
ShowDotFiles[$i]=false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Konsole ===&lt;br /&gt;
&lt;br /&gt;
These keys can appear in {{path|kdeglobals}}, {{path|konsolepartrc}} or {{path|konsolerc}}.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Action&lt;br /&gt;
|-&lt;br /&gt;
|action/konsole_rmb || Context menus&lt;br /&gt;
|-&lt;br /&gt;
|action/settings || Disable the entire settings menu&lt;br /&gt;
|-&lt;br /&gt;
|action/show_menubar || Show/hide the menubar&lt;br /&gt;
|-&lt;br /&gt;
|action/show_toolbar || Show/hide the toolbar&lt;br /&gt;
|-&lt;br /&gt;
|action/scrollbar || Show/hide the scrollbar&lt;br /&gt;
|-&lt;br /&gt;
|action/bell || Configure bell actions&lt;br /&gt;
|-&lt;br /&gt;
|action/font || Configure font&lt;br /&gt;
|-&lt;br /&gt;
|action/keyboard || Set keyboard type&lt;br /&gt;
|-&lt;br /&gt;
|action/schema || Select the schema to use&lt;br /&gt;
|-&lt;br /&gt;
|action/size || Set the terminal size&lt;br /&gt;
|-&lt;br /&gt;
|action/history || Configure history&lt;br /&gt;
|-&lt;br /&gt;
|action/save_default || Save settings as defaults&lt;br /&gt;
|-&lt;br /&gt;
|action/save_sessions_profile || Save sessions profile&lt;br /&gt;
|-&lt;br /&gt;
|action/send_signal || Send a signal to the current terminal&lt;br /&gt;
|-&lt;br /&gt;
|action/bookmarks || Bookmarks menu&lt;br /&gt;
|-&lt;br /&gt;
|action/add_bookmark  || Add a bookmark&lt;br /&gt;
|-&lt;br /&gt;
|action/edit_bookmarks || Edit bookmarks&lt;br /&gt;
|-&lt;br /&gt;
|action/clear_terminal || Clear the current terminal&lt;br /&gt;
|-&lt;br /&gt;
|action/reset_clear_terminal || Clear and reset the current terminal&lt;br /&gt;
|-&lt;br /&gt;
|action/find_history || Find in history&lt;br /&gt;
|-&lt;br /&gt;
|action/find_next || Find next item in history&lt;br /&gt;
|-&lt;br /&gt;
|action/find_previous || Find previous item in history&lt;br /&gt;
|-&lt;br /&gt;
|action/save_history || Save history to disk&lt;br /&gt;
|-&lt;br /&gt;
|action/clear_history || Clear history of current terminal&lt;br /&gt;
|-&lt;br /&gt;
|action/clear_all_histories || Clear histories of all terminals&lt;br /&gt;
|-&lt;br /&gt;
|action/detach_session || Detach current tab&lt;br /&gt;
|-&lt;br /&gt;
|action/rename_session || Rename current session&lt;br /&gt;
|-&lt;br /&gt;
|action/zmodem_upload || ZModem uploading&lt;br /&gt;
|-&lt;br /&gt;
|action/monitor_activity || Monitor current terminal for activity&lt;br /&gt;
|-&lt;br /&gt;
|action/monitor_silence ||  Monitor current terminal for silence&lt;br /&gt;
|-&lt;br /&gt;
|action/send_input_to_all_sessions || Replicate input to all sessions&lt;br /&gt;
|-&lt;br /&gt;
|action/close_session || Close current terminal session&lt;br /&gt;
|-&lt;br /&gt;
|action/new_session || Create a new terminal session&lt;br /&gt;
|-&lt;br /&gt;
|action/activate_menu || Activate menubar&lt;br /&gt;
|-&lt;br /&gt;
|action/list_sessions || Session list menu&lt;br /&gt;
|-&lt;br /&gt;
|action/move_session_left || Shift tab to the left&lt;br /&gt;
|-&lt;br /&gt;
|action/move_session_right || Shift tab to the right&lt;br /&gt;
|-&lt;br /&gt;
|action/previous_session || Go to tab to the left&lt;br /&gt;
|-&lt;br /&gt;
|action/next_session || Go to tab to the right&lt;br /&gt;
|-&lt;br /&gt;
|action/switch_to_session_# || Go to tab numbered #, where # is a number between 1 and 12 inclusive.&lt;br /&gt;
|-&lt;br /&gt;
|action/bigger_font || Increase font size&lt;br /&gt;
|-&lt;br /&gt;
|action/smaller_font || Decrease font size&lt;br /&gt;
|-&lt;br /&gt;
|action/toggle_bidi || Turn bidirectional text support on or off&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== KWin ===&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Action&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| action/kwin_rmb || Context menus on window titlebar and frame&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Plasma ===&lt;br /&gt;
Locking down the entire config with [$i] will cause everything to be immutable. Locking a Containment group will render that one group of widgets to be immutable, and locking a widget itself will cause it to not be movable as well as otherwise locked.&lt;br /&gt;
&lt;br /&gt;
In addition the following resource restrictions are available:&lt;br /&gt;
&lt;br /&gt;
==== All Plasma apps ====&lt;br /&gt;
Any application that links to libplasma supports the following resource restriction keys (the version number in parentheses is the version of the KDE Software Compilation that the key debuted in):&lt;br /&gt;
&lt;br /&gt;
;plasma/allow_configure_when_locked (4.4)&lt;br /&gt;
:Whether widgets and containments can be configured when immutable / locked. The default is true as a convenience to users.&lt;br /&gt;
&lt;br /&gt;
;plasma/containment_actions (4.4)&lt;br /&gt;
:Whether or not to allow Plasma mouse actions on containments (usually menus that pop up on mouse clicks)&lt;br /&gt;
&lt;br /&gt;
;plasma/containment_context_menu (4.4)&lt;br /&gt;
:Whether a context menu should be shown on containments; this can be used to shut off the desktop context menu in plasma-desktop, for instance&lt;br /&gt;
&lt;br /&gt;
;plasma/external_script_extensions (4.5)&lt;br /&gt;
:Whether or not to allow external scripting extensions to APIs beyond the built-in extensions and API.&lt;br /&gt;
&lt;br /&gt;
==== plasma-desktop ====&lt;br /&gt;
The plasma-desktop binary (the desktop and panels part of the KDE Plasma Workspace) supports the following resource restriction keys (the version number in parentheses is the version of the KDE Software Compilation that the key debuted in)::&lt;br /&gt;
&lt;br /&gt;
;plasma-desktop/scripting_console (&amp;gt;= 4.4.0)&lt;br /&gt;
:Whether the plasma desktop scripting console is accessible or not.&lt;br /&gt;
&lt;br /&gt;
;plasma-desktop/add_activities (&amp;gt;= 4.7.1)&lt;br /&gt;
:Whether the user may add new activities or not&lt;br /&gt;
&lt;br /&gt;
=== Using D-Bus To Find More Actions ===&lt;br /&gt;
&lt;br /&gt;
== Authorizing {{path|.desktop}} Files ==&lt;br /&gt;
&lt;br /&gt;
Application {{path|.desktop}} files can have an additional field &amp;lt;tt&amp;gt;X-KDE-AuthorizeAction&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If this field is present the {{path|.desktop}} file is only considered valid if the action(s) mentioned in this field has been authorized. If multiple actions are listed they should be separated by commas (','). &lt;br /&gt;
&lt;br /&gt;
If the {{path|.desktop}} file of an application lists one or more actions this way and the user has no authorization for even one of these actions then the application will not appear in the KDE menu, will not allow execution via that {{path|.desktop}} file and will not be used by KDE for opening files of associated mimetypes.&lt;br /&gt;
&lt;br /&gt;
== File Dialog ==&lt;br /&gt;
&lt;br /&gt;
These keys disable actions that are found in the KDE file dialog. To use them, create a section in {{path|kdeglobals}} that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[KDE Action Restrictions][$i]&lt;br /&gt;
action/&amp;lt;key&amp;gt;=false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Action&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| action/home || Go to home directory&lt;br /&gt;
|-&lt;br /&gt;
| action/up || Go to parent directory&lt;br /&gt;
|-&lt;br /&gt;
| action/back || Go to previous directory&lt;br /&gt;
|-&lt;br /&gt;
| action/forward || Go to next directory&lt;br /&gt;
|-&lt;br /&gt;
| action/reload	|| Reload directory&lt;br /&gt;
|-&lt;br /&gt;
| action/mkdir	|| Create new directory&lt;br /&gt;
|-&lt;br /&gt;
| action/toggleSpeedbar || Show/hide sidebar&lt;br /&gt;
|-&lt;br /&gt;
| action/sorting menu || Sorting options&lt;br /&gt;
|-&lt;br /&gt;
| action/short view || Select short view&lt;br /&gt;
|-&lt;br /&gt;
| action/detailed view || Select detailed view&lt;br /&gt;
|-&lt;br /&gt;
| action/show hidden || Show/hide hidden files&lt;br /&gt;
|-&lt;br /&gt;
| action/preview || Show/hide preview&lt;br /&gt;
|-&lt;br /&gt;
| action/separate dirs || Show/hide separate directories&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Printing ==&lt;br /&gt;
&lt;br /&gt;
There are several keys that restrict various aspects of the KDE print dialog and printing system. To use them, create a configuration section like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[KDE Resource Restrictions][$i]&lt;br /&gt;
print/&amp;lt;resource key&amp;gt;=false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how each of the printing keys start with &amp;lt;tt&amp;gt;print&amp;lt;/tt&amp;gt; in the configuration file.&lt;br /&gt;
&lt;br /&gt;
;print/copies&lt;br /&gt;
:Disables the panel that allows users to make more than one copy.&lt;br /&gt;
&lt;br /&gt;
;print/dialog&lt;br /&gt;
:Disables the complete print dialog. Selecting the print option will immediately print the selected document using default settings. Make sure that a system wide default printer has been selected. No application specific settings are honored when this restriction is activated.&lt;br /&gt;
&lt;br /&gt;
;print/options&lt;br /&gt;
:Disables the button to select additional print options.&lt;br /&gt;
&lt;br /&gt;
;print/properties&lt;br /&gt;
:Disables the button to change printer properties or to add a new printer.&lt;br /&gt;
&lt;br /&gt;
;print/selection&lt;br /&gt;
:Disables the options that allows selecting a (pseudo) printer or change any of the printer properties. Make sure that a proper default printer has been selected before disabling this option. Disabling this option also disables &amp;lt;tt&amp;gt;print/system&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;print/options&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;print/properties&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;print/system&lt;br /&gt;
:Disables the option to select the printing system backend, e.g. CUPS. It is recommended to disable this option once the correct printing system has been configured.&lt;br /&gt;
&lt;br /&gt;
== Resource Restrictions ==&lt;br /&gt;
&lt;br /&gt;
KDE applications can take advantage of many types of resources such as configuration data, caches, plugin registries, etc. These are loaded from both system-wide as well as from per-user locations on disk. It is possible to restrict use of the per-user resources directories, preventing users from adding to or altering existing shared resources.&lt;br /&gt;
&lt;br /&gt;
This is accomplished by creating a section like this in a configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[KDE Resource Restrictions][$i]&lt;br /&gt;
&amp;lt;resource key&amp;gt;=false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following resources can be used as keys and controlled in this manner:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Key !! Directory !! Provides&lt;br /&gt;
|-&lt;br /&gt;
|all || n/a || All resources listed in this table&lt;br /&gt;
|-&lt;br /&gt;
|autostart || {{path|share/autostart}} || Apps to start on login&lt;br /&gt;
|-&lt;br /&gt;
|data || {{path|share/apps}} || Application data&lt;br /&gt;
|-&lt;br /&gt;
|data_&amp;amp;lt;appname&amp;amp;gt; || {{path|share/apps}} || Application data for the application named &amp;amp;lt;appname&amp;amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|html || {{path|share/doc/HTML}} || HTML files&lt;br /&gt;
|-&lt;br /&gt;
|icon || {{path|share/icon}} || Icons&lt;br /&gt;
|-&lt;br /&gt;
|config || {{path|share/config}} || Application configurations&lt;br /&gt;
|-&lt;br /&gt;
|pixmap || {{path|share/pixmaps}} || Images&lt;br /&gt;
|-&lt;br /&gt;
|xdgdata-apps || {{path|share/applications}} || Application .desktop files&lt;br /&gt;
|-&lt;br /&gt;
|sound || {{path|share/sounds}} || Sound files&lt;br /&gt;
|-&lt;br /&gt;
|locale || {{path|share/locale}} || Localization data&lt;br /&gt;
|-&lt;br /&gt;
|services || {{path|share/services}} || Protocols, plugins, kparts, control panels, etc. registry&lt;br /&gt;
|-&lt;br /&gt;
|servicetypes || {{path|share/servicetypes}} || Plugin definitions, referenced in services registry entries&lt;br /&gt;
|-&lt;br /&gt;
|mime || {{path|share/mimelnk}} || Mimetype definitions&lt;br /&gt;
|-&lt;br /&gt;
|wallpaper || {{path|share/wallpapers}} || Desktop wallpaper images&lt;br /&gt;
|-&lt;br /&gt;
|templates || {{path|share/templates}} || Document templates&lt;br /&gt;
|-&lt;br /&gt;
|exe || {{path|bin}} || Executable files&lt;br /&gt;
|-&lt;br /&gt;
|lib || {{path|lib}} || Libraries&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Screensavers ==&lt;br /&gt;
In {{path|kdeglobals}} in the &amp;lt;tt&amp;gt;[KDE Action Restrictions]&amp;lt;/tt&amp;gt; group:&lt;br /&gt;
&lt;br /&gt;
;opengl_screensavers&lt;br /&gt;
:defines whether OpenGL screensavers are allowed to be used.&lt;br /&gt;
&lt;br /&gt;
;manipulatescreen_screensavers&lt;br /&gt;
:defines whether screensavers that manipulate an image of the screen (e.g. moving chunks of the screen around) are allowed to be used.&lt;br /&gt;
&lt;br /&gt;
=== Automatic Log-out ===&lt;br /&gt;
In {{path|kscreensaverrc}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[ScreenSaver]&lt;br /&gt;
AutoLogout=true&lt;br /&gt;
AutoLogoutTimeout=600&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The timeout is the time in seconds that the user must be idle for before the logout process is automatically started. Be careful with this capability as it can lead to data loss if the user has unsaved files open.&lt;br /&gt;
&lt;br /&gt;
== Session Capability Restrictions ==&lt;br /&gt;
&lt;br /&gt;
These keys apply to various capabilities associated with a desktop session and are not application specific. To use them, create a section in {{path|kdeglobals}} that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[KDE Action Restrictions][$i]&lt;br /&gt;
&amp;lt;key&amp;gt;=false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;custom_config&lt;br /&gt;
:Whether the &amp;lt;tt&amp;gt;--config&amp;lt;/tt&amp;gt; command line option should be honored. The &amp;lt;tt&amp;gt;--config&amp;lt;/tt&amp;gt; command line option can be used to circumvent locked-down configuration files.&lt;br /&gt;
&lt;br /&gt;
;editable_desktop_icons&lt;br /&gt;
:define whether icons on the desktop can be moved, renamed, deleted or added. You might want to set the path for the desktop to some read-only directory as well instead of {{path|$HOME/Desktop}}.&lt;br /&gt;
&lt;br /&gt;
;lineedit_text_completion&lt;br /&gt;
:Defines whether input lines should have the potential to remember any previously entered data and make suggestions based on this when typing. When a single account is shared by multiple people you may wish to disable this out of privacy concerns.&lt;br /&gt;
&lt;br /&gt;
;lock_screen&lt;br /&gt;
:whether the user will be able to lock the screen.&lt;br /&gt;
&lt;br /&gt;
;logout&lt;br /&gt;
:whether the user will be able to logout from KDE.&lt;br /&gt;
&lt;br /&gt;
;movable_toolbars&lt;br /&gt;
:define whether toolbars may be moved around by the user. See also &amp;lt;tt&amp;gt;action/options_show_toolbar&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;run_command&lt;br /&gt;
:whether the &amp;quot;Run Command&amp;quot; (Alt-F2) option is available.&lt;br /&gt;
&lt;br /&gt;
;run_desktop_files&lt;br /&gt;
:defines whether users may execute desktop files that are not part of the default desktop, KDE menu, registered services and autostarting services.&lt;br /&gt;
* The default desktop includes the files under {{path|$KDEDIR/share/kdesktop/Desktop}} but '''not''' the files under {{path|$HOME/Desktop}}.&lt;br /&gt;
* The KDE menu includes all files under {{path|$KDEDIR/share/applnk}} and {{path|$XDGDIR/applications}}&lt;br /&gt;
* Registered services includes all files under {{path|$KDEDIR/share/services}}&lt;br /&gt;
* Autostarting services include all files under {{path|$KDEDIR/share/autostart}} but '''not''' the files under {{path|$KDEHOME/Autostart}}&lt;br /&gt;
&lt;br /&gt;
;shell_access&lt;br /&gt;
:Whether a shell suitable for entering random commands may be started. This also determines whether the &amp;quot;Run Command&amp;quot; option (Alt-F2) can be used to run shell-commands and arbitrary executables. Likewise, executables placed in the user's Autostart folder will no longer be executed. Applications can still be autostarted by placing &amp;lt;tt&amp;gt;.desktop&amp;lt;/tt&amp;gt; files in the {{path|$KDEHOME/Autostart}} or {{path|$KDEDIR/share/autostart}} directory. See also &amp;lt;tt&amp;gt;run_desktop_files&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:You probably also want to activate the following resource restictions:&lt;br /&gt;
*&amp;quot;appdata_kdesktop&amp;quot; - To restrict the default desktop.&lt;br /&gt;
*&amp;quot;apps&amp;quot; - To restrict the KDE menu.&lt;br /&gt;
*&amp;quot;xdgdata-apps&amp;quot; - To restrict the KDE menu.&lt;br /&gt;
*&amp;quot;services&amp;quot; - To restrict registered services.&lt;br /&gt;
*&amp;quot;autostart&amp;quot; - To restrict autostarting services.&lt;br /&gt;
:Otherwise users can still execute .desktop files by placing them in e.g. {{path|$KDEHOME/share/kdesktop/Desktop}}&lt;br /&gt;
&lt;br /&gt;
;skip_drm&lt;br /&gt;
:defines if the user may omit DRM checking.&lt;br /&gt;
&lt;br /&gt;
;start_new_session&lt;br /&gt;
:defines whether the user may start a second X session. See also the documentation on [http://docs.kde.org/en/HEAD/kdebase/kdm/ kdm configuration].&lt;br /&gt;
&lt;br /&gt;
;switch_user&lt;br /&gt;
:defines whether user switching via kdm is allowed.  See also the documentation on [http://docs.kde.org/en/HEAD/kdebase/kdm/ kdm configuration].&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Contribute</id>
		<title>Contribute</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Contribute"/>
				<updated>2011-07-19T08:22:30Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:I18n/Language Navigation Bar|Contribute}}&lt;br /&gt;
This page intends to give an overview of the different aspects of KDE development in particular for programming related issues. '''The KDE project welcomes anyone willing to help'''.&lt;br /&gt;
&lt;br /&gt;
{{note|There are a lot of ways to get involved in KDE development, which can be summed up in several categories:&lt;br /&gt;
:''Documentation, Translation, Development, Usability, Accessibility, Artwork, Promotion&lt;br /&gt;
'''Not a coder? See KDE's pages on [http://kde.org/community/getinvolved/ how to get involved] to see other ways you can help. Also see: [[Contribute/Bugsquad|Bugsquad]]!'''&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== News and Mail Sources ==&lt;br /&gt;
The general direction of the KDE project is determined by those who do the work - there is no single high level plan for what KDE will look like in the future.&lt;br /&gt;
&lt;br /&gt;
If you want to find out what is currently happening, then there are a number of sources you might like to consider:&lt;br /&gt;
; [http://www.kde.org/mailinglists/ Mailing Lists]&lt;br /&gt;
: Probably the best way to find out what's going on in KDE development. Archives are available [http://lists.kde.org here]&lt;br /&gt;
&lt;br /&gt;
; [http://commitfilter.kde.org/ CommitFilter]&lt;br /&gt;
: Receive notification of commits to the KDE source code repositories in areas that interest you.&lt;br /&gt;
&lt;br /&gt;
; [http://commit-digest.org/ KDE Commit-Digest]&lt;br /&gt;
: Weekly summary of commits to projects in the KDE source code repositories.&lt;br /&gt;
&lt;br /&gt;
; [http://dot.kde.org/ The Dot]&lt;br /&gt;
: The KDE news site.&lt;br /&gt;
&lt;br /&gt;
== Reporting Bugs ==&lt;br /&gt;
&lt;br /&gt;
The easiest way to contribute to KDE is to [http://userbase.kde.org/Asking_Questions#Reporting_KDE_Bugs report any bugs] you find in KDE using the [https://bugs.kde.org/ KDE Bug Tracking System] (also known as Bugzilla).&lt;br /&gt;
&lt;br /&gt;
If the application you are using crashes then the Dr Konqi utility will appear and guide you through the process of reporting the crash.  Learn more by reading  [[Development/Tutorials/Debugging/How_to_create_useful_crash_reports|how to create useful crash reports]].&lt;br /&gt;
&lt;br /&gt;
== Getting Started with Coding ==&lt;br /&gt;
Getting started at coding for KDE is a matter of finding something to fix, and fixing it. You may want to consult the module overview to help find what you are looking for; once you have fixed something, you will want to send in a patch. If you do that a few times, you may want to apply for a KDE Contributor account so you can improve things directly.&lt;br /&gt;
* [[Contribute/List of KDE Modules|Module overview]]&lt;br /&gt;
* [[Contribute/Send Patches|Sending patches]]&lt;br /&gt;
* [[Contribute/Get a Contributor Account|Applying for a KDE Contributor Account]]&lt;br /&gt;
* [[Contribute/First Steps with your KDE SVN Account|First steps with your new Contributor  account]]&lt;br /&gt;
&lt;br /&gt;
=== C++ ===&lt;br /&gt;
KDE is mostly written in C++. If you are not familiar with C++, you should do at least some work on it. There are a number of good books on C++ - an excellent source is [http://mindview.net/Books/TICPP/ThinkingInCPP2e.html Bruce Eckel's &amp;quot;Thinking in C++&amp;quot;], which is available both as a free download and as a printed document. It isn't essential to understand everything before you start in KDE, but you do need to understand basic syntax and operations.&lt;br /&gt;
&lt;br /&gt;
=== Qt ===&lt;br /&gt;
To become proficient with KDE coding, you should understand the Qt toolkit. If you are not familiar with Qt, you should work through the tutorials included with [http://doc.qt.nokia.com/latest Qt Reference Documentation].&lt;br /&gt;
&lt;br /&gt;
If you need a gentler introduction to Qt, or would just like an alternative view, then you may wish to look at the [http://qt4.digitalfanatics.org/tiqt/ The Independent Qt Tutorial] (Currently offline due to book contract).&lt;br /&gt;
&lt;br /&gt;
If you prefer to learn Qt by reading a traditional book, take a look at the  [http://qt.nokia.com/developer/books/ Books about Qt page]. More suggestions on becoming familiar with Qt4 are available [http://doc.qt.nokia.com/latest/how-to-learn-qt.html How to Learn Qt page]. &lt;br /&gt;
&lt;br /&gt;
=== KDE ===&lt;br /&gt;
A range of information on KDE techniques is available in the [[Development/Tutorials|tutorial section]]. Note that some of these tutorials still target KDE3, though they should be at least partly applicable.&lt;br /&gt;
&lt;br /&gt;
You will also find useful information on KDE coding in the [[Development/FAQs|FAQs]] section. This information may also be somewhat dated for KDE4, however much of it is broadly applicable, even outside KDE.&lt;br /&gt;
&lt;br /&gt;
You can also read [[Development/Further Information#Books|KDE coding books]].&lt;br /&gt;
&lt;br /&gt;
Last, but by no means least, KDE comes with extensive class (Application Programmer Interface) documentation. This is available in the&lt;br /&gt;
[[Development/Tutorials/API Documentation|KDE API Reference Manuals]] section, which also contains a number of useful links on how to write or update the class documentation. You can also generate these on your own machine, or refer to a more up-to-date online version at [http://api.kde.org/ API Reference].&lt;br /&gt;
&lt;br /&gt;
A more detailed description of the steps above is available in our [http://quality.kde.org/develop/howto/howtohack.php Programming Guide].&lt;br /&gt;
&lt;br /&gt;
== Getting Involved in Bug Hunting and Application Quality ==&lt;br /&gt;
&lt;br /&gt;
There is a large number of applications within KDE, and not all of them have a maintainer dedicated to managing bugs and generally helping out with all the issues associated with turning some working code into a polished application.&lt;br /&gt;
&lt;br /&gt;
If you are interested in helping out with KDE, but don't know where to start, becoming a member of the KDE Quality Team might appeal to you - see the [http://quality.kde.org Quality Team website] for more information. Note that you do not need any programming skills to become involved. In particular developers regularly publish so-called [http://community.kde.org/KDE/Junior_Jobs Junior Jobs] to encourage new contributions.&lt;br /&gt;
&lt;br /&gt;
Of course, you can become involved in bug hunting without being part of the KDE Quality Team - just create yourself an account on the KDE [http://bugs.kde.org bug tracking system], and start searching / sorting through the bugs. Again, you don't have to have programming skills - it helps the programmers enormously just to have a procedure that allows a bug to be consistently reproduced.&lt;br /&gt;
&lt;br /&gt;
The [[Contribute/Bugsquad|Bugsquad]] tries to keep track of bugs in KDE software and make sure that valid bugs are noticed by developers. You do not need any programming knowledge to be in the Bugsquad; in fact it is a great way to return something to the KDE community if you cannot program.&lt;br /&gt;
&lt;br /&gt;
==Getting Answers to Your Questions==&lt;br /&gt;
If your question concerns KDE development, your options are pretty much the same general user ones, with some modifications:&lt;br /&gt;
::* '''Read the Developer FAQ'''. Many common developer questions have been answered in the [[Development/FAQs|KDE Developer FAQ]]&lt;br /&gt;
::* '''Search/browse KDE websites'''. A lot of questions can also be answered from the KDE websites, and the documentation included on it. You can search all the KDE websites on the homepage. In addition, you can browse the [http://techbase.kde.org KDE TechBase website]. And if possible, help edit it for clarity, and use the talk page if something is unclear.&lt;br /&gt;
::* '''Search mailing lists'''. A lot of questions have already been answered on the KDE mailing lists, particular the lists kde-devel, kde2-porting, kde-core-devel, kde-games-devel, kfm-devel and koffice-devel. You can search these lists either at [http://lists.kde.org/ lists.kde.org]. You should always search for your answer before asking questions on the mailing lists. When you ask a question on a mailing list you are emailing thousands of people -- please do this only if the answer is not available through a simple search.&lt;br /&gt;
::* '''Search engines'''. Do not forget about your favorite search engine. One of the best search engines is Google. With Google you can also [http://groups.google.com/ search] the great bulk of Usenet news sites, which is also particularly helpful, especially for general programming and gcc-related questions.&lt;br /&gt;
::* '''Read the source code'''.  http://websvn.kde.org and https://projects.kde.org/ are available to help browse code. Read some commit logs and diffs for the code you might want to work with, It adds perspective.&lt;br /&gt;
::* '''Ask on KDE mailing lists'''. If you still do not have an answer, try asking your question on one of the KDE mailing lists listed above.&lt;br /&gt;
::::* For questions relating to core development or third-party KDE development, unless you are particularly interested in [http://konqueror.kde.org/ Konqueror], [http://www.koffice.org/ KOffice], games or Java development, your main choice is [mailto:kde-devel@kde.org kde-devel] [mailto:kde-devel-request@kde.org?subject=subscribe (subscribe)].&lt;br /&gt;
::::* For questions relating to Konqueror development, your main choice is [mailto:kfm-devel@kde.org kfm-devel] [mailto:kfm-devel@kde.org?subject=subscribe (subscribe)]&lt;br /&gt;
::::* For questions relating to KOffice development, your main choice is [mailto:koffice-devel@kde.org koffice-devel] [mailto:koffice-devel-request@kde.org?subject=subscribe (subscribe)]&lt;br /&gt;
::::* For questions relating to games development, your main choice is [mailto:kde-games-devel@kde.org kde-games-devel] [mailto:kde-games-devel-request@kde.org?subject=subscribe (subscribe)]&lt;br /&gt;
::::* For questions relating to [http://qt.nokia.com/ Qt development], please use the fine [http://lists.trolltech.com/qt-interest/ Qt mailing list].&lt;br /&gt;
A full list of KDE mailing lists is available [http://www.kde.org/mailinglists/ here] and [http://mail.kde.org/mailman/listinfo here].&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Contribute/First_Steps_with_your_KDE_SVN_Account</id>
		<title>Contribute/First Steps with your KDE SVN Account</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Contribute/First_Steps_with_your_KDE_SVN_Account"/>
				<updated>2011-07-19T08:21:13Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{warning|This page is yet to be reviewed for changes required by the migration to Git.  Information and commands on this page may no longer be valid and should be used with care. Please see the [[Development/Git|KDE Git hub page]] for more details. }}&lt;br /&gt;
&lt;br /&gt;
{{improve}}&lt;br /&gt;
This tutorial is about what to do when you are a fresh owner of a new contributor account for KDE.&lt;br /&gt;
&lt;br /&gt;
== Notations ==&lt;br /&gt;
* ''SVN'' is used to describe an SVN server, mostly KDE's non-anonymous or anonymous SVN servers.&lt;br /&gt;
* The lower case word ''svn'' is used to describe the program named svn, which the user can use to access SVN.&lt;br /&gt;
* By ''username'' the name of your KDE SVN account is meant (also known as ''login'').&lt;br /&gt;
&lt;br /&gt;
== Preliminary ==&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that you have [[Contribute/Get a Contributor Account|applied for a KDE Contributor account as described here]] and that you have received a positive answer with the information associated with your new account.&lt;br /&gt;
&lt;br /&gt;
== Read First! ==&lt;br /&gt;
&lt;br /&gt;
Now you have a KDE Contributor account.&lt;br /&gt;
&lt;br /&gt;
Please note that the answer email will have an explanation about how to use the account. (This explanation is also the file [http://websvn.kde.org/trunk/kde-common/svn/svn_instructions.txt?view=markup kde-common/svn/svn_instructions.txt].) It contains also topics not discussed here. So please read this email.&lt;br /&gt;
&lt;br /&gt;
In case of conflicting instructions, please follow those of the '''email''', not the ones of this tutorial.&lt;br /&gt;
&lt;br /&gt;
== Changed URLs ==&lt;br /&gt;
&lt;br /&gt;
Until now, you have worked with one of the anonymous servers. Now that you have a KDE Contributor account, you will not use that anonymous server anymore. Therefore the base URL to the SVN server changes for you.&lt;br /&gt;
&lt;br /&gt;
For the standard anonymous SVN of KDE, it was: {{path|svn://anonsvn.kde.org}} assuming that you have not used an anonymous SVN mirror. If you have used another anonymous SVN server for KDE, then please use its URL instead.&lt;br /&gt;
&lt;br /&gt;
{{Note|If you are unsure which SVN anonymous server you have used, use the &amp;lt;tt&amp;gt;svn info&amp;lt;/tt&amp;gt; command to get the server URL.}}&lt;br /&gt;
&lt;br /&gt;
Now the new base URL for your access to the KDE SVN server will be:&lt;br /&gt;
 svn+ssh://username@svn.kde.org/home/kde&lt;br /&gt;
where &amp;lt;tt&amp;gt;username&amp;lt;/tt&amp;gt; is the name that was given to your KDE SVN account.&lt;br /&gt;
&lt;br /&gt;
== Changing The URLs of the Modules of Your Local SVN Copy ==&lt;br /&gt;
This only applies if you have local copies of SVN files that were taken from an anonymous SVN Server, otherwise skip this.&lt;br /&gt;
&lt;br /&gt;
To use the KDE SVN server instead of one of the anonymous SVN servers, you need to tell each module of your local SVN copy that you want to change the server. SVN does this with the command&lt;br /&gt;
 svn switch --relocate&lt;br /&gt;
&lt;br /&gt;
Assuming that you are processing the kdelibs module, you have to use:&lt;br /&gt;
 svn switch --relocate svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs svn+ssh://username@svn.kde.org/home/kde/trunk/KDE/kdelibs&lt;br /&gt;
&lt;br /&gt;
For other modules than kdelibs (or for branches or for tags), you have to change the relative module path; similarly, if you used another anonymous server.&lt;br /&gt;
&lt;br /&gt;
Be careful on what URLs you type, as SVN will only replace the exact old URL by the exact new URL. So if you mistype one of the URLs, it will not work later. (If you have already fallen into this pitfall, it is not a problem, just use relocate again to replace the wrong URL with the right one.)&lt;br /&gt;
&lt;br /&gt;
You will be asked to accept the SSL certificate on the first attempt to access the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ svn switch --relocate svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs svn+ssh://username@svn.kde.org/home/kde/trunk/KDE/kdelibs&lt;br /&gt;
The authenticity of host 'svn.kde.org (195.135.221.74)' can't be established.&lt;br /&gt;
RSA key fingerprint is 86:f3:66:06:20:74:81:d0:1b:b4:2f:25:03:f7:8e:fb.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added 'svn.kde.org,195.135.221.74' (RSA) to the list of known hosts.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the fingerprint matches that in the document [http://techbase.kde.org/Getting_Started/Sources/Using_Subversion_with_KDE#The_KDE_repository_structure Using Subversion with KDE]. (Normally, the SHA1 fingerprint is used for HTTPS.)&lt;br /&gt;
&lt;br /&gt;
== First Test ==&lt;br /&gt;
&lt;br /&gt;
The following steps are described using the command line tool &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt;. Personally, I find it better to start with it, as you know immediately where the problems are. Of course, after you have made your first test, you may use whatever tool that you prefer.&lt;br /&gt;
&lt;br /&gt;
Then you should be ready to start. The best test is to try to update a small directory. So change to a (small) directory of your local copy of KDE and type: &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;svn update&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you have no local copies installed, you can just checkout a module.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;svn checkout YOUR_URL&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Obviously, replace YOUR_URL with the correct path.&lt;br /&gt;
&lt;br /&gt;
Now you can use the SVN commands on KDE's main SVN.&lt;br /&gt;
&lt;br /&gt;
{{note|If you know CVS, you will perhaps wonder that there is no &amp;lt;tt&amp;gt;cvs login&amp;lt;/tt&amp;gt;, Subversion has chosen not to have such a way to login. The login is done at the first connection, where authentication is needed.}}&lt;br /&gt;
&lt;br /&gt;
== Default Editor ==&lt;br /&gt;
&lt;br /&gt;
This section is only useful if you plan to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; program. If you always plan to use a GUI front-end, you can skip this section.&lt;br /&gt;
&lt;br /&gt;
When committing, &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; wants some text for commenting the commit. You can either specify it directly with the &amp;lt;tt&amp;gt;-m&amp;lt;/tt&amp;gt; parameter or by a file with &amp;lt;tt&amp;gt;-F&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;--file&amp;lt;/tt&amp;gt;. If you do neither of both, &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; will run an editor to ask for a comment.&lt;br /&gt;
&lt;br /&gt;
* TODO: improve this section&lt;br /&gt;
* TODO: better ask the user to modify the svn configuration files?&lt;br /&gt;
&lt;br /&gt;
This editor is taken either from the svn configuration files or if not defined there from the environment variables: first &amp;lt;tt&amp;gt;$SVN_EDITOR&amp;lt;/tt&amp;gt;, then &amp;lt;tt&amp;gt;$VISUAL&amp;lt;/tt&amp;gt;, then &amp;lt;tt&amp;gt;$EDITOR&amp;lt;/tt&amp;gt; depending which one is defined.&lt;br /&gt;
&lt;br /&gt;
So maybe you should check your environment variables:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo $SVN_EDITOR&lt;br /&gt;
echo $VISUAL&lt;br /&gt;
echo $EDITOR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that their settings suit you for your work with svn. If they do not suit you, check your file {{path|~/.bashrc}} and add something like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;export SVN_EDITOR=mcedit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here it sets mcedit, replace it with your favorite editor. Of course you can set &amp;lt;tt&amp;gt;$EDITOR&amp;lt;/tt&amp;gt; instead if you want to change the default editor for you.&lt;br /&gt;
&lt;br /&gt;
Be careful that if you do not set a command line editor but one that needs X-Window, you will need to run svn always in a X-Window terminal. It might suit you, it might not. Your choice!&lt;br /&gt;
&lt;br /&gt;
== Subversion Configuration ==&lt;br /&gt;
&lt;br /&gt;
For proper of ''svn status'' and ''svn diff'' on KDE sources, you might want to follow the instructions from [http://developer.kde.org/documentation/other/developer-faq.html#q1.5.2 the developer FAQ] for setting up {{path|~/.subversion/config}}.&lt;br /&gt;
&lt;br /&gt;
== Committing ==&lt;br /&gt;
&lt;br /&gt;
Now a few words about how to commit.&lt;br /&gt;
&lt;br /&gt;
First be sure that the code that you want to commit is right. If you are not certain about a patch, or have some doubts, consider perhaps sending your patch to the relevant mailing list or to the relevant developer if you know who he is.&lt;br /&gt;
&lt;br /&gt;
Also when committing, please give a useful message with the commit. Think about what you would like to find in, say, two years. (One day, you will probably find out that meaningless commit entries like &amp;quot;Fix&amp;quot; or &amp;quot;Here too&amp;quot; are going to drive you crazy when you have to debug a problem.)&lt;br /&gt;
&lt;br /&gt;
Good code is not always only about questions like: &amp;quot;Does the code compile?&amp;quot; The code must also fit in what is planned. For example if a new code fixes just one little bug but the maintainer of the code is currently doing a re-write, he will perhaps not be pleased that something has been committed, because he will have to fix all conflicts between the newly committed code and his new code.&lt;br /&gt;
&lt;br /&gt;
So the best is to communicate (if possible early) to avoid any surprise. A surprised developer is highly at risk of giving a rude answer or at least not a pleasant answer. This is avoidable by communication. Of course, a developer might ask to leave the code alone. Please respect that! (Of course, it does not mean that you should not argue.)&lt;br /&gt;
&lt;br /&gt;
== Commit-Digest ==&lt;br /&gt;
&lt;br /&gt;
The [http://www.commit-digest.org KDE Commit-Digest] is a weekly overview of the commits to KDE's subversion server. Now that you have a SVN account, you will probably see your own name in there soon!&lt;br /&gt;
&lt;br /&gt;
The digest features a small statistics section. To improve the accuracy of those, you should add some information, like age or country, about yourself, which you can do [http://commit-digest.org/data here].&lt;br /&gt;
&lt;br /&gt;
== Commit-Filter ==&lt;br /&gt;
[http://commitfilter.kde.org/ Commit-Filter] is a service which allows you to monitor folders (or authors) in SVN for changes, and have each commit's diff emailed to you. This is very useful if you are interested in getting involved in a certain sub-project of KDE and want to keep up with its development.&lt;br /&gt;
&lt;br /&gt;
Please use reply-to-all when responding to those emails.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
; Subversion&lt;br /&gt;
: [[Getting_Started/Sources/Using_Subversion_with_KDE|Using Subversion with KDE]]&lt;br /&gt;
&lt;br /&gt;
;i18n&lt;br /&gt;
:[[Development/Tutorials/Localization/i18n|What is i18n and how to use it]]&lt;br /&gt;
&lt;br /&gt;
; I18N/L10N&lt;br /&gt;
: [http://developer.kde.org/documentation/library/kdeqt/kde3arch/kde-i18n-howto.html KDE Programmer's i18n howto]&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/FAQs/General_FAQ</id>
		<title>Development/FAQs/General FAQ</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/FAQs/General_FAQ"/>
				<updated>2011-07-19T08:19:19Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:I18n/Language Navigation Bar|Development/FAQs/General FAQ}}&lt;br /&gt;
==I want to start this new application. What do you advise?==&lt;br /&gt;
We all agree that there are plenty of KDE applications that need to be written. But there are also a lot of existing kde applications that need your help.&lt;br /&gt;
&lt;br /&gt;
To see the areas where help is needed, check [http://www.kde.org/jobs/ this page].&lt;br /&gt;
&lt;br /&gt;
Before starting a new application, it's always a good idea to check [http://www.kde-apps.org/ KDE-Apps.org] for existing applications and to ask on the  [https://mail.kde.org/mailman/listinfo/kde-devel kde-devel] mailing-list whether someone is already working on a similar project.&lt;br /&gt;
&lt;br /&gt;
==I am a developer, how can I contribute to KDE?==&lt;br /&gt;
KOffice and KDevelop, despite being very praised, have very few developers, so you might check there. There is no need to be a KDE core-developer to help. KDE is very modular so you can perfectely improve one area without knowing how the whole system works.&lt;br /&gt;
&lt;br /&gt;
You can also ask on  [https://mail.kde.org/mailman/listinfo/kde-devel kde-devel] if someone needs help on an application.&lt;br /&gt;
Use the latest version of KDE and spot things that are needed. A theme generator? A konsole schema editor? Improve a game? There is always a small feature missing. Go and implement it!&lt;br /&gt;
&lt;br /&gt;
Are you familiar or attracted with a specific field? See if there is a related application that could use your help. Or write one. KDE needs more non-geek oriented applications.&lt;br /&gt;
&lt;br /&gt;
==I am not a developer, how can I help?==&lt;br /&gt;
There are plenty of tasks that don't require development skills. Write reviews of applications for the promoting of KDE (see the [https://mail.kde.org/mailman/listinfo/kde-promo kde-promo] mailing-list), help the documentation team (see [http://l10n.kde.org/docs/ i18n.kde.org/doc]), help the translations (see [http://l10n.kde.org/ i18n.kde.org]), help to filter the incoming bugs (see [https://bugs.kde.org/ bugs.kde.org]). &lt;br /&gt;
&lt;br /&gt;
==Where can I find images of Konqi the dragon?==&lt;br /&gt;
The Konqi for some people SDK is at [ftp://ftp.kde.org/pub/kde/devel/konqi_sdk.tar.bz2 ftp.kde.org/pub/kde/devel/konqi_sdk.tar.bz2]&amp;lt;br /&amp;gt;&lt;br /&gt;
It was posted to artist.kde.org before that site ceased to be updated.&lt;br /&gt;
&lt;br /&gt;
Further images are on [http://kde.org/stuff/clipart.php KDE merchandise].&lt;br /&gt;
&lt;br /&gt;
==What is the level required to contribute to KDE? What should I learn? What should I read?==&lt;br /&gt;
You need to know C++. Read the Qt tutorials and browse the Qt docs to get familiar with what's available with Qt. Then read the KDE tutorials and browse architecture and documentation. You can also read the KDE Book, it can not harm. But you don't have to be familiar with the whole KDE architecture to become a kde developer. Using kde's technologies is quite easy, so concentrate on what you really need, you can learn the other bits later on. &lt;br /&gt;
[http://techbase.kde.org KDE TechBase] and [http://doc.qt.nokia.com/ doc.qt.nokia.com] (also in your {{path|$QTDIR/doc/html}}) are invaluable resources, take advantage of them.&lt;br /&gt;
Then, browse the source, look for the examples directories, see how the other did code their applications. Reading and writing code is the best way to learn.&lt;br /&gt;
&lt;br /&gt;
==How do I get KDE software from the KDE git or SVN repositories?==&lt;br /&gt;
See the &amp;quot;Building and Running KDE Software From Source&amp;quot; section on the [[Getting_Started]] page.&lt;br /&gt;
&lt;br /&gt;
==Can I access KDE source code online?==&lt;br /&gt;
Yes&lt;br /&gt;
* Browse http://websvn.kde.org/ and https://projects.kde.org/&lt;br /&gt;
* Search the source code at http://lxr.kde.org/search&lt;br /&gt;
* Browse API docs generated from the source code at http://api.kde.org/&lt;br /&gt;
&lt;br /&gt;
==What should I put in my .subversion/config?==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;[miscellany]&lt;br /&gt;
global-ignores = *.moc *.moc.cc *.moc.cpp config.log config.status \&lt;br /&gt;
config.cache *.gmo .deps .libs SunWS_cache *.lo *.la *.rpo *.la.closure \&lt;br /&gt;
*_la_closure.cpp *_la_closure.cc *_la_closure.cxx *.all_cc.cc *.all_cpp.cpp \&lt;br /&gt;
*.all_C.C *.all_cxx.cxx *_meta_unload.cc *_meta_unload.h *_meta_unload.cpp \&lt;br /&gt;
*_meta_unload.C *_meta_unload.cxx index.cache.bz2 .memdump Makefile.rules.in \&lt;br /&gt;
Makefile.calls.in Makefile.rules Makefile.calls autom4te.cache *.kidl \&lt;br /&gt;
*.o *.lo *.la #*# .*.rej *.rej *.pyc&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
And to make svn diff ignore whitespace, and print function names: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;[helpers]&lt;br /&gt;
diff-cmd = /usr/local/bin/_svndiff&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the following in {{path|/usr/local/bin/_svndiff}}:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;#!/bin/sh&lt;br /&gt;
exec /usr/bin/diff -b -u -p &amp;quot;$@&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don't forget to make {{path|/usr/local/bin/_svndiff}} executable.&lt;br /&gt;
&lt;br /&gt;
==I want to put my app in KDE==&lt;br /&gt;
There are three requirements: &lt;br /&gt;
* your app must compile with the latest version of KDE (git master or SVN trunk).&lt;br /&gt;
* your app must be stable.&lt;br /&gt;
* your app must be maintained. You will probably get a good deal of bug reports and wishes. People expect you to fix the bugs and implement the wishes that make sense.&lt;br /&gt;
See also the next question.&lt;br /&gt;
&lt;br /&gt;
==Is it better to develop inside or outside KDE?==&lt;br /&gt;
As core developer Waldo Bastian explains in a copyrighted mail: &lt;br /&gt;
----&lt;br /&gt;
:Being part of KDE means that you have to work together with others. Such cooperation brings along advantages but it also brings along responsibilities.&lt;br /&gt;
: &amp;lt;br /&amp;gt;&lt;br /&gt;
:Some of those advantages are: your code ends up on all distro's, people might fix your bugs, you get free translations and documentation, you get tons of bugreports.&lt;br /&gt;
: &amp;lt;br /&amp;gt;&lt;br /&gt;
:On the other side there are disadvantages and responsibilities: you will have to communicate with other developers about your work, other people might make changes to your code, you will have to respect release freezes, you get tons of bugreports and people actually expect that you fix them as well (what are they smoking?), people expect you to maintain your code.&lt;br /&gt;
: &amp;lt;br /&amp;gt;&lt;br /&gt;
:You can't chose for the advantages and ignore the responsibilities that come with it, it's a complete package, it's both or nothing.&lt;br /&gt;
: &amp;lt;br /&amp;gt;&lt;br /&gt;
:In general it should be the author of a piece of software that chooses to put his application in KDE's repositories. We usualy don't put software in KDE's repositories unless the author wishes to do so. The other way around, if the author prefers to work on his application elsewhere then that's his right as well. Unless there is a split in the actual group of people working on the application it makes no sense to fork the development of an application because of that.&lt;br /&gt;
: &amp;lt;br /&amp;gt;&lt;br /&gt;
:'''BUT'''... by putting your code under and open source license and putting it in a KDE repository you give the world at large, as well as KDE in particular, the irrevocable right to use your code. And KDE will use that right at its discretion to protect the interests of KDE, even if that goes against the wishes of the author at that point in time.&lt;br /&gt;
----&lt;br /&gt;
It is important to know that but don't be afraid. Usually, things work very well. In 5 years, it has only happened once that a developer had his work put kept in KDE while he wanted to remove it.&lt;br /&gt;
&lt;br /&gt;
==How do I get write access to KDE repositories?==&lt;br /&gt;
See full article at [[Contribute/Get_a_Contributor_Account|Contribute &amp;gt; Get a KDE Contributor Account]].&lt;br /&gt;
&lt;br /&gt;
Go to [[http://identity.kde.org KDE Identity]] , fill out the form and describe why you need write access. Make sure to specify your full name and e-mail address.&lt;br /&gt;
&lt;br /&gt;
Please also include the name of your bugs.kde.org account, if non-existent please create one so that it can be given usual developer rights. Closing bugs.kde.org reports with keywords in commit comments only works if the email address of your KDE Identity and bugs.kde.org accounts match. You can change your bugs.kde.org address in the Bugzilla user settings.&lt;br /&gt;
&lt;br /&gt;
Git requires use of an ssh key, and new accounts for SVN must also choose the svn+ssh protocol. Send a public ssh key (e.g. {{path|~/.ssh/id_dsa.pub}})&lt;br /&gt;
 &lt;br /&gt;
See also [[#How do I create a SSH key?]]&lt;br /&gt;
&lt;br /&gt;
If you are contributing to an application that is not yours, it is a good idea to first submitting your coding as patches to the author and let him apply them. If the author is not maintaining his application, you might become the new maintainer...&lt;br /&gt;
&lt;br /&gt;
Although there are few restrictions on repository commit rights, we expect you not to distrupt other developers' code without their consent. You must also respect the feature freezes of the release schedule (published on developer.kde.org)&lt;br /&gt;
&lt;br /&gt;
A detailed list of rules you should follow when committing to KDE repositories are listed in the [[/Policies/SVN_Commit_Policy|KDE  Commit Policy]].&lt;br /&gt;
&lt;br /&gt;
==My app is not stable but I would like to have it in KDE==&lt;br /&gt;
As a first step, we can put it in playground, which is essentially &amp;quot;kde-alpha&amp;quot;. Develop it there and when it is ready, request that your app to be moved to the appropriate KDE package or the extragear module.&lt;br /&gt;
&lt;br /&gt;
==I don't want to lose my SVN history.==&lt;br /&gt;
This is no longer possible with Subversion. Maybe in the future, if the server is upgraded and allows that. Note that for git this is not an issue.&lt;br /&gt;
&lt;br /&gt;
==What is kdebindings?==&lt;br /&gt;
It contains Qt bindings for Ruby, PHP, C# to use Qt classes with those langages, KDE bindings for  Ruby, C#, python to use KDE classes with those langages, and XParts to embed non-KDE apps as a KPart. Check the [[Development/Languages|binding page]] of TechBase. &lt;br /&gt;
&lt;br /&gt;
==Does the feature freeze apply to playground?==&lt;br /&gt;
No, playground are not a released packages. The same is true for kdereview and extragear: they are not frozen and released. But if you want your app to move to a package, ask for it before the beta-release.&lt;br /&gt;
&lt;br /&gt;
==Can I have a stable and an unstable KDE on the same computer?==&lt;br /&gt;
Yes, check the Building 2 Versions documentation. &lt;br /&gt;
&lt;br /&gt;
==How do I know which version of Qt/KDE I am using?==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;kde-config&amp;lt;/tt&amp;gt; and all kde programs accept &amp;lt;tt&amp;gt;--version&amp;lt;/tt&amp;gt; as argument.&lt;br /&gt;
&lt;br /&gt;
==Qt-copy or Qt from qt.nokia.com : if one were doing a clean build of trunk, which would be preferable?==&lt;br /&gt;
You can use either. They are binary compatible (forward and backward). There can be, however, a few bugfixes in qt-copy over the most recent Qt release. Especially if building from qt-copy, pay attention to the apply-patches script.&lt;br /&gt;
&lt;br /&gt;
==How can I checkout a single directory from a SVN module?==&lt;br /&gt;
Checkout the top-level dir with 'svn co -N /modulename', 'cd modulename', 'svn up admin' to get the admin/ dir and then finally checkout the dir you want with 'svn up subdir'&lt;br /&gt;
&lt;br /&gt;
For instance, to get only reaktivate from playground/utils:&lt;br /&gt;
 svn co -N /playground/utils; svn up reaktivate&lt;br /&gt;
Then compile as usual.&lt;br /&gt;
&lt;br /&gt;
The same answer applies to the question &amp;quot;How do I get a single language out of kde-i18n?&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you don't know the name of the directory you want to check out, you can browse websvn.kde.org to find it.&lt;br /&gt;
&lt;br /&gt;
==How can I get one of the KDE application as a standalone tarball?==&lt;br /&gt;
kdesdk/scripts/svn2dist is a script to extract an application from the KDE source tree and package it as a standalone application. &lt;br /&gt;
&lt;br /&gt;
==How do I close my own bug reports?==&lt;br /&gt;
If you reported a bug that is fixed in a new release of KDE but is still reported as open, you can close it. It might happen because your bug is the same as another one, or simply because the developer fixed something without noticing that it would correct your bug.&lt;br /&gt;
&lt;br /&gt;
You can do that from your Subversion commit. To do so, append to your commit message a line like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;BUG: XXXXX&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Where &amp;lt;tt&amp;gt;XXXXX&amp;lt;/tt&amp;gt; is the bug report you want to close. If the report you're closing is adding a new feature, you can use FEATURE instead of BUG. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Managing a bug list is a huge task for the developers and they usually have a lot of bugs listed, some being fixed already without their knowledge, some being unreproducible, some without enough information to be corrected, etc. If you can help by managing and updating the list of outstanding bugs, you will be gladly welcome. And you will receive an even happier welcome if you provide a patch.&lt;br /&gt;
&lt;br /&gt;
==How do I create a SSH key?==&lt;br /&gt;
SSH makes use of two keys: a private key and a public key. You should keep the private key secret at all times and only place it on machines over which you have direct control. Public, shared, and community machines are not suitable environments to store SSH private keys. Take action to help prevent theft of your SSH private key data. Setting a password on your SSH private key will help reduce the risks involved with private key theft.&lt;br /&gt;
&lt;br /&gt;
Generate a key pair for each major location you work from. This helps to reduce the impact when your key gets stolen. &lt;br /&gt;
When someone obtains access to your private key, your key can be abused in attempts to compromise KDE servers. Well known open source projects have been compromised this way in the past, YOU must help us to make sure that this doesn't happen with KDE servers as well. For that reason it is important to notify sysadmin (at) kde (dot) org immediately when you notice that someone may have had access to your private key for example when a computer on which it was stored has been hacked or infected with a virus, worm or trojan.&lt;br /&gt;
&lt;br /&gt;
If you choose to make a backup of your SSH private key data, please ensure that any such backup is stored in a secure manner as well.&lt;br /&gt;
&lt;br /&gt;
For the practical part, the following command can be used to generate a SSH private/public key pair with&lt;br /&gt;
 ssh-keygen -t dsa&lt;br /&gt;
This will create a private key as {{path|~/.ssh/id_dsa}} and a public key as {{path|~/.ssh/id_dsa.pub}}.&lt;br /&gt;
&lt;br /&gt;
There are times when you may want to use a key of a different name to the default, perhaps to use seperate keys for different projects. To let SSH know which key you want to use for KDE.org, you can keep a list of servers and their corresponding keys in ~/.ssh/config. For example,&lt;br /&gt;
 Host svn.kde.org &lt;br /&gt;
 IdentityFile ~/.ssh/id_dsa_kde &lt;br /&gt;
In order to use SSH to access KDE servers you need to send your public key to sysadmin (at) kde (dot) org.&lt;br /&gt;
&lt;br /&gt;
==How can I monitor changes made by others?==&lt;br /&gt;
The [https://mail.kde.org/mailman/listinfo/kde-commits kde-commits] mailinglist carries automatic notifications for all changes made in the KDE repositories. The KDE-Commits mailinglist is very high traffic. An alternative is [http://commitfilter.kde.org/ CommitFilter] which allows you to get notification for only those areas that interest you.&lt;br /&gt;
[[Category:FAQs]]&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Policies/Application_Lifecycle</id>
		<title>Policies/Application Lifecycle</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Policies/Application_Lifecycle"/>
				<updated>2011-07-19T08:10:06Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{warning|This page is yet to be reviewed for changes required by the migration to Git.  Information and commands on this page may no longer be valid and should be used with care. Please see the [[Development/Git|KDE Git hub page]] for more details. }}&lt;br /&gt;
&lt;br /&gt;
When you want to start a new application (or remove an old application), you want to know where you should place it in the Subversion repository. This document describes where to go in which stage of your application.&lt;br /&gt;
&lt;br /&gt;
See [[#Stage 3: The end]] for instructions on how to deal with old, unmaintained applications.&lt;br /&gt;
&lt;br /&gt;
In a diagram it all comes down to:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:svnguidelines.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Stage 1: The start ===&lt;br /&gt;
The start of a new application can take place on a local disk, in a local repository or any other way. Another option is provided by KDE in the special {{path|/trunk/playground}} folder in the repository where everyone is free to commit ones own application. You can [[Contribute/Get_a_Contributor_Account | request an KDE Contributor account]] and after that you can import your project in the subfolder of your choice. Applications in playground are organized in folders like KDE is itself. For example, games are in {{path|/trunk/playground/games}}. In each of these folders, there is a {{path|doc}} folder where you should put the docbook documentation of your application.&lt;br /&gt;
&lt;br /&gt;
It is not meant as a backup area, so you should not develop your application somewhere else and only sync the changes now and then to KDE's repository.&lt;br /&gt;
&lt;br /&gt;
As soon as you start releasing your software and match the criteria for the next stage, you should consider moving your application folder to the next stage. When doing this move, don't forget to move also its documentation folder. &lt;br /&gt;
&lt;br /&gt;
Because playground is something like an 'experimental' area, there is only a small amount of applications that make it to the next stage. To keep the playground area accessible and a bit organized, we have created a {{path|/tag/unmaintained/N}} (where 'N' is the KDE  major version the application was written for; e.g. 4 for KDE4 applications). If you do not want to continue your application, move it to that place in the repository. If you do not know how, contact the current contactperson which is mentioned at the bottom of this document.&lt;br /&gt;
&lt;br /&gt;
Whenever an application has not received a commit for one complete year, you will be contacted via email to discuss if you want to continue the application or if it has died. In the latter case or when the email bounces, it will be moved to {{path|/tag/unmaintained/N/}}.&lt;br /&gt;
&lt;br /&gt;
=== Stage 2: Stable ===&lt;br /&gt;
When you have made one of more releases and want to continue to develop it, the term 'playground' does no longer apply to you. That is the right time to move out of here. There are two options to move to: extragear and one of the KDE main modules. If you want to move to one of the KDE main modules, you will get released with KDE. That also means you have to respect that release schedule. The fact you want your program in KDE main modules is not enough and others have to agree is valuable to have it. &lt;br /&gt;
In extragear you are on your own. You make the releases whenever you want and you have to talk to the translators about your release schedule. In the future it might be possible to be released together with the KDE main modules. But at this moment this is not possible.&lt;br /&gt;
&lt;br /&gt;
Whatever you choose, there are some rules to follow before you are allowed to move to either location: &lt;br /&gt;
* There should be user documentation in docbook format. If you need help, you can ask for help to the KDE Documentation team: [https://mail.kde.org/mailman/listinfo/kde-doc-english kde-doc-english@kde.org].&lt;br /&gt;
* There should be developers documentation in the form of apidox for libraries you can check this at [http://www.englishbreakfastnetwork.org/ ebn]&lt;br /&gt;
* There should be no krazy code checker issues reported. Again, you can check that at [http://www.englishbreakfastnetwork.org/ ebn]. There is also a [[Development/Tutorials/Code_Checking|tutorial on using Krazy]] available here on TechBase.&lt;br /&gt;
* If possible, there should have been a basic usability review of your application. Usability people are hard to get, so this is not crucial.&lt;br /&gt;
* You should have checked for basic problems with a profiler. I hope we will get a tutorial on how to do this soon&lt;br /&gt;
* Your application should be [[Development/Tutorials/Localization/i18n|completely translatable]]. &lt;br /&gt;
&lt;br /&gt;
When you decide you want to move to this second stage, use `svn mv` to move your application to {{path|/trunk/kdereview}} and announce the move on '''kde-core-devel@kde.org''' (no, project mailing lists are not good enough). In the announcement address the above issues and state where you want your application to move to (which KDE main module or extragear). Extragear only requires general approval on kde-core-devel. A main module requires approval from the community who manages that module (e.g. the kdepim module requires approval from the kdepim community). Don't forget to move the documentation of your application to {{path|/trunk/kdereview/doc}}. Some suggestions for reviewers to consider when reviewing new applications and library code are on [[Policies/Suggested_Review_Criteria]].&lt;br /&gt;
&lt;br /&gt;
The move to kdereview starts a two week review period during which the community can object to your proposal or request additional changes. If there are no objections or requested changes after this two week period, you are allowed to move your application to the place you requested. If your intention is to move to a main module you must additionally get approval from the [[Projects/Release_Team#Module_Coordinators|module coordinator(s)]] who manage that module.&lt;br /&gt;
&lt;br /&gt;
If changes are requested, you can leave your application in kdereview while you are actively working on those issues. If you lack the time to work on the changes, move your application back to playground. Once the requested changes are completed, announce to kde-core-devel that you have completed the requested changes and wait for another week for objections.&lt;br /&gt;
&lt;br /&gt;
Kdereview is only meant as a transitional place from playground to the main modules or extrager. In no case can kdereview be a permanent place to develop your application.&lt;br /&gt;
&lt;br /&gt;
=== Stage 3: The end ===&lt;br /&gt;
Whenever you decide to stop developing the application and that leaves the application without developers, please announce that to kde-core-devel. If nobody stands up to take over maintainership within two weeks, the application has to be moved to the {{path|/tags/unmaintained/N/}} area as every application in the KDE main modules and in extragear needs to have a maintainer to stay there.&lt;br /&gt;
&lt;br /&gt;
=== Translations ===&lt;br /&gt;
For each move of code and documentation in subversion, the translation files of each language need to move as well. Because this requires a complete checkout of the l10n folder and some knowledge about the structure, you can ask the i18n team ('''kde-i18n-doc@kde.org''') to move them. Send a simple mail with the information required to do the move, for example: 'move {{path|/playground/somewhere/someapp}} to {{path|/kdereview/someapp}}'.&lt;br /&gt;
If you want to help out with these kinds of moves, please send a mail! You are welcome to help out.&lt;br /&gt;
&lt;br /&gt;
=== Contact ===&lt;br /&gt;
If you need any help regarding this, please contact Tom Albers ('''tomalbers@kde.nl''')&lt;br /&gt;
&lt;br /&gt;
[[Category:Policies]]&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Contribute/Get_a_Contributor_Account</id>
		<title>Contribute/Get a Contributor Account</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Contribute/Get_a_Contributor_Account"/>
				<updated>2011-07-19T08:03:37Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: moved Contribute/Get a SVN Account to Contribute/Get a Contributor Account: SVN is no longer what we use, so make this more generic.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:I18n/Language Navigation Bar|Contribute/Get a SVN Account}}&lt;br /&gt;
This tutorial is about how to apply for a commit account for KDE so that you may change files (code, documentation files, art, etc.) in KDE's git and svn repositories.&lt;br /&gt;
&lt;br /&gt;
== The short answer: how to get read-write access ==&lt;br /&gt;
&lt;br /&gt;
KDE Contributor accounts are managed through [http://identity.kde.org/ KDE Identity]. You can request Developer Access in the website's menu upon registering and logging into your account.&lt;br /&gt;
&lt;br /&gt;
== KDE Respositories ==&lt;br /&gt;
&lt;br /&gt;
To have write access to KDE's git and SVN servers, you have to use KDE's main git and SVN server. Anonymous git and SVN uses mirrors of this server. Note that SVN does not allow you to read from one server and write to another, while git does. For a tutorial on using KDE's git services, see [[/Development/Git|this tutorial]].&lt;br /&gt;
&lt;br /&gt;
To be able to write to files stored in KDE's git and SVN repositories, you need an account. An account is made up of a username (normally your family name), a password, an ssh key and an email address. The username is for getting in, the password and ssh keys are for authenticating and the email address for knowing who to contact if another developer wants to contact the account holder.&lt;br /&gt;
&lt;br /&gt;
A KDE commit account allows you to write to nearly anywhere in the KDE repositories with a few exceptions, such as the www module. (Of course, exceptions can be made for this as well.)&lt;br /&gt;
&lt;br /&gt;
'''Note''': you can see the accounts in [http://websvn.kde.org/trunk/kde-common/accounts kde-common/accounts]. That is the list of all accounts. Yes, '''the account list is public''', for example on [http://websvn.kde.org WebSVN].&lt;br /&gt;
&lt;br /&gt;
== Who Can Apply For a KDE Contributor Account? ==&lt;br /&gt;
&lt;br /&gt;
Normally, any developer who has done some work on projects hosted by KDE can apply for a KDE Contributor account.&lt;br /&gt;
&lt;br /&gt;
Translators should get approval from their team leader so that they can organize how the work is being done in his/her team. Please mention the approval from the team leader when requesting the account.&lt;br /&gt;
&lt;br /&gt;
Please also [[Policies/SVN Commit Policy|read the KDE commit policy]]. You must accept these rules when using your future KDE Contributor account. Please also familiarize yourself with the [http://www.kde.org/code-of-conduct/ KDE Code of Conduct] which describes the social foundations within KDE.&lt;br /&gt;
&lt;br /&gt;
Also please apply for an account only if you think that you will work on KDE for a somewhat longer time. If you know that you will only work for a couple of weeks and then never again, please consider not applying for a KDE Contributor account but instead continue to send patches directly to developers.&lt;br /&gt;
&lt;br /&gt;
The limitations are not there to exclude anyone - they are there to ensure that the maintenance of accounts remains reasonable.&lt;br /&gt;
&lt;br /&gt;
Of course, to be clear: ''the KDE's sysadmins have the last word about whether or not to create a KDE SVN account for somebody''.&lt;br /&gt;
&lt;br /&gt;
== SSH ==&lt;br /&gt;
&lt;br /&gt;
You need an SSH public key in order to access your KDE Contributor account. If you already have one, you can skip the next subsection and go to [[#Setting up the SVN+SSH protocol|Setting up the SVN+SSH protocol]].&lt;br /&gt;
&lt;br /&gt;
=== Generating the SSH keys ===&lt;br /&gt;
&lt;br /&gt;
To be able to use your KDE Contributor account with SSH, you need a SSH public key. Please notice that it is '''not''' a GPG (OpenPGP) key, which is completely unrelated!&lt;br /&gt;
&lt;br /&gt;
The password in the sense of this documentation is the '''public key''' that you are creating.&lt;br /&gt;
&lt;br /&gt;
For more information on how to create a pair of SSH keys, please refer to a [http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygen SSH documentation] or book.&lt;br /&gt;
&lt;br /&gt;
The command to create a pair of keys is '''ssh-keygen''' and it requires the type of key you will create, either DSA or RSA - both are fine.&lt;br /&gt;
&lt;br /&gt;
To create a new pair of keys, use &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;ssh-keygen -t dsa&amp;lt;/syntaxhighlight&amp;gt; or &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;ssh-keygen -t rsa&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a type called RSA1 which was used in version 1 of the SSH protocol. See the [http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygen ssh documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
You can then accept the default filename for your key (either {{path|$HOME/.ssh/id_dsa}} or {{path|$HOME/.ssh/id_rsa}}, depending on the type of key you have chosen). After that, a passphrase is asked. It is recommended that you do not leave it blank.&lt;br /&gt;
&lt;br /&gt;
Now that you are finished generating your key pair, you will have two files: a private key and a public key. If you have accepted the default filename, they will be respectively {{path|$HOME/.ssh/id_dsa}} and {{path|$HOME/.ssh/id_dsa.pub}} or {{path|$HOME/.ssh/id_rsa}} and {{path|$HOME/.ssh/id_rsa.pub}}, depending on the type of key you have specified.&lt;br /&gt;
&lt;br /&gt;
The private key '''must''' remain secret, do not publish it to anyone under any circumstance.&lt;br /&gt;
&lt;br /&gt;
The public key can be published and shall be sent when you are applying for a KDE SVN account.&lt;br /&gt;
&lt;br /&gt;
You should also set up &amp;lt;tt&amp;gt;ssh-agent&amp;lt;/tt&amp;gt; so you do not have to type the password every time you connect via SSH. There are several tutorials available explaining how to do this, for example [http://mah.everybody.org/docs/ssh this one]. [http://www.gentoo.org/proj/en/keychain Keychain] is a program that makes this task easier.&lt;br /&gt;
&lt;br /&gt;
'''Note''': if you already have an ssh key, you can just use the existing key instead of creating a new one.&lt;br /&gt;
&lt;br /&gt;
{{tip|&lt;br /&gt;
If you want to use SVN with SSH with another user than the one who created the keys, you need to copy &amp;lt;tt&amp;gt;$HOME/.ssh/id_dsa.pub&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;$HOME/.ssh/id_dsa&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;$HOME/.ssh/id_rsa.pub&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;$HOME/.ssh/id_rsa&amp;lt;/tt&amp;gt; to the other user's &amp;lt;tt&amp;gt;$HOME/.ssh&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
You should probably also backup those files.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Setting up the SVN+SSH protocol ===&lt;br /&gt;
&lt;br /&gt;
Once you created your key, you'll have to tell SSH that this one should be used for all connections to KDE sites. For SVN access, add the following lines to the &amp;lt;tt&amp;gt;~/.ssh/config&amp;lt;/tt&amp;gt; file. Replace USERNAME with yours.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Host *.kde.org&lt;br /&gt;
        User USERNAME&lt;br /&gt;
        IdentityFile ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The linked IdentityFile must belong to the public key you send in when applying for the SVN account. But it is ''not'' the public key (&amp;lt;tt&amp;gt;*.pub&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Note that git requires no such configuration.&lt;br /&gt;
&lt;br /&gt;
== Apply for an account ==&lt;br /&gt;
&lt;br /&gt;
Now you are ready to apply for for a KDE Contributor account. Go to [https://identity.kde.org/ https://identity.kde.org/svnaccount/] and create an account if you don't have one already. If you already have an account, you can use that. After you entered the site you will find a form which you can fill in to apply for an account.&lt;br /&gt;
&lt;br /&gt;
When you register on identity.kde.org, you will need to enter your name and an e-mail address, which has to be your own (a normal address or a KDE Mail address). Of course, do not forget that '''this email address becomes public''' (at least by [http://websvn.kde.org WebSVN]) so you will unfortunately get some spam as a result.&lt;br /&gt;
&lt;br /&gt;
Also note that this email address should be the same one that you use on [http://bugs.kde.org bugs.kde.org]. If you don't have an account in [http://bugs.kde.org bugs.kde.org], please create one so that it can be given usual developer rights. Closing bug reports with keywords in commit comments only works if the email address associated with your KDE Contributor account and [http://bugs.kde.org bugs.kde.org] accounts match.&lt;br /&gt;
&lt;br /&gt;
After that, you must choose a username for your KDE Contributor account between the suggestions presented to you. Please notice it is not possible to propose something else such as a nickname, as the username must be as close as possible to someone's real name.&lt;br /&gt;
&lt;br /&gt;
If you ask for a KDE email address one day, this will be the base for your address. For example: &amp;lt;tt&amp;gt;username@kde.org&amp;lt;/tt&amp;gt;. (Note, however, that KDE email addresses are not granted so easily anymore, as too many people have ranted with a KDE address and other people thought that it was the official position of the KDE Team. In the meantime, [http://www.kdemail.net KDE Mail] was created for if you need a permanent address.)&lt;br /&gt;
&lt;br /&gt;
When applying for developer access you have to provide your public SSH key. This key will be added to your profile. You can always add more keys or delete keys you don't use anymore from your profile page on identity.kde.org.&lt;br /&gt;
&lt;br /&gt;
The form also holds a field ''Why do you want an account?'', where you can explain what you want to do with your future KDE SVN account, like for example developing a certain application, making documentations or being the team leader of a translation.&lt;br /&gt;
&lt;br /&gt;
Also note that the form will ask you who has encouraged you to apply. He or she will also get an email to verify your request.&lt;br /&gt;
&lt;br /&gt;
== Updating An Existing Account ==&lt;br /&gt;
&lt;br /&gt;
If you already have a KDE Contributor account but want to update the ssh key, you should go to [https://identity.kde.org/ identity.kde.org] and change the keys in your profile.&lt;br /&gt;
&lt;br /&gt;
== And Now? ==&lt;br /&gt;
&lt;br /&gt;
After having sent the form and clicking the link in the email, you have to wait for the answer (typically within two or three days).&lt;br /&gt;
&lt;br /&gt;
Once you have confirmation that your account has been created, you need to adapt your local copy to the new server. See the [[Contribute/First Steps with your KDE SVN Account|next tutorial]] for your first steps with your new account.&lt;br /&gt;
&lt;br /&gt;
Please add your geographical location (what country are you in?) and other details at the [http://commit-digest.org/data/ Commit Digest data page] so that the Commit Digest can accurately reflect who is working where.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Talk:Contribute/Get_a_Contributor_Account</id>
		<title>Talk:Contribute/Get a Contributor Account</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Talk:Contribute/Get_a_Contributor_Account"/>
				<updated>2011-07-19T08:03:37Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: moved Talk:Contribute/Get a SVN Account to Talk:Contribute/Get a Contributor Account: SVN is no longer what we use, so make this more generic.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On OSX 10.5, &lt;br /&gt;
&lt;br /&gt;
perl -e 'print crypt(&amp;quot;pass&amp;quot;,&amp;quot;\$1\$xyz\$&amp;quot;).&amp;quot;\n&amp;quot;;'&lt;br /&gt;
-- $1dwWckNooiek&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
perl -e 'print crypt(&amp;quot;pass&amp;quot;,&amp;quot;\$1\$abc\$&amp;quot;).&amp;quot;\n&amp;quot;;'&lt;br /&gt;
-- $1dwWckNooiek&lt;br /&gt;
&lt;br /&gt;
They are the same...&lt;br /&gt;
&lt;br /&gt;
[[Special:Contributions/98.235.188.137|98.235.188.137]] 16:08, 22 November 2008 (UTC)&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Contribute/Get_a_SVN_Account</id>
		<title>Contribute/Get a SVN Account</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Contribute/Get_a_SVN_Account"/>
				<updated>2011-07-19T08:03:37Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: moved Contribute/Get a SVN Account to Contribute/Get a Contributor Account: SVN is no longer what we use, so make this more generic.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Contribute/Get a Contributor Account]]&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Talk:Contribute/Get_a_SVN_Account</id>
		<title>Talk:Contribute/Get a SVN Account</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Talk:Contribute/Get_a_SVN_Account"/>
				<updated>2011-07-19T08:03:37Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: moved Talk:Contribute/Get a SVN Account to Talk:Contribute/Get a Contributor Account: SVN is no longer what we use, so make this more generic.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Talk:Contribute/Get a Contributor Account]]&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Contribute/Get_a_Contributor_Account</id>
		<title>Contribute/Get a Contributor Account</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Contribute/Get_a_Contributor_Account"/>
				<updated>2011-07-19T08:02:08Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:I18n/Language Navigation Bar|Contribute/Get a SVN Account}}&lt;br /&gt;
This tutorial is about how to apply for a commit account for KDE so that you may change files (code, documentation files, art, etc.) in KDE's git and svn repositories.&lt;br /&gt;
&lt;br /&gt;
== The short answer: how to get read-write access ==&lt;br /&gt;
&lt;br /&gt;
KDE Contributor accounts are managed through [http://identity.kde.org/ KDE Identity]. You can request Developer Access in the website's menu upon registering and logging into your account.&lt;br /&gt;
&lt;br /&gt;
== KDE Respositories ==&lt;br /&gt;
&lt;br /&gt;
To have write access to KDE's git and SVN servers, you have to use KDE's main git and SVN server. Anonymous git and SVN uses mirrors of this server. Note that SVN does not allow you to read from one server and write to another, while git does. For a tutorial on using KDE's git services, see [[/Development/Git|this tutorial]].&lt;br /&gt;
&lt;br /&gt;
To be able to write to files stored in KDE's git and SVN repositories, you need an account. An account is made up of a username (normally your family name), a password, an ssh key and an email address. The username is for getting in, the password and ssh keys are for authenticating and the email address for knowing who to contact if another developer wants to contact the account holder.&lt;br /&gt;
&lt;br /&gt;
A KDE commit account allows you to write to nearly anywhere in the KDE repositories with a few exceptions, such as the www module. (Of course, exceptions can be made for this as well.)&lt;br /&gt;
&lt;br /&gt;
'''Note''': you can see the accounts in [http://websvn.kde.org/trunk/kde-common/accounts kde-common/accounts]. That is the list of all accounts. Yes, '''the account list is public''', for example on [http://websvn.kde.org WebSVN].&lt;br /&gt;
&lt;br /&gt;
== Who Can Apply For a KDE Contributor Account? ==&lt;br /&gt;
&lt;br /&gt;
Normally, any developer who has done some work on projects hosted by KDE can apply for a KDE Contributor account.&lt;br /&gt;
&lt;br /&gt;
Translators should get approval from their team leader so that they can organize how the work is being done in his/her team. Please mention the approval from the team leader when requesting the account.&lt;br /&gt;
&lt;br /&gt;
Please also [[Policies/SVN Commit Policy|read the KDE commit policy]]. You must accept these rules when using your future KDE Contributor account. Please also familiarize yourself with the [http://www.kde.org/code-of-conduct/ KDE Code of Conduct] which describes the social foundations within KDE.&lt;br /&gt;
&lt;br /&gt;
Also please apply for an account only if you think that you will work on KDE for a somewhat longer time. If you know that you will only work for a couple of weeks and then never again, please consider not applying for a KDE Contributor account but instead continue to send patches directly to developers.&lt;br /&gt;
&lt;br /&gt;
The limitations are not there to exclude anyone - they are there to ensure that the maintenance of accounts remains reasonable.&lt;br /&gt;
&lt;br /&gt;
Of course, to be clear: ''the KDE's sysadmins have the last word about whether or not to create a KDE SVN account for somebody''.&lt;br /&gt;
&lt;br /&gt;
== SSH ==&lt;br /&gt;
&lt;br /&gt;
You need an SSH public key in order to access your KDE Contributor account. If you already have one, you can skip the next subsection and go to [[#Setting up the SVN+SSH protocol|Setting up the SVN+SSH protocol]].&lt;br /&gt;
&lt;br /&gt;
=== Generating the SSH keys ===&lt;br /&gt;
&lt;br /&gt;
To be able to use your KDE Contributor account with SSH, you need a SSH public key. Please notice that it is '''not''' a GPG (OpenPGP) key, which is completely unrelated!&lt;br /&gt;
&lt;br /&gt;
The password in the sense of this documentation is the '''public key''' that you are creating.&lt;br /&gt;
&lt;br /&gt;
For more information on how to create a pair of SSH keys, please refer to a [http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygen SSH documentation] or book.&lt;br /&gt;
&lt;br /&gt;
The command to create a pair of keys is '''ssh-keygen''' and it requires the type of key you will create, either DSA or RSA - both are fine.&lt;br /&gt;
&lt;br /&gt;
To create a new pair of keys, use &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;ssh-keygen -t dsa&amp;lt;/syntaxhighlight&amp;gt; or &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;ssh-keygen -t rsa&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a type called RSA1 which was used in version 1 of the SSH protocol. See the [http://www.openbsd.org/cgi-bin/man.cgi?query=ssh-keygen ssh documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
You can then accept the default filename for your key (either {{path|$HOME/.ssh/id_dsa}} or {{path|$HOME/.ssh/id_rsa}}, depending on the type of key you have chosen). After that, a passphrase is asked. It is recommended that you do not leave it blank.&lt;br /&gt;
&lt;br /&gt;
Now that you are finished generating your key pair, you will have two files: a private key and a public key. If you have accepted the default filename, they will be respectively {{path|$HOME/.ssh/id_dsa}} and {{path|$HOME/.ssh/id_dsa.pub}} or {{path|$HOME/.ssh/id_rsa}} and {{path|$HOME/.ssh/id_rsa.pub}}, depending on the type of key you have specified.&lt;br /&gt;
&lt;br /&gt;
The private key '''must''' remain secret, do not publish it to anyone under any circumstance.&lt;br /&gt;
&lt;br /&gt;
The public key can be published and shall be sent when you are applying for a KDE SVN account.&lt;br /&gt;
&lt;br /&gt;
You should also set up &amp;lt;tt&amp;gt;ssh-agent&amp;lt;/tt&amp;gt; so you do not have to type the password every time you connect via SSH. There are several tutorials available explaining how to do this, for example [http://mah.everybody.org/docs/ssh this one]. [http://www.gentoo.org/proj/en/keychain Keychain] is a program that makes this task easier.&lt;br /&gt;
&lt;br /&gt;
'''Note''': if you already have an ssh key, you can just use the existing key instead of creating a new one.&lt;br /&gt;
&lt;br /&gt;
{{tip|&lt;br /&gt;
If you want to use SVN with SSH with another user than the one who created the keys, you need to copy &amp;lt;tt&amp;gt;$HOME/.ssh/id_dsa.pub&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;$HOME/.ssh/id_dsa&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;$HOME/.ssh/id_rsa.pub&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;$HOME/.ssh/id_rsa&amp;lt;/tt&amp;gt; to the other user's &amp;lt;tt&amp;gt;$HOME/.ssh&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
You should probably also backup those files.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Setting up the SVN+SSH protocol ===&lt;br /&gt;
&lt;br /&gt;
Once you created your key, you'll have to tell SSH that this one should be used for all connections to KDE sites. For SVN access, add the following lines to the &amp;lt;tt&amp;gt;~/.ssh/config&amp;lt;/tt&amp;gt; file. Replace USERNAME with yours.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Host *.kde.org&lt;br /&gt;
        User USERNAME&lt;br /&gt;
        IdentityFile ~/.ssh/id_dsa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The linked IdentityFile must belong to the public key you send in when applying for the SVN account. But it is ''not'' the public key (&amp;lt;tt&amp;gt;*.pub&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Note that git requires no such configuration.&lt;br /&gt;
&lt;br /&gt;
== Apply for an account ==&lt;br /&gt;
&lt;br /&gt;
Now you are ready to apply for for a KDE Contributor account. Go to [https://identity.kde.org/ https://identity.kde.org/svnaccount/] and create an account if you don't have one already. If you already have an account, you can use that. After you entered the site you will find a form which you can fill in to apply for an account.&lt;br /&gt;
&lt;br /&gt;
When you register on identity.kde.org, you will need to enter your name and an e-mail address, which has to be your own (a normal address or a KDE Mail address). Of course, do not forget that '''this email address becomes public''' (at least by [http://websvn.kde.org WebSVN]) so you will unfortunately get some spam as a result.&lt;br /&gt;
&lt;br /&gt;
Also note that this email address should be the same one that you use on [http://bugs.kde.org bugs.kde.org]. If you don't have an account in [http://bugs.kde.org bugs.kde.org], please create one so that it can be given usual developer rights. Closing bug reports with keywords in commit comments only works if the email address associated with your KDE Contributor account and [http://bugs.kde.org bugs.kde.org] accounts match.&lt;br /&gt;
&lt;br /&gt;
After that, you must choose a username for your KDE Contributor account between the suggestions presented to you. Please notice it is not possible to propose something else such as a nickname, as the username must be as close as possible to someone's real name.&lt;br /&gt;
&lt;br /&gt;
If you ask for a KDE email address one day, this will be the base for your address. For example: &amp;lt;tt&amp;gt;username@kde.org&amp;lt;/tt&amp;gt;. (Note, however, that KDE email addresses are not granted so easily anymore, as too many people have ranted with a KDE address and other people thought that it was the official position of the KDE Team. In the meantime, [http://www.kdemail.net KDE Mail] was created for if you need a permanent address.)&lt;br /&gt;
&lt;br /&gt;
When applying for developer access you have to provide your public SSH key. This key will be added to your profile. You can always add more keys or delete keys you don't use anymore from your profile page on identity.kde.org.&lt;br /&gt;
&lt;br /&gt;
The form also holds a field ''Why do you want an account?'', where you can explain what you want to do with your future KDE SVN account, like for example developing a certain application, making documentations or being the team leader of a translation.&lt;br /&gt;
&lt;br /&gt;
Also note that the form will ask you who has encouraged you to apply. He or she will also get an email to verify your request.&lt;br /&gt;
&lt;br /&gt;
== Updating An Existing Account ==&lt;br /&gt;
&lt;br /&gt;
If you already have a KDE Contributor account but want to update the ssh key, you should go to [https://identity.kde.org/ identity.kde.org] and change the keys in your profile.&lt;br /&gt;
&lt;br /&gt;
== And Now? ==&lt;br /&gt;
&lt;br /&gt;
After having sent the form and clicking the link in the email, you have to wait for the answer (typically within two or three days).&lt;br /&gt;
&lt;br /&gt;
Once you have confirmation that your account has been created, you need to adapt your local copy to the new server. See the [[Contribute/First Steps with your KDE SVN Account|next tutorial]] for your first steps with your new account.&lt;br /&gt;
&lt;br /&gt;
Please add your geographical location (what country are you in?) and other details at the [http://commit-digest.org/data/ Commit Digest data page] so that the Commit Digest can accurately reflect who is working where.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/ApplicationShell</id>
		<title>Development/Tutorials/Plasma/ApplicationShell</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/ApplicationShell"/>
				<updated>2011-07-13T10:37:22Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* The Shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page looks at the steps it takes to embed a Plasma shell inside of your application as a dashboard or summary page.&lt;br /&gt;
&lt;br /&gt;
== The Shell ==&lt;br /&gt;
The core of the dashboard's logic is in a KPart in kdebase-runtime called '''plasma-kpart'''. This KPart is loaded like any other ReadOnly KPart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// this routine will find and load our Part.  it finds the Part by&lt;br /&gt;
// name which is a bad idea usually.. but it's alright in this&lt;br /&gt;
// case since our Part is made for this Shell&lt;br /&gt;
KService::Ptr service = KService::serviceByDesktopPath( &amp;quot;plasma-kpart.desktop&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
if (service) {&lt;br /&gt;
    // now that the Part is loaded, we cast it to a Part to get&lt;br /&gt;
    // our hands on it&lt;br /&gt;
    m_part = service-&amp;gt;createInstance&amp;lt;KParts::ReadOnlyPart&amp;gt;(0, args);&lt;br /&gt;
    if (m_part) {   &lt;br /&gt;
        // tell the KParts::MainWindow that this is indeed the main widget&lt;br /&gt;
        // If you have something better to do with the widget, this is where&lt;br /&gt;
        // you would do it.&lt;br /&gt;
        setCentralWidget(m_part-&amp;gt;widget());&lt;br /&gt;
&lt;br /&gt;
        // and integrate the part's GUI with the shell's&lt;br /&gt;
        createGUI(m_part);&lt;br /&gt;
&lt;br /&gt;
    }  else {   &lt;br /&gt;
        // For whatever reason the part didn't load&lt;br /&gt;
        KMessageBox::error(this, i18n(&amp;quot;Could not instantiate our Part!&amp;quot;));&lt;br /&gt;
        qApp-&amp;gt;quit();&lt;br /&gt;
    }   &lt;br /&gt;
} else {   &lt;br /&gt;
    // if we couldn't find our Part, we exit since the Shell by&lt;br /&gt;
    // itself can't do anything useful&lt;br /&gt;
    KMessageBox::error(this, i18n(&amp;quot;Could not find our Part!&amp;quot;));&lt;br /&gt;
    qApp-&amp;gt;quit();&lt;br /&gt;
    // we return here, cause qApp-&amp;gt;quit() only means &amp;quot;exit the&lt;br /&gt;
    // next time we enter the event loop...&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Applets ==&lt;br /&gt;
There are two ways to approach writing applets, and some thought should go into this before writing your applets. &lt;br /&gt;
&lt;br /&gt;
=== Plasma::Applet-based applets ===&lt;br /&gt;
The first is to use the standard method of writing Plasma applets, and provide a DataEngine which your applets can use to communicate with your application, either via DBus (allowing you to use the applets on the desktop and in other shells) or intra-process signal/slots using a DataEngine provided by the [[#Communicating With Your Application|PluginLoader infrastructure]].&lt;br /&gt;
* Pros:&lt;br /&gt;
** Applets can be scripted in Javascript or Python&lt;br /&gt;
** Applets get all of the For Free benefits of being subclasses of Plasma::Applet&lt;br /&gt;
* Cons:&lt;br /&gt;
** Requires writing applets from scratch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== QWidget-based Applets ===&lt;br /&gt;
The second method is to wrap QWidgets inside of a Plasma::Applet using a QGraphicsProxyWidget. This is most useful if your application has an existing  dashboard which is not based on Plasma. These widgets would be created within your application, and loaded using the [[#Communicating With Your Application|PluginLoader infrastructure]].&lt;br /&gt;
* Pros:&lt;br /&gt;
** No need to learn a new API to build widgets&lt;br /&gt;
** Closer integration with applications&lt;br /&gt;
** Can re-use pre-existing applets&lt;br /&gt;
* Cons:&lt;br /&gt;
** No Plasma theming&lt;br /&gt;
** No access to DataEngines and other Plasma services&lt;br /&gt;
&lt;br /&gt;
== Communicating With Your Application ==&lt;br /&gt;
New in KDE Development Platform 4.6 is a class called Plasma::PluginLoader, a class which contains, unsurprisingly, most of Plasma's plugin loading logic. Plasma::Applet, Plasma::DataEngine, Plasma::Service, and Plasma::AbstractRunner all ask Plasma::PluginLoader to provide these plugins for them, and Plasma::PluginLoader can be subclassed for use by your application.&lt;br /&gt;
Plasma::PluginLoader itself is a class with a mix of normal methods, static methods and protected virtual methods:&lt;br /&gt;
* Plasma::* load* -- The main loading methods which are called by their respective classes in libplasma.&lt;br /&gt;
* static void setPluginLoader() and static Plasma::PluginLoader* pluginLoader() -- These are the setters and getters of the application-specific subclass of Plasma::PluginLoader.&lt;br /&gt;
* protected virtual internal* -- These are the methods which application-specific subclasses of Plasma::PluginLoader will implement. Their non-virtual counterparts call the application-specific implementations of these methods that are in the Plasma::PluginLoader specified by the application in setPluginLoader.&lt;br /&gt;
&lt;br /&gt;
The long and short of this is that application developers can inject their own Applets, DataEngines, Services and other Plasma objects into a Plasma shell and allow them to do things which plugins loaded through KDE's Plugin system could not do. Users of Plasma::PluginLoader also get many things for free, such as the easy loading and saving of applets, which would have to be done manually if an application chose to only use Plasma::Containment::addApplet().&lt;br /&gt;
&lt;br /&gt;
All that a developer needs to do is to subclass Plasma::PluginLoader and implement the internalAdd* methods which they want to provide plugins for. &lt;br /&gt;
&lt;br /&gt;
See [http://quickgit.kde.org/?p=kdeexamples.git&amp;amp;a=tree&amp;amp;h=c974192b5d47aa475e8fd0677c6ee8fdafe49158&amp;amp;hb=4459b79a52c3228a8a92ad2f169d406c244966da&amp;amp;f=plasma/c%20%20/kpart kdeexamples/plasma/c++/kpart] for an example of these communication methods.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/ApplicationShell</id>
		<title>Development/Tutorials/Plasma/ApplicationShell</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/ApplicationShell"/>
				<updated>2011-07-13T10:36:48Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* The Shell */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page looks at the steps it takes to embed a Plasma shell inside of your application as a dashboard or summary page.&lt;br /&gt;
&lt;br /&gt;
== The Shell ==&lt;br /&gt;
The core of the dashboard's logic is in a KPart in kdebase-runtime called '''plasma-kpart'''. This KPart is loaded like any other ReadOnly KPart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// this routine will find and load our Part.  it finds the Part by&lt;br /&gt;
// name which is a bad idea usually.. but it's alright in this&lt;br /&gt;
// case since our Part is made for this Shell&lt;br /&gt;
KService::Ptr service = KService::serviceByDesktopPath( &amp;quot;plasma-kpart.desktop&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
if (service)&lt;br /&gt;
{  &lt;br /&gt;
    // now that the Part is loaded, we cast it to a Part to get&lt;br /&gt;
    // our hands on it&lt;br /&gt;
    m_part = service-&amp;gt;createInstance&amp;lt;KParts::ReadOnlyPart&amp;gt;(0, args);&lt;br /&gt;
    if (m_part)&lt;br /&gt;
    {   &lt;br /&gt;
        // tell the KParts::MainWindow that this is indeed the main widget&lt;br /&gt;
        // If you have something better to do with the widget, this is where&lt;br /&gt;
        // you would do it.&lt;br /&gt;
        setCentralWidget(m_part-&amp;gt;widget());&lt;br /&gt;
&lt;br /&gt;
        // and integrate the part's GUI with the shell's&lt;br /&gt;
        createGUI(m_part);&lt;br /&gt;
&lt;br /&gt;
    }   &lt;br /&gt;
    else&lt;br /&gt;
    {   &lt;br /&gt;
        // For whatever reason the part didn't load&lt;br /&gt;
        KMessageBox::error(this, i18n(&amp;quot;Could not instantiate our Part!&amp;quot;));&lt;br /&gt;
        qApp-&amp;gt;quit();&lt;br /&gt;
    }   &lt;br /&gt;
}   &lt;br /&gt;
else&lt;br /&gt;
{   &lt;br /&gt;
    // if we couldn't find our Part, we exit since the Shell by&lt;br /&gt;
    // itself can't do anything useful&lt;br /&gt;
    KMessageBox::error(this, i18n(&amp;quot;Could not find our Part!&amp;quot;));&lt;br /&gt;
    qApp-&amp;gt;quit();&lt;br /&gt;
    // we return here, cause qApp-&amp;gt;quit() only means &amp;quot;exit the&lt;br /&gt;
    // next time we enter the event loop...&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Applets ==&lt;br /&gt;
There are two ways to approach writing applets, and some thought should go into this before writing your applets. &lt;br /&gt;
&lt;br /&gt;
=== Plasma::Applet-based applets ===&lt;br /&gt;
The first is to use the standard method of writing Plasma applets, and provide a DataEngine which your applets can use to communicate with your application, either via DBus (allowing you to use the applets on the desktop and in other shells) or intra-process signal/slots using a DataEngine provided by the [[#Communicating With Your Application|PluginLoader infrastructure]].&lt;br /&gt;
* Pros:&lt;br /&gt;
** Applets can be scripted in Javascript or Python&lt;br /&gt;
** Applets get all of the For Free benefits of being subclasses of Plasma::Applet&lt;br /&gt;
* Cons:&lt;br /&gt;
** Requires writing applets from scratch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== QWidget-based Applets ===&lt;br /&gt;
The second method is to wrap QWidgets inside of a Plasma::Applet using a QGraphicsProxyWidget. This is most useful if your application has an existing  dashboard which is not based on Plasma. These widgets would be created within your application, and loaded using the [[#Communicating With Your Application|PluginLoader infrastructure]].&lt;br /&gt;
* Pros:&lt;br /&gt;
** No need to learn a new API to build widgets&lt;br /&gt;
** Closer integration with applications&lt;br /&gt;
** Can re-use pre-existing applets&lt;br /&gt;
* Cons:&lt;br /&gt;
** No Plasma theming&lt;br /&gt;
** No access to DataEngines and other Plasma services&lt;br /&gt;
&lt;br /&gt;
== Communicating With Your Application ==&lt;br /&gt;
New in KDE Development Platform 4.6 is a class called Plasma::PluginLoader, a class which contains, unsurprisingly, most of Plasma's plugin loading logic. Plasma::Applet, Plasma::DataEngine, Plasma::Service, and Plasma::AbstractRunner all ask Plasma::PluginLoader to provide these plugins for them, and Plasma::PluginLoader can be subclassed for use by your application.&lt;br /&gt;
Plasma::PluginLoader itself is a class with a mix of normal methods, static methods and protected virtual methods:&lt;br /&gt;
* Plasma::* load* -- The main loading methods which are called by their respective classes in libplasma.&lt;br /&gt;
* static void setPluginLoader() and static Plasma::PluginLoader* pluginLoader() -- These are the setters and getters of the application-specific subclass of Plasma::PluginLoader.&lt;br /&gt;
* protected virtual internal* -- These are the methods which application-specific subclasses of Plasma::PluginLoader will implement. Their non-virtual counterparts call the application-specific implementations of these methods that are in the Plasma::PluginLoader specified by the application in setPluginLoader.&lt;br /&gt;
&lt;br /&gt;
The long and short of this is that application developers can inject their own Applets, DataEngines, Services and other Plasma objects into a Plasma shell and allow them to do things which plugins loaded through KDE's Plugin system could not do. Users of Plasma::PluginLoader also get many things for free, such as the easy loading and saving of applets, which would have to be done manually if an application chose to only use Plasma::Containment::addApplet().&lt;br /&gt;
&lt;br /&gt;
All that a developer needs to do is to subclass Plasma::PluginLoader and implement the internalAdd* methods which they want to provide plugins for. &lt;br /&gt;
&lt;br /&gt;
See [http://quickgit.kde.org/?p=kdeexamples.git&amp;amp;a=tree&amp;amp;h=c974192b5d47aa475e8fd0677c6ee8fdafe49158&amp;amp;hb=4459b79a52c3228a8a92ad2f169d406c244966da&amp;amp;f=plasma/c%20%20/kpart kdeexamples/plasma/c++/kpart] for an example of these communication methods.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API</id>
		<title>Development/Tutorials/Plasma/JavaScript/API</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API"/>
				<updated>2011-06-24T12:37:53Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction to the Plasmoid JavaScript API  =&lt;br /&gt;
&lt;br /&gt;
This document provides an overview/reference of the Simplified JavaScript API for Plasmoids. The &amp;quot;Simplified&amp;quot; refers to the fact that it isn't a full binding to all of Qt or KDE's libraries, but a highly focused set of bindings designed to make writing Plasmoids fast and easy, while remaining powerful.&lt;br /&gt;
&lt;br /&gt;
The API in this documentation covers the JavaScript API as it appears in the KDE Software Compilation as of version 4.4 and higher. Changes between versions are noted in the documentation, including when new API functionality was introduced. This API ships as part of the KDE Base Runtime package, so can be relied on being there by any application that is Powered By KDE.&lt;br /&gt;
&lt;br /&gt;
= Examples and Tutorials =&lt;br /&gt;
&lt;br /&gt;
Tutorials can be found [[Development/Tutorials/Plasma|in the Plasma tutorials area here on Techbase]] and full, functioning examples can be found in the [https://projects.kde.org/projects/kde/kdeexamples KDE Examples] repository in the {{path|plasma/javascript}} folder.&lt;br /&gt;
&lt;br /&gt;
= Using QML =&lt;br /&gt;
&lt;br /&gt;
Starting with the KDE Platform 4.7 release, the Plasma team recommends writing your Plasmoids with [http://qt.nokia.com/qtquick/ QtQuick] technologies with the [http://techbase.kde.org/Development/Tutorials/Plasma#QML_Plasmoids Plasma QML integration API].&lt;br /&gt;
&lt;br /&gt;
The QML API uses the same API as the Simplified JavaScript API with the exception of User Interface Elements, Animations and Events which are provided instead by QML itself.&lt;br /&gt;
&lt;br /&gt;
The benefits of writing your Plasmoid with QML can include faster development with more sophisticated results visually and in its usability as well as much better performance when run in a QML-only Plasma shell such as Plasma Active.&lt;br /&gt;
&lt;br /&gt;
= What Is A Simplified JavaScript Plasmoid?  =&lt;br /&gt;
&lt;br /&gt;
This document describes the native Plasma API available to Simplified JavaScript Plasmoids. What makes them &amp;quot;Simplified&amp;quot; is that they do not have access to the entire C++ API in the Plasma, KDE and Qt libraries (let alone things lower in the API stack). This helps ensure that these Plasmoids are more likely to work properly between releases as changes in underlying API don't affect them as well as allowing Plasma to offer stronger security guarantees around them. &lt;br /&gt;
&lt;br /&gt;
To denote that this Plasmoid is a Simplified JavaScript widget, ensure that in the metadata.desktop file there is this line: &lt;br /&gt;
&lt;br /&gt;
X-Plasma-API=javascript &lt;br /&gt;
&lt;br /&gt;
What follows is a description of the runtime environment available to a Simplified JavaScript Plasmoid. &lt;br /&gt;
&lt;br /&gt;
= QtScript  =&lt;br /&gt;
&lt;br /&gt;
The Simplified JavaScript API is powered by Qt's QtScript system which provides access to a full featured ECMA Script interpreter. If it works in ECMA Script, it will work in a Simplified JavaScript Plasmoid. As an interesting implementation note, QtScript uses the high performance ECMA Script interpreter from WebKit and shares this code with QtWebKit. &lt;br /&gt;
&lt;br /&gt;
On top of the ECMA Script language, QtScript provides Qt integration features. Probably the most useful one in this context is the use of signals and slots which is Qt's callback mechanism. Signals may be emitted in QtScript by calling the signal method in question, a signal can be connected to a slot by using the connect() method (and disconnected with disconnect()) and any function defined in the Plasmoid may be used as a slot. For example: &amp;lt;code javascript=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function onClick()&lt;br /&gt;
{&lt;br /&gt;
    print(&amp;quot;We got clicked!&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function onFirstClick()&lt;br /&gt;
{&lt;br /&gt;
    print(&amp;quot;First click!&amp;quot;)&lt;br /&gt;
    button.clicked.disconnect(onFirstClick)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
button = new PushButton&lt;br /&gt;
button.clicked.connect(onClick)&lt;br /&gt;
button.clicked.connect(onFirstClick)&lt;br /&gt;
button.clicked()&lt;br /&gt;
&amp;lt;/code&amp;gt; This will print out: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
We got clicked!&lt;br /&gt;
First click!&lt;br /&gt;
&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
on the console when the Plasmoid starts, and the &amp;quot;We got clicked!&amp;quot; again whenever the button is clicked by the user.&lt;br /&gt;
&lt;br /&gt;
The object that emitted the signal that caused a slot to be called can be retrieved using the ''QObject'' '''sender''' read-only property of the global '''plasmoid''' object.&lt;br /&gt;
&lt;br /&gt;
= API =&lt;br /&gt;
&lt;br /&gt;
* [[../API-PlasmoidObject|The Global plasmoid Object]]&lt;br /&gt;
* [[../API-Enumerations|Global Enumerations]]&lt;br /&gt;
* [[../API-Events|Events]]&lt;br /&gt;
* [[../API-UIElements|User Interface Elements]]&lt;br /&gt;
* [[../API-Animations|Animations]]&lt;br /&gt;
* [[../API-Painting|Painting]]&lt;br /&gt;
* [[../API-DataEnginesServices|Accessing Sources of Data with DataEngines and Services]]&lt;br /&gt;
* [[../API-Print|Printing To Console and Debug Output]]&lt;br /&gt;
* [[../API-IOJobs|Asynchronous Input/Output (IO) Jobs]]&lt;br /&gt;
* [[../API-Timers|Timers]]&lt;br /&gt;
* [[../API-Misc|Utility API and Objects]]&lt;br /&gt;
* [[../API-Extensions|Extensions]]&lt;br /&gt;
** [[../API-FileDialog|File Dialog]]&lt;br /&gt;
** [[../API-LocalIO|Local IO]]&lt;br /&gt;
** [[../API-NetworkIO|Network IO]]&lt;br /&gt;
** [[../API-HTTP|HTTP]]&lt;br /&gt;
** [[../API-LaunchApp|Launching Applications]]&lt;br /&gt;
* [[../API-Addons|Custom Addons (Plugins) in Javascript]]&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API</id>
		<title>Development/Tutorials/Plasma/JavaScript/API</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API"/>
				<updated>2011-06-24T12:25:20Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction to the Plasmoid JavaScript API  =&lt;br /&gt;
&lt;br /&gt;
This document provides an overview/reference of the Simplified JavaScript API for Plasmoids. The &amp;quot;Simplified&amp;quot; refers to the fact that it isn't a full binding to all of Qt or KDE's libraries, but a highly focused set of bindings designed to make writing Plasmoids fast and easy, while remaining powerful.&lt;br /&gt;
&lt;br /&gt;
The API in this documentation covers the JavaScript API as it appears in the KDE Software Compilation as of version 4.4, unless otherwise noted. This API ships as part of the KDE Base Runtime package, so can be relied on being there by any application that is Powered By KDE.&lt;br /&gt;
&lt;br /&gt;
= What Is A Simplified JavaScript Plasmoid?  =&lt;br /&gt;
&lt;br /&gt;
This document describes the native Plasma API available to Simplified JavaScript Plasmoids. What makes them &amp;quot;Simplified&amp;quot; is that they do not have access to the entire C++ API in the Plasma, KDE and Qt libraries (let alone things lower in the API stack). This helps ensure that these Plasmoids are more likely to work properly between releases as changes in underlying API don't affect them as well as allowing Plasma to offer stronger security guarantees around them. &lt;br /&gt;
&lt;br /&gt;
To denote that this Plasmoid is a Simplified JavaScript widget, ensure that in the metadata.desktop file there is this line: &lt;br /&gt;
&lt;br /&gt;
X-Plasma-API=javascript &lt;br /&gt;
&lt;br /&gt;
What follows is a description of the runtime environment available to a Simplified JavaScript Plasmoid. &lt;br /&gt;
&lt;br /&gt;
= QtScript  =&lt;br /&gt;
&lt;br /&gt;
The Simplified JavaScript API is powered by Qt's QtScript system which provides access to a full featured ECMA Script interpreter. If it works in ECMA Script, it will work in a Simplified JavaScript Plasmoid. As an interesting implementation note, QtScript uses the high performance ECMA Script interpreter from WebKit and shares this code with QtWebKit. &lt;br /&gt;
&lt;br /&gt;
On top of the ECMA Script language, QtScript provides Qt integration features. Probably the most useful one in this context is the use of signals and slots which is Qt's callback mechanism. Signals may be emitted in QtScript by calling the signal method in question, a signal can be connected to a slot by using the connect() method (and disconnected with disconnect()) and any function defined in the Plasmoid may be used as a slot. For example: &amp;lt;code javascript=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function onClick()&lt;br /&gt;
{&lt;br /&gt;
    print(&amp;quot;We got clicked!&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function onFirstClick()&lt;br /&gt;
{&lt;br /&gt;
    print(&amp;quot;First click!&amp;quot;)&lt;br /&gt;
    button.clicked.disconnect(onFirstClick)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
button = new PushButton&lt;br /&gt;
button.clicked.connect(onClick)&lt;br /&gt;
button.clicked.connect(onFirstClick)&lt;br /&gt;
button.clicked()&lt;br /&gt;
&amp;lt;/code&amp;gt; This will print out: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
We got clicked!&lt;br /&gt;
First click!&lt;br /&gt;
&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
on the console when the Plasmoid starts, and the &amp;quot;We got clicked!&amp;quot; again whenever the button is clicked by the user.&lt;br /&gt;
&lt;br /&gt;
The object that emitted the signal that caused a slot to be called can be retrieved using the ''QObject'' '''sender''' read-only property of the global '''plasmoid''' object.&lt;br /&gt;
&lt;br /&gt;
= API =&lt;br /&gt;
&lt;br /&gt;
* [[../API-PlasmoidObject|The Global plasmoid Object]]&lt;br /&gt;
* [[../API-Enumerations|Global Enumerations]]&lt;br /&gt;
* [[../API-Events|Events]]&lt;br /&gt;
* [[../API-UIElements|User Interface Elements]]&lt;br /&gt;
* [[../API-Animations|Animations]]&lt;br /&gt;
* [[../API-Painting|Painting]]&lt;br /&gt;
* [[../API-DataEnginesServices|Accessing Sources of Data with DataEngines and Services]]&lt;br /&gt;
* [[../API-Print|Printing To Console and Debug Output]]&lt;br /&gt;
* [[../API-IOJobs|Asynchronous Input/Output (IO) Jobs]]&lt;br /&gt;
* [[../API-Timers|Timers]]&lt;br /&gt;
* [[../API-Misc|Utility API and Objects]]&lt;br /&gt;
* [[../API-Extensions|Extensions]]&lt;br /&gt;
** [[../API-FileDialog|File Dialog]]&lt;br /&gt;
** [[../API-LocalIO|Local IO]]&lt;br /&gt;
** [[../API-NetworkIO|Network IO]]&lt;br /&gt;
** [[../API-HTTP|HTTP]]&lt;br /&gt;
** [[../API-LaunchApp|Launching Applications]]&lt;br /&gt;
* [[../API-Addons|Custom Addons (Plugins) in Javascript]]&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-LaunchApp</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-LaunchApp</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-LaunchApp"/>
				<updated>2011-06-24T12:24:10Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with '= LaunchApp =  This Extension adds methods to the global plasmoid object that allow launching applications, running commands and opening files and urls.  * ...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= LaunchApp =&lt;br /&gt;
&lt;br /&gt;
This [[../API-Extensions|Extension]] adds methods to the global plasmoid object that allow launching applications, running commands and opening files and urls.&lt;br /&gt;
&lt;br /&gt;
* ''bool'' '''runApplication(string application[, array files])''' &amp;lt;br&amp;gt;Runs an application by name (can reference an installed .desktop file as well as an executable in the user's $PATH) with an optional array of files. The file array may contain either Urls or strings. Returns true on success, false on failure.&lt;br /&gt;
* ''bool'' '''runCommand(string exe[, array args])''' &amp;lt;br&amp;gt;Runs the executable with the given arguments. Returns true on success, false on failure.&lt;br /&gt;
* ''bool'' '''openUrl([string|Url] url)''': &amp;lt;br&amp;gt;Opens the url in the default application (or asks the user if there is no default application for the file). The url parameter may be either a string or a Url. Returns true on success, false on failure.&lt;br /&gt;
* ''boolean'' '''applicationExists(String name)''': (scripting version &amp;gt;= 4) searches $PATH first, then tries in the application menu system by application storage name (aka the .desktop file name), then Name= entries for apps with installed .desktop files, then GenericName= entries for same&lt;br /&gt;
* ''mixed'' '''defaultApplication(String kind [, boolean storageId = false])''': (scripting version &amp;gt;= 4) returns the executable (or if storageId is true, then the app menu system id, e.g. its .desktop file name) of the default app. The &amp;quot;kind&amp;quot; parameter may be a well-known application type including &amp;quot;browser&amp;quot;, &amp;quot;mailer&amp;quot;, &amp;quot;filemanager&amp;quot;, &amp;quot;terminal&amp;quot;, &amp;quot;imClient&amp;quot; and &amp;quot;windowmanager&amp;quot; (or any other entry in share/apps/kcm_componentchooser/kcm_*.desktop); it may also be a mimetype (e.g. &amp;quot;application/pdf&amp;quot;). On failure, it returns false.&lt;br /&gt;
* ''String'' '''applicationPath(String name)''':  (scripting version &amp;gt;= 4) returns the full local path to a given application or .desktop file if it exists.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-HTTP</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-HTTP</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-HTTP"/>
				<updated>2011-06-24T12:24:02Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with '= HTTP =  This Extension provides access to data and files via http and https using asynchronous IOJob objects.  Functions: * ''IOJob'' ''...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= HTTP =&lt;br /&gt;
&lt;br /&gt;
This [[../API-Extensions|Extension]] provides access to data and files via http and https using asynchronous [[../API-IOJobs|IOJob]] objects.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''IOJob'' '''getUrl(Url url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''IOJob'' '''getUrl(String url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''bool'' '''openUrl([string|Url] url)''': (API v4) Opens the url in the default application (or asks the user if there is no default application for the file). The url parameter may be either a string or a Url. Returns true on success, false on failure.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-NetworkIO</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-NetworkIO</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-NetworkIO"/>
				<updated>2011-06-24T12:23:39Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with ' = NetworkIO =  This Extension provides access to data over the network using asynchronous IOJob objects.  Functions: * ''IOJob'' '''getUr...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= NetworkIO = &lt;br /&gt;
This [[../API-Extensions|Extension]] provides access to data over the network using asynchronous [[../API-IOJobs|IOJob]] objects.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''IOJob'' '''getUrl(Url url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''IOJob'' '''getUrl(String url)''': attempts to fetch the file using an IOJob&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-LocalIO</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-LocalIO</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-LocalIO"/>
				<updated>2011-06-24T12:23:17Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* LocalIO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= LocalIO = &lt;br /&gt;
This [[../API-Extensions|Extension]] provides access to local files using asynchronous [[../API-IOJobs|IOJob]] objects. &lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''IOJob'' '''getUrl(Url url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''IOJob'' '''getUrl(String url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''String'' '''userDataPath([String type, String path])''':  (scripting version &amp;gt;= 4) returns the default path for user data. Called with no parameters, it returns the user's home directory. If only one string is passed in, the standard directory for that type of data in the user's home directory will be located; the following values are recognized:&lt;br /&gt;
** documents&lt;br /&gt;
** music&lt;br /&gt;
** video&lt;br /&gt;
** downloads&lt;br /&gt;
** pictures&lt;br /&gt;
** autostart&lt;br /&gt;
** desktop (should be considered deprecated for Plasma workspaces)&lt;br /&gt;
&lt;br /&gt;
If a second string is passed in, it is considered a request for a specific path and the following types are recognized:&lt;br /&gt;
** apps - Applications menu (.desktop files).&lt;br /&gt;
** autostart - Autostart directories (both XDG and kde-specific)&lt;br /&gt;
** cache - Cached information (e.g. favicons, web-pages)&lt;br /&gt;
** cgi - CGIs to run from kdehelp.&lt;br /&gt;
** config - Configuration files.&lt;br /&gt;
** data - Where applications store data.&lt;br /&gt;
** emoticons - Emoticons themes&lt;br /&gt;
** exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account.&lt;br /&gt;
** html - HTML documentation.&lt;br /&gt;
** icon - Icons, see KIconLoader.&lt;br /&gt;
** kcfg - KConfigXT config files.&lt;br /&gt;
** lib - Libraries.&lt;br /&gt;
** locale - Translation files for KLocale.&lt;br /&gt;
** mime - Mime types defined by KDE-specific .desktop files.&lt;br /&gt;
** module - Module (dynamically loaded library).&lt;br /&gt;
** qtplugins - Qt plugins (dynamically loaded objects for Qt)&lt;br /&gt;
** services - Services.&lt;br /&gt;
** servicetypes - Service types.&lt;br /&gt;
** sound - Application sounds.&lt;br /&gt;
** templates - Templates for the &amp;quot;Create new file&amp;quot; functionality.&lt;br /&gt;
** wallpaper - Wallpapers.&lt;br /&gt;
** tmp - Temporary files (specific for both current host and current user)&lt;br /&gt;
** socket - UNIX Sockets (specific for both current host and current user)&lt;br /&gt;
** xdgconf-menu - Freedesktop.org standard location for menu layout (.menu) files.&lt;br /&gt;
** xdgdata-apps - Freedesktop.org standard location for application desktop files.&lt;br /&gt;
** xdgdata-dirs - Freedesktop.org standard location for menu descriptions (.directory files).&lt;br /&gt;
** xdgdata-mime - Freedesktop.org standard location for MIME type definitions.&lt;br /&gt;
** xdgdata-icon - Freedesktop.org standard location for icons.&lt;br /&gt;
** xdgdata-pixmap - Gnome-compatibility location for pixmaps.&lt;br /&gt;
&lt;br /&gt;
The second parameter should be a specific resource to find the path to. An example might be userDataPath(&amp;quot;data&amp;quot;, &amp;quot;plasma-desktop&amp;quot;).&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-LocalIO</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-LocalIO</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-LocalIO"/>
				<updated>2011-06-24T12:21:59Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with ' = LocalIO =  This Extension provides access to local files.   Functions: * ''IOJob'' '''getUrl(Url url)''': attempts to fetch the file using an IOJob * ''I...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= LocalIO = &lt;br /&gt;
This [[../API-Extensions|Extension]] provides access to local files. &lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''IOJob'' '''getUrl(Url url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''IOJob'' '''getUrl(String url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''String'' '''userDataPath([String type, String path])''':  (scripting version &amp;gt;= 4) returns the default path for user data. Called with no parameters, it returns the user's home directory. If only one string is passed in, the standard directory for that type of data in the user's home directory will be located; the following values are recognized:&lt;br /&gt;
** documents&lt;br /&gt;
** music&lt;br /&gt;
** video&lt;br /&gt;
** downloads&lt;br /&gt;
** pictures&lt;br /&gt;
** autostart&lt;br /&gt;
** desktop (should be considered deprecated for Plasma workspaces)&lt;br /&gt;
&lt;br /&gt;
If a second string is passed in, it is considered a request for a specific path and the following types are recognized:&lt;br /&gt;
** apps - Applications menu (.desktop files).&lt;br /&gt;
** autostart - Autostart directories (both XDG and kde-specific)&lt;br /&gt;
** cache - Cached information (e.g. favicons, web-pages)&lt;br /&gt;
** cgi - CGIs to run from kdehelp.&lt;br /&gt;
** config - Configuration files.&lt;br /&gt;
** data - Where applications store data.&lt;br /&gt;
** emoticons - Emoticons themes&lt;br /&gt;
** exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account.&lt;br /&gt;
** html - HTML documentation.&lt;br /&gt;
** icon - Icons, see KIconLoader.&lt;br /&gt;
** kcfg - KConfigXT config files.&lt;br /&gt;
** lib - Libraries.&lt;br /&gt;
** locale - Translation files for KLocale.&lt;br /&gt;
** mime - Mime types defined by KDE-specific .desktop files.&lt;br /&gt;
** module - Module (dynamically loaded library).&lt;br /&gt;
** qtplugins - Qt plugins (dynamically loaded objects for Qt)&lt;br /&gt;
** services - Services.&lt;br /&gt;
** servicetypes - Service types.&lt;br /&gt;
** sound - Application sounds.&lt;br /&gt;
** templates - Templates for the &amp;quot;Create new file&amp;quot; functionality.&lt;br /&gt;
** wallpaper - Wallpapers.&lt;br /&gt;
** tmp - Temporary files (specific for both current host and current user)&lt;br /&gt;
** socket - UNIX Sockets (specific for both current host and current user)&lt;br /&gt;
** xdgconf-menu - Freedesktop.org standard location for menu layout (.menu) files.&lt;br /&gt;
** xdgdata-apps - Freedesktop.org standard location for application desktop files.&lt;br /&gt;
** xdgdata-dirs - Freedesktop.org standard location for menu descriptions (.directory files).&lt;br /&gt;
** xdgdata-mime - Freedesktop.org standard location for MIME type definitions.&lt;br /&gt;
** xdgdata-icon - Freedesktop.org standard location for icons.&lt;br /&gt;
** xdgdata-pixmap - Gnome-compatibility location for pixmaps.&lt;br /&gt;
&lt;br /&gt;
The second parameter should be a specific resource to find the path to. An example might be userDataPath(&amp;quot;data&amp;quot;, &amp;quot;plasma-desktop&amp;quot;).&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Extensions</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-Extensions</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Extensions"/>
				<updated>2011-06-24T12:21:29Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with '== Using Extensions == An API extension is a security controlled set of functions and objects that are loaded on demand. These extensions are requested by the widget by listing t...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using Extensions ==&lt;br /&gt;
An API extension is a security controlled set of functions and objects that are loaded on demand. These extensions are requested by the widget by listing the required and the optional extensions (if any) it wants loaded in its metadata.desktop file. This way, even prior to the widget being loaded, Plasma can know what it will want. &lt;br /&gt;
&lt;br /&gt;
Required extensions are requested using the X-Plasma-RequiredExtensions key, and optional extensions with the X-Plasma-OptionalExtensions. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
X-Plasma-RequiredExtensions=FileDialog,MyCustomQScriptExtension&lt;br /&gt;
X-Plasma-OptionalExtensions=LaunchApp,HTTP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Simplified Javascript Engine then decides if the widget will actually get that extension or not. Failure to load a required extension will result in script execution being aborted.&lt;br /&gt;
&lt;br /&gt;
== Available Extensions ==&lt;br /&gt;
&lt;br /&gt;
* [[../API-FileDialog|File Dialog]]&lt;br /&gt;
* [[../API-LocalIO|Local IO]]&lt;br /&gt;
* [[../API-NetworkIO|Network IO]]&lt;br /&gt;
* [[../API-HTTP|HTTP]]&lt;br /&gt;
* [[../API-LaunchApp|Launching Applications]]&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API</id>
		<title>Development/Tutorials/Plasma/JavaScript/API</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API"/>
				<updated>2011-06-24T12:21:08Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction to the Plasmoid JavaScript API  =&lt;br /&gt;
&lt;br /&gt;
This document provides an overview/reference of the Simplified JavaScript API for Plasmoids. The &amp;quot;Simplified&amp;quot; refers to the fact that it isn't a full binding to all of Qt or KDE's libraries, but a highly focused set of bindings designed to make writing Plasmoids fast and easy, while remaining powerful.&lt;br /&gt;
&lt;br /&gt;
The API in this documentation covers the JavaScript API as it appears in the KDE Software Compilation as of version 4.4, unless otherwise noted. This API ships as part of the KDE Base Runtime package, so can be relied on being there by any application that is Powered By KDE.&lt;br /&gt;
&lt;br /&gt;
= What Is A Simplified JavaScript Plasmoid?  =&lt;br /&gt;
&lt;br /&gt;
This document describes the native Plasma API available to Simplified JavaScript Plasmoids. What makes them &amp;quot;Simplified&amp;quot; is that they do not have access to the entire C++ API in the Plasma, KDE and Qt libraries (let alone things lower in the API stack). This helps ensure that these Plasmoids are more likely to work properly between releases as changes in underlying API don't affect them as well as allowing Plasma to offer stronger security guarantees around them. &lt;br /&gt;
&lt;br /&gt;
To denote that this Plasmoid is a Simplified JavaScript widget, ensure that in the metadata.desktop file there is this line: &lt;br /&gt;
&lt;br /&gt;
X-Plasma-API=javascript &lt;br /&gt;
&lt;br /&gt;
What follows is a description of the runtime environment available to a Simplified JavaScript Plasmoid. &lt;br /&gt;
&lt;br /&gt;
= QtScript  =&lt;br /&gt;
&lt;br /&gt;
The Simplified JavaScript API is powered by Qt's QtScript system which provides access to a full featured ECMA Script interpreter. If it works in ECMA Script, it will work in a Simplified JavaScript Plasmoid. As an interesting implementation note, QtScript uses the high performance ECMA Script interpreter from WebKit and shares this code with QtWebKit. &lt;br /&gt;
&lt;br /&gt;
On top of the ECMA Script language, QtScript provides Qt integration features. Probably the most useful one in this context is the use of signals and slots which is Qt's callback mechanism. Signals may be emitted in QtScript by calling the signal method in question, a signal can be connected to a slot by using the connect() method (and disconnected with disconnect()) and any function defined in the Plasmoid may be used as a slot. For example: &amp;lt;code javascript=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function onClick()&lt;br /&gt;
{&lt;br /&gt;
    print(&amp;quot;We got clicked!&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function onFirstClick()&lt;br /&gt;
{&lt;br /&gt;
    print(&amp;quot;First click!&amp;quot;)&lt;br /&gt;
    button.clicked.disconnect(onFirstClick)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
button = new PushButton&lt;br /&gt;
button.clicked.connect(onClick)&lt;br /&gt;
button.clicked.connect(onFirstClick)&lt;br /&gt;
button.clicked()&lt;br /&gt;
&amp;lt;/code&amp;gt; This will print out: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
We got clicked!&lt;br /&gt;
First click!&lt;br /&gt;
&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
on the console when the Plasmoid starts, and the &amp;quot;We got clicked!&amp;quot; again whenever the button is clicked by the user.&lt;br /&gt;
&lt;br /&gt;
The object that emitted the signal that caused a slot to be called can be retrieved using the ''QObject'' '''sender''' read-only property of the global '''plasmoid''' object.&lt;br /&gt;
&lt;br /&gt;
= API =&lt;br /&gt;
&lt;br /&gt;
* [[../API-PlasmoidObject|The Global plasmoid Object]]&lt;br /&gt;
* [[../API-Enumerations|Global Enumerations]]&lt;br /&gt;
* [[../API-Events|Events]]&lt;br /&gt;
* [[../API-UIElements|User Interface Elements]]&lt;br /&gt;
* [[../API-Animations|Animations]]&lt;br /&gt;
* [[../API-Painting|Painting]]&lt;br /&gt;
* [[../API-DataEnginesServices|Accessing Sources of Data with DataEngines and Services]]&lt;br /&gt;
* [[../API-Print|Printing To Console and Debug Output]]&lt;br /&gt;
* [[../API-IOJobs|Asynchronous Input/Output (IO) Jobs]]&lt;br /&gt;
* [[../API-Timers|Timers]]&lt;br /&gt;
* [[../API-Misc|Utility API and Objects]]&lt;br /&gt;
* [[../API-Extensions|Extensions]]&lt;br /&gt;
** [[../API-FileDialog|FileDialog]]&lt;br /&gt;
** [[../API-LocalIO|Local IO|]]&lt;br /&gt;
** [[../API-NetworkIO|Network IO]]&lt;br /&gt;
** [[../API-HTTP|HTTP]]&lt;br /&gt;
** [[../API-LaunchApp|Launching Applications]]&lt;br /&gt;
* [[../API-Addons|Custom Addons (Plugins) in Javascript]]&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-FileDialog</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-FileDialog</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-FileDialog"/>
				<updated>2011-06-24T12:19:12Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with '= FileDialog =  This Extension provides access to open and save dialog classes: OpenFileDialog and SaveFileDialog. Both are non-modal and run asynchronously...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= FileDialog =&lt;br /&gt;
&lt;br /&gt;
This [[../API-Extensions|Extension]] provides access to open and save dialog classes: OpenFileDialog and SaveFileDialog. Both are non-modal and run asynchronously, so the signals must be used. Other than the name difference (and resulting UI variance) the API for each is identical:&lt;br /&gt;
&lt;br /&gt;
* Constructors&lt;br /&gt;
** '''OpenFileDialog'''&lt;br /&gt;
** '''SaveFileDialog'''&lt;br /&gt;
* Properties&lt;br /&gt;
** Read Only&lt;br /&gt;
*** ''array(Url)'' '''urls''': the selected file, as a Url object&lt;br /&gt;
*** ''Url'' '''baseUrl''', the current path (minus filename) as a Url&lt;br /&gt;
*** ''string '''file''': the selected file, as a string&lt;br /&gt;
*** ''array(string)'' '''files''': selected files (plural), as an array of strings&lt;br /&gt;
** Read/Write&lt;br /&gt;
*** ''Url'' '''url''': the current Url, can be read from when the user is done or assigned before to set the starting path&lt;br /&gt;
*** ''string'' '''filter''': a string representing the mimetype filter; e.g. &amp;quot;*.cpp|C++ Source Files\n*.h|Header files&amp;quot; or &amp;quot;*.cpp&amp;quot; or &amp;quot;*.cpp|*h&amp;quot;&lt;br /&gt;
*** ''boolean'' '''localOnly''': true to show only local files, false if network locations are Ok as well&lt;br /&gt;
*** ''boolean'' '''directoriesOnly''': true to only allow selection of a directory (not a file)&lt;br /&gt;
*** ''boolean'' '''existingOnly''': true if only existing files/directories may be selected&lt;br /&gt;
* Functions&lt;br /&gt;
** '''show()''': when called, the dialog will be shown to the user&lt;br /&gt;
* Signals&lt;br /&gt;
** '''accepted(FileDialogProxy)'''': emitted when the file dialog has been successfully accepted by the user with one or more files/directories.&lt;br /&gt;
** '''finished(FileDialogProxy)''': emitted when the file dialog closes, included when cancelled/closed without being accepted&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Addons</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-Addons</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Addons"/>
				<updated>2011-06-24T12:15:53Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Addons (API V3) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Addons (API V3) ==&lt;br /&gt;
Plasmoids may also have plugins of their own, also written in Javascript, and which are shipped separately to the Plasmoid. These are referred to as &amp;quot;Addons&amp;quot; and are packaged similarly to a Plasmoid. For more information on creating Javascript Addons, visit the [[.Development/Plasma/JavascriptAddons|Javascript Addons tutorial]].&lt;br /&gt;
&lt;br /&gt;
It is possible to list, load and be notified of new Addons having been installed for your Plasmoid.&lt;br /&gt;
&lt;br /&gt;
* ''Array[AddonInformation]'' '''listAddons(string type)''': an array of available addons of the provided type. The type name maps to the X-KDE-PluginInfo-Category entry in the Addon's metadata.desktop file. &lt;br /&gt;
* ''boolean'' '''loadAddon(String type, String id)''': load the addon with the given id and type, return true on success. In order to be notified when the addon is successfully created, add an event listener to the &amp;quot;addCreated&amp;quot; event.&lt;br /&gt;
&lt;br /&gt;
The following are the Addon events which are recognized by the Plasmoid along with the type of event objects (if any) that are passed to registered event listeners that are registered with addEventListener: &lt;br /&gt;
&lt;br /&gt;
* addonCreated: Object addOn&lt;br /&gt;
* newAddonsAvaiable&lt;br /&gt;
&lt;br /&gt;
= AddonInformation (API V3) =&lt;br /&gt;
&lt;br /&gt;
The AddonInformation object contains the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''id''': the id of the Addon. Can be used with loadAddon&lt;br /&gt;
* ''String'' '''name''': a string suitable for showing the user, such as in a configuration dialog&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Addons</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-Addons</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Addons"/>
				<updated>2011-06-24T12:14:34Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with '== Addons (API V3) == Plasmoids may also have plugins of their own, also written in Javascript, and which are shipped separately to the Plasmoid. These are referred to as &amp;quot;Addons...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Addons (API V3) ==&lt;br /&gt;
Plasmoids may also have plugins of their own, also written in Javascript, and which are shipped separately to the Plasmoid. These are referred to as &amp;quot;Addons&amp;quot; and are packaged similarly to a Plasmoid. For more information on creating Javascript Addons, visit the [[/JavascriptAddons|Javascript Addons tutorial]].&lt;br /&gt;
&lt;br /&gt;
It is possible to list, load and be notified of new Addons having been installed for your Plasmoid.&lt;br /&gt;
&lt;br /&gt;
* ''Array[AddonInformation]'' '''listAddons(string type)''': an array of available addons of the provided type. The type name maps to the X-KDE-PluginInfo-Category entry in the Addon's metadata.desktop file. &lt;br /&gt;
* ''boolean'' '''loadAddon(String type, String id)''': load the addon with the given id and type, return true on success. In order to be notified when the addon is successfully created, add an event listener to the &amp;quot;addCreated&amp;quot; event.&lt;br /&gt;
&lt;br /&gt;
The following are the Addon events which are recognized by the Plasmoid along with the type of event objects (if any) that are passed to registered event listeners that are registered with addEventListener: &lt;br /&gt;
&lt;br /&gt;
* addonCreated: Object addOn&lt;br /&gt;
* newAddonsAvaiable&lt;br /&gt;
&lt;br /&gt;
= AddonInformation (API V3) =&lt;br /&gt;
&lt;br /&gt;
The AddonInformation object contains the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''id''': the id of the Addon. Can be used with loadAddon&lt;br /&gt;
* ''String'' '''name''': a string suitable for showing the user, such as in a configuration dialog&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API</id>
		<title>Development/Tutorials/Plasma/JavaScript/API</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API"/>
				<updated>2011-06-24T12:10:54Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction to the Plasmoid JavaScript API  =&lt;br /&gt;
&lt;br /&gt;
This document provides an overview/reference of the Simplified JavaScript API for Plasmoids. The &amp;quot;Simplified&amp;quot; refers to the fact that it isn't a full binding to all of Qt or KDE's libraries, but a highly focused set of bindings designed to make writing Plasmoids fast and easy, while remaining powerful.&lt;br /&gt;
&lt;br /&gt;
The API in this documentation covers the JavaScript API as it appears in the KDE Software Compilation as of version 4.4, unless otherwise noted. This API ships as part of the KDE Base Runtime package, so can be relied on being there by any application that is Powered By KDE.&lt;br /&gt;
&lt;br /&gt;
= What Is A Simplified JavaScript Plasmoid?  =&lt;br /&gt;
&lt;br /&gt;
This document describes the native Plasma API available to Simplified JavaScript Plasmoids. What makes them &amp;quot;Simplified&amp;quot; is that they do not have access to the entire C++ API in the Plasma, KDE and Qt libraries (let alone things lower in the API stack). This helps ensure that these Plasmoids are more likely to work properly between releases as changes in underlying API don't affect them as well as allowing Plasma to offer stronger security guarantees around them. &lt;br /&gt;
&lt;br /&gt;
To denote that this Plasmoid is a Simplified JavaScript widget, ensure that in the metadata.desktop file there is this line: &lt;br /&gt;
&lt;br /&gt;
X-Plasma-API=javascript &lt;br /&gt;
&lt;br /&gt;
What follows is a description of the runtime environment available to a Simplified JavaScript Plasmoid. &lt;br /&gt;
&lt;br /&gt;
= QtScript  =&lt;br /&gt;
&lt;br /&gt;
The Simplified JavaScript API is powered by Qt's QtScript system which provides access to a full featured ECMA Script interpreter. If it works in ECMA Script, it will work in a Simplified JavaScript Plasmoid. As an interesting implementation note, QtScript uses the high performance ECMA Script interpreter from WebKit and shares this code with QtWebKit. &lt;br /&gt;
&lt;br /&gt;
On top of the ECMA Script language, QtScript provides Qt integration features. Probably the most useful one in this context is the use of signals and slots which is Qt's callback mechanism. Signals may be emitted in QtScript by calling the signal method in question, a signal can be connected to a slot by using the connect() method (and disconnected with disconnect()) and any function defined in the Plasmoid may be used as a slot. For example: &amp;lt;code javascript=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function onClick()&lt;br /&gt;
{&lt;br /&gt;
    print(&amp;quot;We got clicked!&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function onFirstClick()&lt;br /&gt;
{&lt;br /&gt;
    print(&amp;quot;First click!&amp;quot;)&lt;br /&gt;
    button.clicked.disconnect(onFirstClick)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
button = new PushButton&lt;br /&gt;
button.clicked.connect(onClick)&lt;br /&gt;
button.clicked.connect(onFirstClick)&lt;br /&gt;
button.clicked()&lt;br /&gt;
&amp;lt;/code&amp;gt; This will print out: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
We got clicked!&lt;br /&gt;
First click!&lt;br /&gt;
&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
on the console when the Plasmoid starts, and the &amp;quot;We got clicked!&amp;quot; again whenever the button is clicked by the user.&lt;br /&gt;
&lt;br /&gt;
The object that emitted the signal that caused a slot to be called can be retrieved using the ''QObject'' '''sender''' read-only property of the global '''plasmoid''' object.&lt;br /&gt;
&lt;br /&gt;
= API =&lt;br /&gt;
&lt;br /&gt;
* [[../API-PlasmoidObject|The Global plasmoid Object]]&lt;br /&gt;
* [[../API-Enumerations|Global Enumerations]]&lt;br /&gt;
* [[../API-Events|Events]]&lt;br /&gt;
* [[../API-UIElements|User Interface Elements]]&lt;br /&gt;
* [[../API-Animations|Animations]]&lt;br /&gt;
* [[../API-Painting|Painting]]&lt;br /&gt;
* [[../API-DataEnginesServices|Accessing Sources of Data with DataEngines and Services]]&lt;br /&gt;
* [[../API-Print|Printing To Console and Debug Output]]&lt;br /&gt;
* [[../API-IOJobs|Asynchronous Input/Output (IO) Jobs]]&lt;br /&gt;
* [[../API-Timers|Timers]]&lt;br /&gt;
* [[../API-Misc|Utility API and Objects]]&lt;br /&gt;
&lt;br /&gt;
== Addons (API V3) ==&lt;br /&gt;
Plasmoids may also have plugins of their own, also written in Javascript, and which are shipped separately to the Plasmoid. These are referred to as &amp;quot;Addons&amp;quot; and are packaged similarly to a Plasmoid. For more information on creating Javascript Addons, visit the [[/JavascriptAddons|Javascript Addons tutorial]].&lt;br /&gt;
&lt;br /&gt;
It is possible to list, load and be notified of new Addons having been installed for your Plasmoid.&lt;br /&gt;
&lt;br /&gt;
* ''Array[AddonInformation]'' '''listAddons(string type)''': an array of available addons of the provided type. The type name maps to the X-KDE-PluginInfo-Category entry in the Addon's metadata.desktop file. &lt;br /&gt;
* ''boolean'' '''loadAddon(String type, String id)''': load the addon with the given id and type, return true on success. In order to be notified when the addon is successfully created, add an event listener to the &amp;quot;addCreated&amp;quot; event.&lt;br /&gt;
&lt;br /&gt;
The following are the Addon events which are recognized by the Plasmoid along with the type of event objects (if any) that are passed to registered event listeners that are registered with addEventListener: &lt;br /&gt;
&lt;br /&gt;
* addonCreated: Object addOn&lt;br /&gt;
* newAddonsAvaiable&lt;br /&gt;
&lt;br /&gt;
=== AddonInformation (API V3) ===&lt;br /&gt;
&lt;br /&gt;
The AddonInformation object contains the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''id''': the id of the Addon. Can be used with loadAddon&lt;br /&gt;
* ''String'' '''name''': a string suitable for showing the user, such as in a configuration dialog&lt;br /&gt;
&lt;br /&gt;
== Extensions  ==&lt;br /&gt;
An API extension is a security controlled set of functions and objects that are loaded on demand. These extensions are requested by the widget by listing the required and the optional extensions (if any) it wants loaded in its metadata.desktop file. This way, even prior to the widget being loaded, Plasma can know what it will want. &lt;br /&gt;
&lt;br /&gt;
Required extensions are requested using the X-Plasma-RequiredExtensions key, and optional extensions with the X-Plasma-OptionalExtensions. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
X-Plasma-RequiredExtensions=FileDialog,MyCustomQScriptExtension&lt;br /&gt;
X-Plasma-OptionalExtensions=LaunchApp,HTTP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Simplified Javascript Engine then decides if the widget will actually get that extension or not. Failure to load a required extension will result in script execution being aborted.&lt;br /&gt;
&lt;br /&gt;
Each of the built-in extensions provided are described below.&lt;br /&gt;
&lt;br /&gt;
=== FileDialog ===&lt;br /&gt;
&lt;br /&gt;
Provides access to open and save dialog classes: OpenFileDialog and SaveFileDialog. Both are non-modal and run asynchronously, so the signals must be used. Other than the name difference (and resulting UI variance) the API for each is identical:&lt;br /&gt;
&lt;br /&gt;
* Constructors&lt;br /&gt;
** '''OpenFileDialog'''&lt;br /&gt;
** '''SaveFileDialog'''&lt;br /&gt;
* Properties&lt;br /&gt;
** Read Only&lt;br /&gt;
*** ''array(Url)'' '''urls''': the selected file, as a Url object&lt;br /&gt;
*** ''Url'' '''baseUrl''', the current path (minus filename) as a Url&lt;br /&gt;
*** ''string '''file''': the selected file, as a string&lt;br /&gt;
*** ''array(string)'' '''files''': selected files (plural), as an array of strings&lt;br /&gt;
** Read/Write&lt;br /&gt;
*** ''Url'' '''url''': the current Url, can be read from when the user is done or assigned before to set the starting path&lt;br /&gt;
*** ''string'' '''filter''': a string representing the mimetype filter; e.g. &amp;quot;*.cpp|C++ Source Files\n*.h|Header files&amp;quot; or &amp;quot;*.cpp&amp;quot; or &amp;quot;*.cpp|*h&amp;quot;&lt;br /&gt;
*** ''boolean'' '''localOnly''': true to show only local files, false if network locations are Ok as well&lt;br /&gt;
*** ''boolean'' '''directoriesOnly''': true to only allow selection of a directory (not a file)&lt;br /&gt;
*** ''boolean'' '''existingOnly''': true if only existing files/directories may be selected&lt;br /&gt;
* Functions&lt;br /&gt;
** '''show()''': when called, the dialog will be shown to the user&lt;br /&gt;
* Signals&lt;br /&gt;
** '''accepted(FileDialogProxy)'''': emitted when the file dialog has been successfully accepted by the user with one or more files/directories.&lt;br /&gt;
** '''finished(FileDialogProxy)''': emitted when the file dialog closes, included when cancelled/closed without being accepted&lt;br /&gt;
&lt;br /&gt;
=== LocalIO === &lt;br /&gt;
This extension allows access to local files. &lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''IOJob'' '''getUrl(Url url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''IOJob'' '''getUrl(String url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''String'' '''userDataPath([String type, String path])''':  (scripting version &amp;gt;= 4) returns the default path for user data. Called with no parameters, it returns the user's home directory. If only one string is passed in, the standard directory for that type of data in the user's home directory will be located; the following values are recognized:&lt;br /&gt;
** documents&lt;br /&gt;
** music&lt;br /&gt;
** video&lt;br /&gt;
** downloads&lt;br /&gt;
** pictures&lt;br /&gt;
** autostart&lt;br /&gt;
** desktop (should be considered deprecated for Plasma workspaces)&lt;br /&gt;
&lt;br /&gt;
If a second string is passed in, it is considered a request for a specific path and the following types are recognized:&lt;br /&gt;
** apps - Applications menu (.desktop files).&lt;br /&gt;
** autostart - Autostart directories (both XDG and kde-specific)&lt;br /&gt;
** cache - Cached information (e.g. favicons, web-pages)&lt;br /&gt;
** cgi - CGIs to run from kdehelp.&lt;br /&gt;
** config - Configuration files.&lt;br /&gt;
** data - Where applications store data.&lt;br /&gt;
** emoticons - Emoticons themes&lt;br /&gt;
** exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account.&lt;br /&gt;
** html - HTML documentation.&lt;br /&gt;
** icon - Icons, see KIconLoader.&lt;br /&gt;
** kcfg - KConfigXT config files.&lt;br /&gt;
** lib - Libraries.&lt;br /&gt;
** locale - Translation files for KLocale.&lt;br /&gt;
** mime - Mime types defined by KDE-specific .desktop files.&lt;br /&gt;
** module - Module (dynamically loaded library).&lt;br /&gt;
** qtplugins - Qt plugins (dynamically loaded objects for Qt)&lt;br /&gt;
** services - Services.&lt;br /&gt;
** servicetypes - Service types.&lt;br /&gt;
** sound - Application sounds.&lt;br /&gt;
** templates - Templates for the &amp;quot;Create new file&amp;quot; functionality.&lt;br /&gt;
** wallpaper - Wallpapers.&lt;br /&gt;
** tmp - Temporary files (specific for both current host and current user)&lt;br /&gt;
** socket - UNIX Sockets (specific for both current host and current user)&lt;br /&gt;
** xdgconf-menu - Freedesktop.org standard location for menu layout (.menu) files.&lt;br /&gt;
** xdgdata-apps - Freedesktop.org standard location for application desktop files.&lt;br /&gt;
** xdgdata-dirs - Freedesktop.org standard location for menu descriptions (.directory files).&lt;br /&gt;
** xdgdata-mime - Freedesktop.org standard location for MIME type definitions.&lt;br /&gt;
** xdgdata-icon - Freedesktop.org standard location for icons.&lt;br /&gt;
** xdgdata-pixmap - Gnome-compatibility location for pixmaps.&lt;br /&gt;
&lt;br /&gt;
The second parameter should be a specific resource to find the path to. An example might be userDataPath(&amp;quot;data&amp;quot;, &amp;quot;plasma-desktop&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== NetworkIO === &lt;br /&gt;
This extensions allows access to network addresses.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''IOJob'' '''getUrl(Url url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''IOJob'' '''getUrl(String url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
&lt;br /&gt;
=== HTTP ===&lt;br /&gt;
This extension allows access to data and files via http and https.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''IOJob'' '''getUrl(Url url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''IOJob'' '''getUrl(String url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''bool'' '''openUrl([string|Url] url)''': (API v4) Opens the url in the default application (or asks the user if there is no default application for the file). The url parameter may be either a string or a Url. Returns true on success, false on failure.&lt;br /&gt;
&lt;br /&gt;
=== LaunchApp ===&lt;br /&gt;
&lt;br /&gt;
Adds methods to the global plasmoid object that allow launching applications, running commands and opening files and urls.&lt;br /&gt;
&lt;br /&gt;
* ''bool'' '''runApplication(string application[, array files])''' &amp;lt;br&amp;gt;Runs an application by name (can reference an installed .desktop file as well as an executable in the user's $PATH) with an optional array of files. The file array may contain either Urls or strings. Returns true on success, false on failure.&lt;br /&gt;
* ''bool'' '''runCommand(string exe[, array args])''' &amp;lt;br&amp;gt;Runs the executable with the given arguments. Returns true on success, false on failure.&lt;br /&gt;
* ''bool'' '''openUrl([string|Url] url)''': &amp;lt;br&amp;gt;Opens the url in the default application (or asks the user if there is no default application for the file). The url parameter may be either a string or a Url. Returns true on success, false on failure.&lt;br /&gt;
* ''boolean'' '''applicationExists(String name)''': (scripting version &amp;gt;= 4) searches $PATH first, then tries in the application menu system by application storage name (aka the .desktop file name), then Name= entries for apps with installed .desktop files, then GenericName= entries for same&lt;br /&gt;
* ''mixed'' '''defaultApplication(String kind [, boolean storageId = false])''': (scripting version &amp;gt;= 4) returns the executable (or if storageId is true, then the app menu system id, e.g. its .desktop file name) of the default app. The &amp;quot;kind&amp;quot; parameter may be a well-known application type including &amp;quot;browser&amp;quot;, &amp;quot;mailer&amp;quot;, &amp;quot;filemanager&amp;quot;, &amp;quot;terminal&amp;quot;, &amp;quot;imClient&amp;quot; and &amp;quot;windowmanager&amp;quot; (or any other entry in share/apps/kcm_componentchooser/kcm_*.desktop); it may also be a mimetype (e.g. &amp;quot;application/pdf&amp;quot;). On failure, it returns false.&lt;br /&gt;
* ''String'' '''applicationPath(String name)''':  (scripting version &amp;gt;= 4) returns the full local path to a given application or .desktop file if it exists.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Misc</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-Misc</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Misc"/>
				<updated>2011-06-24T12:10:38Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with '= Url = Represents a local or remote address. To create a new Url (or assign to an existing one), use the following syntax:  &amp;lt;code javascript&amp;gt;var url = new Url(&amp;quot;http://kde.org&amp;quot;)&amp;lt;...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Url =&lt;br /&gt;
Represents a local or remote address. To create a new Url (or assign to an existing one), use the following syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;var url = new Url(&amp;quot;http://kde.org&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''string'' '''toString''': the URL as a String object&lt;br /&gt;
&lt;br /&gt;
Read-write properties (each representing a portion of the full URL):&lt;br /&gt;
* ''string'' '''protocol'''&lt;br /&gt;
* ''string'' '''host'''&lt;br /&gt;
* ''string'' '''path'''&lt;br /&gt;
* ''string'' '''user'''&lt;br /&gt;
* ''string'' '''password'''&lt;br /&gt;
&lt;br /&gt;
= ByteArray =&lt;br /&gt;
This class provides an array of bytes. This is often used by data centric objects, such as the Job classes returned by getUrl.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''number'' '''length''': the size of the array (number of bytes)&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''chop(number numBytes)''': chops numBytes from the end of the array&lt;br /&gt;
* ''bool'' '''equals(ByteArray other)'''&lt;br /&gt;
* ''ByteArray '''left(number len)''': return len bytes from the left of the array&lt;br /&gt;
* ''ByteArray '''mid(number pos, number len)''': returns an array of bytes starting a post and length len (if len is -1, it returns all remaining bytes)&lt;br /&gt;
* ''ByteArray '''remove(number pos, number len)''': removes len bytes starting at index pos from the array and returns it&lt;br /&gt;
* ''ByteArray '''right(number len)''': returns len bytes from the right of the array&lt;br /&gt;
* ''ByteArray '''simplified()''': returns a byte array that has whitespace removed from the start and the end, and which has each sequence of internal whitespace replaced with a single space&lt;br /&gt;
* ''ByteArray '''toBase64()''': returns the array encoded in base64&lt;br /&gt;
* ''ByteArray '''toLower()''': returns a lowercased copy of the array&lt;br /&gt;
* ''ByteArray '''toUpper()''': returns an uppercased copy of the array&lt;br /&gt;
* ''ByteArray '''trimmed()''': returns a copy of the array with whitespace remove from the start and end&lt;br /&gt;
* truncate(number pos): truncates the array at index pos&lt;br /&gt;
* ''String'' '''toLatin1String()''': returns a Latin1-ized string based on the array&lt;br /&gt;
* ''String'' '''toUtf8()''': (API v3) returns a string from the contents of the array using a Utf8 conversation&lt;br /&gt;
* ''String'' '''valueOf()''': returns the raw data in the array as a string&lt;br /&gt;
&lt;br /&gt;
= GraphicsItem =&lt;br /&gt;
This class represents an item on the canvas. Support is only provided so that GraphicsItem objects returned or taken by other objects work. There is no meaningful API provided directly in the JavaScript runtime for these objects and they should not need to be used directly.&lt;br /&gt;
&lt;br /&gt;
= QSizePolicy =&lt;br /&gt;
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy. This can be set on any graphics widget that you have using the enums provided for this (QtSizePolicy ), for example:&lt;br /&gt;
&lt;br /&gt;
button = new PushButton();&lt;br /&gt;
button.sizePolicy = QSizePolicy(QSizePolicyMaximum, QSizePolicyFixed);&lt;br /&gt;
&lt;br /&gt;
This is useful when your widgets are being laid out by a layout (specially the anchor layout).&lt;br /&gt;
&lt;br /&gt;
* ''QtSizePolicy '' '''horizontalPolicy''': The horizontal component of the size policy.&lt;br /&gt;
* ''QtSizePolicy '' '''verticalPolicy''': The vertical component of the size policy.&lt;br /&gt;
* ''number'' '''horizontalStretch''': The horizontal stretch factor of the size policy.&lt;br /&gt;
* ''number'' '''verticalStretch''': The vertical stretch factor of the size policy.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Timers</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-Timers</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Timers"/>
				<updated>2011-06-24T12:10:00Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with '= QTimer =  Read-write properties: * ''boolean'' '''active''': true if active, false if not * ''boolean'' '''singleShot''': true if the timer will fire once when started, false i...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= QTimer =&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''active''': true if active, false if not&lt;br /&gt;
* ''boolean'' '''singleShot''': true if the timer will fire once when started, false if it will fire repeatedly until stopped&lt;br /&gt;
* ''boolean'' '''interval''': the interval in milliseconds that the timer will trigger&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''start(int msec)''': starts the timer with msec as the interval&lt;br /&gt;
* '''start()''': starts the timer with the default interval&lt;br /&gt;
* '''stop()''': stops the timer&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''timeout()''': this signal is emitted whenever the timer interval is reached&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-IOJobs</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-IOJobs</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-IOJobs"/>
				<updated>2011-06-24T12:09:20Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with '= IOJob =  This object is returned by input/output access for asynchronous file and data access (see the section on Extensions for documentation on getUrl). It is used by connect...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= IOJob =&lt;br /&gt;
&lt;br /&gt;
This object is returned by input/output access for asynchronous file and data access (see the section on Extensions for documentation on getUrl). It is used by connecting Javascript functions in your code to the relevant signals.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''kill()'''&lt;br /&gt;
* '''suspend()'''&lt;br /&gt;
* '''resume()'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''data(IOJob job, ByteArray data)''': emitted whenever data arrives. If data is empty (data.length == 0) then the transmission has completed.&lt;br /&gt;
* '''dataReq(IOJob job, ByteArray data)''': when sending data, this signal is emitted when data is requested; add the data to be sent ot the data member, or leave it empty to signal that the process is complete and there is no more data to send&lt;br /&gt;
* '''finished(IOJob job)''': emitted when the transmission has completed&lt;br /&gt;
* '''suspended(IOJob job)''': emitted when the job has been suspeneded &lt;br /&gt;
* '''resumed(IOJob job)'''&lt;br /&gt;
* '''canceled(IOJob job)'''&lt;br /&gt;
* '''connected(IOJob job)'''&lt;br /&gt;
* '''redirection(IOJob job, Url to)'''&lt;br /&gt;
* '''permanentRedirection(IOJob job, Url from, Url to)'''&lt;br /&gt;
* '''mimetype(IOJob job, String mimetype)'''&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Print</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-Print</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Print"/>
				<updated>2011-06-24T12:08:54Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with '= Print and Debug =  * '''print(string message)''': prints message to console * '''debug(string message)''': print message to console if it is running in a KDE debug build'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Print and Debug =&lt;br /&gt;
&lt;br /&gt;
* '''print(string message)''': prints message to console&lt;br /&gt;
* '''debug(string message)''': print message to console if it is running in a KDE debug build&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-DataEnginesServices</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-DataEnginesServices</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-DataEnginesServices"/>
				<updated>2011-06-24T12:05:32Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with 'DataEngines and Services provide access to various types of data and the ability to interact with them via asynchronous services with a convenient and consistent API. See the [[D...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DataEngines and Services provide access to various types of data and the ability to interact with them via asynchronous services with a convenient and consistent API. See the [[Development/Tutorials/Plasma/JavaScript/DataEngine|JavaScript Plasmoid DataEngine tutorials]] for examples on how to use DataEngines and Services in your Plasmoids.&lt;br /&gt;
&lt;br /&gt;
= Global Functions to Access DataEngines and Services =&lt;br /&gt;
* dataEngine(string name): returns a DataEngine object&lt;br /&gt;
* service(string dataEngineName, string sourceName): returns a ServiceObject, see also DataEngine::serviceForSource&lt;br /&gt;
&lt;br /&gt;
= DataEngine =&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[String]'' '''sources'''&lt;br /&gt;
* ''boolean'' '''valid'''&lt;br /&gt;
* ''String'' '''icon'''&lt;br /&gt;
* ''String'' '''name'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''sourceAdded(String sourceName)'''&lt;br /&gt;
* '''sourceRemoved(String sourceName)'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''serviceForSource(String sourceName)'''&lt;br /&gt;
* '''connectSource(String sourceName, Object connectTo[, number interval[, IntervalAlignment alignment] ])''': if the object passed in as the object to connect to is the plasmoid object, then the plasmoid.dataUpdated(String source, Map[String, Any] data) callback will be called if it exists&lt;br /&gt;
* '''connectAllSources(Object connectTo[, number interval[, IntervalAlignment alignment] ])''': if the object passed in as the object to connect to is the plasmoid object, then the plasmoid.dataUpdated(String source, Map[String, Any] data) callback will be called if it exists&lt;br /&gt;
* '''disconnectSource(String sourceName, Object connectedTo)''': if the object passed in as the object to connect to is the plasmoid object, then the plasmoid.dataUpdated(String source, Map[String, Any] data) callback will be called if it exists&lt;br /&gt;
* '''Data query(String sourceName)'''&lt;br /&gt;
&lt;br /&gt;
The following functions are only of interest to DataEngine reimplementations (e.g. JavaScript DataEngines):&lt;br /&gt;
&lt;br /&gt;
* '''scheduleSourcesUpdated()'''&lt;br /&gt;
* '''removeSource(String)'''&lt;br /&gt;
* '''updateAllSources()'''&lt;br /&gt;
* '''forceImmediateUpdateOfAllVisualizations()'''&lt;br /&gt;
* '''DataContainer containerForSource(String)'''&lt;br /&gt;
&lt;br /&gt;
= Service =&lt;br /&gt;
* function finished(Plasma::ServiceJob*)&lt;br /&gt;
* function operationsChanged()&lt;br /&gt;
* function serviceReady(Plasma::Service*)&lt;br /&gt;
* function setDestination(QString)&lt;br /&gt;
* function destination()&lt;br /&gt;
* function operationNames()&lt;br /&gt;
* function operationDescription(QString)&lt;br /&gt;
* function startOperationCall(KConfigGroup,QObject*)&lt;br /&gt;
* function startOperationCall(KConfigGroup)&lt;br /&gt;
* function isOperationEnabled(QString)&lt;br /&gt;
* function name()&lt;br /&gt;
* function associateWidget(QWidget*,QString)&lt;br /&gt;
* function disassociateWidget(QWidget*)&lt;br /&gt;
* function associateWidget(QGraphicsWidget*,QString)&lt;br /&gt;
* function disassociateWidget(QGraphicsWidget*)&lt;br /&gt;
* function parametersFromDescription(KConfigGroup)&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API</id>
		<title>Development/Tutorials/Plasma/JavaScript/API</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API"/>
				<updated>2011-06-24T12:02:51Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction to the Plasmoid JavaScript API  =&lt;br /&gt;
&lt;br /&gt;
This document provides an overview/reference of the Simplified JavaScript API for Plasmoids. The &amp;quot;Simplified&amp;quot; refers to the fact that it isn't a full binding to all of Qt or KDE's libraries, but a highly focused set of bindings designed to make writing Plasmoids fast and easy, while remaining powerful.&lt;br /&gt;
&lt;br /&gt;
The API in this documentation covers the JavaScript API as it appears in the KDE Software Compilation as of version 4.4, unless otherwise noted. This API ships as part of the KDE Base Runtime package, so can be relied on being there by any application that is Powered By KDE.&lt;br /&gt;
&lt;br /&gt;
= What Is A Simplified JavaScript Plasmoid?  =&lt;br /&gt;
&lt;br /&gt;
This document describes the native Plasma API available to Simplified JavaScript Plasmoids. What makes them &amp;quot;Simplified&amp;quot; is that they do not have access to the entire C++ API in the Plasma, KDE and Qt libraries (let alone things lower in the API stack). This helps ensure that these Plasmoids are more likely to work properly between releases as changes in underlying API don't affect them as well as allowing Plasma to offer stronger security guarantees around them. &lt;br /&gt;
&lt;br /&gt;
To denote that this Plasmoid is a Simplified JavaScript widget, ensure that in the metadata.desktop file there is this line: &lt;br /&gt;
&lt;br /&gt;
X-Plasma-API=javascript &lt;br /&gt;
&lt;br /&gt;
What follows is a description of the runtime environment available to a Simplified JavaScript Plasmoid. &lt;br /&gt;
&lt;br /&gt;
= QtScript  =&lt;br /&gt;
&lt;br /&gt;
The Simplified JavaScript API is powered by Qt's QtScript system which provides access to a full featured ECMA Script interpreter. If it works in ECMA Script, it will work in a Simplified JavaScript Plasmoid. As an interesting implementation note, QtScript uses the high performance ECMA Script interpreter from WebKit and shares this code with QtWebKit. &lt;br /&gt;
&lt;br /&gt;
On top of the ECMA Script language, QtScript provides Qt integration features. Probably the most useful one in this context is the use of signals and slots which is Qt's callback mechanism. Signals may be emitted in QtScript by calling the signal method in question, a signal can be connected to a slot by using the connect() method (and disconnected with disconnect()) and any function defined in the Plasmoid may be used as a slot. For example: &amp;lt;code javascript=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function onClick()&lt;br /&gt;
{&lt;br /&gt;
    print(&amp;quot;We got clicked!&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function onFirstClick()&lt;br /&gt;
{&lt;br /&gt;
    print(&amp;quot;First click!&amp;quot;)&lt;br /&gt;
    button.clicked.disconnect(onFirstClick)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
button = new PushButton&lt;br /&gt;
button.clicked.connect(onClick)&lt;br /&gt;
button.clicked.connect(onFirstClick)&lt;br /&gt;
button.clicked()&lt;br /&gt;
&amp;lt;/code&amp;gt; This will print out: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
We got clicked!&lt;br /&gt;
First click!&lt;br /&gt;
&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
on the console when the Plasmoid starts, and the &amp;quot;We got clicked!&amp;quot; again whenever the button is clicked by the user.&lt;br /&gt;
&lt;br /&gt;
The object that emitted the signal that caused a slot to be called can be retrieved using the ''QObject'' '''sender''' read-only property of the global '''plasmoid''' object.&lt;br /&gt;
&lt;br /&gt;
= API =&lt;br /&gt;
&lt;br /&gt;
* [[../API-PlasmoidObject|The Global plasmoid Object]]&lt;br /&gt;
* [[../API-Enumerations|Global Enumerations]]&lt;br /&gt;
* [[../API-Events|Events]]&lt;br /&gt;
* [[../API-UIElements|User Interface Elements]]&lt;br /&gt;
* [[../API-Animations|Animations]]&lt;br /&gt;
* [[../API-Painting|Painting|]]&lt;br /&gt;
&lt;br /&gt;
== Accessing Sources of Data  ==&lt;br /&gt;
&lt;br /&gt;
See the [[Development/Tutorials/Plasma/JavaScript/DataEngine|JavaScript Plasmoid DataEngine tutorials]]&lt;br /&gt;
&lt;br /&gt;
=== Global Functions to Access DataEngines and Services ===&lt;br /&gt;
* dataEngine(string name): returns a DataEngine object&lt;br /&gt;
* service(string dataEngineName, string sourceName): returns a ServiceObject, see also DataEngine::serviceForSource&lt;br /&gt;
&lt;br /&gt;
=== DataEngine ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[String]'' '''sources'''&lt;br /&gt;
* ''boolean'' '''valid'''&lt;br /&gt;
* ''String'' '''icon'''&lt;br /&gt;
* ''String'' '''name'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''sourceAdded(String sourceName)'''&lt;br /&gt;
* '''sourceRemoved(String sourceName)'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''serviceForSource(String sourceName)'''&lt;br /&gt;
* '''connectSource(String sourceName, Object connectTo[, number interval[, IntervalAlignment alignment] ])''': if the object passed in as the object to connect to is the plasmoid object, then the plasmoid.dataUpdated(String source, Map[String, Any] data) callback will be called if it exists&lt;br /&gt;
* '''connectAllSources(Object connectTo[, number interval[, IntervalAlignment alignment] ])''': if the object passed in as the object to connect to is the plasmoid object, then the plasmoid.dataUpdated(String source, Map[String, Any] data) callback will be called if it exists&lt;br /&gt;
* '''disconnectSource(String sourceName, Object connectedTo)''': if the object passed in as the object to connect to is the plasmoid object, then the plasmoid.dataUpdated(String source, Map[String, Any] data) callback will be called if it exists&lt;br /&gt;
* '''Data query(String sourceName)'''&lt;br /&gt;
&lt;br /&gt;
The following functions are only of interest to DataEngine reimplementations (e.g. JavaScript DataEngines):&lt;br /&gt;
&lt;br /&gt;
* '''scheduleSourcesUpdated()'''&lt;br /&gt;
* '''removeSource(String)'''&lt;br /&gt;
* '''updateAllSources()'''&lt;br /&gt;
* '''forceImmediateUpdateOfAllVisualizations()'''&lt;br /&gt;
* '''DataContainer containerForSource(String)'''&lt;br /&gt;
&lt;br /&gt;
=== Service ===&lt;br /&gt;
* function finished(Plasma::ServiceJob*)&lt;br /&gt;
* function operationsChanged()&lt;br /&gt;
* function serviceReady(Plasma::Service*)&lt;br /&gt;
* function setDestination(QString)&lt;br /&gt;
* function destination()&lt;br /&gt;
* function operationNames()&lt;br /&gt;
* function operationDescription(QString)&lt;br /&gt;
* function startOperationCall(KConfigGroup,QObject*)&lt;br /&gt;
* function startOperationCall(KConfigGroup)&lt;br /&gt;
* function isOperationEnabled(QString)&lt;br /&gt;
* function name()&lt;br /&gt;
* function associateWidget(QWidget*,QString)&lt;br /&gt;
* function disassociateWidget(QWidget*)&lt;br /&gt;
* function associateWidget(QGraphicsWidget*,QString)&lt;br /&gt;
* function disassociateWidget(QGraphicsWidget*)&lt;br /&gt;
* function parametersFromDescription(KConfigGroup)&lt;br /&gt;
&lt;br /&gt;
== Other Functions and Classes  ==&lt;br /&gt;
=== Print and Debug ===&lt;br /&gt;
* '''print(string message)''': prints message to console&lt;br /&gt;
* '''debug(string message)''': print message to console if it is running in a KDE debug build&lt;br /&gt;
&lt;br /&gt;
=== GraphicsItem ===&lt;br /&gt;
This class represents an item on the canvas. Support is only provided so that GraphicsItem objects returned or taken by other objects work. There is no meaningful API provided directly in the JavaScript runtime for these objects and they should not need to be used directly.&lt;br /&gt;
&lt;br /&gt;
=== QSizePolicy ===&lt;br /&gt;
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy. This can be set on any graphics widget that you have using the enums provided for this (QtSizePolicy ), for example:&lt;br /&gt;
&lt;br /&gt;
button = new PushButton();&lt;br /&gt;
button.sizePolicy = QSizePolicy(QSizePolicyMaximum, QSizePolicyFixed);&lt;br /&gt;
&lt;br /&gt;
This is useful when your widgets are being laid out by a layout (specially the anchor layout).&lt;br /&gt;
&lt;br /&gt;
* ''QtSizePolicy '' '''horizontalPolicy''': The horizontal component of the size policy.&lt;br /&gt;
* ''QtSizePolicy '' '''verticalPolicy''': The vertical component of the size policy.&lt;br /&gt;
* ''number'' '''horizontalStretch''': The horizontal stretch factor of the size policy.&lt;br /&gt;
* ''number'' '''verticalStretch''': The vertical stretch factor of the size policy.&lt;br /&gt;
&lt;br /&gt;
=== IOJob ===&lt;br /&gt;
This object is returned by input/output access for asynchronous file and data access (see the section on Extensions for documentation on getUrl). It is used by connecting Javascript functions in your code to the relevant signals.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''kill()'''&lt;br /&gt;
* '''suspend()'''&lt;br /&gt;
* '''resume()'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''data(IOJob job, ByteArray data)''': emitted whenever data arrives. If data is empty (data.length == 0) then the transmission has completed.&lt;br /&gt;
* '''dataReq(IOJob job, ByteArray data)''': when sending data, this signal is emitted when data is requested; add the data to be sent ot the data member, or leave it empty to signal that the process is complete and there is no more data to send&lt;br /&gt;
* '''finished(IOJob job)''': emitted when the transmission has completed&lt;br /&gt;
* '''suspended(IOJob job)''': emitted when the job has been suspeneded &lt;br /&gt;
* '''resumed(IOJob job)'''&lt;br /&gt;
* '''canceled(IOJob job)'''&lt;br /&gt;
* '''connected(IOJob job)'''&lt;br /&gt;
* '''redirection(IOJob job, Url to)'''&lt;br /&gt;
* '''permanentRedirection(IOJob job, Url from, Url to)'''&lt;br /&gt;
* '''mimetype(IOJob job, String mimetype)'''&lt;br /&gt;
&lt;br /&gt;
=== QTimer ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''active''': true if active, false if not&lt;br /&gt;
* ''boolean'' '''singleShot''': true if the timer will fire once when started, false if it will fire repeatedly until stopped&lt;br /&gt;
* ''boolean'' '''interval''': the interval in milliseconds that the timer will trigger&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''start(int msec)''': starts the timer with msec as the interval&lt;br /&gt;
* '''start()''': starts the timer with the default interval&lt;br /&gt;
* '''stop()''': stops the timer&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''timeout()''': this signal is emitted whenever the timer interval is reached&lt;br /&gt;
&lt;br /&gt;
=== Url ===&lt;br /&gt;
Represents a local or remote address. To create a new Url (or assign to an existing one), use the following syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;var url = new Url(&amp;quot;http://kde.org&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''string'' '''toString''': the URL as a String object&lt;br /&gt;
&lt;br /&gt;
Read-write properties (each representing a portion of the full URL):&lt;br /&gt;
* ''string'' '''protocol'''&lt;br /&gt;
* ''string'' '''host'''&lt;br /&gt;
* ''string'' '''path'''&lt;br /&gt;
* ''string'' '''user'''&lt;br /&gt;
* ''string'' '''password'''&lt;br /&gt;
&lt;br /&gt;
=== ByteArray ===&lt;br /&gt;
This class provides an array of bytes. This is often used by data centric objects, such as the Job classes returned by getUrl.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''number'' '''length''': the size of the array (number of bytes)&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''chop(number numBytes)''': chops numBytes from the end of the array&lt;br /&gt;
* ''bool'' '''equals(ByteArray other)'''&lt;br /&gt;
* ''ByteArray '''left(number len)''': return len bytes from the left of the array&lt;br /&gt;
* ''ByteArray '''mid(number pos, number len)''': returns an array of bytes starting a post and length len (if len is -1, it returns all remaining bytes)&lt;br /&gt;
* ''ByteArray '''remove(number pos, number len)''': removes len bytes starting at index pos from the array and returns it&lt;br /&gt;
* ''ByteArray '''right(number len)''': returns len bytes from the right of the array&lt;br /&gt;
* ''ByteArray '''simplified()''': returns a byte array that has whitespace removed from the start and the end, and which has each sequence of internal whitespace replaced with a single space&lt;br /&gt;
* ''ByteArray '''toBase64()''': returns the array encoded in base64&lt;br /&gt;
* ''ByteArray '''toLower()''': returns a lowercased copy of the array&lt;br /&gt;
* ''ByteArray '''toUpper()''': returns an uppercased copy of the array&lt;br /&gt;
* ''ByteArray '''trimmed()''': returns a copy of the array with whitespace remove from the start and end&lt;br /&gt;
* truncate(number pos): truncates the array at index pos&lt;br /&gt;
* ''String'' '''toLatin1String()''': returns a Latin1-ized string based on the array&lt;br /&gt;
* ''String'' '''toUtf8()''': (API v3) returns a string from the contents of the array using a Utf8 conversation&lt;br /&gt;
* ''String'' '''valueOf()''': returns the raw data in the array as a string&lt;br /&gt;
&lt;br /&gt;
== Addons (API V3) ==&lt;br /&gt;
Plasmoids may also have plugins of their own, also written in Javascript, and which are shipped separately to the Plasmoid. These are referred to as &amp;quot;Addons&amp;quot; and are packaged similarly to a Plasmoid. For more information on creating Javascript Addons, visit the [[/JavascriptAddons|Javascript Addons tutorial]].&lt;br /&gt;
&lt;br /&gt;
It is possible to list, load and be notified of new Addons having been installed for your Plasmoid.&lt;br /&gt;
&lt;br /&gt;
* ''Array[AddonInformation]'' '''listAddons(string type)''': an array of available addons of the provided type. The type name maps to the X-KDE-PluginInfo-Category entry in the Addon's metadata.desktop file. &lt;br /&gt;
* ''boolean'' '''loadAddon(String type, String id)''': load the addon with the given id and type, return true on success. In order to be notified when the addon is successfully created, add an event listener to the &amp;quot;addCreated&amp;quot; event.&lt;br /&gt;
&lt;br /&gt;
The following are the Addon events which are recognized by the Plasmoid along with the type of event objects (if any) that are passed to registered event listeners that are registered with addEventListener: &lt;br /&gt;
&lt;br /&gt;
* addonCreated: Object addOn&lt;br /&gt;
* newAddonsAvaiable&lt;br /&gt;
&lt;br /&gt;
=== AddonInformation (API V3) ===&lt;br /&gt;
&lt;br /&gt;
The AddonInformation object contains the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''id''': the id of the Addon. Can be used with loadAddon&lt;br /&gt;
* ''String'' '''name''': a string suitable for showing the user, such as in a configuration dialog&lt;br /&gt;
&lt;br /&gt;
== Extensions  ==&lt;br /&gt;
An API extension is a security controlled set of functions and objects that are loaded on demand. These extensions are requested by the widget by listing the required and the optional extensions (if any) it wants loaded in its metadata.desktop file. This way, even prior to the widget being loaded, Plasma can know what it will want. &lt;br /&gt;
&lt;br /&gt;
Required extensions are requested using the X-Plasma-RequiredExtensions key, and optional extensions with the X-Plasma-OptionalExtensions. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
X-Plasma-RequiredExtensions=FileDialog,MyCustomQScriptExtension&lt;br /&gt;
X-Plasma-OptionalExtensions=LaunchApp,HTTP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Simplified Javascript Engine then decides if the widget will actually get that extension or not. Failure to load a required extension will result in script execution being aborted.&lt;br /&gt;
&lt;br /&gt;
Each of the built-in extensions provided are described below.&lt;br /&gt;
&lt;br /&gt;
=== FileDialog ===&lt;br /&gt;
&lt;br /&gt;
Provides access to open and save dialog classes: OpenFileDialog and SaveFileDialog. Both are non-modal and run asynchronously, so the signals must be used. Other than the name difference (and resulting UI variance) the API for each is identical:&lt;br /&gt;
&lt;br /&gt;
* Constructors&lt;br /&gt;
** '''OpenFileDialog'''&lt;br /&gt;
** '''SaveFileDialog'''&lt;br /&gt;
* Properties&lt;br /&gt;
** Read Only&lt;br /&gt;
*** ''array(Url)'' '''urls''': the selected file, as a Url object&lt;br /&gt;
*** ''Url'' '''baseUrl''', the current path (minus filename) as a Url&lt;br /&gt;
*** ''string '''file''': the selected file, as a string&lt;br /&gt;
*** ''array(string)'' '''files''': selected files (plural), as an array of strings&lt;br /&gt;
** Read/Write&lt;br /&gt;
*** ''Url'' '''url''': the current Url, can be read from when the user is done or assigned before to set the starting path&lt;br /&gt;
*** ''string'' '''filter''': a string representing the mimetype filter; e.g. &amp;quot;*.cpp|C++ Source Files\n*.h|Header files&amp;quot; or &amp;quot;*.cpp&amp;quot; or &amp;quot;*.cpp|*h&amp;quot;&lt;br /&gt;
*** ''boolean'' '''localOnly''': true to show only local files, false if network locations are Ok as well&lt;br /&gt;
*** ''boolean'' '''directoriesOnly''': true to only allow selection of a directory (not a file)&lt;br /&gt;
*** ''boolean'' '''existingOnly''': true if only existing files/directories may be selected&lt;br /&gt;
* Functions&lt;br /&gt;
** '''show()''': when called, the dialog will be shown to the user&lt;br /&gt;
* Signals&lt;br /&gt;
** '''accepted(FileDialogProxy)'''': emitted when the file dialog has been successfully accepted by the user with one or more files/directories.&lt;br /&gt;
** '''finished(FileDialogProxy)''': emitted when the file dialog closes, included when cancelled/closed without being accepted&lt;br /&gt;
&lt;br /&gt;
=== LocalIO === &lt;br /&gt;
This extension allows access to local files. &lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''IOJob'' '''getUrl(Url url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''IOJob'' '''getUrl(String url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''String'' '''userDataPath([String type, String path])''':  (scripting version &amp;gt;= 4) returns the default path for user data. Called with no parameters, it returns the user's home directory. If only one string is passed in, the standard directory for that type of data in the user's home directory will be located; the following values are recognized:&lt;br /&gt;
** documents&lt;br /&gt;
** music&lt;br /&gt;
** video&lt;br /&gt;
** downloads&lt;br /&gt;
** pictures&lt;br /&gt;
** autostart&lt;br /&gt;
** desktop (should be considered deprecated for Plasma workspaces)&lt;br /&gt;
&lt;br /&gt;
If a second string is passed in, it is considered a request for a specific path and the following types are recognized:&lt;br /&gt;
** apps - Applications menu (.desktop files).&lt;br /&gt;
** autostart - Autostart directories (both XDG and kde-specific)&lt;br /&gt;
** cache - Cached information (e.g. favicons, web-pages)&lt;br /&gt;
** cgi - CGIs to run from kdehelp.&lt;br /&gt;
** config - Configuration files.&lt;br /&gt;
** data - Where applications store data.&lt;br /&gt;
** emoticons - Emoticons themes&lt;br /&gt;
** exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account.&lt;br /&gt;
** html - HTML documentation.&lt;br /&gt;
** icon - Icons, see KIconLoader.&lt;br /&gt;
** kcfg - KConfigXT config files.&lt;br /&gt;
** lib - Libraries.&lt;br /&gt;
** locale - Translation files for KLocale.&lt;br /&gt;
** mime - Mime types defined by KDE-specific .desktop files.&lt;br /&gt;
** module - Module (dynamically loaded library).&lt;br /&gt;
** qtplugins - Qt plugins (dynamically loaded objects for Qt)&lt;br /&gt;
** services - Services.&lt;br /&gt;
** servicetypes - Service types.&lt;br /&gt;
** sound - Application sounds.&lt;br /&gt;
** templates - Templates for the &amp;quot;Create new file&amp;quot; functionality.&lt;br /&gt;
** wallpaper - Wallpapers.&lt;br /&gt;
** tmp - Temporary files (specific for both current host and current user)&lt;br /&gt;
** socket - UNIX Sockets (specific for both current host and current user)&lt;br /&gt;
** xdgconf-menu - Freedesktop.org standard location for menu layout (.menu) files.&lt;br /&gt;
** xdgdata-apps - Freedesktop.org standard location for application desktop files.&lt;br /&gt;
** xdgdata-dirs - Freedesktop.org standard location for menu descriptions (.directory files).&lt;br /&gt;
** xdgdata-mime - Freedesktop.org standard location for MIME type definitions.&lt;br /&gt;
** xdgdata-icon - Freedesktop.org standard location for icons.&lt;br /&gt;
** xdgdata-pixmap - Gnome-compatibility location for pixmaps.&lt;br /&gt;
&lt;br /&gt;
The second parameter should be a specific resource to find the path to. An example might be userDataPath(&amp;quot;data&amp;quot;, &amp;quot;plasma-desktop&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== NetworkIO === &lt;br /&gt;
This extensions allows access to network addresses.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''IOJob'' '''getUrl(Url url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''IOJob'' '''getUrl(String url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
&lt;br /&gt;
=== HTTP ===&lt;br /&gt;
This extension allows access to data and files via http and https.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''IOJob'' '''getUrl(Url url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''IOJob'' '''getUrl(String url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''bool'' '''openUrl([string|Url] url)''': (API v4) Opens the url in the default application (or asks the user if there is no default application for the file). The url parameter may be either a string or a Url. Returns true on success, false on failure.&lt;br /&gt;
&lt;br /&gt;
=== LaunchApp ===&lt;br /&gt;
&lt;br /&gt;
Adds methods to the global plasmoid object that allow launching applications, running commands and opening files and urls.&lt;br /&gt;
&lt;br /&gt;
* ''bool'' '''runApplication(string application[, array files])''' &amp;lt;br&amp;gt;Runs an application by name (can reference an installed .desktop file as well as an executable in the user's $PATH) with an optional array of files. The file array may contain either Urls or strings. Returns true on success, false on failure.&lt;br /&gt;
* ''bool'' '''runCommand(string exe[, array args])''' &amp;lt;br&amp;gt;Runs the executable with the given arguments. Returns true on success, false on failure.&lt;br /&gt;
* ''bool'' '''openUrl([string|Url] url)''': &amp;lt;br&amp;gt;Opens the url in the default application (or asks the user if there is no default application for the file). The url parameter may be either a string or a Url. Returns true on success, false on failure.&lt;br /&gt;
* ''boolean'' '''applicationExists(String name)''': (scripting version &amp;gt;= 4) searches $PATH first, then tries in the application menu system by application storage name (aka the .desktop file name), then Name= entries for apps with installed .desktop files, then GenericName= entries for same&lt;br /&gt;
* ''mixed'' '''defaultApplication(String kind [, boolean storageId = false])''': (scripting version &amp;gt;= 4) returns the executable (or if storageId is true, then the app menu system id, e.g. its .desktop file name) of the default app. The &amp;quot;kind&amp;quot; parameter may be a well-known application type including &amp;quot;browser&amp;quot;, &amp;quot;mailer&amp;quot;, &amp;quot;filemanager&amp;quot;, &amp;quot;terminal&amp;quot;, &amp;quot;imClient&amp;quot; and &amp;quot;windowmanager&amp;quot; (or any other entry in share/apps/kcm_componentchooser/kcm_*.desktop); it may also be a mimetype (e.g. &amp;quot;application/pdf&amp;quot;). On failure, it returns false.&lt;br /&gt;
* ''String'' '''applicationPath(String name)''':  (scripting version &amp;gt;= 4) returns the full local path to a given application or .desktop file if it exists.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Painting</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-Painting</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Painting"/>
				<updated>2011-06-24T12:00:47Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Pixmaps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Painting  =&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;[[../API-PlasmoidObject|Painting and Layout]]&amp;quot; section, part of the Global Plasmoid object chapter, for information on using these classes within a widget.&lt;br /&gt;
&lt;br /&gt;
= Pixmaps  =&lt;br /&gt;
&lt;br /&gt;
The QPixmap object allows widgets to use pixmaps for painting. Widgets may include pixmaps in various common formats (PNG, JPEG, GIF, etc.) in the contents/images/ directory of the Plasmoid package and load them by passing the name of the file into the pixmap constructor:&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
    var pixmap = new QPixmap(&amp;quot;myimage.png&amp;quot;)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
In addition to being used as a file load, some objects return or take pixmaps and the QPixmap object facilitates that as well. &lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''null''': true if the pixmap is empty&lt;br /&gt;
* ''QRectF'' '''rect''': the rect of the pixmap &lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QPixmap'' '''scaled(number width, number height): returns a scaled version of the pixmap with width and height dimensions.&lt;br /&gt;
&lt;br /&gt;
= Icons =&lt;br /&gt;
&lt;br /&gt;
(Since 4.4.1)&lt;br /&gt;
&lt;br /&gt;
The QIcon object provides simple access to icons. They can be constructed using a String or a QPixmap, with the String version either loading a file from disk if given an absolute path (useful for loading icons from the Plasmoid's package) or from the desktop icon theme if given just a name (e.g. &amp;quot;file-open&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''null''': true if the icon is empty&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''addPixmap(QPixmap)''': adds another pixmap to this icon&lt;br /&gt;
* '''addFile(String)''': adds another file to this icon&lt;br /&gt;
&lt;br /&gt;
= SVG Images  =&lt;br /&gt;
&lt;br /&gt;
Plasma makes heavy usage of SVG images. More information on this industry standard scalable vector format can be found here: &lt;br /&gt;
&lt;br /&gt;
:http://www.w3.org/Graphics/SVG/&lt;br /&gt;
&lt;br /&gt;
Free and Open Source Software tools for creating SVGs include Inkscape and Karbon13. Widgets may include their own SVG files in the contents/images/ directory or may use SVG images that are part of the standard Plasma Desktop Theme as documented here: &lt;br /&gt;
&lt;br /&gt;
:http://techbase.kde.org/Projects/Plasma/Theme&lt;br /&gt;
&lt;br /&gt;
Two classes are provide: Svg and FrameSvg. Svg allows loading and painting entire SVG documents or individual elements in an SVG document. FrameSvg extends Svg with methods to paint bordered frames from specially crafted SVG documents (see the Plasma Desktop Theme documentation for more information on this). &lt;br /&gt;
&lt;br /&gt;
==Svg==&lt;br /&gt;
Constructors:&lt;br /&gt;
*'''Svg(string fileName)'''': fileName can be a file in the desktop theme or the plasmoid package &lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
*''QSizeF'' '''size''': the current size of the svg&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''multipleImages''': whether or not the svg contains multiple separate images&lt;br /&gt;
* ''string'' '''imagePath''': the file path, including name of the svg&lt;br /&gt;
* ''boolean'' '''usingRenderingCache'': whether or not to cache rendered pixmaps; improves performance (at the cost of some disk and memory usage) for SVG data that is repeatedly rendered&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QSizeF'' elementSize(String svgElemen)'''&lt;br /&gt;
* ''QRectF'' elementRect(String svgElemen)'''&lt;br /&gt;
* ''boolean'' '''hasElement(String svgElement)''' &lt;br /&gt;
* '''elementAtPoint(QPoint pos)''' &lt;br /&gt;
* ''boolean'' '''isValid()'''&lt;br /&gt;
* ''QPixmap'' '''pixmap(String svgElement)''': a pixmap of the element in the svg rendered to the current size&lt;br /&gt;
* ''QPixmap'' '''pixmap()''': a pixmap of the entire svg rendered to the current size&lt;br /&gt;
* '''paint(QPainter painter, QPointF point)'''&lt;br /&gt;
* '''paint(QPainter painter, QPointF point, String svgElement)'''&lt;br /&gt;
* '''paint(QPainter painter, number x, number y)'''&lt;br /&gt;
* '''paint(QPainter painter, number x, number y, String svgElement)'''&lt;br /&gt;
* '''paint(QPainter painter, QRectF destination)'''&lt;br /&gt;
* '''paint(QPainter painter, QRectF destination, String svgElement)'''&lt;br /&gt;
* '''paint(QPainter painter, number y, number width, number height)'''&lt;br /&gt;
* '''paint(QPainter painter, number x, number y, number width, number height, QString svgElement)'''&lt;br /&gt;
* '''resize(number width, number height) &lt;br /&gt;
* '''resize(QSizeF size)'''&lt;br /&gt;
* '''resize()''': resizes the SVG to the document size defined in the SVG itself&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''repaintNeeded()''': emitted when the SVG is in need of a repaint, such as when the theme changes and the SVG has reloaded its data&lt;br /&gt;
&lt;br /&gt;
==FrameSvg==&lt;br /&gt;
Constructors:&lt;br /&gt;
* '''FrameSvg(String fileName)''': fileName can be a file in the desktop theme or the plasmoid package&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''multipleImages''': whether or not the svg contains multiple separate images&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setEnabledBorders(EnabledBorders borders)''': sets which borders are enabled when painting&lt;br /&gt;
* ''EnabledBorders'' '''enabledBorders()''': the borders which are enabled when painting&lt;br /&gt;
* '''resizeFrame(QSizeF size)''': resizes the frame to size&lt;br /&gt;
* ''QSizeF'' '''frameSize()''': the size of the current frame&lt;br /&gt;
* ''number'' '''marginSize(MarginEdge margin)''': the size of the margin for a given edge&lt;br /&gt;
* '''getMargins(number left, number top, number right, number bottom)''': stores the margin values in the variables passed in&lt;br /&gt;
* ''QRectF'' '''contentsRect()''': the rect containing the contents, e.g. the size of the SVG minus the space required by the enabled borders&lt;br /&gt;
* '''setElementPrefix(Location)''': sets the frame element for the given location if it exists&lt;br /&gt;
* '''setElementPrefix(String prefix)''': sets the element prefix&lt;br /&gt;
* ''boolean'' '''hasElementPrefix(String prefix)''': returns true if the SVG contains a frame with the given prefix&lt;br /&gt;
* ''boolean'' '''hasElementPrefix(Location location)''': true if the SVG contains a frame element for the given location&lt;br /&gt;
* '''prefix()'''&lt;br /&gt;
* '''mask()'''&lt;br /&gt;
* '''setCacheAllRenderedFrames(bool)'''&lt;br /&gt;
* '''cacheAllRenderedFrames()'''&lt;br /&gt;
* ''QPixmap'' '''framePixmap()''': a pixmap containing the current frame at the current size&lt;br /&gt;
* '''paintFrame(QPainter painter)'''&lt;br /&gt;
* '''paintFrame(QPainter painter, QPointF target)'''&lt;br /&gt;
* '''paintFrame(QPainter painter, QRectF target)'''&lt;br /&gt;
* '''paintFrame(QPainter painter, QRectF target, QRectF source)'''&lt;br /&gt;
&lt;br /&gt;
Enumerations&lt;br /&gt;
* '''EnabledBorder'''&lt;br /&gt;
** NoBorder&lt;br /&gt;
** TopBorder&lt;br /&gt;
** BottomBorder&lt;br /&gt;
** LeftBorder&lt;br /&gt;
** RightBorder&lt;br /&gt;
** AllBorders&lt;br /&gt;
&lt;br /&gt;
= Painting on the Canvas  =&lt;br /&gt;
&lt;br /&gt;
== QColor ==&lt;br /&gt;
&lt;br /&gt;
*Constructors: &lt;br /&gt;
** QColor &lt;br /&gt;
** QColor(string colorName) &lt;br /&gt;
** QColor(number red, number green, number blue, number alpha) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setThemeColor(ThemeColor color)''': sets the color to the appropriate ThemeColor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Read/write properties:&lt;br /&gt;
* ''number'' '''red'''&lt;br /&gt;
* ''number'' '''green'''&lt;br /&gt;
* ''number'' '''blue'''&lt;br /&gt;
* ''number'' '''alpha'''&lt;br /&gt;
* ''boolean'' '''valid'''&lt;br /&gt;
&lt;br /&gt;
== QFont ==&lt;br /&gt;
&lt;br /&gt;
*Constructors: &lt;br /&gt;
**QFont &lt;br /&gt;
**QFont(string fontName) &lt;br /&gt;
**QFont(string fontName, number pointSize) &lt;br /&gt;
**QFont(string fontName, number pointSize, number weight) &lt;br /&gt;
**QFont(string fontName, number pointSize, number weight, boolean italic) &lt;br /&gt;
*string key &lt;br /&gt;
*string lastResortFamily &lt;br /&gt;
*string lastResortFont &lt;br /&gt;
*string defaultFamily &lt;br /&gt;
*boolean exactMatch &lt;br /&gt;
*string toString &lt;br /&gt;
*boolean bold &lt;br /&gt;
*string family &lt;br /&gt;
*boolean fixedPitch &lt;br /&gt;
*undefined fromString &lt;br /&gt;
*boolean italic &lt;br /&gt;
*boolean kerning &lt;br /&gt;
*boolean overline &lt;br /&gt;
*number pixelSize &lt;br /&gt;
*number pointSize &lt;br /&gt;
*number pointSizeF &lt;br /&gt;
*boolean strikeOut &lt;br /&gt;
*number stretch &lt;br /&gt;
*boolean underline &lt;br /&gt;
*number weight &lt;br /&gt;
*function isCopyOf &lt;br /&gt;
*function resolve&lt;br /&gt;
&lt;br /&gt;
==QPainter ==&lt;br /&gt;
* Constructors&lt;br /&gt;
** QPainter&lt;br /&gt;
** QPainter(object paintDevice): used to start a painter on a specific QWidget; rarely if ever needed in a JavaScript Plasmoid&lt;br /&gt;
* object background&lt;br /&gt;
* number backgroundMode&lt;br /&gt;
* object brush&lt;br /&gt;
* undefined setBrush&lt;br /&gt;
* object brushOrigin&lt;br /&gt;
* undefined clipping&lt;br /&gt;
* object clipPath&lt;br /&gt;
* object clipRegion&lt;br /&gt;
* number compositionMode&lt;br /&gt;
* object font&lt;br /&gt;
* number layoutDirection&lt;br /&gt;
* number opacity&lt;br /&gt;
* object pen&lt;br /&gt;
* number renderHints&lt;br /&gt;
* undefined transform&lt;br /&gt;
* object viewport&lt;br /&gt;
* boolean viewTransformEnabled&lt;br /&gt;
* object window&lt;br /&gt;
* object worldMatrix&lt;br /&gt;
* object worldTransform&lt;br /&gt;
* boolean worldMatrixEnabled&lt;br /&gt;
* object combinedMatrix&lt;br /&gt;
* object combinedTransform&lt;br /&gt;
* boolean active&lt;br /&gt;
* function begin&lt;br /&gt;
* function end&lt;br /&gt;
* function boundingRect&lt;br /&gt;
* function drawChord&lt;br /&gt;
* function drawConvexPolygon&lt;br /&gt;
* function drawArc&lt;br /&gt;
* function drawEllipse&lt;br /&gt;
* function drawImage&lt;br /&gt;
* function drawLine&lt;br /&gt;
* function drawLines&lt;br /&gt;
* function drawPath&lt;br /&gt;
* function drawPicture&lt;br /&gt;
* function drawPie&lt;br /&gt;
* function drawPixmap&lt;br /&gt;
* function drawPoint&lt;br /&gt;
* function drawPoints&lt;br /&gt;
* function drawPolygon&lt;br /&gt;
* function drawPolyline&lt;br /&gt;
* function drawRect&lt;br /&gt;
* function drawRects&lt;br /&gt;
* function drawRoundRect&lt;br /&gt;
* function drawText&lt;br /&gt;
* function drawTiledPixmap&lt;br /&gt;
* function eraseRect&lt;br /&gt;
* function fillPath&lt;br /&gt;
* function fillRect&lt;br /&gt;
* function resetMatrix&lt;br /&gt;
* function resetTransform&lt;br /&gt;
* function restore&lt;br /&gt;
* function rotate&lt;br /&gt;
* function save&lt;br /&gt;
* function scale&lt;br /&gt;
* function setClipRect&lt;br /&gt;
* function setRenderHint&lt;br /&gt;
* function shear&lt;br /&gt;
* function strokePath&lt;br /&gt;
* function testRenderHint&lt;br /&gt;
* function toString&lt;br /&gt;
* function translate&lt;br /&gt;
&lt;br /&gt;
== QPen ==&lt;br /&gt;
*Constructors: &lt;br /&gt;
**QPen &lt;br /&gt;
* object brush&lt;br /&gt;
* object color&lt;br /&gt;
* number capStyle&lt;br /&gt;
* number joinStyle&lt;br /&gt;
* number style&lt;br /&gt;
* number dashOffset&lt;br /&gt;
* number miterLimit&lt;br /&gt;
* number width&lt;br /&gt;
* boolean solid&lt;br /&gt;
* number red&lt;br /&gt;
* number green&lt;br /&gt;
* number blue&lt;br /&gt;
* number alpha&lt;br /&gt;
* boolean valid&lt;br /&gt;
&lt;br /&gt;
== QRectF ==&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''empty''': true if the rectangle's width or height is less than, or equal to, 0; an empty rectangle is also invalid&lt;br /&gt;
* ''boolean'' '''null''': true if the rectangle has both the width and the height set to 0; a null rectangle is also empty and not valid&lt;br /&gt;
* ''boolean'' '''valid''':  true if the rectangle has a width &amp;gt; 0 and height 0.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''left'''&lt;br /&gt;
* ''number'' '''top'''&lt;br /&gt;
* ''number'' '''bottom''' &lt;br /&gt;
* ''number'' '''right'''&lt;br /&gt;
* ''number'' '''height'''&lt;br /&gt;
* ''number'' '''width'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
&lt;br /&gt;
Constructors: &lt;br /&gt;
* '''QRectF'''&lt;br /&gt;
* '''QRectF(number x, number y, number width, number height)''': Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''adjust(number dx1, number dy1, number dx2, number dy2)''': adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle&lt;br /&gt;
* ''QRectF'' '''adjusted(number dx1, number dy1, number dx2, number dy2)''': returns a new QRectF with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of the rectangle &lt;br /&gt;
* '''translate(number dx, number dy)''': translates the rect by dx, dy&lt;br /&gt;
* '''setCoords(number x1, number y1, number x2, number y2)''': sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).&lt;br /&gt;
* '''setRect(number x, number y, number width, number height)''': sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
* ''boolean'' '''contains(number x, number y)''': returns true if the rect contains the point (x, y)&lt;br /&gt;
* '''moveBottom(number delta)'': moves the bottom by delta pixels&lt;br /&gt;
* '''moveLeft(number delta)''': moves the left by delta pixels&lt;br /&gt;
* '''moveRight(number delta)''': moves the right by delta pixels&lt;br /&gt;
* '''moveTo(number x, number y)''': moves the top left of the rect to point (x, y)&lt;br /&gt;
* '''moveTop(number delta)''': moves the top by delta pixels&lt;br /&gt;
&lt;br /&gt;
== QSizeF ==&lt;br /&gt;
&lt;br /&gt;
*Constructors: &lt;br /&gt;
**QSizeF &lt;br /&gt;
**QSizeF(number width, number height) &lt;br /&gt;
*number height &lt;br /&gt;
*number width&lt;br /&gt;
&lt;br /&gt;
== QPoint ==&lt;br /&gt;
&lt;br /&gt;
Constructors: &lt;br /&gt;
* '''QPoint'''&lt;br /&gt;
* '''QPoint(number x, number y)'''&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''bool'' '''null''' &lt;br /&gt;
* ''number'' '''manhattanLength '''&lt;br /&gt;
&lt;br /&gt;
Read-write propertie:&lt;br /&gt;
* ''number'' '''x '''&lt;br /&gt;
* ''number'' '''y'''&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Painting</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-Painting</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Painting"/>
				<updated>2011-06-24T12:00:38Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Painting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Painting  =&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;[[../API-PlasmoidObject|Painting and Layout]]&amp;quot; section, part of the Global Plasmoid object chapter, for information on using these classes within a widget.&lt;br /&gt;
&lt;br /&gt;
= Pixmaps  =&lt;br /&gt;
&lt;br /&gt;
The QPixmap object allows widgets to use pixmaps for painting. Widgets may include pixmaps in various common formats (PNG, JPEG, GIF, etc.) in the contents/images/ directory of the Plasmoid package and load them by passing the name of the file into the pixmap constructor:&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
    var pixmap = new QPixmap(&amp;quot;myimage.png&amp;quot;)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
In addition to being used as a file load, some objects return or take pixmaps and the QPixmap object facilitates that as well. &lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''null''': true if the pixmap is empty&lt;br /&gt;
* ''QRectF'' '''rect''': the rect of the pixmap &lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QPixmap'' '''scaled(number width, number height);;: returns a scaled version of the pixmap with width and height dimensions.&lt;br /&gt;
&lt;br /&gt;
= Icons =&lt;br /&gt;
&lt;br /&gt;
(Since 4.4.1)&lt;br /&gt;
&lt;br /&gt;
The QIcon object provides simple access to icons. They can be constructed using a String or a QPixmap, with the String version either loading a file from disk if given an absolute path (useful for loading icons from the Plasmoid's package) or from the desktop icon theme if given just a name (e.g. &amp;quot;file-open&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''null''': true if the icon is empty&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''addPixmap(QPixmap)''': adds another pixmap to this icon&lt;br /&gt;
* '''addFile(String)''': adds another file to this icon&lt;br /&gt;
&lt;br /&gt;
= SVG Images  =&lt;br /&gt;
&lt;br /&gt;
Plasma makes heavy usage of SVG images. More information on this industry standard scalable vector format can be found here: &lt;br /&gt;
&lt;br /&gt;
:http://www.w3.org/Graphics/SVG/&lt;br /&gt;
&lt;br /&gt;
Free and Open Source Software tools for creating SVGs include Inkscape and Karbon13. Widgets may include their own SVG files in the contents/images/ directory or may use SVG images that are part of the standard Plasma Desktop Theme as documented here: &lt;br /&gt;
&lt;br /&gt;
:http://techbase.kde.org/Projects/Plasma/Theme&lt;br /&gt;
&lt;br /&gt;
Two classes are provide: Svg and FrameSvg. Svg allows loading and painting entire SVG documents or individual elements in an SVG document. FrameSvg extends Svg with methods to paint bordered frames from specially crafted SVG documents (see the Plasma Desktop Theme documentation for more information on this). &lt;br /&gt;
&lt;br /&gt;
==Svg==&lt;br /&gt;
Constructors:&lt;br /&gt;
*'''Svg(string fileName)'''': fileName can be a file in the desktop theme or the plasmoid package &lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
*''QSizeF'' '''size''': the current size of the svg&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''multipleImages''': whether or not the svg contains multiple separate images&lt;br /&gt;
* ''string'' '''imagePath''': the file path, including name of the svg&lt;br /&gt;
* ''boolean'' '''usingRenderingCache'': whether or not to cache rendered pixmaps; improves performance (at the cost of some disk and memory usage) for SVG data that is repeatedly rendered&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QSizeF'' elementSize(String svgElemen)'''&lt;br /&gt;
* ''QRectF'' elementRect(String svgElemen)'''&lt;br /&gt;
* ''boolean'' '''hasElement(String svgElement)''' &lt;br /&gt;
* '''elementAtPoint(QPoint pos)''' &lt;br /&gt;
* ''boolean'' '''isValid()'''&lt;br /&gt;
* ''QPixmap'' '''pixmap(String svgElement)''': a pixmap of the element in the svg rendered to the current size&lt;br /&gt;
* ''QPixmap'' '''pixmap()''': a pixmap of the entire svg rendered to the current size&lt;br /&gt;
* '''paint(QPainter painter, QPointF point)'''&lt;br /&gt;
* '''paint(QPainter painter, QPointF point, String svgElement)'''&lt;br /&gt;
* '''paint(QPainter painter, number x, number y)'''&lt;br /&gt;
* '''paint(QPainter painter, number x, number y, String svgElement)'''&lt;br /&gt;
* '''paint(QPainter painter, QRectF destination)'''&lt;br /&gt;
* '''paint(QPainter painter, QRectF destination, String svgElement)'''&lt;br /&gt;
* '''paint(QPainter painter, number y, number width, number height)'''&lt;br /&gt;
* '''paint(QPainter painter, number x, number y, number width, number height, QString svgElement)'''&lt;br /&gt;
* '''resize(number width, number height) &lt;br /&gt;
* '''resize(QSizeF size)'''&lt;br /&gt;
* '''resize()''': resizes the SVG to the document size defined in the SVG itself&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''repaintNeeded()''': emitted when the SVG is in need of a repaint, such as when the theme changes and the SVG has reloaded its data&lt;br /&gt;
&lt;br /&gt;
==FrameSvg==&lt;br /&gt;
Constructors:&lt;br /&gt;
* '''FrameSvg(String fileName)''': fileName can be a file in the desktop theme or the plasmoid package&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''multipleImages''': whether or not the svg contains multiple separate images&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setEnabledBorders(EnabledBorders borders)''': sets which borders are enabled when painting&lt;br /&gt;
* ''EnabledBorders'' '''enabledBorders()''': the borders which are enabled when painting&lt;br /&gt;
* '''resizeFrame(QSizeF size)''': resizes the frame to size&lt;br /&gt;
* ''QSizeF'' '''frameSize()''': the size of the current frame&lt;br /&gt;
* ''number'' '''marginSize(MarginEdge margin)''': the size of the margin for a given edge&lt;br /&gt;
* '''getMargins(number left, number top, number right, number bottom)''': stores the margin values in the variables passed in&lt;br /&gt;
* ''QRectF'' '''contentsRect()''': the rect containing the contents, e.g. the size of the SVG minus the space required by the enabled borders&lt;br /&gt;
* '''setElementPrefix(Location)''': sets the frame element for the given location if it exists&lt;br /&gt;
* '''setElementPrefix(String prefix)''': sets the element prefix&lt;br /&gt;
* ''boolean'' '''hasElementPrefix(String prefix)''': returns true if the SVG contains a frame with the given prefix&lt;br /&gt;
* ''boolean'' '''hasElementPrefix(Location location)''': true if the SVG contains a frame element for the given location&lt;br /&gt;
* '''prefix()'''&lt;br /&gt;
* '''mask()'''&lt;br /&gt;
* '''setCacheAllRenderedFrames(bool)'''&lt;br /&gt;
* '''cacheAllRenderedFrames()'''&lt;br /&gt;
* ''QPixmap'' '''framePixmap()''': a pixmap containing the current frame at the current size&lt;br /&gt;
* '''paintFrame(QPainter painter)'''&lt;br /&gt;
* '''paintFrame(QPainter painter, QPointF target)'''&lt;br /&gt;
* '''paintFrame(QPainter painter, QRectF target)'''&lt;br /&gt;
* '''paintFrame(QPainter painter, QRectF target, QRectF source)'''&lt;br /&gt;
&lt;br /&gt;
Enumerations&lt;br /&gt;
* '''EnabledBorder'''&lt;br /&gt;
** NoBorder&lt;br /&gt;
** TopBorder&lt;br /&gt;
** BottomBorder&lt;br /&gt;
** LeftBorder&lt;br /&gt;
** RightBorder&lt;br /&gt;
** AllBorders&lt;br /&gt;
&lt;br /&gt;
= Painting on the Canvas  =&lt;br /&gt;
&lt;br /&gt;
== QColor ==&lt;br /&gt;
&lt;br /&gt;
*Constructors: &lt;br /&gt;
** QColor &lt;br /&gt;
** QColor(string colorName) &lt;br /&gt;
** QColor(number red, number green, number blue, number alpha) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setThemeColor(ThemeColor color)''': sets the color to the appropriate ThemeColor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Read/write properties:&lt;br /&gt;
* ''number'' '''red'''&lt;br /&gt;
* ''number'' '''green'''&lt;br /&gt;
* ''number'' '''blue'''&lt;br /&gt;
* ''number'' '''alpha'''&lt;br /&gt;
* ''boolean'' '''valid'''&lt;br /&gt;
&lt;br /&gt;
== QFont ==&lt;br /&gt;
&lt;br /&gt;
*Constructors: &lt;br /&gt;
**QFont &lt;br /&gt;
**QFont(string fontName) &lt;br /&gt;
**QFont(string fontName, number pointSize) &lt;br /&gt;
**QFont(string fontName, number pointSize, number weight) &lt;br /&gt;
**QFont(string fontName, number pointSize, number weight, boolean italic) &lt;br /&gt;
*string key &lt;br /&gt;
*string lastResortFamily &lt;br /&gt;
*string lastResortFont &lt;br /&gt;
*string defaultFamily &lt;br /&gt;
*boolean exactMatch &lt;br /&gt;
*string toString &lt;br /&gt;
*boolean bold &lt;br /&gt;
*string family &lt;br /&gt;
*boolean fixedPitch &lt;br /&gt;
*undefined fromString &lt;br /&gt;
*boolean italic &lt;br /&gt;
*boolean kerning &lt;br /&gt;
*boolean overline &lt;br /&gt;
*number pixelSize &lt;br /&gt;
*number pointSize &lt;br /&gt;
*number pointSizeF &lt;br /&gt;
*boolean strikeOut &lt;br /&gt;
*number stretch &lt;br /&gt;
*boolean underline &lt;br /&gt;
*number weight &lt;br /&gt;
*function isCopyOf &lt;br /&gt;
*function resolve&lt;br /&gt;
&lt;br /&gt;
==QPainter ==&lt;br /&gt;
* Constructors&lt;br /&gt;
** QPainter&lt;br /&gt;
** QPainter(object paintDevice): used to start a painter on a specific QWidget; rarely if ever needed in a JavaScript Plasmoid&lt;br /&gt;
* object background&lt;br /&gt;
* number backgroundMode&lt;br /&gt;
* object brush&lt;br /&gt;
* undefined setBrush&lt;br /&gt;
* object brushOrigin&lt;br /&gt;
* undefined clipping&lt;br /&gt;
* object clipPath&lt;br /&gt;
* object clipRegion&lt;br /&gt;
* number compositionMode&lt;br /&gt;
* object font&lt;br /&gt;
* number layoutDirection&lt;br /&gt;
* number opacity&lt;br /&gt;
* object pen&lt;br /&gt;
* number renderHints&lt;br /&gt;
* undefined transform&lt;br /&gt;
* object viewport&lt;br /&gt;
* boolean viewTransformEnabled&lt;br /&gt;
* object window&lt;br /&gt;
* object worldMatrix&lt;br /&gt;
* object worldTransform&lt;br /&gt;
* boolean worldMatrixEnabled&lt;br /&gt;
* object combinedMatrix&lt;br /&gt;
* object combinedTransform&lt;br /&gt;
* boolean active&lt;br /&gt;
* function begin&lt;br /&gt;
* function end&lt;br /&gt;
* function boundingRect&lt;br /&gt;
* function drawChord&lt;br /&gt;
* function drawConvexPolygon&lt;br /&gt;
* function drawArc&lt;br /&gt;
* function drawEllipse&lt;br /&gt;
* function drawImage&lt;br /&gt;
* function drawLine&lt;br /&gt;
* function drawLines&lt;br /&gt;
* function drawPath&lt;br /&gt;
* function drawPicture&lt;br /&gt;
* function drawPie&lt;br /&gt;
* function drawPixmap&lt;br /&gt;
* function drawPoint&lt;br /&gt;
* function drawPoints&lt;br /&gt;
* function drawPolygon&lt;br /&gt;
* function drawPolyline&lt;br /&gt;
* function drawRect&lt;br /&gt;
* function drawRects&lt;br /&gt;
* function drawRoundRect&lt;br /&gt;
* function drawText&lt;br /&gt;
* function drawTiledPixmap&lt;br /&gt;
* function eraseRect&lt;br /&gt;
* function fillPath&lt;br /&gt;
* function fillRect&lt;br /&gt;
* function resetMatrix&lt;br /&gt;
* function resetTransform&lt;br /&gt;
* function restore&lt;br /&gt;
* function rotate&lt;br /&gt;
* function save&lt;br /&gt;
* function scale&lt;br /&gt;
* function setClipRect&lt;br /&gt;
* function setRenderHint&lt;br /&gt;
* function shear&lt;br /&gt;
* function strokePath&lt;br /&gt;
* function testRenderHint&lt;br /&gt;
* function toString&lt;br /&gt;
* function translate&lt;br /&gt;
&lt;br /&gt;
== QPen ==&lt;br /&gt;
*Constructors: &lt;br /&gt;
**QPen &lt;br /&gt;
* object brush&lt;br /&gt;
* object color&lt;br /&gt;
* number capStyle&lt;br /&gt;
* number joinStyle&lt;br /&gt;
* number style&lt;br /&gt;
* number dashOffset&lt;br /&gt;
* number miterLimit&lt;br /&gt;
* number width&lt;br /&gt;
* boolean solid&lt;br /&gt;
* number red&lt;br /&gt;
* number green&lt;br /&gt;
* number blue&lt;br /&gt;
* number alpha&lt;br /&gt;
* boolean valid&lt;br /&gt;
&lt;br /&gt;
== QRectF ==&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''empty''': true if the rectangle's width or height is less than, or equal to, 0; an empty rectangle is also invalid&lt;br /&gt;
* ''boolean'' '''null''': true if the rectangle has both the width and the height set to 0; a null rectangle is also empty and not valid&lt;br /&gt;
* ''boolean'' '''valid''':  true if the rectangle has a width &amp;gt; 0 and height 0.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''left'''&lt;br /&gt;
* ''number'' '''top'''&lt;br /&gt;
* ''number'' '''bottom''' &lt;br /&gt;
* ''number'' '''right'''&lt;br /&gt;
* ''number'' '''height'''&lt;br /&gt;
* ''number'' '''width'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
&lt;br /&gt;
Constructors: &lt;br /&gt;
* '''QRectF'''&lt;br /&gt;
* '''QRectF(number x, number y, number width, number height)''': Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''adjust(number dx1, number dy1, number dx2, number dy2)''': adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle&lt;br /&gt;
* ''QRectF'' '''adjusted(number dx1, number dy1, number dx2, number dy2)''': returns a new QRectF with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of the rectangle &lt;br /&gt;
* '''translate(number dx, number dy)''': translates the rect by dx, dy&lt;br /&gt;
* '''setCoords(number x1, number y1, number x2, number y2)''': sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).&lt;br /&gt;
* '''setRect(number x, number y, number width, number height)''': sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
* ''boolean'' '''contains(number x, number y)''': returns true if the rect contains the point (x, y)&lt;br /&gt;
* '''moveBottom(number delta)'': moves the bottom by delta pixels&lt;br /&gt;
* '''moveLeft(number delta)''': moves the left by delta pixels&lt;br /&gt;
* '''moveRight(number delta)''': moves the right by delta pixels&lt;br /&gt;
* '''moveTo(number x, number y)''': moves the top left of the rect to point (x, y)&lt;br /&gt;
* '''moveTop(number delta)''': moves the top by delta pixels&lt;br /&gt;
&lt;br /&gt;
== QSizeF ==&lt;br /&gt;
&lt;br /&gt;
*Constructors: &lt;br /&gt;
**QSizeF &lt;br /&gt;
**QSizeF(number width, number height) &lt;br /&gt;
*number height &lt;br /&gt;
*number width&lt;br /&gt;
&lt;br /&gt;
== QPoint ==&lt;br /&gt;
&lt;br /&gt;
Constructors: &lt;br /&gt;
* '''QPoint'''&lt;br /&gt;
* '''QPoint(number x, number y)'''&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''bool'' '''null''' &lt;br /&gt;
* ''number'' '''manhattanLength '''&lt;br /&gt;
&lt;br /&gt;
Read-write propertie:&lt;br /&gt;
* ''number'' '''x '''&lt;br /&gt;
* ''number'' '''y'''&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Painting</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-Painting</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Painting"/>
				<updated>2011-06-24T11:59:29Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with ' == Painting  ==  See the &amp;quot;Painting and Layout&amp;quot; section, part of the Global Plasmoid object chapter, for infor...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Painting  ==&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;[[Development/Tutorials/Plasma/JavaScript/API#Painting_and_Layout|Painting and Layout]]&amp;quot; section, part of the Global Plasmoid object chapter, for information on using these classes within a widget.&lt;br /&gt;
&lt;br /&gt;
= Pixmaps  =&lt;br /&gt;
&lt;br /&gt;
The QPixmap object allows widgets to use pixmaps for painting. Widgets may include pixmaps in various common formats (PNG, JPEG, GIF, etc.) in the contents/images/ directory of the Plasmoid package and load them by passing the name of the file into the pixmap constructor:&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
    var pixmap = new QPixmap(&amp;quot;myimage.png&amp;quot;)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
In addition to being used as a file load, some objects return or take pixmaps and the QPixmap object facilitates that as well. &lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''null''': true if the pixmap is empty&lt;br /&gt;
* ''QRectF'' '''rect''': the rect of the pixmap &lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QPixmap'' '''scaled(number width, number height);;: returns a scaled version of the pixmap with width and height dimensions.&lt;br /&gt;
&lt;br /&gt;
= Icons =&lt;br /&gt;
&lt;br /&gt;
(Since 4.4.1)&lt;br /&gt;
&lt;br /&gt;
The QIcon object provides simple access to icons. They can be constructed using a String or a QPixmap, with the String version either loading a file from disk if given an absolute path (useful for loading icons from the Plasmoid's package) or from the desktop icon theme if given just a name (e.g. &amp;quot;file-open&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''null''': true if the icon is empty&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''addPixmap(QPixmap)''': adds another pixmap to this icon&lt;br /&gt;
* '''addFile(String)''': adds another file to this icon&lt;br /&gt;
&lt;br /&gt;
= SVG Images  =&lt;br /&gt;
&lt;br /&gt;
Plasma makes heavy usage of SVG images. More information on this industry standard scalable vector format can be found here: &lt;br /&gt;
&lt;br /&gt;
:http://www.w3.org/Graphics/SVG/&lt;br /&gt;
&lt;br /&gt;
Free and Open Source Software tools for creating SVGs include Inkscape and Karbon13. Widgets may include their own SVG files in the contents/images/ directory or may use SVG images that are part of the standard Plasma Desktop Theme as documented here: &lt;br /&gt;
&lt;br /&gt;
:http://techbase.kde.org/Projects/Plasma/Theme&lt;br /&gt;
&lt;br /&gt;
Two classes are provide: Svg and FrameSvg. Svg allows loading and painting entire SVG documents or individual elements in an SVG document. FrameSvg extends Svg with methods to paint bordered frames from specially crafted SVG documents (see the Plasma Desktop Theme documentation for more information on this). &lt;br /&gt;
&lt;br /&gt;
==Svg==&lt;br /&gt;
Constructors:&lt;br /&gt;
*'''Svg(string fileName)'''': fileName can be a file in the desktop theme or the plasmoid package &lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
*''QSizeF'' '''size''': the current size of the svg&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''multipleImages''': whether or not the svg contains multiple separate images&lt;br /&gt;
* ''string'' '''imagePath''': the file path, including name of the svg&lt;br /&gt;
* ''boolean'' '''usingRenderingCache'': whether or not to cache rendered pixmaps; improves performance (at the cost of some disk and memory usage) for SVG data that is repeatedly rendered&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QSizeF'' elementSize(String svgElemen)'''&lt;br /&gt;
* ''QRectF'' elementRect(String svgElemen)'''&lt;br /&gt;
* ''boolean'' '''hasElement(String svgElement)''' &lt;br /&gt;
* '''elementAtPoint(QPoint pos)''' &lt;br /&gt;
* ''boolean'' '''isValid()'''&lt;br /&gt;
* ''QPixmap'' '''pixmap(String svgElement)''': a pixmap of the element in the svg rendered to the current size&lt;br /&gt;
* ''QPixmap'' '''pixmap()''': a pixmap of the entire svg rendered to the current size&lt;br /&gt;
* '''paint(QPainter painter, QPointF point)'''&lt;br /&gt;
* '''paint(QPainter painter, QPointF point, String svgElement)'''&lt;br /&gt;
* '''paint(QPainter painter, number x, number y)'''&lt;br /&gt;
* '''paint(QPainter painter, number x, number y, String svgElement)'''&lt;br /&gt;
* '''paint(QPainter painter, QRectF destination)'''&lt;br /&gt;
* '''paint(QPainter painter, QRectF destination, String svgElement)'''&lt;br /&gt;
* '''paint(QPainter painter, number y, number width, number height)'''&lt;br /&gt;
* '''paint(QPainter painter, number x, number y, number width, number height, QString svgElement)'''&lt;br /&gt;
* '''resize(number width, number height) &lt;br /&gt;
* '''resize(QSizeF size)'''&lt;br /&gt;
* '''resize()''': resizes the SVG to the document size defined in the SVG itself&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''repaintNeeded()''': emitted when the SVG is in need of a repaint, such as when the theme changes and the SVG has reloaded its data&lt;br /&gt;
&lt;br /&gt;
==FrameSvg==&lt;br /&gt;
Constructors:&lt;br /&gt;
* '''FrameSvg(String fileName)''': fileName can be a file in the desktop theme or the plasmoid package&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''multipleImages''': whether or not the svg contains multiple separate images&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setEnabledBorders(EnabledBorders borders)''': sets which borders are enabled when painting&lt;br /&gt;
* ''EnabledBorders'' '''enabledBorders()''': the borders which are enabled when painting&lt;br /&gt;
* '''resizeFrame(QSizeF size)''': resizes the frame to size&lt;br /&gt;
* ''QSizeF'' '''frameSize()''': the size of the current frame&lt;br /&gt;
* ''number'' '''marginSize(MarginEdge margin)''': the size of the margin for a given edge&lt;br /&gt;
* '''getMargins(number left, number top, number right, number bottom)''': stores the margin values in the variables passed in&lt;br /&gt;
* ''QRectF'' '''contentsRect()''': the rect containing the contents, e.g. the size of the SVG minus the space required by the enabled borders&lt;br /&gt;
* '''setElementPrefix(Location)''': sets the frame element for the given location if it exists&lt;br /&gt;
* '''setElementPrefix(String prefix)''': sets the element prefix&lt;br /&gt;
* ''boolean'' '''hasElementPrefix(String prefix)''': returns true if the SVG contains a frame with the given prefix&lt;br /&gt;
* ''boolean'' '''hasElementPrefix(Location location)''': true if the SVG contains a frame element for the given location&lt;br /&gt;
* '''prefix()'''&lt;br /&gt;
* '''mask()'''&lt;br /&gt;
* '''setCacheAllRenderedFrames(bool)'''&lt;br /&gt;
* '''cacheAllRenderedFrames()'''&lt;br /&gt;
* ''QPixmap'' '''framePixmap()''': a pixmap containing the current frame at the current size&lt;br /&gt;
* '''paintFrame(QPainter painter)'''&lt;br /&gt;
* '''paintFrame(QPainter painter, QPointF target)'''&lt;br /&gt;
* '''paintFrame(QPainter painter, QRectF target)'''&lt;br /&gt;
* '''paintFrame(QPainter painter, QRectF target, QRectF source)'''&lt;br /&gt;
&lt;br /&gt;
Enumerations&lt;br /&gt;
* '''EnabledBorder'''&lt;br /&gt;
** NoBorder&lt;br /&gt;
** TopBorder&lt;br /&gt;
** BottomBorder&lt;br /&gt;
** LeftBorder&lt;br /&gt;
** RightBorder&lt;br /&gt;
** AllBorders&lt;br /&gt;
&lt;br /&gt;
= Painting on the Canvas  =&lt;br /&gt;
&lt;br /&gt;
== QColor ==&lt;br /&gt;
&lt;br /&gt;
*Constructors: &lt;br /&gt;
** QColor &lt;br /&gt;
** QColor(string colorName) &lt;br /&gt;
** QColor(number red, number green, number blue, number alpha) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setThemeColor(ThemeColor color)''': sets the color to the appropriate ThemeColor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Read/write properties:&lt;br /&gt;
* ''number'' '''red'''&lt;br /&gt;
* ''number'' '''green'''&lt;br /&gt;
* ''number'' '''blue'''&lt;br /&gt;
* ''number'' '''alpha'''&lt;br /&gt;
* ''boolean'' '''valid'''&lt;br /&gt;
&lt;br /&gt;
== QFont ==&lt;br /&gt;
&lt;br /&gt;
*Constructors: &lt;br /&gt;
**QFont &lt;br /&gt;
**QFont(string fontName) &lt;br /&gt;
**QFont(string fontName, number pointSize) &lt;br /&gt;
**QFont(string fontName, number pointSize, number weight) &lt;br /&gt;
**QFont(string fontName, number pointSize, number weight, boolean italic) &lt;br /&gt;
*string key &lt;br /&gt;
*string lastResortFamily &lt;br /&gt;
*string lastResortFont &lt;br /&gt;
*string defaultFamily &lt;br /&gt;
*boolean exactMatch &lt;br /&gt;
*string toString &lt;br /&gt;
*boolean bold &lt;br /&gt;
*string family &lt;br /&gt;
*boolean fixedPitch &lt;br /&gt;
*undefined fromString &lt;br /&gt;
*boolean italic &lt;br /&gt;
*boolean kerning &lt;br /&gt;
*boolean overline &lt;br /&gt;
*number pixelSize &lt;br /&gt;
*number pointSize &lt;br /&gt;
*number pointSizeF &lt;br /&gt;
*boolean strikeOut &lt;br /&gt;
*number stretch &lt;br /&gt;
*boolean underline &lt;br /&gt;
*number weight &lt;br /&gt;
*function isCopyOf &lt;br /&gt;
*function resolve&lt;br /&gt;
&lt;br /&gt;
==QPainter ==&lt;br /&gt;
* Constructors&lt;br /&gt;
** QPainter&lt;br /&gt;
** QPainter(object paintDevice): used to start a painter on a specific QWidget; rarely if ever needed in a JavaScript Plasmoid&lt;br /&gt;
* object background&lt;br /&gt;
* number backgroundMode&lt;br /&gt;
* object brush&lt;br /&gt;
* undefined setBrush&lt;br /&gt;
* object brushOrigin&lt;br /&gt;
* undefined clipping&lt;br /&gt;
* object clipPath&lt;br /&gt;
* object clipRegion&lt;br /&gt;
* number compositionMode&lt;br /&gt;
* object font&lt;br /&gt;
* number layoutDirection&lt;br /&gt;
* number opacity&lt;br /&gt;
* object pen&lt;br /&gt;
* number renderHints&lt;br /&gt;
* undefined transform&lt;br /&gt;
* object viewport&lt;br /&gt;
* boolean viewTransformEnabled&lt;br /&gt;
* object window&lt;br /&gt;
* object worldMatrix&lt;br /&gt;
* object worldTransform&lt;br /&gt;
* boolean worldMatrixEnabled&lt;br /&gt;
* object combinedMatrix&lt;br /&gt;
* object combinedTransform&lt;br /&gt;
* boolean active&lt;br /&gt;
* function begin&lt;br /&gt;
* function end&lt;br /&gt;
* function boundingRect&lt;br /&gt;
* function drawChord&lt;br /&gt;
* function drawConvexPolygon&lt;br /&gt;
* function drawArc&lt;br /&gt;
* function drawEllipse&lt;br /&gt;
* function drawImage&lt;br /&gt;
* function drawLine&lt;br /&gt;
* function drawLines&lt;br /&gt;
* function drawPath&lt;br /&gt;
* function drawPicture&lt;br /&gt;
* function drawPie&lt;br /&gt;
* function drawPixmap&lt;br /&gt;
* function drawPoint&lt;br /&gt;
* function drawPoints&lt;br /&gt;
* function drawPolygon&lt;br /&gt;
* function drawPolyline&lt;br /&gt;
* function drawRect&lt;br /&gt;
* function drawRects&lt;br /&gt;
* function drawRoundRect&lt;br /&gt;
* function drawText&lt;br /&gt;
* function drawTiledPixmap&lt;br /&gt;
* function eraseRect&lt;br /&gt;
* function fillPath&lt;br /&gt;
* function fillRect&lt;br /&gt;
* function resetMatrix&lt;br /&gt;
* function resetTransform&lt;br /&gt;
* function restore&lt;br /&gt;
* function rotate&lt;br /&gt;
* function save&lt;br /&gt;
* function scale&lt;br /&gt;
* function setClipRect&lt;br /&gt;
* function setRenderHint&lt;br /&gt;
* function shear&lt;br /&gt;
* function strokePath&lt;br /&gt;
* function testRenderHint&lt;br /&gt;
* function toString&lt;br /&gt;
* function translate&lt;br /&gt;
&lt;br /&gt;
== QPen ==&lt;br /&gt;
*Constructors: &lt;br /&gt;
**QPen &lt;br /&gt;
* object brush&lt;br /&gt;
* object color&lt;br /&gt;
* number capStyle&lt;br /&gt;
* number joinStyle&lt;br /&gt;
* number style&lt;br /&gt;
* number dashOffset&lt;br /&gt;
* number miterLimit&lt;br /&gt;
* number width&lt;br /&gt;
* boolean solid&lt;br /&gt;
* number red&lt;br /&gt;
* number green&lt;br /&gt;
* number blue&lt;br /&gt;
* number alpha&lt;br /&gt;
* boolean valid&lt;br /&gt;
&lt;br /&gt;
== QRectF ==&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''empty''': true if the rectangle's width or height is less than, or equal to, 0; an empty rectangle is also invalid&lt;br /&gt;
* ''boolean'' '''null''': true if the rectangle has both the width and the height set to 0; a null rectangle is also empty and not valid&lt;br /&gt;
* ''boolean'' '''valid''':  true if the rectangle has a width &amp;gt; 0 and height 0.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''left'''&lt;br /&gt;
* ''number'' '''top'''&lt;br /&gt;
* ''number'' '''bottom''' &lt;br /&gt;
* ''number'' '''right'''&lt;br /&gt;
* ''number'' '''height'''&lt;br /&gt;
* ''number'' '''width'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
&lt;br /&gt;
Constructors: &lt;br /&gt;
* '''QRectF'''&lt;br /&gt;
* '''QRectF(number x, number y, number width, number height)''': Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''adjust(number dx1, number dy1, number dx2, number dy2)''': adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle&lt;br /&gt;
* ''QRectF'' '''adjusted(number dx1, number dy1, number dx2, number dy2)''': returns a new QRectF with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of the rectangle &lt;br /&gt;
* '''translate(number dx, number dy)''': translates the rect by dx, dy&lt;br /&gt;
* '''setCoords(number x1, number y1, number x2, number y2)''': sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).&lt;br /&gt;
* '''setRect(number x, number y, number width, number height)''': sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
* ''boolean'' '''contains(number x, number y)''': returns true if the rect contains the point (x, y)&lt;br /&gt;
* '''moveBottom(number delta)'': moves the bottom by delta pixels&lt;br /&gt;
* '''moveLeft(number delta)''': moves the left by delta pixels&lt;br /&gt;
* '''moveRight(number delta)''': moves the right by delta pixels&lt;br /&gt;
* '''moveTo(number x, number y)''': moves the top left of the rect to point (x, y)&lt;br /&gt;
* '''moveTop(number delta)''': moves the top by delta pixels&lt;br /&gt;
&lt;br /&gt;
== QSizeF ==&lt;br /&gt;
&lt;br /&gt;
*Constructors: &lt;br /&gt;
**QSizeF &lt;br /&gt;
**QSizeF(number width, number height) &lt;br /&gt;
*number height &lt;br /&gt;
*number width&lt;br /&gt;
&lt;br /&gt;
== QPoint ==&lt;br /&gt;
&lt;br /&gt;
Constructors: &lt;br /&gt;
* '''QPoint'''&lt;br /&gt;
* '''QPoint(number x, number y)'''&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''bool'' '''null''' &lt;br /&gt;
* ''number'' '''manhattanLength '''&lt;br /&gt;
&lt;br /&gt;
Read-write propertie:&lt;br /&gt;
* ''number'' '''x '''&lt;br /&gt;
* ''number'' '''y'''&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Animations</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-Animations</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Animations"/>
				<updated>2011-06-24T11:58:28Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with '== Animations ==  = Creating Animation Objects = An Animation object can be retrieved by calling the ''Animation'' '''animation(string type)''' function. The ''string'' correspon...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Animations ==&lt;br /&gt;
&lt;br /&gt;
= Creating Animation Objects =&lt;br /&gt;
An Animation object can be retrieved by calling the ''Animation'' '''animation(string type)''' function. The ''string'' corresponds to the type of animation, which are listed below.&lt;br /&gt;
&lt;br /&gt;
New Animation objects are associated with (and therefore will animate) the Plasmoid by default. By setting the widgetToAnimate property, however, it can be assigned to animate any QGraphicsWidget desired (e.g. Plasma widgets such as push buttons, sliders, etc) .&lt;br /&gt;
&lt;br /&gt;
= Enumerations =&lt;br /&gt;
All Animation objects have the following enumerations:&lt;br /&gt;
&lt;br /&gt;
== MovementDirection ==&lt;br /&gt;
* '''MoveUp'''&lt;br /&gt;
* '''MoveUpRight'''&lt;br /&gt;
* '''MoveRight'''&lt;br /&gt;
* '''MoveDownRight'''&lt;br /&gt;
* '''MoveDown'''&lt;br /&gt;
* '''MoveDownLeft'''&lt;br /&gt;
* '''MoveLeft'''&lt;br /&gt;
* '''MoveUpLeft'''&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
The reference point, relative to the target widget, for the animation.&lt;br /&gt;
* '''Center'''&lt;br /&gt;
* '''Up'''&lt;br /&gt;
* '''Down'''&lt;br /&gt;
* '''Left'''&lt;br /&gt;
* '''Right'''&lt;br /&gt;
&lt;br /&gt;
== State ==&lt;br /&gt;
* '''Paused'''&lt;br /&gt;
* '''Running'''&lt;br /&gt;
* '''Stopped'''&lt;br /&gt;
&lt;br /&gt;
= Common API =&lt;br /&gt;
With the exception of Pause and Property animations, all animations support the following read/write properties: &lt;br /&gt;
&lt;br /&gt;
* ''AnimationDirection'' '''direction''': the direction the animation should play: AnimationForward or AnimationBackward&lt;br /&gt;
* ''int'' '''duration''': length of the animation in ms.&lt;br /&gt;
* ''EasingCurveType'' '''easingCurveType''': The easing curve to use in the animation&lt;br /&gt;
* ''QGraphicsWidget'' '''targetWidget''': the QGraphicsWidget (e.g. a Plasma::Widget) that this animation should operate on&lt;br /&gt;
&lt;br /&gt;
= Animation Groups =&lt;br /&gt;
Animations may be put into groups for convenient sequential or parallel running. Sequential groups, where the animations run one after the other, are handled by the '''AnimationGroup''' class. Parallel aniations, where the animations run simultaneously, are handled the '''ParallelAnimationGroup''' class. &lt;br /&gt;
&lt;br /&gt;
Animations are added to a group by calling '''add(Animation)''' on the group object. Groups may also be added to other groups.&lt;br /&gt;
&lt;br /&gt;
= Custom Animations =&lt;br /&gt;
Custom animation types can be defined using Javascript files that are included as part of the Plasmoid's package in the {{path|contents/animations/}} directory. To learn how to create such animations and access them from your Plasmoid, visit the [[Development/Tutorials/Plasma/JavaScript/Animations|Javascript Animations tutorial]].&lt;br /&gt;
&lt;br /&gt;
= Standard Animation Types =&lt;br /&gt;
Below is a list of all current standard animation types and their particular read/write properties:&lt;br /&gt;
&lt;br /&gt;
== Fade ==&lt;br /&gt;
* ''number'' '''startOpacity''': the opacity, between 0 and 1, that the target widget starts at when the animation begins&lt;br /&gt;
* ''number'' '''targetOpacity''': the opacity, between 0 and 1, that the target widget will be at the end of the animation&lt;br /&gt;
&lt;br /&gt;
== Geometry ==&lt;br /&gt;
* ''QRectF'' '''startGeometry''': the geometry that the target widget should start with&lt;br /&gt;
* ''QRectF'' '''targetGeometry''': the geometry the target widget will have at the end of the animation&lt;br /&gt;
&lt;br /&gt;
== Grow ==&lt;br /&gt;
* ''number'' '''factor''': the factor by which the target widget will grow to by the end of the animation&lt;br /&gt;
&lt;br /&gt;
== Pause ==&lt;br /&gt;
* ''number'' '''duration''': the number of milliseconds to pause for&lt;br /&gt;
&lt;br /&gt;
== Property ==&lt;br /&gt;
Animates an object (must be a QObject internally, which includes all Plasma Widgets) by manipulating one of its properties. Property animations have the following read/write properties:&lt;br /&gt;
&lt;br /&gt;
* ''any'' '''startValue'''&lt;br /&gt;
* ''any'' '''endValue'''&lt;br /&gt;
* ''ByteArray'' '''propertyName'''&lt;br /&gt;
* ''QObject'' '''targetObject'''&lt;br /&gt;
* ''number'' '''duration'''&lt;br /&gt;
* ''EasingCurve'' '''easingCurve'''&lt;br /&gt;
&lt;br /&gt;
== Pulser == &lt;br /&gt;
* ''number'' '''targetScale''': the maximum scale of the pulse-shadow item, relative to the target widget&lt;br /&gt;
&lt;br /&gt;
== Rotate ==&lt;br /&gt;
* ''QtAxis'' '''axis''': the axis along which to rotate the item&lt;br /&gt;
* ''Reference'' '''reference''': the reference point around which to rotate the target widget&lt;br /&gt;
* ''number'' '''angle''': the number of degrees to rotate the item&lt;br /&gt;
&lt;br /&gt;
== RotateStacked ==&lt;br /&gt;
* ''MovementDirection'' '''movementDirection''': the direction to rotate the widgets in the stack around&lt;br /&gt;
* ''QGraphicsLayoutItem'' '''layout'''&lt;br /&gt;
* ''Reference'' '''reference''': the reference point around which to rotate the target widget&lt;br /&gt;
* ''QGraphicsWidget'' '''backingWidget''': the widget in the &amp;quot;back&amp;quot; to rotate to the front of the target widget&lt;br /&gt;
&lt;br /&gt;
== Slide == &lt;br /&gt;
* ''MovementDirection'' '''movementDirection''': the direction to slide the widget&lt;br /&gt;
* ''number'' '''distance''': the distance to slide the widget&lt;br /&gt;
&lt;br /&gt;
== Zoom ==&lt;br /&gt;
* ''number'' '''zoom''': the factor by which to zoom the target widget&lt;br /&gt;
&lt;br /&gt;
= QEasingCurve =&lt;br /&gt;
Used to set the progress shape of Animation objects, this class has the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''string'' '''toString'''&lt;br /&gt;
* ''number'' '''valueForProgress(number progress)''': returns effective progress for the easing curve at progress. While progress must be between 0 and 1, the returned effective progress can be outside those bounds.&lt;br /&gt;
&lt;br /&gt;
as well as the following read/write property:&lt;br /&gt;
&lt;br /&gt;
* ''EasingCurveType'' '''type''': the shape of this easing curve&lt;br /&gt;
&lt;br /&gt;
and the following enumeration:&lt;br /&gt;
&lt;br /&gt;
* '''EasingCurveType'''&lt;br /&gt;
** Linear&lt;br /&gt;
** InQuad&lt;br /&gt;
** OutQuad&lt;br /&gt;
** InOutQuad&lt;br /&gt;
** OutInQuad&lt;br /&gt;
** InCubic&lt;br /&gt;
** OutCubic&lt;br /&gt;
** InOutCubic&lt;br /&gt;
** OutInCubic&lt;br /&gt;
** InQuart&lt;br /&gt;
** OutQuart&lt;br /&gt;
** InOutQuart&lt;br /&gt;
** OutInQuart&lt;br /&gt;
** InQuint&lt;br /&gt;
** OutQuint&lt;br /&gt;
** InOutQuint&lt;br /&gt;
** OutInQuint&lt;br /&gt;
** InSize&lt;br /&gt;
** OutSine&lt;br /&gt;
** InOutSine&lt;br /&gt;
** OutInSine&lt;br /&gt;
** InExpo&lt;br /&gt;
** OutExpo&lt;br /&gt;
** InOutExpo&lt;br /&gt;
** OutInExpo&lt;br /&gt;
** InCirc&lt;br /&gt;
** OutCirc&lt;br /&gt;
** InOutCirc&lt;br /&gt;
** InOutCirc&lt;br /&gt;
** OutInCirc&lt;br /&gt;
** InElastic&lt;br /&gt;
** OutElastic&lt;br /&gt;
** InOutElastic&lt;br /&gt;
** OutInElastic&lt;br /&gt;
** InBack&lt;br /&gt;
** OutBack&lt;br /&gt;
** InOutBack&lt;br /&gt;
** OutInBack&lt;br /&gt;
** InBounc&lt;br /&gt;
** OutBounce&lt;br /&gt;
** InOutBounce&lt;br /&gt;
** OutInBounce&lt;br /&gt;
** InCurve&lt;br /&gt;
** OutCurve&lt;br /&gt;
** SineCurve&lt;br /&gt;
** CosineCurve&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-UIElements</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-UIElements</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-UIElements"/>
				<updated>2011-06-24T11:57:15Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with '= User Interface Elements =  The Plasma framework provides a set of standard user interface elements such as pushbuttons and checkboxes for use in Plasmoids, and these are availa...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= User Interface Elements =&lt;br /&gt;
&lt;br /&gt;
The Plasma framework provides a set of standard user interface elements such as pushbuttons and checkboxes for use in Plasmoids, and these are available from the Simplified Javascript API as well. These elements follow the Plasma style and other conventions so that widgets blend well both visually and functionally with other Plasma elements. &lt;br /&gt;
&lt;br /&gt;
Note that some UI elements have functions that are synonymous with a read-write property. In those cases, the function can serve as a slot and be connected to signals for easy setting of the property.&lt;br /&gt;
&lt;br /&gt;
= DataEngine-Aware UI Elements =&lt;br /&gt;
Some of the UI elements are able to accept data directly from DataEngines. These widgets will have a dataUpdated function and can be passed into the DataEngine::connectSource method successfully.&lt;br /&gt;
&lt;br /&gt;
DataEngine-aware UI elements include:&lt;br /&gt;
&lt;br /&gt;
* Label&lt;br /&gt;
* TextEdit&lt;br /&gt;
* Meter&lt;br /&gt;
&lt;br /&gt;
= Common Properties  =&lt;br /&gt;
&lt;br /&gt;
By default, all of the Plasma user interface elements have the following properties: &lt;br /&gt;
&lt;br /&gt;
* ''String'' '''objectName'''&lt;br /&gt;
* ''number'' '''opacity'''&lt;br /&gt;
* ''boolean'' '''enabled'''&lt;br /&gt;
* ''boolean'' '''visible'''&lt;br /&gt;
* ''QPointF'' '''pos'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
* ''number'' '''z'''&lt;br /&gt;
* ''number'' '''rotation'''&lt;br /&gt;
* ''number'' '''scale'''&lt;br /&gt;
* ''QPointF'' '''transformOriginPoint'''&lt;br /&gt;
* ''QPalette'' '''palette'''&lt;br /&gt;
* ''QFont'' '''font'''&lt;br /&gt;
* ''QSizeF'' '''size'''&lt;br /&gt;
* ''QtFocusPolicy'' '''focusPolicy'''&lt;br /&gt;
* ''QRectF'' '''geometry'''&lt;br /&gt;
&lt;br /&gt;
= Common Signals  =&lt;br /&gt;
&lt;br /&gt;
* '''opacityChanged()'''&lt;br /&gt;
* '''visibleChanged()'''&lt;br /&gt;
* '''enabledChanged()'''&lt;br /&gt;
* '''xChanged()'''&lt;br /&gt;
* '''yChanged()'''&lt;br /&gt;
* '''zChanged()'''&lt;br /&gt;
* '''rotationChanged()'''&lt;br /&gt;
* '''scaleChanged() '''&lt;br /&gt;
&lt;br /&gt;
= UI Element Gallery  =&lt;br /&gt;
&lt;br /&gt;
== CSS Styleable UI Elements ==&lt;br /&gt;
&lt;br /&gt;
Most UI Elements are able to have their appearance adjust using a CSS stylesheet. All of these elements have the following read/write property:&lt;br /&gt;
&lt;br /&gt;
*''String'' '''styleSheet''': A CSS stylesheet describing visual properties to apply to the widget; see [http://doc.trolltech.com/4.5/stylesheet.html the Qt Documentation for more information]&lt;br /&gt;
&lt;br /&gt;
=== CheckBox ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
* ''boolean'' '''checked'''&lt;br /&gt;
* '''toggled(bool)'''&lt;br /&gt;
&lt;br /&gt;
=== ComboBox ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''number'' '''count''': (API v 3) the number of items in the combobox&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text''': the text of the currently selected item in the combobox&lt;br /&gt;
* ''number'' currentIndex:  (API v 3) the index of the current item&lt;br /&gt;
&lt;br /&gt;
Funtions:&lt;br /&gt;
* '''clear()'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''activated(String)'''&lt;br /&gt;
* '''textChanged(String)'''&lt;br /&gt;
* '''currentIndexChanged(number)'''&lt;br /&gt;
&lt;br /&gt;
=== Frame ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''Shadow'' '''frameShadow'''&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
&lt;br /&gt;
Enumerations:&lt;br /&gt;
* '''Shadow'''&lt;br /&gt;
* '''Plain'''&lt;br /&gt;
* '''Raised'''&lt;br /&gt;
* '''Sunken'''&lt;br /&gt;
&lt;br /&gt;
=== GroupBox ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
&lt;br /&gt;
=== Label ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
* ''number'' '''alignment''' (see [[#QtAlignment]] for the valid values)&lt;br /&gt;
* ''boolean'' '''hasScaledContents'''&lt;br /&gt;
* ''boolean'' '''textIsSelectable''' (since 4.4.1)&lt;br /&gt;
* ''boolean'' '''wordWrap''' (API v2)&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''dataUpdated(String, Data)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''linkActivated(String)''': emitted when a link is clicked; includes the URL of link that is clicked; this is only available when textIsSelectable&lt;br /&gt;
* '''linkHovered(String)''': emitted when a link is hovered&lt;br /&gt;
&lt;br /&gt;
=== LineEdit ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''boolean'' '''clearButtonShown'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''editingFinished()'''&lt;br /&gt;
* '''returnPressed()'''&lt;br /&gt;
* '''textEdited(String)'''&lt;br /&gt;
* '''textChanged(String)'''&lt;br /&gt;
&lt;br /&gt;
=== PushButton ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
* ''QAction'' '''action'''&lt;br /&gt;
* ''QIcon'' '''icon'''&lt;br /&gt;
* ''boolean'' '''checkable'''&lt;br /&gt;
* ''boolean'' '''checked'''&lt;br /&gt;
* ''boolean'' '''down'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''pressed()'''&lt;br /&gt;
* '''released()'''&lt;br /&gt;
* '''clicked()'''&lt;br /&gt;
* '''toggled(bool)'''&lt;br /&gt;
&lt;br /&gt;
=== RadioButton ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
* ''boolean'' '''checked'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''toggled(bool)'''&lt;br /&gt;
&lt;br /&gt;
=== ScrollWidget ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''QGraphicsWidget'' '''widget'''&lt;br /&gt;
* ''number'' '''horizontalScrollBarPolicy'''&lt;br /&gt;
* ''number'' '''verticalScrollBarPolicy'''&lt;br /&gt;
* ''QPointF'' '''scrollPosition'''&lt;br /&gt;
* ''QSizeF'' '''contentsSize'''&lt;br /&gt;
* ''QRectF'' '''viewportGeometry'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''ensureRectVisible(QRectF)'''&lt;br /&gt;
* '''ensureItemVisible(QGraphicsItem)'''&lt;br /&gt;
* '''registerAsDragHandle(QGraphicsWidget)'''&lt;br /&gt;
* '''unregisterAsDragHandle(QGraphicsWidget)'''&lt;br /&gt;
&lt;br /&gt;
=== ScrollBar ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''singleStep'''&lt;br /&gt;
* ''number'' '''pageStep'''&lt;br /&gt;
* ''number'' '''value'''&lt;br /&gt;
* ''number'' '''minimum'''&lt;br /&gt;
* ''number'' '''maximum'''&lt;br /&gt;
* ''QtOrientation'' '''setOrientation'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setValue(number)'''&lt;br /&gt;
* '''setOrientation(QtOrientation)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''valueChanged(number)'''&lt;br /&gt;
&lt;br /&gt;
=== Slider ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''maximum'''&lt;br /&gt;
* ''number'' '''minimum'''&lt;br /&gt;
* ''number'' '''value'''&lt;br /&gt;
* ''number'' '''orientation'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''sliderMoved(number)'''&lt;br /&gt;
* '''valueChanged(number)'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setMaximum(number)'''&lt;br /&gt;
* '''setMinimum(number)'''&lt;br /&gt;
* '''setRange(number, number)'''&lt;br /&gt;
* '''setValue(number)'''&lt;br /&gt;
* '''setOrientation(QtOrientation)'''&lt;br /&gt;
&lt;br /&gt;
=== SpinBox ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''maximum'''&lt;br /&gt;
* ''number'' '''minimum'''&lt;br /&gt;
* ''number'' '''value'''&lt;br /&gt;
&lt;br /&gt;
Functins:&lt;br /&gt;
* '''setMaximum(number)'''&lt;br /&gt;
* '''setMinimum(number)'''&lt;br /&gt;
* '''setRange(number, number)'''&lt;br /&gt;
* '''setValue(number)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''sliderMoved(number)'''&lt;br /&gt;
* '''valueChanged(number)'''&lt;br /&gt;
* '''editingFinished()'''&lt;br /&gt;
&lt;br /&gt;
=== TabBar ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''currentIndex'''&lt;br /&gt;
* ''number'' '''count'''&lt;br /&gt;
* ''boolean'' '''tabBarShown'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setCurrentIndex(number)'''&lt;br /&gt;
* '''insertTab(number, QIcon,String,QGraphicsLayoutItem)'''&lt;br /&gt;
* '''insertTab(number, QIcon,String)'''&lt;br /&gt;
* '''insertTab(number, String,QGraphicsLayoutItem)'''&lt;br /&gt;
* '''insertTab(number, String)'''&lt;br /&gt;
* '''addTab(QIcon,String,QGraphicsLayoutItem)'''&lt;br /&gt;
* '''addTab(QIcon,String)'''&lt;br /&gt;
* '''addTab(String,QGraphicsLayoutItem)'''&lt;br /&gt;
* '''addTab(String)'''&lt;br /&gt;
* '''removeTab(number)'''&lt;br /&gt;
* '''takeTab(number)'''&lt;br /&gt;
* '''tabAt(number)'''&lt;br /&gt;
* '''setTabText(number, String)'''&lt;br /&gt;
* '''tabText(number)'''&lt;br /&gt;
* '''setTabIcon(number, QIcon)'''&lt;br /&gt;
* '''tabIcon(number)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''currentChanged(number)'''&lt;br /&gt;
&lt;br /&gt;
=== TextEdit ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''boolean'' '''readOnly'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''dataUpdated(String, Data)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''textChanged()'''&lt;br /&gt;
&lt;br /&gt;
=== ToolButton ===&lt;br /&gt;
:Read-write properties:&lt;br /&gt;
&lt;br /&gt;
* ''''QAction'' '''action''': the action associated with this '''ToolButton'''&lt;br /&gt;
* ''''boolean'' '''autoRaise''': whether or not the ToolButton should raise automatically when the user interacts with it'''&lt;br /&gt;
* ''''String'' '''image''': path to an icon or image (e.g. in the widget's Package) to show on the ToolButton&lt;br /&gt;
* ''''String'' '''text''': the text shown on the ToolButton&lt;br /&gt;
&lt;br /&gt;
API v2 adds:&lt;br /&gt;
* ''''boolean'' '''down''': whether or not the ToolButton is in the down position (since protocol version 2)&lt;br /&gt;
&lt;br /&gt;
:Signals:&lt;br /&gt;
* '''clicked()'''&lt;br /&gt;
* '''pressed()'''&lt;br /&gt;
* '''released()'''&lt;br /&gt;
&lt;br /&gt;
=== TreeView ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''QAbstractModel'' '''model'''&lt;br /&gt;
&lt;br /&gt;
=== VideoWidget ===&lt;br /&gt;
Read-writeproperties:&lt;br /&gt;
* ''String'' '''url'''&lt;br /&gt;
* ''number'' '''currentTime'''&lt;br /&gt;
* ''number'' '''totalTime'''&lt;br /&gt;
* ''number'' '''remainingTime'''&lt;br /&gt;
* ''Controls'' '''usedControls'''&lt;br /&gt;
* ''boolean'' '''controlsVisible'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''play()'''&lt;br /&gt;
* '''pause()'''&lt;br /&gt;
* '''stop()'''&lt;br /&gt;
* '''seek(number)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''tick(number)'''&lt;br /&gt;
* '''aboutToFinish()'''&lt;br /&gt;
* '''nextRequested()'''&lt;br /&gt;
* '''previousRequested()'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enumerations:&lt;br /&gt;
* Controls&lt;br /&gt;
** NoControls&lt;br /&gt;
** Play&lt;br /&gt;
** Pause&lt;br /&gt;
** Stop&lt;br /&gt;
** PlayPause&lt;br /&gt;
** Previous&lt;br /&gt;
** Next&lt;br /&gt;
** Progress&lt;br /&gt;
** Volume&lt;br /&gt;
** OpenFile&lt;br /&gt;
** DefaultControls&lt;br /&gt;
&lt;br /&gt;
== Other UI Elements ==&lt;br /&gt;
&lt;br /&gt;
=== BusyWidget ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''running'''&lt;br /&gt;
* ''String'' '''label'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''clicked()'''&lt;br /&gt;
&lt;br /&gt;
=== FlashingLabel ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''autohide'''&lt;br /&gt;
* ''QColor'' '''color'''&lt;br /&gt;
* ''number'' '''duration'''&lt;br /&gt;
&lt;br /&gt;
Functins:&lt;br /&gt;
* '''kill()'''&lt;br /&gt;
* '''fadeIn()'''&lt;br /&gt;
* '''fadeOut()'''&lt;br /&gt;
* '''flash(String, number, QTextOption)'''&lt;br /&gt;
* '''flash(String ,number)'''&lt;br /&gt;
* '''flash(String)'''&lt;br /&gt;
* '''flash(QPixmap, number, QtAlignment)'''&lt;br /&gt;
* '''flash(QPixmap, number)'''&lt;br /&gt;
* '''flash(QPixmap)'''&lt;br /&gt;
&lt;br /&gt;
=== GraphicsWidget (API v3) ===&lt;br /&gt;
This is just a plain element with no painting or other features. It is useful primarily as a place holder, especially to contain layouts for other elements.&lt;br /&gt;
&lt;br /&gt;
=== IconWidget ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''QSizeF'' '''iconSize''' - the actual size of the icon given the size of the IconWidget, space reserved (if any) for text displayed, etc.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''infoText'''&lt;br /&gt;
* ''QIcon'' '''icon'''&lt;br /&gt;
* ''QColor'' '''textBackgroundColor'''&lt;br /&gt;
* ''String'' '''svg'''&lt;br /&gt;
* ''QAction'' '''action'''&lt;br /&gt;
* ''QtOrientation'' '''orientation'''&lt;br /&gt;
* ''number'' '''numDisplayLines'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setPressed(boolean)'''&lt;br /&gt;
* '''setUnpressed()'''&lt;br /&gt;
* '''setIcon(String)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''pressed(bool)'''&lt;br /&gt;
* '''clicked()'''&lt;br /&gt;
* '''doubleClicked()'''&lt;br /&gt;
* '''activated()'''&lt;br /&gt;
* '''changed()'''&lt;br /&gt;
&lt;br /&gt;
=== ItemBackground ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''QRectF'' '''target'''&lt;br /&gt;
* ''QGraphicsItem'' '''targetItem'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''appearanceChanged()'''&lt;br /&gt;
* '''animationStep(qreal)'''&lt;br /&gt;
* '''targetReached(QRectF)'''&lt;br /&gt;
* '''targetItemReached(QGraphicsItem)'''&lt;br /&gt;
&lt;br /&gt;
=== Meter ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''minimum'''&lt;br /&gt;
* ''number'' '''maximum'''&lt;br /&gt;
* ''number'' '''value'''&lt;br /&gt;
* ''String'' '''svg'''&lt;br /&gt;
* ''MeterType'' '''meterType'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''dataUpdated(String, Data)'''&lt;br /&gt;
&lt;br /&gt;
Enumerations:&lt;br /&gt;
* '''MeterType'''&lt;br /&gt;
** BarMeterHorizontal&lt;br /&gt;
** BarMeterVertical&lt;br /&gt;
** AnalogMeter&lt;br /&gt;
&lt;br /&gt;
=== Separator ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''QtOrientation'' '''orientation'''&lt;br /&gt;
&lt;br /&gt;
=== SignalPlotter ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''title'''&lt;br /&gt;
* ''String'' '''unit'''&lt;br /&gt;
* ''boolean'' '''useAutoRange'''&lt;br /&gt;
* ''number'' '''horizontalScale'''&lt;br /&gt;
* ''boolean'' '''showVerticalLines'''&lt;br /&gt;
* ''QColor'' '''verticalLinesColor'''&lt;br /&gt;
* ''number'' '''verticalLinesDistance'''&lt;br /&gt;
* ''boolean'' '''verticalLinesScroll'''&lt;br /&gt;
* ''boolean'' '''showHorizontalLines'''&lt;br /&gt;
* ''QColor'' '''horizontalLinesColor'''&lt;br /&gt;
* ''QColor'' '''fontColor'''&lt;br /&gt;
* ''number'' '''horizontalLinesCount'''&lt;br /&gt;
* ''boolean'' '''showLabels'''&lt;br /&gt;
* ''boolean'' '''showTopBar'''&lt;br /&gt;
* ''QColor'' '''backgroundColor'''&lt;br /&gt;
* ''String'' '''svgBackground'''&lt;br /&gt;
* ''boolean'' '''thinFrame'''&lt;br /&gt;
* ''boolean'' '''stackPlots'''&lt;br /&gt;
&lt;br /&gt;
=== SvgWidget ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''Svg'' '''svg'''&lt;br /&gt;
* ''String'' '''elementID'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''clicked(QtMouseButton)'''&lt;br /&gt;
&lt;br /&gt;
=== WebView ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''QSizeF'' '''contentsSize'''&lt;br /&gt;
* ''QRectF'' '''viewportGeometry'''&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''Url'' '''url'''&lt;br /&gt;
* ''String'' '''html'''&lt;br /&gt;
* ''boolean'' '''dragToScroll'''&lt;br /&gt;
* ''QPointF'' '''scrollPosition'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''loadProgress(number)'''&lt;br /&gt;
* '''loadFinished(bool)'''&lt;br /&gt;
&lt;br /&gt;
= Layouts  =&lt;br /&gt;
&lt;br /&gt;
== LinearLayout ==&lt;br /&gt;
* ''number'' '''spacing'''&lt;br /&gt;
* ''QtOrientation'' '''orientation''' (''QtVertical'' or ''QtHorizontal'')&lt;br /&gt;
* ''function'' '''removeAt'''&lt;br /&gt;
* ''function'' '''addStretch'''&lt;br /&gt;
* ''function'' '''setStretchFactor'''&lt;br /&gt;
* ''function'' '''setAlignment'''&lt;br /&gt;
* ''function'' '''insertStretch'''&lt;br /&gt;
* ''function'' '''setItemSpacing'''&lt;br /&gt;
* ''function'' '''setContentsMargins'''&lt;br /&gt;
* ''function'' '''addItem'''&lt;br /&gt;
* ''function'' '''removeItem'''&lt;br /&gt;
* ''function'' '''insertItem'''&lt;br /&gt;
* ''function'' '''toString'''&lt;br /&gt;
* ''function'' '''activate''' (API v3)&lt;br /&gt;
&lt;br /&gt;
== AnchorLayout ==&lt;br /&gt;
* ''number'' '''horizontalSpacing'''&lt;br /&gt;
* ''number'' '''verticalSpacing'''&lt;br /&gt;
* ''function'' '''setSpacing'''&lt;br /&gt;
* ''function'' '''removeAt'''&lt;br /&gt;
* ''function'' '''addAnchor'''&lt;br /&gt;
* ''function'' '''anchor'''&lt;br /&gt;
* ''function'' '''addAnchors'''&lt;br /&gt;
* ''function'' '''addCornerAnchors'''&lt;br /&gt;
* ''function'' '''toString'''&lt;br /&gt;
* ''function'' '''activate''' (API v3)&lt;br /&gt;
&lt;br /&gt;
== GridLayout ==&lt;br /&gt;
* ''number '''horizontalSpacing'''&lt;br /&gt;
* ''number '''verticalSpacing'''&lt;br /&gt;
* ''function'' '''rowSpacing'''&lt;br /&gt;
* ''function'' '''setRowSpacing'''&lt;br /&gt;
* ''function'' '''columnSpacing'''&lt;br /&gt;
* ''function'' '''setColumnSpacing'''&lt;br /&gt;
* ''function'' '''rowMinimumHeight'''&lt;br /&gt;
* ''function'' '''setRowMinimumHeight'''&lt;br /&gt;
* ''function'' '''rowPreferredHeight'''&lt;br /&gt;
* ''function'' '''setRowPreferredHeight'''&lt;br /&gt;
* ''function'' '''rowMaximumHeight'''&lt;br /&gt;
* ''function'' '''setRowMaximumHeight'''&lt;br /&gt;
* ''function'' '''rowFixedHeight'''&lt;br /&gt;
* ''function'' '''setRowFixedHeight'''&lt;br /&gt;
* ''function'' '''columnMinimumWidth'''&lt;br /&gt;
* ''function'' '''setColumnMinimumWidth'''&lt;br /&gt;
* ''function'' '''columnPreferredWidth'''&lt;br /&gt;
* ''function'' '''setColumnPreferredWidth'''&lt;br /&gt;
* ''function'' '''columnMaximumWidth'''&lt;br /&gt;
* ''function'' '''setColumnMaximumWidth'''&lt;br /&gt;
* ''function'' '''columnFixedWidth'''&lt;br /&gt;
* ''function'' '''setColumnFixedWidth'''&lt;br /&gt;
* ''function'' '''remoteAt'''&lt;br /&gt;
* ''function'' '''setAlignment'''&lt;br /&gt;
* ''function'' '''setSpacing'''&lt;br /&gt;
* ''function'' '''setContentsMargins'''&lt;br /&gt;
* ''function'' '''addItem'''&lt;br /&gt;
* ''function'' '''toString'''&lt;br /&gt;
* ''function'' '''activate''' (API v3)&lt;br /&gt;
&lt;br /&gt;
= Undocumented Properties and Functions  =&lt;br /&gt;
&lt;br /&gt;
There are a handful of other undocumented properties and functions available to UI elements. These are not supported or guaranteed to exist in future versions however, and as such should not be used or relied upon.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Enumerations</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-Enumerations</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Enumerations"/>
				<updated>2011-06-24T11:54:08Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with '== Global Enumerations == In the global namespace are a set of useful enumerations that can be used with various classes in the Simplified Javascript Plasmoid API. These include:...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Global Enumerations ==&lt;br /&gt;
In the global namespace are a set of useful enumerations that can be used with various classes in the Simplified Javascript Plasmoid API. These include:&lt;br /&gt;
&lt;br /&gt;
= AspectRatioMode =&lt;br /&gt;
* '''IgnoreAspectRatio''': The Plasmoid can be freely resized &lt;br /&gt;
* '''KeepAspectRatio''': The Plasmoid keeps a fixed aspect ratio &lt;br /&gt;
* '''Square: The Plasmoid is always a square &lt;br /&gt;
* '''ConstrainedSquare''': The Plasmoid is no wider (in horizontal formfactors) or no higher (in vertical ones) than a square &lt;br /&gt;
* '''FixedSize''': The Plasmoid cannot be resized &lt;br /&gt;
&lt;br /&gt;
= FormFactor =&lt;br /&gt;
* '''Planar''': The Plasmoid lives in a plane and has two degrees of freedom to grow. Optimize for desktop, laptop or tablet usage: a high resolution screen 1-3 feet distant from the viewer.&lt;br /&gt;
* '''MediaCenter''': As with Plasmoid the applet lives in a but the interface should be optimized for medium-to-high resolution screens that 5-15 feet distant from the viewer. Sometimes referred to as a &amp;quot;ten foot interface&amp;quot;.&lt;br /&gt;
* '''Horizontal''': The Plasmoid is constrained vertically, but can expand horizontally.&lt;br /&gt;
* '''Vertical''': The Plasmoid is constrained horizontally, but can expand vertically.&lt;br /&gt;
&lt;br /&gt;
= Location =&lt;br /&gt;
* '''Floating''': Free floating. Neither geometry or z-ordering is described precisely by this value.&lt;br /&gt;
* '''Desktop''': On the planar desktop layer, extending across the full screen from edge to edge&lt;br /&gt;
* '''FullScreen'''&lt;br /&gt;
* '''TopEdge'''&lt;br /&gt;
* '''BottomEdge'''&lt;br /&gt;
* '''LeftEdge'''&lt;br /&gt;
* '''RightEdge'''&lt;br /&gt;
&lt;br /&gt;
= AnimationDirection =&lt;br /&gt;
* '''AnimationForward'''&lt;br /&gt;
* '''AnimationBackward'''&lt;br /&gt;
&lt;br /&gt;
= BackgroundHints =&lt;br /&gt;
* '''NoBackground'''&lt;br /&gt;
* '''StandardBackground'''&lt;br /&gt;
* '''TranslucentBackground'''&lt;br /&gt;
* '''DefaultBackground'''&lt;br /&gt;
&lt;br /&gt;
= QtAlignment =&lt;br /&gt;
* QtAlignLeft&lt;br /&gt;
* QtAlignRight&lt;br /&gt;
* QtAlignHCenter&lt;br /&gt;
* QtAlignJustify&lt;br /&gt;
* QtAlignTop&lt;br /&gt;
* QtAlignBottom&lt;br /&gt;
* QtAlignVCenter&lt;br /&gt;
&lt;br /&gt;
If you need to align something in the center (both horizontally and vertically) you can sum the constans.&lt;br /&gt;
&lt;br /&gt;
= QtAnchorPoint =&lt;br /&gt;
* QtAnchorLeft&lt;br /&gt;
* QtAnchorRight&lt;br /&gt;
* QtAnchorBottom&lt;br /&gt;
* QtAnchorTop&lt;br /&gt;
* QtAnchorHorizontalCenter&lt;br /&gt;
* QtAnchorVerticalCenter&lt;br /&gt;
&lt;br /&gt;
= QtCorner =&lt;br /&gt;
* QtTopLeftCorner&lt;br /&gt;
* QtTopRightCorner&lt;br /&gt;
* QtBottomLeftCorner&lt;br /&gt;
* QtBottomRightCorner&lt;br /&gt;
&lt;br /&gt;
= QtMouseButton =&lt;br /&gt;
* QtNoButton&lt;br /&gt;
* QtLeftButton&lt;br /&gt;
* QtRightButton&lt;br /&gt;
* QtMidButton&lt;br /&gt;
* QtXButton1&lt;br /&gt;
* QtXButton2&lt;br /&gt;
&lt;br /&gt;
= QtOrientation =&lt;br /&gt;
* QtHorizontal&lt;br /&gt;
* QtVertical&lt;br /&gt;
&lt;br /&gt;
= QtScrollBarPolicy =&lt;br /&gt;
* QtScrollBarAsNeeded&lt;br /&gt;
* QtScrollBarAlwaysOff&lt;br /&gt;
* QtScrollBarAlwaysOn&lt;br /&gt;
&lt;br /&gt;
= QtSizePolicy =&lt;br /&gt;
* QSizePolicyFixed&lt;br /&gt;
* QSizePolicyMinimum&lt;br /&gt;
* QSizePolicyMaximum&lt;br /&gt;
* QSizePolicyPreferred&lt;br /&gt;
* QSizePolicyExpanding&lt;br /&gt;
* QSizePolicyMinimumExpanding&lt;br /&gt;
* QSizePolicyIgnored&lt;br /&gt;
&lt;br /&gt;
= Theme Colors (API v3) =&lt;br /&gt;
* TextColor&lt;br /&gt;
* HighlightColor&lt;br /&gt;
* BackgroundColor&lt;br /&gt;
* ButtonTextColor&lt;br /&gt;
* ButtonBackgroundColor&lt;br /&gt;
* LinkColor&lt;br /&gt;
* VisitedLinkColor&lt;br /&gt;
&lt;br /&gt;
= Status =&lt;br /&gt;
* UnknownStatus The status is unknown&lt;br /&gt;
* PassiveStatus The Item is passive&lt;br /&gt;
* ActiveStatus The Item is active&lt;br /&gt;
* NeedsAttentionStatus The Item needs attention&lt;br /&gt;
* AcceptingInputStatus The Item is accepting input&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject"/>
				<updated>2011-06-24T11:52:47Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= The Global plasmoid Object =&lt;br /&gt;
There is a global object available to the Plasmoid called, appropriately, &amp;quot;plasmoid&amp;quot;. It has a number of useful properties (some of which are read only, but many of which are read/write), functions, constant values and callbacks. Each are enumerated below. &lt;br /&gt;
&lt;br /&gt;
= Callbacks  =&lt;br /&gt;
&lt;br /&gt;
See the section on Events above.&lt;br /&gt;
&lt;br /&gt;
There are some events that are generated by Plasma for the Plasmoid. These can often be caught by providing a function assigned to a specific name in the plasmoid object. For instance, to get notified of form factor changes, one would provide a formFactorChanged method as follows: &amp;lt;code javascript=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
plasmoid.formFactorChanged = function() { &lt;br /&gt;
&lt;br /&gt;
    print(&amp;quot;the form factor has changed to: &amp;quot; + plasmoid.formFactor())&lt;br /&gt;
&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following callbacks are used to notify the Plasmoid of changes in its running environment:&lt;br /&gt;
&lt;br /&gt;
* '''configChanged()'''&lt;br /&gt;
* '''currentActivityChanged()'''&lt;br /&gt;
* '''formFactorChanged()'''&lt;br /&gt;
* '''immutabilityChanged()'''&lt;br /&gt;
* '''locationChanged()'''&lt;br /&gt;
* '''sizeChanged()'''&lt;br /&gt;
&lt;br /&gt;
Other callbacks include:&lt;br /&gt;
* '''dataUpdated(String source, Map[String, Any] data)''': used to pass in DataEngine updates&lt;br /&gt;
* '''activate()''': called when the widget is activated by the user, e.g. by a keyboard shortcut. Useful for setting the focus on a specific input widget, for instance. (API v2)&lt;br /&gt;
* '''initExtenderItem(Extender extender)''': Called when an Extender should be set up. (API v2)&lt;br /&gt;
* '''popupEvent(boolean shown)''': called on PopupApplets when the popup is shown or hidden. (API v2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In API v2, all of these callbacks can also be used as events. So, for instance, instead of implementing plasmoid.popupEvent, one could also write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;plasmoid.addEventListener('popupEvent', function(shown) { print('shown? ' + shown) } )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would also suppress any calls to plasmoid.popupEvent.&lt;br /&gt;
&lt;br /&gt;
Further documentation on these callbacks can be found in the relevant sections below.&lt;br /&gt;
&lt;br /&gt;
= Environment  =&lt;br /&gt;
&lt;br /&gt;
A set of read-only properties (and in most cases notification functions) that tell the Plasmoid about its current environment: &lt;br /&gt;
&lt;br /&gt;
* '''apiVersion''': the integer version of the Simplified JavaScript API in the current execution environment; can be used to change behaviour or usage of functions depending on the version number.&lt;br /&gt;
&lt;br /&gt;
* '''formFactor''': one of Planar (e.g. on a desktop or in an application main view), Horizontal, Vertical or MediaCenter. When the form factor changes, the plasmoid.formFactorChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''size''': the size of the Plasmoid, expressed in QSizeF (explained below). when it changes, plasmoid.sizeChanged() will be called.&lt;br /&gt;
&lt;br /&gt;
* '''location''': one of Floating (no specific location), Desktop (on the application's main view are), FullScreen, LeftEdge, RightEdge, TopEdge or ButtomEdge. When the location changes, the plasmoid.locationChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''immutable''': this property is set to true when the Plasmoid is set to not be movable or otherwise changeable, and false otherwise. Configuration is still usually allowed in this state. When the immutability changes, the plasmoid.immutabilityChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''currentActivity''': the current contextual activity name. When the current activity changes, the plasmoid.currentActivityChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''shouldConserveResources''': true if the plasmoid should not be doing anything that would create too much draw on power, e.g. when on a device with low battery power it may be a good idea not to run a computationally expensive but optional animation&lt;br /&gt;
&lt;br /&gt;
* '''userConfiguring''': true if the user configuration interface is currently being displayed.&lt;br /&gt;
&lt;br /&gt;
= Properties  =&lt;br /&gt;
A set of read/write properties that allow the Plasmoid to set various visual or functional properties: &lt;br /&gt;
&lt;br /&gt;
* ''AspectRatioMode'' '''aspectRatioMode''': defines how to treat the aspect ratio of a Plasmoid when resizing it. See the [[#AspectRatioMode|AspectRatioMode]] documentation for values and their meaning. &lt;br /&gt;
&lt;br /&gt;
* ''BackgroundHints'' '''backgroundHints''': defines how the background of the widget is rendered. See the [[#BackgroundHints|BackgroundHints]] documentation for values and their meaning. &lt;br /&gt;
&lt;br /&gt;
* ''boolean'' '''busy''': set to true when the Plasmoid is currently processing or waiting for data and the user interface should be blocked while doing so; will generally show a full-Plasmoid animated overlay to denote business&lt;br /&gt;
&lt;br /&gt;
= Geometry  =&lt;br /&gt;
&lt;br /&gt;
Read Only Properties: &lt;br /&gt;
&lt;br /&gt;
* ''QRectF'' '''rect''': the current rect of the Plasmoid; note that the top left may be not be the origin point (0,0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* '''resize(width, height)'''&lt;br /&gt;
* '''setMinimumSize(width, height)'''&lt;br /&gt;
* '''setPreferredSize(width, height)'''&lt;br /&gt;
* '''setBackgroundHints(background)''' - use '''NoBackground''' as value if you want to remove the default plasmoid background box.&lt;br /&gt;
* '''popupIcon(QIcon(&amp;quot;some icon&amp;quot;))''' - set icon to show when the plasmoid is added to the taskbar. NOTE if the plasmoid is made in QML, you MUST specify a default size for the main Item. This size will be used for the plasmoid when added to the taskbar&lt;br /&gt;
&lt;br /&gt;
= Painting and Layout  =&lt;br /&gt;
&lt;br /&gt;
To paint directly on to the canvas, a widget may implement the paintInterface function in the plasmoid object: &lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
    plasmoid.paintInterface = function(painter) { /* painting code goes here*/ }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
See the Painting section below for information about helpful classes and functions that can be used when implementing a paintInterface function. &lt;br /&gt;
&lt;br /&gt;
Read/Write Properties: &lt;br /&gt;
&lt;br /&gt;
* ''Layout'' '''layout''': the QGraphicsLayout associated with the Plasmoid for laying out top level items; this property is read-write, though the property is not usually set as one can simply do &amp;quot;new LinearLayout&amp;quot; (or one of the other layout classes provided) and it will be automatically associated with the Plasmoid.&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* '''update()''': triggers a full repaint of the Plasmoid.&lt;br /&gt;
* '''update(QRectF rect)''' triggers a repaint of the rect area of the Plasmoid.&lt;br /&gt;
* '''failedToLaunch(bool failed[, string reason])''' sets the launch status of the Plasmoid; if set to true, the script will stop executing and the reason message, if any, will be displayed to the user.&lt;br /&gt;
&lt;br /&gt;
= Access To Packaged Files  =&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* ''string'' '''file(string type[, string fileName])''': returns the path to a file in the Plasmoid package of the given type, optionally with a file name to match, e.g. &amp;lt;code javascript&amp;gt;var path = plasmoid.file(&amp;quot;mainscript&amp;quot;)&amp;lt;/code&amp;gt; or &amp;lt;code javascript&amp;gt;var pm = new QPixmap(plasmoid.file(&amp;quot;images&amp;quot;, &amp;quot;mypixmap.png&amp;quot;))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''bool'' '''include(string filename)''': attempts to include the script defined from the package's code directory&lt;br /&gt;
&lt;br /&gt;
= Configuration Data  =&lt;br /&gt;
Configuration values can be defined using [[Development/Tutorials/Using_KConfig_XT|KConfig XT]] XML files in the {{path|contents/config/}} directory of the Plasmoid's package. The default file that is looked for and used is {{path|contents/config/main.xml}}.&lt;br /&gt;
&lt;br /&gt;
== Accessing Configuration Data  ==&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''activeConfig''': The current active configuration description. For instance, setting it to &amp;quot;foo&amp;quot; would cause the Plasmoid to try and reference the {{path|contents/config/foo.xml}} KConfigXT file. Setting this to an empty string will switch to the main.xml file.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''any'' '''readConfig(String key)''': reads the value from the configuration data for the given key as defined by the currently active configuration.&lt;br /&gt;
&lt;br /&gt;
* '''writeConfig(String key, any value) ''': writes a value to the configuration store under the given key&lt;br /&gt;
&lt;br /&gt;
== User Customization  ==&lt;br /&gt;
&lt;br /&gt;
User customization can be offered by providing a Qt Designer file called {{path|contents/ui/config.ui}} in the Plasmoid's package.&lt;br /&gt;
&lt;br /&gt;
Callbacks:&lt;br /&gt;
* '''configChanged()''': callback function called when the configuration is changed external to the Plasmoid, e.g. when the user changes settings in a configuration dialog.&lt;br /&gt;
&lt;br /&gt;
= Context menu =&lt;br /&gt;
&lt;br /&gt;
It's possible to add some items to the popup menu of the Plasmoid.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setAction(name, text, icon, shortcut)''': adds an item to the context menu with the given text and icon; you need to define '''plasmoid.action_&amp;lt;name&amp;gt;''' function, where &amp;lt;name&amp;gt; is the first argument for setAction call, and this function will be called each time user clicks the item&lt;br /&gt;
&lt;br /&gt;
* '''removeAction(name)''': removes the item&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-PlasmoidObject"/>
				<updated>2011-06-24T11:50:59Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with '== The Global plasmoid Object  ==  There is a global object available to the Plasmoid called, appropriately, &amp;quot;plasmoid&amp;quot;. It has a number of useful properties (some of which are r...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The Global plasmoid Object  ==&lt;br /&gt;
&lt;br /&gt;
There is a global object available to the Plasmoid called, appropriately, &amp;quot;plasmoid&amp;quot;. It has a number of useful properties (some of which are read only, but many of which are read/write), functions, constant values and callbacks. Each are enumerated below. &lt;br /&gt;
&lt;br /&gt;
=== Callbacks  ===&lt;br /&gt;
&lt;br /&gt;
See the section on Events above.&lt;br /&gt;
&lt;br /&gt;
There are some events that are generated by Plasma for the Plasmoid. These can often be caught by providing a function assigned to a specific name in the plasmoid object. For instance, to get notified of form factor changes, one would provide a formFactorChanged method as follows: &amp;lt;code javascript=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
plasmoid.formFactorChanged = function() { &lt;br /&gt;
&lt;br /&gt;
    print(&amp;quot;the form factor has changed to: &amp;quot; + plasmoid.formFactor())&lt;br /&gt;
&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following callbacks are used to notify the Plasmoid of changes in its running environment:&lt;br /&gt;
&lt;br /&gt;
* '''configChanged()'''&lt;br /&gt;
* '''currentActivityChanged()'''&lt;br /&gt;
* '''formFactorChanged()'''&lt;br /&gt;
* '''immutabilityChanged()'''&lt;br /&gt;
* '''locationChanged()'''&lt;br /&gt;
* '''sizeChanged()'''&lt;br /&gt;
&lt;br /&gt;
Other callbacks include:&lt;br /&gt;
* '''dataUpdated(String source, Map[String, Any] data)''': used to pass in DataEngine updates&lt;br /&gt;
* '''activate()''': called when the widget is activated by the user, e.g. by a keyboard shortcut. Useful for setting the focus on a specific input widget, for instance. (API v2)&lt;br /&gt;
* '''initExtenderItem(Extender extender)''': Called when an Extender should be set up. (API v2)&lt;br /&gt;
* '''popupEvent(boolean shown)''': called on PopupApplets when the popup is shown or hidden. (API v2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In API v2, all of these callbacks can also be used as events. So, for instance, instead of implementing plasmoid.popupEvent, one could also write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;plasmoid.addEventListener('popupEvent', function(shown) { print('shown? ' + shown) } )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would also suppress any calls to plasmoid.popupEvent.&lt;br /&gt;
&lt;br /&gt;
Further documentation on these callbacks can be found in the relevant sections below.&lt;br /&gt;
&lt;br /&gt;
=== Environment  ===&lt;br /&gt;
&lt;br /&gt;
A set of read-only properties (and in most cases notification functions) that tell the Plasmoid about its current environment: &lt;br /&gt;
&lt;br /&gt;
* '''apiVersion''': the integer version of the Simplified JavaScript API in the current execution environment; can be used to change behaviour or usage of functions depending on the version number.&lt;br /&gt;
&lt;br /&gt;
* '''formFactor''': one of Planar (e.g. on a desktop or in an application main view), Horizontal, Vertical or MediaCenter. When the form factor changes, the plasmoid.formFactorChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''size''': the size of the Plasmoid, expressed in QSizeF (explained below). when it changes, plasmoid.sizeChanged() will be called.&lt;br /&gt;
&lt;br /&gt;
* '''location''': one of Floating (no specific location), Desktop (on the application's main view are), FullScreen, LeftEdge, RightEdge, TopEdge or ButtomEdge. When the location changes, the plasmoid.locationChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''immutable''': this property is set to true when the Plasmoid is set to not be movable or otherwise changeable, and false otherwise. Configuration is still usually allowed in this state. When the immutability changes, the plasmoid.immutabilityChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''currentActivity''': the current contextual activity name. When the current activity changes, the plasmoid.currentActivityChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''shouldConserveResources''': true if the plasmoid should not be doing anything that would create too much draw on power, e.g. when on a device with low battery power it may be a good idea not to run a computationally expensive but optional animation&lt;br /&gt;
&lt;br /&gt;
* '''userConfiguring''': true if the user configuration interface is currently being displayed.&lt;br /&gt;
&lt;br /&gt;
=== Properties  ===&lt;br /&gt;
A set of read/write properties that allow the Plasmoid to set various visual or functional properties: &lt;br /&gt;
&lt;br /&gt;
* ''AspectRatioMode'' '''aspectRatioMode''': defines how to treat the aspect ratio of a Plasmoid when resizing it. See the [[#AspectRatioMode|AspectRatioMode]] documentation for values and their meaning. &lt;br /&gt;
&lt;br /&gt;
* ''BackgroundHints'' '''backgroundHints''': defines how the background of the widget is rendered. See the [[#BackgroundHints|BackgroundHints]] documentation for values and their meaning. &lt;br /&gt;
&lt;br /&gt;
* ''boolean'' '''busy''': set to true when the Plasmoid is currently processing or waiting for data and the user interface should be blocked while doing so; will generally show a full-Plasmoid animated overlay to denote business&lt;br /&gt;
&lt;br /&gt;
=== Geometry  ===&lt;br /&gt;
&lt;br /&gt;
Read Only Properties: &lt;br /&gt;
&lt;br /&gt;
* ''QRectF'' '''rect''': the current rect of the Plasmoid; note that the top left may be not be the origin point (0,0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* '''resize(width, height)'''&lt;br /&gt;
* '''setMinimumSize(width, height)'''&lt;br /&gt;
* '''setPreferredSize(width, height)'''&lt;br /&gt;
* '''setBackgroundHints(background)''' - use '''NoBackground''' as value if you want to remove the default plasmoid background box.&lt;br /&gt;
* '''popupIcon(QIcon(&amp;quot;some icon&amp;quot;))''' - set icon to show when the plasmoid is added to the taskbar. NOTE if the plasmoid is made in QML, you MUST specify a default size for the main Item. This size will be used for the plasmoid when added to the taskbar&lt;br /&gt;
&lt;br /&gt;
=== Painting and Layout  ===&lt;br /&gt;
&lt;br /&gt;
To paint directly on to the canvas, a widget may implement the paintInterface function in the plasmoid object: &lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
    plasmoid.paintInterface = function(painter) { /* painting code goes here*/ }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
See the Painting section below for information about helpful classes and functions that can be used when implementing a paintInterface function. &lt;br /&gt;
&lt;br /&gt;
Read/Write Properties: &lt;br /&gt;
&lt;br /&gt;
* ''Layout'' '''layout''': the QGraphicsLayout associated with the Plasmoid for laying out top level items; this property is read-write, though the property is not usually set as one can simply do &amp;quot;new LinearLayout&amp;quot; (or one of the other layout classes provided) and it will be automatically associated with the Plasmoid.&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* '''update()''': triggers a full repaint of the Plasmoid.&lt;br /&gt;
* '''update(QRectF rect)''' triggers a repaint of the rect area of the Plasmoid.&lt;br /&gt;
* '''failedToLaunch(bool failed[, string reason])''' sets the launch status of the Plasmoid; if set to true, the script will stop executing and the reason message, if any, will be displayed to the user.&lt;br /&gt;
&lt;br /&gt;
=== Access To Packaged Files  ===&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* ''string'' '''file(string type[, string fileName])''': returns the path to a file in the Plasmoid package of the given type, optionally with a file name to match, e.g. &amp;lt;code javascript&amp;gt;var path = plasmoid.file(&amp;quot;mainscript&amp;quot;)&amp;lt;/code&amp;gt; or &amp;lt;code javascript&amp;gt;var pm = new QPixmap(plasmoid.file(&amp;quot;images&amp;quot;, &amp;quot;mypixmap.png&amp;quot;))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''bool'' '''include(string filename)''': attempts to include the script defined from the package's code directory&lt;br /&gt;
&lt;br /&gt;
=== Configuration Data  ===&lt;br /&gt;
Configuration values can be defined using [[Development/Tutorials/Using_KConfig_XT|KConfig XT]] XML files in the {{path|contents/config/}} directory of the Plasmoid's package. The default file that is looked for and used is {{path|contents/config/main.xml}}.&lt;br /&gt;
&lt;br /&gt;
==== Accessing Configuration Data  ====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''activeConfig''': The current active configuration description. For instance, setting it to &amp;quot;foo&amp;quot; would cause the Plasmoid to try and reference the {{path|contents/config/foo.xml}} KConfigXT file. Setting this to an empty string will switch to the main.xml file.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''any'' '''readConfig(String key)''': reads the value from the configuration data for the given key as defined by the currently active configuration.&lt;br /&gt;
&lt;br /&gt;
* '''writeConfig(String key, any value) ''': writes a value to the configuration store under the given key&lt;br /&gt;
&lt;br /&gt;
==== User Customization  ====&lt;br /&gt;
&lt;br /&gt;
User customization can be offered by providing a Qt Designer file called {{path|contents/ui/config.ui}} in the Plasmoid's package.&lt;br /&gt;
&lt;br /&gt;
Callbacks:&lt;br /&gt;
* '''configChanged()''': callback function called when the configuration is changed external to the Plasmoid, e.g. when the user changes settings in a configuration dialog.&lt;br /&gt;
&lt;br /&gt;
=== Context menu ===&lt;br /&gt;
&lt;br /&gt;
It's possible to add some items to the popup menu of the Plasmoid.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setAction(name, text, icon, shortcut)''': adds an item to the context menu with the given text and icon; you need to define '''plasmoid.action_&amp;lt;name&amp;gt;''' function, where &amp;lt;name&amp;gt; is the first argument for setAction call, and this function will be called each time user clicks the item&lt;br /&gt;
&lt;br /&gt;
* '''removeAction(name)''': removes the item&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Events</id>
		<title>Development/Tutorials/Plasma/JavaScript/API-Events</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Events"/>
				<updated>2011-06-24T11:45:53Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: Created page with '= Events =  Starting in API v2, it is possible register functions as event handlers. To register an event handler, use:  * '''addEventListener(String event, Function listener)'''...'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Events =&lt;br /&gt;
&lt;br /&gt;
Starting in API v2, it is possible register functions as event handlers. To register an event handler, use:&lt;br /&gt;
&lt;br /&gt;
* '''addEventListener(String event, Function listener)'''&lt;br /&gt;
&lt;br /&gt;
The event parameter is the name of the event (see list at end of section for known events) and the handler parameter is the function that will be called whenever the event occurs. Event names are not case sensitive. An event object will be passed into the handler, and the type and behavior of that object is event specific.&lt;br /&gt;
&lt;br /&gt;
Any number of event handlers may be added to a given event, and one handler may be registered to any number of events. The order of execution of event handlers is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
To remove an event handler, use:&lt;br /&gt;
&lt;br /&gt;
* '''removeEventListener(String event, Function listener)'''&lt;br /&gt;
&lt;br /&gt;
The function passed in will no longer be called as a result of the event occurring. Any currently pending calls to the listener are still made, however.&lt;br /&gt;
&lt;br /&gt;
If an event handler is registered using addEventListener, then any callback in the global plasmoid object that may be related to the same event will be suppressed. For instance, if an event handler is registered using addEventListener for the paintInterface event, then plasmoid.paintInterface will not be called.&lt;br /&gt;
&lt;br /&gt;
= Input Events (API v2) =&lt;br /&gt;
&lt;br /&gt;
Following are the input events which are recognized on the Plasmoid along with the type of event object passed in to registered event listeners:&lt;br /&gt;
&lt;br /&gt;
* HoverEnter: HoverEvent Object&lt;br /&gt;
* HoverLeave: HoverEvent Object&lt;br /&gt;
* HoverMove: HoverEvent Object&lt;br /&gt;
* KeyPress: KeyEvent Object&lt;br /&gt;
* KeyRelease: KeyEvent Object&lt;br /&gt;
* MouseDoubleClick: MouseEvent Object&lt;br /&gt;
* MouseMove: MouseEvent Object&lt;br /&gt;
* MousePress: MouseEvent Object&lt;br /&gt;
* MouseRelease: MouseEvent Object&lt;br /&gt;
* Wheel: WheelEvent Object&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
// anonymous function as a listener on KeyPress&lt;br /&gt;
plasmoid.addEventListener('KeyPress', function(a) { print(a.key) })&lt;br /&gt;
&lt;br /&gt;
function output()&lt;br /&gt;
{&lt;br /&gt;
    print('Hover Event!')&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function hovered(event)&lt;br /&gt;
{&lt;br /&gt;
    plasmoid.busy = true&lt;br /&gt;
    plasmoid.removeEventListener('HoverEnter', output)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function unhovered(event)&lt;br /&gt;
{&lt;br /&gt;
    plasmoid.busy = false&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
plasmoid.addEventListener('HoverEnter', hovered)&lt;br /&gt;
plasmoid.addEventListener('HoverLeave', unhovered)&lt;br /&gt;
plasmoid.addEventListener('HoverEnter', output)&lt;br /&gt;
plasmoid.addEventListener('HoverLeave', output)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= HoverEvent (API v2) =&lt;br /&gt;
&lt;br /&gt;
= KeyEvent (API v2) =&lt;br /&gt;
&lt;br /&gt;
= MouseEvent (API v2) =&lt;br /&gt;
&lt;br /&gt;
= WheelEvent (API v2) =&lt;br /&gt;
&lt;br /&gt;
= Addon Events (API v3) =&lt;br /&gt;
&lt;br /&gt;
The following two events are used in conjuction with Addons. See the [[API-Addons|Addons documentation]] for more information on Addons.&lt;br /&gt;
&lt;br /&gt;
* addonCreated: Object addOn&lt;br /&gt;
* newAddonsAvailable&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/QML/API</id>
		<title>Development/Tutorials/Plasma/QML/API</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/QML/API"/>
				<updated>2011-06-22T07:58:48Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* ToolTip */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction to the Plasmoid QML Declarative API  =&lt;br /&gt;
&lt;br /&gt;
This document provides an overview/reference of the Declarative QML API for Plasmoids. It isn't a full binding to all of Qt or KDE's libraries, but a focused set of bindings designed to make writing Plasmoids fast and easy, while remaining powerful.&lt;br /&gt;
&lt;br /&gt;
The API in this documentation covers the API of the Plasma specific QML components, so only the Declarative part of the API.&lt;br /&gt;
&lt;br /&gt;
The QML ScriptEngine is bassed upon the Plasma JavaScript engine, making the API of the JavaScript part identical to the one of the JavaScript plasmoids engine.&lt;br /&gt;
To see the api of the global ''Plasmoid'' object, see the [http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API#The_Global_plasmoid_Object JavaScript API] documentation.&lt;br /&gt;
(TODO: the JavaScript api paged should probably be copied and stripped down the imperative bits not present there, it would make harder to update tough)&lt;br /&gt;
&lt;br /&gt;
== What Is a Declarative Plasmoid?  ==&lt;br /&gt;
&lt;br /&gt;
To denote that this Plasmoid is a Declarative widget, ensure that in the metadata.desktop file there is this line: &lt;br /&gt;
&lt;br /&gt;
X-Plasma-API=declarativeappletscript&lt;br /&gt;
&lt;br /&gt;
What follows is a description of the Plasma declarative classes instantiable from QML.&lt;br /&gt;
&lt;br /&gt;
= Main QML classes =&lt;br /&gt;
&lt;br /&gt;
== Data engines ==&lt;br /&gt;
While it's possible to fetch data from a Plasma DataEngine in the same way as the [http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API#DataEngine JavaScript API], however it is preferrable to use the following declarative classes:&lt;br /&gt;
&lt;br /&gt;
=== DataSource ===&lt;br /&gt;
DataSource is a receiver for a dataEngine and can be declared inside QML:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 import org.kde.plasma.core 0.1 as PlasmaCore&lt;br /&gt;
&lt;br /&gt;
 PlasmaCore.DataSource {&lt;br /&gt;
     id: dataSource&lt;br /&gt;
     engine: &amp;quot;time&amp;quot;&lt;br /&gt;
     connectedSources: [&amp;quot;Local&amp;quot;]&lt;br /&gt;
     interval: 500&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It has the following properties:&lt;br /&gt;
* bool '''valid''' (read only): true when the DataSource is successfully connected to a data engine&lt;br /&gt;
* int '''interval''': interval of polling of the dataengine, if 0 no polling will be executed&lt;br /&gt;
* string '''engine''': the plugin name of the dataengine to load&lt;br /&gt;
* Array(string) '''connectedSources''': all the sources of the dataengine we are connected to (and whose data will appear in the '''data''' property)&lt;br /&gt;
* Array(string) '''sources''' (read only): all the sources available from the dataengine&lt;br /&gt;
* variant map '''data''' (read only): It's the most important property, it's a map of all the data available from the dataengine: its structure will be as follows:&lt;br /&gt;
** each key of the map will be a source name, in '''connectedSources'''&lt;br /&gt;
** each value will be a variant hash, so an hash with strings as keys and any variant as value&lt;br /&gt;
** example: dataSource.data[&amp;quot;Local&amp;quot;][&amp;quot;Time&amp;quot;] indicates the '''Time''' key of the dataengine source called &amp;quot;Local&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It has the following methods:&lt;br /&gt;
* StringList keysForSource(String source): lists all the keys corresponding to a certain source: for instance in the &amp;quot;time&amp;quot; dataengine, for the &amp;quot;Local&amp;quot; source, keys will be:&lt;br /&gt;
** &amp;quot;Timezone Continent&amp;quot;&lt;br /&gt;
** &amp;quot;Offset&amp;quot;&lt;br /&gt;
** &amp;quot;Timezone&amp;quot;&lt;br /&gt;
** &amp;quot;Time&amp;quot;&lt;br /&gt;
** &amp;quot;Date&amp;quot;&lt;br /&gt;
** &amp;quot;Timezone City&amp;quot;&lt;br /&gt;
* Service serviceForSource(String source): returns a Plasma service that corresponds a given source: see the section about services for how to use it.&lt;br /&gt;
* void connectSource(String source): adds to '''connectedSources''' the new source&lt;br /&gt;
* void disconnectSource(String source): removes that source from '''connectedSources'''&lt;br /&gt;
&lt;br /&gt;
=== Service ===&lt;br /&gt;
Due to their imperative nature, Plasma Services are not instantiated as QML classes, but rather created out of a '''DataSource''' with the method '''serviceForSource''' and used in the JavaScript portions of the QML files.&lt;br /&gt;
This following example is a simplified version from the Now Playing QML widget in the kdeexamples git repository: &lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  var service = dataSource.serviceForSource(activeSource)&lt;br /&gt;
  var operation = service.operationDescription(&amp;quot;seek&amp;quot;)&lt;br /&gt;
  operation.seconds = 10&lt;br /&gt;
&lt;br /&gt;
  var job = service.startOperationCall(operation)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here dataSource is the id of a DataSource object, and activeSource is a source contained in one of its '''connectedSources'''.&lt;br /&gt;
The service provides an operation called &amp;quot;seek&amp;quot;, with a parameter called &amp;quot;seconds&amp;quot;, that can be written on it as a property of a JavaScript object.&lt;br /&gt;
&lt;br /&gt;
=== ServiceJob ===&lt;br /&gt;
If is necessary to monitor the result of a Service operation, it's possible to connect to the '''finished''' signal provided by the job return paramenter of the '''startOperationCall''' service method.&lt;br /&gt;
The '''finished''' signal has the same job as parameter, from which is possible to check the variant '''result''' property, to check the result.&lt;br /&gt;
&lt;br /&gt;
=== DataModel ===&lt;br /&gt;
Some data engines return as their data something that can be interpreted as a list of items, rather than simple key/value pairs.&lt;br /&gt;
QML provides some item views such as '''ListView''', '''GridView''' and '''Repeater'''.&lt;br /&gt;
The '''DataModel''' QML object can provide, based on a DataSource a model suitable for those QML item views.&lt;br /&gt;
&lt;br /&gt;
It has the following properties:&lt;br /&gt;
* DataSource '''dataSource''': the id of an existing (and connected) DataSource&lt;br /&gt;
* String '''sourceFilter''': it's a regular expression. If the DataSource is connected to more than one source, only inserts data from sources matching this filter expression in the model&lt;br /&gt;
* String '''keyRoleFilter''': it's a regular expression. Only data with keys that match this filter expression will be inserted in the model&lt;br /&gt;
* int '''count''' (read only): how many items are in the model&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 ListView {&lt;br /&gt;
   model: PlasmaCore.DataModel {&lt;br /&gt;
        dataSource: microblogSource&lt;br /&gt;
        keyRoleFilter: &amp;quot;[\\d]*&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    delegate: Text {&lt;br /&gt;
        text: title&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example, ''microblogSource'' is the id of a DataSource, and inserts in the model only entries that have a number as the key name (matched with [\\d]*, in this case tweets ids)&lt;br /&gt;
&lt;br /&gt;
Each item in the model will have the form of a variant hash: all the keys of the hash will be registered as model role names, in the example, &amp;quot;title&amp;quot; is a role of the model containing a string (also reachable with model[&amp;quot;title&amp;quot;]).&lt;br /&gt;
&lt;br /&gt;
A special reserved role will always be present: '''&amp;quot;DataEngineSource&amp;quot;''': it will contain the name of the data engine source that gave origin to this item.&lt;br /&gt;
&lt;br /&gt;
=== SortFilterModel ===&lt;br /&gt;
SortFilterModel is a proxy model for easy sorting and/or filtering of the items in a DataModel (or any other QAbstractItemModel subclass that has been registered in QML with setContextProperty from a C++ application)&lt;br /&gt;
Properties:&lt;br /&gt;
* model '''sourceModel'''&lt;br /&gt;
* String '''filterRegExp'''&lt;br /&gt;
* String '''filterRole'''&lt;br /&gt;
* String '''sortRole'''&lt;br /&gt;
* Qt::SortOrder '''sortOrder'''&lt;br /&gt;
* int '''count''' (read only)&lt;br /&gt;
&lt;br /&gt;
== Plasma Themes ==&lt;br /&gt;
&lt;br /&gt;
=== Theme ===&lt;br /&gt;
This class instantiable from QML provides access to the Plasma Theme colors and other facilities such as fonts.&lt;br /&gt;
It has the following properties:&lt;br /&gt;
* String '''themeName''' (read only)&lt;br /&gt;
* QFont '''font''' (read only)&lt;br /&gt;
* bool '''windowTranslucentEnabled''' (read only)&lt;br /&gt;
* Url '''homepage''' (read only)&lt;br /&gt;
* bool '''useGlobalSettings''' (read only)&lt;br /&gt;
* QString '''wallpaperPath''' (read only)&lt;br /&gt;
* color '''textColor''' (read only)&lt;br /&gt;
* color '''highlightColor''' (read only)&lt;br /&gt;
* color '''backgroundColor''' (read only)&lt;br /&gt;
* color '''buttonTextColor''' (read only)&lt;br /&gt;
* color '''buttonBackgroundColor''' (read only)&lt;br /&gt;
* color '''linkColor''' (read only)&lt;br /&gt;
* color visitedLinkColor''' (read only)&lt;br /&gt;
* color '''visitedLinkColor''' (read only)&lt;br /&gt;
* color '''buttonHoverColor''' (read only)&lt;br /&gt;
* color '''buttonFocusColor''' (read only)&lt;br /&gt;
* color '''viewTextColor''' (read only)&lt;br /&gt;
* color '''viewBackgroundColo''' (read only)r&lt;br /&gt;
* color '''viewHoverColor''' (read only)&lt;br /&gt;
* color '''viewFocusColor''' (read only)&lt;br /&gt;
* String '''styleSheet''' (read only)&lt;br /&gt;
&lt;br /&gt;
=== Svg ===&lt;br /&gt;
Declaring a Svg element instantiates a Plasma Svg instance. This class doesn't draw anything, for drawing, SvgItem is used.&lt;br /&gt;
Properties:&lt;br /&gt;
* QSize '''size'''&lt;br /&gt;
* bool '''multipleImages'''&lt;br /&gt;
* String '''imagePath'''&lt;br /&gt;
* bool '''usingRenderingCache'''&lt;br /&gt;
&lt;br /&gt;
Methods:&lt;br /&gt;
* QPixmap pixmap(QString elementID)&lt;br /&gt;
* void resize(qreal width, qreal height)&lt;br /&gt;
* void resize(): resets the image to its default dimension&lt;br /&gt;
* QSize elementSize(QString elementId)&lt;br /&gt;
* QRectF elementRect(QString elementId)&lt;br /&gt;
* bool hasElement(QString elementId)&lt;br /&gt;
* bool isValid(): true if valid svg file&lt;br /&gt;
&lt;br /&gt;
=== SvgItem ===&lt;br /&gt;
It's a graphical element that will actually paint a Svg instance.&lt;br /&gt;
Properties:&lt;br /&gt;
* String '''elementId''': what element to render. If null, the whole svg will be rendered&lt;br /&gt;
* Svg '''svg''': instance of the Svg class mentioned above&lt;br /&gt;
* QSizeF '''naturalSize''' (read only): default size of the Svg&lt;br /&gt;
* bool '''smooth''': paint with antialias (default false)&lt;br /&gt;
&lt;br /&gt;
=== FrameSvgItem ===&lt;br /&gt;
It's a graphical elenent that paints a Plasma::FrameSvg, so a ractangular image composed by 9 elements contained in a Svg file, useful for things like buttons and frames.&lt;br /&gt;
&lt;br /&gt;
Flags&lt;br /&gt;
* EnabledBorders: combination of TopBorder | BottomBorder | LeftBorder | RightBorder, NoBorder if no border of the frame is enabled&lt;br /&gt;
&lt;br /&gt;
Properties:&lt;br /&gt;
* String '''imagePath''': path of the file relative to the Plasma Theme, for instance &amp;quot;widgets/background&amp;quot;&lt;br /&gt;
* String '''prefix''': a FrameSvg can contain multiple frames, for instance a button contains &amp;quot;normal&amp;quot;, &amp;quot;raised&amp;quot; and &amp;quot;pressed&amp;quot;&lt;br /&gt;
* Margins '''margins''' (read only): the margins of the frame, see documentation below&lt;br /&gt;
* EnabledBorders '''enabledBorders''': what borders are enabled&lt;br /&gt;
&lt;br /&gt;
==== Margins ====&lt;br /&gt;
Properties:&lt;br /&gt;
* real '''left''' (read only)&lt;br /&gt;
* real '''top''' (read only)&lt;br /&gt;
* real '''right''' (read only)&lt;br /&gt;
* real '''bottom''' (read only)&lt;br /&gt;
&lt;br /&gt;
== Top Level windows ==&lt;br /&gt;
&lt;br /&gt;
=== Dialog ===&lt;br /&gt;
Dialog instantiates a Plasma::Dialog, it will be a Plasma themed top level window that can contain any QML component.&lt;br /&gt;
&lt;br /&gt;
Properties:&lt;br /&gt;
* Item mainItem: the Item contained in the Dialog, it can be any QML Item instance&lt;br /&gt;
* bool '''visible''': if the window (not the mainItem) is visible&lt;br /&gt;
* int '''x''': x position of the window in screen coordinates&lt;br /&gt;
* int '''y''': y position of the window in screen coordinates&lt;br /&gt;
* int '''width''' (read only): total width of the dialog, including margins&lt;br /&gt;
* int '''height''' (read only): total height of the dialog, including margins&lt;br /&gt;
* int '''windowFlags''': Qt window flags of the Dialog&lt;br /&gt;
* Margins '''margins''' (read only): margins of the Dialog&lt;br /&gt;
&lt;br /&gt;
Methods:&lt;br /&gt;
* QPoint popupPosition(Item item, Qt::Alignment alignment=Qt::AlignLeft): the suggested position for the Dialog if it has to be correctly placed as popup of the QML item passed as parameter.&lt;br /&gt;
* void setAttribute(Qt::WindowAttribute attribute, bool on): set an attribute for the dialog window&lt;br /&gt;
&lt;br /&gt;
==== Margins ====&lt;br /&gt;
Properties:&lt;br /&gt;
* real '''left''' (read only)&lt;br /&gt;
* real '''top''' (read only)&lt;br /&gt;
* real '''right''' (read only)&lt;br /&gt;
* real '''bottom''' (read only)&lt;br /&gt;
&lt;br /&gt;
=== ToolTip ===&lt;br /&gt;
Declaring a ToolTip instance makes it possible to use Plasma tooltips with any QML item.&lt;br /&gt;
&lt;br /&gt;
Properties:&lt;br /&gt;
* Item '''target''': the QML item we want to show a tooltip of&lt;br /&gt;
* String '''mainText'''&lt;br /&gt;
* String '''subText'''&lt;br /&gt;
* String '''image''': freedesktop compliant icon name as image of the tooltip&lt;br /&gt;
&lt;br /&gt;
= Plasma QtComponents (4.8) =&lt;br /&gt;
TODO&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/QML/GettingStarted</id>
		<title>Development/Tutorials/Plasma/QML/GettingStarted</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/QML/GettingStarted"/>
				<updated>2011-06-22T07:57:36Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* QML Basics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
&lt;br /&gt;
Writing a plasma applet in QML is very easy, in fact, with KDE 4.6 and Qt 4.7 it just works.&lt;br /&gt;
&lt;br /&gt;
== QML Basics ==&lt;br /&gt;
&lt;br /&gt;
It is recommended that you have read through the [http://doc.qt.nokia.com/4.7/qtquick.html Qt QML Tutorials], as there are quite a few and they are explained thoroughly. There is also a list of all [http://doc.qt.nokia.com/4.7/qdeclarativeelements.html standard QML elements].&lt;br /&gt;
&lt;br /&gt;
See the [https://projects.kde.org/projects/kde/kdeexamples KDE Examples] repository for more KDE-related helpful resources.&lt;br /&gt;
&lt;br /&gt;
=== Root Item ===&lt;br /&gt;
&lt;br /&gt;
The root item can be anything that inherits QGraphicsItem. For example, in this case it is QGraphicsWidget which is a plasmoid. It can also simply be an Item. I also noticed that PathView does not respond to mouse inputs automatically (so flicking doesn't work). Probably because events are being intercepted. So take note, it'll have to be e.g. an Item, for that case.&lt;br /&gt;
&lt;br /&gt;
=== Layouts ===&lt;br /&gt;
&lt;br /&gt;
==== Row and Column ====&lt;br /&gt;
&lt;br /&gt;
==== Anchors ====&lt;br /&gt;
Anchor layouts offer a nice way of grouping UI elements nicely together. The idea is that you connect edges or corners of one element to the edge or corner of another widget.&lt;br /&gt;
Some examples:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
import org.kde.plasma.core 0.1 as PlasmaCore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Item {&lt;br /&gt;
    width: 200&lt;br /&gt;
    heigt: 300&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Text {&lt;br /&gt;
        id: first&lt;br /&gt;
        text: i18n(&amp;quot;1st line&amp;quot;)&lt;br /&gt;
        anchors { top: parent.top;&lt;br /&gt;
                  left: parent.left;&lt;br /&gt;
                  right: parent.right;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    Text {&lt;br /&gt;
        id: second&lt;br /&gt;
        text: i18n(&amp;quot;2nd line&amp;quot;)&lt;br /&gt;
        anchors { top: first.bottom;&lt;br /&gt;
                  left: parent.left;&lt;br /&gt;
                  right: parent.right;&lt;br /&gt;
                  bottom: parent.bottom;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Buttons ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Animations ===&lt;br /&gt;
&lt;br /&gt;
== Package Structure ==&lt;br /&gt;
&lt;br /&gt;
You create a .desktop file and the .qml file. They have to be in the usual plasma package structure.&lt;br /&gt;
&lt;br /&gt;
plasmoid-qml/metadata.desktop&lt;br /&gt;
plasmoid-qml/contents/ui/main.qml&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;metadata.desktop&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Name=Hello QML&lt;br /&gt;
Comment=A hello world widget in QML&lt;br /&gt;
Icon=chronometer&lt;br /&gt;
&lt;br /&gt;
X-Plasma-API=declarativeappletscript&lt;br /&gt;
X-Plasma-MainScript=ui/main.qml&lt;br /&gt;
X-Plasma-DefaultSize=200,100&lt;br /&gt;
&lt;br /&gt;
X-KDE-PluginInfo-Author=Frederik Gladhorn&lt;br /&gt;
X-KDE-PluginInfo-Email=gladhorn@kde.org&lt;br /&gt;
X-KDE-PluginInfo-Website=http://plasma.kde.org/&lt;br /&gt;
X-KDE-PluginInfo-Category=Examples&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.hello-qml&lt;br /&gt;
X-KDE-PluginInfo-Version=0.0&lt;br /&gt;
&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
X-KDE-ServiceTypes=Plasma/Applet&lt;br /&gt;
Type=Service&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===  &amp;lt;tt&amp;gt;main.qml&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
&lt;br /&gt;
Text {&lt;br /&gt;
    text: &amp;quot;Hello world!&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
You can install your plasmoid:&lt;br /&gt;
plasmapkg --install plasmoid-qml&lt;br /&gt;
&lt;br /&gt;
== plasmoidviewer ==&lt;br /&gt;
You can run it in plasmoidviewer as usual:&lt;br /&gt;
plasmoidviewer plasmoid-qml&lt;br /&gt;
&lt;br /&gt;
== qmlviewer ==&lt;br /&gt;
It's possible to use Plasma specific imports in qml files loaded by qmlviewer:&lt;br /&gt;
&lt;br /&gt;
qmlviewer -I /usr/lib/kde4/imports/ plasmoid-qml/contents/qml/main.qml &lt;br /&gt;
&lt;br /&gt;
Where the -I is the path to the plasma plugin for qml. Try to look for the path of &lt;br /&gt;
/usr/lib/kde4/imports/org/kde/plasma/graphicswidgets/libgraphicswidgetsbindingsplugin.so&lt;br /&gt;
and use everything up to org of that path.&lt;br /&gt;
&lt;br /&gt;
Hovewer it's '''strongly discouraged''' to use qmlviewer to develop plasmoids, because some features won't be available there:&lt;br /&gt;
* localization with i18n()&lt;br /&gt;
* access to the global ''plasmoid'' object&lt;br /&gt;
* device specific qml files imported with plasmapackage:// urls&lt;br /&gt;
* bindings for qicons, KJobs, services and KConfig&lt;br /&gt;
&lt;br /&gt;
= Features only available in Plasma widgets =&lt;br /&gt;
In order to have a better integration with the KDE platform and to reach an higher degree of expressivity, the stock features of QML have been expanded with the following features, that strictly follow the Plasmoid JavaScript API:&lt;br /&gt;
&lt;br /&gt;
== Plasmoid object ==&lt;br /&gt;
Every QML plasmoid will have an object called ''plasmoid'', that will give access to the configuration, the formfactor, immutability and so on. It offers the same api as the object with the same name in the Javascript API.&lt;br /&gt;
&lt;br /&gt;
== Localization ==&lt;br /&gt;
It's possible to localize strings with the usual i18n(), i18nc(), i18np() global functions&lt;br /&gt;
&lt;br /&gt;
== Extra types ==&lt;br /&gt;
Some extra types are available from withing JavaScript, namely&lt;br /&gt;
&lt;br /&gt;
* KConfigGroup: it's an object with its cnfig keys readable and writable as properties&lt;br /&gt;
* QIcon: can be constructed with QIcon(&amp;quot;fdo name&amp;quot;) such as QIcon(&amp;quot;konqueror&amp;quot;)&lt;br /&gt;
* KJob&lt;br /&gt;
* Plasma Service api&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Plasma specific imports =&lt;br /&gt;
To use some Plasma specific features is necessary to use some particular QML imports.&lt;br /&gt;
&lt;br /&gt;
== Plasma Core ==&lt;br /&gt;
org.kde.plasma.core&lt;br /&gt;
This is the import that lets you access to the most important Plasma Core features.&lt;br /&gt;
&lt;br /&gt;
=== DataSource ===&lt;br /&gt;
Used to connect to a dataengine&lt;br /&gt;
&lt;br /&gt;
=== DataModel ===&lt;br /&gt;
Attaches to a DataSource, makes possible to use a dataengine as a model for a QML ListView, GridView, PathView and so on&lt;br /&gt;
&lt;br /&gt;
=== Svg ===&lt;br /&gt;
Loads a Plasma Svg, it's not the visual item&lt;br /&gt;
&lt;br /&gt;
=== SvgItem ===&lt;br /&gt;
Visual item that paints a Svg&lt;br /&gt;
&lt;br /&gt;
=== FrameSvg ===&lt;br /&gt;
Loads a Plasma FrameSvg, it's not the visual item.&lt;br /&gt;
&lt;br /&gt;
=== FrameSvgItem ===&lt;br /&gt;
Visual item that displays a Plasma FrameSvg&lt;br /&gt;
&lt;br /&gt;
== Extra Qt features ==&lt;br /&gt;
org.kde.qtextraimports&lt;br /&gt;
&lt;br /&gt;
* QPixmapItem&lt;br /&gt;
* QImageItem&lt;br /&gt;
* QIconItem&lt;br /&gt;
&lt;br /&gt;
== Plasma Widgets in QML ==&lt;br /&gt;
To use standard plasma widgets (e.g. Plasma::LineEdit, etc.), you simply add an import line for them.&lt;br /&gt;
All properties, signals and slots from ordinary Plasma widgets are available there.&lt;br /&gt;
Those widgets are provided as a transition tool, intended to be replaced by the Plasma version of QtComponents.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
import QtQuick 1.0&lt;br /&gt;
import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets&lt;br /&gt;
&lt;br /&gt;
Item {&lt;br /&gt;
    width: 64&lt;br /&gt;
    height: 64&lt;br /&gt;
    PlasmaWidgets.IconWidget {&lt;br /&gt;
        id: icon&lt;br /&gt;
        Component.onCompleted: setIcon(&amp;quot;flag-red&amp;quot;)&lt;br /&gt;
        anchors.centerIn: parent&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/DataEngine</id>
		<title>Development/Tutorials/Plasma/JavaScript/DataEngine</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/DataEngine"/>
				<updated>2011-06-09T10:18:04Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TutorialBrowser|&lt;br /&gt;
&lt;br /&gt;
series=JavaScript Plasmoids|&lt;br /&gt;
&lt;br /&gt;
name=Getting Data|&lt;br /&gt;
&lt;br /&gt;
pre=[[../GettingStarted|Getting Started: Creating and running your first plasmoid in JavaScript]]|&lt;br /&gt;
&lt;br /&gt;
next=[[../NowPlaying|Now Playing: Advanced DataEngine Usage Example]]|&lt;br /&gt;
&lt;br /&gt;
reading=[[../API|JavaScript Plasmoid API reference]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
Now that you've [[Development/Tutorials/Plasma/JavaScript/GettingStarted|seen how to create a JavaScript plasmoid]], we're going to move on to getting data into it.&lt;br /&gt;
&lt;br /&gt;
Plasma has a data abstraction mechanism called DataEngines. You can ask for a DataEngine by name, request a source from it (again, by name) and you get data back from it, either at fixed intervals or whenever it is updated by the DataEngine internally. The data is a map (which is the same as an object in JavaScript) of string keys to data.&lt;br /&gt;
&lt;br /&gt;
In this example, we'll get the local time from the time engine.&lt;br /&gt;
&lt;br /&gt;
== Connecting Engines to plasmoid.dataUpdated ==&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;tt&amp;gt;contents/code/main.js&amp;lt;/tt&amp;gt; will have the following content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
layout = new LinearLayout(plasmoid);&lt;br /&gt;
&lt;br /&gt;
label = new Label();&lt;br /&gt;
layout.addItem(label);&lt;br /&gt;
&lt;br /&gt;
plasmoid.dataUpdated = function(name, data) {&lt;br /&gt;
	label.text = data.Time;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
dataEngine(&amp;quot;time&amp;quot;).connectSource(&amp;quot;Local&amp;quot;, plasmoid, 500);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are two new things in this plasmoid.  We've implemented &amp;lt;tt&amp;gt;plasmoid.dataUpdated&amp;lt;/tt&amp;gt;, and connected a data engine source to it.&lt;br /&gt;
&lt;br /&gt;
If you connect a data engine source to &amp;lt;tt&amp;gt;object&amp;lt;/tt&amp;gt;, when there is an update for that source the method &amp;lt;tt&amp;gt;object.dataUpdated&amp;lt;/tt&amp;gt; is called with two arguments: the name of the source and a map containing the data provided by the source.&lt;br /&gt;
&lt;br /&gt;
In this case, &amp;lt;tt&amp;gt;plasmoid.dataUpdated&amp;lt;/tt&amp;gt; gets called with &amp;lt;tt&amp;gt;&amp;quot;Local&amp;quot;&amp;lt;/tt&amp;gt; as the first argument and the following object as the second argument (on my machine right now):&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    Timezone_Continent: 'Europe',&lt;br /&gt;
    Offset: 3600,&lt;br /&gt;
    Timezone: 'Europe/London',&lt;br /&gt;
    Time: new Date('Sun May 17 20:06:20 2009 GMT+0100'),&lt;br /&gt;
    Timezone_City: 'Guernsey'&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last line of the script does the actual connection.  We select the &amp;lt;tt&amp;gt;&amp;quot;time&amp;quot;&amp;lt;/tt&amp;gt; data engine and request the &amp;lt;tt&amp;gt;&amp;quot;Local&amp;quot;&amp;lt;/tt&amp;gt; source from it, which provide the local time.  We tell it to connect to the &amp;lt;tt&amp;gt;plasmoid&amp;lt;/tt&amp;gt; object and force an update every 500ms (every half a second).&lt;br /&gt;
&lt;br /&gt;
If we left off the last parameter to &amp;lt;tt&amp;gt;connectSource&amp;lt;/tt&amp;gt; (ie: didn't provide an update interval), then the source would be updated when there was new data available.  This doesn't make much sense for a clock, where the time is continually changing, so would actually get no updates at all if you did this.  However, there are other data engines (such as the &amp;quot;soliddevice&amp;quot; engine) where you only want to be notified when something changed, and in this case you would leave off the update interval.&lt;br /&gt;
&lt;br /&gt;
== Connecting Engines to Plasma Interface Elements ==&lt;br /&gt;
A number of Plasma interface elements support connecting DataEngines directly to them. These include:&lt;br /&gt;
&lt;br /&gt;
* Label&lt;br /&gt;
* Meter&lt;br /&gt;
* TextEdit&lt;br /&gt;
&lt;br /&gt;
With these widgets, one can simply direct the DataEngine to update the widget directly and it will attempt to display the data. So in our example we could also write it as:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
layout = new LinearLayout(plasmoid);&lt;br /&gt;
&lt;br /&gt;
label = new Label();&lt;br /&gt;
layout.addItem(label);&lt;br /&gt;
&lt;br /&gt;
dataEngine(&amp;quot;time&amp;quot;).connectSource(&amp;quot;Local&amp;quot;, label, 500);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While this is not as flexible as implementing &amp;lt;tt&amp;gt;plasmoid.dataUpdated&amp;lt;/tt&amp;gt;, it can be a useful technique.&lt;br /&gt;
&lt;br /&gt;
== Connecting Engines to Arbitrary Functions ==&lt;br /&gt;
&lt;br /&gt;
It is also possible to connect DataEngines to any Javascript function by passing it in as an argument to connectSource. The function can be &amp;quot;in-line&amp;quot; such as in this example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dataEngine(&amp;quot;time&amp;quot;).connectSource(&amp;quot;Local&amp;quot;, function(source, data) { print(source); } )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or reference a function elsewhere in the script as seen here:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;function printSourceName(source, data) { print(source); } &lt;br /&gt;
&lt;br /&gt;
dataEngine(&amp;quot;time&amp;quot;).connectSource(&amp;quot;Local&amp;quot;, printSourceName)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disconnecting Engines ==&lt;br /&gt;
&lt;br /&gt;
To disconnect a source, use the disconnectSource function from a DataEngine object. disconnectSource is symmetrical to connectSource and takes the name of the source and the target. The only difference is that disconnectSource does not take an optional time parameter as connectSource does.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dataEngine(&amp;quot;time&amp;quot;).connectSource(&amp;quot;Local&amp;quot;, plasmoid);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pro tip: plasmaengineexplorer ==&lt;br /&gt;
&lt;br /&gt;
To find out what engines are available and what sources they provide, run&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
plasmaengineexplorer&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can choose from any of the installed data engines and request a source, including setting an update interval.  Just remember that when you are reading the data in JavaScript, spaces in the keys provided by the sources are replaced by underscores.  So each source in the &amp;lt;tt&amp;gt;time&amp;lt;/tt&amp;gt; engine provides a &amp;quot;Timezone Continent&amp;quot; key, but in JavaScript you would access that as &amp;lt;tt&amp;gt;data.Timezone_Continent&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;data[&amp;quot;Timezone_Continent&amp;quot;]&amp;lt;/tt&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API</id>
		<title>Development/Tutorials/Plasma/JavaScript/API</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API"/>
				<updated>2011-05-27T09:39:36Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Extensions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction to the Plasmoid JavaScript API  =&lt;br /&gt;
&lt;br /&gt;
This document provides an overview/reference of the Simplified JavaScript API for Plasmoids. The &amp;quot;Simplified&amp;quot; refers to the fact that it isn't a full binding to all of Qt or KDE's libraries, but a highly focused set of bindings designed to make writing Plasmoids fast and easy, while remaining powerful.&lt;br /&gt;
&lt;br /&gt;
The API in this documentation covers the JavaScript API as it appears in the KDE Software Compilation as of version 4.4, unless otherwise noted. This API ships as part of the KDE Base Runtime package, so can be relied on being there by any application that is Powered By KDE.&lt;br /&gt;
&lt;br /&gt;
If you have not done so already, please read the [http://websvn.kde.org/trunk/KDE/kdebase/workspace/plasma/design/plasmoids &amp;quot;plasmoid&amp;quot; design document] first. &lt;br /&gt;
&lt;br /&gt;
== What Is A Simplified JavaScript Plasmoid?  ==&lt;br /&gt;
&lt;br /&gt;
This document describes the native Plasma API available to Simplified JavaScript Plasmoids. What makes them &amp;quot;Simplified&amp;quot; is that they do not have access to the entire C++ API in the Plasma, KDE and Qt libraries (let alone things lower in the API stack). This helps ensure that these Plasmoids are more likely to work properly between releases as changes in underlying API don't affect them as well as allowing Plasma to offer stronger security guarantees around them. &lt;br /&gt;
&lt;br /&gt;
To denote that this Plasmoid is a Simplified JavaScript widget, ensure that in the metadata.desktop file there is this line: &lt;br /&gt;
&lt;br /&gt;
X-Plasma-API=javascript &lt;br /&gt;
&lt;br /&gt;
What follows is a description of the runtime environment available to a Simplified JavaScript Plasmoid. &lt;br /&gt;
&lt;br /&gt;
== QtScript  ==&lt;br /&gt;
&lt;br /&gt;
The Simplified JavaScript API is powered by Qt's QtScript system which provides access to a full featured ECMA Script interpreter. If it works in ECMA Script, it will work in a Simplified JavaScript Plasmoid. As an interesting implementation note, QtScript uses the high performance ECMA Script interpreter from WebKit and shares this code with QtWebKit. &lt;br /&gt;
&lt;br /&gt;
On top of the ECMA Script language, QtScript provides Qt integration features. Probably the most useful one in this context is the use of signals and slots which is Qt's callback mechanism. Signals may be emitted in QtScript by calling the signal method in question, a signal can be connected to a slot by using the connect() method (and disconnected with disconnect()) and any function defined in the Plasmoid may be used as a slot. For example: &amp;lt;code javascript=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function onClick()&lt;br /&gt;
{&lt;br /&gt;
    print(&amp;quot;We got clicked!&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function onFirstClick()&lt;br /&gt;
{&lt;br /&gt;
    print(&amp;quot;First click!&amp;quot;)&lt;br /&gt;
    button.clicked.disconnect(onFirstClick)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
button = new PushButton&lt;br /&gt;
button.clicked.connect(onClick)&lt;br /&gt;
button.clicked.connect(onFirstClick)&lt;br /&gt;
button.clicked()&lt;br /&gt;
&amp;lt;/code&amp;gt; This will print out: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
We got clicked!&lt;br /&gt;
First click!&lt;br /&gt;
&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
on the console when the Plasmoid starts, and the &amp;quot;We got clicked!&amp;quot; again whenever the button is clicked by the user.&lt;br /&gt;
&lt;br /&gt;
The object that emitted the signal that caused a slot to be called can be retrieved using the ''QObject'' '''sender''' read-only property of the global '''plasmoid''' object.&lt;br /&gt;
&lt;br /&gt;
== Events (API v2) ==&lt;br /&gt;
&lt;br /&gt;
Starting in API v2, it is possible register functions as event handlers. To register an event handler, use:&lt;br /&gt;
&lt;br /&gt;
* '''addEventListener(String event, Function listener)'''&lt;br /&gt;
&lt;br /&gt;
The event parameter is the name of the event (see list at end of section for known events) and the handler parameter is the function that will be called whenever the event occurs. Event names are not case sensitive. An event object will be passed into the handler, and the type and behavior of that object is event specific.&lt;br /&gt;
&lt;br /&gt;
Any number of event handlers may be added to a given event, and one handler may be registered to any number of events. The order of execution of event handlers is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
To remove an event handler, use:&lt;br /&gt;
&lt;br /&gt;
* '''removeEventListener(String event, Function listener)'''&lt;br /&gt;
&lt;br /&gt;
The function passed in will no longer be called as a result of the event occurring. Any currently pending calls to the listener are still made, however.&lt;br /&gt;
&lt;br /&gt;
If an event handler is registered using addEventListener, then any callback in the global plasmoid object that may be related to the same event will be suppressed. For instance, if an event handler is registered using addEventListener for the paintInterface event, then plasmoid.paintInterface will not be called.&lt;br /&gt;
&lt;br /&gt;
=== Input Events (API v2) ===&lt;br /&gt;
&lt;br /&gt;
Following are the input events which are recognized on the Plasmoid along with the type of event object passed in to registered event listeners:&lt;br /&gt;
&lt;br /&gt;
* HoverEnter: HoverEvent Object&lt;br /&gt;
* HoverLeave: HoverEvent Object&lt;br /&gt;
* HoverMove: HoverEvent Object&lt;br /&gt;
* KeyPress: KeyEvent Object&lt;br /&gt;
* KeyRelease: KeyEvent Object&lt;br /&gt;
* MouseDoubleClick: MouseEvent Object&lt;br /&gt;
* MouseMove: MouseEvent Object&lt;br /&gt;
* MousePress: MouseEvent Object&lt;br /&gt;
* MouseRelease: MouseEvent Object&lt;br /&gt;
* Wheel: WheelEvent Object&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
// anonymous function as a listener on KeyPress&lt;br /&gt;
plasmoid.addEventListener('KeyPress', function(a) { print(a.key) })&lt;br /&gt;
&lt;br /&gt;
function output()&lt;br /&gt;
{&lt;br /&gt;
    print('Hover Event!')&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function hovered(event)&lt;br /&gt;
{&lt;br /&gt;
    plasmoid.busy = true&lt;br /&gt;
    plasmoid.removeEventListener('HoverEnter', output)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function unhovered(event)&lt;br /&gt;
{&lt;br /&gt;
    plasmoid.busy = false&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
plasmoid.addEventListener('HoverEnter', hovered)&lt;br /&gt;
plasmoid.addEventListener('HoverLeave', unhovered)&lt;br /&gt;
plasmoid.addEventListener('HoverEnter', output)&lt;br /&gt;
plasmoid.addEventListener('HoverLeave', output)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== HoverEvent (API v2) ====&lt;br /&gt;
&lt;br /&gt;
==== KeyEvent (API v2) ====&lt;br /&gt;
&lt;br /&gt;
==== MouseEvent (API v2) ====&lt;br /&gt;
&lt;br /&gt;
==== WheelEvent (API v2) ====&lt;br /&gt;
&lt;br /&gt;
=== Addon Events (API v3) ===&lt;br /&gt;
&lt;br /&gt;
The following two events are used in conjuction with Addons. See the Addons section for more information on Addons.&lt;br /&gt;
&lt;br /&gt;
* addonCreated: Object addOn&lt;br /&gt;
* newAddonsAvailable&lt;br /&gt;
&lt;br /&gt;
== The Global plasmoid Object  ==&lt;br /&gt;
&lt;br /&gt;
There is a global object available to the Plasmoid called, appropriately, &amp;quot;plasmoid&amp;quot;. It has a number of useful properties (some of which are read only, but many of which are read/write), functions, constant values and callbacks. Each are enumerated below. &lt;br /&gt;
&lt;br /&gt;
=== Callbacks  ===&lt;br /&gt;
&lt;br /&gt;
See the section on Events above.&lt;br /&gt;
&lt;br /&gt;
There are some events that are generated by Plasma for the Plasmoid. These can often be caught by providing a function assigned to a specific name in the plasmoid object. For instance, to get notified of form factor changes, one would provide a formFactorChanged method as follows: &amp;lt;code javascript=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
plasmoid.formFactorChanged = function() { &lt;br /&gt;
&lt;br /&gt;
    print(&amp;quot;the form factor has changed to: &amp;quot; + plasmoid.formFactor())&lt;br /&gt;
&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following callbacks are used to notify the Plasmoid of changes in its running environment:&lt;br /&gt;
&lt;br /&gt;
* '''configChanged()'''&lt;br /&gt;
* '''currentActivityChanged()'''&lt;br /&gt;
* '''formFactorChanged()'''&lt;br /&gt;
* '''immutabilityChanged()'''&lt;br /&gt;
* '''locationChanged()'''&lt;br /&gt;
* '''sizeChanged()'''&lt;br /&gt;
&lt;br /&gt;
Other callbacks include:&lt;br /&gt;
* '''dataUpdated(String source, Map[String, Any] data)''': used to pass in DataEngine updates&lt;br /&gt;
* '''activate()''': called when the widget is activated by the user, e.g. by a keyboard shortcut. Useful for setting the focus on a specific input widget, for instance. (API v2)&lt;br /&gt;
* '''initExtenderItem(Extender extender)''': Called when an Extender should be set up. (API v2)&lt;br /&gt;
* '''popupEvent(boolean shown)''': called on PopupApplets when the popup is shown or hidden. (API v2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In API v2, all of these callbacks can also be used as events. So, for instance, instead of implementing plasmoid.popupEvent, one could also write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;plasmoid.addEventListener('popupEvent', function(shown) { print('shown? ' + shown) } )&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would also suppress any calls to plasmoid.popupEvent.&lt;br /&gt;
&lt;br /&gt;
Further documentation on these callbacks can be found in the relevant sections below.&lt;br /&gt;
&lt;br /&gt;
=== Environment  ===&lt;br /&gt;
&lt;br /&gt;
A set of read-only properties (and in most cases notification functions) that tell the Plasmoid about its current environment: &lt;br /&gt;
&lt;br /&gt;
* '''apiVersion''': the integer version of the Simplified JavaScript API in the current execution environment; can be used to change behaviour or usage of functions depending on the version number.&lt;br /&gt;
&lt;br /&gt;
* '''formFactor''': one of Planar (e.g. on a desktop or in an application main view), Horizontal, Vertical or MediaCenter. When the form factor changes, the plasmoid.formFactorChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''size''': the size of the Plasmoid, expressed in QSizeF (explained below). when it changes, plasmoid.sizeChanged() will be called.&lt;br /&gt;
&lt;br /&gt;
* '''location''': one of Floating (no specific location), Desktop (on the application's main view are), FullScreen, LeftEdge, RightEdge, TopEdge or ButtomEdge. When the location changes, the plasmoid.locationChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''immutable''': this property is set to true when the Plasmoid is set to not be movable or otherwise changeable, and false otherwise. Configuration is still usually allowed in this state. When the immutability changes, the plasmoid.immutabilityChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''currentActivity''': the current contextual activity name. When the current activity changes, the plasmoid.currentActivityChanged function, if defined in the Plasmoid, is called.&lt;br /&gt;
&lt;br /&gt;
* '''shouldConserveResources''': true if the plasmoid should not be doing anything that would create too much draw on power, e.g. when on a device with low battery power it may be a good idea not to run a computationally expensive but optional animation&lt;br /&gt;
&lt;br /&gt;
* '''userConfiguring''': true if the user configuration interface is currently being displayed.&lt;br /&gt;
&lt;br /&gt;
=== Properties  ===&lt;br /&gt;
A set of read/write properties that allow the Plasmoid to set various visual or functional properties: &lt;br /&gt;
&lt;br /&gt;
* ''AspectRatioMode'' '''aspectRatioMode''': defines how to treat the aspect ratio of a Plasmoid when resizing it. See the [[#AspectRatioMode|AspectRatioMode]] documentation for values and their meaning. &lt;br /&gt;
&lt;br /&gt;
* ''BackgroundHints'' '''backgroundHints''': defines how the background of the widget is rendered. See the [[#BackgroundHints|BackgroundHints]] documentation for values and their meaning. &lt;br /&gt;
&lt;br /&gt;
* ''boolean'' '''busy''': set to true when the Plasmoid is currently processing or waiting for data and the user interface should be blocked while doing so; will generally show a full-Plasmoid animated overlay to denote business&lt;br /&gt;
&lt;br /&gt;
=== Geometry  ===&lt;br /&gt;
&lt;br /&gt;
Read Only Properties: &lt;br /&gt;
&lt;br /&gt;
* ''QRectF'' '''rect''': the current rect of the Plasmoid; note that the top left may be not be the origin point (0,0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* '''resize(width, height)'''&lt;br /&gt;
* '''setMinimumSize(width, height)'''&lt;br /&gt;
* '''setPreferredSize(width, height)'''&lt;br /&gt;
* '''setBackgroundHints(background)''' - use '''NoBackground''' as value if you want to remove the default plasmoid background box.&lt;br /&gt;
* '''popupIcon(QIcon(&amp;quot;some icon&amp;quot;))''' - set icon to show when the plasmoid is added to the taskbar. NOTE if the plasmoid is made in QML, you MUST specify a default size for the main Item. This size will be used for the plasmoid when added to the taskbar&lt;br /&gt;
&lt;br /&gt;
=== Painting and Layout  ===&lt;br /&gt;
&lt;br /&gt;
To paint directly on to the canvas, a widget may implement the paintInterface function in the plasmoid object: &lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
    plasmoid.paintInterface = function(painter) { /* painting code goes here*/ }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
See the Painting section below for information about helpful classes and functions that can be used when implementing a paintInterface function. &lt;br /&gt;
&lt;br /&gt;
Read/Write Properties: &lt;br /&gt;
&lt;br /&gt;
* ''Layout'' '''layout''': the QGraphicsLayout associated with the Plasmoid for laying out top level items; this property is read-write, though the property is not usually set as one can simply do &amp;quot;new LinearLayout&amp;quot; (or one of the other layout classes provided) and it will be automatically associated with the Plasmoid.&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* '''update()''': triggers a full repaint of the Plasmoid.&lt;br /&gt;
* '''update(QRectF rect)''' triggers a repaint of the rect area of the Plasmoid.&lt;br /&gt;
* '''failedToLaunch(bool failed[, string reason])''' sets the launch status of the Plasmoid; if set to true, the script will stop executing and the reason message, if any, will be displayed to the user.&lt;br /&gt;
&lt;br /&gt;
=== Access To Packaged Files  ===&lt;br /&gt;
&lt;br /&gt;
Functions: &lt;br /&gt;
&lt;br /&gt;
* ''string'' '''file(string type[, string fileName])''': returns the path to a file in the Plasmoid package of the given type, optionally with a file name to match, e.g. &amp;lt;code javascript&amp;gt;var path = plasmoid.file(&amp;quot;mainscript&amp;quot;)&amp;lt;/code&amp;gt; or &amp;lt;code javascript&amp;gt;var pm = new QPixmap(plasmoid.file(&amp;quot;images&amp;quot;, &amp;quot;mypixmap.png&amp;quot;))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''bool'' '''include(string filename)''': attempts to include the script defined from the package's code directory&lt;br /&gt;
&lt;br /&gt;
=== Configuration Data  ===&lt;br /&gt;
Configuration values can be defined using [[Development/Tutorials/Using_KConfig_XT|KConfig XT]] XML files in the {{path|contents/config/}} directory of the Plasmoid's package. The default file that is looked for and used is {{path|contents/config/main.xml}}.&lt;br /&gt;
&lt;br /&gt;
==== Accessing Configuration Data  ====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''activeConfig''': The current active configuration description. For instance, setting it to &amp;quot;foo&amp;quot; would cause the Plasmoid to try and reference the {{path|contents/config/foo.xml}} KConfigXT file. Setting this to an empty string will switch to the main.xml file.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''any'' '''readConfig(String key)''': reads the value from the configuration data for the given key as defined by the currently active configuration.&lt;br /&gt;
&lt;br /&gt;
* '''writeConfig(String key, any value) ''': writes a value to the configuration store under the given key&lt;br /&gt;
&lt;br /&gt;
==== User Customization  ====&lt;br /&gt;
&lt;br /&gt;
User customization can be offered by providing a Qt Designer file called {{path|contents/ui/config.ui}} in the Plasmoid's package.&lt;br /&gt;
&lt;br /&gt;
Callbacks:&lt;br /&gt;
* '''configChanged()''': callback function called when the configuration is changed external to the Plasmoid, e.g. when the user changes settings in a configuration dialog.&lt;br /&gt;
&lt;br /&gt;
=== Context menu ===&lt;br /&gt;
&lt;br /&gt;
It's possible to add some items to the popup menu of the Plasmoid.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setAction(name, text, icon, shortcut)''': adds an item to the context menu with the given text and icon; you need to define '''plasmoid.action_&amp;lt;name&amp;gt;''' function, where &amp;lt;name&amp;gt; is the first argument for setAction call, and this function will be called each time user clicks the item&lt;br /&gt;
&lt;br /&gt;
* '''removeAction(name)''': removes the item&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Global Enumerations ==&lt;br /&gt;
In the global namespace are a set of useful enumerations that can be used with various classes in the Simplified Javascript Plasmoid API. These include:&lt;br /&gt;
&lt;br /&gt;
=== AspectRatioMode ===&lt;br /&gt;
* '''IgnoreAspectRatio''': The Plasmoid can be freely resized &lt;br /&gt;
* '''KeepAspectRatio''': The Plasmoid keeps a fixed aspect ratio &lt;br /&gt;
* '''Square: The Plasmoid is always a square &lt;br /&gt;
* '''ConstrainedSquare''': The Plasmoid is no wider (in horizontal formfactors) or no higher (in vertical ones) than a square &lt;br /&gt;
* '''FixedSize''': The Plasmoid cannot be resized &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FormFactor ===&lt;br /&gt;
* '''Planar''': The Plasmoid lives in a plane and has two degrees of freedom to grow. Optimize for desktop, laptop or tablet usage: a high resolution screen 1-3 feet distant from the viewer.&lt;br /&gt;
* '''MediaCenter''': As with Plasmoid the applet lives in a but the interface should be optimized for medium-to-high resolution screens that 5-15 feet distant from the viewer. Sometimes referred to as a &amp;quot;ten foot interface&amp;quot;.&lt;br /&gt;
* '''Horizontal''': The Plasmoid is constrained vertically, but can expand horizontally.&lt;br /&gt;
* '''Vertical''': The Plasmoid is constrained horizontally, but can expand vertically.&lt;br /&gt;
&lt;br /&gt;
=== Location ===&lt;br /&gt;
* '''Floating''': Free floating. Neither geometry or z-ordering is described precisely by this value.&lt;br /&gt;
* '''Desktop''': On the planar desktop layer, extending across the full screen from edge to edge&lt;br /&gt;
* '''FullScreen'''&lt;br /&gt;
* '''TopEdge'''&lt;br /&gt;
* '''BottomEdge'''&lt;br /&gt;
* '''LeftEdge'''&lt;br /&gt;
* '''RightEdge'''&lt;br /&gt;
&lt;br /&gt;
=== AnimationDirection ===&lt;br /&gt;
* '''AnimationForward'''&lt;br /&gt;
* '''AnimationBackward'''&lt;br /&gt;
&lt;br /&gt;
=== BackgroundHints ===&lt;br /&gt;
* '''NoBackground'''&lt;br /&gt;
* '''StandardBackground'''&lt;br /&gt;
* '''TranslucentBackground'''&lt;br /&gt;
* '''DefaultBackground'''&lt;br /&gt;
&lt;br /&gt;
=== QtAlignment ===&lt;br /&gt;
* QtAlignLeft&lt;br /&gt;
* QtAlignRight&lt;br /&gt;
* QtAlignHCenter&lt;br /&gt;
* QtAlignJustify&lt;br /&gt;
* QtAlignTop&lt;br /&gt;
* QtAlignBottom&lt;br /&gt;
* QtAlignVCenter&lt;br /&gt;
&lt;br /&gt;
If you need to align something in the center (both horizontally and vertically) you can sum the constans.&lt;br /&gt;
&lt;br /&gt;
=== QtAnchorPoint ===&lt;br /&gt;
* QtAnchorLeft&lt;br /&gt;
* QtAnchorRight&lt;br /&gt;
* QtAnchorBottom&lt;br /&gt;
* QtAnchorTop&lt;br /&gt;
* QtAnchorHorizontalCenter&lt;br /&gt;
* QtAnchorVerticalCenter&lt;br /&gt;
&lt;br /&gt;
=== QtCorner ===&lt;br /&gt;
* QtTopLeftCorner&lt;br /&gt;
* QtTopRightCorner&lt;br /&gt;
* QtBottomLeftCorner&lt;br /&gt;
* QtBottomRightCorner&lt;br /&gt;
&lt;br /&gt;
=== QtMouseButton ===&lt;br /&gt;
* QtNoButton&lt;br /&gt;
* QtLeftButton&lt;br /&gt;
* QtRightButton&lt;br /&gt;
* QtMidButton&lt;br /&gt;
* QtXButton1&lt;br /&gt;
* QtXButton2&lt;br /&gt;
&lt;br /&gt;
=== QtOrientation ===&lt;br /&gt;
* QtHorizontal&lt;br /&gt;
* QtVertical&lt;br /&gt;
&lt;br /&gt;
=== QtScrollBarPolicy ===&lt;br /&gt;
* QtScrollBarAsNeeded&lt;br /&gt;
* QtScrollBarAlwaysOff&lt;br /&gt;
* QtScrollBarAlwaysOn&lt;br /&gt;
&lt;br /&gt;
=== QtSizePolicy ===&lt;br /&gt;
* QSizePolicyFixed&lt;br /&gt;
* QSizePolicyMinimum&lt;br /&gt;
* QSizePolicyMaximum&lt;br /&gt;
* QSizePolicyPreferred&lt;br /&gt;
* QSizePolicyExpanding&lt;br /&gt;
* QSizePolicyMinimumExpanding&lt;br /&gt;
* QSizePolicyIgnored&lt;br /&gt;
&lt;br /&gt;
=== Theme Colors (API v3) ===&lt;br /&gt;
* TextColor&lt;br /&gt;
* HighlightColor&lt;br /&gt;
* BackgroundColor&lt;br /&gt;
* ButtonTextColor&lt;br /&gt;
* ButtonBackgroundColor&lt;br /&gt;
* LinkColor&lt;br /&gt;
* VisitedLinkColor&lt;br /&gt;
&lt;br /&gt;
=== Status ===&lt;br /&gt;
* UnknownStatus The status is unknown&lt;br /&gt;
* PassiveStatus The Item is passive&lt;br /&gt;
* ActiveStatus The Item is active&lt;br /&gt;
* NeedsAttentionStatus The Item needs attention&lt;br /&gt;
* AcceptingInputStatus The Item is accepting input&lt;br /&gt;
&lt;br /&gt;
== User Interface Elements  ==&lt;br /&gt;
&lt;br /&gt;
=== Plasma Widgets  ===&lt;br /&gt;
&lt;br /&gt;
The Plasma framework provides a set of standard user interface elements such as pushbuttons and checkboxes for use in Plasmoids, and these are available from the Simplified Javascript API as well. These elements follow the Plasma style and other conventions so that widgets blend well both visually and functionally with other Plasma elements. &lt;br /&gt;
&lt;br /&gt;
Note that some UI elements have functions that are synonymous with a read-write property. In those cases, the function can serve as a slot and be connected to signals for easy setting of the property.&lt;br /&gt;
&lt;br /&gt;
=== DataEngine-Aware UI Elements ===&lt;br /&gt;
Some of the UI elements are able to accept data directly from DataEngines. These widgets will have a dataUpdated function and can be passed into the DataEngine::connectSource method successfully.&lt;br /&gt;
&lt;br /&gt;
DataEngine-aware UI elements include:&lt;br /&gt;
&lt;br /&gt;
* Label&lt;br /&gt;
* TextEdit&lt;br /&gt;
* Meter&lt;br /&gt;
&lt;br /&gt;
=== Common Properties  ===&lt;br /&gt;
&lt;br /&gt;
By default, all of the Plasma user interface elements have the following properties: &lt;br /&gt;
&lt;br /&gt;
* ''String'' '''objectName'''&lt;br /&gt;
* ''number'' '''opacity'''&lt;br /&gt;
* ''boolean'' '''enabled'''&lt;br /&gt;
* ''boolean'' '''visible'''&lt;br /&gt;
* ''QPointF'' '''pos'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
* ''number'' '''z'''&lt;br /&gt;
* ''number'' '''rotation'''&lt;br /&gt;
* ''number'' '''scale'''&lt;br /&gt;
* ''QPointF'' '''transformOriginPoint'''&lt;br /&gt;
* ''QPalette'' '''palette'''&lt;br /&gt;
* ''QFont'' '''font'''&lt;br /&gt;
* ''QSizeF'' '''size'''&lt;br /&gt;
* ''QtFocusPolicy'' '''focusPolicy'''&lt;br /&gt;
* ''QRectF'' '''geometry'''&lt;br /&gt;
&lt;br /&gt;
=== Common Signals  ===&lt;br /&gt;
&lt;br /&gt;
* '''opacityChanged()'''&lt;br /&gt;
* '''visibleChanged()'''&lt;br /&gt;
* '''enabledChanged()'''&lt;br /&gt;
* '''xChanged()'''&lt;br /&gt;
* '''yChanged()'''&lt;br /&gt;
* '''zChanged()'''&lt;br /&gt;
* '''rotationChanged()'''&lt;br /&gt;
* '''scaleChanged() '''&lt;br /&gt;
&lt;br /&gt;
=== UI Element Gallery  ===&lt;br /&gt;
&lt;br /&gt;
==== CSS Styleable UI Elements ====&lt;br /&gt;
&lt;br /&gt;
Most UI Elements are able to have their appearance adjust using a CSS stylesheet. All of these elements have the following read/write property:&lt;br /&gt;
&lt;br /&gt;
*''String'' '''styleSheet''': A CSS stylesheet describing visual properties to apply to the widget; see [http://doc.trolltech.com/4.5/stylesheet.html the Qt Documentation for more information]&lt;br /&gt;
&lt;br /&gt;
===== CheckBox =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
* ''boolean'' '''checked'''&lt;br /&gt;
* '''toggled(bool)'''&lt;br /&gt;
&lt;br /&gt;
===== ComboBox =====&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''number'' '''count''': (API v 3) the number of items in the combobox&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text''': the text of the currently selected item in the combobox&lt;br /&gt;
* ''number'' currentIndex:  (API v 3) the index of the current item&lt;br /&gt;
&lt;br /&gt;
Funtions:&lt;br /&gt;
* '''clear()'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''activated(String)'''&lt;br /&gt;
* '''textChanged(String)'''&lt;br /&gt;
* '''currentIndexChanged(number)'''&lt;br /&gt;
&lt;br /&gt;
===== Frame =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''Shadow'' '''frameShadow'''&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
&lt;br /&gt;
Enumerations:&lt;br /&gt;
* '''Shadow'''&lt;br /&gt;
* '''Plain'''&lt;br /&gt;
* '''Raised'''&lt;br /&gt;
* '''Sunken'''&lt;br /&gt;
&lt;br /&gt;
===== GroupBox =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
&lt;br /&gt;
===== Label =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
* ''number'' '''alignment''' (see [[#QtAlignment]] for the valid values)&lt;br /&gt;
* ''boolean'' '''hasScaledContents'''&lt;br /&gt;
* ''boolean'' '''textIsSelectable''' (since 4.4.1)&lt;br /&gt;
* ''boolean'' '''wordWrap''' (API v2)&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''dataUpdated(String, Data)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''linkActivated(String)''': emitted when a link is clicked; includes the URL of link that is clicked; this is only available when textIsSelectable&lt;br /&gt;
* '''linkHovered(String)''': emitted when a link is hovered&lt;br /&gt;
&lt;br /&gt;
===== LineEdit =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''boolean'' '''clearButtonShown'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''editingFinished()'''&lt;br /&gt;
* '''returnPressed()'''&lt;br /&gt;
* '''textEdited(String)'''&lt;br /&gt;
* '''textChanged(String)'''&lt;br /&gt;
&lt;br /&gt;
===== PushButton =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
* ''QAction'' '''action'''&lt;br /&gt;
* ''QIcon'' '''icon'''&lt;br /&gt;
* ''boolean'' '''checkable'''&lt;br /&gt;
* ''boolean'' '''checked'''&lt;br /&gt;
* ''boolean'' '''down'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''pressed()'''&lt;br /&gt;
* '''released()'''&lt;br /&gt;
* '''clicked()'''&lt;br /&gt;
* '''toggled(bool)'''&lt;br /&gt;
&lt;br /&gt;
===== RadioButton =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''image'''&lt;br /&gt;
* ''boolean'' '''checked'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''toggled(bool)'''&lt;br /&gt;
&lt;br /&gt;
===== ScrollWidget =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''QGraphicsWidget'' '''widget'''&lt;br /&gt;
* ''number'' '''horizontalScrollBarPolicy'''&lt;br /&gt;
* ''number'' '''verticalScrollBarPolicy'''&lt;br /&gt;
* ''QPointF'' '''scrollPosition'''&lt;br /&gt;
* ''QSizeF'' '''contentsSize'''&lt;br /&gt;
* ''QRectF'' '''viewportGeometry'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''ensureRectVisible(QRectF)'''&lt;br /&gt;
* '''ensureItemVisible(QGraphicsItem)'''&lt;br /&gt;
* '''registerAsDragHandle(QGraphicsWidget)'''&lt;br /&gt;
* '''unregisterAsDragHandle(QGraphicsWidget)'''&lt;br /&gt;
&lt;br /&gt;
===== ScrollBar =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''singleStep'''&lt;br /&gt;
* ''number'' '''pageStep'''&lt;br /&gt;
* ''number'' '''value'''&lt;br /&gt;
* ''number'' '''minimum'''&lt;br /&gt;
* ''number'' '''maximum'''&lt;br /&gt;
* ''QtOrientation'' '''setOrientation'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setValue(number)'''&lt;br /&gt;
* '''setOrientation(QtOrientation)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''valueChanged(number)'''&lt;br /&gt;
&lt;br /&gt;
===== Slider =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''maximum'''&lt;br /&gt;
* ''number'' '''minimum'''&lt;br /&gt;
* ''number'' '''value'''&lt;br /&gt;
* ''number'' '''orientation'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''sliderMoved(number)'''&lt;br /&gt;
* '''valueChanged(number)'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setMaximum(number)'''&lt;br /&gt;
* '''setMinimum(number)'''&lt;br /&gt;
* '''setRange(number, number)'''&lt;br /&gt;
* '''setValue(number)'''&lt;br /&gt;
* '''setOrientation(QtOrientation)'''&lt;br /&gt;
&lt;br /&gt;
===== SpinBox =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''maximum'''&lt;br /&gt;
* ''number'' '''minimum'''&lt;br /&gt;
* ''number'' '''value'''&lt;br /&gt;
&lt;br /&gt;
Functins:&lt;br /&gt;
* '''setMaximum(number)'''&lt;br /&gt;
* '''setMinimum(number)'''&lt;br /&gt;
* '''setRange(number, number)'''&lt;br /&gt;
* '''setValue(number)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''sliderMoved(number)'''&lt;br /&gt;
* '''valueChanged(number)'''&lt;br /&gt;
* '''editingFinished()'''&lt;br /&gt;
&lt;br /&gt;
===== TabBar =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''currentIndex'''&lt;br /&gt;
* ''number'' '''count'''&lt;br /&gt;
* ''boolean'' '''tabBarShown'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setCurrentIndex(number)'''&lt;br /&gt;
* '''insertTab(number, QIcon,String,QGraphicsLayoutItem)'''&lt;br /&gt;
* '''insertTab(number, QIcon,String)'''&lt;br /&gt;
* '''insertTab(number, String,QGraphicsLayoutItem)'''&lt;br /&gt;
* '''insertTab(number, String)'''&lt;br /&gt;
* '''addTab(QIcon,String,QGraphicsLayoutItem)'''&lt;br /&gt;
* '''addTab(QIcon,String)'''&lt;br /&gt;
* '''addTab(String,QGraphicsLayoutItem)'''&lt;br /&gt;
* '''addTab(String)'''&lt;br /&gt;
* '''removeTab(number)'''&lt;br /&gt;
* '''takeTab(number)'''&lt;br /&gt;
* '''tabAt(number)'''&lt;br /&gt;
* '''setTabText(number, String)'''&lt;br /&gt;
* '''tabText(number)'''&lt;br /&gt;
* '''setTabIcon(number, QIcon)'''&lt;br /&gt;
* '''tabIcon(number)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''currentChanged(number)'''&lt;br /&gt;
&lt;br /&gt;
===== TextEdit =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''boolean'' '''readOnly'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''dataUpdated(String, Data)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''textChanged()'''&lt;br /&gt;
&lt;br /&gt;
===== ToolButton =====&lt;br /&gt;
:Read-write properties:&lt;br /&gt;
&lt;br /&gt;
* ''''QAction'' '''action''': the action associated with this '''ToolButton'''&lt;br /&gt;
* ''''boolean'' '''autoRaise''': whether or not the ToolButton should raise automatically when the user interacts with it'''&lt;br /&gt;
* ''''String'' '''image''': path to an icon or image (e.g. in the widget's Package) to show on the ToolButton&lt;br /&gt;
* ''''String'' '''text''': the text shown on the ToolButton&lt;br /&gt;
&lt;br /&gt;
API v2 adds:&lt;br /&gt;
* ''''boolean'' '''down''': whether or not the ToolButton is in the down position (since protocol version 2)&lt;br /&gt;
&lt;br /&gt;
:Signals:&lt;br /&gt;
* '''clicked()'''&lt;br /&gt;
* '''pressed()'''&lt;br /&gt;
* '''released()'''&lt;br /&gt;
&lt;br /&gt;
===== TreeView =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''QAbstractModel'' '''model'''&lt;br /&gt;
&lt;br /&gt;
===== VideoWidget =====&lt;br /&gt;
Read-writeproperties:&lt;br /&gt;
* ''String'' '''url'''&lt;br /&gt;
* ''number'' '''currentTime'''&lt;br /&gt;
* ''number'' '''totalTime'''&lt;br /&gt;
* ''number'' '''remainingTime'''&lt;br /&gt;
* ''Controls'' '''usedControls'''&lt;br /&gt;
* ''boolean'' '''controlsVisible'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''play()'''&lt;br /&gt;
* '''pause()'''&lt;br /&gt;
* '''stop()'''&lt;br /&gt;
* '''seek(number)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''tick(number)'''&lt;br /&gt;
* '''aboutToFinish()'''&lt;br /&gt;
* '''nextRequested()'''&lt;br /&gt;
* '''previousRequested()'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enumerations:&lt;br /&gt;
* Controls&lt;br /&gt;
** NoControls&lt;br /&gt;
** Play&lt;br /&gt;
** Pause&lt;br /&gt;
** Stop&lt;br /&gt;
** PlayPause&lt;br /&gt;
** Previous&lt;br /&gt;
** Next&lt;br /&gt;
** Progress&lt;br /&gt;
** Volume&lt;br /&gt;
** OpenFile&lt;br /&gt;
** DefaultControls&lt;br /&gt;
&lt;br /&gt;
==== Other UI Elements ====&lt;br /&gt;
&lt;br /&gt;
===== BusyWidget =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''running'''&lt;br /&gt;
* ''String'' '''label'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''clicked()'''&lt;br /&gt;
&lt;br /&gt;
===== FlashingLabel =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''autohide'''&lt;br /&gt;
* ''QColor'' '''color'''&lt;br /&gt;
* ''number'' '''duration'''&lt;br /&gt;
&lt;br /&gt;
Functins:&lt;br /&gt;
* '''kill()'''&lt;br /&gt;
* '''fadeIn()'''&lt;br /&gt;
* '''fadeOut()'''&lt;br /&gt;
* '''flash(String, number, QTextOption)'''&lt;br /&gt;
* '''flash(String ,number)'''&lt;br /&gt;
* '''flash(String)'''&lt;br /&gt;
* '''flash(QPixmap, number, QtAlignment)'''&lt;br /&gt;
* '''flash(QPixmap, number)'''&lt;br /&gt;
* '''flash(QPixmap)'''&lt;br /&gt;
&lt;br /&gt;
===== GraphicsWidget (API v3) =====&lt;br /&gt;
This is just a plain element with no painting or other features. It is useful primarily as a place holder, especially to contain layouts for other elements.&lt;br /&gt;
&lt;br /&gt;
===== IconWidget =====&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''QSizeF'' '''iconSize''' - the actual size of the icon given the size of the IconWidget, space reserved (if any) for text displayed, etc.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''text'''&lt;br /&gt;
* ''String'' '''infoText'''&lt;br /&gt;
* ''QIcon'' '''icon'''&lt;br /&gt;
* ''QColor'' '''textBackgroundColor'''&lt;br /&gt;
* ''String'' '''svg'''&lt;br /&gt;
* ''QAction'' '''action'''&lt;br /&gt;
* ''QtOrientation'' '''orientation'''&lt;br /&gt;
* ''number'' '''numDisplayLines'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setPressed(boolean)'''&lt;br /&gt;
* '''setUnpressed()'''&lt;br /&gt;
* '''setIcon(String)'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''pressed(bool)'''&lt;br /&gt;
* '''clicked()'''&lt;br /&gt;
* '''doubleClicked()'''&lt;br /&gt;
* '''activated()'''&lt;br /&gt;
* '''changed()'''&lt;br /&gt;
&lt;br /&gt;
===== ItemBackground =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''QRectF'' '''target'''&lt;br /&gt;
* ''QGraphicsItem'' '''targetItem'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''appearanceChanged()'''&lt;br /&gt;
* '''animationStep(qreal)'''&lt;br /&gt;
* '''targetReached(QRectF)'''&lt;br /&gt;
* '''targetItemReached(QGraphicsItem)'''&lt;br /&gt;
&lt;br /&gt;
===== Meter =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''minimum'''&lt;br /&gt;
* ''number'' '''maximum'''&lt;br /&gt;
* ''number'' '''value'''&lt;br /&gt;
* ''String'' '''svg'''&lt;br /&gt;
* ''MeterType'' '''meterType'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''dataUpdated(String, Data)'''&lt;br /&gt;
&lt;br /&gt;
Enumerations:&lt;br /&gt;
* '''MeterType'''&lt;br /&gt;
** BarMeterHorizontal&lt;br /&gt;
** BarMeterVertical&lt;br /&gt;
** AnalogMeter&lt;br /&gt;
&lt;br /&gt;
===== Separator =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''QtOrientation'' '''orientation'''&lt;br /&gt;
&lt;br /&gt;
===== SignalPlotter =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''String'' '''title'''&lt;br /&gt;
* ''String'' '''unit'''&lt;br /&gt;
* ''boolean'' '''useAutoRange'''&lt;br /&gt;
* ''number'' '''horizontalScale'''&lt;br /&gt;
* ''boolean'' '''showVerticalLines'''&lt;br /&gt;
* ''QColor'' '''verticalLinesColor'''&lt;br /&gt;
* ''number'' '''verticalLinesDistance'''&lt;br /&gt;
* ''boolean'' '''verticalLinesScroll'''&lt;br /&gt;
* ''boolean'' '''showHorizontalLines'''&lt;br /&gt;
* ''QColor'' '''horizontalLinesColor'''&lt;br /&gt;
* ''QColor'' '''fontColor'''&lt;br /&gt;
* ''number'' '''horizontalLinesCount'''&lt;br /&gt;
* ''boolean'' '''showLabels'''&lt;br /&gt;
* ''boolean'' '''showTopBar'''&lt;br /&gt;
* ''QColor'' '''backgroundColor'''&lt;br /&gt;
* ''String'' '''svgBackground'''&lt;br /&gt;
* ''boolean'' '''thinFrame'''&lt;br /&gt;
* ''boolean'' '''stackPlots'''&lt;br /&gt;
&lt;br /&gt;
===== SvgWidget =====&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''Svg'' '''svg'''&lt;br /&gt;
* ''String'' '''elementID'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''clicked(QtMouseButton)'''&lt;br /&gt;
&lt;br /&gt;
===== WebView =====&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''QSizeF'' '''contentsSize'''&lt;br /&gt;
* ''QRectF'' '''viewportGeometry'''&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''Url'' '''url'''&lt;br /&gt;
* ''String'' '''html'''&lt;br /&gt;
* ''boolean'' '''dragToScroll'''&lt;br /&gt;
* ''QPointF'' '''scrollPosition'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''loadProgress(number)'''&lt;br /&gt;
* '''loadFinished(bool)'''&lt;br /&gt;
&lt;br /&gt;
=== Layouts  ===&lt;br /&gt;
&lt;br /&gt;
==== LinearLayout ====&lt;br /&gt;
* ''number'' '''spacing'''&lt;br /&gt;
* ''QtOrientation'' '''orientation''' (''QtVertical'' or ''QtHorizontal'')&lt;br /&gt;
* ''function'' '''removeAt'''&lt;br /&gt;
* ''function'' '''addStretch'''&lt;br /&gt;
* ''function'' '''setStretchFactor'''&lt;br /&gt;
* ''function'' '''setAlignment'''&lt;br /&gt;
* ''function'' '''insertStretch'''&lt;br /&gt;
* ''function'' '''setItemSpacing'''&lt;br /&gt;
* ''function'' '''setContentsMargins'''&lt;br /&gt;
* ''function'' '''addItem'''&lt;br /&gt;
* ''function'' '''removeItem'''&lt;br /&gt;
* ''function'' '''insertItem'''&lt;br /&gt;
* ''function'' '''toString'''&lt;br /&gt;
* ''function'' '''activate''' (API v3)&lt;br /&gt;
&lt;br /&gt;
==== AnchorLayout ====&lt;br /&gt;
* ''number'' '''horizontalSpacing'''&lt;br /&gt;
* ''number'' '''verticalSpacing'''&lt;br /&gt;
* ''function'' '''setSpacing'''&lt;br /&gt;
* ''function'' '''removeAt'''&lt;br /&gt;
* ''function'' '''addAnchor'''&lt;br /&gt;
* ''function'' '''anchor'''&lt;br /&gt;
* ''function'' '''addAnchors'''&lt;br /&gt;
* ''function'' '''addCornerAnchors'''&lt;br /&gt;
* ''function'' '''toString'''&lt;br /&gt;
* ''function'' '''activate''' (API v3)&lt;br /&gt;
&lt;br /&gt;
==== GridLayout ====&lt;br /&gt;
* ''number '''horizontalSpacing'''&lt;br /&gt;
* ''number '''verticalSpacing'''&lt;br /&gt;
* ''function'' '''rowSpacing'''&lt;br /&gt;
* ''function'' '''setRowSpacing'''&lt;br /&gt;
* ''function'' '''columnSpacing'''&lt;br /&gt;
* ''function'' '''setColumnSpacing'''&lt;br /&gt;
* ''function'' '''rowMinimumHeight'''&lt;br /&gt;
* ''function'' '''setRowMinimumHeight'''&lt;br /&gt;
* ''function'' '''rowPreferredHeight'''&lt;br /&gt;
* ''function'' '''setRowPreferredHeight'''&lt;br /&gt;
* ''function'' '''rowMaximumHeight'''&lt;br /&gt;
* ''function'' '''setRowMaximumHeight'''&lt;br /&gt;
* ''function'' '''rowFixedHeight'''&lt;br /&gt;
* ''function'' '''setRowFixedHeight'''&lt;br /&gt;
* ''function'' '''columnMinimumWidth'''&lt;br /&gt;
* ''function'' '''setColumnMinimumWidth'''&lt;br /&gt;
* ''function'' '''columnPreferredWidth'''&lt;br /&gt;
* ''function'' '''setColumnPreferredWidth'''&lt;br /&gt;
* ''function'' '''columnMaximumWidth'''&lt;br /&gt;
* ''function'' '''setColumnMaximumWidth'''&lt;br /&gt;
* ''function'' '''columnFixedWidth'''&lt;br /&gt;
* ''function'' '''setColumnFixedWidth'''&lt;br /&gt;
* ''function'' '''remoteAt'''&lt;br /&gt;
* ''function'' '''setAlignment'''&lt;br /&gt;
* ''function'' '''setSpacing'''&lt;br /&gt;
* ''function'' '''setContentsMargins'''&lt;br /&gt;
* ''function'' '''addItem'''&lt;br /&gt;
* ''function'' '''toString'''&lt;br /&gt;
* ''function'' '''activate''' (API v3)&lt;br /&gt;
&lt;br /&gt;
=== Undocumented Properties and Functions  ===&lt;br /&gt;
&lt;br /&gt;
There are a handful of other undocumented properties and functions available to UI elements. These are not supported or guaranteed to exist in future versions however, and as such should not be used or relied upon.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
&lt;br /&gt;
=== Creating Animation Objects ===&lt;br /&gt;
An Animation object can be retrieved by calling the ''Animation'' '''animation(string type)''' function. The ''string'' corresponds to the type of animation, which are listed below.&lt;br /&gt;
&lt;br /&gt;
New Animation objects are associated with (and therefore will animate) the Plasmoid by default. By setting the widgetToAnimate property, however, it can be assigned to animate any QGraphicsWidget desired (e.g. Plasma widgets such as push buttons, sliders, etc) .&lt;br /&gt;
&lt;br /&gt;
=== Enumerations ===&lt;br /&gt;
All Animation objects have the following enumerations:&lt;br /&gt;
&lt;br /&gt;
==== MovementDirection ====&lt;br /&gt;
* '''MoveUp'''&lt;br /&gt;
* '''MoveUpRight'''&lt;br /&gt;
* '''MoveRight'''&lt;br /&gt;
* '''MoveDownRight'''&lt;br /&gt;
* '''MoveDown'''&lt;br /&gt;
* '''MoveDownLeft'''&lt;br /&gt;
* '''MoveLeft'''&lt;br /&gt;
* '''MoveUpLeft'''&lt;br /&gt;
&lt;br /&gt;
==== Reference ====&lt;br /&gt;
The reference point, relative to the target widget, for the animation.&lt;br /&gt;
* '''Center'''&lt;br /&gt;
* '''Up'''&lt;br /&gt;
* '''Down'''&lt;br /&gt;
* '''Left'''&lt;br /&gt;
* '''Right'''&lt;br /&gt;
&lt;br /&gt;
==== State ====&lt;br /&gt;
* '''Paused'''&lt;br /&gt;
* '''Running'''&lt;br /&gt;
* '''Stopped'''&lt;br /&gt;
&lt;br /&gt;
=== Common API ===&lt;br /&gt;
With the exception of Pause and Property animations, all animations support the following read/write properties: &lt;br /&gt;
&lt;br /&gt;
* ''AnimationDirection'' '''direction''': the direction the animation should play: AnimationForward or AnimationBackward&lt;br /&gt;
* ''int'' '''duration''': length of the animation in ms.&lt;br /&gt;
* ''EasingCurveType'' '''easingCurveType''': The easing curve to use in the animation&lt;br /&gt;
* ''QGraphicsWidget'' '''targetWidget''': the QGraphicsWidget (e.g. a Plasma::Widget) that this animation should operate on&lt;br /&gt;
&lt;br /&gt;
=== Animation Groups ===&lt;br /&gt;
Animations may be put into groups for convenient sequential or parallel running. Sequential groups, where the animations run one after the other, are handled by the '''AnimationGroup''' class. Parallel aniations, where the animations run simultaneously, are handled the '''ParallelAnimationGroup''' class. &lt;br /&gt;
&lt;br /&gt;
Animations are added to a group by calling '''add(Animation)''' on the group object. Groups may also be added to other groups.&lt;br /&gt;
&lt;br /&gt;
=== Custom Animations ===&lt;br /&gt;
Custom animation types can be defined using Javascript files that are included as part of the Plasmoid's package in the {{path|contents/animations/}} directory. To learn how to create such animations and access them from your Plasmoid, visit the [[Development/Tutorials/Plasma/JavaScript/Animations|Javascript Animations tutorial]].&lt;br /&gt;
&lt;br /&gt;
=== Standard Animation Types ===&lt;br /&gt;
Below is a list of all current standard animation types and their particular read/write properties:&lt;br /&gt;
&lt;br /&gt;
==== Fade ====&lt;br /&gt;
* ''number'' '''startOpacity''': the opacity, between 0 and 1, that the target widget starts at when the animation begins&lt;br /&gt;
* ''number'' '''targetOpacity''': the opacity, between 0 and 1, that the target widget will be at the end of the animation&lt;br /&gt;
&lt;br /&gt;
==== Geometry ====&lt;br /&gt;
* ''QRectF'' '''startGeometry''': the geometry that the target widget should start with&lt;br /&gt;
* ''QRectF'' '''targetGeometry''': the geometry the target widget will have at the end of the animation&lt;br /&gt;
&lt;br /&gt;
==== Grow ====&lt;br /&gt;
* ''number'' '''factor''': the factor by which the target widget will grow to by the end of the animation&lt;br /&gt;
&lt;br /&gt;
==== Pause ====&lt;br /&gt;
* ''number'' '''duration''': the number of milliseconds to pause for&lt;br /&gt;
&lt;br /&gt;
==== Property ====&lt;br /&gt;
Animates an object (must be a QObject internally, which includes all Plasma Widgets) by manipulating one of its properties. Property animations have the following read/write properties:&lt;br /&gt;
&lt;br /&gt;
* ''any'' '''startValue'''&lt;br /&gt;
* ''any'' '''endValue'''&lt;br /&gt;
* ''ByteArray'' '''propertyName'''&lt;br /&gt;
* ''QObject'' '''targetObject'''&lt;br /&gt;
* ''number'' '''duration'''&lt;br /&gt;
* ''EasingCurve'' '''easingCurve'''&lt;br /&gt;
&lt;br /&gt;
==== Pulser ==== &lt;br /&gt;
* ''number'' '''targetScale''': the maximum scale of the pulse-shadow item, relative to the target widget&lt;br /&gt;
&lt;br /&gt;
==== Rotate ====&lt;br /&gt;
* ''QtAxis'' '''axis''': the axis along which to rotate the item&lt;br /&gt;
* ''Reference'' '''reference''': the reference point around which to rotate the target widget&lt;br /&gt;
* ''number'' '''angle''': the number of degrees to rotate the item&lt;br /&gt;
&lt;br /&gt;
==== RotateStacked ====&lt;br /&gt;
* ''MovementDirection'' '''movementDirection''': the direction to rotate the widgets in the stack around&lt;br /&gt;
* ''QGraphicsLayoutItem'' '''layout'''&lt;br /&gt;
* ''Reference'' '''reference''': the reference point around which to rotate the target widget&lt;br /&gt;
* ''QGraphicsWidget'' '''backingWidget''': the widget in the &amp;quot;back&amp;quot; to rotate to the front of the target widget&lt;br /&gt;
&lt;br /&gt;
==== Slide ==== &lt;br /&gt;
* ''MovementDirection'' '''movementDirection''': the direction to slide the widget&lt;br /&gt;
* ''number'' '''distance''': the distance to slide the widget&lt;br /&gt;
&lt;br /&gt;
==== Zoom ====&lt;br /&gt;
* ''number'' '''zoom''': the factor by which to zoom the target widget&lt;br /&gt;
&lt;br /&gt;
=== QEasingCurve ===&lt;br /&gt;
Used to set the progress shape of Animation objects, this class has the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''string'' '''toString'''&lt;br /&gt;
* ''number'' '''valueForProgress(number progress)''': returns effective progress for the easing curve at progress. While progress must be between 0 and 1, the returned effective progress can be outside those bounds.&lt;br /&gt;
&lt;br /&gt;
as well as the following read/write property:&lt;br /&gt;
&lt;br /&gt;
* ''EasingCurveType'' '''type''': the shape of this easing curve&lt;br /&gt;
&lt;br /&gt;
and the following enumeration:&lt;br /&gt;
&lt;br /&gt;
* '''EasingCurveType'''&lt;br /&gt;
** Linear&lt;br /&gt;
** InQuad&lt;br /&gt;
** OutQuad&lt;br /&gt;
** InOutQuad&lt;br /&gt;
** OutInQuad&lt;br /&gt;
** InCubic&lt;br /&gt;
** OutCubic&lt;br /&gt;
** InOutCubic&lt;br /&gt;
** OutInCubic&lt;br /&gt;
** InQuart&lt;br /&gt;
** OutQuart&lt;br /&gt;
** InOutQuart&lt;br /&gt;
** OutInQuart&lt;br /&gt;
** InQuint&lt;br /&gt;
** OutQuint&lt;br /&gt;
** InOutQuint&lt;br /&gt;
** OutInQuint&lt;br /&gt;
** InSize&lt;br /&gt;
** OutSine&lt;br /&gt;
** InOutSine&lt;br /&gt;
** OutInSine&lt;br /&gt;
** InExpo&lt;br /&gt;
** OutExpo&lt;br /&gt;
** InOutExpo&lt;br /&gt;
** OutInExpo&lt;br /&gt;
** InCirc&lt;br /&gt;
** OutCirc&lt;br /&gt;
** InOutCirc&lt;br /&gt;
** InOutCirc&lt;br /&gt;
** OutInCirc&lt;br /&gt;
** InElastic&lt;br /&gt;
** OutElastic&lt;br /&gt;
** InOutElastic&lt;br /&gt;
** OutInElastic&lt;br /&gt;
** InBack&lt;br /&gt;
** OutBack&lt;br /&gt;
** InOutBack&lt;br /&gt;
** OutInBack&lt;br /&gt;
** InBounc&lt;br /&gt;
** OutBounce&lt;br /&gt;
** InOutBounce&lt;br /&gt;
** OutInBounce&lt;br /&gt;
** InCurve&lt;br /&gt;
** OutCurve&lt;br /&gt;
** SineCurve&lt;br /&gt;
** CosineCurve&lt;br /&gt;
&lt;br /&gt;
== Painting  ==&lt;br /&gt;
&lt;br /&gt;
See the &amp;quot;[[Development/Tutorials/Plasma/JavaScript/API#Painting_and_Layout|Painting and Layout]]&amp;quot; section, part of the Global Plasmoid object chapter, for information on using these classes within a widget.&lt;br /&gt;
&lt;br /&gt;
=== Pixmaps  ===&lt;br /&gt;
&lt;br /&gt;
The QPixmap object allows widgets to use pixmaps for painting. Widgets may include pixmaps in various common formats (PNG, JPEG, GIF, etc.) in the contents/images/ directory of the Plasmoid package and load them by passing the name of the file into the pixmap constructor:&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
    var pixmap = new QPixmap(&amp;quot;myimage.png&amp;quot;)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
In addition to being used as a file load, some objects return or take pixmaps and the QPixmap object facilitates that as well. &lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''null''': true if the pixmap is empty&lt;br /&gt;
* ''QRectF'' '''rect''': the rect of the pixmap &lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QPixmap'' '''scaled(number width, number height);;: returns a scaled version of the pixmap with width and height dimensions.&lt;br /&gt;
&lt;br /&gt;
=== Icons ===&lt;br /&gt;
&lt;br /&gt;
(Since 4.4.1)&lt;br /&gt;
&lt;br /&gt;
The QIcon object provides simple access to icons. They can be constructed using a String or a QPixmap, with the String version either loading a file from disk if given an absolute path (useful for loading icons from the Plasmoid's package) or from the desktop icon theme if given just a name (e.g. &amp;quot;file-open&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''null''': true if the icon is empty&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''addPixmap(QPixmap)''': adds another pixmap to this icon&lt;br /&gt;
* '''addFile(String)''': adds another file to this icon&lt;br /&gt;
&lt;br /&gt;
=== SVG Images  ===&lt;br /&gt;
&lt;br /&gt;
Plasma makes heavy usage of SVG images. More information on this industry standard scalable vector format can be found here: &lt;br /&gt;
&lt;br /&gt;
:http://www.w3.org/Graphics/SVG/&lt;br /&gt;
&lt;br /&gt;
Free and Open Source Software tools for creating SVGs include Inkscape and Karbon13. Widgets may include their own SVG files in the contents/images/ directory or may use SVG images that are part of the standard Plasma Desktop Theme as documented here: &lt;br /&gt;
&lt;br /&gt;
:http://techbase.kde.org/Projects/Plasma/Theme&lt;br /&gt;
&lt;br /&gt;
Two classes are provide: Svg and FrameSvg. Svg allows loading and painting entire SVG documents or individual elements in an SVG document. FrameSvg extends Svg with methods to paint bordered frames from specially crafted SVG documents (see the Plasma Desktop Theme documentation for more information on this). &lt;br /&gt;
&lt;br /&gt;
====Svg====&lt;br /&gt;
Constructors:&lt;br /&gt;
*'''Svg(string fileName)'''': fileName can be a file in the desktop theme or the plasmoid package &lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
*''QSizeF'' '''size''': the current size of the svg&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''multipleImages''': whether or not the svg contains multiple separate images&lt;br /&gt;
* ''string'' '''imagePath''': the file path, including name of the svg&lt;br /&gt;
* ''boolean'' '''usingRenderingCache'': whether or not to cache rendered pixmaps; improves performance (at the cost of some disk and memory usage) for SVG data that is repeatedly rendered&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QSizeF'' elementSize(String svgElemen)'''&lt;br /&gt;
* ''QRectF'' elementRect(String svgElemen)'''&lt;br /&gt;
* ''boolean'' '''hasElement(String svgElement)''' &lt;br /&gt;
* '''elementAtPoint(QPoint pos)''' &lt;br /&gt;
* ''boolean'' '''isValid()'''&lt;br /&gt;
* ''QPixmap'' '''pixmap(String svgElement)''': a pixmap of the element in the svg rendered to the current size&lt;br /&gt;
* ''QPixmap'' '''pixmap()''': a pixmap of the entire svg rendered to the current size&lt;br /&gt;
* '''paint(QPainter painter, QPointF point)'''&lt;br /&gt;
* '''paint(QPainter painter, QPointF point, String svgElement)'''&lt;br /&gt;
* '''paint(QPainter painter, number x, number y)'''&lt;br /&gt;
* '''paint(QPainter painter, number x, number y, String svgElement)'''&lt;br /&gt;
* '''paint(QPainter painter, QRectF destination)'''&lt;br /&gt;
* '''paint(QPainter painter, QRectF destination, String svgElement)'''&lt;br /&gt;
* '''paint(QPainter painter, number y, number width, number height)'''&lt;br /&gt;
* '''paint(QPainter painter, number x, number y, number width, number height, QString svgElement)'''&lt;br /&gt;
* '''resize(number width, number height) &lt;br /&gt;
* '''resize(QSizeF size)'''&lt;br /&gt;
* '''resize()''': resizes the SVG to the document size defined in the SVG itself&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''repaintNeeded()''': emitted when the SVG is in need of a repaint, such as when the theme changes and the SVG has reloaded its data&lt;br /&gt;
&lt;br /&gt;
====FrameSvg====&lt;br /&gt;
Constructors:&lt;br /&gt;
* '''FrameSvg(String fileName)''': fileName can be a file in the desktop theme or the plasmoid package&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''multipleImages''': whether or not the svg contains multiple separate images&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setEnabledBorders(EnabledBorders borders)''': sets which borders are enabled when painting&lt;br /&gt;
* ''EnabledBorders'' '''enabledBorders()''': the borders which are enabled when painting&lt;br /&gt;
* '''resizeFrame(QSizeF size)''': resizes the frame to size&lt;br /&gt;
* ''QSizeF'' '''frameSize()''': the size of the current frame&lt;br /&gt;
* ''number'' '''marginSize(MarginEdge margin)''': the size of the margin for a given edge&lt;br /&gt;
* '''getMargins(number left, number top, number right, number bottom)''': stores the margin values in the variables passed in&lt;br /&gt;
* ''QRectF'' '''contentsRect()''': the rect containing the contents, e.g. the size of the SVG minus the space required by the enabled borders&lt;br /&gt;
* '''setElementPrefix(Location)''': sets the frame element for the given location if it exists&lt;br /&gt;
* '''setElementPrefix(String prefix)''': sets the element prefix&lt;br /&gt;
* ''boolean'' '''hasElementPrefix(String prefix)''': returns true if the SVG contains a frame with the given prefix&lt;br /&gt;
* ''boolean'' '''hasElementPrefix(Location location)''': true if the SVG contains a frame element for the given location&lt;br /&gt;
* '''prefix()'''&lt;br /&gt;
* '''mask()'''&lt;br /&gt;
* '''setCacheAllRenderedFrames(bool)'''&lt;br /&gt;
* '''cacheAllRenderedFrames()'''&lt;br /&gt;
* ''QPixmap'' '''framePixmap()''': a pixmap containing the current frame at the current size&lt;br /&gt;
* '''paintFrame(QPainter painter)'''&lt;br /&gt;
* '''paintFrame(QPainter painter, QPointF target)'''&lt;br /&gt;
* '''paintFrame(QPainter painter, QRectF target)'''&lt;br /&gt;
* '''paintFrame(QPainter painter, QRectF target, QRectF source)'''&lt;br /&gt;
&lt;br /&gt;
Enumerations&lt;br /&gt;
* '''EnabledBorder'''&lt;br /&gt;
** NoBorder&lt;br /&gt;
** TopBorder&lt;br /&gt;
** BottomBorder&lt;br /&gt;
** LeftBorder&lt;br /&gt;
** RightBorder&lt;br /&gt;
** AllBorders&lt;br /&gt;
&lt;br /&gt;
=== Painting on the Canvas  ===&lt;br /&gt;
&lt;br /&gt;
==== QColor ====&lt;br /&gt;
&lt;br /&gt;
*Constructors: &lt;br /&gt;
** QColor &lt;br /&gt;
** QColor(string colorName) &lt;br /&gt;
** QColor(number red, number green, number blue, number alpha) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''setThemeColor(ThemeColor color)''': sets the color to the appropriate ThemeColor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Read/write properties:&lt;br /&gt;
* ''number'' '''red'''&lt;br /&gt;
* ''number'' '''green'''&lt;br /&gt;
* ''number'' '''blue'''&lt;br /&gt;
* ''number'' '''alpha'''&lt;br /&gt;
* ''boolean'' '''valid'''&lt;br /&gt;
&lt;br /&gt;
==== QFont ====&lt;br /&gt;
&lt;br /&gt;
*Constructors: &lt;br /&gt;
**QFont &lt;br /&gt;
**QFont(string fontName) &lt;br /&gt;
**QFont(string fontName, number pointSize) &lt;br /&gt;
**QFont(string fontName, number pointSize, number weight) &lt;br /&gt;
**QFont(string fontName, number pointSize, number weight, boolean italic) &lt;br /&gt;
*string key &lt;br /&gt;
*string lastResortFamily &lt;br /&gt;
*string lastResortFont &lt;br /&gt;
*string defaultFamily &lt;br /&gt;
*boolean exactMatch &lt;br /&gt;
*string toString &lt;br /&gt;
*boolean bold &lt;br /&gt;
*string family &lt;br /&gt;
*boolean fixedPitch &lt;br /&gt;
*undefined fromString &lt;br /&gt;
*boolean italic &lt;br /&gt;
*boolean kerning &lt;br /&gt;
*boolean overline &lt;br /&gt;
*number pixelSize &lt;br /&gt;
*number pointSize &lt;br /&gt;
*number pointSizeF &lt;br /&gt;
*boolean strikeOut &lt;br /&gt;
*number stretch &lt;br /&gt;
*boolean underline &lt;br /&gt;
*number weight &lt;br /&gt;
*function isCopyOf &lt;br /&gt;
*function resolve&lt;br /&gt;
&lt;br /&gt;
====QPainter ====&lt;br /&gt;
* Constructors&lt;br /&gt;
** QPainter&lt;br /&gt;
** QPainter(object paintDevice): used to start a painter on a specific QWidget; rarely if ever needed in a JavaScript Plasmoid&lt;br /&gt;
* object background&lt;br /&gt;
* number backgroundMode&lt;br /&gt;
* object brush&lt;br /&gt;
* undefined setBrush&lt;br /&gt;
* object brushOrigin&lt;br /&gt;
* undefined clipping&lt;br /&gt;
* object clipPath&lt;br /&gt;
* object clipRegion&lt;br /&gt;
* number compositionMode&lt;br /&gt;
* object font&lt;br /&gt;
* number layoutDirection&lt;br /&gt;
* number opacity&lt;br /&gt;
* object pen&lt;br /&gt;
* number renderHints&lt;br /&gt;
* undefined transform&lt;br /&gt;
* object viewport&lt;br /&gt;
* boolean viewTransformEnabled&lt;br /&gt;
* object window&lt;br /&gt;
* object worldMatrix&lt;br /&gt;
* object worldTransform&lt;br /&gt;
* boolean worldMatrixEnabled&lt;br /&gt;
* object combinedMatrix&lt;br /&gt;
* object combinedTransform&lt;br /&gt;
* boolean active&lt;br /&gt;
* function begin&lt;br /&gt;
* function end&lt;br /&gt;
* function boundingRect&lt;br /&gt;
* function drawChord&lt;br /&gt;
* function drawConvexPolygon&lt;br /&gt;
* function drawArc&lt;br /&gt;
* function drawEllipse&lt;br /&gt;
* function drawImage&lt;br /&gt;
* function drawLine&lt;br /&gt;
* function drawLines&lt;br /&gt;
* function drawPath&lt;br /&gt;
* function drawPicture&lt;br /&gt;
* function drawPie&lt;br /&gt;
* function drawPixmap&lt;br /&gt;
* function drawPoint&lt;br /&gt;
* function drawPoints&lt;br /&gt;
* function drawPolygon&lt;br /&gt;
* function drawPolyline&lt;br /&gt;
* function drawRect&lt;br /&gt;
* function drawRects&lt;br /&gt;
* function drawRoundRect&lt;br /&gt;
* function drawText&lt;br /&gt;
* function drawTiledPixmap&lt;br /&gt;
* function eraseRect&lt;br /&gt;
* function fillPath&lt;br /&gt;
* function fillRect&lt;br /&gt;
* function resetMatrix&lt;br /&gt;
* function resetTransform&lt;br /&gt;
* function restore&lt;br /&gt;
* function rotate&lt;br /&gt;
* function save&lt;br /&gt;
* function scale&lt;br /&gt;
* function setClipRect&lt;br /&gt;
* function setRenderHint&lt;br /&gt;
* function shear&lt;br /&gt;
* function strokePath&lt;br /&gt;
* function testRenderHint&lt;br /&gt;
* function toString&lt;br /&gt;
* function translate&lt;br /&gt;
&lt;br /&gt;
==== QPen ====&lt;br /&gt;
*Constructors: &lt;br /&gt;
**QPen &lt;br /&gt;
* object brush&lt;br /&gt;
* object color&lt;br /&gt;
* number capStyle&lt;br /&gt;
* number joinStyle&lt;br /&gt;
* number style&lt;br /&gt;
* number dashOffset&lt;br /&gt;
* number miterLimit&lt;br /&gt;
* number width&lt;br /&gt;
* boolean solid&lt;br /&gt;
* number red&lt;br /&gt;
* number green&lt;br /&gt;
* number blue&lt;br /&gt;
* number alpha&lt;br /&gt;
* boolean valid&lt;br /&gt;
&lt;br /&gt;
==== QRectF ====&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''empty''': true if the rectangle's width or height is less than, or equal to, 0; an empty rectangle is also invalid&lt;br /&gt;
* ''boolean'' '''null''': true if the rectangle has both the width and the height set to 0; a null rectangle is also empty and not valid&lt;br /&gt;
* ''boolean'' '''valid''':  true if the rectangle has a width &amp;gt; 0 and height 0.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''left'''&lt;br /&gt;
* ''number'' '''top'''&lt;br /&gt;
* ''number'' '''bottom''' &lt;br /&gt;
* ''number'' '''right'''&lt;br /&gt;
* ''number'' '''height'''&lt;br /&gt;
* ''number'' '''width'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
&lt;br /&gt;
Constructors: &lt;br /&gt;
* '''QRectF'''&lt;br /&gt;
* '''QRectF(number x, number y, number width, number height)''': Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''adjust(number dx1, number dy1, number dx2, number dy2)''': adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle&lt;br /&gt;
* ''QRectF'' '''adjusted(number dx1, number dy1, number dx2, number dy2)''': returns a new QRectF with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of the rectangle &lt;br /&gt;
* '''translate(number dx, number dy)''': translates the rect by dx, dy&lt;br /&gt;
* '''setCoords(number x1, number y1, number x2, number y2)''': sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).&lt;br /&gt;
* '''setRect(number x, number y, number width, number height)''': sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
* ''boolean'' '''contains(number x, number y)''': returns true if the rect contains the point (x, y)&lt;br /&gt;
* '''moveBottom(number delta)'': moves the bottom by delta pixels&lt;br /&gt;
* '''moveLeft(number delta)''': moves the left by delta pixels&lt;br /&gt;
* '''moveRight(number delta)''': moves the right by delta pixels&lt;br /&gt;
* '''moveTo(number x, number y)''': moves the top left of the rect to point (x, y)&lt;br /&gt;
* '''moveTop(number delta)''': moves the top by delta pixels&lt;br /&gt;
&lt;br /&gt;
==== QSizeF ====&lt;br /&gt;
&lt;br /&gt;
*Constructors: &lt;br /&gt;
**QSizeF &lt;br /&gt;
**QSizeF(number width, number height) &lt;br /&gt;
*number height &lt;br /&gt;
*number width&lt;br /&gt;
&lt;br /&gt;
==== QPoint ====&lt;br /&gt;
&lt;br /&gt;
Constructors: &lt;br /&gt;
* '''QPoint'''&lt;br /&gt;
* '''QPoint(number x, number y)'''&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''bool'' '''null''' &lt;br /&gt;
* ''number'' '''manhattanLength '''&lt;br /&gt;
&lt;br /&gt;
Read-write propertie:&lt;br /&gt;
* ''number'' '''x '''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
&lt;br /&gt;
== Accessing Sources of Data  ==&lt;br /&gt;
&lt;br /&gt;
See the [[Development/Tutorials/Plasma/JavaScript/DataEngine|JavaScript Plasmoid DataEngine tutorials]]&lt;br /&gt;
&lt;br /&gt;
=== Global Functions to Access DataEngines and Services ===&lt;br /&gt;
* dataEngine(string name): returns a DataEngine object&lt;br /&gt;
* service(string dataEngineName, string sourceName): returns a ServiceObject, see also DataEngine::serviceForSource&lt;br /&gt;
&lt;br /&gt;
=== DataEngine ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[String]'' '''sources'''&lt;br /&gt;
* ''boolean'' '''valid'''&lt;br /&gt;
* ''String'' '''icon'''&lt;br /&gt;
* ''String'' '''name'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''sourceAdded(String sourceName)'''&lt;br /&gt;
* '''sourceRemoved(String sourceName)'''&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''serviceForSource(String sourceName)'''&lt;br /&gt;
* '''connectSource(String sourceName, Object connectTo[, number interval[, IntervalAlignment alignment] ])''': if the object passed in as the object to connect to is the plasmoid object, then the plasmoid.dataUpdated(String source, Map[String, Any] data) callback will be called if it exists&lt;br /&gt;
* '''connectAllSources(Object connectTo[, number interval[, IntervalAlignment alignment] ])''': if the object passed in as the object to connect to is the plasmoid object, then the plasmoid.dataUpdated(String source, Map[String, Any] data) callback will be called if it exists&lt;br /&gt;
* '''disconnectSource(String sourceName, Object connectedTo)''': if the object passed in as the object to connect to is the plasmoid object, then the plasmoid.dataUpdated(String source, Map[String, Any] data) callback will be called if it exists&lt;br /&gt;
* '''Data query(String sourceName)'''&lt;br /&gt;
&lt;br /&gt;
The following functions are only of interest to DataEngine reimplementations (e.g. JavaScript DataEngines):&lt;br /&gt;
&lt;br /&gt;
* '''scheduleSourcesUpdated()'''&lt;br /&gt;
* '''removeSource(String)'''&lt;br /&gt;
* '''updateAllSources()'''&lt;br /&gt;
* '''forceImmediateUpdateOfAllVisualizations()'''&lt;br /&gt;
* '''DataContainer containerForSource(String)'''&lt;br /&gt;
&lt;br /&gt;
=== Service ===&lt;br /&gt;
* function finished(Plasma::ServiceJob*)&lt;br /&gt;
* function operationsChanged()&lt;br /&gt;
* function serviceReady(Plasma::Service*)&lt;br /&gt;
* function setDestination(QString)&lt;br /&gt;
* function destination()&lt;br /&gt;
* function operationNames()&lt;br /&gt;
* function operationDescription(QString)&lt;br /&gt;
* function startOperationCall(KConfigGroup,QObject*)&lt;br /&gt;
* function startOperationCall(KConfigGroup)&lt;br /&gt;
* function isOperationEnabled(QString)&lt;br /&gt;
* function name()&lt;br /&gt;
* function associateWidget(QWidget*,QString)&lt;br /&gt;
* function disassociateWidget(QWidget*)&lt;br /&gt;
* function associateWidget(QGraphicsWidget*,QString)&lt;br /&gt;
* function disassociateWidget(QGraphicsWidget*)&lt;br /&gt;
* function parametersFromDescription(KConfigGroup)&lt;br /&gt;
&lt;br /&gt;
== Other Functions and Classes  ==&lt;br /&gt;
=== Print and Debug ===&lt;br /&gt;
* '''print(string message)''': prints message to console&lt;br /&gt;
* '''debug(string message)''': print message to console if it is running in a KDE debug build&lt;br /&gt;
&lt;br /&gt;
=== GraphicsItem ===&lt;br /&gt;
This class represents an item on the canvas. Support is only provided so that GraphicsItem objects returned or taken by other objects work. There is no meaningful API provided directly in the JavaScript runtime for these objects and they should not need to be used directly.&lt;br /&gt;
&lt;br /&gt;
=== QSizePolicy ===&lt;br /&gt;
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy. This can be set on any graphics widget that you have using the enums provided for this (QtSizePolicy ), for example:&lt;br /&gt;
&lt;br /&gt;
button = new PushButton();&lt;br /&gt;
button.sizePolicy = QSizePolicy(QSizePolicyMaximum, QSizePolicyFixed);&lt;br /&gt;
&lt;br /&gt;
This is useful when your widgets are being laid out by a layout (specially the anchor layout).&lt;br /&gt;
&lt;br /&gt;
* ''QtSizePolicy '' '''horizontalPolicy''': The horizontal component of the size policy.&lt;br /&gt;
* ''QtSizePolicy '' '''verticalPolicy''': The vertical component of the size policy.&lt;br /&gt;
* ''number'' '''horizontalStretch''': The horizontal stretch factor of the size policy.&lt;br /&gt;
* ''number'' '''verticalStretch''': The vertical stretch factor of the size policy.&lt;br /&gt;
&lt;br /&gt;
=== IOJob ===&lt;br /&gt;
This object is returned by input/output access for asynchronous file and data access (see the section on Extensions for documentation on getUrl). It is used by connecting Javascript functions in your code to the relevant signals.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''kill()'''&lt;br /&gt;
* '''suspend()'''&lt;br /&gt;
* '''resume()'''&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''data(IOJob job, ByteArray data)''': emitted whenever data arrives. If data is empty (data.length == 0) then the transmission has completed.&lt;br /&gt;
* '''dataReq(IOJob job, ByteArray data)''': when sending data, this signal is emitted when data is requested; add the data to be sent ot the data member, or leave it empty to signal that the process is complete and there is no more data to send&lt;br /&gt;
* '''finished(IOJob job)''': emitted when the transmission has completed&lt;br /&gt;
* '''suspended(IOJob job)''': emitted when the job has been suspeneded &lt;br /&gt;
* '''resumed(IOJob job)'''&lt;br /&gt;
* '''canceled(IOJob job)'''&lt;br /&gt;
* '''connected(IOJob job)'''&lt;br /&gt;
* '''redirection(IOJob job, Url to)'''&lt;br /&gt;
* '''permanentRedirection(IOJob job, Url from, Url to)'''&lt;br /&gt;
* '''mimetype(IOJob job, String mimetype)'''&lt;br /&gt;
&lt;br /&gt;
=== QTimer ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''active''': true if active, false if not&lt;br /&gt;
* ''boolean'' '''singleShot''': true if the timer will fire once when started, false if it will fire repeatedly until stopped&lt;br /&gt;
* ''boolean'' '''interval''': the interval in milliseconds that the timer will trigger&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''start(int msec)''': starts the timer with msec as the interval&lt;br /&gt;
* '''start()''': starts the timer with the default interval&lt;br /&gt;
* '''stop()''': stops the timer&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
* '''timeout()''': this signal is emitted whenever the timer interval is reached&lt;br /&gt;
&lt;br /&gt;
=== Url ===&lt;br /&gt;
Represents a local or remote address. To create a new Url (or assign to an existing one), use the following syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;var url = new Url(&amp;quot;http://kde.org&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''string'' '''toString''': the URL as a String object&lt;br /&gt;
&lt;br /&gt;
Read-write properties (each representing a portion of the full URL):&lt;br /&gt;
* ''string'' '''protocol'''&lt;br /&gt;
* ''string'' '''host'''&lt;br /&gt;
* ''string'' '''path'''&lt;br /&gt;
* ''string'' '''user'''&lt;br /&gt;
* ''string'' '''password'''&lt;br /&gt;
&lt;br /&gt;
=== ByteArray ===&lt;br /&gt;
This class provides an array of bytes. This is often used by data centric objects, such as the Job classes returned by getUrl.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''number'' '''length''': the size of the array (number of bytes)&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''chop(number numBytes)''': chops numBytes from the end of the array&lt;br /&gt;
* ''bool'' '''equals(ByteArray other)'''&lt;br /&gt;
* ''ByteArray '''left(number len)''': return len bytes from the left of the array&lt;br /&gt;
* ''ByteArray '''mid(number pos, number len)''': returns an array of bytes starting a post and length len (if len is -1, it returns all remaining bytes)&lt;br /&gt;
* ''ByteArray '''remove(number pos, number len)''': removes len bytes starting at index pos from the array and returns it&lt;br /&gt;
* ''ByteArray '''right(number len)''': returns len bytes from the right of the array&lt;br /&gt;
* ''ByteArray '''simplified()''': returns a byte array that has whitespace removed from the start and the end, and which has each sequence of internal whitespace replaced with a single space&lt;br /&gt;
* ''ByteArray '''toBase64()''': returns the array encoded in base64&lt;br /&gt;
* ''ByteArray '''toLower()''': returns a lowercased copy of the array&lt;br /&gt;
* ''ByteArray '''toUpper()''': returns an uppercased copy of the array&lt;br /&gt;
* ''ByteArray '''trimmed()''': returns a copy of the array with whitespace remove from the start and end&lt;br /&gt;
* truncate(number pos): truncates the array at index pos&lt;br /&gt;
* ''String'' '''toLatin1String()''': returns a Latin1-ized string based on the array&lt;br /&gt;
* ''String'' '''toUtf8()''': (API v3) returns a string from the contents of the array using a Utf8 conversation&lt;br /&gt;
* ''String'' '''valueOf()''': returns the raw data in the array as a string&lt;br /&gt;
&lt;br /&gt;
== Addons (API V3) ==&lt;br /&gt;
Plasmoids may also have plugins of their own, also written in Javascript, and which are shipped separately to the Plasmoid. These are referred to as &amp;quot;Addons&amp;quot; and are packaged similarly to a Plasmoid. For more information on creating Javascript Addons, visit the [[/JavascriptAddons|Javascript Addons tutorial]].&lt;br /&gt;
&lt;br /&gt;
It is possible to list, load and be notified of new Addons having been installed for your Plasmoid.&lt;br /&gt;
&lt;br /&gt;
* ''Array[AddonInformation]'' '''listAddons(string type)''': an array of available addons of the provided type. The type name maps to the X-KDE-PluginInfo-Category entry in the Addon's metadata.desktop file. &lt;br /&gt;
* ''boolean'' '''loadAddon(String type, String id)''': load the addon with the given id and type, return true on success. In order to be notified when the addon is successfully created, add an event listener to the &amp;quot;addCreated&amp;quot; event.&lt;br /&gt;
&lt;br /&gt;
The following are the Addon events which are recognized by the Plasmoid along with the type of event objects (if any) that are passed to registered event listeners that are registered with addEventListener: &lt;br /&gt;
&lt;br /&gt;
* addonCreated: Object addOn&lt;br /&gt;
* newAddonsAvaiable&lt;br /&gt;
&lt;br /&gt;
=== AddonInformation (API V3) ===&lt;br /&gt;
&lt;br /&gt;
The AddonInformation object contains the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''id''': the id of the Addon. Can be used with loadAddon&lt;br /&gt;
* ''String'' '''name''': a string suitable for showing the user, such as in a configuration dialog&lt;br /&gt;
&lt;br /&gt;
== Extensions  ==&lt;br /&gt;
An API extension is a security controlled set of functions and objects that are loaded on demand. These extensions are requested by the widget by listing the required and the optional extensions (if any) it wants loaded in its metadata.desktop file. This way, even prior to the widget being loaded, Plasma can know what it will want. &lt;br /&gt;
&lt;br /&gt;
Required extensions are requested using the X-Plasma-RequiredExtensions key, and optional extensions with the X-Plasma-OptionalExtensions. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
X-Plasma-RequiredExtensions=FileDialog,MyCustomQScriptExtension&lt;br /&gt;
X-Plasma-OptionalExtensions=LaunchApp,HTTP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Simplified Javascript Engine then decides if the widget will actually get that extension or not. Failure to load a required extension will result in script execution being aborted.&lt;br /&gt;
&lt;br /&gt;
Each of the built-in extensions provided are described below.&lt;br /&gt;
&lt;br /&gt;
=== FileDialog ===&lt;br /&gt;
&lt;br /&gt;
Provides access to open and save dialog classes: OpenFileDialog and SaveFileDialog. Both are non-modal and run asynchronously, so the signals must be used. Other than the name difference (and resulting UI variance) the API for each is identical:&lt;br /&gt;
&lt;br /&gt;
* Constructors&lt;br /&gt;
** '''OpenFileDialog'''&lt;br /&gt;
** '''SaveFileDialog'''&lt;br /&gt;
* Properties&lt;br /&gt;
** Read Only&lt;br /&gt;
*** ''array(Url)'' '''urls''': the selected file, as a Url object&lt;br /&gt;
*** ''Url'' '''baseUrl''', the current path (minus filename) as a Url&lt;br /&gt;
*** ''string '''file''': the selected file, as a string&lt;br /&gt;
*** ''array(string)'' '''files''': selected files (plural), as an array of strings&lt;br /&gt;
** Read/Write&lt;br /&gt;
*** ''Url'' '''url''': the current Url, can be read from when the user is done or assigned before to set the starting path&lt;br /&gt;
*** ''string'' '''filter''': a string representing the mimetype filter; e.g. &amp;quot;*.cpp|C++ Source Files\n*.h|Header files&amp;quot; or &amp;quot;*.cpp&amp;quot; or &amp;quot;*.cpp|*h&amp;quot;&lt;br /&gt;
*** ''boolean'' '''localOnly''': true to show only local files, false if network locations are Ok as well&lt;br /&gt;
*** ''boolean'' '''directoriesOnly''': true to only allow selection of a directory (not a file)&lt;br /&gt;
*** ''boolean'' '''existingOnly''': true if only existing files/directories may be selected&lt;br /&gt;
* Functions&lt;br /&gt;
** '''show()''': when called, the dialog will be shown to the user&lt;br /&gt;
* Signals&lt;br /&gt;
** '''accepted(FileDialogProxy)'''': emitted when the file dialog has been successfully accepted by the user with one or more files/directories.&lt;br /&gt;
** '''finished(FileDialogProxy)''': emitted when the file dialog closes, included when cancelled/closed without being accepted&lt;br /&gt;
&lt;br /&gt;
=== LocalIO === &lt;br /&gt;
This extension allows access to local files. &lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''IOJob'' '''getUrl(Url url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''IOJob'' '''getUrl(String url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''String'' '''userDataPath([String type, String path])''':  (scripting version &amp;gt;= 4) returns the default path for user data. Called with no parameters, it returns the user's home directory. If only one string is passed in, the standard directory for that type of data in the user's home directory will be located; the following values are recognized:&lt;br /&gt;
** documents&lt;br /&gt;
** music&lt;br /&gt;
** video&lt;br /&gt;
** downloads&lt;br /&gt;
** pictures&lt;br /&gt;
** autostart&lt;br /&gt;
** desktop (should be considered deprecated for Plasma workspaces)&lt;br /&gt;
&lt;br /&gt;
If a second string is passed in, it is considered a request for a specific path and the following types are recognized:&lt;br /&gt;
** apps - Applications menu (.desktop files).&lt;br /&gt;
** autostart - Autostart directories (both XDG and kde-specific)&lt;br /&gt;
** cache - Cached information (e.g. favicons, web-pages)&lt;br /&gt;
** cgi - CGIs to run from kdehelp.&lt;br /&gt;
** config - Configuration files.&lt;br /&gt;
** data - Where applications store data.&lt;br /&gt;
** emoticons - Emoticons themes&lt;br /&gt;
** exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account.&lt;br /&gt;
** html - HTML documentation.&lt;br /&gt;
** icon - Icons, see KIconLoader.&lt;br /&gt;
** kcfg - KConfigXT config files.&lt;br /&gt;
** lib - Libraries.&lt;br /&gt;
** locale - Translation files for KLocale.&lt;br /&gt;
** mime - Mime types defined by KDE-specific .desktop files.&lt;br /&gt;
** module - Module (dynamically loaded library).&lt;br /&gt;
** qtplugins - Qt plugins (dynamically loaded objects for Qt)&lt;br /&gt;
** services - Services.&lt;br /&gt;
** servicetypes - Service types.&lt;br /&gt;
** sound - Application sounds.&lt;br /&gt;
** templates - Templates for the &amp;quot;Create new file&amp;quot; functionality.&lt;br /&gt;
** wallpaper - Wallpapers.&lt;br /&gt;
** tmp - Temporary files (specific for both current host and current user)&lt;br /&gt;
** socket - UNIX Sockets (specific for both current host and current user)&lt;br /&gt;
** xdgconf-menu - Freedesktop.org standard location for menu layout (.menu) files.&lt;br /&gt;
** xdgdata-apps - Freedesktop.org standard location for application desktop files.&lt;br /&gt;
** xdgdata-dirs - Freedesktop.org standard location for menu descriptions (.directory files).&lt;br /&gt;
** xdgdata-mime - Freedesktop.org standard location for MIME type definitions.&lt;br /&gt;
** xdgdata-icon - Freedesktop.org standard location for icons.&lt;br /&gt;
** xdgdata-pixmap - Gnome-compatibility location for pixmaps.&lt;br /&gt;
&lt;br /&gt;
The second parameter should be a specific resource to find the path to. An example might be userDataPath(&amp;quot;data&amp;quot;, &amp;quot;plasma-desktop&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== NetworkIO === &lt;br /&gt;
This extensions allows access to network addresses.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''IOJob'' '''getUrl(Url url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''IOJob'' '''getUrl(String url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
&lt;br /&gt;
=== HTTP ===&lt;br /&gt;
This extension allows access to data and files via http and https.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''IOJob'' '''getUrl(Url url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''IOJob'' '''getUrl(String url)''': attempts to fetch the file using an IOJob&lt;br /&gt;
* ''bool'' '''openUrl([string|Url] url)''': (API v4) Opens the url in the default application (or asks the user if there is no default application for the file). The url parameter may be either a string or a Url. Returns true on success, false on failure.&lt;br /&gt;
&lt;br /&gt;
=== LaunchApp ===&lt;br /&gt;
&lt;br /&gt;
Adds methods to the global plasmoid object that allow launching applications, running commands and opening files and urls.&lt;br /&gt;
&lt;br /&gt;
* ''bool'' '''runApplication(string application[, array files])''' &amp;lt;br&amp;gt;Runs an application by name (can reference an installed .desktop file as well as an executable in the user's $PATH) with an optional array of files. The file array may contain either Urls or strings. Returns true on success, false on failure.&lt;br /&gt;
* ''bool'' '''runCommand(string exe[, array args])''' &amp;lt;br&amp;gt;Runs the executable with the given arguments. Returns true on success, false on failure.&lt;br /&gt;
* ''bool'' '''openUrl([string|Url] url)''': &amp;lt;br&amp;gt;Opens the url in the default application (or asks the user if there is no default application for the file). The url parameter may be either a string or a Url. Returns true on success, false on failure.&lt;br /&gt;
* ''boolean'' '''applicationExists(String name)''': (scripting version &amp;gt;= 4) searches $PATH first, then tries in the application menu system by application storage name (aka the .desktop file name), then Name= entries for apps with installed .desktop files, then GenericName= entries for same&lt;br /&gt;
* ''mixed'' '''defaultApplication(String kind [, boolean storageId = false])''': (scripting version &amp;gt;= 4) returns the executable (or if storageId is true, then the app menu system id, e.g. its .desktop file name) of the default app. The &amp;quot;kind&amp;quot; parameter may be a well-known application type including &amp;quot;browser&amp;quot;, &amp;quot;mailer&amp;quot;, &amp;quot;filemanager&amp;quot;, &amp;quot;terminal&amp;quot;, &amp;quot;imClient&amp;quot; and &amp;quot;windowmanager&amp;quot; (or any other entry in share/apps/kcm_componentchooser/kcm_*.desktop); it may also be a mimetype (e.g. &amp;quot;application/pdf&amp;quot;). On failure, it returns false.&lt;br /&gt;
* ''String'' '''applicationPath(String name)''':  (scripting version &amp;gt;= 4) returns the full local path to a given application or .desktop file if it exists.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting</id>
		<title>KDE System Administration/PlasmaDesktopScripting</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting"/>
				<updated>2011-05-27T07:53:20Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Locating Applications and Paths */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ECMA Script Interaction With Plasma Shells ==&lt;br /&gt;
&lt;br /&gt;
It is possible to control and interact with a Plasma user interface shell such as a plasma-desktop or (starting in KDE SC 4.5) plasma-netbook session using ECMA Script (aka JavaScript). This scripting mechanism exposes containments (Desktop Activities and Panels), widgets and various other aspects of plasma-desktop configuration using the widely known and used ECMA Script language. The QtScript engine is used for the runtime environment.&lt;br /&gt;
&lt;br /&gt;
This document describes the API that is provided along with how to&lt;br /&gt;
run such scripts in plasma-desktop.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
A set of examples can be found [https://projects.kde.org/projects/kde/kdeexamples/repository/revisions/master/show/plasma/javascript/plasma-shell-scripting here] that demonstrate the use of various aspects of Plasma shell scripting.&lt;br /&gt;
&lt;br /&gt;
Contributions of additional examples are welcome and an be sent to the Plasma development mailing list (plasma-devel at kde.org) for inclusion if you do not have commit rights to the kdeexamples module.&lt;br /&gt;
&lt;br /&gt;
== Running Scripts ==&lt;br /&gt;
There are three ways that scripts can be executed in plasma-desktop:&lt;br /&gt;
&lt;br /&gt;
* '''on first run''': when plasma-desktop is started without any pre-existing configuration, any scripts in $APPDATA/plasma-desktop/init/ with a &amp;quot;.js&amp;quot; suffix are run. If there is more than one script, they are run sequentially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''on update''': when plasma-desktop is started, it will check in&lt;br /&gt;
  `kde4-config --path data`/plasma-desktop/updates/&lt;br /&gt;
with a &amp;quot;.js&amp;quot; suffix for scripts that have not yet been run. If there is more than one script which has not been run yet they will be executed serially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
A record of which update scripts have been run is kept in the application's config file in the [Updates] group. This means that if the plasma-desktop configuraiton file is removed, all the update scripts will be run again.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''interactively''': an interactive scripting dialog can be requested either via the KRunner window (Alt+F2, by default, or via the &amp;quot;Run Command&amp;quot; entry in various desktop menus) by entering &amp;quot;desktop console&amp;quot; as the search term. It can also be triggered directly via dbus with &amp;lt;code bash&amp;gt;qdbus org.kde.plasma-desktop /MainApplication showInteractiveConsole&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|This method is not available for plasma-netbook.}}&lt;br /&gt;
&lt;br /&gt;
:ECMA Script may be entered directly into this window for execution and output appears in the lower half of the window. Ctrl+E is a shortcut to run scripts, and scripts can be saved to and loaded from disk.&lt;br /&gt;
&lt;br /&gt;
:Scripts from files can also be loaded using KRunner with &amp;quot;desktop console /path/to/file&amp;quot; or via dbus with&lt;br /&gt;
&amp;lt;code bash&amp;gt;qdbus org.kde.plasma-desktop /MainApplication loadScriptInInteractiveConsole /path/to/file&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&lt;br /&gt;
Templates are named packages that contain scripts. This provides a way for common functionality to be easily reused, helping to increase consistency and lower maintenance costs. Templates can be loaded from other scripts by name and they are also used to populate some parts of the user interface, such as the entries in the Add Panels menu.&lt;br /&gt;
&lt;br /&gt;
A template is a small set of files in a specified file hierarchy (or, in Plasma terms, a &amp;quot;Package&amp;quot;). In particular, a Template package contains the following files:&lt;br /&gt;
&lt;br /&gt;
* metadata.desktop: a .desktop file describing the template&lt;br /&gt;
* contents/layout.js: a Javascript file containing the actual script&lt;br /&gt;
&lt;br /&gt;
Templates are stored under share/apps/plasma/layout-templates and may be installed using `plasmapkg -t layout-template -i /path/to/package`. Template packages may also be provided as a .zip file with a .plasmalayout suffix.&lt;br /&gt;
&lt;br /&gt;
The metadata.desktop file contains the usual .desktop entries such as Name and Icon but must also contain Type=Service and ServiceTypes=Plasma/LayoutTemplate entries. If the layout is specific to a given Plasma application, such as plasma-desktop, this can be specific using X-Plasma-Shell. X-Plasma-ContainmentCategories defines what kind of layout it is with possible values being panel and desktop. Finally a X-KDE-PluginInfo-Name entry is required to provide a globally unique internal name for the Template. Here is an example of a Template that provides a Panel layout for Plasma Netbook:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Panel&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-netbook&lt;br /&gt;
X-Plasma-ContainmentCategories=panel&lt;br /&gt;
X-KDE-PluginInfo-Author=Aaron Seigo&lt;br /&gt;
X-KDE-PluginInfo-Email=aseigo@kde.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.CoolNetbookPanel&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://plasma.kde.org/&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running a template, two global variables will be accessible in read-only mode: templateName and templateComment. They will contain the Name and Comment fields of the above desktop file, and are translated if a localization is available.&lt;br /&gt;
&lt;br /&gt;
=== Examples of Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Creating panels ====&lt;br /&gt;
A good example of the use of templates is the use case that triggered the creation of this feature: the desire to make it easy for users to re-create the default panel that is created on first start. There is a Template called org.kde.plasma-desktop.defaultPanel that ships with the KDE Plasma Workspace which contains the layout for the initial default panel. This is referenced by the default Plasma Desktop init script and, because it is marked as a Panel Template in the metadata.desktop file it also shows up to the user in the Add Panels menu. When selected by the user from the menu, the exact same panel that is created on desktop start up is created for them, complete with Plasma Widgets and configuration.&lt;br /&gt;
&lt;br /&gt;
==== Automating tasks ====&lt;br /&gt;
Another example of the usefulness of templates is the &amp;quot;Find Widgets&amp;quot; template. This template, which first shipped with Plasma Desktop v4.5, provides a function for finding widgets by name. It appears in the toolbar &amp;quot;Load&amp;quot; and &amp;quot;Use&amp;quot; menus in the Desktop Console in plasma-desktop, and makes finding widgets as simple as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
var template = loadTemplate('org.kde.plasma-desktop.findWidgets')&lt;br /&gt;
template.findWidgets('systemtray')&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Activity templates ====&lt;br /&gt;
Probably the most user visible use of templates are &amp;quot;Activity templates&amp;quot;. The structure of Activity templates is similar to the other use of templates, but a few extra features are provided in the metadata.desktop file. Here is an example of such an activity template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Activity Template&lt;br /&gt;
Icon=user-desktop&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-desktop&lt;br /&gt;
X-Plasma-ContainmentCategories=desktop&lt;br /&gt;
X-Plasma-ContainmentLayout-ExecuteOnCreation=dolphin $desktop, gwenview $pictures&lt;br /&gt;
X-Plasma-ContainmentLayout-ShowAsExisting=true&lt;br /&gt;
X-KDE-PluginInfo-Author=John Doe&lt;br /&gt;
X-KDE-PluginInfo-Email=john@doe.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.plasma-desktop.CoolTemplate&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://john.doe.org&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The layout itself is still created from the layout.js file as usual, but this template also shows as a precreated activity to the user thanks to the X-Plasma-ContainmentLayout-ShowAsExisting key. Additionally, it starts applications in the newly created activity using the X-Plasma-ContainmentLayout-ExecuteOnCreation key.&lt;br /&gt;
&lt;br /&gt;
That key is a list of commands to execute, and it supports the following variables:&lt;br /&gt;
* $desktop&lt;br /&gt;
* $autostart&lt;br /&gt;
* $documents&lt;br /&gt;
* $music&lt;br /&gt;
* $video&lt;br /&gt;
* $downloads&lt;br /&gt;
* $pictures&lt;br /&gt;
&lt;br /&gt;
They all expand into the path toward the user corresponding default folder.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
In addition to the normal ECMA Script API and the Qt-specific extensions (such as signal/slot support) provided by QtScript, the following API is provided for use by scripts.&lt;br /&gt;
&lt;br /&gt;
All of the API below, unless otherwise noted with a version noticed, appear as below in the KDE Software Compilation v4.4.0 and later. API that is not noted as being part of a given class or object is part of the global namespace.&lt;br /&gt;
&lt;br /&gt;
{{note|API compatibility is guaranteed from version to version starting with KDE Software Compilation v4.4.0.}}&lt;br /&gt;
&lt;br /&gt;
=== Version Numbers ===&lt;br /&gt;
&lt;br /&gt;
Starting with KDE SC 4.5, the version number of both the scripting API and the application is available to the script via the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''applicationVersion''': the version of the application, e.g. 0.3&lt;br /&gt;
* ''String'' '''platformVersion''': the version of the KDE Platform, e.g. 0.3&lt;br /&gt;
* ''number'' '''scriptingVersion''': the version of the scripting API; e.g. in KDE SC 4.5 this is 2&lt;br /&gt;
&lt;br /&gt;
=== Activities ===&lt;br /&gt;
Activities are the desktop layer in a plasma-desktop session and may contain widgts. In sightly more technical terms, they are desktop containments. Activities can be created, enumerated, modified and destroyed.&lt;br /&gt;
&lt;br /&gt;
New Activities can be created using the Activity constructor, like this:&lt;br /&gt;
&lt;br /&gt;
    var activity = new Activity(&amp;quot;folderview&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file). See the documentation on the Containment object class below.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''activityIds''': returns a list of integer ids of all existing Plasma activities&lt;br /&gt;
* ''Array[String]'' '''knownActivityTypes''':  (scripting version &amp;gt;= 2) a list of types of activities that can be created. This is useful to check if an Activity type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Activity'' '''activityById(number id)''': return an object representing the activity with the given id&lt;br /&gt;
* ''Activity'' '''activityForScreen(number screen[, number dekstop])''': returns an object representing the activity  currently associated with the given screen and, optionally, the given desktop.&lt;br /&gt;
* ''Array[Activity]'' '''activities()''': returns an array of all activities that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Panels ===&lt;br /&gt;
Panels can be created, enumerated, modified and destroyed. A panel object combines both a containment as well as the container itself, allowing for full control of things such as where it appears on screen and the hiding features associated with them.&lt;br /&gt;
&lt;br /&gt;
New Panels can be created using the Panel constructor, like this:&lt;br /&gt;
&lt;br /&gt;
    var panel = new Panel(&amp;quot;dock&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file).&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''panelIds''': returns a list of integer ids of all existing Plasma panels&lt;br /&gt;
* ''Array[String]'' '''knownPanelTypes''':  (scripting version &amp;gt;= 2) a list of types of panels that can be created. This is useful to check if a Panel type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Panel'' '''panelById(int id)''': returns an object representing the Panel that matches the given id&lt;br /&gt;
* ''Array[Panels]'' '''panels()''': returns an array of all panels that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Activities and Panels ===&lt;br /&gt;
Activity and Panel objects, once created by the script, or as returned by activityById, activityForScreen,&lt;br /&gt;
or panelById) provide the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id: the integer id of this activity&lt;br /&gt;
* ''String'' '''formFactor''': returns the form factor of the activity, e.g. &amp;quot;planar&amp;quot; for most desktop activities,&amp;quot;mediacenter&amp;quot; for media centers and either &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; for panels.&lt;br /&gt;
* ''Array[number]'' '''widgetIds''': a list of integer ids of all the widgets in this Activity&lt;br /&gt;
* ''Array[String]'' '''configKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''configGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
&lt;br /&gt;
as well as the following read/write properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''desktop''': the virtual desktop this activity is associated with, or -1 for none&lt;br /&gt;
* ''number'' '''screen''': the screen this activity is associated with, or -1 for none&lt;br /&gt;
* ''String'' '''name''': the name of this activity&lt;br /&gt;
* ''String'' '''wallpaperPlugin''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin to use with the Activity&lt;br /&gt;
* ''String'' '''wallpaperMode''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin mode to use with the Activity&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': (scriptingVersion &amp;gt;= 2) the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this activity and all widgets inside of it&lt;br /&gt;
* ''Widget'' '''widgetById(number id)''': returns an object representing the widget with the given id&lt;br /&gt;
* ''Widget'' '''addWidget(String name)''': adds a new widget to the activity; the name maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
  in the widget's .desktop file&lt;br /&gt;
* ''Widget'' '''addWidget(Widget widget)''': adds an existing widget to this activity; useful for moving widgets between Activities and Panels&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this Activity or Panel on the screen&lt;br /&gt;
* '''readConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the config with default for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the config&lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': (scriptingVersion &amp;gt;= 2) causes the Activity or Panel to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of panels and activities of the same type.&lt;br /&gt;
* ''Array[Widget]'' '''widgets([String type])''': (scriptingVersion &amp;gt;= 2) returns all the widgets in the Panel or Activity. If the optional type is specified, only widgets matching that type will be returned.&lt;br /&gt;
&lt;br /&gt;
In addition to all of the above properties and functions, Panel objects also provide the folowing read/write properties:&lt;br /&gt;
* ''number'' '''length''': the number of pixels along the screen edge used&lt;br /&gt;
* ''number'' '''height''': the height (or for vertical panels, the width) of the panel&lt;br /&gt;
* ''String'' '''hiding''': the hiding mode of the panel, one of &amp;quot;none&amp;quot; (for no hiding), &amp;quot;autohide&amp;quot;, &amp;quot;windowscover&amp;quot; or &amp;quot;windowsbelow&amp;quot;&lt;br /&gt;
* ''String'' '''alignment''': right, left or center alignment of the panel (for vertical panels, right corrsponds to top and left to bottom)&lt;br /&gt;
* ''String'' '''location''': returns the location of the activity (only relevant for Panels); valid values include &amp;quot;top&amp;quot;, &amp;quot;bottom&amp;quot;, &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot; and &amp;quot;floating&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Widgets ===&lt;br /&gt;
Widgets may be enumerated by calling the widgetIds property on a Activity or Panel object. With a widget id in hand, a Widget object can be retrieved by calling widgetById(id) on an Activity or Panel object. New Widgets can be created with add addWidget(String) function provided by Activity and Panel objects.&lt;br /&gt;
&lt;br /&gt;
A list of all installed widget types can be retrieved the following read-only property:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''knownWidgetTypes''' (scripting version &amp;gt;= 2)&lt;br /&gt;
&lt;br /&gt;
A Widget object provides the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id''': the id of the widget&lt;br /&gt;
* ''String'' '''type''': the plugin type of this widget&lt;br /&gt;
* ''Array[String]'' '''configKeys''': a list of all keys that are set in the current configuration&lt;br /&gt;
* ''Array[String]'' '''configGroups''': a list of all the groups in the current configuration&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
as well as the following read-write properties:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of widgets of the same type.&lt;br /&gt;
* ''QRectF'' '''geometry''': the geometry of the widget (settable)&lt;br /&gt;
* ''String'' '''globalShortcut''': the shortcut sequence (in the format used by QKeySequence, e.g. &amp;quot;Alt+F1&amp;quot;) associated with this widget&lt;br /&gt;
* ''number'' '''index''': the layout index of the widget; in a Panel this corresponds to the order the widget appears in. Changing the value of the index will change the position of the widget in Panels and may do so in some Activities as well.&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this widget&lt;br /&gt;
* '''readConfig(String key, any default)''': reads the value of key in the config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': sets key to value in the config&lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': causes the widget to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this widget on the screen&lt;br /&gt;
&lt;br /&gt;
=== Screen Geometry ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''number'' '''screenCount''': returns the number of screens connected to the computer&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QRectF'' '''screenGeometry(number screen)''': returns a rect object representing the geometry of a screen&lt;br /&gt;
&lt;br /&gt;
=== Wallpaper Plugins ===&lt;br /&gt;
&lt;br /&gt;
* ''Array[String =&amp;gt; Array[String]]'' '''knownWallpaperPlugins()''': (scripting version &amp;gt;= 4) returns a list of all installed wallpaper plugins. They keys of the array are the wallpaper plugin names. The values are arrays containing the modes available for that wallpaper plugin. The mode array may be empty, as most wallpaper plugins only offer one mode.&lt;br /&gt;
&lt;br /&gt;
=== Locating Applications and Paths ===&lt;br /&gt;
* ''boolean'' '''applicationExists(String name)''': (scripting version &amp;gt;= 4) searches $PATH first, then tries in the application menu system by application storage name (aka the .desktop file name), then Name= entries for apps with installed .desktop files, then GenericName= entries for same&lt;br /&gt;
* ''mixed'' '''defaultApplication(String kind [, boolean storageId = false])''': (scripting version &amp;gt;= 4) returns the executable (or if storageId is true, then the app menu system id, e.g. its .desktop file name) of the default app. The &amp;quot;kind&amp;quot; parameter may be a well-known application type including &amp;quot;browser&amp;quot;, &amp;quot;mailer&amp;quot;, &amp;quot;filemanager&amp;quot;, &amp;quot;terminal&amp;quot;, &amp;quot;imClient&amp;quot; and &amp;quot;windowmanager&amp;quot; (or any other entry in share/apps/kcm_componentchooser/kcm_*.desktop); it may also be a mimetype (e.g. &amp;quot;application/pdf&amp;quot;). On failure, it returns false.&lt;br /&gt;
* ''String'' '''applicationPath(String name)''':  (scripting version &amp;gt;= 4) returns the full local path to a given application or .desktop file if it exists.&lt;br /&gt;
* ''String'' '''userDataPath([String type, String path])''':  (scripting version &amp;gt;= 4) returns the default path for user data. Called with no parameters, it returns the user's home directory. If only one string is passed in, the standard directory for that type of data in the user's home directory will be located; the following values are recognized:&lt;br /&gt;
** documents&lt;br /&gt;
** music&lt;br /&gt;
** video&lt;br /&gt;
** downloads&lt;br /&gt;
** pictures&lt;br /&gt;
** autostart&lt;br /&gt;
** desktop (should be considered deprecated for Plasma workspaces)&lt;br /&gt;
&lt;br /&gt;
If a second string is passed in, it is considered a request for a specific path and the following types are recognized:&lt;br /&gt;
** apps - Applications menu (.desktop files).&lt;br /&gt;
** autostart - Autostart directories (both XDG and kde-specific)&lt;br /&gt;
** cache - Cached information (e.g. favicons, web-pages)&lt;br /&gt;
** cgi - CGIs to run from kdehelp.&lt;br /&gt;
** config - Configuration files.&lt;br /&gt;
** data - Where applications store data.&lt;br /&gt;
** emoticons - Emoticons themes&lt;br /&gt;
** exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account.&lt;br /&gt;
** html - HTML documentation.&lt;br /&gt;
** icon - Icons, see KIconLoader.&lt;br /&gt;
** kcfg - KConfigXT config files.&lt;br /&gt;
** lib - Libraries.&lt;br /&gt;
** locale - Translation files for KLocale.&lt;br /&gt;
** mime - Mime types defined by KDE-specific .desktop files.&lt;br /&gt;
** module - Module (dynamically loaded library).&lt;br /&gt;
** qtplugins - Qt plugins (dynamically loaded objects for Qt)&lt;br /&gt;
** services - Services.&lt;br /&gt;
** servicetypes - Service types.&lt;br /&gt;
** sound - Application sounds.&lt;br /&gt;
** templates - Templates for the &amp;quot;Create new file&amp;quot; functionality.&lt;br /&gt;
** wallpaper - Wallpapers.&lt;br /&gt;
** tmp - Temporary files (specific for both current host and current user)&lt;br /&gt;
** socket - UNIX Sockets (specific for both current host and current user)&lt;br /&gt;
** xdgconf-menu - Freedesktop.org standard location for menu layout (.menu) files.&lt;br /&gt;
** xdgdata-apps - Freedesktop.org standard location for application desktop files.&lt;br /&gt;
** xdgdata-dirs - Freedesktop.org standard location for menu descriptions (.directory files).&lt;br /&gt;
** xdgdata-mime - Freedesktop.org standard location for MIME type definitions.&lt;br /&gt;
** xdgdata-icon - Freedesktop.org standard location for icons.&lt;br /&gt;
** xdgdata-pixmap - Gnome-compatibility location for pixmaps.&lt;br /&gt;
&lt;br /&gt;
The second parameter should be a specific resource to find the path to. An example might be userDataPath(&amp;quot;data&amp;quot;, &amp;quot;plasma-desktop&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Misc. Global Properties and Functions ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''locked''': whether the desktop shell and widgets are locked or not (settable)&lt;br /&gt;
* ''string'' '''theme''': (scripting version &amp;gt;= 3) the name of the desktop theme to use for the interface, e.g. default, Air, Oxygen, etc.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''hasBattery''': whether or not the system has the ability to run on battery power, e.g. a laptop or mobile device&lt;br /&gt;
* ''boolean'' '''multihead''': (scripting version &amp;gt;= 3) true if the system is running with multiple screens in a &amp;quot;Xaphod&amp;quot; multiple display server configuration&lt;br /&gt;
* ''int'' '''multiheadScreen''': (scripting version &amp;gt;= 3) if multihead is true, contains the (real) screen id of the current screen&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''sleep(number ms)''': sleeps the script for the specified number of millseconds&lt;br /&gt;
&lt;br /&gt;
=== QRectF ===&lt;br /&gt;
A rectangle class is also provided for use with Widget, Panel and screen geometry properties and functions.&lt;br /&gt;
&lt;br /&gt;
Read-only properites:&lt;br /&gt;
* ''boolean'' '''empty''': true if the rectangle's width or height is less than, or equal to, 0; an empty rectangle is also invalid&lt;br /&gt;
* ''boolean'' '''null''': true if the rectangle has both the width and the height set to 0; a null rectangle is also empty and not valid&lt;br /&gt;
* ''boolean'' '''valid''':  true if the rectangle has a width &amp;gt; 0 and height 0.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''left'''&lt;br /&gt;
* ''number'' '''top'''&lt;br /&gt;
* ''number'' '''bottom'''&lt;br /&gt;
* ''number'' '''right'''&lt;br /&gt;
* ''number'' '''height'''&lt;br /&gt;
* ''number'' '''width'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
&lt;br /&gt;
Constructors:&lt;br /&gt;
* '''QRectF'''&lt;br /&gt;
* '''QRectF(number x, number y, number width, number height)''': Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''adjust(number dx1, number dy1, number dx2, number dy2)''': adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle&lt;br /&gt;
* ''QRectF'' '''adjusted(number dx1, number dy1, number dx2, number dy2)''': returns a new QRectF with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of the rectangle&lt;br /&gt;
* '''translate(number dx, number dy)''': translates the rect by dx, dy&lt;br /&gt;
* '''setCoords(number x1, number y1, number x2, number y2)''': sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).&lt;br /&gt;
* '''setRect(number x, number y, number width, number height)''': sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
* ''boolean'' '''contains(number x, number y)''': returns true if the rect contains the point (x, y)&lt;br /&gt;
* '''moveBottom(number delta)'': moves the bottom by delta pixels&lt;br /&gt;
* '''moveLeft(number delta)''': moves the left by delta pixels&lt;br /&gt;
* '''moveRight(number delta)''': moves the right by delta pixels&lt;br /&gt;
* '''moveTo(number x, number y)''': moves the top left of the rect to point (x, y)&lt;br /&gt;
* '''moveTop(number delta)''': moves the top by delta pixels&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Keys ==&lt;br /&gt;
Here you find a list of commonly used configuration keys to use with the '''writeConfig''' command. Where the documentation notes that a key is in a subgroup, remember to first use '''currentConfigGroup'''.&lt;br /&gt;
&lt;br /&gt;
=== Common configuration keys ===&lt;br /&gt;
Here are some keys that can be used with all widgets:&lt;br /&gt;
&lt;br /&gt;
* '''Share''' (true/false): Whether or not the widget is to be announces throughout the network (Share tab)&lt;br /&gt;
&lt;br /&gt;
=== Common time and date keys ===&lt;br /&gt;
Most of the settings listed below apply to all widgets dealing with date and time (clock, digital-clock, binary-clock, …)&lt;br /&gt;
Settings for individual plasmoids can be found in their respective category and usually only affect the plasmoid’s appearance.&lt;br /&gt;
* '''announceInterval''' (number ≥ 0): Interval in minutes that the time is read out loud&lt;br /&gt;
* '''calendarType''' (local/coptic/ethopian/gregorian/gregorian-proleptic/hebrew/hijri/indian-national/jalali/japanese/julian/minguo/thai): Calendar system to be used, defaults to local&lt;br /&gt;
* '''defaultTimezone''' (Local/…): Time zone to be used&lt;br /&gt;
* '''displayHolidays''' (true/false): Whether holidays are to be displayed&lt;br /&gt;
* '''holidayRegions''' (tbd): tbd&lt;br /&gt;
* '''holidayRegionaDaysOff''' (tbd): tbd&lt;br /&gt;
* '''timeZones''' (Europe/Andorra,…): Comma-separated list of timezones to be used (e. g. Europe/Andorra,Indian/Antananarivo,Asia/Aqtau)&lt;br /&gt;
&lt;br /&gt;
=== Analog clock (clock) ===&lt;br /&gt;
* '''showSecondHand''' (true/false): self-explanatory&lt;br /&gt;
* '''showTimezoneString''' (true/false): self-explanatory&lt;br /&gt;
&lt;br /&gt;
=== Battery status (battery) ===&lt;br /&gt;
* '''showBatteryString''' (true/false): Whether or not battery status is shown as overlay for the battery icon (if in systemtray or panel)&lt;br /&gt;
* '''showMultipleBatteries''' (true/false): Whether or not battery status is shown for each battery separately&lt;br /&gt;
&lt;br /&gt;
=== Digital clock (digital-clock) ===&lt;br /&gt;
* '''plainClockColor''' (rrr,ggg,bbb): Color set for clock font (e. g. 192,0,0 - to be used with useCustomColor=true!)&lt;br /&gt;
* '''plainClockDrawShadow''' (true/false): Whether a shadow is to bed drawn (defaults to true)&lt;br /&gt;
* '''plainClockShadowColor''' (rrr,ggg,bbb): Color set for clock shadow (e. g. 64,97,128 - to be used with useCustomShadowColor=true!)&lt;br /&gt;
* '''plainClockFont''' (tbd): Font to be used for clock (e. g. Serif,12,-1,5,75,0,0,0,0,0)&lt;br /&gt;
* '''showDate''' (true/false): self-explanatory&lt;br /&gt;
* '''showDay''' (true/false): self-explanatory&lt;br /&gt;
* '''showSeconds''' (true/false): self-explanatory&lt;br /&gt;
* '''showTimezone''' (true/false): self-explanatory&lt;br /&gt;
* '''showYear''' (true/false): self-explanatory&lt;br /&gt;
* '''useCustomColor''' (true/false): Whether or not a custom color is to be used (use with plainClockColor=rrr,ggg,bbb!)&lt;br /&gt;
* '''useCustomShadowColor''' (true/false): Whether or not a custom shadow color is to be used (use with plainClockShadowColor=rrr,ggg,bbb!)&lt;br /&gt;
&lt;br /&gt;
=== Folderview (folderview) ===&lt;br /&gt;
* '''alignToGrid''' (true/false): self-explanatory&lt;br /&gt;
* '''customIconSize''' (16/22/24/32/48/…): Use custom icon size for files/folders (use only default/common icon sizes, powers of 2)&lt;br /&gt;
* '''customLabel''': Use custom title rather than default path or place name&lt;br /&gt;
* '''drawShadows''' (true/false): Whether or not file labels are to draw shadows&lt;br /&gt;
* '''filter''' (0/1/2): Defines whether a filter is to be used or not (0 = No filter, 1 = Show only matching files, 2 = Hide matching files)&lt;br /&gt;
* '''filterFiles''': Wildcard filter to filter file names&lt;br /&gt;
* '''mimeFilter''': Comma-separated list of mimetypes to be filtered (shown/hidden depends on filter-setting)&lt;br /&gt;
* '''iconsLocked''' (true/false): Whether or not icons can be moved&lt;br /&gt;
* '''numTextLines''' (number &amp;gt; 0): Amount of lines a file name can have before it is truncated&lt;br /&gt;
* '''url''': Folder URL to be displayed (e. g. desktop:/// or file:///home/yourusername)&lt;br /&gt;
* '''sortColumn''' (-1/0/1/2/3/4/5): The way files and folders are sorted (-1 = No sorting, 0 = By name, 1 = By size, 2 = By type, 3 = By date)&lt;br /&gt;
* '''sortDirsFirst''' (true/false): Whether or not folders are displayed before files (defaults to true)&lt;br /&gt;
* '''textColor''' (rrr,ggg,bbb): Color the icon labels will have&lt;br /&gt;
&lt;br /&gt;
=== Kickoff menu (launcher) ===&lt;br /&gt;
* '''SwitchTabsOnHover''' (true/false): self-explanatory&lt;br /&gt;
* '''ShowAppsByName''' (true/false): Apps are sorted by name rather than by description&lt;br /&gt;
&lt;br /&gt;
=== Pager (pager) ===&lt;br /&gt;
* '''displayedText''' (0/1/2): Text to be shown on individual virtual desktops (0 = Workspace number, 1 = Workspace title, 2 = None)&lt;br /&gt;
* '''ShowWindowIcons''' (true/false): Whether or not the application icon is to be shown on each individual window&lt;br /&gt;
* '''currentDesktopSelected''' (0/1/2): Defines what should happen if the user clicks on the virtual desktop that is currently active (0 = Nothing, 1 = Show Workspace, i. e. minimize windows, 2 = Show Dashboard)&lt;br /&gt;
* '''rows''' (number &amp;gt; 0): Amount of rows the pager should have. (Note: ''This is a global option, so you need to use '''writeGlobalConfig''' instead'')&lt;br /&gt;
&lt;br /&gt;
=== Notifications (notifications) ===&lt;br /&gt;
{{note|This applet is likely to be embedded to system tray. For Systrem Tray specific tasks, i. e. how to add, manage and remove plasmoids inside it, see sections below}}&lt;br /&gt;
* '''AutoHidePopup''' (true/false): Whether or not popups are to be hidden automatiaclly&lt;br /&gt;
* '''ShowJobs''' (true/false): Whether or not jobs are to be shown (e. g. file transfer progress)&lt;br /&gt;
* '''ShowNotifications''' (true/false): Whether or not notifications are to be shown&lt;br /&gt;
&lt;br /&gt;
=== Removable media notifier (notifier) ===&lt;br /&gt;
* '''ShowDevices''' (0/1/2): Defines what kind of devices are to be shown (0 = Removable media only, 1 = Non-removable media only, 2 = All)&lt;br /&gt;
{{note|Auto-mount settings and device actions are not stored in this Plasmoid’s settings.}}&lt;br /&gt;
&lt;br /&gt;
=== Taskbar (tasks) ===&lt;br /&gt;
* '''groupingStrategy''' (0/1/2): Defines how taskbar entries are to be grouped (0 = Never, 1 = Manually, 2 = By Program Name)&lt;br /&gt;
* '''groupWhenFull''' (true/false): Only group when taskbar is full (to be used with groupingStrategy=2 only!)&lt;br /&gt;
* '''highlightWindows''' (true/false): Highlight a window if your mouse cursor is hovering its taskbar entry (requires Desktop Compositing and “Highlight windows” effect enabled to work)&lt;br /&gt;
* '''maxRows''' (number &amp;gt; 0): Amount of rows taskbar entries can take&lt;br /&gt;
* '''forceRows''' (true/false): Force row setting for taskbar entries&lt;br /&gt;
* '''showOnlyCurrentActivity''' (true/false): Show only windows from current activity&lt;br /&gt;
* '''showOnlyCurrentDesktop''' (true/false): Show only windows from current virtual desktop&lt;br /&gt;
* '''showOnlyCurrentScreen''' (true/false): Show only windows from current screen (multi monitor setup)&lt;br /&gt;
* '''showTooltip''' (true/false): Whether or not tooltips are to be shown&lt;br /&gt;
* '''sortingStrategy''' (0/1/2/3): How taskbar entries are to be sorted (0 = Never, 1 = Manually, 2 = Alphabetically, 3 = By Desktop)&lt;br /&gt;
&lt;br /&gt;
=== System Tray ===&lt;br /&gt;
The System Tray has some unique behaviors since it can host widgets and configuring it is not as easy as most other widgets, particularly when adding and removing widgets. This section will help you deal with its specific behavior.&lt;br /&gt;
&lt;br /&gt;
==== Generic System Tray configuration keys ====&lt;br /&gt;
* '''DefaultAppletAdded''' (true/false): Remembers whether the default plasmoids (networkmanagement, device manager, notifications) have already been added(??)&lt;br /&gt;
* '''ShowApplicationStatus''' (true/false): Show system tray icons of applications that belong to the group “Applications”&lt;br /&gt;
* '''ShowCommunications''' (true/false): Show system tray icons of applications that belong to the group “Applications” (i. e. Messenger, IRC chat)&lt;br /&gt;
* '''ShowHardware''' (true/false): Show system tray icons of applications that belong to the group “Hardware” (i. e. volume control, printer applet)&lt;br /&gt;
* '''ShowSystemServices''' (true/false): Show system tray icons of applications that belong to the group “System Services” (i. e. Nepomuk Indexing Agent)&lt;br /&gt;
* '''ShowUnknown''' (true/false): Show system tray icons that do not belong into one of the categories mentioned above (or that do not use KDE’s system tray protocol and thus do not provide such information)&lt;br /&gt;
* '''alwaysShown''': Comma-separated list of widgets and entries that are to be shown all the time (e. g. KMix,notifier)&lt;br /&gt;
* '''hidden''': Comma-separated list of widgets and entries that are to be hidden all the time (e. g. Nepomuk Indexing Agent,Klipper,kmail)&lt;br /&gt;
{{note|Although notifications appear to be part of the System Tray, they are handled by a separate plasmoid which is embedded to the system tray. For its configuration keys, see section above}}&lt;br /&gt;
&lt;br /&gt;
==== Add a widget to systemtray ====&lt;br /&gt;
You can not add widgets to the systemtray in a similar way like you would add them to a panel or containment using addWidget. Instead, to add, manage and remove them, you need to utilize writeConfig changing the currentConfigGroup.&lt;br /&gt;
&amp;lt;code bash&amp;gt;systray = panel.addWidget(&amp;quot;systemtray&amp;quot;)	// First add a systemtray to your panel&lt;br /&gt;
systray.currentConfigGroup = Array(&amp;quot;Applets&amp;quot;,&amp;quot;0&amp;quot;)		// then change the currentConfig Group&lt;br /&gt;
																										// to the subnode [Applets][0]. Use any number you like(?)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can “create” the plasmoid by adding a “plugin” configuration entry&lt;br /&gt;
&amp;lt;code bash&amp;gt;systray.writeConfig(&amp;quot;plugin&amp;quot;,&amp;quot;notifier&amp;quot;)	// This will add a Device Notifier Plasmoid&amp;lt;/code&amp;gt;&lt;br /&gt;
You can modify the plasmoid’s configuration by using writeConfig.&lt;br /&gt;
&amp;lt;code bash&amp;gt;systray.writeConfig(&amp;quot;property&amp;quot;,&amp;quot;value&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
To change back to the top configuration level and thus edit the systemtray plasmoid itself pass an empty array to currentConfigGroup.&lt;br /&gt;
&lt;br /&gt;
==== Edit existing widgets in systemtray ====&lt;br /&gt;
&lt;br /&gt;
==== Remove a widget from systemtray ====&lt;br /&gt;
&lt;br /&gt;
To remove a widget, simply delete the corresponding configuration group.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting</id>
		<title>KDE System Administration/PlasmaDesktopScripting</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting"/>
				<updated>2011-05-27T07:52:14Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Remove a widget from systemtray = */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ECMA Script Interaction With Plasma Shells ==&lt;br /&gt;
&lt;br /&gt;
It is possible to control and interact with a Plasma user interface shell such as a plasma-desktop or (starting in KDE SC 4.5) plasma-netbook session using ECMA Script (aka JavaScript). This scripting mechanism exposes containments (Desktop Activities and Panels), widgets and various other aspects of plasma-desktop configuration using the widely known and used ECMA Script language. The QtScript engine is used for the runtime environment.&lt;br /&gt;
&lt;br /&gt;
This document describes the API that is provided along with how to&lt;br /&gt;
run such scripts in plasma-desktop.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
A set of examples can be found [https://projects.kde.org/projects/kde/kdeexamples/repository/revisions/master/show/plasma/javascript/plasma-shell-scripting here] that demonstrate the use of various aspects of Plasma shell scripting.&lt;br /&gt;
&lt;br /&gt;
Contributions of additional examples are welcome and an be sent to the Plasma development mailing list (plasma-devel at kde.org) for inclusion if you do not have commit rights to the kdeexamples module.&lt;br /&gt;
&lt;br /&gt;
== Running Scripts ==&lt;br /&gt;
There are three ways that scripts can be executed in plasma-desktop:&lt;br /&gt;
&lt;br /&gt;
* '''on first run''': when plasma-desktop is started without any pre-existing configuration, any scripts in $APPDATA/plasma-desktop/init/ with a &amp;quot;.js&amp;quot; suffix are run. If there is more than one script, they are run sequentially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''on update''': when plasma-desktop is started, it will check in&lt;br /&gt;
  `kde4-config --path data`/plasma-desktop/updates/&lt;br /&gt;
with a &amp;quot;.js&amp;quot; suffix for scripts that have not yet been run. If there is more than one script which has not been run yet they will be executed serially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
A record of which update scripts have been run is kept in the application's config file in the [Updates] group. This means that if the plasma-desktop configuraiton file is removed, all the update scripts will be run again.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''interactively''': an interactive scripting dialog can be requested either via the KRunner window (Alt+F2, by default, or via the &amp;quot;Run Command&amp;quot; entry in various desktop menus) by entering &amp;quot;desktop console&amp;quot; as the search term. It can also be triggered directly via dbus with &amp;lt;code bash&amp;gt;qdbus org.kde.plasma-desktop /MainApplication showInteractiveConsole&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|This method is not available for plasma-netbook.}}&lt;br /&gt;
&lt;br /&gt;
:ECMA Script may be entered directly into this window for execution and output appears in the lower half of the window. Ctrl+E is a shortcut to run scripts, and scripts can be saved to and loaded from disk.&lt;br /&gt;
&lt;br /&gt;
:Scripts from files can also be loaded using KRunner with &amp;quot;desktop console /path/to/file&amp;quot; or via dbus with&lt;br /&gt;
&amp;lt;code bash&amp;gt;qdbus org.kde.plasma-desktop /MainApplication loadScriptInInteractiveConsole /path/to/file&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&lt;br /&gt;
Templates are named packages that contain scripts. This provides a way for common functionality to be easily reused, helping to increase consistency and lower maintenance costs. Templates can be loaded from other scripts by name and they are also used to populate some parts of the user interface, such as the entries in the Add Panels menu.&lt;br /&gt;
&lt;br /&gt;
A template is a small set of files in a specified file hierarchy (or, in Plasma terms, a &amp;quot;Package&amp;quot;). In particular, a Template package contains the following files:&lt;br /&gt;
&lt;br /&gt;
* metadata.desktop: a .desktop file describing the template&lt;br /&gt;
* contents/layout.js: a Javascript file containing the actual script&lt;br /&gt;
&lt;br /&gt;
Templates are stored under share/apps/plasma/layout-templates and may be installed using `plasmapkg -t layout-template -i /path/to/package`. Template packages may also be provided as a .zip file with a .plasmalayout suffix.&lt;br /&gt;
&lt;br /&gt;
The metadata.desktop file contains the usual .desktop entries such as Name and Icon but must also contain Type=Service and ServiceTypes=Plasma/LayoutTemplate entries. If the layout is specific to a given Plasma application, such as plasma-desktop, this can be specific using X-Plasma-Shell. X-Plasma-ContainmentCategories defines what kind of layout it is with possible values being panel and desktop. Finally a X-KDE-PluginInfo-Name entry is required to provide a globally unique internal name for the Template. Here is an example of a Template that provides a Panel layout for Plasma Netbook:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Panel&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-netbook&lt;br /&gt;
X-Plasma-ContainmentCategories=panel&lt;br /&gt;
X-KDE-PluginInfo-Author=Aaron Seigo&lt;br /&gt;
X-KDE-PluginInfo-Email=aseigo@kde.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.CoolNetbookPanel&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://plasma.kde.org/&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running a template, two global variables will be accessible in read-only mode: templateName and templateComment. They will contain the Name and Comment fields of the above desktop file, and are translated if a localization is available.&lt;br /&gt;
&lt;br /&gt;
=== Examples of Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Creating panels ====&lt;br /&gt;
A good example of the use of templates is the use case that triggered the creation of this feature: the desire to make it easy for users to re-create the default panel that is created on first start. There is a Template called org.kde.plasma-desktop.defaultPanel that ships with the KDE Plasma Workspace which contains the layout for the initial default panel. This is referenced by the default Plasma Desktop init script and, because it is marked as a Panel Template in the metadata.desktop file it also shows up to the user in the Add Panels menu. When selected by the user from the menu, the exact same panel that is created on desktop start up is created for them, complete with Plasma Widgets and configuration.&lt;br /&gt;
&lt;br /&gt;
==== Automating tasks ====&lt;br /&gt;
Another example of the usefulness of templates is the &amp;quot;Find Widgets&amp;quot; template. This template, which first shipped with Plasma Desktop v4.5, provides a function for finding widgets by name. It appears in the toolbar &amp;quot;Load&amp;quot; and &amp;quot;Use&amp;quot; menus in the Desktop Console in plasma-desktop, and makes finding widgets as simple as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
var template = loadTemplate('org.kde.plasma-desktop.findWidgets')&lt;br /&gt;
template.findWidgets('systemtray')&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Activity templates ====&lt;br /&gt;
Probably the most user visible use of templates are &amp;quot;Activity templates&amp;quot;. The structure of Activity templates is similar to the other use of templates, but a few extra features are provided in the metadata.desktop file. Here is an example of such an activity template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Activity Template&lt;br /&gt;
Icon=user-desktop&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-desktop&lt;br /&gt;
X-Plasma-ContainmentCategories=desktop&lt;br /&gt;
X-Plasma-ContainmentLayout-ExecuteOnCreation=dolphin $desktop, gwenview $pictures&lt;br /&gt;
X-Plasma-ContainmentLayout-ShowAsExisting=true&lt;br /&gt;
X-KDE-PluginInfo-Author=John Doe&lt;br /&gt;
X-KDE-PluginInfo-Email=john@doe.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.plasma-desktop.CoolTemplate&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://john.doe.org&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The layout itself is still created from the layout.js file as usual, but this template also shows as a precreated activity to the user thanks to the X-Plasma-ContainmentLayout-ShowAsExisting key. Additionally, it starts applications in the newly created activity using the X-Plasma-ContainmentLayout-ExecuteOnCreation key.&lt;br /&gt;
&lt;br /&gt;
That key is a list of commands to execute, and it supports the following variables:&lt;br /&gt;
* $desktop&lt;br /&gt;
* $autostart&lt;br /&gt;
* $documents&lt;br /&gt;
* $music&lt;br /&gt;
* $video&lt;br /&gt;
* $downloads&lt;br /&gt;
* $pictures&lt;br /&gt;
&lt;br /&gt;
They all expand into the path toward the user corresponding default folder.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
In addition to the normal ECMA Script API and the Qt-specific extensions (such as signal/slot support) provided by QtScript, the following API is provided for use by scripts.&lt;br /&gt;
&lt;br /&gt;
All of the API below, unless otherwise noted with a version noticed, appear as below in the KDE Software Compilation v4.4.0 and later. API that is not noted as being part of a given class or object is part of the global namespace.&lt;br /&gt;
&lt;br /&gt;
{{note|API compatibility is guaranteed from version to version starting with KDE Software Compilation v4.4.0.}}&lt;br /&gt;
&lt;br /&gt;
=== Version Numbers ===&lt;br /&gt;
&lt;br /&gt;
Starting with KDE SC 4.5, the version number of both the scripting API and the application is available to the script via the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''applicationVersion''': the version of the application, e.g. 0.3&lt;br /&gt;
* ''String'' '''platformVersion''': the version of the KDE Platform, e.g. 0.3&lt;br /&gt;
* ''number'' '''scriptingVersion''': the version of the scripting API; e.g. in KDE SC 4.5 this is 2&lt;br /&gt;
&lt;br /&gt;
=== Activities ===&lt;br /&gt;
Activities are the desktop layer in a plasma-desktop session and may contain widgts. In sightly more technical terms, they are desktop containments. Activities can be created, enumerated, modified and destroyed.&lt;br /&gt;
&lt;br /&gt;
New Activities can be created using the Activity constructor, like this:&lt;br /&gt;
&lt;br /&gt;
    var activity = new Activity(&amp;quot;folderview&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file). See the documentation on the Containment object class below.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''activityIds''': returns a list of integer ids of all existing Plasma activities&lt;br /&gt;
* ''Array[String]'' '''knownActivityTypes''':  (scripting version &amp;gt;= 2) a list of types of activities that can be created. This is useful to check if an Activity type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Activity'' '''activityById(number id)''': return an object representing the activity with the given id&lt;br /&gt;
* ''Activity'' '''activityForScreen(number screen[, number dekstop])''': returns an object representing the activity  currently associated with the given screen and, optionally, the given desktop.&lt;br /&gt;
* ''Array[Activity]'' '''activities()''': returns an array of all activities that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Panels ===&lt;br /&gt;
Panels can be created, enumerated, modified and destroyed. A panel object combines both a containment as well as the container itself, allowing for full control of things such as where it appears on screen and the hiding features associated with them.&lt;br /&gt;
&lt;br /&gt;
New Panels can be created using the Panel constructor, like this:&lt;br /&gt;
&lt;br /&gt;
    var panel = new Panel(&amp;quot;dock&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file).&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''panelIds''': returns a list of integer ids of all existing Plasma panels&lt;br /&gt;
* ''Array[String]'' '''knownPanelTypes''':  (scripting version &amp;gt;= 2) a list of types of panels that can be created. This is useful to check if a Panel type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Panel'' '''panelById(int id)''': returns an object representing the Panel that matches the given id&lt;br /&gt;
* ''Array[Panels]'' '''panels()''': returns an array of all panels that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Activities and Panels ===&lt;br /&gt;
Activity and Panel objects, once created by the script, or as returned by activityById, activityForScreen,&lt;br /&gt;
or panelById) provide the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id: the integer id of this activity&lt;br /&gt;
* ''String'' '''formFactor''': returns the form factor of the activity, e.g. &amp;quot;planar&amp;quot; for most desktop activities,&amp;quot;mediacenter&amp;quot; for media centers and either &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; for panels.&lt;br /&gt;
* ''Array[number]'' '''widgetIds''': a list of integer ids of all the widgets in this Activity&lt;br /&gt;
* ''Array[String]'' '''configKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''configGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
&lt;br /&gt;
as well as the following read/write properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''desktop''': the virtual desktop this activity is associated with, or -1 for none&lt;br /&gt;
* ''number'' '''screen''': the screen this activity is associated with, or -1 for none&lt;br /&gt;
* ''String'' '''name''': the name of this activity&lt;br /&gt;
* ''String'' '''wallpaperPlugin''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin to use with the Activity&lt;br /&gt;
* ''String'' '''wallpaperMode''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin mode to use with the Activity&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': (scriptingVersion &amp;gt;= 2) the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this activity and all widgets inside of it&lt;br /&gt;
* ''Widget'' '''widgetById(number id)''': returns an object representing the widget with the given id&lt;br /&gt;
* ''Widget'' '''addWidget(String name)''': adds a new widget to the activity; the name maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
  in the widget's .desktop file&lt;br /&gt;
* ''Widget'' '''addWidget(Widget widget)''': adds an existing widget to this activity; useful for moving widgets between Activities and Panels&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this Activity or Panel on the screen&lt;br /&gt;
* '''readConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the config with default for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the config&lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': (scriptingVersion &amp;gt;= 2) causes the Activity or Panel to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of panels and activities of the same type.&lt;br /&gt;
* ''Array[Widget]'' '''widgets([String type])''': (scriptingVersion &amp;gt;= 2) returns all the widgets in the Panel or Activity. If the optional type is specified, only widgets matching that type will be returned.&lt;br /&gt;
&lt;br /&gt;
In addition to all of the above properties and functions, Panel objects also provide the folowing read/write properties:&lt;br /&gt;
* ''number'' '''length''': the number of pixels along the screen edge used&lt;br /&gt;
* ''number'' '''height''': the height (or for vertical panels, the width) of the panel&lt;br /&gt;
* ''String'' '''hiding''': the hiding mode of the panel, one of &amp;quot;none&amp;quot; (for no hiding), &amp;quot;autohide&amp;quot;, &amp;quot;windowscover&amp;quot; or &amp;quot;windowsbelow&amp;quot;&lt;br /&gt;
* ''String'' '''alignment''': right, left or center alignment of the panel (for vertical panels, right corrsponds to top and left to bottom)&lt;br /&gt;
* ''String'' '''location''': returns the location of the activity (only relevant for Panels); valid values include &amp;quot;top&amp;quot;, &amp;quot;bottom&amp;quot;, &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot; and &amp;quot;floating&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Widgets ===&lt;br /&gt;
Widgets may be enumerated by calling the widgetIds property on a Activity or Panel object. With a widget id in hand, a Widget object can be retrieved by calling widgetById(id) on an Activity or Panel object. New Widgets can be created with add addWidget(String) function provided by Activity and Panel objects.&lt;br /&gt;
&lt;br /&gt;
A list of all installed widget types can be retrieved the following read-only property:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''knownWidgetTypes''' (scripting version &amp;gt;= 2)&lt;br /&gt;
&lt;br /&gt;
A Widget object provides the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id''': the id of the widget&lt;br /&gt;
* ''String'' '''type''': the plugin type of this widget&lt;br /&gt;
* ''Array[String]'' '''configKeys''': a list of all keys that are set in the current configuration&lt;br /&gt;
* ''Array[String]'' '''configGroups''': a list of all the groups in the current configuration&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
as well as the following read-write properties:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of widgets of the same type.&lt;br /&gt;
* ''QRectF'' '''geometry''': the geometry of the widget (settable)&lt;br /&gt;
* ''String'' '''globalShortcut''': the shortcut sequence (in the format used by QKeySequence, e.g. &amp;quot;Alt+F1&amp;quot;) associated with this widget&lt;br /&gt;
* ''number'' '''index''': the layout index of the widget; in a Panel this corresponds to the order the widget appears in. Changing the value of the index will change the position of the widget in Panels and may do so in some Activities as well.&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this widget&lt;br /&gt;
* '''readConfig(String key, any default)''': reads the value of key in the config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': sets key to value in the config&lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': causes the widget to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this widget on the screen&lt;br /&gt;
&lt;br /&gt;
=== Screen Geometry ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''number'' '''screenCount''': returns the number of screens connected to the computer&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QRectF'' '''screenGeometry(number screen)''': returns a rect object representing the geometry of a screen&lt;br /&gt;
&lt;br /&gt;
=== Wallpaper Plugins ===&lt;br /&gt;
&lt;br /&gt;
* ''Array[String =&amp;gt; Array[String]]'' '''knownWallpaperPlugins()''': (scripting version &amp;gt;= 4) returns a list of all installed wallpaper plugins. They keys of the array are the wallpaper plugin names. The values are arrays containing the modes available for that wallpaper plugin. The mode array may be empty, as most wallpaper plugins only offer one mode.&lt;br /&gt;
&lt;br /&gt;
=== Locating Applications and Paths ===&lt;br /&gt;
* ''boolean'' '''applicationExists(String name)''': (scripting version &amp;gt;= 4) searches $PATH first, then tries in the application menu system by application storage name (aka the .desktop file name), then Name= entries for apps with installed .desktop files, then GenericName= entries for same&lt;br /&gt;
* ''mixed'' '''defaultApplication(String kind [, boolean storageId = false])''': (scripting version &amp;gt;= 4) returns the executable (or if storageId is true, then the the app menu system id, e.g. its .desktop file name) of the default app. The &amp;quot;kind&amp;quot; parameter may be a well-known application type including &amp;quot;browser&amp;quot;, &amp;quot;mailer&amp;quot;, &amp;quot;filemanager&amp;quot;, &amp;quot;terminal&amp;quot;, &amp;quot;imClient&amp;quot; and &amp;quot;windowmanager&amp;quot; (or any other entry in share/apps/kcm_componentchooser/kcm_*.desktop); it may also be a mimetype (e.g. &amp;quot;application/pdf&amp;quot;). On failure, it returns false.&lt;br /&gt;
* ''String'' '''applicationPath(String name)''':  (scripting version &amp;gt;= 4) returns the full local path to a given application or .desktop file if it exists.&lt;br /&gt;
* ''String'' '''userDataPath([String type, String path])''':  (scripting version &amp;gt;= 4) returns the default path for user data. Called with no parameters, it returns the user's home directory. If only one string is passed in, the standard directory for that type of data in the user's home directory will be located; the following values are recognized:&lt;br /&gt;
** documents&lt;br /&gt;
** music&lt;br /&gt;
** video&lt;br /&gt;
** downloads&lt;br /&gt;
** pictures&lt;br /&gt;
** autostart&lt;br /&gt;
** desktop (should be considered deprecated for Plasma workspaces)&lt;br /&gt;
&lt;br /&gt;
If a second string is passed in, it is considered a request for a specific path and the following types are recognized:&lt;br /&gt;
** apps - Applications menu (.desktop files).&lt;br /&gt;
** autostart - Autostart directories (both XDG and kde-specific)&lt;br /&gt;
** cache - Cached information (e.g. favicons, web-pages)&lt;br /&gt;
** cgi - CGIs to run from kdehelp.&lt;br /&gt;
** config - Configuration files.&lt;br /&gt;
** data - Where applications store data.&lt;br /&gt;
** emoticons - Emoticons themes&lt;br /&gt;
** exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account.&lt;br /&gt;
** html - HTML documentation.&lt;br /&gt;
** icon - Icons, see KIconLoader.&lt;br /&gt;
** kcfg - KConfigXT config files.&lt;br /&gt;
** lib - Libraries.&lt;br /&gt;
** locale - Translation files for KLocale.&lt;br /&gt;
** mime - Mime types defined by KDE-specific .desktop files.&lt;br /&gt;
** module - Module (dynamically loaded library).&lt;br /&gt;
** qtplugins - Qt plugins (dynamically loaded objects for Qt)&lt;br /&gt;
** services - Services.&lt;br /&gt;
** servicetypes - Service types.&lt;br /&gt;
** sound - Application sounds.&lt;br /&gt;
** templates - Templates for the &amp;quot;Create new file&amp;quot; functionality.&lt;br /&gt;
** wallpaper - Wallpapers.&lt;br /&gt;
** tmp - Temporary files (specific for both current host and current user)&lt;br /&gt;
** socket - UNIX Sockets (specific for both current host and current user)&lt;br /&gt;
** xdgconf-menu - Freedesktop.org standard location for menu layout (.menu) files.&lt;br /&gt;
** xdgdata-apps - Freedesktop.org standard location for application desktop files.&lt;br /&gt;
** xdgdata-dirs - Freedesktop.org standard location for menu descriptions (.directory files).&lt;br /&gt;
** xdgdata-mime - Freedesktop.org standard location for MIME type definitions.&lt;br /&gt;
** xdgdata-icon - Freedesktop.org standard location for icons.&lt;br /&gt;
** xdgdata-pixmap - Gnome-compatibility location for pixmaps.&lt;br /&gt;
&lt;br /&gt;
The second parameter should be a specific resource to find the path to. An example might be userDataPath(&amp;quot;data&amp;quot;, &amp;quot;plasma-desktop&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Misc. Global Properties and Functions ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''locked''': whether the desktop shell and widgets are locked or not (settable)&lt;br /&gt;
* ''string'' '''theme''': (scripting version &amp;gt;= 3) the name of the desktop theme to use for the interface, e.g. default, Air, Oxygen, etc.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''hasBattery''': whether or not the system has the ability to run on battery power, e.g. a laptop or mobile device&lt;br /&gt;
* ''boolean'' '''multihead''': (scripting version &amp;gt;= 3) true if the system is running with multiple screens in a &amp;quot;Xaphod&amp;quot; multiple display server configuration&lt;br /&gt;
* ''int'' '''multiheadScreen''': (scripting version &amp;gt;= 3) if multihead is true, contains the (real) screen id of the current screen&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''sleep(number ms)''': sleeps the script for the specified number of millseconds&lt;br /&gt;
&lt;br /&gt;
=== QRectF ===&lt;br /&gt;
A rectangle class is also provided for use with Widget, Panel and screen geometry properties and functions.&lt;br /&gt;
&lt;br /&gt;
Read-only properites:&lt;br /&gt;
* ''boolean'' '''empty''': true if the rectangle's width or height is less than, or equal to, 0; an empty rectangle is also invalid&lt;br /&gt;
* ''boolean'' '''null''': true if the rectangle has both the width and the height set to 0; a null rectangle is also empty and not valid&lt;br /&gt;
* ''boolean'' '''valid''':  true if the rectangle has a width &amp;gt; 0 and height 0.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''left'''&lt;br /&gt;
* ''number'' '''top'''&lt;br /&gt;
* ''number'' '''bottom'''&lt;br /&gt;
* ''number'' '''right'''&lt;br /&gt;
* ''number'' '''height'''&lt;br /&gt;
* ''number'' '''width'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
&lt;br /&gt;
Constructors:&lt;br /&gt;
* '''QRectF'''&lt;br /&gt;
* '''QRectF(number x, number y, number width, number height)''': Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''adjust(number dx1, number dy1, number dx2, number dy2)''': adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle&lt;br /&gt;
* ''QRectF'' '''adjusted(number dx1, number dy1, number dx2, number dy2)''': returns a new QRectF with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of the rectangle&lt;br /&gt;
* '''translate(number dx, number dy)''': translates the rect by dx, dy&lt;br /&gt;
* '''setCoords(number x1, number y1, number x2, number y2)''': sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).&lt;br /&gt;
* '''setRect(number x, number y, number width, number height)''': sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
* ''boolean'' '''contains(number x, number y)''': returns true if the rect contains the point (x, y)&lt;br /&gt;
* '''moveBottom(number delta)'': moves the bottom by delta pixels&lt;br /&gt;
* '''moveLeft(number delta)''': moves the left by delta pixels&lt;br /&gt;
* '''moveRight(number delta)''': moves the right by delta pixels&lt;br /&gt;
* '''moveTo(number x, number y)''': moves the top left of the rect to point (x, y)&lt;br /&gt;
* '''moveTop(number delta)''': moves the top by delta pixels&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Keys ==&lt;br /&gt;
Here you find a list of commonly used configuration keys to use with the '''writeConfig''' command. Where the documentation notes that a key is in a subgroup, remember to first use '''currentConfigGroup'''.&lt;br /&gt;
&lt;br /&gt;
=== Common configuration keys ===&lt;br /&gt;
Here are some keys that can be used with all widgets:&lt;br /&gt;
&lt;br /&gt;
* '''Share''' (true/false): Whether or not the widget is to be announces throughout the network (Share tab)&lt;br /&gt;
&lt;br /&gt;
=== Common time and date keys ===&lt;br /&gt;
Most of the settings listed below apply to all widgets dealing with date and time (clock, digital-clock, binary-clock, …)&lt;br /&gt;
Settings for individual plasmoids can be found in their respective category and usually only affect the plasmoid’s appearance.&lt;br /&gt;
* '''announceInterval''' (number ≥ 0): Interval in minutes that the time is read out loud&lt;br /&gt;
* '''calendarType''' (local/coptic/ethopian/gregorian/gregorian-proleptic/hebrew/hijri/indian-national/jalali/japanese/julian/minguo/thai): Calendar system to be used, defaults to local&lt;br /&gt;
* '''defaultTimezone''' (Local/…): Time zone to be used&lt;br /&gt;
* '''displayHolidays''' (true/false): Whether holidays are to be displayed&lt;br /&gt;
* '''holidayRegions''' (tbd): tbd&lt;br /&gt;
* '''holidayRegionaDaysOff''' (tbd): tbd&lt;br /&gt;
* '''timeZones''' (Europe/Andorra,…): Comma-separated list of timezones to be used (e. g. Europe/Andorra,Indian/Antananarivo,Asia/Aqtau)&lt;br /&gt;
&lt;br /&gt;
=== Analog clock (clock) ===&lt;br /&gt;
* '''showSecondHand''' (true/false): self-explanatory&lt;br /&gt;
* '''showTimezoneString''' (true/false): self-explanatory&lt;br /&gt;
&lt;br /&gt;
=== Battery status (battery) ===&lt;br /&gt;
* '''showBatteryString''' (true/false): Whether or not battery status is shown as overlay for the battery icon (if in systemtray or panel)&lt;br /&gt;
* '''showMultipleBatteries''' (true/false): Whether or not battery status is shown for each battery separately&lt;br /&gt;
&lt;br /&gt;
=== Digital clock (digital-clock) ===&lt;br /&gt;
* '''plainClockColor''' (rrr,ggg,bbb): Color set for clock font (e. g. 192,0,0 - to be used with useCustomColor=true!)&lt;br /&gt;
* '''plainClockDrawShadow''' (true/false): Whether a shadow is to bed drawn (defaults to true)&lt;br /&gt;
* '''plainClockShadowColor''' (rrr,ggg,bbb): Color set for clock shadow (e. g. 64,97,128 - to be used with useCustomShadowColor=true!)&lt;br /&gt;
* '''plainClockFont''' (tbd): Font to be used for clock (e. g. Serif,12,-1,5,75,0,0,0,0,0)&lt;br /&gt;
* '''showDate''' (true/false): self-explanatory&lt;br /&gt;
* '''showDay''' (true/false): self-explanatory&lt;br /&gt;
* '''showSeconds''' (true/false): self-explanatory&lt;br /&gt;
* '''showTimezone''' (true/false): self-explanatory&lt;br /&gt;
* '''showYear''' (true/false): self-explanatory&lt;br /&gt;
* '''useCustomColor''' (true/false): Whether or not a custom color is to be used (use with plainClockColor=rrr,ggg,bbb!)&lt;br /&gt;
* '''useCustomShadowColor''' (true/false): Whether or not a custom shadow color is to be used (use with plainClockShadowColor=rrr,ggg,bbb!)&lt;br /&gt;
&lt;br /&gt;
=== Folderview (folderview) ===&lt;br /&gt;
* '''alignToGrid''' (true/false): self-explanatory&lt;br /&gt;
* '''customIconSize''' (16/22/24/32/48/…): Use custom icon size for files/folders (use only default/common icon sizes, powers of 2)&lt;br /&gt;
* '''customLabel''': Use custom title rather than default path or place name&lt;br /&gt;
* '''drawShadows''' (true/false): Whether or not file labels are to draw shadows&lt;br /&gt;
* '''filter''' (0/1/2): Defines whether a filter is to be used or not (0 = No filter, 1 = Show only matching files, 2 = Hide matching files)&lt;br /&gt;
* '''filterFiles''': Wildcard filter to filter file names&lt;br /&gt;
* '''mimeFilter''': Comma-separated list of mimetypes to be filtered (shown/hidden depends on filter-setting)&lt;br /&gt;
* '''iconsLocked''' (true/false): Whether or not icons can be moved&lt;br /&gt;
* '''numTextLines''' (number &amp;gt; 0): Amount of lines a file name can have before it is truncated&lt;br /&gt;
* '''url''': Folder URL to be displayed (e. g. desktop:/// or file:///home/yourusername)&lt;br /&gt;
* '''sortColumn''' (-1/0/1/2/3/4/5): The way files and folders are sorted (-1 = No sorting, 0 = By name, 1 = By size, 2 = By type, 3 = By date)&lt;br /&gt;
* '''sortDirsFirst''' (true/false): Whether or not folders are displayed before files (defaults to true)&lt;br /&gt;
* '''textColor''' (rrr,ggg,bbb): Color the icon labels will have&lt;br /&gt;
&lt;br /&gt;
=== Kickoff menu (launcher) ===&lt;br /&gt;
* '''SwitchTabsOnHover''' (true/false): self-explanatory&lt;br /&gt;
* '''ShowAppsByName''' (true/false): Apps are sorted by name rather than by description&lt;br /&gt;
&lt;br /&gt;
=== Pager (pager) ===&lt;br /&gt;
* '''displayedText''' (0/1/2): Text to be shown on individual virtual desktops (0 = Workspace number, 1 = Workspace title, 2 = None)&lt;br /&gt;
* '''ShowWindowIcons''' (true/false): Whether or not the application icon is to be shown on each individual window&lt;br /&gt;
* '''currentDesktopSelected''' (0/1/2): Defines what should happen if the user clicks on the virtual desktop that is currently active (0 = Nothing, 1 = Show Workspace, i. e. minimize windows, 2 = Show Dashboard)&lt;br /&gt;
* '''rows''' (number &amp;gt; 0): Amount of rows the pager should have. (Note: ''This is a global option, so you need to use '''writeGlobalConfig''' instead'')&lt;br /&gt;
&lt;br /&gt;
=== Notifications (notifications) ===&lt;br /&gt;
{{note|This applet is likely to be embedded to system tray. For Systrem Tray specific tasks, i. e. how to add, manage and remove plasmoids inside it, see sections below}}&lt;br /&gt;
* '''AutoHidePopup''' (true/false): Whether or not popups are to be hidden automatiaclly&lt;br /&gt;
* '''ShowJobs''' (true/false): Whether or not jobs are to be shown (e. g. file transfer progress)&lt;br /&gt;
* '''ShowNotifications''' (true/false): Whether or not notifications are to be shown&lt;br /&gt;
&lt;br /&gt;
=== Removable media notifier (notifier) ===&lt;br /&gt;
* '''ShowDevices''' (0/1/2): Defines what kind of devices are to be shown (0 = Removable media only, 1 = Non-removable media only, 2 = All)&lt;br /&gt;
{{note|Auto-mount settings and device actions are not stored in this Plasmoid’s settings.}}&lt;br /&gt;
&lt;br /&gt;
=== Taskbar (tasks) ===&lt;br /&gt;
* '''groupingStrategy''' (0/1/2): Defines how taskbar entries are to be grouped (0 = Never, 1 = Manually, 2 = By Program Name)&lt;br /&gt;
* '''groupWhenFull''' (true/false): Only group when taskbar is full (to be used with groupingStrategy=2 only!)&lt;br /&gt;
* '''highlightWindows''' (true/false): Highlight a window if your mouse cursor is hovering its taskbar entry (requires Desktop Compositing and “Highlight windows” effect enabled to work)&lt;br /&gt;
* '''maxRows''' (number &amp;gt; 0): Amount of rows taskbar entries can take&lt;br /&gt;
* '''forceRows''' (true/false): Force row setting for taskbar entries&lt;br /&gt;
* '''showOnlyCurrentActivity''' (true/false): Show only windows from current activity&lt;br /&gt;
* '''showOnlyCurrentDesktop''' (true/false): Show only windows from current virtual desktop&lt;br /&gt;
* '''showOnlyCurrentScreen''' (true/false): Show only windows from current screen (multi monitor setup)&lt;br /&gt;
* '''showTooltip''' (true/false): Whether or not tooltips are to be shown&lt;br /&gt;
* '''sortingStrategy''' (0/1/2/3): How taskbar entries are to be sorted (0 = Never, 1 = Manually, 2 = Alphabetically, 3 = By Desktop)&lt;br /&gt;
&lt;br /&gt;
=== System Tray ===&lt;br /&gt;
The System Tray has some unique behaviors since it can host widgets and configuring it is not as easy as most other widgets, particularly when adding and removing widgets. This section will help you deal with its specific behavior.&lt;br /&gt;
&lt;br /&gt;
==== Generic System Tray configuration keys ====&lt;br /&gt;
* '''DefaultAppletAdded''' (true/false): Remembers whether the default plasmoids (networkmanagement, device manager, notifications) have already been added(??)&lt;br /&gt;
* '''ShowApplicationStatus''' (true/false): Show system tray icons of applications that belong to the group “Applications”&lt;br /&gt;
* '''ShowCommunications''' (true/false): Show system tray icons of applications that belong to the group “Applications” (i. e. Messenger, IRC chat)&lt;br /&gt;
* '''ShowHardware''' (true/false): Show system tray icons of applications that belong to the group “Hardware” (i. e. volume control, printer applet)&lt;br /&gt;
* '''ShowSystemServices''' (true/false): Show system tray icons of applications that belong to the group “System Services” (i. e. Nepomuk Indexing Agent)&lt;br /&gt;
* '''ShowUnknown''' (true/false): Show system tray icons that do not belong into one of the categories mentioned above (or that do not use KDE’s system tray protocol and thus do not provide such information)&lt;br /&gt;
* '''alwaysShown''': Comma-separated list of widgets and entries that are to be shown all the time (e. g. KMix,notifier)&lt;br /&gt;
* '''hidden''': Comma-separated list of widgets and entries that are to be hidden all the time (e. g. Nepomuk Indexing Agent,Klipper,kmail)&lt;br /&gt;
{{note|Although notifications appear to be part of the System Tray, they are handled by a separate plasmoid which is embedded to the system tray. For its configuration keys, see section above}}&lt;br /&gt;
&lt;br /&gt;
==== Add a widget to systemtray ====&lt;br /&gt;
You can not add widgets to the systemtray in a similar way like you would add them to a panel or containment using addWidget. Instead, to add, manage and remove them, you need to utilize writeConfig changing the currentConfigGroup.&lt;br /&gt;
&amp;lt;code bash&amp;gt;systray = panel.addWidget(&amp;quot;systemtray&amp;quot;)	// First add a systemtray to your panel&lt;br /&gt;
systray.currentConfigGroup = Array(&amp;quot;Applets&amp;quot;,&amp;quot;0&amp;quot;)		// then change the currentConfig Group&lt;br /&gt;
																										// to the subnode [Applets][0]. Use any number you like(?)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can “create” the plasmoid by adding a “plugin” configuration entry&lt;br /&gt;
&amp;lt;code bash&amp;gt;systray.writeConfig(&amp;quot;plugin&amp;quot;,&amp;quot;notifier&amp;quot;)	// This will add a Device Notifier Plasmoid&amp;lt;/code&amp;gt;&lt;br /&gt;
You can modify the plasmoid’s configuration by using writeConfig.&lt;br /&gt;
&amp;lt;code bash&amp;gt;systray.writeConfig(&amp;quot;property&amp;quot;,&amp;quot;value&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
To change back to the top configuration level and thus edit the systemtray plasmoid itself pass an empty array to currentConfigGroup.&lt;br /&gt;
&lt;br /&gt;
==== Edit existing widgets in systemtray ====&lt;br /&gt;
&lt;br /&gt;
==== Remove a widget from systemtray ====&lt;br /&gt;
&lt;br /&gt;
To remove a widget, simply delete the corresponding configuration group.&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Git/Feature_Development_Workflow</id>
		<title>Development/Tutorials/Git/Feature Development Workflow</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Git/Feature_Development_Workflow"/>
				<updated>2011-05-19T08:52:29Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{warning|This page refers to a draft policy which is still to be agreed and implemented. Please take it as a reference for a work in progress project. }}&lt;br /&gt;
&lt;br /&gt;
These tutorials are aimed to get people started with KDE's policy for merging and integrating changes into the repositories.&lt;br /&gt;
&lt;br /&gt;
Such policies vary depending on the developer's role inside the project. Please follow the tutorial which best suits your role and profile&lt;br /&gt;
&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Simple_Branch_Development|Casual Developer]] - follow this tutorial if you simply wish to contribute features or fixes OR you are a developer without specific knowledge of git. Difficulty level: easy&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Branch_Development_With_Merge|Core Developer with git knowledge]] - follow this tutorial if you are a developer which contributes frequently AND you have a more-than-average knowledge of git. Difficulty level: manageable&lt;br /&gt;
* Repository Maintainer - follow this tutorial if you are a repository maintainer or if you want to apply for becoming one. Difficulty level: relevant&lt;br /&gt;
&lt;br /&gt;
Also, for your knowledge, you should check out these specific articles:&lt;br /&gt;
&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Which_repository_should_I_use|Which repository should I use?]]&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Rationale_and_Explanation_of_Workflow|Rationale and explanation of workflow]]&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Rebase_vs_Merge|Rebase vs. merging: why and how]]&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Staging_Phase_Explained|The staging phase explained]]&lt;br /&gt;
* Merge strategies to and from integration&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Branches_and_Commit_policies|Branches and commit policies]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some KDE Components have adopted an integration-staging-origin policy for pushing features into KDE's repositories. This document is designed to get developers started with this workflow and understand the steps involved.&lt;br /&gt;
&lt;br /&gt;
===Repositories and projects complying with this policy===&lt;br /&gt;
The following repositories/projects follow these guidelines. Any project not mentioned here is unaffected by what described&lt;br /&gt;
&lt;br /&gt;
* kde-workspace&lt;br /&gt;
* kde-runtime&lt;br /&gt;
* kdelibs (plasma only)&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
The requirements of the KDE community that this workflow aims to meet include the following items. The final workflow may not meet all of the requirements with 100% perfection and there may be some need for compromise on some points as we develop the workflow further. However, these are points of value to the KDE community which need to be addressed by the proposed git workflow:&lt;br /&gt;
&lt;br /&gt;
* low barrier of entry (easily learnable, easily practiced,) for developers with little to no git knowledge / mastery&lt;br /&gt;
* master being in a continuously stable state&lt;br /&gt;
* the ability to do integration in a branch other than master&lt;br /&gt;
* ease of bug fixing, particularly making applying the same fix to stable and integration branches clear and simple&lt;br /&gt;
* no interruption to feature development, even during freezes in preparation of Software Compilation releases&lt;br /&gt;
* a single workflow applied across all participants in the Software Compilation and, hopefully, even wider across projects hosted in KDE's git installation to keep the barrier to participation low&lt;br /&gt;
* as clean a history in the repo as possible&lt;br /&gt;
* works with existing &amp;quot;Best Practices&amp;quot; in KDE such as commit mailing lists and other communication aids as development happens (not just post-merge)&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
This approach is meant to implement proper quality evaluation into the main repositories, still allowing developers to work on anything they want, and providing a sane merging strategy which does not require any specific knowledge from the developer's side.&lt;br /&gt;
&lt;br /&gt;
This is achieved by using two separate repositories. One is ''origin'', the official project repository, where just maintainers are allowed to push, apart from special cases. The other is ''integration'', where work in progress happens, and everyone can create branches and work on that.&lt;br /&gt;
&lt;br /&gt;
There are two separate figures: developers and maintainers. Developers are people who want to work on features on a specific repositories, maintainers are the gatekeepers for those repositories. Please note the purpose of the maintainer is purely organizational: no special power over technical decision is given to maintainers.&lt;br /&gt;
&lt;br /&gt;
A developer would provide his code into a remote branch in ''integration'': as soon as this code is ready and reviewed, the maintainer would take care of merging into ''integration/master'' first, prepare for staging in ''integration/staging'', and finally merge into master when needed.&lt;br /&gt;
&lt;br /&gt;
===Setting up the development environment===&lt;br /&gt;
In the following steps, we will assume your system is set up as shown in the [http://community.kde.org/Sysadmin/GitKdeOrgManual git.kde.org user manual], especially regarding  [http://community.kde.org/Sysadmin/GitKdeOrgManual#Let_Git_rewrite_URL_prefixes automatic URL rewriting for KDE repositories] enabled.&lt;br /&gt;
&lt;br /&gt;
In the following tutorial, we'll refer to kdelibs as the main target, but this applies to any other repository using this policy.&lt;br /&gt;
&lt;br /&gt;
====Cloning the repository and adding integration====&lt;br /&gt;
To clone the repository, issue&lt;br /&gt;
&lt;br /&gt;
 git clone kde:kdelibs&lt;br /&gt;
&lt;br /&gt;
This will create a kdelibs directory containing the whole repository. You now need to add a separate remote for handling ''integration''. A remote is a repository URL, and your local clone can contain multiple repositories to track different branches. To add kdelibs' ''integration'' repository, issue inside kdelibs' clone:&lt;br /&gt;
&lt;br /&gt;
 git remote add integration kde:clones/kdelibs/dafre/kdelibs-integration&lt;br /&gt;
&lt;br /&gt;
Now, fetch from integration to retrieve the changes:&lt;br /&gt;
&lt;br /&gt;
 git fetch integration&lt;br /&gt;
&lt;br /&gt;
{{note|When working with multiple remotes, you can issue ''git fetch --all'' to update all the remotes tracked by your local copy }}&lt;br /&gt;
&lt;br /&gt;
====Creating branches====&lt;br /&gt;
You now need to get your branches set up, in particular ''integration/master''. In this example, we are creating a new branch named ''integration-master'' which would serve for this purpose in particular:&lt;br /&gt;
&lt;br /&gt;
 git checkout -b integration-master integration/master&lt;br /&gt;
&lt;br /&gt;
This command creates a local branch set to track a remote one. This branch should be the branch you'll be basing your work upon: origin/master is not meant for development!&lt;br /&gt;
&lt;br /&gt;
{{note|Advanced users might want to use ''integration'' as their origin }}&lt;br /&gt;
&lt;br /&gt;
====Using integration vs. using your own clone====&lt;br /&gt;
It is ''strongly'' advised to push your work to integration, but under some circumstances (your work is extremely big in size, you do not have a KDE Development account, etc.), it is allowed to push your branches to a separate personal clone. All work should end up into integration for being reviewed anyway.&lt;br /&gt;
&lt;br /&gt;
===Developing a new feature===&lt;br /&gt;
We'll now walk through the process needed to develop a new feature. We'll suppose you want to add a button which says &amp;quot;hello&amp;quot; to a specific part of code.&lt;br /&gt;
&lt;br /&gt;
====Creating a new branch====&lt;br /&gt;
First thing to do is creating a new branch on which to base your work on. This branch must be based upon ''integration/master''. To make sure this happens, start by issuing&lt;br /&gt;
&lt;br /&gt;
 git checkout integration-master&lt;br /&gt;
&lt;br /&gt;
Now create your branch. Give it a self-explainatory name: try to keep branches as atomic as possible, and possibly split big changes throughout multiple branches divided as per topic. In our case, we want to name our branch ''add-hello-button''. To do that, we do:&lt;br /&gt;
&lt;br /&gt;
 git checkout -b add-hello-button&lt;br /&gt;
&lt;br /&gt;
That will create our personal branch which is going to contain our work. Push your branch to integration by issuing&lt;br /&gt;
&lt;br /&gt;
 git push integration add-hello-button&lt;br /&gt;
&lt;br /&gt;
====Getting the branch reviewed====&lt;br /&gt;
Once you are done with your changes, you are ready to get your branch reviewed. This involves three easy steps:&lt;br /&gt;
&lt;br /&gt;
=====Rebase your branch onto integration/master=====&lt;br /&gt;
It is important to have your branch rebased to be ready for review. Rebasing puts your commits on top of anything else of the branch you are rebasing on, including the changes from that branch. You of course want to rebase onto ''integration/master''. To do that, issue&lt;br /&gt;
&lt;br /&gt;
 git rebase integration/master&lt;br /&gt;
&lt;br /&gt;
Be sure to fetch before doing that. At this stage, conflicts might occur: be sure to fix them and commit/push the result. You will be required to force push at this stage.&lt;br /&gt;
&lt;br /&gt;
{{warning|Rebasing must be done at this stage only: please avoid rebasing before getting reviewed or after getting reviewed if not strictly necessary }}&lt;br /&gt;
&lt;br /&gt;
=====Push your changes to integration=====&lt;br /&gt;
If you have a KDE developer account, simply&lt;br /&gt;
&lt;br /&gt;
 git push integration add-hello-button&lt;br /&gt;
&lt;br /&gt;
from within your ''add-hello-button'' branch. If you do not have one, please have your mentor push your branch for you.&lt;br /&gt;
&lt;br /&gt;
=====Submit the branch for review=====&lt;br /&gt;
Use Reviewboard for getting your branch reviewed. You can read [http://techbase.kde.org/Development/Review_Board KDE Reviewboard+Git tutorial] for getting started.&lt;br /&gt;
&lt;br /&gt;
====Getting the branch approved====&lt;br /&gt;
After your branch has been reviewed and marked as &amp;quot;Ship it!&amp;quot; at least by one of the maintainers of the code you are adding features to, your branch is ready for integration and staging. Your reviewer will inform one of the repository's maintainers of that.&lt;br /&gt;
&lt;br /&gt;
Your work is done at this stage: the maintainer will integrate and stage your branch for you, and will merge it into ''origin'' according to the project's merging policy. You will be CCMailed upon every separate step your branch will take on its way to ''origin/master''&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Git/Feature_Development_Workflow</id>
		<title>Development/Tutorials/Git/Feature Development Workflow</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Git/Feature_Development_Workflow"/>
				<updated>2011-05-19T07:12:35Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Rationale */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{warning|This page refers to a draft policy which is still to be agreed and implemented. Please take it as a reference for a work in progress project. }}&lt;br /&gt;
&lt;br /&gt;
These tutorials are aimed to get people started with KDE's policy for merging and integrating changes into the repositories.&lt;br /&gt;
&lt;br /&gt;
Such policies vary depending on the developer's role inside the project. Please follow the tutorial which best suits your role and profile&lt;br /&gt;
&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Simple_Branch_Development|Casual Developer]] - follow this tutorial if you simply wish to contribute features or fixes OR you are a developer without specific knowledge of git. Difficulty level: easy&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Branch_Development_With_Merge|Core Developer with git knowledge]] - follow this tutorial if you are a developer which contributes frequently AND you have a more-than-average knowledge of git. Difficulty level: manageable&lt;br /&gt;
* Repository Maintainer - follow this tutorial if you are a repository maintainer or if you want to apply for becoming one. Difficulty level: relevant&lt;br /&gt;
&lt;br /&gt;
Also, for your knowledge, you should check out these specific articles:&lt;br /&gt;
&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Which_repository_should_I_use|Which repository should I use?]]&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Rationale_and_Explanation_of_Workflow|Rationale and explanation of workflow]]&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Rebase_vs_Merge|Rebase vs. merging: why and how]]&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Staging_Phase_Explained|The staging phase explained]]&lt;br /&gt;
* Merge strategies to and from integration&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Branches_and_Commit_policies|Branches and commit policies]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some KDE Components have adopted an integration-staging-origin policy for pushing features into KDE's repositories. This document is designed to get developers started with this workflow and understand the steps involved.&lt;br /&gt;
&lt;br /&gt;
===Repositories and projects complying with this policy===&lt;br /&gt;
The following repositories/projects follow these guidelines. Any project not mentioned here is unaffected by what described&lt;br /&gt;
&lt;br /&gt;
* kde-workspace&lt;br /&gt;
* kde-runtime&lt;br /&gt;
* kdelibs (plasma only)&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
The requirements of the KDE community that this workflow aims to meet include:&lt;br /&gt;
&lt;br /&gt;
* master being in a continuously stable state&lt;br /&gt;
* the ability to do integration in a branch other than master&lt;br /&gt;
* ease of bug fixing, particularly making applying the same fix to stable and integration branches clear and simple&lt;br /&gt;
* no interruption to feature development, even during freezes in preparation of Software Compilation releases&lt;br /&gt;
* a single workflow applied across all participants in the Software Compilation and, hopefully, even wider across projects hosted in KDE's git installation to keep the barrier to participation low&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
This approach is meant to implement proper quality evaluation into the main repositories, still allowing developers to work on anything they want, and providing a sane merging strategy which does not require any specific knowledge from the developer's side.&lt;br /&gt;
&lt;br /&gt;
This is achieved by using two separate repositories. One is ''origin'', the official project repository, where just maintainers are allowed to push, apart from special cases. The other is ''integration'', where work in progress happens, and everyone can create branches and work on that.&lt;br /&gt;
&lt;br /&gt;
There are two separate figures: developers and maintainers. Developers are people who want to work on features on a specific repositories, maintainers are the gatekeepers for those repositories. Please note the purpose of the maintainer is purely organizational: no special power over technical decision is given to maintainers.&lt;br /&gt;
&lt;br /&gt;
A developer would provide his code into a remote branch in ''integration'': as soon as this code is ready and reviewed, the maintainer would take care of merging into ''integration/master'' first, prepare for staging in ''integration/staging'', and finally merge into master when needed.&lt;br /&gt;
&lt;br /&gt;
===Setting up the development environment===&lt;br /&gt;
In the following steps, we will assume your system is set up as shown in the [http://community.kde.org/Sysadmin/GitKdeOrgManual git.kde.org user manual], especially regarding  [http://community.kde.org/Sysadmin/GitKdeOrgManual#Let_Git_rewrite_URL_prefixes automatic URL rewriting for KDE repositories] enabled.&lt;br /&gt;
&lt;br /&gt;
In the following tutorial, we'll refer to kdelibs as the main target, but this applies to any other repository using this policy.&lt;br /&gt;
&lt;br /&gt;
====Cloning the repository and adding integration====&lt;br /&gt;
To clone the repository, issue&lt;br /&gt;
&lt;br /&gt;
 git clone kde:kdelibs&lt;br /&gt;
&lt;br /&gt;
This will create a kdelibs directory containing the whole repository. You now need to add a separate remote for handling ''integration''. A remote is a repository URL, and your local clone can contain multiple repositories to track different branches. To add kdelibs' ''integration'' repository, issue inside kdelibs' clone:&lt;br /&gt;
&lt;br /&gt;
 git remote add integration kde:clones/kdelibs/dafre/kdelibs-integration&lt;br /&gt;
&lt;br /&gt;
Now, fetch from integration to retrieve the changes:&lt;br /&gt;
&lt;br /&gt;
 git fetch integration&lt;br /&gt;
&lt;br /&gt;
{{note|When working with multiple remotes, you can issue ''git fetch --all'' to update all the remotes tracked by your local copy }}&lt;br /&gt;
&lt;br /&gt;
====Creating branches====&lt;br /&gt;
You now need to get your branches set up, in particular ''integration/master''. In this example, we are creating a new branch named ''integration-master'' which would serve for this purpose in particular:&lt;br /&gt;
&lt;br /&gt;
 git checkout -b integration-master integration/master&lt;br /&gt;
&lt;br /&gt;
This command creates a local branch set to track a remote one. This branch should be the branch you'll be basing your work upon: origin/master is not meant for development!&lt;br /&gt;
&lt;br /&gt;
{{note|Advanced users might want to use ''integration'' as their origin }}&lt;br /&gt;
&lt;br /&gt;
====Using integration vs. using your own clone====&lt;br /&gt;
It is ''strongly'' advised to push your work to integration, but under some circumstances (your work is extremely big in size, you do not have a KDE Development account, etc.), it is allowed to push your branches to a separate personal clone. All work should end up into integration for being reviewed anyway.&lt;br /&gt;
&lt;br /&gt;
===Developing a new feature===&lt;br /&gt;
We'll now walk through the process needed to develop a new feature. We'll suppose you want to add a button which says &amp;quot;hello&amp;quot; to a specific part of code.&lt;br /&gt;
&lt;br /&gt;
====Creating a new branch====&lt;br /&gt;
First thing to do is creating a new branch on which to base your work on. This branch must be based upon ''integration/master''. To make sure this happens, start by issuing&lt;br /&gt;
&lt;br /&gt;
 git checkout integration-master&lt;br /&gt;
&lt;br /&gt;
Now create your branch. Give it a self-explainatory name: try to keep branches as atomic as possible, and possibly split big changes throughout multiple branches divided as per topic. In our case, we want to name our branch ''add-hello-button''. To do that, we do:&lt;br /&gt;
&lt;br /&gt;
 git checkout -b add-hello-button&lt;br /&gt;
&lt;br /&gt;
That will create our personal branch which is going to contain our work. Push your branch to integration by issuing&lt;br /&gt;
&lt;br /&gt;
 git push integration add-hello-button&lt;br /&gt;
&lt;br /&gt;
====Getting the branch reviewed====&lt;br /&gt;
Once you are done with your changes, you are ready to get your branch reviewed. This involves three easy steps:&lt;br /&gt;
&lt;br /&gt;
=====Rebase your branch onto integration/master=====&lt;br /&gt;
It is important to have your branch rebased to be ready for review. Rebasing puts your commits on top of anything else of the branch you are rebasing on, including the changes from that branch. You of course want to rebase onto ''integration/master''. To do that, issue&lt;br /&gt;
&lt;br /&gt;
 git rebase integration/master&lt;br /&gt;
&lt;br /&gt;
Be sure to fetch before doing that. At this stage, conflicts might occur: be sure to fix them and commit/push the result. You will be required to force push at this stage.&lt;br /&gt;
&lt;br /&gt;
{{warning|Rebasing must be done at this stage only: please avoid rebasing before getting reviewed or after getting reviewed if not strictly necessary }}&lt;br /&gt;
&lt;br /&gt;
=====Push your changes to integration=====&lt;br /&gt;
If you have a KDE developer account, simply&lt;br /&gt;
&lt;br /&gt;
 git push integration add-hello-button&lt;br /&gt;
&lt;br /&gt;
from within your ''add-hello-button'' branch. If you do not have one, please have your mentor push your branch for you.&lt;br /&gt;
&lt;br /&gt;
=====Submit the branch for review=====&lt;br /&gt;
Use Reviewboard for getting your branch reviewed. You can read [http://techbase.kde.org/Development/Review_Board KDE Reviewboard+Git tutorial] for getting started.&lt;br /&gt;
&lt;br /&gt;
====Getting the branch approved====&lt;br /&gt;
After your branch has been reviewed and marked as &amp;quot;Ship it!&amp;quot; at least by one of the maintainers of the code you are adding features to, your branch is ready for integration and staging. Your reviewer will inform one of the repository's maintainers of that.&lt;br /&gt;
&lt;br /&gt;
Your work is done at this stage: the maintainer will integrate and stage your branch for you, and will merge it into ''origin'' according to the project's merging policy. You will be CCMailed upon every separate step your branch will take on its way to ''origin/master''&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting</id>
		<title>KDE System Administration/PlasmaDesktopScripting</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting"/>
				<updated>2011-05-05T15:08:36Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ECMA Script Interaction With Plasma Shells ==&lt;br /&gt;
&lt;br /&gt;
It is possible to control and interact with a Plasma user interface shell such as a plasma-desktop or (starting in KDE SC 4.5) plasma-netbook session using ECMA Script (aka JavaScript). This scripting mechanism exposes containments (Desktop Activities and Panels), widgets and various other aspects of plasma-desktop configuration using the widely known and used ECMA Script language. The QtScript engine is used for the runtime environment.&lt;br /&gt;
&lt;br /&gt;
This document describes the API that is provided along with how to&lt;br /&gt;
run such scripts in plasma-desktop.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
A set of examples can be found [https://projects.kde.org/projects/kde/kdeexamples/repository/revisions/master/show/plasma/javascript/plasma-shell-scripting here] that demonstrate the use of various aspects of Plasma shell scripting.&lt;br /&gt;
&lt;br /&gt;
Contributions of additional examples are welcome and an be sent to the Plasma development mailing list (plasma-devel at kde.org) for inclusion if you do not have commit rights to the kdeexamples module.&lt;br /&gt;
&lt;br /&gt;
== Running Scripts ==&lt;br /&gt;
There are three ways that scripts can be executed in plasma-desktop:&lt;br /&gt;
&lt;br /&gt;
* '''on first run''': when plasma-desktop is started without any pre-existing configuration, any scripts in $APPDATA/plasma-desktop/init/ with a &amp;quot;.js&amp;quot; suffix are run. If there is more than one script, they are run sequentially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''on update''': when plasma-desktop is started, it will check in&lt;br /&gt;
  `kde4-config --path data`/plasma-desktop/updates/&lt;br /&gt;
with a &amp;quot;.js&amp;quot; suffix for scripts that have not yet been run. If there is more than one script which has not been run yet they will be executed serially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
A record of which update scripts have been run is kept in the application's config file in the [Updates] group. This means that if the plasma-desktop configuraiton file is removed, all the update scripts will be run again.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''interactively''': an interactive scripting dialog can be requested either via the KRunner window (Alt+F2, by default, or via the &amp;quot;Run Command&amp;quot; entry in various desktop menus) by entering &amp;quot;desktop console&amp;quot; as the search term. It can also be triggered directly via dbus with &amp;lt;code bash&amp;gt;qdbus org.kde.plasma-desktop /MainApplication showInteractiveConsole&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|This method is not available for plasma-netbook.}}&lt;br /&gt;
&lt;br /&gt;
:ECMA Script may be entered directly into this window for execution and output appears in the lower half of the window. Ctrl+E is a shortcut to run scripts, and scripts can be saved to and loaded from disk.&lt;br /&gt;
&lt;br /&gt;
:Scripts from files can also be loaded using KRunner with &amp;quot;desktop console /path/to/file&amp;quot; or via dbus with&lt;br /&gt;
&amp;lt;code bash&amp;gt;qdbus org.kde.plasma-desktop /MainApplication loadScriptInInteractiveConsole /path/to/file&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&lt;br /&gt;
Templates are named packages that contain scripts. This provides a way for common functionality to be easily reused, helping to increase consistency and lower maintenance costs. Templates can be loaded from other scripts by name and they are also used to populate some parts of the user interface, such as the entries in the Add Panels menu.&lt;br /&gt;
&lt;br /&gt;
A template is a small set of files in a specified file hierarchy (or, in Plasma terms, a &amp;quot;Package&amp;quot;). In particular, a Template package contains the following files:&lt;br /&gt;
&lt;br /&gt;
* metadata.desktop: a .desktop file describing the template&lt;br /&gt;
* contents/layout.js: a Javascript file containing the actual script&lt;br /&gt;
&lt;br /&gt;
Templates are stored under share/apps/plasma/layout-templates and may be installed using `plasmapkg -t layout-template -i /path/to/package`. Template packages may also be provided as a .zip file with a .plasmalayout suffix.&lt;br /&gt;
&lt;br /&gt;
The metadata.desktop file contains the usual .desktop entries such as Name and Icon but must also contain Type=Service and ServiceTypes=Plasma/LayoutTemplate entries. If the layout is specific to a given Plasma application, such as plasma-desktop, this can be specific using X-Plasma-Shell. X-Plasma-ContainmentCategories defines what kind of layout it is with possible values being panel and desktop. Finally a X-KDE-PluginInfo-Name entry is required to provide a globally unique internal name for the Template. Here is an example of a Template that provides a Panel layout for Plasma Netbook:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Panel&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-netbook&lt;br /&gt;
X-Plasma-ContainmentCategories=panel&lt;br /&gt;
X-KDE-PluginInfo-Author=Aaron Seigo&lt;br /&gt;
X-KDE-PluginInfo-Email=aseigo@kde.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.CoolNetbookPanel&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://plasma.kde.org/&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running a template, two global variables will be accessible in read-only mode: templateName and templateComment. They will contain the Name and Comment fields of the above desktop file, and are translated if a localization is available.&lt;br /&gt;
&lt;br /&gt;
=== Examples of Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Creating panels ====&lt;br /&gt;
A good example of the use of templates is the use case that triggered the creation of this feature: the desire to make it easy for users to re-create the default panel that is created on first start. There is a Template called org.kde.plasma-desktop.defaultPanel that ships with the KDE Plasma Workspace which contains the layout for the initial default panel. This is referenced by the default Plasma Desktop init script and, because it is marked as a Panel Template in the metadata.desktop file it also shows up to the user in the Add Panels menu. When selected by the user from the menu, the exact same panel that is created on desktop start up is created for them, complete with Plasma Widgets and configuration.&lt;br /&gt;
&lt;br /&gt;
==== Automating tasks ====&lt;br /&gt;
Another example of the usefulness of templates is the &amp;quot;Find Widgets&amp;quot; template. This template, which first shipped with Plasma Desktop v4.5, provides a function for finding widgets by name. It appears in the toolbar &amp;quot;Load&amp;quot; and &amp;quot;Use&amp;quot; menus in the Desktop Console in plasma-desktop, and makes finding widgets as simple as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
var template = loadTemplate('org.kde.plasma-desktop.findWidgets')&lt;br /&gt;
template.findWidgets('systemtray')&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Activity templates ====&lt;br /&gt;
Probably the most user visible use of templates are &amp;quot;Activity templates&amp;quot;. The structure of Activity templates is similar to the other use of templates, but a few extra features are provided in the metadata.desktop file. Here is an example of such an activity template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Activity Template&lt;br /&gt;
Icon=user-desktop&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-desktop&lt;br /&gt;
X-Plasma-ContainmentCategories=desktop&lt;br /&gt;
X-Plasma-ContainmentLayout-ExecuteOnCreation=dolphin $desktop, gwenview $pictures&lt;br /&gt;
X-Plasma-ContainmentLayout-ShowAsExisting=true&lt;br /&gt;
X-KDE-PluginInfo-Author=John Doe&lt;br /&gt;
X-KDE-PluginInfo-Email=john@doe.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.plasma-desktop.CoolTemplate&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://john.doe.org&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The layout itself is still created from the layout.js file as usual, but this template also shows as a precreated activity to the user thanks to the X-Plasma-ContainmentLayout-ShowAsExisting key. Additionally, it starts applications in the newly created activity using the X-Plasma-ContainmentLayout-ExecuteOnCreation key.&lt;br /&gt;
&lt;br /&gt;
That key is a list of commands to execute, and it supports the following variables:&lt;br /&gt;
* $desktop&lt;br /&gt;
* $autostart&lt;br /&gt;
* $documents&lt;br /&gt;
* $music&lt;br /&gt;
* $video&lt;br /&gt;
* $downloads&lt;br /&gt;
* $pictures&lt;br /&gt;
&lt;br /&gt;
They all expand into the path toward the user corresponding default folder.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
In addition to the normal ECMA Script API and the Qt-specific extensions (such as signal/slot support) provided by QtScript, the following API is provided for use by scripts.&lt;br /&gt;
&lt;br /&gt;
All of the API below, unless otherwise noted with a version noticed, appear as below in the KDE Software Compilation v4.4.0 and later. API that is not noted as being part of a given class or object is part of the global namespace.&lt;br /&gt;
&lt;br /&gt;
{{note|API compatibility is guaranteed from version to version starting with KDE Software Compilation v4.4.0.}}&lt;br /&gt;
&lt;br /&gt;
=== Version Numbers ===&lt;br /&gt;
&lt;br /&gt;
Starting with KDE SC 4.5, the version number of both the scripting API and the application is available to the script via the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''applicationVersion''': the version of the application, e.g. 0.3&lt;br /&gt;
* ''String'' '''platformVersion''': the version of the KDE Platform, e.g. 0.3&lt;br /&gt;
* ''number'' '''scriptingVersion''': the version of the scripting API; e.g. in KDE SC 4.5 this is 2&lt;br /&gt;
&lt;br /&gt;
=== Activities ===&lt;br /&gt;
Activities are the desktop layer in a plasma-desktop session and may contain widgts. In sightly more technical terms, they are desktop containments. Activities can be created, enumerated, modified and destroyed.&lt;br /&gt;
&lt;br /&gt;
New Activities can be created using the Activity constructor, like this:&lt;br /&gt;
&lt;br /&gt;
    var activity = new Activity(&amp;quot;folderview&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file). See the documentation on the Containment object class below.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''activityIds''': returns a list of integer ids of all existing Plasma activities&lt;br /&gt;
* ''Array[String]'' '''knownActivityTypes''':  (scripting version &amp;gt;= 2) a list of types of activities that can be created. This is useful to check if an Activity type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Activity'' '''activityById(number id)''': return an object representing the activity with the given id&lt;br /&gt;
* ''Activity'' '''activityForScreen(number screen[, number dekstop])''': returns an object representing the activity  currently associated with the given screen and, optionally, the given desktop.&lt;br /&gt;
* ''Array[Activity]'' '''activities()''': returns an array of all activities that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Panels ===&lt;br /&gt;
Panels can be created, enumerated, modified and destroyed. A panel object combines both a containment as well as the container itself, allowing for full control of things such as where it appears on screen and the hiding features associated with them.&lt;br /&gt;
&lt;br /&gt;
New Panels can be created using the Panel constructor, like this:&lt;br /&gt;
&lt;br /&gt;
    var panel = new Panel(&amp;quot;dock&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file).&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''panelIds''': returns a list of integer ids of all existing Plasma panels&lt;br /&gt;
* ''Array[String]'' '''knownPanelTypes''':  (scripting version &amp;gt;= 2) a list of types of panels that can be created. This is useful to check if a Panel type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Panel'' '''panelById(int id)''': returns an object representing the Panel that matches the given id&lt;br /&gt;
* ''Array[Panels]'' '''panels()''': returns an array of all panels that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Activities and Panels ===&lt;br /&gt;
Activity and Panel objects, once created by the script, or as returned by activityById, activityForScreen,&lt;br /&gt;
or panelById) provide the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id: the integer id of this activity&lt;br /&gt;
* ''String'' '''formFactor''': returns the form factor of the activity, e.g. &amp;quot;planar&amp;quot; for most desktop activities,&amp;quot;mediacenter&amp;quot; for media centers and either &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; for panels.&lt;br /&gt;
* ''Array[number]'' '''widgetIds''': a list of integer ids of all the widgets in this Activity&lt;br /&gt;
* ''Array[String]'' '''configKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''configGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
&lt;br /&gt;
as well as the following read/write properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''desktop''': the virtual desktop this activity is associated with, or -1 for none&lt;br /&gt;
* ''number'' '''screen''': the screen this activity is associated with, or -1 for none&lt;br /&gt;
* ''String'' '''name''': the name of this activity&lt;br /&gt;
* ''String'' '''wallpaperPlugin''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin to use with the Activity&lt;br /&gt;
* ''String'' '''wallpaperMode''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin mode to use with the Activity&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': (scriptingVersion &amp;gt;= 2) the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this activity and all widgets inside of it&lt;br /&gt;
* ''Widget'' '''widgetById(number id)''': returns an object representing the widget with the given id&lt;br /&gt;
* ''Widget'' '''addWidget(String name)''': adds a new widget to the activity; the name maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
  in the widget's .desktop file&lt;br /&gt;
* ''Widget'' '''addWidget(Widget widget)''': adds an existing widget to this activity; useful for moving widgets between Activities and Panels&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this Activity or Panel on the screen&lt;br /&gt;
* '''readConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the config with default for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the config&lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': (scriptingVersion &amp;gt;= 2) causes the Activity or Panel to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of panels and activities of the same type.&lt;br /&gt;
* ''Array[Widget]'' '''widgets([String type])''': (scriptingVersion &amp;gt;= 2) returns all the widgets in the Panel or Activity. If the optional type is specified, only widgets matching that type will be returned.&lt;br /&gt;
&lt;br /&gt;
In addition to all of the above properties and functions, Panel objects also provide the folowing read/write properties:&lt;br /&gt;
* ''number'' '''length''': the number of pixels along the screen edge used&lt;br /&gt;
* ''number'' '''height''': the height (or for vertical panels, the width) of the panel&lt;br /&gt;
* ''String'' '''hiding''': the hiding mode of the panel, one of &amp;quot;none&amp;quot; (for no hiding), &amp;quot;autohide&amp;quot;, &amp;quot;windowscover&amp;quot; or &amp;quot;windowsbelow&amp;quot;&lt;br /&gt;
* ''String'' '''alignment''': right, left or center alignment of the panel (for vertical panels, right corrsponds to top and left to bottom)&lt;br /&gt;
* ''String'' '''location''': returns the location of the activity (only relevant for Panels); valid values include &amp;quot;top&amp;quot;, &amp;quot;bottom&amp;quot;, &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot; and &amp;quot;floating&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Widgets ===&lt;br /&gt;
Widgets may be enumerated by calling the widgetIds property on a Activity or Panel object. With a widget id in hand, a Widget object can be retrieved by calling widgetById(id) on an Activity or Panel object. New Widgets can be created with add addWidget(String) function provided by Activity and Panel objects.&lt;br /&gt;
&lt;br /&gt;
A list of all installed widget types can be retrieved the following read-only property:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''knownWidgetTypes''' (scripting version &amp;gt;= 2)&lt;br /&gt;
&lt;br /&gt;
A Widget object provides the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id''': the id of the widget&lt;br /&gt;
* ''String'' '''type''': the plugin type of this widget&lt;br /&gt;
* ''Array[String]'' '''configKeys''': a list of all keys that are set in the current configuration&lt;br /&gt;
* ''Array[String]'' '''configGroups''': a list of all the groups in the current configuration&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
as well as the following read-write properties:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of widgets of the same type.&lt;br /&gt;
* ''QRectF'' '''geometry''': the geometry of the widget (settable)&lt;br /&gt;
* ''String'' '''globalShortcut''': the shortcut sequence (in the format used by QKeySequence, e.g. &amp;quot;Alt+F1&amp;quot;) associated with this widget&lt;br /&gt;
* ''number'' '''index''': the layout index of the widget; in a Panel this corresponds to the order the widget appears in. Changing the value of the index will change the position of the widget in Panels and may do so in some Activities as well.&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this widget&lt;br /&gt;
* '''readConfig(String key, any default)''': reads the value of key in the config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': sets key to value in the config&lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': causes the widget to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this widget on the screen&lt;br /&gt;
&lt;br /&gt;
=== Screen Geometry ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''number'' '''screenCount''': returns the number of screens connected to the computer&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QRectF'' '''screenGeometry(number screen)''': returns a rect object representing the geometry of a screen&lt;br /&gt;
&lt;br /&gt;
=== Wallpaper Plugins ===&lt;br /&gt;
&lt;br /&gt;
* ''Array[String =&amp;gt; Array[String]]'' '''knownWallpaperPlugins()''': (scripting version &amp;gt;= 4) returns a list of all installed wallpaper plugins. They keys of the array are the wallpaper plugin names. The values are arrays containing the modes available for that wallpaper plugin. The mode array may be empty, as most wallpaper plugins only offer one mode.&lt;br /&gt;
&lt;br /&gt;
=== Locating Applications and Paths ===&lt;br /&gt;
* ''boolean'' '''applicationExists(String name)''': (scripting version &amp;gt;= 4) searches $PATH first, then tries in the application menu system by application storage name (aka the .desktop file name), then Name= entries for apps with installed .desktop files, then GenericName= entries for same&lt;br /&gt;
* ''mixed'' '''defaultApplication(String kind [, boolean storageId = false])''': (scripting version &amp;gt;= 4) returns the executable (or if storageId is true, then the the app menu system id, e.g. its .desktop file name) of the default app. The &amp;quot;kind&amp;quot; parameter may be a well-known application type including &amp;quot;browser&amp;quot;, &amp;quot;mailer&amp;quot;, &amp;quot;filemanager&amp;quot;, &amp;quot;terminal&amp;quot;, &amp;quot;imClient&amp;quot; and &amp;quot;windowmanager&amp;quot; (or any other entry in share/apps/kcm_componentchooser/kcm_*.desktop); it may also be a mimetype (e.g. &amp;quot;application/pdf&amp;quot;). On failure, it returns false.&lt;br /&gt;
* ''String'' '''applicationPath(String name)''':  (scripting version &amp;gt;= 4) returns the full local path to a given application or .desktop file if it exists.&lt;br /&gt;
* ''String'' '''userDataPath([String type, String path])''':  (scripting version &amp;gt;= 4) returns the default path for user data. Called with no parameters, it returns the user's home directory. If only one string is passed in, the standard directory for that type of data in the user's home directory will be located; the following values are recognized:&lt;br /&gt;
** documents&lt;br /&gt;
** music&lt;br /&gt;
** video&lt;br /&gt;
** downloads&lt;br /&gt;
** pictures&lt;br /&gt;
** autostart&lt;br /&gt;
** desktop (should be considered deprecated for Plasma workspaces)&lt;br /&gt;
&lt;br /&gt;
If a second string is passed in, it is considered a request for a specific path and the following types are recognized:&lt;br /&gt;
** apps - Applications menu (.desktop files).&lt;br /&gt;
** autostart - Autostart directories (both XDG and kde-specific)&lt;br /&gt;
** cache - Cached information (e.g. favicons, web-pages)&lt;br /&gt;
** cgi - CGIs to run from kdehelp.&lt;br /&gt;
** config - Configuration files.&lt;br /&gt;
** data - Where applications store data.&lt;br /&gt;
** emoticons - Emoticons themes&lt;br /&gt;
** exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account.&lt;br /&gt;
** html - HTML documentation.&lt;br /&gt;
** icon - Icons, see KIconLoader.&lt;br /&gt;
** kcfg - KConfigXT config files.&lt;br /&gt;
** lib - Libraries.&lt;br /&gt;
** locale - Translation files for KLocale.&lt;br /&gt;
** mime - Mime types defined by KDE-specific .desktop files.&lt;br /&gt;
** module - Module (dynamically loaded library).&lt;br /&gt;
** qtplugins - Qt plugins (dynamically loaded objects for Qt)&lt;br /&gt;
** services - Services.&lt;br /&gt;
** servicetypes - Service types.&lt;br /&gt;
** sound - Application sounds.&lt;br /&gt;
** templates - Templates for the &amp;quot;Create new file&amp;quot; functionality.&lt;br /&gt;
** wallpaper - Wallpapers.&lt;br /&gt;
** tmp - Temporary files (specific for both current host and current user)&lt;br /&gt;
** socket - UNIX Sockets (specific for both current host and current user)&lt;br /&gt;
** xdgconf-menu - Freedesktop.org standard location for menu layout (.menu) files.&lt;br /&gt;
** xdgdata-apps - Freedesktop.org standard location for application desktop files.&lt;br /&gt;
** xdgdata-dirs - Freedesktop.org standard location for menu descriptions (.directory files).&lt;br /&gt;
** xdgdata-mime - Freedesktop.org standard location for MIME type definitions.&lt;br /&gt;
** xdgdata-icon - Freedesktop.org standard location for icons.&lt;br /&gt;
** xdgdata-pixmap - Gnome-compatibility location for pixmaps.&lt;br /&gt;
&lt;br /&gt;
The second parameter should be a specific resource to find the path to. An example might be userDataPath(&amp;quot;data&amp;quot;, &amp;quot;plasma-desktop&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Misc. Global Properties and Functions ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''locked''': whether the desktop shell and widgets are locked or not (settable)&lt;br /&gt;
* ''string'' '''theme''': (scripting version &amp;gt;= 3) the name of the desktop theme to use for the interface, e.g. default, Air, Oxygen, etc.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''hasBattery''': whether or not the system has the ability to run on battery power, e.g. a laptop or mobile device&lt;br /&gt;
* ''boolean'' '''multihead''': (scripting version &amp;gt;= 3) true if the system is running with multiple screens in a &amp;quot;Xaphod&amp;quot; multiple display server configuration&lt;br /&gt;
* ''int'' '''multiheadScreen''': (scripting version &amp;gt;= 3) if multihead is true, contains the (real) screen id of the current screen&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''sleep(number ms)''': sleeps the script for the specified number of millseconds&lt;br /&gt;
&lt;br /&gt;
=== QRectF ===&lt;br /&gt;
A rectangle class is also provided for use with Widget, Panel and screen geometry properties and functions.&lt;br /&gt;
&lt;br /&gt;
Read-only properites:&lt;br /&gt;
* ''boolean'' '''empty''': true if the rectangle's width or height is less than, or equal to, 0; an empty rectangle is also invalid&lt;br /&gt;
* ''boolean'' '''null''': true if the rectangle has both the width and the height set to 0; a null rectangle is also empty and not valid&lt;br /&gt;
* ''boolean'' '''valid''':  true if the rectangle has a width &amp;gt; 0 and height 0.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''left'''&lt;br /&gt;
* ''number'' '''top'''&lt;br /&gt;
* ''number'' '''bottom'''&lt;br /&gt;
* ''number'' '''right'''&lt;br /&gt;
* ''number'' '''height'''&lt;br /&gt;
* ''number'' '''width'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
&lt;br /&gt;
Constructors:&lt;br /&gt;
* '''QRectF'''&lt;br /&gt;
* '''QRectF(number x, number y, number width, number height)''': Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''adjust(number dx1, number dy1, number dx2, number dy2)''': adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle&lt;br /&gt;
* ''QRectF'' '''adjusted(number dx1, number dy1, number dx2, number dy2)''': returns a new QRectF with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of the rectangle&lt;br /&gt;
* '''translate(number dx, number dy)''': translates the rect by dx, dy&lt;br /&gt;
* '''setCoords(number x1, number y1, number x2, number y2)''': sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).&lt;br /&gt;
* '''setRect(number x, number y, number width, number height)''': sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
* ''boolean'' '''contains(number x, number y)''': returns true if the rect contains the point (x, y)&lt;br /&gt;
* '''moveBottom(number delta)'': moves the bottom by delta pixels&lt;br /&gt;
* '''moveLeft(number delta)''': moves the left by delta pixels&lt;br /&gt;
* '''moveRight(number delta)''': moves the right by delta pixels&lt;br /&gt;
* '''moveTo(number x, number y)''': moves the top left of the rect to point (x, y)&lt;br /&gt;
* '''moveTop(number delta)''': moves the top by delta pixels&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration Keys ==&lt;br /&gt;
Here you find a list of commonly used configuration keys to use with the '''writeConfig''' command. Where the documentation notes that a key is in a subgroup, remember to first use '''currentConfigGroup'''.&lt;br /&gt;
&lt;br /&gt;
=== Common configuration keys ===&lt;br /&gt;
Here are some keys that can be used with all widgets:&lt;br /&gt;
&lt;br /&gt;
* '''Share''' (true/false): Whether or not the widget is to be announces throughout the network (Share tab)&lt;br /&gt;
&lt;br /&gt;
=== Digital clock (digital-clock) ===&lt;br /&gt;
* '''announceInterval''' (number ≥ 0): Interval in minutes that the time is read out loud&lt;br /&gt;
* '''calendarType''' (local/coptic/ethopian/gregorian/gregorian-proleptic/hebrew/hijri/indian-national/jalali/japanese/julian/minguo/thai): Calendar system to be used, defaults to local&lt;br /&gt;
* '''defaultTimezone''' (Local/…): Time zone to be used&lt;br /&gt;
* '''displayHolidays''' (true/false): Whether holidays are to be displayed&lt;br /&gt;
* '''holidayRegions''' (tbd): tbd&lt;br /&gt;
* '''holidayRegionaDaysOff''' (tbd): tbd&lt;br /&gt;
* '''plainClockColor''' (rrr,ggg,bbb): Color set for clock font (e. g. 192,0,0 - to be used with useCustomColor=true!)&lt;br /&gt;
* '''plainClockDrawShadow''' (true/false): Whether a shadow is to bed drawn (defaults to true)&lt;br /&gt;
* '''plainClockShadowColor''' (rrr,ggg,bbb): Color set for clock shadow (e. g. 64,97,128 - to be used with useCustomShadowColor=true!)&lt;br /&gt;
* '''plainClockFont''' (tbd): Font to be used for clock (e. g. Serif,12,-1,5,75,0,0,0,0,0)&lt;br /&gt;
* '''showDate''' (true/false): self-explanatory&lt;br /&gt;
* '''showDay''' (true/false): self-explanatory&lt;br /&gt;
* '''showSeconds''' (true/false): self-explanatory&lt;br /&gt;
* '''showTimezone''' (true/false): self-explanatory&lt;br /&gt;
* '''showYear''' (true/false): self-explanatory&lt;br /&gt;
* '''timeZones''' (Europe/Andorra,…): Comma-separated list of timezones to be used (e. g. Europe/Andorra,Indian/Antananarivo,Asia/Aqtau)&lt;br /&gt;
* '''useCustomColor''' (true/false): Whether or not a custom color is to be used (use with plainClockColor=rrr,ggg,bbb!)&lt;br /&gt;
* '''useCustomShadowColor''' (true/false): Whether or not a custom shadow color is to be used (use with plainClockShadowColor=rrr,ggg,bbb!)&lt;br /&gt;
&lt;br /&gt;
=== Folderview (folderview) ===&lt;br /&gt;
* '''alignToGrid''' (true/false): self-explanatory&lt;br /&gt;
* '''customIconSize''' (16/22/24/32/48/…): Use custom icon size for files/folders (use only default/common icon sizes, powers of 2)&lt;br /&gt;
* '''customLabel''': Use custom title rather than default path or place name&lt;br /&gt;
* '''drawShadows''' (true/false): Whether or not file labels are to draw shadows&lt;br /&gt;
* '''filter''' (0/1/2): Defines whether a filter is to be used or not (0 = No filter, 1 = Show only matching files, 2 = Hide matching files)&lt;br /&gt;
* '''filterFiles''': Wildcard filter to filter file names&lt;br /&gt;
* '''mimeFilter''': Comma-separated list of mimetypes to be filtered (shown/hidden depends on filter-setting)&lt;br /&gt;
* '''iconsLocked''' (true/false): Whether or not icons can be moved&lt;br /&gt;
* '''numTextLines''' (number &amp;gt; 0): Amount of lines a file name can have before it is truncated&lt;br /&gt;
* '''url''': Folder URL to be displayed (e. g. desktop:/// or file:///home/yourusername)&lt;br /&gt;
* '''sortColumn''' (-1/0/1/2/3/4/5): The way files and folders are sorted (-1 = No sorting, 0 = By name, 1 = By size, 2 = By type, 3 = By date)&lt;br /&gt;
* '''sortDirsFirst''' (true/false): Whether or not folders are displayed before files (defaults to true)&lt;br /&gt;
* '''textColor''' (rrr,ggg,bbb): Color the icon labels will have&lt;br /&gt;
&lt;br /&gt;
=== Kickoff menu (launcher) ===&lt;br /&gt;
* '''SwitchTabsOnHover''' (true/false): self-explanatory&lt;br /&gt;
* '''ShowAppsByName''' (true/false): Apps are sorted by name rather than by description&lt;br /&gt;
&lt;br /&gt;
=== Taskbar (tasks) ===&lt;br /&gt;
* '''groupingStrategy''' (0/1/2): Defines how taskbar entries are to be grouped (0 = Never, 1 = Manually, 2 = By Program Name)&lt;br /&gt;
* '''groupWhenFull''' (true/false): Only group when taskbar is full (to be used with groupingStrategy=2 only!)&lt;br /&gt;
* '''highlightWindows''' (true/false): Highlight a window if your mouse cursor is hovering its taskbar entry (requires Desktop Compositing and “Highlight windows” effect enabled to work)&lt;br /&gt;
* '''maxRows''' (number &amp;gt; 0): Amount of rows taskbar entries can take&lt;br /&gt;
* '''forceRows''' (true/false): Force row setting for taskbar entries&lt;br /&gt;
* '''showOnlyCurrentActivity''' (true/false): Show only windows from current activity&lt;br /&gt;
* '''showOnlyCurrentDesktop''' (true/false): Show only windows from current virtual desktop&lt;br /&gt;
* '''showOnlyCurrentScreen''' (true/false): Show only windows from current screen (multi monitor setup)&lt;br /&gt;
* '''showTooltip''' (true/false): Whether or not tooltips are to be shown&lt;br /&gt;
* '''sortingStrategy''' (0/1/2/3): How taskbar entries are to be sorted (0 = Never, 1 = Manually, 2 = Alphabetically, 3 = By Desktop)&lt;br /&gt;
&lt;br /&gt;
=== System Tray ===&lt;br /&gt;
The System Tray has some unique behaviors since it can host widgets and configuring it is not as easy as most other widgets, particularly when adding and removing widgets. This section will help you deal with its specific behavior.&lt;br /&gt;
&lt;br /&gt;
==== Generic Systemtray configuration keys ====&lt;br /&gt;
* '''DefaultAppletAdded''' (true/false): Remembers whether the default plasmoids (networkmanagement, device manager, notifications) have already been added(??)&lt;br /&gt;
* '''ShowApplicationStatus''' (true/false): Show system tray icons of applications that belong to the group “Applications”&lt;br /&gt;
* '''ShowCommunications''' (true/false): Show system tray icons of applications that belong to the group “Applications” (i. e. Messenger, IRC chat)&lt;br /&gt;
* '''ShowHardware''' (true/false): Show system tray icons of applications that belong to the group “Hardware” (i. e. volume control, printer applet)&lt;br /&gt;
* '''ShowSystemServices''' (true/false): Show system tray icons of applications that belong to the group “System Services” (i. e. Nepomuk Indexing Agent)&lt;br /&gt;
* '''ShowUnknown''' (true/false): Show system tray icons that do not belong into one of the categories mentioned above (or that do not use KDE’s system tray protocol and thus do not provide such information)&lt;br /&gt;
* '''alwaysShown''': Comma-separated list of widgets and entries that are to be shown all the time (e. g. KMix,notifier)&lt;br /&gt;
* '''hidden''': Comma-separated list of widgets and entries that are to be hidden all the time (e. g. Nepomuk Indexing Agent,Klipper,kmail)&lt;br /&gt;
&lt;br /&gt;
==== Add a widget to systemtray ====&lt;br /&gt;
You can not add widgets to the systemtray in a similar way like you would add them to a panel or containment using addWidget. Instead, to add, manage and remove them, you need to utilize writeConfig changing the currentConfigGroup.&lt;br /&gt;
&amp;lt;code bash&amp;gt;systray = panel.addWidget(&amp;quot;systemtray&amp;quot;)	// First add a systemtray to your panel&lt;br /&gt;
systray.currentConfigGroup = Array(&amp;quot;Applets&amp;quot;,&amp;quot;0&amp;quot;)		// then change the currentConfig Group&lt;br /&gt;
																										// to the subnode [Applets][0]. Use any number you like(?)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can “create” the plasmoid by adding a “plugin” configuration entry&lt;br /&gt;
&amp;lt;code bash&amp;gt;systray.writeConfig(&amp;quot;plugin&amp;quot;,&amp;quot;notifier&amp;quot;)	// This will add a Device Notifier Plasmoid&amp;lt;/code&amp;gt;&lt;br /&gt;
You can modify the plasmoid’s configuration by using writeConfig.&lt;br /&gt;
&amp;lt;code bash&amp;gt;systray.writeConfig(&amp;quot;property&amp;quot;,&amp;quot;value&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
To change back to the top configuration level and thus edit the systemtray plasmoid itself pass an empty array to currentConfigGroup.&lt;br /&gt;
&lt;br /&gt;
==== Edit existing widgets in systemtray ====&lt;br /&gt;
&lt;br /&gt;
==== Remove a widget from systemtray =====&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting</id>
		<title>KDE System Administration/PlasmaDesktopScripting</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting"/>
				<updated>2011-04-28T12:00:02Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Activity templates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ECMA Script Interaction With Plasma Shells ==&lt;br /&gt;
&lt;br /&gt;
It is possible to control and interact with a Plasma user interface shell such as a plasma-desktop or (starting in KDE SC 4.5) plasma-netbook session using ECMA Script (aka JavaScript). This scripting mechanism exposes containments (Desktop Activities and Panels), widgets and various other aspects of plasma-desktop configuration using the widely known and used ECMA Script language. The QtScript engine is used for the runtime environment.&lt;br /&gt;
&lt;br /&gt;
This document describes the API that is provided along with how to&lt;br /&gt;
run such scripts in plasma-desktop.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
A set of examples can be found [https://projects.kde.org/projects/kde/kdeexamples/repository/revisions/master/show/plasma/javascript/plasma-shell-scripting here] that demonstrate the use of various aspects of Plasma shell scripting.&lt;br /&gt;
&lt;br /&gt;
Contributions of additional examples are welcome and an be sent to the Plasma development mailing list (plasma-devel at kde.org) for inclusion if you do not have commit rights to the kdeexamples module.&lt;br /&gt;
&lt;br /&gt;
== Running Scripts ==&lt;br /&gt;
There are three ways that scripts can be executed in plasma-desktop:&lt;br /&gt;
&lt;br /&gt;
* '''on first run''': when plasma-desktop is started without any pre-existing configuration, any scripts in $APPDATA/plasma-desktop/init/ with a &amp;quot;.js&amp;quot; suffix are run. If there is more than one script, they are run sequentially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''on update''': when plasma-desktop is started, it will check in&lt;br /&gt;
  `kde4-config --path data`/plasma-desktop/updates/ &lt;br /&gt;
with a &amp;quot;.js&amp;quot; suffix for scripts that have not yet been run. If there is more than one script which has not been run yet they will be executed serially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
A record of which update scripts have been run is kept in the application's config file in the [Updates] group. This means that if the plasma-desktop configuraiton file is removed, all the update scripts will be run again.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''interactively''': an interactive scripting dialog can be requested either via the KRunner window (Alt+F2, by default, or via the &amp;quot;Run Command&amp;quot; entry in various desktop menus) by entering &amp;quot;desktop console&amp;quot; as the search term. It can also be triggered directly via dbus with &amp;lt;code bash&amp;gt;qdbus org.kde.plasma-desktop /MainApplication showInteractiveConsole&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|This method is not available for plasma-netbook.}}&lt;br /&gt;
&lt;br /&gt;
:ECMA Script may be entered directly into this window for execution and output appears in the lower half of the window. Ctrl+E is a shortcut to run scripts, and scripts can be saved to and loaded from disk.&lt;br /&gt;
&lt;br /&gt;
:Scripts from files can also be loaded using KRunner with &amp;quot;desktop console /path/to/file&amp;quot; or via dbus with&lt;br /&gt;
&amp;lt;code bash&amp;gt;qdbus org.kde.plasma-desktop /MainApplication loadScriptInInteractiveConsole /path/to/file&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&lt;br /&gt;
Templates are named packages that contain scripts. This provides a way for common functionality to be easily reused, helping to increase consistency and lower maintenance costs. Templates can be loaded from other scripts by name and they are also used to populate some parts of the user interface, such as the entries in the Add Panels menu. &lt;br /&gt;
&lt;br /&gt;
A template is a small set of files in a specified file hierarchy (or, in Plasma terms, a &amp;quot;Package&amp;quot;). In particular, a Template package contains the following files:&lt;br /&gt;
&lt;br /&gt;
* metadata.desktop: a .desktop file describing the template&lt;br /&gt;
* contents/layout.js: a Javascript file containing the actual script&lt;br /&gt;
&lt;br /&gt;
Templates are stored under share/apps/plasma/layout-templates and may be installed using `plasmapkg -t layout-template -i /path/to/package`. Template packages may also be provided as a .zip file with a .plasmalayout suffix.&lt;br /&gt;
&lt;br /&gt;
The metadata.desktop file contains the usual .desktop entries such as Name and Icon but must also contain Type=Service and ServiceTypes=Plasma/LayoutTemplate entries. If the layout is specific to a given Plasma application, such as plasma-desktop, this can be specific using X-Plasma-Shell. X-Plasma-ContainmentCategories defines what kind of layout it is with possible values being panel and desktop. Finally a X-KDE-PluginInfo-Name entry is required to provide a globally unique internal name for the Template. Here is an example of a Template that provides a Panel layout for Plasma Netbook:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Panel&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-netbook&lt;br /&gt;
X-Plasma-ContainmentCategories=panel&lt;br /&gt;
X-KDE-PluginInfo-Author=Aaron Seigo&lt;br /&gt;
X-KDE-PluginInfo-Email=aseigo@kde.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.CoolNetbookPanel&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://plasma.kde.org/&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running a template, two global variables will be accessible in read-only mode: templateName and templateComment. They will contain the Name and Comment fields of the above desktop file, and are translated if a localization is available.&lt;br /&gt;
&lt;br /&gt;
=== Examples of Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Creating panels ====&lt;br /&gt;
A good example of the use of templates is the use case that triggered the creation of this feature: the desire to make it easy for users to re-create the default panel that is created on first start. There is a Template called org.kde.plasma-desktop.defaultPanel that ships with the KDE Plasma Workspace which contains the layout for the initial default panel. This is referenced by the default Plasma Desktop init script and, because it is marked as a Panel Template in the metadata.desktop file it also shows up to the user in the Add Panels menu. When selected by the user from the menu, the exact same panel that is created on desktop start up is created for them, complete with Plasma Widgets and configuration.&lt;br /&gt;
&lt;br /&gt;
==== Automating tasks ====&lt;br /&gt;
Another example of the usefulness of templates is the &amp;quot;Find Widgets&amp;quot; template. This template, which first shipped with Plasma Desktop v4.5, provides a function for finding widgets by name. It appears in the toolbar &amp;quot;Load&amp;quot; and &amp;quot;Use&amp;quot; menus in the Desktop Console in plasma-desktop, and makes finding widgets as simple as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
var template = loadTemplate('org.kde.plasma-desktop.findWidgets')&lt;br /&gt;
template.findWidgets('systemtray')&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Activity templates ====&lt;br /&gt;
Probably the most user visible use of templates are &amp;quot;Activity templates&amp;quot;. The structure of Activity templates is similar to the other use of templates, but a few extra features are provided in the metadata.desktop file. Here is an example of such an activity template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Activity Template&lt;br /&gt;
Icon=user-desktop&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-desktop&lt;br /&gt;
X-Plasma-ContainmentCategories=desktop&lt;br /&gt;
X-Plasma-ContainmentLayout-ExecuteOnCreation=dolphin $desktop, gwenview $pictures&lt;br /&gt;
X-Plasma-ContainmentLayout-ShowAsExisting=true&lt;br /&gt;
X-KDE-PluginInfo-Author=John Doe&lt;br /&gt;
X-KDE-PluginInfo-Email=john@doe.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.plasma-desktop.CoolTemplate&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://john.doe.org&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The layout itself is still created from the layout.js file as usual, but this template also shows as a precreated activity to the user thanks to the X-Plasma-ContainmentLayout-ShowAsExisting key. Additionally, it starts applications in the newly created activity using the X-Plasma-ContainmentLayout-ExecuteOnCreation key.&lt;br /&gt;
&lt;br /&gt;
That key is a list of commands to execute, and it supports the following variables:&lt;br /&gt;
* $desktop&lt;br /&gt;
* $autostart&lt;br /&gt;
* $documents&lt;br /&gt;
* $music&lt;br /&gt;
* $video&lt;br /&gt;
* $downloads&lt;br /&gt;
* $pictures&lt;br /&gt;
&lt;br /&gt;
They all expand into the path toward the user corresponding default folder.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
In addition to the normal ECMA Script API and the Qt-specific extensions (such as signal/slot support) provided by QtScript, the following API is provided for use by scripts.&lt;br /&gt;
&lt;br /&gt;
All of the API below, unless otherwise noted with a version noticed, appear as below in the KDE Software Compilation v4.4.0 and later. API that is not noted as being part of a given class or object is part of the global namespace.&lt;br /&gt;
&lt;br /&gt;
{{note|API compatibility is guaranteed from version to version starting with KDE Software Compilation v4.4.0.}}&lt;br /&gt;
&lt;br /&gt;
=== Version Numbers ===&lt;br /&gt;
&lt;br /&gt;
Starting with KDE SC 4.5, the version number of both the scripting API and the application is available to the script via the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''applicationVersion''': the version of the application, e.g. 0.3&lt;br /&gt;
* ''String'' '''platformVersion''': the version of the KDE Platform, e.g. 0.3&lt;br /&gt;
* ''number'' '''scriptingVersion''': the version of the scripting API; e.g. in KDE SC 4.5 this is 2&lt;br /&gt;
&lt;br /&gt;
=== Activities ===&lt;br /&gt;
Activities are the desktop layer in a plasma-desktop session and may contain widgts. In sightly more technical terms, they are desktop containments. Activities can be created, enumerated, modified and destroyed.&lt;br /&gt;
&lt;br /&gt;
New Activities can be created using the Activity constructor, like this:&lt;br /&gt;
&lt;br /&gt;
    var activity = new Activity(&amp;quot;folderview&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file). See the documentation on the Containment object class below.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''activityIds''': returns a list of integer ids of all existing Plasma activities&lt;br /&gt;
* ''Array[String]'' '''knownActivityTypes''':  (scripting version &amp;gt;= 2) a list of types of activities that can be created. This is useful to check if an Activity type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Activity'' '''activityById(number id)''': return an object representing the activity with the given id&lt;br /&gt;
* ''Activity'' '''activityForScreen(number screen[, number dekstop])''': returns an object representing the activity  currently associated with the given screen and, optionally, the given desktop.&lt;br /&gt;
* ''Array[Activity]'' '''activities()''': returns an array of all activities that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Panels ===&lt;br /&gt;
Panels can be created, enumerated, modified and destroyed. A panel object combines both a containment as well as the container itself, allowing for full control of things such as where it appears on screen and the hiding features associated with them.&lt;br /&gt;
&lt;br /&gt;
New Panels can be created using the Panel constructor, like this:&lt;br /&gt;
&lt;br /&gt;
    var panel = new Panel(&amp;quot;dock&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file).&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''panelIds''': returns a list of integer ids of all existing Plasma panels&lt;br /&gt;
* ''Array[String]'' '''knownPanelTypes''':  (scripting version &amp;gt;= 2) a list of types of panels that can be created. This is useful to check if a Panel type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Panel'' '''panelById(int id)''': returns an object representing the Panel that matches the given id&lt;br /&gt;
* ''Array[Panels]'' '''panels()''': returns an array of all panels that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Activities and Panels ===&lt;br /&gt;
Activity and Panel objects, once created by the script, or as returned by activityById, activityForScreen,&lt;br /&gt;
or panelById) provide the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id: the integer id of this activity&lt;br /&gt;
* ''String'' '''formFactor''': returns the form factor of the activity, e.g. &amp;quot;planar&amp;quot; for most desktop activities,&amp;quot;mediacenter&amp;quot; for media centers and either &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; for panels.&lt;br /&gt;
* ''Array[number]'' '''widgetIds''': a list of integer ids of all the widgets in this Activity&lt;br /&gt;
* ''Array[String]'' '''configKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''configGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
&lt;br /&gt;
as well as the following read/write properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''desktop''': the virtual desktop this activity is associated with, or -1 for none&lt;br /&gt;
* ''number'' '''screen''': the screen this activity is associated with, or -1 for none&lt;br /&gt;
* ''String'' '''name''': the name of this activity&lt;br /&gt;
* ''String'' '''wallpaperPlugin''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin to use with the Activity&lt;br /&gt;
* ''String'' '''wallpaperMode''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin mode to use with the Activity&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': (scriptingVersion &amp;gt;= 2) the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget &lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this activity and all widgets inside of it&lt;br /&gt;
* ''Widget'' '''widgetById(number id)''': returns an object representing the widget with the given id&lt;br /&gt;
* ''Widget'' '''addWidget(String name)''': adds a new widget to the activity; the name maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
  in the widget's .desktop file&lt;br /&gt;
* ''Widget'' '''addWidget(Widget widget)''': adds an existing widget to this activity; useful for moving widgets between Activities and Panels&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this Activity or Panel on the screen&lt;br /&gt;
* '''readConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the config with default for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the config &lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': (scriptingVersion &amp;gt;= 2) causes the Activity or Panel to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of panels and activities of the same type.&lt;br /&gt;
* ''Array[Widget]'' '''widgets([String type])''': (scriptingVersion &amp;gt;= 2) returns all the widgets in the Panel or Activity. If the optional type is specified, only widgets matching that type will be returned.&lt;br /&gt;
&lt;br /&gt;
In addition to all of the above properties and functions, Panel objects also provide the folowing read/write properties:&lt;br /&gt;
* ''number'' '''length''': the number of pixels along the screen edge used&lt;br /&gt;
* ''number'' '''height''': the height (or for vertical panels, the width) of the panel&lt;br /&gt;
* ''String'' '''hiding''': the hiding mode of the panel, one of &amp;quot;none&amp;quot; (for no hiding), &amp;quot;autohide&amp;quot;, &amp;quot;windowscover&amp;quot; or &amp;quot;windowsbelow&amp;quot;&lt;br /&gt;
* ''String'' '''alignment''': right, left or center alignment of the panel (for vertical panels, right corrsponds to top and left to bottom)&lt;br /&gt;
* ''String'' '''location''': returns the location of the activity (only relevant for Panels); valid values include &amp;quot;top&amp;quot;, &amp;quot;bottom&amp;quot;, &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot; and &amp;quot;floating&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Widgets ===&lt;br /&gt;
Widgets may be enumerated by calling the widgetIds property on a Activity or Panel object. With a widget id in hand, a Widget object can be retrieved by calling widgetById(id) on an Activity or Panel object. New Widgets can be created with add addWidget(String) function provided by Activity and Panel objects.&lt;br /&gt;
&lt;br /&gt;
A list of all installed widget types can be retrieved the following read-only property:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''knownWidgetTypes''' (scripting version &amp;gt;= 2)&lt;br /&gt;
&lt;br /&gt;
A Widget object provides the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id''': the id of the widget&lt;br /&gt;
* ''String'' '''type''': the plugin type of this widget&lt;br /&gt;
* ''Array[String]'' '''configKeys''': a list of all keys that are set in the current configuration&lt;br /&gt;
* ''Array[String]'' '''configGroups''': a list of all the groups in the current configuration&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
as well as the following read-write properties:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of widgets of the same type.&lt;br /&gt;
* ''QRectF'' '''geometry''': the geometry of the widget (settable)&lt;br /&gt;
* ''String'' '''globalShortcut''': the shortcut sequence (in the format used by QKeySequence, e.g. &amp;quot;Alt+F1&amp;quot;) associated with this widget&lt;br /&gt;
* ''number'' '''index''': the layout index of the widget; in a Panel this corresponds to the order the widget appears in. Changing the value of the index will change the position of the widget in Panels and may do so in some Activities as well.&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this widget&lt;br /&gt;
* '''readConfig(String key, any default)''': reads the value of key in the config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': sets key to value in the config&lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': causes the widget to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this widget on the screen&lt;br /&gt;
&lt;br /&gt;
=== Screen Geometry ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''number'' '''screenCount''': returns the number of screens connected to the computer&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QRectF'' '''screenGeometry(number screen)''': returns a rect object representing the geometry of a screen&lt;br /&gt;
&lt;br /&gt;
=== Wallpaper Plugins ===&lt;br /&gt;
&lt;br /&gt;
* ''Array[String =&amp;gt; Array[String]]'' '''knownWallpaperPlugins()''': (scripting version &amp;gt;= 4) returns a list of all installed wallpaper plugins. They keys of the array are the wallpaper plugin names. The values are arrays containing the modes available for that wallpaper plugin. The mode array may be empty, as most wallpaper plugins only offer one mode.&lt;br /&gt;
&lt;br /&gt;
=== Locating Applications and Paths ===&lt;br /&gt;
* ''boolean'' '''applicationExists(String name)''': (scripting version &amp;gt;= 4) searches $PATH first, then tries in the application menu system by application storage name (aka the .desktop file name), then Name= entries for apps with installed .desktop files, then GenericName= entries for same&lt;br /&gt;
* ''mixed'' '''defaultApplication(String kind [, boolean storageId = false])''': (scripting version &amp;gt;= 4) returns the executable (or if storageId is true, then the the app menu system id, e.g. its .desktop file name) of the default app. The &amp;quot;kind&amp;quot; parameter may be a well-known application type including &amp;quot;browser&amp;quot;, &amp;quot;mailer&amp;quot;, &amp;quot;filemanager&amp;quot;, &amp;quot;terminal&amp;quot;, &amp;quot;imClient&amp;quot; and &amp;quot;windowmanager&amp;quot; (or any other entry in share/apps/kcm_componentchooser/kcm_*.desktop); it may also be a mimetype (e.g. &amp;quot;application/pdf&amp;quot;). On failure, it returns false.&lt;br /&gt;
* ''String'' '''applicationPath(String name)''':  (scripting version &amp;gt;= 4) returns the full local path to a given application or .desktop file if it exists.&lt;br /&gt;
* ''String'' '''userDataPath([String type, String path])''':  (scripting version &amp;gt;= 4) returns the default path for user data. Called with no parameters, it returns the user's home directory. If only one string is passed in, the standard directory for that type of data in the user's home directory will be located; the following values are recognized:&lt;br /&gt;
** documents&lt;br /&gt;
** music&lt;br /&gt;
** video&lt;br /&gt;
** downloads&lt;br /&gt;
** pictures&lt;br /&gt;
** autostart&lt;br /&gt;
** desktop (should be considered deprecated for Plasma workspaces)&lt;br /&gt;
&lt;br /&gt;
If a second string is passed in, it is considered a request for a specific path and the following types are recognized:&lt;br /&gt;
** apps - Applications menu (.desktop files).&lt;br /&gt;
** autostart - Autostart directories (both XDG and kde-specific)&lt;br /&gt;
** cache - Cached information (e.g. favicons, web-pages)&lt;br /&gt;
** cgi - CGIs to run from kdehelp.&lt;br /&gt;
** config - Configuration files.&lt;br /&gt;
** data - Where applications store data.&lt;br /&gt;
** emoticons - Emoticons themes&lt;br /&gt;
** exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account.&lt;br /&gt;
** html - HTML documentation.&lt;br /&gt;
** icon - Icons, see KIconLoader.&lt;br /&gt;
** kcfg - KConfigXT config files.&lt;br /&gt;
** lib - Libraries.&lt;br /&gt;
** locale - Translation files for KLocale.&lt;br /&gt;
** mime - Mime types defined by KDE-specific .desktop files.&lt;br /&gt;
** module - Module (dynamically loaded library).&lt;br /&gt;
** qtplugins - Qt plugins (dynamically loaded objects for Qt)&lt;br /&gt;
** services - Services.&lt;br /&gt;
** servicetypes - Service types.&lt;br /&gt;
** sound - Application sounds.&lt;br /&gt;
** templates - Templates for the &amp;quot;Create new file&amp;quot; functionality.&lt;br /&gt;
** wallpaper - Wallpapers.&lt;br /&gt;
** tmp - Temporary files (specific for both current host and current user)&lt;br /&gt;
** socket - UNIX Sockets (specific for both current host and current user)&lt;br /&gt;
** xdgconf-menu - Freedesktop.org standard location for menu layout (.menu) files.&lt;br /&gt;
** xdgdata-apps - Freedesktop.org standard location for application desktop files.&lt;br /&gt;
** xdgdata-dirs - Freedesktop.org standard location for menu descriptions (.directory files).&lt;br /&gt;
** xdgdata-mime - Freedesktop.org standard location for MIME type definitions.&lt;br /&gt;
** xdgdata-icon - Freedesktop.org standard location for icons.&lt;br /&gt;
** xdgdata-pixmap - Gnome-compatibility location for pixmaps.&lt;br /&gt;
&lt;br /&gt;
The second parameter should be a specific resource to find the path to. An example might be userDataPath(&amp;quot;data&amp;quot;, &amp;quot;plasma-desktop&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Misc. Global Properties and Functions ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''locked''': whether the desktop shell and widgets are locked or not (settable)&lt;br /&gt;
* ''string'' '''theme''': (scripting version &amp;gt;= 3) the name of the desktop theme to use for the interface, e.g. default, Air, Oxygen, etc.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''hasBattery''': whether or not the system has the ability to run on battery power, e.g. a laptop or mobile device&lt;br /&gt;
* ''boolean'' '''multihead''': (scripting version &amp;gt;= 3) true if the system is running with multiple screens in a &amp;quot;Xaphod&amp;quot; multiple display server configuration&lt;br /&gt;
* ''int'' '''multiheadScreen''': (scripting version &amp;gt;= 3) if multihead is true, contains the (real) screen id of the current screen&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''sleep(number ms)''': sleeps the script for the specified number of millseconds&lt;br /&gt;
&lt;br /&gt;
=== QRectF ===&lt;br /&gt;
A rectangle class is also provided for use with Widget, Panel and screen geometry properties and functions.&lt;br /&gt;
&lt;br /&gt;
Read-only properites:&lt;br /&gt;
* ''boolean'' '''empty''': true if the rectangle's width or height is less than, or equal to, 0; an empty rectangle is also invalid&lt;br /&gt;
* ''boolean'' '''null''': true if the rectangle has both the width and the height set to 0; a null rectangle is also empty and not valid&lt;br /&gt;
* ''boolean'' '''valid''':  true if the rectangle has a width &amp;gt; 0 and height 0.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''left'''&lt;br /&gt;
* ''number'' '''top'''&lt;br /&gt;
* ''number'' '''bottom''' &lt;br /&gt;
* ''number'' '''right'''&lt;br /&gt;
* ''number'' '''height'''&lt;br /&gt;
* ''number'' '''width'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
&lt;br /&gt;
Constructors: &lt;br /&gt;
* '''QRectF'''&lt;br /&gt;
* '''QRectF(number x, number y, number width, number height)''': Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''adjust(number dx1, number dy1, number dx2, number dy2)''': adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle&lt;br /&gt;
* ''QRectF'' '''adjusted(number dx1, number dy1, number dx2, number dy2)''': returns a new QRectF with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of the rectangle &lt;br /&gt;
* '''translate(number dx, number dy)''': translates the rect by dx, dy&lt;br /&gt;
* '''setCoords(number x1, number y1, number x2, number y2)''': sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).&lt;br /&gt;
* '''setRect(number x, number y, number width, number height)''': sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
* ''boolean'' '''contains(number x, number y)''': returns true if the rect contains the point (x, y)&lt;br /&gt;
* '''moveBottom(number delta)'': moves the bottom by delta pixels&lt;br /&gt;
* '''moveLeft(number delta)''': moves the left by delta pixels&lt;br /&gt;
* '''moveRight(number delta)''': moves the right by delta pixels&lt;br /&gt;
* '''moveTo(number x, number y)''': moves the top left of the rect to point (x, y)&lt;br /&gt;
* '''moveTop(number delta)''': moves the top by delta pixels&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting</id>
		<title>KDE System Administration/PlasmaDesktopScripting</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting"/>
				<updated>2011-04-28T11:59:34Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Activity templates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ECMA Script Interaction With Plasma Shells ==&lt;br /&gt;
&lt;br /&gt;
It is possible to control and interact with a Plasma user interface shell such as a plasma-desktop or (starting in KDE SC 4.5) plasma-netbook session using ECMA Script (aka JavaScript). This scripting mechanism exposes containments (Desktop Activities and Panels), widgets and various other aspects of plasma-desktop configuration using the widely known and used ECMA Script language. The QtScript engine is used for the runtime environment.&lt;br /&gt;
&lt;br /&gt;
This document describes the API that is provided along with how to&lt;br /&gt;
run such scripts in plasma-desktop.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
A set of examples can be found [https://projects.kde.org/projects/kde/kdeexamples/repository/revisions/master/show/plasma/javascript/plasma-shell-scripting here] that demonstrate the use of various aspects of Plasma shell scripting.&lt;br /&gt;
&lt;br /&gt;
Contributions of additional examples are welcome and an be sent to the Plasma development mailing list (plasma-devel at kde.org) for inclusion if you do not have commit rights to the kdeexamples module.&lt;br /&gt;
&lt;br /&gt;
== Running Scripts ==&lt;br /&gt;
There are three ways that scripts can be executed in plasma-desktop:&lt;br /&gt;
&lt;br /&gt;
* '''on first run''': when plasma-desktop is started without any pre-existing configuration, any scripts in $APPDATA/plasma-desktop/init/ with a &amp;quot;.js&amp;quot; suffix are run. If there is more than one script, they are run sequentially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''on update''': when plasma-desktop is started, it will check in&lt;br /&gt;
  `kde4-config --path data`/plasma-desktop/updates/ &lt;br /&gt;
with a &amp;quot;.js&amp;quot; suffix for scripts that have not yet been run. If there is more than one script which has not been run yet they will be executed serially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
A record of which update scripts have been run is kept in the application's config file in the [Updates] group. This means that if the plasma-desktop configuraiton file is removed, all the update scripts will be run again.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''interactively''': an interactive scripting dialog can be requested either via the KRunner window (Alt+F2, by default, or via the &amp;quot;Run Command&amp;quot; entry in various desktop menus) by entering &amp;quot;desktop console&amp;quot; as the search term. It can also be triggered directly via dbus with &amp;lt;code bash&amp;gt;qdbus org.kde.plasma-desktop /MainApplication showInteractiveConsole&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|This method is not available for plasma-netbook.}}&lt;br /&gt;
&lt;br /&gt;
:ECMA Script may be entered directly into this window for execution and output appears in the lower half of the window. Ctrl+E is a shortcut to run scripts, and scripts can be saved to and loaded from disk.&lt;br /&gt;
&lt;br /&gt;
:Scripts from files can also be loaded using KRunner with &amp;quot;desktop console /path/to/file&amp;quot; or via dbus with&lt;br /&gt;
&amp;lt;code bash&amp;gt;qdbus org.kde.plasma-desktop /MainApplication loadScriptInInteractiveConsole /path/to/file&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&lt;br /&gt;
Templates are named packages that contain scripts. This provides a way for common functionality to be easily reused, helping to increase consistency and lower maintenance costs. Templates can be loaded from other scripts by name and they are also used to populate some parts of the user interface, such as the entries in the Add Panels menu. &lt;br /&gt;
&lt;br /&gt;
A template is a small set of files in a specified file hierarchy (or, in Plasma terms, a &amp;quot;Package&amp;quot;). In particular, a Template package contains the following files:&lt;br /&gt;
&lt;br /&gt;
* metadata.desktop: a .desktop file describing the template&lt;br /&gt;
* contents/layout.js: a Javascript file containing the actual script&lt;br /&gt;
&lt;br /&gt;
Templates are stored under share/apps/plasma/layout-templates and may be installed using `plasmapkg -t layout-template -i /path/to/package`. Template packages may also be provided as a .zip file with a .plasmalayout suffix.&lt;br /&gt;
&lt;br /&gt;
The metadata.desktop file contains the usual .desktop entries such as Name and Icon but must also contain Type=Service and ServiceTypes=Plasma/LayoutTemplate entries. If the layout is specific to a given Plasma application, such as plasma-desktop, this can be specific using X-Plasma-Shell. X-Plasma-ContainmentCategories defines what kind of layout it is with possible values being panel and desktop. Finally a X-KDE-PluginInfo-Name entry is required to provide a globally unique internal name for the Template. Here is an example of a Template that provides a Panel layout for Plasma Netbook:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Panel&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-netbook&lt;br /&gt;
X-Plasma-ContainmentCategories=panel&lt;br /&gt;
X-KDE-PluginInfo-Author=Aaron Seigo&lt;br /&gt;
X-KDE-PluginInfo-Email=aseigo@kde.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.CoolNetbookPanel&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://plasma.kde.org/&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running a template, two global variables will be accessible in read-only mode: templateName and templateComment. They will contain the Name and Comment fields of the above desktop file, and are translated if a localization is available.&lt;br /&gt;
&lt;br /&gt;
=== Examples of Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Creating panels ====&lt;br /&gt;
A good example of the use of templates is the use case that triggered the creation of this feature: the desire to make it easy for users to re-create the default panel that is created on first start. There is a Template called org.kde.plasma-desktop.defaultPanel that ships with the KDE Plasma Workspace which contains the layout for the initial default panel. This is referenced by the default Plasma Desktop init script and, because it is marked as a Panel Template in the metadata.desktop file it also shows up to the user in the Add Panels menu. When selected by the user from the menu, the exact same panel that is created on desktop start up is created for them, complete with Plasma Widgets and configuration.&lt;br /&gt;
&lt;br /&gt;
==== Automating tasks ====&lt;br /&gt;
Another example of the usefulness of templates is the &amp;quot;Find Widgets&amp;quot; template. This template, which first shipped with Plasma Desktop v4.5, provides a function for finding widgets by name. It appears in the toolbar &amp;quot;Load&amp;quot; and &amp;quot;Use&amp;quot; menus in the Desktop Console in plasma-desktop, and makes finding widgets as simple as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
var template = loadTemplate('org.kde.plasma-desktop.findWidgets')&lt;br /&gt;
template.findWidgets('systemtray')&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Activity templates ====&lt;br /&gt;
Probably the most user visible use of templates are &amp;quot;Activity templates&amp;quot;. The structure of Activity templates is similar to the other use of templates, but a few extra features are provided in the metadata.desktop file. Here is an example of such an activity template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Activity Template&lt;br /&gt;
Icon=user-desktop&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-desktop&lt;br /&gt;
X-Plasma-ContainmentCategories=desktop&lt;br /&gt;
X-Plasma-ContainmentLayout-ExecuteOnCreation=dolphin $desktop, gwenview $pictures&lt;br /&gt;
X-Plasma-ContainmentLayout-ShowAsExisting=true&lt;br /&gt;
X-KDE-PluginInfo-Author=John Doe&lt;br /&gt;
X-KDE-PluginInfo-Email=john@doe.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.plasma-desktop.CoolTemplate&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://john.doe.org&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The layout itself is still created from the layout.js file as usual, but this template also shows as a precreated activity to the user thanks to the X-Plasma-ContainmentLayout-ShowAsExisting key. Additionally, it startups applications in the newly created activity using the X-Plasma-ContainmentLayout-ExecuteOnCreation key.&lt;br /&gt;
&lt;br /&gt;
That key is a list of commands to execute, and it supports the following variables:&lt;br /&gt;
* $desktop&lt;br /&gt;
* $autostart&lt;br /&gt;
* $documents&lt;br /&gt;
* $music&lt;br /&gt;
* $video&lt;br /&gt;
* $downloads&lt;br /&gt;
* $pictures&lt;br /&gt;
&lt;br /&gt;
They all expand into the path toward the user corresponding default folder.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
In addition to the normal ECMA Script API and the Qt-specific extensions (such as signal/slot support) provided by QtScript, the following API is provided for use by scripts.&lt;br /&gt;
&lt;br /&gt;
All of the API below, unless otherwise noted with a version noticed, appear as below in the KDE Software Compilation v4.4.0 and later. API that is not noted as being part of a given class or object is part of the global namespace.&lt;br /&gt;
&lt;br /&gt;
{{note|API compatibility is guaranteed from version to version starting with KDE Software Compilation v4.4.0.}}&lt;br /&gt;
&lt;br /&gt;
=== Version Numbers ===&lt;br /&gt;
&lt;br /&gt;
Starting with KDE SC 4.5, the version number of both the scripting API and the application is available to the script via the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''applicationVersion''': the version of the application, e.g. 0.3&lt;br /&gt;
* ''String'' '''platformVersion''': the version of the KDE Platform, e.g. 0.3&lt;br /&gt;
* ''number'' '''scriptingVersion''': the version of the scripting API; e.g. in KDE SC 4.5 this is 2&lt;br /&gt;
&lt;br /&gt;
=== Activities ===&lt;br /&gt;
Activities are the desktop layer in a plasma-desktop session and may contain widgts. In sightly more technical terms, they are desktop containments. Activities can be created, enumerated, modified and destroyed.&lt;br /&gt;
&lt;br /&gt;
New Activities can be created using the Activity constructor, like this:&lt;br /&gt;
&lt;br /&gt;
    var activity = new Activity(&amp;quot;folderview&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file). See the documentation on the Containment object class below.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''activityIds''': returns a list of integer ids of all existing Plasma activities&lt;br /&gt;
* ''Array[String]'' '''knownActivityTypes''':  (scripting version &amp;gt;= 2) a list of types of activities that can be created. This is useful to check if an Activity type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Activity'' '''activityById(number id)''': return an object representing the activity with the given id&lt;br /&gt;
* ''Activity'' '''activityForScreen(number screen[, number dekstop])''': returns an object representing the activity  currently associated with the given screen and, optionally, the given desktop.&lt;br /&gt;
* ''Array[Activity]'' '''activities()''': returns an array of all activities that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Panels ===&lt;br /&gt;
Panels can be created, enumerated, modified and destroyed. A panel object combines both a containment as well as the container itself, allowing for full control of things such as where it appears on screen and the hiding features associated with them.&lt;br /&gt;
&lt;br /&gt;
New Panels can be created using the Panel constructor, like this:&lt;br /&gt;
&lt;br /&gt;
    var panel = new Panel(&amp;quot;dock&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file).&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''panelIds''': returns a list of integer ids of all existing Plasma panels&lt;br /&gt;
* ''Array[String]'' '''knownPanelTypes''':  (scripting version &amp;gt;= 2) a list of types of panels that can be created. This is useful to check if a Panel type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Panel'' '''panelById(int id)''': returns an object representing the Panel that matches the given id&lt;br /&gt;
* ''Array[Panels]'' '''panels()''': returns an array of all panels that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Activities and Panels ===&lt;br /&gt;
Activity and Panel objects, once created by the script, or as returned by activityById, activityForScreen,&lt;br /&gt;
or panelById) provide the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id: the integer id of this activity&lt;br /&gt;
* ''String'' '''formFactor''': returns the form factor of the activity, e.g. &amp;quot;planar&amp;quot; for most desktop activities,&amp;quot;mediacenter&amp;quot; for media centers and either &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; for panels.&lt;br /&gt;
* ''Array[number]'' '''widgetIds''': a list of integer ids of all the widgets in this Activity&lt;br /&gt;
* ''Array[String]'' '''configKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''configGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
&lt;br /&gt;
as well as the following read/write properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''desktop''': the virtual desktop this activity is associated with, or -1 for none&lt;br /&gt;
* ''number'' '''screen''': the screen this activity is associated with, or -1 for none&lt;br /&gt;
* ''String'' '''name''': the name of this activity&lt;br /&gt;
* ''String'' '''wallpaperPlugin''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin to use with the Activity&lt;br /&gt;
* ''String'' '''wallpaperMode''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin mode to use with the Activity&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': (scriptingVersion &amp;gt;= 2) the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget &lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this activity and all widgets inside of it&lt;br /&gt;
* ''Widget'' '''widgetById(number id)''': returns an object representing the widget with the given id&lt;br /&gt;
* ''Widget'' '''addWidget(String name)''': adds a new widget to the activity; the name maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
  in the widget's .desktop file&lt;br /&gt;
* ''Widget'' '''addWidget(Widget widget)''': adds an existing widget to this activity; useful for moving widgets between Activities and Panels&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this Activity or Panel on the screen&lt;br /&gt;
* '''readConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the config with default for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the config &lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': (scriptingVersion &amp;gt;= 2) causes the Activity or Panel to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of panels and activities of the same type.&lt;br /&gt;
* ''Array[Widget]'' '''widgets([String type])''': (scriptingVersion &amp;gt;= 2) returns all the widgets in the Panel or Activity. If the optional type is specified, only widgets matching that type will be returned.&lt;br /&gt;
&lt;br /&gt;
In addition to all of the above properties and functions, Panel objects also provide the folowing read/write properties:&lt;br /&gt;
* ''number'' '''length''': the number of pixels along the screen edge used&lt;br /&gt;
* ''number'' '''height''': the height (or for vertical panels, the width) of the panel&lt;br /&gt;
* ''String'' '''hiding''': the hiding mode of the panel, one of &amp;quot;none&amp;quot; (for no hiding), &amp;quot;autohide&amp;quot;, &amp;quot;windowscover&amp;quot; or &amp;quot;windowsbelow&amp;quot;&lt;br /&gt;
* ''String'' '''alignment''': right, left or center alignment of the panel (for vertical panels, right corrsponds to top and left to bottom)&lt;br /&gt;
* ''String'' '''location''': returns the location of the activity (only relevant for Panels); valid values include &amp;quot;top&amp;quot;, &amp;quot;bottom&amp;quot;, &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot; and &amp;quot;floating&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Widgets ===&lt;br /&gt;
Widgets may be enumerated by calling the widgetIds property on a Activity or Panel object. With a widget id in hand, a Widget object can be retrieved by calling widgetById(id) on an Activity or Panel object. New Widgets can be created with add addWidget(String) function provided by Activity and Panel objects.&lt;br /&gt;
&lt;br /&gt;
A list of all installed widget types can be retrieved the following read-only property:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''knownWidgetTypes''' (scripting version &amp;gt;= 2)&lt;br /&gt;
&lt;br /&gt;
A Widget object provides the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id''': the id of the widget&lt;br /&gt;
* ''String'' '''type''': the plugin type of this widget&lt;br /&gt;
* ''Array[String]'' '''configKeys''': a list of all keys that are set in the current configuration&lt;br /&gt;
* ''Array[String]'' '''configGroups''': a list of all the groups in the current configuration&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
as well as the following read-write properties:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of widgets of the same type.&lt;br /&gt;
* ''QRectF'' '''geometry''': the geometry of the widget (settable)&lt;br /&gt;
* ''String'' '''globalShortcut''': the shortcut sequence (in the format used by QKeySequence, e.g. &amp;quot;Alt+F1&amp;quot;) associated with this widget&lt;br /&gt;
* ''number'' '''index''': the layout index of the widget; in a Panel this corresponds to the order the widget appears in. Changing the value of the index will change the position of the widget in Panels and may do so in some Activities as well.&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this widget&lt;br /&gt;
* '''readConfig(String key, any default)''': reads the value of key in the config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': sets key to value in the config&lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': causes the widget to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this widget on the screen&lt;br /&gt;
&lt;br /&gt;
=== Screen Geometry ===&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''number'' '''screenCount''': returns the number of screens connected to the computer&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''QRectF'' '''screenGeometry(number screen)''': returns a rect object representing the geometry of a screen&lt;br /&gt;
&lt;br /&gt;
=== Wallpaper Plugins ===&lt;br /&gt;
&lt;br /&gt;
* ''Array[String =&amp;gt; Array[String]]'' '''knownWallpaperPlugins()''': (scripting version &amp;gt;= 4) returns a list of all installed wallpaper plugins. They keys of the array are the wallpaper plugin names. The values are arrays containing the modes available for that wallpaper plugin. The mode array may be empty, as most wallpaper plugins only offer one mode.&lt;br /&gt;
&lt;br /&gt;
=== Locating Applications and Paths ===&lt;br /&gt;
* ''boolean'' '''applicationExists(String name)''': (scripting version &amp;gt;= 4) searches $PATH first, then tries in the application menu system by application storage name (aka the .desktop file name), then Name= entries for apps with installed .desktop files, then GenericName= entries for same&lt;br /&gt;
* ''mixed'' '''defaultApplication(String kind [, boolean storageId = false])''': (scripting version &amp;gt;= 4) returns the executable (or if storageId is true, then the the app menu system id, e.g. its .desktop file name) of the default app. The &amp;quot;kind&amp;quot; parameter may be a well-known application type including &amp;quot;browser&amp;quot;, &amp;quot;mailer&amp;quot;, &amp;quot;filemanager&amp;quot;, &amp;quot;terminal&amp;quot;, &amp;quot;imClient&amp;quot; and &amp;quot;windowmanager&amp;quot; (or any other entry in share/apps/kcm_componentchooser/kcm_*.desktop); it may also be a mimetype (e.g. &amp;quot;application/pdf&amp;quot;). On failure, it returns false.&lt;br /&gt;
* ''String'' '''applicationPath(String name)''':  (scripting version &amp;gt;= 4) returns the full local path to a given application or .desktop file if it exists.&lt;br /&gt;
* ''String'' '''userDataPath([String type, String path])''':  (scripting version &amp;gt;= 4) returns the default path for user data. Called with no parameters, it returns the user's home directory. If only one string is passed in, the standard directory for that type of data in the user's home directory will be located; the following values are recognized:&lt;br /&gt;
** documents&lt;br /&gt;
** music&lt;br /&gt;
** video&lt;br /&gt;
** downloads&lt;br /&gt;
** pictures&lt;br /&gt;
** autostart&lt;br /&gt;
** desktop (should be considered deprecated for Plasma workspaces)&lt;br /&gt;
&lt;br /&gt;
If a second string is passed in, it is considered a request for a specific path and the following types are recognized:&lt;br /&gt;
** apps - Applications menu (.desktop files).&lt;br /&gt;
** autostart - Autostart directories (both XDG and kde-specific)&lt;br /&gt;
** cache - Cached information (e.g. favicons, web-pages)&lt;br /&gt;
** cgi - CGIs to run from kdehelp.&lt;br /&gt;
** config - Configuration files.&lt;br /&gt;
** data - Where applications store data.&lt;br /&gt;
** emoticons - Emoticons themes&lt;br /&gt;
** exe - Executables in $prefix/bin. findExe() for a function that takes $PATH into account.&lt;br /&gt;
** html - HTML documentation.&lt;br /&gt;
** icon - Icons, see KIconLoader.&lt;br /&gt;
** kcfg - KConfigXT config files.&lt;br /&gt;
** lib - Libraries.&lt;br /&gt;
** locale - Translation files for KLocale.&lt;br /&gt;
** mime - Mime types defined by KDE-specific .desktop files.&lt;br /&gt;
** module - Module (dynamically loaded library).&lt;br /&gt;
** qtplugins - Qt plugins (dynamically loaded objects for Qt)&lt;br /&gt;
** services - Services.&lt;br /&gt;
** servicetypes - Service types.&lt;br /&gt;
** sound - Application sounds.&lt;br /&gt;
** templates - Templates for the &amp;quot;Create new file&amp;quot; functionality.&lt;br /&gt;
** wallpaper - Wallpapers.&lt;br /&gt;
** tmp - Temporary files (specific for both current host and current user)&lt;br /&gt;
** socket - UNIX Sockets (specific for both current host and current user)&lt;br /&gt;
** xdgconf-menu - Freedesktop.org standard location for menu layout (.menu) files.&lt;br /&gt;
** xdgdata-apps - Freedesktop.org standard location for application desktop files.&lt;br /&gt;
** xdgdata-dirs - Freedesktop.org standard location for menu descriptions (.directory files).&lt;br /&gt;
** xdgdata-mime - Freedesktop.org standard location for MIME type definitions.&lt;br /&gt;
** xdgdata-icon - Freedesktop.org standard location for icons.&lt;br /&gt;
** xdgdata-pixmap - Gnome-compatibility location for pixmaps.&lt;br /&gt;
&lt;br /&gt;
The second parameter should be a specific resource to find the path to. An example might be userDataPath(&amp;quot;data&amp;quot;, &amp;quot;plasma-desktop&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Misc. Global Properties and Functions ===&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''boolean'' '''locked''': whether the desktop shell and widgets are locked or not (settable)&lt;br /&gt;
* ''string'' '''theme''': (scripting version &amp;gt;= 3) the name of the desktop theme to use for the interface, e.g. default, Air, Oxygen, etc.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''boolean'' '''hasBattery''': whether or not the system has the ability to run on battery power, e.g. a laptop or mobile device&lt;br /&gt;
* ''boolean'' '''multihead''': (scripting version &amp;gt;= 3) true if the system is running with multiple screens in a &amp;quot;Xaphod&amp;quot; multiple display server configuration&lt;br /&gt;
* ''int'' '''multiheadScreen''': (scripting version &amp;gt;= 3) if multihead is true, contains the (real) screen id of the current screen&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''sleep(number ms)''': sleeps the script for the specified number of millseconds&lt;br /&gt;
&lt;br /&gt;
=== QRectF ===&lt;br /&gt;
A rectangle class is also provided for use with Widget, Panel and screen geometry properties and functions.&lt;br /&gt;
&lt;br /&gt;
Read-only properites:&lt;br /&gt;
* ''boolean'' '''empty''': true if the rectangle's width or height is less than, or equal to, 0; an empty rectangle is also invalid&lt;br /&gt;
* ''boolean'' '''null''': true if the rectangle has both the width and the height set to 0; a null rectangle is also empty and not valid&lt;br /&gt;
* ''boolean'' '''valid''':  true if the rectangle has a width &amp;gt; 0 and height 0.&lt;br /&gt;
&lt;br /&gt;
Read-write properties:&lt;br /&gt;
* ''number'' '''left'''&lt;br /&gt;
* ''number'' '''top'''&lt;br /&gt;
* ''number'' '''bottom''' &lt;br /&gt;
* ''number'' '''right'''&lt;br /&gt;
* ''number'' '''height'''&lt;br /&gt;
* ''number'' '''width'''&lt;br /&gt;
* ''number'' '''x'''&lt;br /&gt;
* ''number'' '''y'''&lt;br /&gt;
&lt;br /&gt;
Constructors: &lt;br /&gt;
* '''QRectF'''&lt;br /&gt;
* '''QRectF(number x, number y, number width, number height)''': Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* '''adjust(number dx1, number dy1, number dx2, number dy2)''': adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle&lt;br /&gt;
* ''QRectF'' '''adjusted(number dx1, number dy1, number dx2, number dy2)''': returns a new QRectF with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of the rectangle &lt;br /&gt;
* '''translate(number dx, number dy)''': translates the rect by dx, dy&lt;br /&gt;
* '''setCoords(number x1, number y1, number x2, number y2)''': sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).&lt;br /&gt;
* '''setRect(number x, number y, number width, number height)''': sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.&lt;br /&gt;
* ''boolean'' '''contains(number x, number y)''': returns true if the rect contains the point (x, y)&lt;br /&gt;
* '''moveBottom(number delta)'': moves the bottom by delta pixels&lt;br /&gt;
* '''moveLeft(number delta)''': moves the left by delta pixels&lt;br /&gt;
* '''moveRight(number delta)''': moves the right by delta pixels&lt;br /&gt;
* '''moveTo(number x, number y)''': moves the top left of the rect to point (x, y)&lt;br /&gt;
* '''moveTop(number delta)''': moves the top by delta pixels&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Git/Feature_Development_Workflow/Simple_Branch_Development</id>
		<title>Development/Tutorials/Git/Feature Development Workflow/Simple Branch Development</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Git/Feature_Development_Workflow/Simple_Branch_Development"/>
				<updated>2011-04-27T18:30:50Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* The Recipe */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{warning|This page refers to a draft policy which is still to be agreed and implemented. Please take it as a reference for a work in progress project. }}&lt;br /&gt;
&lt;br /&gt;
This tutorial can help casual developers as well as developers with a limited knowledge of git to get started quickly. It covers the entire work flow, from developing in branches to getting them merged and integrated for the next release.&lt;br /&gt;
&lt;br /&gt;
This tutorial does not require any git-specific knowledge.&lt;br /&gt;
&lt;br /&gt;
Before you start, you are strongly advised to read the following documents:&lt;br /&gt;
&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Repository_Roles|Which repository should I use?]]&lt;br /&gt;
&lt;br /&gt;
===Repositories and projects complying with this policy===&lt;br /&gt;
The following repositories/projects follow these guidelines. Any project not mentioned here is unaffected by what described&lt;br /&gt;
&lt;br /&gt;
* kde-workspace&lt;br /&gt;
* kde-runtime&lt;br /&gt;
* kdelibs (plasma only)&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
The approach described in this document helps us implement proper quality evaluation for code that ends up in the main repositories while still allowing developers to work on anything they want. It provides a sane merging strategy which does not require any special git knowledge from the contributing developer's side.&lt;br /&gt;
&lt;br /&gt;
To learn more about the rationale behind this approach, please read [[Development/Tutorials/Git/Feature_Development_Workflow/Rationale|the Rationale article]].&lt;br /&gt;
&lt;br /&gt;
===Setting up the development environment===&lt;br /&gt;
The following steps assume your system is set up as shown in the [http://community.kde.org/Sysadmin/GitKdeOrgManual git.kde.org user manual], especially regarding  [http://community.kde.org/Sysadmin/GitKdeOrgManual#Let_Git_rewrite_URL_prefixes automatic URL rewriting for KDE repositories] enabled.&lt;br /&gt;
&lt;br /&gt;
In the following tutorial, we'll refer to kdelibs as the main target, but this applies to any other repository using this policy.&lt;br /&gt;
&lt;br /&gt;
====Cloning the repository and adding integration====&lt;br /&gt;
&lt;br /&gt;
=====The Recipe=====&lt;br /&gt;
&amp;lt;code lang=&amp;quot;bash&amp;quot;&amp;gt;git clone kde:kdelibs&lt;br /&gt;
git remote add integration kde:clones/kdelibs/dafre/kdelibs-integration&lt;br /&gt;
git fetch integration&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====The Explanation=====&lt;br /&gt;
&lt;br /&gt;
To clone the repository, issue&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code lang=&amp;quot;bash&amp;quot;&amp;gt;git clone kde:kdelibs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create a kdelibs directory containing the whole repository. You now need to add a separate remote for handling ''integration''. A remote is a repository URL, and your local clone can contain multiple repositories to track different branches. To add kdelibs' ''integration'' repository, issue inside kdelibs' clone:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code lang=&amp;quot;bash&amp;quot;&amp;gt;git remote add integration kde:clones/kdelibs/dafre/kdelibs-integration&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, fetch from integration to retrieve the changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code lang=&amp;quot;bash&amp;quot;&amp;gt;git fetch integration&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|When working with multiple remotes, you can issue ''git fetch --all'' to update all the remotes tracked by your local copy }}&lt;br /&gt;
&lt;br /&gt;
====Creating branches====&lt;br /&gt;
You now need to get your branches set up, in particular ''integration/master''. In this example, we are creating a new branch named ''integration-master'' which would serve for this purpose in particular:&lt;br /&gt;
&lt;br /&gt;
 git checkout -b integration-master integration/master&lt;br /&gt;
&lt;br /&gt;
This command creates a local branch set to track a remote one. This branch should be the branch you'll be basing your work upon: origin/master is not meant for development!&lt;br /&gt;
&lt;br /&gt;
====Using integration vs. using your own clone====&lt;br /&gt;
It is ''strongly'' advised to push your work to integration, but under some circumstances (your work is extremely big in size, you do not have a KDE Development account, etc.), it is allowed to push your branches to a separate personal clone. All work should end up into integration for being reviewed anyway.&lt;br /&gt;
&lt;br /&gt;
===Developing a new feature===&lt;br /&gt;
We'll now walk through the process needed to develop a new feature. We'll suppose you want to add a button which says &amp;quot;hello&amp;quot; to a specific part of code.&lt;br /&gt;
&lt;br /&gt;
====Creating a new branch====&lt;br /&gt;
First thing to do is creating a new branch on which to base your work on. This branch must be based upon ''integration/master''. To make sure this happens, start by issuing&lt;br /&gt;
&lt;br /&gt;
 git checkout integration-master&lt;br /&gt;
&lt;br /&gt;
Now create your branch. Give it a self-exeplainatory name: try to keep branches as atomic as possible, and possibly split big changes throughout multiple branches divided as per topic. In our case, we want to name our branch ''add-hello-button''. To do that, we do:&lt;br /&gt;
&lt;br /&gt;
 git checkout -b add-hello-button&lt;br /&gt;
&lt;br /&gt;
That will create our personal branch which is going to contain our work. Push your branch to integration by issuing&lt;br /&gt;
&lt;br /&gt;
 git push integration add-hello-button&lt;br /&gt;
&lt;br /&gt;
====Synchronizing the branch with master====&lt;br /&gt;
When you create a branch (like you did), you are not receiving incremental updates from other people working in the repository (so in the ''master'' branch). This is usually not an issue, and instead an advantage: you can work on your code without being affected by other changes.&lt;br /&gt;
&lt;br /&gt;
However, there are some cases in which ''synchronizing'' your code with what's been going on with master is required. Git gives you two ways for doing that: merging or rebasing. Both have upsides and downsides, and both come at a cost.&lt;br /&gt;
&lt;br /&gt;
For this reason, you are ''strongly'' invited to avoid merging or rebasing on top of master while developing your feature whenever possible. Although, if you need to, you are supposed to merge your branch with master, and not to rebase it. What you need to do is the following:&lt;br /&gt;
&lt;br /&gt;
 git fetch --all&lt;br /&gt;
 git merge integration/master&lt;br /&gt;
&lt;br /&gt;
This command merges your work with the very latest code from ''integration/master''. This process comes with a cost: your branch will not be a candidate for a clean rebase, and each merge makes the history more complex.&lt;br /&gt;
&lt;br /&gt;
Again, this means that you should try to avoid this process if possible, and if you ''absolutely'' need to do that, you should try and keep the number of merges you'll do in your branch as low as possible. More than 3 merges start to create a very cluttered history.&lt;br /&gt;
&lt;br /&gt;
To learn more about merging, rebasing, and what this implies to your branch and to our merge strategy, you are invited to read [[Development/Tutorials/Git/Feature_Development_Workflow/Rebase_vs_Merge|Rebasing vs. merging: why and how]]&lt;br /&gt;
&lt;br /&gt;
====Getting the branch reviewed====&lt;br /&gt;
Once you are done with your changes, you are ready to get your branch reviewed. In the review process, the project's core developers will evaluate your code's quality, and will help you in making it perfect before it gets integrated. Here's how to do it.&lt;br /&gt;
&lt;br /&gt;
=====Push your changes to integration=====&lt;br /&gt;
If you have a KDE developer account, simply&lt;br /&gt;
&lt;br /&gt;
 git push integration add-hello-button&lt;br /&gt;
&lt;br /&gt;
from within your ''add-hello-button'' branch.&lt;br /&gt;
&lt;br /&gt;
If you do not have a KDE Developer account, please get in touch with the core developer who is mentoring you, or with one of the repository's maintainers to get your changes pushed into ''integration''.&lt;br /&gt;
&lt;br /&gt;
=====Submit the branch for review=====&lt;br /&gt;
Use Reviewboard for getting your branch reviewed. You can read [[Development/Review_Board|KDE Reviewboard+Git tutorial]] for getting started and understanding the steps involved.&lt;br /&gt;
&lt;br /&gt;
It is '''critical''' that you specify in the review request whether your branch has ever been merged with master or not.&lt;br /&gt;
&lt;br /&gt;
=====Modifying the branch=====&lt;br /&gt;
Everytime you update your review request with new code, please remember to push changes to ''integration'' with your new code. That will help developers in reviewing and maintainers in handling your request.&lt;br /&gt;
&lt;br /&gt;
====Getting your branch integrated====&lt;br /&gt;
Once your review request has been marked as &amp;quot;Ship it!&amp;quot;, your job is done. The maintainers will take care of merging the branch into ''integration/master'', stage it for release, and make it reach ''origin'' in the end.&lt;br /&gt;
&lt;br /&gt;
It is '''critical''' at this point to have your branch ''frozen''. You should not commit anything else to your branch and you should consider it dead. Maintainers will take over its commits and will delete it when merging occurs.&lt;br /&gt;
&lt;br /&gt;
If you are curious to find out what happens to your commit after your code is accepted, read [[Development/Tutorials/Git/Feature_Development_Workflow/Merge_Strategies|Merge strategies to and from integration]]&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Git/Feature_Development_Workflow/Simple_Branch_Development</id>
		<title>Development/Tutorials/Git/Feature Development Workflow/Simple Branch Development</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Git/Feature_Development_Workflow/Simple_Branch_Development"/>
				<updated>2011-04-27T18:30:40Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Cloning the repository and adding integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{warning|This page refers to a draft policy which is still to be agreed and implemented. Please take it as a reference for a work in progress project. }}&lt;br /&gt;
&lt;br /&gt;
This tutorial can help casual developers as well as developers with a limited knowledge of git to get started quickly. It covers the entire work flow, from developing in branches to getting them merged and integrated for the next release.&lt;br /&gt;
&lt;br /&gt;
This tutorial does not require any git-specific knowledge.&lt;br /&gt;
&lt;br /&gt;
Before you start, you are strongly advised to read the following documents:&lt;br /&gt;
&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Repository_Roles|Which repository should I use?]]&lt;br /&gt;
&lt;br /&gt;
===Repositories and projects complying with this policy===&lt;br /&gt;
The following repositories/projects follow these guidelines. Any project not mentioned here is unaffected by what described&lt;br /&gt;
&lt;br /&gt;
* kde-workspace&lt;br /&gt;
* kde-runtime&lt;br /&gt;
* kdelibs (plasma only)&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
The approach described in this document helps us implement proper quality evaluation for code that ends up in the main repositories while still allowing developers to work on anything they want. It provides a sane merging strategy which does not require any special git knowledge from the contributing developer's side.&lt;br /&gt;
&lt;br /&gt;
To learn more about the rationale behind this approach, please read [[Development/Tutorials/Git/Feature_Development_Workflow/Rationale|the Rationale article]].&lt;br /&gt;
&lt;br /&gt;
===Setting up the development environment===&lt;br /&gt;
The following steps assume your system is set up as shown in the [http://community.kde.org/Sysadmin/GitKdeOrgManual git.kde.org user manual], especially regarding  [http://community.kde.org/Sysadmin/GitKdeOrgManual#Let_Git_rewrite_URL_prefixes automatic URL rewriting for KDE repositories] enabled.&lt;br /&gt;
&lt;br /&gt;
In the following tutorial, we'll refer to kdelibs as the main target, but this applies to any other repository using this policy.&lt;br /&gt;
&lt;br /&gt;
====Cloning the repository and adding integration====&lt;br /&gt;
&lt;br /&gt;
=====The Recipe=====&lt;br /&gt;
&amp;lt;code lang=&amp;quot;bash&amp;quot;&amp;gt;git clone kde:kdelibs&lt;br /&gt;
 git remote add integration kde:clones/kdelibs/dafre/kdelibs-integration&lt;br /&gt;
 git fetch integration&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====The Explanation=====&lt;br /&gt;
&lt;br /&gt;
To clone the repository, issue&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code lang=&amp;quot;bash&amp;quot;&amp;gt;git clone kde:kdelibs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create a kdelibs directory containing the whole repository. You now need to add a separate remote for handling ''integration''. A remote is a repository URL, and your local clone can contain multiple repositories to track different branches. To add kdelibs' ''integration'' repository, issue inside kdelibs' clone:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code lang=&amp;quot;bash&amp;quot;&amp;gt;git remote add integration kde:clones/kdelibs/dafre/kdelibs-integration&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, fetch from integration to retrieve the changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code lang=&amp;quot;bash&amp;quot;&amp;gt;git fetch integration&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|When working with multiple remotes, you can issue ''git fetch --all'' to update all the remotes tracked by your local copy }}&lt;br /&gt;
&lt;br /&gt;
====Creating branches====&lt;br /&gt;
You now need to get your branches set up, in particular ''integration/master''. In this example, we are creating a new branch named ''integration-master'' which would serve for this purpose in particular:&lt;br /&gt;
&lt;br /&gt;
 git checkout -b integration-master integration/master&lt;br /&gt;
&lt;br /&gt;
This command creates a local branch set to track a remote one. This branch should be the branch you'll be basing your work upon: origin/master is not meant for development!&lt;br /&gt;
&lt;br /&gt;
====Using integration vs. using your own clone====&lt;br /&gt;
It is ''strongly'' advised to push your work to integration, but under some circumstances (your work is extremely big in size, you do not have a KDE Development account, etc.), it is allowed to push your branches to a separate personal clone. All work should end up into integration for being reviewed anyway.&lt;br /&gt;
&lt;br /&gt;
===Developing a new feature===&lt;br /&gt;
We'll now walk through the process needed to develop a new feature. We'll suppose you want to add a button which says &amp;quot;hello&amp;quot; to a specific part of code.&lt;br /&gt;
&lt;br /&gt;
====Creating a new branch====&lt;br /&gt;
First thing to do is creating a new branch on which to base your work on. This branch must be based upon ''integration/master''. To make sure this happens, start by issuing&lt;br /&gt;
&lt;br /&gt;
 git checkout integration-master&lt;br /&gt;
&lt;br /&gt;
Now create your branch. Give it a self-exeplainatory name: try to keep branches as atomic as possible, and possibly split big changes throughout multiple branches divided as per topic. In our case, we want to name our branch ''add-hello-button''. To do that, we do:&lt;br /&gt;
&lt;br /&gt;
 git checkout -b add-hello-button&lt;br /&gt;
&lt;br /&gt;
That will create our personal branch which is going to contain our work. Push your branch to integration by issuing&lt;br /&gt;
&lt;br /&gt;
 git push integration add-hello-button&lt;br /&gt;
&lt;br /&gt;
====Synchronizing the branch with master====&lt;br /&gt;
When you create a branch (like you did), you are not receiving incremental updates from other people working in the repository (so in the ''master'' branch). This is usually not an issue, and instead an advantage: you can work on your code without being affected by other changes.&lt;br /&gt;
&lt;br /&gt;
However, there are some cases in which ''synchronizing'' your code with what's been going on with master is required. Git gives you two ways for doing that: merging or rebasing. Both have upsides and downsides, and both come at a cost.&lt;br /&gt;
&lt;br /&gt;
For this reason, you are ''strongly'' invited to avoid merging or rebasing on top of master while developing your feature whenever possible. Although, if you need to, you are supposed to merge your branch with master, and not to rebase it. What you need to do is the following:&lt;br /&gt;
&lt;br /&gt;
 git fetch --all&lt;br /&gt;
 git merge integration/master&lt;br /&gt;
&lt;br /&gt;
This command merges your work with the very latest code from ''integration/master''. This process comes with a cost: your branch will not be a candidate for a clean rebase, and each merge makes the history more complex.&lt;br /&gt;
&lt;br /&gt;
Again, this means that you should try to avoid this process if possible, and if you ''absolutely'' need to do that, you should try and keep the number of merges you'll do in your branch as low as possible. More than 3 merges start to create a very cluttered history.&lt;br /&gt;
&lt;br /&gt;
To learn more about merging, rebasing, and what this implies to your branch and to our merge strategy, you are invited to read [[Development/Tutorials/Git/Feature_Development_Workflow/Rebase_vs_Merge|Rebasing vs. merging: why and how]]&lt;br /&gt;
&lt;br /&gt;
====Getting the branch reviewed====&lt;br /&gt;
Once you are done with your changes, you are ready to get your branch reviewed. In the review process, the project's core developers will evaluate your code's quality, and will help you in making it perfect before it gets integrated. Here's how to do it.&lt;br /&gt;
&lt;br /&gt;
=====Push your changes to integration=====&lt;br /&gt;
If you have a KDE developer account, simply&lt;br /&gt;
&lt;br /&gt;
 git push integration add-hello-button&lt;br /&gt;
&lt;br /&gt;
from within your ''add-hello-button'' branch.&lt;br /&gt;
&lt;br /&gt;
If you do not have a KDE Developer account, please get in touch with the core developer who is mentoring you, or with one of the repository's maintainers to get your changes pushed into ''integration''.&lt;br /&gt;
&lt;br /&gt;
=====Submit the branch for review=====&lt;br /&gt;
Use Reviewboard for getting your branch reviewed. You can read [[Development/Review_Board|KDE Reviewboard+Git tutorial]] for getting started and understanding the steps involved.&lt;br /&gt;
&lt;br /&gt;
It is '''critical''' that you specify in the review request whether your branch has ever been merged with master or not.&lt;br /&gt;
&lt;br /&gt;
=====Modifying the branch=====&lt;br /&gt;
Everytime you update your review request with new code, please remember to push changes to ''integration'' with your new code. That will help developers in reviewing and maintainers in handling your request.&lt;br /&gt;
&lt;br /&gt;
====Getting your branch integrated====&lt;br /&gt;
Once your review request has been marked as &amp;quot;Ship it!&amp;quot;, your job is done. The maintainers will take care of merging the branch into ''integration/master'', stage it for release, and make it reach ''origin'' in the end.&lt;br /&gt;
&lt;br /&gt;
It is '''critical''' at this point to have your branch ''frozen''. You should not commit anything else to your branch and you should consider it dead. Maintainers will take over its commits and will delete it when merging occurs.&lt;br /&gt;
&lt;br /&gt;
If you are curious to find out what happens to your commit after your code is accepted, read [[Development/Tutorials/Git/Feature_Development_Workflow/Merge_Strategies|Merge strategies to and from integration]]&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Git/Feature_Development_Workflow/Simple_Branch_Development</id>
		<title>Development/Tutorials/Git/Feature Development Workflow/Simple Branch Development</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Git/Feature_Development_Workflow/Simple_Branch_Development"/>
				<updated>2011-04-27T18:27:53Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Setting up the development environment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{warning|This page refers to a draft policy which is still to be agreed and implemented. Please take it as a reference for a work in progress project. }}&lt;br /&gt;
&lt;br /&gt;
This tutorial can help casual developers as well as developers with a limited knowledge of git to get started quickly. It covers the entire work flow, from developing in branches to getting them merged and integrated for the next release.&lt;br /&gt;
&lt;br /&gt;
This tutorial does not require any git-specific knowledge.&lt;br /&gt;
&lt;br /&gt;
Before you start, you are strongly advised to read the following documents:&lt;br /&gt;
&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Repository_Roles|Which repository should I use?]]&lt;br /&gt;
&lt;br /&gt;
===Repositories and projects complying with this policy===&lt;br /&gt;
The following repositories/projects follow these guidelines. Any project not mentioned here is unaffected by what described&lt;br /&gt;
&lt;br /&gt;
* kde-workspace&lt;br /&gt;
* kde-runtime&lt;br /&gt;
* kdelibs (plasma only)&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
The approach described in this document helps us implement proper quality evaluation for code that ends up in the main repositories while still allowing developers to work on anything they want. It provides a sane merging strategy which does not require any special git knowledge from the contributing developer's side.&lt;br /&gt;
&lt;br /&gt;
To learn more about the rationale behind this approach, please read [[Development/Tutorials/Git/Feature_Development_Workflow/Rationale|the Rationale article]].&lt;br /&gt;
&lt;br /&gt;
===Setting up the development environment===&lt;br /&gt;
The following steps assume your system is set up as shown in the [http://community.kde.org/Sysadmin/GitKdeOrgManual git.kde.org user manual], especially regarding  [http://community.kde.org/Sysadmin/GitKdeOrgManual#Let_Git_rewrite_URL_prefixes automatic URL rewriting for KDE repositories] enabled.&lt;br /&gt;
&lt;br /&gt;
In the following tutorial, we'll refer to kdelibs as the main target, but this applies to any other repository using this policy.&lt;br /&gt;
&lt;br /&gt;
====Cloning the repository and adding integration====&lt;br /&gt;
To clone the repository, issue&lt;br /&gt;
&lt;br /&gt;
 git clone kde:kdelibs&lt;br /&gt;
&lt;br /&gt;
This will create a kdelibs directory containing the whole repository. You now need to add a separate remote for handling ''integration''. A remote is a repository URL, and your local clone can contain multiple repositories to track different branches. To add kdelibs' ''integration'' repository, issue inside kdelibs' clone:&lt;br /&gt;
&lt;br /&gt;
 git remote add integration kde:clones/kdelibs/dafre/kdelibs-integration&lt;br /&gt;
&lt;br /&gt;
Now, fetch from integration to retrieve the changes:&lt;br /&gt;
&lt;br /&gt;
 git fetch integration&lt;br /&gt;
&lt;br /&gt;
{{note|When working with multiple remotes, you can issue ''git fetch --all'' to update all the remotes tracked by your local copy }}&lt;br /&gt;
&lt;br /&gt;
====Creating branches====&lt;br /&gt;
You now need to get your branches set up, in particular ''integration/master''. In this example, we are creating a new branch named ''integration-master'' which would serve for this purpose in particular:&lt;br /&gt;
&lt;br /&gt;
 git checkout -b integration-master integration/master&lt;br /&gt;
&lt;br /&gt;
This command creates a local branch set to track a remote one. This branch should be the branch you'll be basing your work upon: origin/master is not meant for development!&lt;br /&gt;
&lt;br /&gt;
====Using integration vs. using your own clone====&lt;br /&gt;
It is ''strongly'' advised to push your work to integration, but under some circumstances (your work is extremely big in size, you do not have a KDE Development account, etc.), it is allowed to push your branches to a separate personal clone. All work should end up into integration for being reviewed anyway.&lt;br /&gt;
&lt;br /&gt;
===Developing a new feature===&lt;br /&gt;
We'll now walk through the process needed to develop a new feature. We'll suppose you want to add a button which says &amp;quot;hello&amp;quot; to a specific part of code.&lt;br /&gt;
&lt;br /&gt;
====Creating a new branch====&lt;br /&gt;
First thing to do is creating a new branch on which to base your work on. This branch must be based upon ''integration/master''. To make sure this happens, start by issuing&lt;br /&gt;
&lt;br /&gt;
 git checkout integration-master&lt;br /&gt;
&lt;br /&gt;
Now create your branch. Give it a self-exeplainatory name: try to keep branches as atomic as possible, and possibly split big changes throughout multiple branches divided as per topic. In our case, we want to name our branch ''add-hello-button''. To do that, we do:&lt;br /&gt;
&lt;br /&gt;
 git checkout -b add-hello-button&lt;br /&gt;
&lt;br /&gt;
That will create our personal branch which is going to contain our work. Push your branch to integration by issuing&lt;br /&gt;
&lt;br /&gt;
 git push integration add-hello-button&lt;br /&gt;
&lt;br /&gt;
====Synchronizing the branch with master====&lt;br /&gt;
When you create a branch (like you did), you are not receiving incremental updates from other people working in the repository (so in the ''master'' branch). This is usually not an issue, and instead an advantage: you can work on your code without being affected by other changes.&lt;br /&gt;
&lt;br /&gt;
However, there are some cases in which ''synchronizing'' your code with what's been going on with master is required. Git gives you two ways for doing that: merging or rebasing. Both have upsides and downsides, and both come at a cost.&lt;br /&gt;
&lt;br /&gt;
For this reason, you are ''strongly'' invited to avoid merging or rebasing on top of master while developing your feature whenever possible. Although, if you need to, you are supposed to merge your branch with master, and not to rebase it. What you need to do is the following:&lt;br /&gt;
&lt;br /&gt;
 git fetch --all&lt;br /&gt;
 git merge integration/master&lt;br /&gt;
&lt;br /&gt;
This command merges your work with the very latest code from ''integration/master''. This process comes with a cost: your branch will not be a candidate for a clean rebase, and each merge makes the history more complex.&lt;br /&gt;
&lt;br /&gt;
Again, this means that you should try to avoid this process if possible, and if you ''absolutely'' need to do that, you should try and keep the number of merges you'll do in your branch as low as possible. More than 3 merges start to create a very cluttered history.&lt;br /&gt;
&lt;br /&gt;
To learn more about merging, rebasing, and what this implies to your branch and to our merge strategy, you are invited to read [[Development/Tutorials/Git/Feature_Development_Workflow/Rebase_vs_Merge|Rebasing vs. merging: why and how]]&lt;br /&gt;
&lt;br /&gt;
====Getting the branch reviewed====&lt;br /&gt;
Once you are done with your changes, you are ready to get your branch reviewed. In the review process, the project's core developers will evaluate your code's quality, and will help you in making it perfect before it gets integrated. Here's how to do it.&lt;br /&gt;
&lt;br /&gt;
=====Push your changes to integration=====&lt;br /&gt;
If you have a KDE developer account, simply&lt;br /&gt;
&lt;br /&gt;
 git push integration add-hello-button&lt;br /&gt;
&lt;br /&gt;
from within your ''add-hello-button'' branch.&lt;br /&gt;
&lt;br /&gt;
If you do not have a KDE Developer account, please get in touch with the core developer who is mentoring you, or with one of the repository's maintainers to get your changes pushed into ''integration''.&lt;br /&gt;
&lt;br /&gt;
=====Submit the branch for review=====&lt;br /&gt;
Use Reviewboard for getting your branch reviewed. You can read [[Development/Review_Board|KDE Reviewboard+Git tutorial]] for getting started and understanding the steps involved.&lt;br /&gt;
&lt;br /&gt;
It is '''critical''' that you specify in the review request whether your branch has ever been merged with master or not.&lt;br /&gt;
&lt;br /&gt;
=====Modifying the branch=====&lt;br /&gt;
Everytime you update your review request with new code, please remember to push changes to ''integration'' with your new code. That will help developers in reviewing and maintainers in handling your request.&lt;br /&gt;
&lt;br /&gt;
====Getting your branch integrated====&lt;br /&gt;
Once your review request has been marked as &amp;quot;Ship it!&amp;quot;, your job is done. The maintainers will take care of merging the branch into ''integration/master'', stage it for release, and make it reach ''origin'' in the end.&lt;br /&gt;
&lt;br /&gt;
It is '''critical''' at this point to have your branch ''frozen''. You should not commit anything else to your branch and you should consider it dead. Maintainers will take over its commits and will delete it when merging occurs.&lt;br /&gt;
&lt;br /&gt;
If you are curious to find out what happens to your commit after your code is accepted, read [[Development/Tutorials/Git/Feature_Development_Workflow/Merge_Strategies|Merge strategies to and from integration]]&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Git/Feature_Development_Workflow/Simple_Branch_Development</id>
		<title>Development/Tutorials/Git/Feature Development Workflow/Simple Branch Development</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Git/Feature_Development_Workflow/Simple_Branch_Development"/>
				<updated>2011-04-27T18:26:17Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Rationale */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{warning|This page refers to a draft policy which is still to be agreed and implemented. Please take it as a reference for a work in progress project. }}&lt;br /&gt;
&lt;br /&gt;
This tutorial can help casual developers as well as developers with a limited knowledge of git to get started quickly. It covers the entire work flow, from developing in branches to getting them merged and integrated for the next release.&lt;br /&gt;
&lt;br /&gt;
This tutorial does not require any git-specific knowledge.&lt;br /&gt;
&lt;br /&gt;
Before you start, you are strongly advised to read the following documents:&lt;br /&gt;
&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Repository_Roles|Which repository should I use?]]&lt;br /&gt;
&lt;br /&gt;
===Repositories and projects complying with this policy===&lt;br /&gt;
The following repositories/projects follow these guidelines. Any project not mentioned here is unaffected by what described&lt;br /&gt;
&lt;br /&gt;
* kde-workspace&lt;br /&gt;
* kde-runtime&lt;br /&gt;
* kdelibs (plasma only)&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
The approach described in this document helps us implement proper quality evaluation for code that ends up in the main repositories while still allowing developers to work on anything they want. It provides a sane merging strategy which does not require any special git knowledge from the contributing developer's side.&lt;br /&gt;
&lt;br /&gt;
To learn more about the rationale behind this approach, please read [[Development/Tutorials/Git/Feature_Development_Workflow/Rationale|the Rationale article]].&lt;br /&gt;
&lt;br /&gt;
===Setting up the development environment===&lt;br /&gt;
In the following steps, we will assume your system is set up as shown in the [http://community.kde.org/Sysadmin/GitKdeOrgManual git.kde.org user manual], especially regarding  [http://community.kde.org/Sysadmin/GitKdeOrgManual#Let_Git_rewrite_URL_prefixes automatic URL rewriting for KDE repositories] enabled.&lt;br /&gt;
&lt;br /&gt;
In the following tutorial, we'll refer to kdelibs as the main target, but this applies to any other repository using this policy.&lt;br /&gt;
&lt;br /&gt;
====Cloning the repository and adding integration====&lt;br /&gt;
To clone the repository, issue&lt;br /&gt;
&lt;br /&gt;
 git clone kde:kdelibs&lt;br /&gt;
&lt;br /&gt;
This will create a kdelibs directory containing the whole repository. You now need to add a separate remote for handling ''integration''. A remote is a repository URL, and your local clone can contain multiple repositories to track different branches. To add kdelibs' ''integration'' repository, issue inside kdelibs' clone:&lt;br /&gt;
&lt;br /&gt;
 git remote add integration kde:clones/kdelibs/dafre/kdelibs-integration&lt;br /&gt;
&lt;br /&gt;
Now, fetch from integration to retrieve the changes:&lt;br /&gt;
&lt;br /&gt;
 git fetch integration&lt;br /&gt;
&lt;br /&gt;
{{note|When working with multiple remotes, you can issue ''git fetch --all'' to update all the remotes tracked by your local copy }}&lt;br /&gt;
&lt;br /&gt;
====Creating branches====&lt;br /&gt;
You now need to get your branches set up, in particular ''integration/master''. In this example, we are creating a new branch named ''integration-master'' which would serve for this purpose in particular:&lt;br /&gt;
&lt;br /&gt;
 git checkout -b integration-master integration/master&lt;br /&gt;
&lt;br /&gt;
This command creates a local branch set to track a remote one. This branch should be the branch you'll be basing your work upon: origin/master is not meant for development!&lt;br /&gt;
&lt;br /&gt;
====Using integration vs. using your own clone====&lt;br /&gt;
It is ''strongly'' advised to push your work to integration, but under some circumstances (your work is extremely big in size, you do not have a KDE Development account, etc.), it is allowed to push your branches to a separate personal clone. All work should end up into integration for being reviewed anyway.&lt;br /&gt;
&lt;br /&gt;
===Developing a new feature===&lt;br /&gt;
We'll now walk through the process needed to develop a new feature. We'll suppose you want to add a button which says &amp;quot;hello&amp;quot; to a specific part of code.&lt;br /&gt;
&lt;br /&gt;
====Creating a new branch====&lt;br /&gt;
First thing to do is creating a new branch on which to base your work on. This branch must be based upon ''integration/master''. To make sure this happens, start by issuing&lt;br /&gt;
&lt;br /&gt;
 git checkout integration-master&lt;br /&gt;
&lt;br /&gt;
Now create your branch. Give it a self-exeplainatory name: try to keep branches as atomic as possible, and possibly split big changes throughout multiple branches divided as per topic. In our case, we want to name our branch ''add-hello-button''. To do that, we do:&lt;br /&gt;
&lt;br /&gt;
 git checkout -b add-hello-button&lt;br /&gt;
&lt;br /&gt;
That will create our personal branch which is going to contain our work. Push your branch to integration by issuing&lt;br /&gt;
&lt;br /&gt;
 git push integration add-hello-button&lt;br /&gt;
&lt;br /&gt;
====Synchronizing the branch with master====&lt;br /&gt;
When you create a branch (like you did), you are not receiving incremental updates from other people working in the repository (so in the ''master'' branch). This is usually not an issue, and instead an advantage: you can work on your code without being affected by other changes.&lt;br /&gt;
&lt;br /&gt;
However, there are some cases in which ''synchronizing'' your code with what's been going on with master is required. Git gives you two ways for doing that: merging or rebasing. Both have upsides and downsides, and both come at a cost.&lt;br /&gt;
&lt;br /&gt;
For this reason, you are ''strongly'' invited to avoid merging or rebasing on top of master while developing your feature whenever possible. Although, if you need to, you are supposed to merge your branch with master, and not to rebase it. What you need to do is the following:&lt;br /&gt;
&lt;br /&gt;
 git fetch --all&lt;br /&gt;
 git merge integration/master&lt;br /&gt;
&lt;br /&gt;
This command merges your work with the very latest code from ''integration/master''. This process comes with a cost: your branch will not be a candidate for a clean rebase, and each merge makes the history more complex.&lt;br /&gt;
&lt;br /&gt;
Again, this means that you should try to avoid this process if possible, and if you ''absolutely'' need to do that, you should try and keep the number of merges you'll do in your branch as low as possible. More than 3 merges start to create a very cluttered history.&lt;br /&gt;
&lt;br /&gt;
To learn more about merging, rebasing, and what this implies to your branch and to our merge strategy, you are invited to read [[Development/Tutorials/Git/Feature_Development_Workflow/Rebase_vs_Merge|Rebasing vs. merging: why and how]]&lt;br /&gt;
&lt;br /&gt;
====Getting the branch reviewed====&lt;br /&gt;
Once you are done with your changes, you are ready to get your branch reviewed. In the review process, the project's core developers will evaluate your code's quality, and will help you in making it perfect before it gets integrated. Here's how to do it.&lt;br /&gt;
&lt;br /&gt;
=====Push your changes to integration=====&lt;br /&gt;
If you have a KDE developer account, simply&lt;br /&gt;
&lt;br /&gt;
 git push integration add-hello-button&lt;br /&gt;
&lt;br /&gt;
from within your ''add-hello-button'' branch.&lt;br /&gt;
&lt;br /&gt;
If you do not have a KDE Developer account, please get in touch with the core developer who is mentoring you, or with one of the repository's maintainers to get your changes pushed into ''integration''.&lt;br /&gt;
&lt;br /&gt;
=====Submit the branch for review=====&lt;br /&gt;
Use Reviewboard for getting your branch reviewed. You can read [[Development/Review_Board|KDE Reviewboard+Git tutorial]] for getting started and understanding the steps involved.&lt;br /&gt;
&lt;br /&gt;
It is '''critical''' that you specify in the review request whether your branch has ever been merged with master or not.&lt;br /&gt;
&lt;br /&gt;
=====Modifying the branch=====&lt;br /&gt;
Everytime you update your review request with new code, please remember to push changes to ''integration'' with your new code. That will help developers in reviewing and maintainers in handling your request.&lt;br /&gt;
&lt;br /&gt;
====Getting your branch integrated====&lt;br /&gt;
Once your review request has been marked as &amp;quot;Ship it!&amp;quot;, your job is done. The maintainers will take care of merging the branch into ''integration/master'', stage it for release, and make it reach ''origin'' in the end.&lt;br /&gt;
&lt;br /&gt;
It is '''critical''' at this point to have your branch ''frozen''. You should not commit anything else to your branch and you should consider it dead. Maintainers will take over its commits and will delete it when merging occurs.&lt;br /&gt;
&lt;br /&gt;
If you are curious to find out what happens to your commit after your code is accepted, read [[Development/Tutorials/Git/Feature_Development_Workflow/Merge_Strategies|Merge strategies to and from integration]]&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/Development/Tutorials/Git/Feature_Development_Workflow/Simple_Branch_Development</id>
		<title>Development/Tutorials/Git/Feature Development Workflow/Simple Branch Development</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/Development/Tutorials/Git/Feature_Development_Workflow/Simple_Branch_Development"/>
				<updated>2011-04-27T18:22:43Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{warning|This page refers to a draft policy which is still to be agreed and implemented. Please take it as a reference for a work in progress project. }}&lt;br /&gt;
&lt;br /&gt;
This tutorial can help casual developers as well as developers with a limited knowledge of git to get started quickly. It covers the entire work flow, from developing in branches to getting them merged and integrated for the next release.&lt;br /&gt;
&lt;br /&gt;
This tutorial does not require any git-specific knowledge.&lt;br /&gt;
&lt;br /&gt;
Before you start, you are strongly advised to read the following documents:&lt;br /&gt;
&lt;br /&gt;
* [[Development/Tutorials/Git/Feature_Development_Workflow/Repository_Roles|Which repository should I use?]]&lt;br /&gt;
&lt;br /&gt;
===Repositories and projects complying with this policy===&lt;br /&gt;
The following repositories/projects follow these guidelines. Any project not mentioned here is unaffected by what described&lt;br /&gt;
&lt;br /&gt;
* kde-workspace&lt;br /&gt;
* kde-runtime&lt;br /&gt;
* kdelibs (plasma only)&lt;br /&gt;
&lt;br /&gt;
===Rationale===&lt;br /&gt;
This approach is meant to implement proper quality evaluation into the main repositories, still allowing developers to work on anything they want, and providing a sane merging strategy which does not require any specific knowledge from the developer's side.&lt;br /&gt;
&lt;br /&gt;
To learn more about the rationale behind this approach, please read [[Development/Tutorials/Git/Feature_Development_Workflow/Rationale|the Rationale article]].&lt;br /&gt;
&lt;br /&gt;
===Setting up the development environment===&lt;br /&gt;
In the following steps, we will assume your system is set up as shown in the [http://community.kde.org/Sysadmin/GitKdeOrgManual git.kde.org user manual], especially regarding  [http://community.kde.org/Sysadmin/GitKdeOrgManual#Let_Git_rewrite_URL_prefixes automatic URL rewriting for KDE repositories] enabled.&lt;br /&gt;
&lt;br /&gt;
In the following tutorial, we'll refer to kdelibs as the main target, but this applies to any other repository using this policy.&lt;br /&gt;
&lt;br /&gt;
====Cloning the repository and adding integration====&lt;br /&gt;
To clone the repository, issue&lt;br /&gt;
&lt;br /&gt;
 git clone kde:kdelibs&lt;br /&gt;
&lt;br /&gt;
This will create a kdelibs directory containing the whole repository. You now need to add a separate remote for handling ''integration''. A remote is a repository URL, and your local clone can contain multiple repositories to track different branches. To add kdelibs' ''integration'' repository, issue inside kdelibs' clone:&lt;br /&gt;
&lt;br /&gt;
 git remote add integration kde:clones/kdelibs/dafre/kdelibs-integration&lt;br /&gt;
&lt;br /&gt;
Now, fetch from integration to retrieve the changes:&lt;br /&gt;
&lt;br /&gt;
 git fetch integration&lt;br /&gt;
&lt;br /&gt;
{{note|When working with multiple remotes, you can issue ''git fetch --all'' to update all the remotes tracked by your local copy }}&lt;br /&gt;
&lt;br /&gt;
====Creating branches====&lt;br /&gt;
You now need to get your branches set up, in particular ''integration/master''. In this example, we are creating a new branch named ''integration-master'' which would serve for this purpose in particular:&lt;br /&gt;
&lt;br /&gt;
 git checkout -b integration-master integration/master&lt;br /&gt;
&lt;br /&gt;
This command creates a local branch set to track a remote one. This branch should be the branch you'll be basing your work upon: origin/master is not meant for development!&lt;br /&gt;
&lt;br /&gt;
====Using integration vs. using your own clone====&lt;br /&gt;
It is ''strongly'' advised to push your work to integration, but under some circumstances (your work is extremely big in size, you do not have a KDE Development account, etc.), it is allowed to push your branches to a separate personal clone. All work should end up into integration for being reviewed anyway.&lt;br /&gt;
&lt;br /&gt;
===Developing a new feature===&lt;br /&gt;
We'll now walk through the process needed to develop a new feature. We'll suppose you want to add a button which says &amp;quot;hello&amp;quot; to a specific part of code.&lt;br /&gt;
&lt;br /&gt;
====Creating a new branch====&lt;br /&gt;
First thing to do is creating a new branch on which to base your work on. This branch must be based upon ''integration/master''. To make sure this happens, start by issuing&lt;br /&gt;
&lt;br /&gt;
 git checkout integration-master&lt;br /&gt;
&lt;br /&gt;
Now create your branch. Give it a self-exeplainatory name: try to keep branches as atomic as possible, and possibly split big changes throughout multiple branches divided as per topic. In our case, we want to name our branch ''add-hello-button''. To do that, we do:&lt;br /&gt;
&lt;br /&gt;
 git checkout -b add-hello-button&lt;br /&gt;
&lt;br /&gt;
That will create our personal branch which is going to contain our work. Push your branch to integration by issuing&lt;br /&gt;
&lt;br /&gt;
 git push integration add-hello-button&lt;br /&gt;
&lt;br /&gt;
====Synchronizing the branch with master====&lt;br /&gt;
When you create a branch (like you did), you are not receiving incremental updates from other people working in the repository (so in the ''master'' branch). This is usually not an issue, and instead an advantage: you can work on your code without being affected by other changes.&lt;br /&gt;
&lt;br /&gt;
However, there are some cases in which ''synchronizing'' your code with what's been going on with master is required. Git gives you two ways for doing that: merging or rebasing. Both have upsides and downsides, and both come at a cost.&lt;br /&gt;
&lt;br /&gt;
For this reason, you are ''strongly'' invited to avoid merging or rebasing on top of master while developing your feature whenever possible. Although, if you need to, you are supposed to merge your branch with master, and not to rebase it. What you need to do is the following:&lt;br /&gt;
&lt;br /&gt;
 git fetch --all&lt;br /&gt;
 git merge integration/master&lt;br /&gt;
&lt;br /&gt;
This command merges your work with the very latest code from ''integration/master''. This process comes with a cost: your branch will not be a candidate for a clean rebase, and each merge makes the history more complex.&lt;br /&gt;
&lt;br /&gt;
Again, this means that you should try to avoid this process if possible, and if you ''absolutely'' need to do that, you should try and keep the number of merges you'll do in your branch as low as possible. More than 3 merges start to create a very cluttered history.&lt;br /&gt;
&lt;br /&gt;
To learn more about merging, rebasing, and what this implies to your branch and to our merge strategy, you are invited to read [[Development/Tutorials/Git/Feature_Development_Workflow/Rebase_vs_Merge|Rebasing vs. merging: why and how]]&lt;br /&gt;
&lt;br /&gt;
====Getting the branch reviewed====&lt;br /&gt;
Once you are done with your changes, you are ready to get your branch reviewed. In the review process, the project's core developers will evaluate your code's quality, and will help you in making it perfect before it gets integrated. Here's how to do it.&lt;br /&gt;
&lt;br /&gt;
=====Push your changes to integration=====&lt;br /&gt;
If you have a KDE developer account, simply&lt;br /&gt;
&lt;br /&gt;
 git push integration add-hello-button&lt;br /&gt;
&lt;br /&gt;
from within your ''add-hello-button'' branch.&lt;br /&gt;
&lt;br /&gt;
If you do not have a KDE Developer account, please get in touch with the core developer who is mentoring you, or with one of the repository's maintainers to get your changes pushed into ''integration''.&lt;br /&gt;
&lt;br /&gt;
=====Submit the branch for review=====&lt;br /&gt;
Use Reviewboard for getting your branch reviewed. You can read [[Development/Review_Board|KDE Reviewboard+Git tutorial]] for getting started and understanding the steps involved.&lt;br /&gt;
&lt;br /&gt;
It is '''critical''' that you specify in the review request whether your branch has ever been merged with master or not.&lt;br /&gt;
&lt;br /&gt;
=====Modifying the branch=====&lt;br /&gt;
Everytime you update your review request with new code, please remember to push changes to ''integration'' with your new code. That will help developers in reviewing and maintainers in handling your request.&lt;br /&gt;
&lt;br /&gt;
====Getting your branch integrated====&lt;br /&gt;
Once your review request has been marked as &amp;quot;Ship it!&amp;quot;, your job is done. The maintainers will take care of merging the branch into ''integration/master'', stage it for release, and make it reach ''origin'' in the end.&lt;br /&gt;
&lt;br /&gt;
It is '''critical''' at this point to have your branch ''frozen''. You should not commit anything else to your branch and you should consider it dead. Maintainers will take over its commits and will delete it when merging occurs.&lt;br /&gt;
&lt;br /&gt;
If you are curious to find out what happens to your commit after your code is accepted, read [[Development/Tutorials/Git/Feature_Development_Workflow/Merge_Strategies|Merge strategies to and from integration]]&lt;/div&gt;</summary>
		<author><name>Aseigo</name></author>	</entry>

	<entry>
		<id>http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting</id>
		<title>KDE System Administration/PlasmaDesktopScripting</title>
		<link rel="alternate" type="text/html" href="http://techbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting"/>
				<updated>2011-04-27T07:54:32Z</updated>
		
		<summary type="html">&lt;p&gt;Aseigo: /* Locating Applications and Paths */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ECMA Script Interaction With Plasma Shells ==&lt;br /&gt;
&lt;br /&gt;
It is possible to control and interact with a Plasma user interface shell such as a plasma-desktop or (starting in KDE SC 4.5) plasma-netbook session using ECMA Script (aka JavaScript). This scripting mechanism exposes containments (Desktop Activities and Panels), widgets and various other aspects of plasma-desktop configuration using the widely known and used ECMA Script language. The QtScript engine is used for the runtime environment.&lt;br /&gt;
&lt;br /&gt;
This document describes the API that is provided along with how to&lt;br /&gt;
run such scripts in plasma-desktop.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
A set of examples can be found [https://projects.kde.org/projects/kde/kdeexamples/repository/revisions/master/show/plasma/javascript/plasma-shell-scripting here] that demonstrate the use of various aspects of Plasma shell scripting.&lt;br /&gt;
&lt;br /&gt;
Contributions of additional examples are welcome and an be sent to the Plasma development mailing list (plasma-devel at kde.org) for inclusion if you do not have commit rights to the kdeexamples module.&lt;br /&gt;
&lt;br /&gt;
== Running Scripts ==&lt;br /&gt;
There are three ways that scripts can be executed in plasma-desktop:&lt;br /&gt;
&lt;br /&gt;
* '''on first run''': when plasma-desktop is started without any pre-existing configuration, any scripts in $APPDATA/plasma-desktop/init/ with a &amp;quot;.js&amp;quot; suffix are run. If there is more than one script, they are run sequentially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''on update''': when plasma-desktop is started, it will check in&lt;br /&gt;
  `kde4-config --path data`/plasma-desktop/updates/ &lt;br /&gt;
with a &amp;quot;.js&amp;quot; suffix for scripts that have not yet been run. If there is more than one script which has not been run yet they will be executed serially in the alphabetical order of the file names.&lt;br /&gt;
&lt;br /&gt;
A record of which update scripts have been run is kept in the application's config file in the [Updates] group. This means that if the plasma-desktop configuraiton file is removed, all the update scripts will be run again.&lt;br /&gt;
&lt;br /&gt;
{{note|For security reasons, scripts located in the user's home directory will '''not''' be run during this phase.}}&lt;br /&gt;
&lt;br /&gt;
* '''interactively''': an interactive scripting dialog can be requested either via the KRunner window (Alt+F2, by default, or via the &amp;quot;Run Command&amp;quot; entry in various desktop menus) by entering &amp;quot;desktop console&amp;quot; as the search term. It can also be triggered directly via dbus with &amp;lt;code bash&amp;gt;qdbus org.kde.plasma-desktop /MainApplication showInteractiveConsole&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|This method is not available for plasma-netbook.}}&lt;br /&gt;
&lt;br /&gt;
:ECMA Script may be entered directly into this window for execution and output appears in the lower half of the window. Ctrl+E is a shortcut to run scripts, and scripts can be saved to and loaded from disk.&lt;br /&gt;
&lt;br /&gt;
:Scripts from files can also be loaded using KRunner with &amp;quot;desktop console /path/to/file&amp;quot; or via dbus with&lt;br /&gt;
&amp;lt;code bash&amp;gt;qdbus org.kde.plasma-desktop /MainApplication loadScriptInInteractiveConsole /path/to/file&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&lt;br /&gt;
Templates are named packages that contain scripts. This provides a way for common functionality to be easily reused, helping to increase consistency and lower maintenance costs. Templates can be loaded from other scripts by name and they are also used to populate some parts of the user interface, such as the entries in the Add Panels menu. &lt;br /&gt;
&lt;br /&gt;
A template is a small set of files in a specified file hierarchy (or, in Plasma terms, a &amp;quot;Package&amp;quot;). In particular, a Template package contains the following files:&lt;br /&gt;
&lt;br /&gt;
* metadata.desktop: a .desktop file describing the template&lt;br /&gt;
* contents/layout.js: a Javascript file containing the actual script&lt;br /&gt;
&lt;br /&gt;
Templates are stored under share/apps/plasma/layout-templates and may be installed using `plasmapkg -t layout-template -i /path/to/package`. Template packages may also be provided as a .zip file with a .plasmalayout suffix.&lt;br /&gt;
&lt;br /&gt;
The metadata.desktop file contains the usual .desktop entries such as Name and Icon but must also contain Type=Service and ServiceTypes=Plasma/LayoutTemplate entries. If the layout is specific to a given Plasma application, such as plasma-desktop, this can be specific using X-Plasma-Shell. X-Plasma-ContainmentCategories defines what kind of layout it is with possible values being panel and desktop. Finally a X-KDE-PluginInfo-Name entry is required to provide a globally unique internal name for the Template. Here is an example of a Template that provides a Panel layout for Plasma Netbook:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Name=Cool Panel&lt;br /&gt;
Type=Service&lt;br /&gt;
ServiceTypes=Plasma/LayoutTemplate&lt;br /&gt;
X-Plasma-Shell=plasma-netbook&lt;br /&gt;
X-Plasma-ContainmentCategories=panel&lt;br /&gt;
X-KDE-PluginInfo-Author=Aaron Seigo&lt;br /&gt;
X-KDE-PluginInfo-Email=aseigo@kde.org&lt;br /&gt;
X-KDE-PluginInfo-Name=org.kde.CoolNetbookPanel&lt;br /&gt;
X-KDE-PluginInfo-Version=1.0&lt;br /&gt;
X-KDE-PluginInfo-Website=http://plasma.kde.org/&lt;br /&gt;
X-KDE-PluginInfo-Category=&lt;br /&gt;
X-KDE-PluginInfo-Depends=&lt;br /&gt;
X-KDE-PluginInfo-License=GPL&lt;br /&gt;
X-KDE-PluginInfo-EnabledByDefault=true&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running a template, two global variables will be accessible in read-only mode: templateName and templateComment. They will contain the Name and Comment fields of the above desktop file, and are translated if a localization is available.&lt;br /&gt;
&lt;br /&gt;
=== Examples of Usage ===&lt;br /&gt;
&lt;br /&gt;
A good example of the use of templates is the use case that triggered the creation of this feature: the desire to make it easy for users to re-create the default panel that is created on first start. There is a Template called org.kde.plasma-desktop.defaultPanel that ships with the KDE Plasma Workspace which contains the layout for the initial default panel. This is referenced by the default Plasma Desktop init script and, because it is marked as a Panel Template in the metadata.desktop file it also shows up to the user in the Add Panels menu. When selected by the user from the menu, the exact same panel that is created on desktop start up is created for them, complete with Plasma Widgets and configuration.&lt;br /&gt;
&lt;br /&gt;
Another example of the usefulness of templates is the &amp;quot;Find Widgets&amp;quot; template. This template, which first shipped with Plasma Desktop v4.5, provides a function for finding widgets by name. It appears in the toolbar &amp;quot;Load&amp;quot; and &amp;quot;Use&amp;quot; menus in the Desktop Console in plasma-desktop, and makes finding widgets as simple as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
var template = loadTemplate('org.kde.plasma-desktop.findWidgets')&lt;br /&gt;
template.findWidgets('systemtray')&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
In addition to the normal ECMA Script API and the Qt-specific extensions (such as signal/slot support) provided by QtScript, the following API is provided for use by scripts.&lt;br /&gt;
&lt;br /&gt;
All of the API below, unless otherwise noted with a version noticed, appear as below in the KDE Software Compilation v4.4.0 and later. API that is not noted as being part of a given class or object is part of the global namespace.&lt;br /&gt;
&lt;br /&gt;
{{note|API compatibility is guaranteed from version to version starting with KDE Software Compilation v4.4.0.}}&lt;br /&gt;
&lt;br /&gt;
=== Version Numbers ===&lt;br /&gt;
&lt;br /&gt;
Starting with KDE SC 4.5, the version number of both the scripting API and the application is available to the script via the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''String'' '''applicationVersion''': the version of the application, e.g. 0.3&lt;br /&gt;
* ''String'' '''platformVersion''': the version of the KDE Platform, e.g. 0.3&lt;br /&gt;
* ''number'' '''scriptingVersion''': the version of the scripting API; e.g. in KDE SC 4.5 this is 2&lt;br /&gt;
&lt;br /&gt;
=== Activities ===&lt;br /&gt;
Activities are the desktop layer in a plasma-desktop session and may contain widgts. In sightly more technical terms, they are desktop containments. Activities can be created, enumerated, modified and destroyed.&lt;br /&gt;
&lt;br /&gt;
New Activities can be created using the Activity constructor, like this:&lt;br /&gt;
&lt;br /&gt;
    var activity = new Activity(&amp;quot;folderview&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file). See the documentation on the Containment object class below.&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''activityIds''': returns a list of integer ids of all existing Plasma activities&lt;br /&gt;
* ''Array[String]'' '''knownActivityTypes''':  (scripting version &amp;gt;= 2) a list of types of activities that can be created. This is useful to check if an Activity type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Activity'' '''activityById(number id)''': return an object representing the activity with the given id&lt;br /&gt;
* ''Activity'' '''activityForScreen(number screen[, number dekstop])''': returns an object representing the activity  currently associated with the given screen and, optionally, the given desktop.&lt;br /&gt;
* ''Array[Activity]'' '''activities()''': returns an array of all activities that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Panels ===&lt;br /&gt;
Panels can be created, enumerated, modified and destroyed. A panel object combines both a containment as well as the container itself, allowing for full control of things such as where it appears on screen and the hiding features associated with them.&lt;br /&gt;
&lt;br /&gt;
New Panels can be created using the Panel constructor, like this:&lt;br /&gt;
&lt;br /&gt;
    var panel = new Panel(&amp;quot;dock&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The string passed into the constructor maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
in the plugin's .desktop file).&lt;br /&gt;
&lt;br /&gt;
Read-only properties:&lt;br /&gt;
* ''Array[number]'' '''panelIds''': returns a list of integer ids of all existing Plasma panels&lt;br /&gt;
* ''Array[String]'' '''knownPanelTypes''':  (scripting version &amp;gt;= 2) a list of types of panels that can be created. This is useful to check if a Panel type is available on the system before trying to construct one.&lt;br /&gt;
&lt;br /&gt;
Functions:&lt;br /&gt;
* ''Panel'' '''panelById(int id)''': returns an object representing the Panel that matches the given id&lt;br /&gt;
* ''Array[Panels]'' '''panels()''': returns an array of all panels that currently exist&lt;br /&gt;
&lt;br /&gt;
=== Activities and Panels ===&lt;br /&gt;
Activity and Panel objects, once created by the script, or as returned by activityById, activityForScreen,&lt;br /&gt;
or panelById) provide the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id: the integer id of this activity&lt;br /&gt;
* ''String'' '''formFactor''': returns the form factor of the activity, e.g. &amp;quot;planar&amp;quot; for most desktop activities,&amp;quot;mediacenter&amp;quot; for media centers and either &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; for panels.&lt;br /&gt;
* ''Array[number]'' '''widgetIds''': a list of integer ids of all the widgets in this Activity&lt;br /&gt;
* ''Array[String]'' '''configKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''configGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
&lt;br /&gt;
as well as the following read/write properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''desktop''': the virtual desktop this activity is associated with, or -1 for none&lt;br /&gt;
* ''number'' '''screen''': the screen this activity is associated with, or -1 for none&lt;br /&gt;
* ''String'' '''name''': the name of this activity&lt;br /&gt;
* ''String'' '''wallpaperPlugin''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin to use with the Activity&lt;br /&gt;
* ''String'' '''wallpaperMode''': (scriptingVersion &amp;gt;= 2) the wallpaper plugin mode to use with the Activity&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': (scriptingVersion &amp;gt;= 2) the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget &lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
and the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''remove()''': deletes this activity and all widgets inside of it&lt;br /&gt;
* ''Widget'' '''widgetById(number id)''': returns an object representing the widget with the given id&lt;br /&gt;
* ''Widget'' '''addWidget(String name)''': adds a new widget to the activity; the name maps to the X-KDE-PluginInfo-Name= entry&lt;br /&gt;
  in the widget's .desktop file&lt;br /&gt;
* ''Widget'' '''addWidget(Widget widget)''': adds an existing widget to this activity; useful for moving widgets between Activities and Panels&lt;br /&gt;
* '''showConfigurationInteface()''': shows the configuration user interface for this Activity or Panel on the screen&lt;br /&gt;
* '''readConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the config with default for the default value&lt;br /&gt;
* '''writeConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the config &lt;br /&gt;
* '''readGlobalConfig(String key, any default)''': (scriptingVersion &amp;gt;= 2) reads the value of key in the global config with default&lt;br /&gt;
  for the default value&lt;br /&gt;
* '''writeGlobalConfig(String key, any value)''': (scriptingVersion &amp;gt;= 2) sets key to value in the global config&lt;br /&gt;
* '''reloadConfig()''': (scriptingVersion &amp;gt;= 2) causes the Activity or Panel to reload its configuration; reaction to configuration changes made using readConfig are usually activated on script exit, but this can be triggered earlier on a per-widget basis using this method&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of panels and activities of the same type.&lt;br /&gt;
* ''Array[Widget]'' '''widgets([String type])''': (scriptingVersion &amp;gt;= 2) returns all the widgets in the Panel or Activity. If the optional type is specified, only widgets matching that type will be returned.&lt;br /&gt;
&lt;br /&gt;
In addition to all of the above properties and functions, Panel objects also provide the folowing read/write properties:&lt;br /&gt;
* ''number'' '''length''': the number of pixels along the screen edge used&lt;br /&gt;
* ''number'' '''height''': the height (or for vertical panels, the width) of the panel&lt;br /&gt;
* ''String'' '''hiding''': the hiding mode of the panel, one of &amp;quot;none&amp;quot; (for no hiding), &amp;quot;autohide&amp;quot;, &amp;quot;windowscover&amp;quot; or &amp;quot;windowsbelow&amp;quot;&lt;br /&gt;
* ''String'' '''alignment''': right, left or center alignment of the panel (for vertical panels, right corrsponds to top and left to bottom)&lt;br /&gt;
* ''String'' '''location''': returns the location of the activity (only relevant for Panels); valid values include &amp;quot;top&amp;quot;, &amp;quot;bottom&amp;quot;, &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot; and &amp;quot;floating&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Widgets ===&lt;br /&gt;
Widgets may be enumerated by calling the widgetIds property on a Activity or Panel object. With a widget id in hand, a Widget object can be retrieved by calling widgetById(id) on an Activity or Panel object. New Widgets can be created with add addWidget(String) function provided by Activity and Panel objects.&lt;br /&gt;
&lt;br /&gt;
A list of all installed widget types can be retrieved the following read-only property:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''knownWidgetTypes''' (scripting version &amp;gt;= 2)&lt;br /&gt;
&lt;br /&gt;
A Widget object provides the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
* ''number'' '''id''': the id of the widget&lt;br /&gt;
* ''String'' '''type''': the plugin type of this widget&lt;br /&gt;
* ''Array[String]'' '''configKeys''': a list of all keys that are set in the current configuration&lt;br /&gt;
* ''Array[String]'' '''configGroups''': a list of all the groups in the current configuration&lt;br /&gt;
* ''Array[String]'' '''globalConfigKeys''':  (scriptingVersion &amp;gt;= 2) a list of all keys that are set in the current global configuration group&lt;br /&gt;
* ''Array[String]'' '''globalConfigGroups''': (scriptingVersion &amp;gt;= 2)  a list of all the groups in the current global configuration group&lt;br /&gt;
* ''String'' '''version''': (scriptingVersion &amp;gt;= 2) the version of the Activity or Panel&lt;br /&gt;
&lt;br /&gt;
as well as the following read-write properties:&lt;br /&gt;
&lt;br /&gt;
* ''Array[String]'' '''currentConfigGroup''': the current configuration group path, with each entry in the array representing a sub-group. This allows one to access trees of groups with code such as: widget.currentConfigGroup = new Array('topGroup', 'subGroupOfTopGroup'). An empty Array means the default (top-level) configuration group for the widget&lt;br /&gt;
* ''Array[String]'' '''currentGlobalConfigGroup''': (scriptingVersion &amp;gt;= 2)  the current global configuration group path, with each entry in the array representing a sub-group, similar to currentConfigGroup. However, global configuration is shared by all instances of widgets of the same type.&lt;br /&gt;
* ''QRectF'' '''geometry''': the geometry of the widget (settable)&lt;br /&gt;
* ''String'' '''globalShortcut''': the shortcut sequence (in the format used by QKeySequence, e.g. &amp;quot;Alt+F1&amp;quot;) associated with this widget&lt;br /&gt;
* ''number'' '''index''': the layout index of the widget; in a Panel this corresponds to the order the widget appears in. Changing the value of the index will change the position of the widget in Panels and may do so in some Activities as 