lib

Kross::Api::ScriptGUIClient Class Reference

#include <scriptguiclient.h>

Inheritance diagram for Kross::Api::ScriptGUIClient:

KXMLGUIClient

List of all members.


Detailed Description

The ScriptGUIClient class provides abstract access to scripting code used to extend an applications functionality.

Definition at line 43 of file scriptguiclient.h.


Public Types

typedef QPtrList< KActionList

Public Slots

KURL openScriptFile (const QString &caption=QString::null)
bool loadScriptFile ()
bool executeScriptFile ()
bool executeScriptFile (const QString &file)
bool executeScriptAction (ScriptAction::Ptr action)
void showScriptManager ()

Signals

void collectionChanged (ScriptActionCollection *)
void executionStarted (const Kross::Api::ScriptAction *)
void executionFinished (const Kross::Api::ScriptAction *)

Public Member Functions

 ScriptGUIClient (KXMLGUIClient *guiclient, QWidget *parent=0)
virtual ~ScriptGUIClient ()
bool hasActionCollection (const QString &name)
ScriptActionCollectiongetActionCollection (const QString &name)
QMap< QString,
ScriptActionCollection * > 
getActionCollections ()
void addActionCollection (const QString &name, ScriptActionCollection *collection)
bool removeActionCollection (const QString &name)
void reloadInstalledScripts ()
bool installScriptPackage (const QString &scriptpackagefile)
bool uninstallScriptPackage (const QString &scriptpackagepath)
bool loadScriptConfigFile (const QString &scriptconfigfile)
bool loadScriptConfigDocument (const QString &scriptconfigfile, const QDomDocument &document)
virtual void setXMLFile (const QString &file, bool merge=false, bool setXMLDoc=true)
virtual void setDOMDocument (const QDomDocument &document, bool merge=false)

Member Typedef Documentation

List of KAction instances.

Definition at line 53 of file scriptguiclient.h.


Constructor & Destructor Documentation

ScriptGUIClient::ScriptGUIClient ( KXMLGUIClient guiclient,
QWidget *  parent = 0 
) [explicit]

Constructor.

Parameters:
guiclient The KXMLGUIClient this ScriptGUIClient is a child of.
parent The parent QWidget. If defined Qt will handle freeing this ScriptGUIClient instance else the caller has to take care of freeing this instance if not needed any longer.

Definition at line 66 of file scriptguiclient.cpp.

ScriptGUIClient::~ScriptGUIClient (  )  [virtual]

Destructor.

Definition at line 95 of file scriptguiclient.cpp.


Member Function Documentation

bool ScriptGUIClient::hasActionCollection ( const QString &  name  ) 

Returns:
true if this ScriptGUIClient has a ScriptActionCollection with the name name else false is returned.

Definition at line 103 of file scriptguiclient.cpp.

ScriptActionCollection * ScriptGUIClient::getActionCollection ( const QString &  name  ) 

Returns:
the ScriptActionCollection which has the name name or NULL if there exists no such ScriptActionCollection .

Definition at line 108 of file scriptguiclient.cpp.

QMap< QString, ScriptActionCollection * > ScriptGUIClient::getActionCollections (  ) 

Returns:
a map of all avaiable ScriptActionCollection instances this ScriptGUIClient knows about. Per default there are 2 collections avaiable; 1. "installedscripts" The installed collection of scripts. 2. "loadedscripts" The loaded scripts.

Definition at line 113 of file scriptguiclient.cpp.

void ScriptGUIClient::addActionCollection ( const QString &  name,
ScriptActionCollection collection 
)

Add a new ScriptActionCollection with the name name to our map of actioncollections.

Definition at line 118 of file scriptguiclient.cpp.

bool ScriptGUIClient::removeActionCollection ( const QString &  name  ) 

Remove the ScriptActionCollection defined with name name.

Definition at line 124 of file scriptguiclient.cpp.

void ScriptGUIClient::reloadInstalledScripts (  ) 

Reload the list of installed scripts.

Definition at line 135 of file scriptguiclient.cpp.

bool ScriptGUIClient::installScriptPackage ( const QString &  scriptpackagefile  ) 

Install the packagefile scriptpackagefile .

Those packagefile should be a tar.gz-archive which will be extracted and to the users script-directory.

Definition at line 148 of file scriptguiclient.cpp.

bool ScriptGUIClient::uninstallScriptPackage ( const QString &  scriptpackagepath  ) 

Uninstall the scriptpackage located in the path scriptpackagepath .

This just deletes the whole directory.

Definition at line 188 of file scriptguiclient.cpp.

bool ScriptGUIClient::loadScriptConfigFile ( const QString &  scriptconfigfile  ) 

Load the scriptpackage's configurationfile scriptconfigfile and add the defined ScriptAction instances to the list of installed scripts.

Definition at line 198 of file scriptguiclient.cpp.

bool ScriptGUIClient::loadScriptConfigDocument ( const QString &  scriptconfigfile,
const QDomDocument &  document 
)

Load the document DOM-document from the scriptpackage's XML-configfile scriptconfigfile and add the defined ScriptAction instances to the list of installed scripts.

Definition at line 218 of file scriptguiclient.cpp.

void ScriptGUIClient::setXMLFile ( const QString &  file,
bool  merge = false,
bool  setXMLDoc = true 
) [virtual]

KXMLGUIClient overloaded method to set the XML file.

Reimplemented from KXMLGUIClient.

Definition at line 263 of file scriptguiclient.cpp.

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

KXMLGUIClient overloaded method to set the XML DOM-document.

Reimplemented from KXMLGUIClient.

Definition at line 268 of file scriptguiclient.cpp.

KURL ScriptGUIClient::openScriptFile ( const QString &  caption = QString::null  )  [slot]

A KFileDialog will be displayed to let the user choose a scriptfile.

The choosen file will be returned as KURL.

Definition at line 304 of file scriptguiclient.cpp.

bool ScriptGUIClient::loadScriptFile (  )  [slot]

A KFileDialog will be displayed to let the user choose a scriptfile that should be loaded.

Those loaded ScriptAction will be added to the ScriptActionCollection of loaded scripts.

Definition at line 325 of file scriptguiclient.cpp.

bool ScriptGUIClient::executeScriptFile (  )  [slot]

A KFileDialog will be displayed to let the user choose the scriptfile that should be executed.

The executed ScriptAction will be added to the ScriptActionCollection of executed scripts.

Definition at line 346 of file scriptguiclient.cpp.

bool ScriptGUIClient::executeScriptFile ( const QString &  file  )  [slot]

Execute the scriptfile file .

Internaly we try to use the defined filename to auto-detect the Interpreter which should be used for the execution.

Definition at line 354 of file scriptguiclient.cpp.

bool ScriptGUIClient::executeScriptAction ( ScriptAction::Ptr  action  )  [slot]

This method executes the ScriptAction action .

Internaly we just call ScriptAction::activate and redirect the success/failed signals to our internal slots.

Definition at line 362 of file scriptguiclient.cpp.

void ScriptGUIClient::showScriptManager (  )  [slot]

The ScriptManagerGUI dialog will be displayed to let the user manage the scriptfiles.

Definition at line 375 of file scriptguiclient.cpp.

void Kross::Api::ScriptGUIClient::collectionChanged ( ScriptActionCollection  )  [signal]

Emitted if a ScriptActionCollection instances changed.

void Kross::Api::ScriptGUIClient::executionStarted ( const Kross::Api::ScriptAction  )  [signal]

This signal is emited when the execution of a script is started.

void Kross::Api::ScriptGUIClient::executionFinished ( const Kross::Api::ScriptAction  )  [signal]

This signal is emited when the execution of a script is finished.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys