Difference between revisions of "Development/Tutorials/Plasma/JavaScript/API-Addons"

Jump to: navigation, search
(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 "Addons...')
 
(Addons (API V3))
 
Line 1: Line 1:
 
== Addons (API V3) ==
 
== 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 "Addons" and are packaged similarly to a Plasmoid. For more information on creating Javascript Addons, visit the [[/JavascriptAddons|Javascript Addons tutorial]].
+
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 "Addons" and are packaged similarly to a Plasmoid. For more information on creating Javascript Addons, visit the [[.Development/Plasma/JavascriptAddons|Javascript Addons tutorial]].
  
 
It is possible to list, load and be notified of new Addons having been installed for your Plasmoid.
 
It is possible to list, load and be notified of new Addons having been installed for your Plasmoid.

Latest revision as of 13:15, 24 June 2011

[edit] 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 "Addons" and are packaged similarly to a Plasmoid. For more information on creating Javascript Addons, visit the Javascript Addons tutorial.

It is possible to list, load and be notified of new Addons having been installed for your Plasmoid.

  • 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.
  • 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 "addCreated" event.

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:

  • addonCreated: Object addOn
  • newAddonsAvaiable

[edit] AddonInformation (API V3)

The AddonInformation object contains the following read-only properties:

  • String id: the id of the Addon. Can be used with loadAddon
  • String name: a string suitable for showing the user, such as in a configuration dialog

This page was last modified on 24 June 2011, at 13:15. This page has been accessed 1,531 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal