Tree item containing CContentStream. More...
#include <treeitemcontentstream.h>
Public Member Functions | |
| boost::shared_ptr< CContentStream > | getObject () |
| TreeItemContentStream (TreeData *_data, Q_ListView *parent, boost::shared_ptr< CContentStream > pdfObj, const QString name=QString::null, Q_ListViewItem *after=NULL, const QString &nameId=NULL) | |
| TreeItemContentStream (TreeData *_data, Q_ListViewItem *parent, boost::shared_ptr< CContentStream > pdfObj, const QString name=QString::null, Q_ListViewItem *after=NULL, const QString &nameId=NULL) | |
| virtual | ~TreeItemContentStream () |
| virtual void | setOpen (bool open) |
| 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 () |
| void | setMode (TreeItemContentStreamMode newMode) |
| void | setMode (const QString &newMode) |
| QString | getMode () |
Private Member Functions | |
| void | showMode () |
| void | initObserver () |
| void | uninitObserver () |
| void | init (const QString &name) |
Private Attributes | |
| boost::shared_ptr< CContentStream > | obj |
| std::vector< boost::shared_ptr < PdfOperator > > | op |
| boost::shared_ptr < TreeItemContentStreamObserver > | observer |
| TreeItemContentStreamMode | mode |
Tree item containing CContentStream.
Class holding one Content Stream object in tree
On attempting to open the item in main window, the item opens itself automatically in secondary tree window.
This is to avoid cluttering the main window with too many items, making navigation in main tree difficult for user.
| gui::TreeItemContentStream::TreeItemContentStream | ( | TreeData * | _data, | |
| Q_ListView * | parent, | |||
| boost::shared_ptr< CContentStream > | pdfObj, | |||
| const QString | name = QString::null, |
|||
| Q_ListViewItem * | after = NULL, |
|||
| const QString & | nameId = NULL | |||
| ) |
constructor of TreeItemContentStream - 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 | |
| pdfObj | ContentStream contained in this item | |
| 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::TreeItemContentStream::TreeItemContentStream | ( | TreeData * | _data, | |
| Q_ListViewItem * | parent, | |||
| boost::shared_ptr< CContentStream > | pdfObj, | |||
| const QString | name = QString::null, |
|||
| Q_ListViewItem * | after = NULL, |
|||
| const QString & | nameId = NULL | |||
| ) |
constructor of TreeItemContentStream - 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 | |
| pdfObj | ContentStream contained in this item | |
| 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::TreeItemContentStream::~TreeItemContentStream | ( | ) | [virtual] |
default destructor
| TreeItemAbstract * gui::TreeItemContentStream::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::TreeItemContentStream::getChildNames | ( | ) | [virtual] |
Get list of all item's childs names
Implements gui::TreeItemAbstract.
| ChildType gui::TreeItemContentStream::getChildType | ( | const QString & | name | ) | [virtual] |
Get type of this items child, given its name.
| name | Name of child item |
Implements gui::TreeItemAbstract.
| QString gui::TreeItemContentStream::getMode | ( | ) |
Get mode of this item as a string (that can be passed to setMode)
Referenced by gui::QSTreeItemContentStream::getMode().
| boost::shared_ptr< CContentStream > gui::TreeItemContentStream::getObject | ( | ) |
Return content stream inside this tree items
Referenced by gui::TreeItemPage::validChild().
| QSCObject * gui::TreeItemContentStream::getQSObject | ( | ) | [virtual] |
Create and return object for scripting representing this tree item
Implements gui::TreeItemAbstract.
| bool gui::TreeItemContentStream::haveChild | ( | ) | [virtual] |
Return true, if the item have at least one child
Implements gui::TreeItemAbstract.
| void gui::TreeItemContentStream::init | ( | const QString & | name | ) | [private] |
initialize captions of this item from name
| name | Caption of item |
| void gui::TreeItemContentStream::initObserver | ( | ) | [private] |
Sets observer for this item
| void gui::TreeItemContentStream::reloadSelf | ( | ) | [virtual] |
Reload contents of itself and only itself (excluding any children)
Implements gui::TreeItemAbstract.
| void gui::TreeItemContentStream::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.
| void gui::TreeItemContentStream::setMode | ( | const QString & | newMode | ) |
Set mode of this tree item, i.e. what to show as children
| newMode | new Mode |
| void gui::TreeItemContentStream::setMode | ( | TreeItemContentStreamMode | newMode | ) |
Set mode of this tree item, i.e. what to show as children
| newMode | new Mode |
Referenced by gui::QSTreeItemContentStream::setMode().
| void gui::TreeItemContentStream::setOpen | ( | bool | open | ) | [virtual] |
Slot that will be called when item is opened/closed
| open | True if item is being opened, false if closed |
Reimplemented from gui::TreeItemAbstract.
| void gui::TreeItemContentStream::showMode | ( | ) | [private] |
Update tree item accdording to what mode is selected
| void gui::TreeItemContentStream::uninitObserver | ( | ) | [private] |
Unsets observer for this item
| bool gui::TreeItemContentStream::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.
Mode - what should be shown?
boost::shared_ptr<CContentStream> gui::TreeItemContentStream::obj [private] |
ContentStream object held in this item
boost::shared_ptr<TreeItemContentStreamObserver> gui::TreeItemContentStream::observer [private] |
Observer registered for this item
std::vector<boost::shared_ptr<PdfOperator> > gui::TreeItemContentStream::op [private] |
Vector with pdf operators