Tree item containing vector of Annotations. More...
#include <treeitemannotationcontainer.h>
Public Member Functions | |
| TreeItemAnnotationContainer (TreeData *_data, Q_ListView *parent, const AnnotationVector &_op, boost::shared_ptr< CPage > _page, const QString name=QString::null, Q_ListViewItem *after=NULL, const QString &nameId=NULL) | |
| TreeItemAnnotationContainer (TreeData *_data, Q_ListViewItem *parent, const AnnotationVector &_op, boost::shared_ptr< CPage > _page, const QString name=QString::null, Q_ListViewItem *after=NULL, const QString &nameId=NULL) | |
| virtual | ~TreeItemAnnotationContainer () |
| virtual bool | validChild (const QString &name, Q_ListViewItem *oldChild) |
| virtual ChildType | getChildType (const QString &name) |
| virtual TreeItemAbstract * | createChild (const QString &name, ChildType typ, Q_ListViewItem *after=NULL) |
| virtual QStringList | getChildNames () |
| virtual bool | haveChild () |
| virtual QSCObject * | getQSObject () |
| virtual void | remove () |
| virtual void | reloadSelf () |
Private Member Functions | |
| void | init (const QString &name) |
Private Attributes | |
| AnnotationVector | op |
| boost::shared_ptr< CPage > | page |
Tree item containing vector of Annotations.
Tree item holding vector with Annotations The vector is specified in constructor and comes from arbitrary source (usually selected objects from page)
| gui::TreeItemAnnotationContainer::TreeItemAnnotationContainer | ( | TreeData * | _data, | |
| Q_ListView * | parent, | |||
| const AnnotationVector & | _op, | |||
| boost::shared_ptr< CPage > | _page, | |||
| const QString | name = QString::null, |
|||
| Q_ListViewItem * | after = NULL, |
|||
| const QString & | nameId = NULL | |||
| ) |
constructor of TreeItemAnnotationContainer - create root item from given object
| _data | TreeData containing necessary information about tree in which this item will be inserted | |
| parent | Q_ListView in which to put this item | |
| _op | Vector with annotations | |
| _page | Page with annotations | |
| nameId | Internal name of this item | |
| name | Caption of this item - will be shown in treeview | |
| after | Item after which this one will be inserted |
| gui::TreeItemAnnotationContainer::TreeItemAnnotationContainer | ( | TreeData * | _data, | |
| Q_ListViewItem * | parent, | |||
| const AnnotationVector & | _op, | |||
| boost::shared_ptr< CPage > | _page, | |||
| const QString | name = QString::null, |
|||
| Q_ListViewItem * | after = NULL, |
|||
| const QString & | nameId = NULL | |||
| ) |
constructor of TreeItemAnnotationContainer - create child item from given object
| _data | TreeData containing necessary information about tree in which this item will be inserted | |
| parent | Q_ListViewItem under which to put this item | |
| _op | Vector with annotations | |
| _page | Page with annotations | |
| nameId | Internal name of this item | |
| name | Caption of this item - will be shown in treeview | |
| after | Item after which this one will be inserted |
| gui::TreeItemAnnotationContainer::~TreeItemAnnotationContainer | ( | ) | [virtual] |
default destructor
| TreeItemAbstract * gui::TreeItemAnnotationContainer::createChild | ( | const QString & | name, | |
| ChildType | typ, | |||
| Q_ListViewItem * | after = NULL | |||
| ) | [virtual] |
Create one subchild
| 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 |
Implements gui::TreeItemAbstract.
| QStringList gui::TreeItemAnnotationContainer::getChildNames | ( | ) | [virtual] |
Get list of all item's childs names
Implements gui::TreeItemAbstract.
| ChildType gui::TreeItemAnnotationContainer::getChildType | ( | const QString & | name | ) | [virtual] |
Get type of this items child, given its name.
| name | Name of child item |
Implements gui::TreeItemAbstract.
| QSCObject * gui::TreeItemAnnotationContainer::getQSObject | ( | ) | [virtual] |
Create and return object for scripting representing this tree item
Implements gui::TreeItemAbstract.
References util::countList(), and op.
| bool gui::TreeItemAnnotationContainer::haveChild | ( | ) | [virtual] |
Return true, if the item have at least one child
Implements gui::TreeItemAbstract.
| void gui::TreeItemAnnotationContainer::init | ( | const QString & | name | ) | [private] |
initialize captions of this item from name
| name | Caption of item |
| void gui::TreeItemAnnotationContainer::reloadSelf | ( | ) | [virtual] |
Reload contents of itself and only itself (excluding any children)
Implements gui::TreeItemAbstract.
| void gui::TreeItemAnnotationContainer::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.
| bool gui::TreeItemAnnotationContainer::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
| name | name of (old and new) treeitem | |
| oldChild | reference to old child tree item |
Implements gui::TreeItemAbstract.
Vector with annotations
Referenced by getQSObject().
boost::shared_ptr<CPage> gui::TreeItemAnnotationContainer::page [private] |
CPage containing these annotation