gui::TreeItemCStream Class Reference

Tree item containing CStream. More...

#include <treeitemcstream.h>

Inheritance diagram for gui::TreeItemCStream:
gui::TreeItem gui::TreeItemAbstract

List of all members.

Public Member Functions

void remove (const QString &name)
 TreeItemCStream (TreeData *_data, Q_ListView *parent, boost::shared_ptr< IProperty > pdfObj, const QString name=QString::null, Q_ListViewItem *after=NULL, const QString &nameId=NULL)
 TreeItemCStream (TreeData *_data, Q_ListViewItem *parent, boost::shared_ptr< IProperty > pdfObj, const QString name=QString::null, Q_ListViewItem *after=NULL, const QString &nameId=NULL)
virtual ~TreeItemCStream ()
virtual bool validChild (const QString &name, Q_ListViewItem *oldChild)
virtual QSCObjectgetQSObject (BaseCore *_base)
virtual ChildType getChildType (const QString &name)
virtual TreeItemAbstractcreateChild (const QString &name, ChildType typ, Q_ListViewItem *after=NULL)
virtual QStringList getChildNames ()
virtual bool haveChild ()
virtual QSCObjectgetQSObject ()

Detailed Description

Tree item containing CStream.

class holding one CStream object in tree


Constructor & Destructor Documentation

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

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 gui::TreeItemAbstract::data, gui::TreeItem::initObserver(), and gui::TreeItemAbstract::reload().

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

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 gui::TreeItemAbstract::data, gui::TreeItem::initObserver(), and gui::TreeItemAbstract::reload().

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

default destructor

References gui::TreeItem::uninitObserver().


Member Function Documentation

TreeItemAbstract * gui::TreeItemCStream::createChild ( const QString &  name,
ChildType  typ,
Q_ListViewItem *  after = NULL 
) [virtual]

Create one subchild

Parameters:
name Name of child (the same as in list returned from getChildNames)
typ Type of TreeItemAbstract's child. (see ChildType)
after Q_ListViewItem after which will be this item added. If unspecified (or NULL), it is added before any other items
Returns:
Pointer to subchild. If returned NULL, the subchild can not be created
See also:
getChildNames

Implements gui::TreeItemAbstract.

References util::convertFromUnicode(), gui::TreeItem::create(), gui::TreeItemAbstract::data, pdfobjects::CStream::getProperty(), gui::TreeItem::obj, and util::PDF.

QStringList gui::TreeItemCStream::getChildNames (  )  [virtual]

Get list of all item's childs names

Returns:
list of child names. Names in the list must be unique and the list may be empty.

Implements gui::TreeItemAbstract.

References util::convertToUnicode(), gui::TreeItemAbstract::data, pdfobjects::CStream::getAllPropertyNames(), pdfobjects::CStream::getProperty(), util::isSimple(), gui::TreeItem::obj, util::PDF, and gui::TreeData::showSimple().

ChildType gui::TreeItemCStream::getChildType ( const QString &  name  )  [virtual]

Get type of this items child, given its name.

Parameters:
name Name of child item
Returns:
type of specified child

Implements gui::TreeItemAbstract.

References util::convertFromUnicode(), pdfobjects::CStream::getProperty(), gui::TreeItem::obj, and util::PDF.

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

Create and return object for scripting representing this tree item

Returns:
object for scripting

Reimplemented from gui::TreeItem.

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

QSCObject * gui::TreeItemCStream::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::TreeItem.

References gui::TreeItem::obj.

bool gui::TreeItemCStream::haveChild (  )  [virtual]

Return true, if the item have at least one child

Returns:
Presence of at least one child

Implements gui::TreeItemAbstract.

References pdfobjects::CStream::getPropertyCount(), and gui::TreeItem::obj.

void gui::TreeItemCStream::remove ( const QString &  name  ) 
bool gui::TreeItemCStream::validChild ( const QString &  name,
Q_ListViewItem *  oldChild 
) [virtual]

Validate child, given its name and reference to old child Usually it is valid, since item with same name refer to same subitem (key-based items), but for value-based items (array) same keys can correspond to different values after reloading. In such cases, false should be returned. Also, similar problems can happen when switching revisions (with almost all types)

Note: false negative it not a problem (only unnecessary reloading), while false positive mean the tree is invalid/outdated

Parameters:
name name of (old and new) treeitem
oldChild reference to old child tree item
Returns:
True, if the old child is pointing to same item as item "name", false, if the child item "name" no longer point to same item as oldChild.

Implements gui::TreeItemAbstract.

References util::convertFromUnicode(), gui::TreeItem::getObject(), pdfobjects::CStream::getProperty(), gui::TreeItem::obj, and util::PDF.


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