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

Kross

Kross::ScriptingPlugin

Kross::ScriptingPlugin Class Reference

The ScriptingPlugin class loads additional actions stored in rc files with the KrossScripting format, e.g. More...

#include <plugin.h>

Inheritance diagram for Kross::ScriptingPlugin:

Inheritance graph
[legend]

List of all members.


Public Member Functions

void addObject (QObject *object, const QString &name=QString())
 ScriptingPlugin (QObject *parent=0)
virtual void setDOMDocument (const QDomDocument &document, bool merge=false)
virtual ~ScriptingPlugin ()

Protected Slots

virtual void slotEditScriptActions ()
virtual void slotResetScriptActions ()

Detailed Description

The ScriptingPlugin class loads additional actions stored in rc files with the KrossScripting format, e.g.

:

 <KrossScripting>
     <collection name="file" text="File">
         <script
             name="dummy_script"
             text="Dummy Script"
             comment="Dummy Script example"
             interpreter="python"
             file="dummy_script.py" />
     </collection>
 </KrossScripting>

The 'name' attribute in collection element will be used to match the menu object name. If no menu already exists with this name, a new one is created. In this example, the user will see a menu item with the text "Dummy Script" in "File" menu, which will execute the dummy_script.py script.

By default it tries to find kross rc files in appdata "scripts" subdirectory. Clients of this class can use slotEditScriptActions() as a way to override and/or extend the default script actions (if they exist at all).

Definition at line 61 of file ui/plugin.h.


Constructor & Destructor Documentation

ScriptingPlugin::ScriptingPlugin ( QObject *  parent = 0  )  [explicit]

Constructor.

Parameters:
parent The parent QObject this QObject is child of.

Definition at line 55 of file ui/plugin.cpp.

ScriptingPlugin::~ScriptingPlugin (  )  [virtual]

Destructor.

Definition at line 62 of file ui/plugin.cpp.


Member Function Documentation

void ScriptingPlugin::addObject ( QObject *  object,
const QString &  name = QString() 
)

Add a QObject to the list of children.

The object will be published to the scripting code.

Parameters:
object The QObject instance that should be added to the list of children.
name The name the QObject should be known under. If not defined, the QObject's objectName is used.

Definition at line 73 of file ui/plugin.cpp.

void ScriptingPlugin::setDOMDocument ( const QDomDocument &  document,
bool  merge = false 
) [virtual]

Re-implement in order to load additional kross scripting rc files.

Definition at line 67 of file ui/plugin.cpp.

void ScriptingPlugin::slotEditScriptActions (  )  [protected, virtual, slot]

This slot will open/create a scriptactions.rc file at $KDEHOME/share/apps/application/scripts/ which will overide other kross rc files.

This allows a user to extend existing menus with new actions.

Definition at line 156 of file ui/plugin.cpp.

void ScriptingPlugin::slotResetScriptActions (  )  [protected, virtual, slot]

Deletes the user rc file, which has the effect of falling back to the default script actions (if any).

Definition at line 207 of file ui/plugin.cpp.


The documentation for this class was generated from the following files:
  • ui/plugin.h
  • ui/plugin.cpp

Kross

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal