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

Jump to: navigation, search
(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...')
 
m (Text replace - "<code ini>" to "<syntaxhighlight lang="ini">")
Line 4: Line 4:
 
Required extensions are requested using the X-Plasma-RequiredExtensions key, and optional extensions with the X-Plasma-OptionalExtensions. For example:
 
Required extensions are requested using the X-Plasma-RequiredExtensions key, and optional extensions with the X-Plasma-OptionalExtensions. For example:
  
<code ini>
+
<syntaxhighlight lang="ini">
 
X-Plasma-RequiredExtensions=FileDialog,MyCustomQScriptExtension
 
X-Plasma-RequiredExtensions=FileDialog,MyCustomQScriptExtension
 
X-Plasma-OptionalExtensions=LaunchApp,HTTP
 
X-Plasma-OptionalExtensions=LaunchApp,HTTP

Revision as of 21:36, 29 June 2011

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 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.

Required extensions are requested using the X-Plasma-RequiredExtensions key, and optional extensions with the X-Plasma-OptionalExtensions. For example:

X-Plasma-RequiredExtensions=FileDialog,MyCustomQScriptExtension
X-Plasma-OptionalExtensions=LaunchApp,HTTP
</code>
 
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.
 
== Available Extensions ==
 
* [[../API-FileDialog|File Dialog]]
* [[../API-LocalIO|Local IO]]
* [[../API-NetworkIO|Network IO]]
* [[../API-HTTP|HTTP]]
* [[../API-LaunchApp|Launching Applications]]

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