lib
Kross::Api::ScriptGUIClient Class Reference
#include <scriptguiclient.h>
Inheritance diagram for Kross::Api::ScriptGUIClient:

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< KAction > | List |
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) |
ScriptActionCollection * | getActionCollection (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
typedef QPtrList<KAction> Kross::Api::ScriptGUIClient::List |
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 67 of file scriptguiclient.cpp.
ScriptGUIClient::~ScriptGUIClient | ( | ) | [virtual] |
Member Function Documentation
void ScriptGUIClient::addActionCollection | ( | const QString & | name, | |
ScriptActionCollection * | collection | |||
) |
Add a new ScriptActionCollection with the name name
to our map of actioncollections.
Definition at line 119 of file scriptguiclient.cpp.
void Kross::Api::ScriptGUIClient::collectionChanged | ( | ScriptActionCollection * | ) | [signal] |
Emitted if a ScriptActionCollection instances changed.
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 363 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 355 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 347 of file scriptguiclient.cpp.
void Kross::Api::ScriptGUIClient::executionFinished | ( | const Kross::Api::ScriptAction * | ) | [signal] |
This signal is emited when the execution of a script is finished.
void Kross::Api::ScriptGUIClient::executionStarted | ( | const Kross::Api::ScriptAction * | ) | [signal] |
This signal is emited when the execution of a script is started.
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 109 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 114 of file scriptguiclient.cpp.
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 104 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 149 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 219 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 199 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 326 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 305 of file scriptguiclient.cpp.
void ScriptGUIClient::reloadInstalledScripts | ( | ) |
bool ScriptGUIClient::removeActionCollection | ( | const QString & | name | ) |
Remove the ScriptActionCollection defined with name name
.
Definition at line 125 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 269 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 264 of file scriptguiclient.cpp.
void ScriptGUIClient::showScriptManager | ( | ) | [slot] |
The ScriptManagerGUI dialog will be displayed to let the user manage the scriptfiles.
Definition at line 376 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 189 of file scriptguiclient.cpp.
The documentation for this class was generated from the following files: