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

interfaces

KScriptManager Class Reference

This class is the base for all script engines. More...

#include <scriptmanager.h>

Inheritance diagram for KScriptManager:

Inheritance graph
[legend]

List of all members.


Public Slots

void runScript (const QString &scriptName, QObject *context=0, const QVariant &arg=0)

Signals

void scriptDone (KScriptClientInterface::Result result, const QVariant &returned)
void scriptError (const QString &msg)
void scriptOutput (const QString &msg)
void scriptProgress (int percent)
void scriptWarning (const QString &msg)

Public Member Functions

bool addScript (const QString &scriptDesktopFile)
void clear ()
void done (KScriptClientInterface::Result result, const QVariant &returned)
void error (const QString &msg)
 KScriptManager (QObject *parent, const char *name)
void output (const QString &msg)
void progress (int percent)
bool removeScript (const QString &scriptName)
QStringList scripts ()
void warning (const QString &msg)
virtual ~KScriptManager ()

Protected Attributes

QString m_currentScript
QDict< KScriptInterface > m_scriptCache
QDict< ScriptInfo > m_scripts

Detailed Description

This class is the base for all script engines.

Author:
Ian Reinhart Geiser <geiseri@kde.org>

Definition at line 39 of file scriptmanager.h.


Constructor & Destructor Documentation

KScriptManager::KScriptManager ( QObject *  parent,
const char *  name 
)

Create a new instance of the script engine.

Definition at line 28 of file scriptmanager.cpp.

KScriptManager::~KScriptManager (  )  [virtual]

Destroy the current script engine.

Definition at line 33 of file scriptmanager.cpp.


Member Function Documentation

bool KScriptManager::addScript ( const QString &  scriptDesktopFile  ) 

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.

void KScriptManager::clear (  ) 

Clear all script intstances in memory.

Definition at line 79 of file scriptmanager.cpp.

void KScriptManager::done ( KScriptClientInterface::Result  result,
const QVariant &  returned 
) [inline, virtual]

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 99 of file scriptmanager.h.

void KScriptManager::error ( const QString &  msg  )  [inline, virtual]

This function will allow the main application of any errors that have occurred during processing of the script.

Implements KScriptClientInterface.

Definition at line 76 of file scriptmanager.h.

void KScriptManager::output ( const QString &  msg  )  [inline, virtual]

This function will allow the main application of any normal output that has occurred during the processing of the script.

Implements KScriptClientInterface.

Definition at line 86 of file scriptmanager.h.

void KScriptManager::progress ( int  percent  )  [inline, virtual]

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 93 of file scriptmanager.h.

bool KScriptManager::removeScript ( const QString &  scriptName  ) 

Remove a script instance from the script engine.

Returns:
the success of the operation.

Definition at line 61 of file scriptmanager.cpp.

void KScriptManager::runScript ( const QString &  scriptName,
QObject *  context = 0,
const QVariant &  arg = 0 
) [slot]

Run the selected script.

Definition at line 84 of file scriptmanager.cpp.

void KScriptManager::scriptDone ( KScriptClientInterface::Result  result,
const QVariant &  returned 
) [signal]

Send out a signal of the exit status of the script.

void KScriptManager::scriptError ( const QString &  msg  )  [signal]

Send out a signal of the error message from the current running script.

void KScriptManager::scriptOutput ( const QString &  msg  )  [signal]

Send out a signal of the output message from the current running script.

void KScriptManager::scriptProgress ( int  percent  )  [signal]

Send out a signal of the progress of the current running script.

QStringList KScriptManager::scripts (  ) 

Access the names of script instances from the script engine.

Returns:
a QStringList of the current scripts.

Definition at line 67 of file scriptmanager.cpp.

void KScriptManager::scriptWarning ( const QString &  msg  )  [signal]

Send out a signal of the warning message from the current running script.

void KScriptManager::warning ( const QString &  msg  )  [inline, virtual]

This function will allow the main application of any warnings that have occurred during the processing of the script.

Implements KScriptClientInterface.

Definition at line 81 of file scriptmanager.h.


Member Data Documentation

QString KScriptManager::m_currentScript [protected]

Definition at line 136 of file scriptmanager.h.

QDict<KScriptInterface> KScriptManager::m_scriptCache [protected]

Definition at line 134 of file scriptmanager.h.

QDict<ScriptInfo> KScriptManager::m_scripts [protected]

Definition at line 133 of file scriptmanager.h.


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

interfaces

Skip menu "interfaces"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
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