KScriptManager Class Reference
This class is the base for all script engines. More...
#include <scriptmanager.h>
Inheritance diagram for KScriptManager:

Public Slots | |
void | runScript (const QString &scriptName, QObject *context=0, const QVariant &arg=0) |
Run the selected script. | |
Signals | |
void | scriptError (const QString &msg) |
Send out a signal of the error message from the current running script. | |
void | scriptWarning (const QString &msg) |
Send out a signal of the warning message from the current running script. | |
void | scriptOutput (const QString &msg) |
Send out a signal of the output message from the current running script. | |
void | scriptProgress (int percent) |
Send out a signal of the progress of the current running script. | |
void | scriptDone (KScriptClientInterface::Result result, const QVariant &returned) |
Send out a signal of the exit status of the script. | |
Public Methods | |
KScriptManager (QObject *parent, const char *name) | |
Create a new instance of the script engine. | |
virtual | ~KScriptManager () |
Destroy the current script engine. | |
bool | addScript (const QString &scriptDesktopFile) |
Add a new script instance to the script engine. | |
bool | removeScript (const QString &scriptName) |
Remove a script instance from the script engine. | |
QStringList | scripts () |
Access the names of script instances from the script engine. | |
void | clear () |
Clear all script intstances in memory. | |
void | error (const QString &msg) |
This function will allow the main application of any errors that have occured during processing of the script. | |
void | warning (const QString &msg) |
This function will allow the main application of any warnings that have occured during the processing of the script. | |
void | output (const QString &msg) |
This function will allow the main application of any normal output that has occured during the processing of the script. | |
void | progress (int percent) |
This function will allow feedback to any progress bars in the main application as to how far along the script is. | |
void | done (KScriptClientInterface::Result result, const QVariant &returned) |
This function will allow feedback on completion of the script. |
Detailed Description
This class is the base for all script engines.
- Author:
- Ian Reinhart Geiser <geiseri@kde.org>
Definition at line 37 of file scriptmanager.h.
Constructor & Destructor Documentation
|
Create a new instance of the script engine.
Definition at line 28 of file scriptmanager.cpp. |
|
Destroy the current script engine.
Definition at line 33 of file scriptmanager.cpp. References QDict< KScriptInterface >::setAutoDelete(), and QDict< ScriptInfo >::setAutoDelete(). |
Member Function Documentation
|
Add a new script instance to the script engine. This should be the full name and path to the desktop file. Definition at line 39 of file scriptmanager.cpp. References QDict< ScriptInfo >::insert(), KDesktopFile::isDesktopFile(), KDesktopFile::readName(), and KDesktopFile::readType(). |
|
Remove a script instance from the script engine.
Definition at line 61 of file scriptmanager.cpp. References QDict< ScriptInfo >::remove(), and QDict< KScriptInterface >::remove(). |
|
Access the names of script instances from the script engine.
Definition at line 67 of file scriptmanager.cpp. References QDictIterator::current(), and QDictIterator::currentKey(). |
|
Clear all script intstances in memory.
Definition at line 79 of file scriptmanager.cpp. References QDict< ScriptInfo >::clear(), and QDict< KScriptInterface >::clear(). |
|
This function will allow the main application of any errors that have occured during processing of the script.
Implements KScriptClientInterface. Definition at line 74 of file scriptmanager.h. References scriptError(). |
|
This function will allow the main application of any warnings that have occured during the processing of the script.
Implements KScriptClientInterface. Definition at line 79 of file scriptmanager.h. References scriptWarning(). |
|
This function will allow the main application of any normal output that has occured during the processing of the script.
Implements KScriptClientInterface. Definition at line 84 of file scriptmanager.h. References scriptOutput(). |
|
This function will allow feedback to any progress bars in the main application as to how far along the script is. This is very useful when a script is processing files or doing some long operation that is of a known duration. Implements KScriptClientInterface. Definition at line 91 of file scriptmanager.h. References scriptProgress(). |
|
This function will allow feedback on completion of the script. It turns the result as a KScriptInteface::Result, and a return value as a QVariant Implements KScriptClientInterface. Definition at line 97 of file scriptmanager.h. References scriptDone(). |
|
Run the selected script.
Definition at line 84 of file scriptmanager.cpp. References QDict< KScriptInterface >::insert(), QDict< KScriptInterface >::remove(), and KMessageBox::sorry(). |
|
Send out a signal of the error message from the current running script.
Referenced by error(). |
|
Send out a signal of the warning message from the current running script.
Referenced by warning(). |
|
Send out a signal of the output message from the current running script.
Referenced by output(). |
|
Send out a signal of the progress of the current running script.
Referenced by progress(). |
|
Send out a signal of the exit status of the script.
Referenced by done(). |
The documentation for this class was generated from the following files: