NSScript::ScriptEnvironment Class Reference

The basic environment for scripting. More...

#include <scriptenvironment.h>

Inheritance diagram for NSScript::ScriptEnvironment:

QObject
Collaboration diagram for NSScript::ScriptEnvironment:

Collaboration graph
[legend]

List of all members.

Signals

void snippetsToRestoreAvailable ()
 There are snippets available to restore.

Public Member Functions

 ScriptEnvironment (QObject *)
 Construct a new ScriptEnvironment.
 ~ScriptEnvironment ()
 destructor
void addQObject (QObject *)
 Add a QObject to the script-environment.
bool hasUnrestoredSnippets () const
 Wether there are unrestored ScriptSnippets after startup.
ScriptSnippetrestoreFirstSnippet (QWidget *w)
 Restore the first unrestored ScriptSnippet.
ScriptSnippetnewSnippet (QWidget *w)
 Create a new empty snippet.
QString toXML () const
 Store the relevant snippets to xml.
void fromXML (QString)
 Restore snippets from xml.
void fromXML (QDomNode)
 Restore snippets from xml.

Private Slots

void execCode (QString)
 Execute the given code.
void snippetDestroyed (ScriptSnippet *)
 A snippet was destroyed.
void systemSave ()
 Save the snippets that are saved system-wide.

Private Attributes

QObjectList _objects
 Keep track of the elements in the scripting environment.
QScriptEngine * _engine
 The engine itself.
QList< ScriptSnippet * > _snippets
 Active script snippets.
QSettings * _settings
 Settings-pointer.
QList< _snippetsToRestore_t > _snippetsToRestore
 List/Map of the snippets to restore after startup.

Friends

class ScriptIntrospection

Classes

struct  _snippetsToRestore_t


Detailed Description

The basic environment for scripting.

This provides an environment for scripting supporting the special EPOS-features.


Constructor & Destructor Documentation

NSScript::ScriptEnvironment::ScriptEnvironment ( QObject  ) 

Construct a new ScriptEnvironment.

NSScript::ScriptEnvironment::~ScriptEnvironment (  ) 

destructor


Member Function Documentation

void NSScript::ScriptEnvironment::addQObject ( QObject  ) 

Add a QObject to the script-environment.

This adds a new QObject to the scripting environment and uses QObject::objectName() as the variable-name of the object. If no objectname is set, it will be named scriptobjectX where X is an increasing number.

bool NSScript::ScriptEnvironment::hasUnrestoredSnippets (  )  const

Wether there are unrestored ScriptSnippets after startup.

ScriptSnippet* NSScript::ScriptEnvironment::restoreFirstSnippet ( QWidget w  ) 

Restore the first unrestored ScriptSnippet.

Parameters:
w Parent widget of the new ScriptSnippet

ScriptSnippet* NSScript::ScriptEnvironment::newSnippet ( QWidget w  ) 

Create a new empty snippet.

Parameters:
w Parent widget of the new ScriptSnippet

QString NSScript::ScriptEnvironment::toXML (  )  const

Store the relevant snippets to xml.

void NSScript::ScriptEnvironment::fromXML ( QString   ) 

Restore snippets from xml.

void NSScript::ScriptEnvironment::fromXML ( QDomNode   ) 

Restore snippets from xml.

void NSScript::ScriptEnvironment::snippetsToRestoreAvailable (  )  [signal]

There are snippets available to restore.

void NSScript::ScriptEnvironment::execCode ( QString   )  [private, slot]

Execute the given code.

void NSScript::ScriptEnvironment::snippetDestroyed ( ScriptSnippet  )  [private, slot]

A snippet was destroyed.

void NSScript::ScriptEnvironment::systemSave (  )  [private, slot]

Save the snippets that are saved system-wide.


Friends And Related Function Documentation

friend class ScriptIntrospection [friend]


Member Data Documentation

Keep track of the elements in the scripting environment.

QScriptEngine* NSScript::ScriptEnvironment::_engine [private]

The engine itself.

Active script snippets.

Settings-pointer.

QList<_snippetsToRestore_t> NSScript::ScriptEnvironment::_snippetsToRestore [private]

List/Map of the snippets to restore after startup.


The documentation for this class was generated from the following file:

Generated on Tue Apr 12 02:10:37 2011 for epos by  doxygen 1.5.5