gui::QSIProperty Class Reference

QObject wrapper around IProperty. More...

#include <qsiproperty.h>

Inheritance diagram for gui::QSIProperty:
gui::QSCObject gui::QSArray gui::QSDict gui::QSStream

List of all members.

Public Slots

bool equals (QObject *otherObject)
QVariant value ()
QString getText ()
QSCObjectref ()
int getInt ()
QString getType ()
QString getTypeName ()
void set (const QString &value)
void set (int value)
void set (double value)
void set (bool value)

Public Member Functions

 QSIProperty (boost::shared_ptr< IProperty > _ip, BaseCore *_base)
 QSIProperty (QSIProperty &source)
virtual ~QSIProperty ()
boost::shared_ptr< IPropertyget () const

Protected Member Functions

 QSIProperty (boost::shared_ptr< IProperty > _ip, QString _className, BaseCore *_base)

Protected Attributes

boost::shared_ptr< IPropertyobj

Detailed Description

QObject wrapper around IProperty.


Constructor & Destructor Documentation

gui::QSIProperty::QSIProperty ( boost::shared_ptr< IProperty _ip,
BaseCore _base 
)

Construct wrapper with given IProperty

Parameters:
_ip IProperty wrapped in this object
_base Scripting base

References obj.

gui::QSIProperty::QSIProperty ( QSIProperty source  ) 

Copy constructor

Parameters:
source Source object to copy from

References obj.

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

destructor

gui::QSIProperty::QSIProperty ( boost::shared_ptr< IProperty _ip,
QString  _className,
BaseCore _base 
) [protected]

Construct wrapper with given IProperty and given type name
This constructor is available only to subclasses - they can set their own class name here

Parameters:
_ip IProperty wrapped in this object
_className type name of this object
_base Scripting base

References obj.


Member Function Documentation

bool gui::QSIProperty::equals ( QObject *  otherObject  )  [slot]

Return true, if this property is equal to given object (i.e. if objects inside the wrapper are the same)

Parameters:
otherObject object to compare with this one
Returns:
True if the both objects hold the same item, false otherwise

References get(), and obj.

boost::shared_ptr< IProperty > gui::QSIProperty::get (  )  const

get IProperty held inside this class. Not exposed to scripting

References obj.

Referenced by gui::QSStream::add(), gui::QSDict::add(), gui::QSArray::add(), gui::QSIPropertyArray::append(), and equals().

int gui::QSIProperty::getInt (  )  [slot]

Try to convert value to a number. Return 0 if it cannot be represented as number

Returns:
Integer representation of this property

References value().

QString gui::QSIProperty::getText (  )  [slot]

Return text representation of property

See also:
IProperty::getStringRepresentation
Returns:
string representation

Reimplemented in gui::QSArray, and gui::QSDict.

References util::convertToUnicode(), obj, and util::PDF.

QString gui::QSIProperty::getType (  )  [slot]

Get type identifier of this Property Can be one of: Null, Bool, Int, Real, String, Name, Ref, Array, Dict, Stream

References util::getTypeId(), and obj.

QString gui::QSIProperty::getTypeName (  )  [slot]

Get human readable and localized name of type of this Property

References obj.

QSCObject * gui::QSIProperty::ref (  )  [slot]

Return reference to this property, but if the property is a reference, create and return the reference target. This way you will always get dereferenced property for correct manipulation. If new item was created this way, caller is responsible for freeing the item.

Returns:
Dereferenced property

References gui::QSCObject::base, gui::QSImporter::createQSObject(), util::dereference(), obj, and pdfobjects::pRef.

Referenced by gui::QSTreeItem::itemref(), and value().

void gui::QSIProperty::set ( bool  value  )  [slot]

Set value of this property to specified string. Work only on Bool, Int, Real, String or Name types, tries to "inteligently" convert value if type of property is different than type of parameter Will do nothing if called on different types

Parameters:
value new value for the property

References gui::QSCObject::base, gui::BaseCore::errorException(), obj, pdfobjects::pBool, pdfobjects::pInt, pdfobjects::pName, pdfobjects::pReal, pdfobjects::pString, and pdfobjects::CObjectSimple< Tp >::setValue().

void gui::QSIProperty::set ( double  value  )  [slot]

Set value of this property to specified string. Work only on Bool, Int, Real, String or Name types, tries to "inteligently" convert value if type of property is different than type of parameter Will do nothing if called on different types

Parameters:
value new value for the property

References gui::QSCObject::base, gui::BaseCore::errorException(), obj, pdfobjects::pBool, pdfobjects::pInt, pdfobjects::pName, pdfobjects::pReal, pdfobjects::pString, and pdfobjects::CObjectSimple< Tp >::setValue().

void gui::QSIProperty::set ( int  value  )  [slot]

Set value of this property to specified string. Work only on Bool, Int, Real, String or Name types, tries to "inteligently" convert value if type of property is different than type of parameter Will do nothing if called on different types

Parameters:
value new value for the property

References gui::QSCObject::base, gui::BaseCore::errorException(), obj, pdfobjects::pBool, pdfobjects::pInt, pdfobjects::pName, pdfobjects::pReal, pdfobjects::pString, and pdfobjects::CObjectSimple< Tp >::setValue().

void gui::QSIProperty::set ( const QString &  value  )  [slot]

Set value of this property to specified string. Work only on Bool, Int, Real, String or Name types, tries to "inteligently" convert value if type of property is different than type of parameter Will do nothing if called on different types

Parameters:
value new value for the property

References gui::QSCObject::base, util::convertFromUnicode(), gui::BaseCore::errorException(), obj, pdfobjects::pBool, util::PDF, pdfobjects::pInt, pdfobjects::pName, pdfobjects::pReal, pdfobjects::pString, and pdfobjects::CObjectSimple< Tp >::setValue().

QVariant gui::QSIProperty::value (  )  [slot]

Return Value of property

Returns:
property value

References util::convertToUnicode(), pdfobjects::IndiRef::gen, pdfobjects::CObjectSimple< Tp >::getValue(), pdfobjects::IndiRef::num, obj, util::PDF, and ref().

Referenced by getInt().


Member Data Documentation

boost::shared_ptr<IProperty> gui::QSIProperty::obj [protected]

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