gui::TreeItem Class Reference

Tree item containing IProperty. More...

#include <treeitem.h>

Inheritance diagram for gui::TreeItem:
gui::TreeItemAbstract gui::TreeItemArray gui::TreeItemCStream gui::TreeItemDict gui::TreeItemRef gui::TreeItemSimple gui::TreeItemOutline

List of all members.

Public Member Functions

TreeItemparent ()
virtual ~TreeItem ()
boost::shared_ptr< IPropertygetObject ()
void setParent (TreeItem *parent)
virtual bool setObject (boost::shared_ptr< IProperty > newItem)
virtual void insertItem (Q_ListViewItem *newChild)
void unSelect ()
virtual void reloadSelf ()
virtual QSCObjectgetQSObject ()
virtual QSCObjectgetQSObject (BaseCore *_base)
virtual void remove ()

Static Public Member Functions

static TreeItemcreate (TreeData *_data, Q_ListView *parent, boost::shared_ptr< IProperty > pdfObj, const QString &name=QString::null, Q_ListViewItem *after=NULL, const QString &nameId=QString::null)
static TreeItemcreate (TreeData *_data, Q_ListViewItem *parent, boost::shared_ptr< IProperty > pdfObj, const QString &name=QString::null, Q_ListViewItem *after=NULL, const QString &nameId=QString::null)

Protected Member Functions

 TreeItem (const QString &nameId, TreeData *_data, Q_ListView *parent, boost::shared_ptr< IProperty > pdfObj, const QString &name=QString::null, Q_ListViewItem *after=NULL)
 TreeItem (const QString &nameId, TreeData *_data, Q_ListViewItem *parent, boost::shared_ptr< IProperty > pdfObj, const QString &name=QString::null, Q_ListViewItem *after=NULL)
void initObserver ()
void uninitObserver ()
bool haveObserver ()
void init (boost::shared_ptr< IProperty > pdfObj, const QString &name)

Protected Attributes

boost::shared_ptr< IPropertyobj
PropertyType typ
TreeItem_parent
boost::shared_ptr
< TreeItemObserver
observer

Detailed Description

Tree item containing IProperty.

Class holding one PDF object (IProperty) in tree


Constructor & Destructor Documentation

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

default destructor

gui::TreeItem::TreeItem ( const QString &  nameId,
TreeData _data,
Q_ListView *  parent,
boost::shared_ptr< IProperty pdfObj,
const QString &  name = QString::null,
Q_ListViewItem *  after = NULL 
) [protected]

constructor of TreeItem - create root item from given object

Parameters:
parent Q_ListView in which to put item
pdfObj Object contained in this item
nameId Internal name of this item
name Caption of this item - will be shown in treeview
_data TreeData containing necessary information about tree in which this item will be inserted
after Item after which this one will be inserted
gui::TreeItem::TreeItem ( const QString &  nameId,
TreeData _data,
Q_ListViewItem *  parent,
boost::shared_ptr< IProperty pdfObj,
const QString &  name = QString::null,
Q_ListViewItem *  after = NULL 
) [protected]

constructor of TreeItem - create child item from given object

Parameters:
parent Q_ListViewItem which is parent of this object
pdfObj Object contained in this item
nameId Internal name of this item
name Caption of this item - will be shown in treeview
_data TreeData containing necessary information about tree in which this item will be inserted
after Item after which this one will be inserted

Member Function Documentation

TreeItem * gui::TreeItem::create ( TreeData _data,
Q_ListViewItem *  parent,
boost::shared_ptr< IProperty pdfObj,
const QString &  name = QString::null,
Q_ListViewItem *  after = NULL,
const QString &  nameId = QString::null 
) [static]

"Constructor" that will create object of proper class based on type of IProperty
constructor of TreeItem - create child item from given object

Parameters:
parent Q_ListViewItem which is parent of this object
pdfObj Object contained in this item
nameId Internal name of this item
name Caption of this item - will be shown in treeview
_data TreeData containing necessary information about tree in which this item will be inserted
after Item after which this one will be inserted

References debug::DBG_DBG, util::getTypeName(), guiPrintDbg, pdfobjects::pArray, pdfobjects::pDict, pdfobjects::pRef, pdfobjects::pStream, and Q_OUT.

TreeItem * gui::TreeItem::create ( TreeData _data,
Q_ListView *  parent,
boost::shared_ptr< IProperty pdfObj,
const QString &  name = QString::null,
Q_ListViewItem *  after = NULL,
const QString &  nameId = QString::null 
) [static]

"Constructor" that will create object of proper class based on type of IProperty
constructor of TreeItem - create root item from given object

Parameters:
parent Q_ListView in which to put item
pdfObj Object contained in this item
nameId Internal name of this item
name Caption of this item - will be shown in treeview
_data TreeData containing necessary information about tree in which this item will be inserted
after Item after which this one will be inserted

References debug::DBG_DBG, util::getTypeName(), guiPrintDbg, pdfobjects::pArray, pdfobjects::pDict, pdfobjects::pRef, pdfobjects::pStream, and Q_OUT.

Referenced by gui::TreeItemRef::createChild(), gui::TreeItemPdfOperator::createChild(), gui::TreeItemPage::createChild(), gui::TreeItemDict::createChild(), gui::TreeItemCStream::createChild(), gui::TreeItemArray::createChild(), and gui::TreeWindow::init().

boost::shared_ptr< IProperty > gui::TreeItem::getObject (  ) 
QSCObject * gui::TreeItem::getQSObject ( BaseCore _base  )  [virtual]

Create and return object for scripting representing this tree item, relocated in different base If the object cannot be copied into new base, return NULL

Parameters:
_base BaseCore for the new object.
Returns:
object for scripting

Reimplemented from gui::TreeItemAbstract.

Reimplemented in gui::TreeItemArray, gui::TreeItemCStream, and gui::TreeItemDict.

References gui::TreeData::base(), gui::TreeItemAbstract::data, and obj.

QSCObject * gui::TreeItem::getQSObject (  )  [virtual]

Create and return object for scripting representing this tree item

Returns:
object for scripting

Implements gui::TreeItemAbstract.

Reimplemented in gui::TreeItemArray, gui::TreeItemCStream, and gui::TreeItemDict.

bool gui::TreeItem::haveObserver (  )  [protected]

Return true, if observer is installed on this item

Returns:
Presence of observer

Referenced by gui::TreeItemSimple::setObject().

void gui::TreeItem::init ( boost::shared_ptr< IProperty pdfObj,
const QString &  name 
) [protected]

Initialize item from given PDF object

Parameters:
pdfObj Object used to initialize this item
name Name of this item - will be shown in treeview

References debug::DBG_DBG, util::getTypeName(), guiPrintDbg, obj, Q_OUT, and typ.

void gui::TreeItem::initObserver (  )  [protected]
void gui::TreeItem::insertItem ( Q_ListViewItem *  newChild  )  [virtual]

Insert existing item as child of this item

Parameters:
newChild child Q_ListViewItem to be inserted

References debug::DBG_DBG, guiPrintDbg, and setParent().

TreeItem * gui::TreeItem::parent (  ) 

Return parent of this Tree Item, if it is also TreeItem. If not, return NULL

Returns:
parent TreeItem

Referenced by gui::TreeItemRef::parentCheck().

void gui::TreeItem::reloadSelf (  )  [virtual]

Reload contents of itself and only itself (excluding any children)

Implements gui::TreeItemAbstract.

Reimplemented in gui::TreeItemOutline, and gui::TreeItemRef.

void gui::TreeItem::remove (  )  [virtual]

Remove itself from document (including any children) Do not remove the treeitem itself in this method -> this may lead to crash! If desired, you may call reload() on parent to get rid of the item correctly

Implements gui::TreeItemAbstract.

References gui::TreeItemAbstract::data, gui::TreeData::multi(), and gui::MultiTreeWindow::notifyDeleteItem().

bool gui::TreeItem::setObject ( boost::shared_ptr< IProperty newItem  )  [virtual]

This method is needed for "deep reload" to work Try to replace object inside this treeitem with a new one.

Parameters:
newItem new object to replace the old one
Returns:
true if item replaced, false on error.

Reimplemented in gui::TreeItemSimple.

Referenced by gui::TreeItemRef::deepReload(), gui::TreeItemPage::deepReload(), and gui::TreeItemDict::deepReload().

void gui::TreeItem::setParent ( TreeItem parent  ) 

Set new parent of this object

Parameters:
parent New parent of this object if it is TreeItem (or NULL otherwise)

Referenced by insertItem().

void gui::TreeItem::uninitObserver (  )  [protected]
void gui::TreeItem::unSelect (  ) 

Member Data Documentation

Parent of this window if it is TreeItem. NULL if no parent or parent is not a TreeItem

Referenced by gui::TreeItemRef::parentCheck().

boost::shared_ptr<IProperty> gui::TreeItem::obj [protected]
boost::shared_ptr<TreeItemObserver> gui::TreeItem::observer [protected]

Observer registered for this item

Type of stored object

Referenced by init(), gui::TreeItemRef::setOpen(), and gui::TreeItemRef::unOpen().


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