Writing Plasmoids With JavaScript
=================================

The Plasmoid Package
===================

Structure
---------
http://techbase.kde.org/Projects/Plasma/Package

Installing and Replacing
------------------------
plasmapkg

The plasmoid Object
===================
Environment:
    FormFactor formFactor();
    Location location();
    QString currentActivity();
    bool shouldConserveResources();

Properties:
    AspectRatioMode aspectRatioMode();
    void setAspectRatioMode(AspectRatioMode mode);
    bool isBusy();
    setFailedToLaunch(bool failed, const QString &reason = QString());
    setBusy(bool busy);

Geometry:
    resize(qreal w, qreal h);
    setMinimumSize(qreal w, qreal h);
    setPreferredSize(qreal w, qreal h);

Painting and Layout:
    update();
    setLayout(QGraphicsLayout *layout);
    QGraphicsLayout *layout() const;

Package Access:
    QString file(const QString &type, const QString &fileName)
    QString file(const QString &type)

Getting Notified of Changes
===========================
Events:
plasmoid.formFactorChanged
plasmoid.locationChanged
plasmoid.contextChanged

Possibilities for 4.3
---------------------
networkAvailableChanged(bool)
conserveResourcesChanged(bool)

User Interface Elements
=======================

Types of Widgets
----------------
BusyWidget
CheckBox
ComboBox
FlashingLabel
Frame
GroupBox
IconWidget
Label
LineEdit
Meter
PushButton
RadioButton
ScrollBar
SignalPlotter
Slider
SvgWidget
TabBar
TextEdit
ToolButton
TreeView
WebView

Layouts
-------
GridLayout
LinearLayout

Creating Items By Hand
----------------------
createWidget
createLayout

Creating Items From UI Files
----------------------------

Animations
==========
An animation object can be retrieved by calling the animation(string) method.
The string corresponds to the Plasma::Animator::Animation enumeration, and currently
the following are supported (case insensitive) along with a list of their properties:

* fade
* grow
* expand
* pause
* pulse
* rotate
* rotateStacked
* slide

All animations support the following properties:

* duration (int): length of the animation in ms
* widgetToAnimate: the QGraphicsWidget (e.g. a Plasma::Widget) to operate on
* forwards (bool): true if the animation should play forwards or false if backwards (rewind)
* visible (bool): whether or not the animation is currently visible (??!?!)

By default the animation object is associated with the plasmoid itself. By setting
the widgetToAnimate property, however, it can be re-assigned to any QGraphicsWidget
(e.g. Plasma widgets such as push buttons, sliders, etc) one wants.


Animations may also be put into groups for convenient sequential or parallel running
by creating an AnimationGroup object and then calling add(widget) on it. The parallel (bool)
property holds whether or not the animations should be run in parallel or sequentially.
The default is sequential.

Painting
========

SVG Images
---------
PlasmaSvg
PlasmaFrameSvg

Painting on the Canvas
----------------------
plasmoid.paintInterface = function(painter)
QPainter
QFont
QRectF
QSizeF
QPoint

Accessing Sources of Data
=========================
dataEngine(string name)
dataUpdate

Configuration
=============
Declaring Config Values
-----------------------
KConfigXt XML -> main.xml

Accessing Configuration Data
----------------------------
activeConfig
plasmoid.readConfig(string)
WriteConfig(string, var)

User Customization
------------------
Qt UI file
configChanged()

Other Functions and Classes
===========================
print(string)
GraphicsItem
Timer
Url
