gui::TreeItemPdfOperator Class Reference

Tree item containing PdfOperator. More...

#include <treeitempdfoperator.h>

Inheritance diagram for gui::TreeItemPdfOperator:
gui::TreeItemAbstract

List of all members.

Public Member Functions

 TreeItemPdfOperator (TreeData *_data, Q_ListView *parent, boost::shared_ptr< PdfOperator > pdfObj, boost::shared_ptr< CContentStream > cs, const QString name=QString::null, Q_ListViewItem *after=NULL)
 TreeItemPdfOperator (TreeData *_data, Q_ListViewItem *parent, boost::shared_ptr< PdfOperator > pdfObj, boost::shared_ptr< CContentStream > cs, const QString name=QString::null, Q_ListViewItem *after=NULL)
 TreeItemPdfOperator (TreeData *_data, Q_ListViewItem *parent, boost::shared_ptr< PdfOperator > pdfObj, const QString name=QString::null, Q_ListViewItem *after=NULL)
virtual ~TreeItemPdfOperator ()
boost::shared_ptr< PdfOperatorgetObject ()
virtual void remove ()
virtual void reloadSelf ()
virtual bool validChild (const QString &name, Q_ListViewItem *oldChild)
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 ()
virtual QString itemHint ()

Private Attributes

boost::shared_ptr< PdfOperatorobj
std::vector< boost::shared_ptr
< PdfOperator > > 
op
std::vector< boost::shared_ptr
< IProperty > > 
params
boost::shared_ptr< CContentStreamcsRef

Detailed Description

Tree item containing PdfOperator.

class holding one PDF Operator in tree


Constructor & Destructor Documentation

gui::TreeItemPdfOperator::TreeItemPdfOperator ( TreeData _data,
Q_ListView *  parent,
boost::shared_ptr< PdfOperator pdfObj,
boost::shared_ptr< CContentStream cs,
const QString  name = QString::null,
Q_ListViewItem *  after = NULL 
)

constructor of TreeItemPdfOperator - create root item from given object

Parameters:
_data TreeData containing necessary information about tree in which this item will be inserted
parent Q_ListView in which to put this item
pdfObj Operator contained in this item
cs Content stream in which this pdf operator is contained
name Internal name of this item (order of operator)
after Item after which this one will be inserted

References csRef, gui::TreeItemAbstract::data, obj, and gui::TreeItemAbstract::reload().

Referenced by createChild().

gui::TreeItemPdfOperator::TreeItemPdfOperator ( TreeData _data,
Q_ListViewItem *  parent,
boost::shared_ptr< PdfOperator pdfObj,
boost::shared_ptr< CContentStream cs,
const QString  name = QString::null,
Q_ListViewItem *  after = NULL 
)

constructor of TreeItemPdfOperator - create child item from given object

Parameters:
_data TreeData containing necessary information about tree in which this item will be inserted
parent Q_ListViewItem under which to put this item
pdfObj Operator contained in this item
cs Content stream in which this pdf operator is contained
name Internal name of this item (order of operator)
after Item after which this one will be inserted

References csRef, gui::TreeItemAbstract::data, obj, and gui::TreeItemAbstract::reload().

gui::TreeItemPdfOperator::TreeItemPdfOperator ( TreeData _data,
Q_ListViewItem *  parent,
boost::shared_ptr< PdfOperator pdfObj,
const QString  name = QString::null,
Q_ListViewItem *  after = NULL 
)

constructor of TreeItemPdfOperator - create child item from given object (without any content stream information)

Parameters:
_data TreeData containing necessary information about tree in which this item will be inserted
parent Q_ListViewItem under which to put this item
pdfObj Operator contained in this item
name Internal name of this item (order of operator)
after Item after which this one will be inserted

References gui::TreeItemAbstract::data, obj, and gui::TreeItemAbstract::reload().

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

default destructor


Member Function Documentation

TreeItemAbstract * gui::TreeItemPdfOperator::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 gui::TreeItem::create(), csRef, gui::TreeItemAbstract::data, debug::DBG_DBG, guiPrintDbg, op, params, and TreeItemPdfOperator().

QStringList gui::TreeItemPdfOperator::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 gui::TreeItemAbstract::data, obj, op, and params.

ChildType gui::TreeItemPdfOperator::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.

boost::shared_ptr< PdfOperator > gui::TreeItemPdfOperator::getObject (  ) 

Return PDF operator inside this tree items

Returns:
PDF operator inside this tree items

References obj.

Referenced by validChild().

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

Create and return object for scripting representing this tree item

Returns:
object for scripting

Implements gui::TreeItemAbstract.

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

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

Return true, if the item have at least one child

Returns:
Presence of at least one child

Implements gui::TreeItemAbstract.

References obj.

QString gui::TreeItemPdfOperator::itemHint (  )  [virtual]

Return hint (description) of this item. Hint is taken from OperatorHint class

Returns:
hint for given item

Reimplemented from gui::TreeItemAbstract.

References util::convertToUnicode(), gui::OperatorHint::getInstance(), gui::OperatorHint::hint(), obj, gui::TreeItemAbstract::path(), and util::PDF.

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

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

Implements gui::TreeItemAbstract.

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

void gui::TreeItemPdfOperator::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

This will delete the operator treeitem and also the operator itself

Implements gui::TreeItemAbstract.

References obj, and gui::TreeItemAbstract::reload().

bool gui::TreeItemPdfOperator::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 gui::TreeItem::getObject(), getObject(), op, and params.


Member Data Documentation

boost::shared_ptr<CContentStream> gui::TreeItemPdfOperator::csRef [private]

Reference to content stream that is holding this operator.

Referenced by createChild(), getQSObject(), and TreeItemPdfOperator().

boost::shared_ptr<PdfOperator> gui::TreeItemPdfOperator::obj [private]
std::vector<boost::shared_ptr<PdfOperator> > gui::TreeItemPdfOperator::op [private]

Vector with pdf operators (children)

Referenced by createChild(), getChildNames(), and validChild().

std::vector<boost::shared_ptr<IProperty> > gui::TreeItemPdfOperator::params [private]

Vector with pdf operands (parameters)

Referenced by createChild(), getChildNames(), reloadSelf(), and validChild().


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