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

Kross

Kross::Manager

Kross::Manager Class Reference

#include <manager.h>

Inheritance diagram for Kross::Manager:

Inheritance graph
[legend]

List of all members.


Detailed Description

The Manager class is a singleton that provides the main entry point to deal with the Kross Scripting Framework.

Use Interpreter to just work with some implementated interpreter like python or ruby. While Action implements a flexible abstract container to deal with single script files.

Definition at line 48 of file manager.h.


Public Slots

QObject * action (const QString &name)
void addQObject (QObject *obj, const QString &name=QString())
bool executeScriptFile (const QUrl &file=QUrl())
bool hasAction (const QString &name)
QStringList interpreters () const
QObject * module (const QString &modulename)
QObject * qobject (const QString &name) const
QStringList qobjectNames () const

Signals

void finished (Kross::Action *)
void started (Kross::Action *)

Public Member Functions

ActionCollection * actionCollection () const
bool hasInterpreterInfo (const QString &interpretername) const
Interpreter * interpreter (const QString &interpretername) const
InterpreterInfo * interpreterInfo (const QString &interpretername) const
QHash< QString, InterpreterInfo * > interpreterInfos () const
const QString interpreternameForFile (const QString &file)
 Manager ()
virtual ~Manager ()

Static Public Member Functions

static Manager & self ()

Constructor & Destructor Documentation

Manager::Manager (  )  [explicit]

The constructor.

Use self() to access the Manager singleton instance and don't call this direct.

Definition at line 115 of file manager.cpp.

Manager::~Manager (  )  [virtual]

Destructor.

Definition at line 212 of file manager.cpp.


Member Function Documentation

QObject * Manager::action ( const QString &  name  )  [slot]

Returns:
the Action QObject instance defined with name which is child of this Manager instance.

If there exists no such Action yet, create one.

Definition at line 275 of file manager.cpp.

ActionCollection * Manager::actionCollection (  )  const

Returns:
the root ActionCollection instance.

Each collection could have children of other collections and/or Action instances.

Definition at line 265 of file manager.cpp.

void Manager::addQObject ( QObject *  obj,
const QString &  name = QString() 
) [slot]

Definition at line 354 of file manager.cpp.

bool Manager::executeScriptFile ( const QUrl &  file = QUrl()  )  [slot]

Execute a script file.

Parameters:
file The script file that should be executed.

Definition at line 344 of file manager.cpp.

void Kross::Manager::finished ( Kross::Action *   )  [signal]

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

bool Manager::hasAction ( const QString &  name  )  [slot]

Returns:
true if there exists a Action QObject instance which is child of this Manager instance and is defined as name else false is returned.

Definition at line 270 of file manager.cpp.

bool Manager::hasInterpreterInfo ( const QString &  interpretername  )  const

Returns:
true if there exists an interpreter with the name interpretername else false.

Definition at line 225 of file manager.cpp.

Interpreter * Manager::interpreter ( const QString &  interpretername  )  const

Return the Interpreter instance defined by the interpretername.

Parameters:
interpretername The name of the interpreter. e.g. "python" or "kjs".
Returns:
The Interpreter instance or NULL if there does not exists an interpreter with such an interpretername.

Definition at line 251 of file manager.cpp.

InterpreterInfo * Manager::interpreterInfo ( const QString &  interpretername  )  const

Returns:
the InterpreterInfo* matching to the defined interpretername or NULL if there does not exists such a interpreter.

Definition at line 230 of file manager.cpp.

QHash< QString, InterpreterInfo * > Manager::interpreterInfos (  )  const

Returns:
a map with InterpreterInfo* instances used to describe interpreters.

Definition at line 220 of file manager.cpp.

const QString Manager::interpreternameForFile ( const QString &  file  ) 

Return the name of the Interpreter that feels responsible for the defined file .

Parameters:
file The filename we should try to determinate the interpretername for.
Returns:
The name of the Interpreter which will be used to execute the file or QString() if we failed to determinate a matching interpreter for the file.

Definition at line 235 of file manager.cpp.

QStringList Manager::interpreters (  )  const [slot]

Returns:
a list of names of all supported scripting interpreters.

The list may contain for example "python", "ruby" and "kjs" depending on what interpreter-plugins are installed.

Definition at line 260 of file manager.cpp.

QObject * Manager::module ( const QString &  modulename  )  [slot]

Load and return an external module.

Modules are dynamic loadable plugins which could be loaded on demand to provide additional functionality.

Parameters:
modulename The name of the module we should try to load.
Returns:
The QObject instance that repesents the module or NULL if loading failed.

Definition at line 287 of file manager.cpp.

QObject * Manager::qobject ( const QString &  name  )  const [slot]

Definition at line 359 of file manager.cpp.

QStringList Manager::qobjectNames (  )  const [slot]

Definition at line 364 of file manager.cpp.

Manager & Manager::self (  )  [static]

Return the Manager instance.

Always use this function to access the Manager singleton.

Definition at line 67 of file manager.cpp.

void Kross::Manager::started ( Kross::Action *   )  [signal]

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


The documentation for this class was generated from the following files:
  • manager.h
  • manager.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
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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