gui::QSImporter Class Reference

QObject importer into scripting. More...

#include <qsimporter.h>

List of all members.

Public Slots

QObject * getQSObj ()

Public Member Functions

virtual ~QSImporter ()
void addQSObj (QObject *obj, const QString &name)
QSCObjectcreateQSObject (boost::shared_ptr< PdfOperator > op)
QSCObjectcreateQSObject (boost::shared_ptr< IProperty > ip)
QSCObjectcreateQSObject (boost::shared_ptr< CDict > dict)
QSCObjectcreateQSObject (boost::shared_ptr< CPage > page)
QSCObjectcreateQSObject (TreeItemAbstract *item)
QSPdfcreateQSObject (boost::shared_ptr< CPdf > pdf)
 QSImporter (QSProject *_qp, QObject *_context, BaseCore *_base)

Static Public Member Functions

static QSCObjectcreateQSObject (boost::shared_ptr< IProperty > ip, BaseCore *_base)
static QSCObjectcreateQSObject (TreeItemAbstract *item, BaseCore *_base)

Private Attributes

QObject * qobj
QObject * context
QSInterpreter * qs
QSProject * qp
BaseCorebase

Detailed Description

QObject importer into scripting.

QSImporter -> import QObjects from application without re-evaluating project
Adding objects via addObject have disadvantage of clearing interpreter state (thus removing all functions loaded from initscript) Adding via addTransientObject disallow removing the object later. Can import any QObject into scripting layer under specified name and also can create QSCObjects from some common types (dict, page ..)


Constructor & Destructor Documentation

gui::QSImporter::~QSImporter (  )  [virtual]

destructor

gui::QSImporter::QSImporter ( QSProject *  _qp,
QObject *  _context,
BaseCore _base 
)

Construct importer object for current QSProject to given context. Must be contructed before any scripts are evaluated

Parameters:
_qp QSProject in which this importer is installed
_context Context in which all objects will be imported
_base scripting base under which all objects will be created

Member Function Documentation

void gui::QSImporter::addQSObj ( QObject *  obj,
const QString &  name 
)

Import object into interpreter under specified name

Parameters:
obj Object to import
name Name of object in scripting
QSPdf * gui::QSImporter::createQSObject ( boost::shared_ptr< CPdf pdf  ) 

Overloaded factory function to create QSCObjects from various C... classes Returns QSCObject that can be added directly with addQSObj()

Parameters:
pdf CPdf to wrap into to QSPdf
Returns:
QSPdf(pdf)
QSCObject * gui::QSImporter::createQSObject ( TreeItemAbstract item  ) 

Overloaded factory function to create QSCObjects from various C... classes Returns QSCObject that can be added directly with addQSObj()

Parameters:
item TreeItemAbstract to wrap into to QSTreeItem
Returns:
QSTreeItem(item)
QSCObject * gui::QSImporter::createQSObject ( boost::shared_ptr< CPage page  ) 

Overloaded factory function to create QSCObjects from various C... classes Returns QSCObject that can be added directly with addQSObj()

Parameters:
page CPage (shared_ptr) to wrap into to QSPage
Returns:
QSPage(page)

References base.

QSCObject * gui::QSImporter::createQSObject ( boost::shared_ptr< CDict dict  ) 

Overloaded factory function to create QSCObjects from various C... classes Returns QSCObject that can be added directly with addQSObj()

Parameters:
dict CDict to wrap into to QSDict
Returns:
QSDict(dict)

References base.

QSCObject * gui::QSImporter::createQSObject ( boost::shared_ptr< IProperty ip  ) 

Overloaded factory function to create QSCObjects from various C... classes Returns QSCObject that can be added directly with addQSObj()

Parameters:
ip IProperty to wrap into to QSIProperty
Returns:
QSIProperty(ip)

References base, and createQSObject().

QSCObject * gui::QSImporter::createQSObject ( boost::shared_ptr< PdfOperator op  ) 

Overloaded factory function to create QSCObjects from various classes Returns QSCObject that can be added directly with addQSObj()

Parameters:
op PdfOperator to wrap into to QSPdfOperator
Returns:
QSPdfOperator(op)

References base.

QSCObject * gui::QSImporter::createQSObject ( TreeItemAbstract item,
BaseCore _base 
) [static]

Static version of factory function to create QSCObjects from various C... classes Returns QSCObject that can be added directly with addQSObj()

Parameters:
item TreeItemAbstract to wrap into to QSTreeItem
_base Scripting base
Returns:
QSTreeItem(item)
QSCObject * gui::QSImporter::createQSObject ( boost::shared_ptr< IProperty ip,
BaseCore _base 
) [static]

Static version of factory function to create QSCObjects from various C... classes Returns QSCObject that can be added directly with addQSObj()

Parameters:
ip IProperty to wrap into to QSIProperty
_base Scripting base
Returns:
QSIProperty(ip)

Referenced by gui::QSTreeItem::child(), gui::QSDict::child(), gui::QSArray::child(), createQSObject(), gui::QSTreeItem::parent(), gui::QSStream::property(), gui::QSIPropertyArray::property(), gui::QSDict::property(), gui::QSArray::property(), and gui::QSIProperty::ref().

QObject * gui::QSImporter::getQSObj (  )  [slot]

Internal importing function. Do not use outside this class.

Returns:
Imported object

Member Data Documentation

Scripting base for created objects

Referenced by createQSObject().

QObject* gui::QSImporter::context [private]

context in which objects will be imported

QObject* gui::QSImporter::qobj [private]

Current QObject to import

QSProject* gui::QSImporter::qp [private]

QSProject in which this importer is installed.

QSInterpreter* gui::QSImporter::qs [private]

Interpreter from QProject qp. All objects will be imported in it.


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