Object tree view widget. More...
#include <treewindow.h>
Public Slots | |
| void | settingUpdate (QString key) |
Signals | |
| void | itemSelected () |
| void | treeClicked (int, QListViewItem *) |
| void | itemInfo (const QString &info) |
Public Member Functions | |
| void | uninit () |
| void | init (const AnnotationVector &vec, boost::shared_ptr< pdfobjects::CPage > page, const QString &pName=QString::null) |
| void | init (boost::shared_ptr< pdfobjects::CPdf > pdfDoc, const QString &fileName) |
| void | init (const OperatorVector &vec, const QString &pName=QString::null) |
| void | init (boost::shared_ptr< pdfobjects::IProperty > doc, const QString &pName=QString::null) |
| void | init (boost::shared_ptr< pdfobjects::CContentStream > cs, const QString &pName=QString::null) |
| TreeWindow (MultiTreeWindow *multi, Base *base, QWidget *parent=0, const char *name=0) | |
| ~TreeWindow () | |
| void | reloadFrom (TreeItemAbstract *item) |
| TreeItemAbstract * | root () |
| void | reload () |
| QSCObject * | getSelected () |
| QSCObject * | nextSelected () |
| TreeItemAbstract * | getSelectedItem () |
| TreeItemAbstract * | nextSelectedItem () |
| void | deleteNotify (TreeItemAbstract *notifyItem) |
Protected Member Functions | |
| virtual void | paintEvent (QPaintEvent *e) |
Private Slots | |
| void | moveOnItem (QListViewItem *item) |
| void | moveOffItem () |
| void | treeSelectionChanged (QListViewItem *item) |
| void | treeSelectionChanged () |
| void | mouseClicked (int button, QListViewItem *item, const QPoint &coord, int column) |
| void | mouseDoubleClicked (QListViewItem *item, const QPoint &coord, int column) |
Private Member Functions | |
| void | clear () |
| void | updateTreeSettings () |
Private Attributes | |
| Q_ListView * | tree |
| TreeData * | data |
| QString | rootName |
| Q_ListViewItemIterator | selIter |
Object tree view widget.
Class providing treeview of PDF objects
It can contain items of TreeItemAbstract class, which represent objects in PDF file (actually its subclasses, as that class is abstract)
| gui::TreeWindow::TreeWindow | ( | MultiTreeWindow * | multi, | |
| Base * | base, | |||
| QWidget * | parent = 0, |
|||
| const char * | name = 0 | |||
| ) |
constructor of TreeWindow, creates window and fills it with elements, parameters are ignored
| base | Scripting base | |
| parent | Parent widget | |
| name | Name of this widget (not used, just passed to QWidget) | |
| multi | MultiTreeWindow holding this tree |
References data, mouseClicked(), mouseDoubleClicked(), moveOffItem(), moveOnItem(), Q_ListView, tree, and treeSelectionChanged().
| void gui::TreeWindow::clear | ( | ) | [private] |
Clears all items from TreeWindow
References gui::TreeData::clear(), data, Q_ListViewItem, and tree.
| void gui::TreeWindow::deleteNotify | ( | TreeItemAbstract * | notifyItem | ) |
Delete notification from tree items
| notifyItem | Item just being deleted |
References tree.
Referenced by gui::TreeItemAbstract::~TreeItemAbstract().
| QSCObject * gui::TreeWindow::getSelected | ( | ) |
Return QSCObject from currently selected item Caller is responsible for freeing object
References gui::TreeItemAbstract::getQSObject(), and getSelectedItem().
| TreeItemAbstract * gui::TreeWindow::getSelectedItem | ( | ) |
Return pointer to currently selected tree item (single select) or first selected tree item (multiselect)
References nextSelectedItem(), Q_ListViewItemIterator, selIter, and tree.
Referenced by getSelected().
| void gui::TreeWindow::init | ( | boost::shared_ptr< pdfobjects::CContentStream > | cs, | |
| const QString & | pName = QString::null | |||
| ) |
Init contents of treeview from given Content Stream
| cs | Content Stream used to initialize treeview | |
| pName | Name of the content stream passed |
References clear(), data, gui::TreeItemAbstract::setOpen(), and tree.
| void gui::TreeWindow::init | ( | boost::shared_ptr< pdfobjects::IProperty > | doc, | |
| const QString & | pName = QString::null | |||
| ) |
Init contents of treeview from given IProperty (dictionary, etc ...)
| doc | IProperty used to initialize treeview | |
| pName | Name of the property passed |
References clear(), gui::TreeItem::create(), data, gui::TreeItemAbstract::setOpen(), and tree.
| void gui::TreeWindow::init | ( | const OperatorVector & | vec, | |
| const QString & | pName = QString::null | |||
| ) |
Init contents of treeview from given vector with operators
| vec | Vector used to initialize treeview | |
| pName | Name of the root item |
References clear(), data, Q_ListViewItem, gui::TreeItemAbstract::setOpen(), and tree.
| void gui::TreeWindow::init | ( | boost::shared_ptr< pdfobjects::CPdf > | pdfDoc, | |
| const QString & | fileName | |||
| ) |
Init contents of treeview from given PDF document
| pdfDoc | Document used to initialize treeview | |
| fileName | Name of PDF document (will be shown in treeview as name of root element) |
References clear(), data, rootName, gui::TreeItemAbstract::setOpen(), and tree.
| void gui::TreeWindow::init | ( | const AnnotationVector & | vec, | |
| boost::shared_ptr< pdfobjects::CPage > | page, | |||
| const QString & | pName = QString::null | |||
| ) |
Init contents of treeview from given vector with annotations
| vec | Vector used to initialize treeview | |
| page | Page with annotations | |
| pName | Name of the root item |
References clear(), data, itemSelected(), Q_ListViewItem, gui::TreeItemAbstract::setOpen(), and tree.
Referenced by gui::MultiTreeWindow::activate().
| void gui::TreeWindow::itemInfo | ( | const QString & | info | ) | [signal] |
Signal emitted when mouse moves over items.
| info | Info sent to statusbar |
Referenced by moveOffItem(), and moveOnItem().
| void gui::TreeWindow::itemSelected | ( | ) | [signal] |
Signal emitted when selection in the tree window is changes (and another object(s) is now selected). You can call getSelected to obtain QSCObject from currently selected item
Referenced by init(), and treeSelectionChanged().
| void gui::TreeWindow::mouseClicked | ( | int | button, | |
| QListViewItem * | item, | |||
| const QPoint & | coord, | |||
| int | column | |||
| ) | [private, slot] |
Slot called when someone click with mouse button anywhere in the tree
| button | Which button(s) are clicked (1=left, 2=right, 4=middle) | |
| item | Which item is clicked upon (NULL if clicked outside item) | |
| coord | Coordinates of mouseclick | |
| column | Clicked in which item's column? (if clicked on item) |
References treeClicked().
Referenced by TreeWindow().
| void gui::TreeWindow::mouseDoubleClicked | ( | QListViewItem * | item, | |
| const QPoint & | coord, | |||
| int | column | |||
| ) | [private, slot] |
Slot called when someone doubleclick with left mouse button anywhere in the tree
| item | Which item is clicked upon (NULL if clicked outside item) | |
| coord | Coordinates of mouseclick | |
| column | Clicked in which item's column? (if clicked on item) |
References treeClicked().
Referenced by TreeWindow().
| void gui::TreeWindow::moveOffItem | ( | ) | [private, slot] |
Slot called when mouse moves off any items in tree
References itemInfo().
Referenced by TreeWindow().
| void gui::TreeWindow::moveOnItem | ( | QListViewItem * | item | ) | [private, slot] |
Slot called when mouse moves to some item in tree, OR when user navigates to new item via keyboard
| item | Item over which mouse moved |
References gui::TreeItemAbstract::itemHint(), and itemInfo().
Referenced by treeSelectionChanged(), and TreeWindow().
| QSCObject * gui::TreeWindow::nextSelected | ( | ) |
Return QSCObject from next selected item Caller is responsible for freeing object
References gui::TreeItemAbstract::getQSObject(), and nextSelectedItem().
| TreeItemAbstract * gui::TreeWindow::nextSelectedItem | ( | ) |
Return pointer to next selected tree item in multiselect mode (next mean next from the last item returned by getSelectedItem or nextSelectedItem) Returns NULL if nor more selected items can be found.
Referenced by getSelectedItem(), and nextSelected().
| void gui::TreeWindow::paintEvent | ( | QPaintEvent * | e | ) | [protected, virtual] |
Paint event handler -> if settings have been changed, reload tree
| e | Paint event data (passed to widget) |
References data, debug::DBG_DBG, guiPrintDbg, gui::TreeData::needReload(), reload(), and gui::TreeData::resetReload().
| void gui::TreeWindow::reload | ( | ) |
reinitialize/reload entire tree after some major change
References gui::TreeItemAbstract::reload(), and root().
Referenced by paintEvent().
| void gui::TreeWindow::reloadFrom | ( | TreeItemAbstract * | item | ) |
Reload part of tree that have given item as root (including that item) Reloading will stop at unopened reference targets
| item | root of subtree to reload Ow |
References gui::TreeItemAbstract::reload().
| TreeItemAbstract * gui::TreeWindow::root | ( | ) |
Return root item of the tree. (or NULL if tree is empty)
References tree.
Referenced by reload(), gui::MultiTreeWindow::rootMain(), and gui::MultiTreeWindow::settingUpdate().
| void gui::TreeWindow::settingUpdate | ( | QString | key | ) | [slot] |
Called when any settings are updated (in script, option editor, etc ...)
| key | Key of setting which have changed |
References debug::DBG_DBG, guiPrintDbg, Q_OUT, and updateTreeSettings().
| void gui::TreeWindow::treeClicked | ( | int | , | |
| QListViewItem * | ||||
| ) | [signal] |
Signal emitted when clicks anywhere in tree windows Button used to click is sent as first parameter (1=left, 2=right, 4=middle, 8=doubleclick with left) If clicked on tree item, it is sent in second parameter (otherwise NULL is sent)
Referenced by mouseClicked(), and mouseDoubleClicked().
| void gui::TreeWindow::treeSelectionChanged | ( | ) | [private, slot] |
Called upon changing selection in the tree window (multiselect)
References itemSelected(), moveOnItem(), Q_ListViewItem, and tree.
Referenced by TreeWindow().
| void gui::TreeWindow::treeSelectionChanged | ( | QListViewItem * | item | ) | [private, slot] |
Called upon changing selection in the tree window
| item | The item that was selected |
References itemSelected(), moveOnItem(), and tree.
| void gui::TreeWindow::uninit | ( | ) |
Resets the tree to be empty and show nothing
References clear().
| void gui::TreeWindow::updateTreeSettings | ( | ) | [private] |
Re-read tree settings from global settings
References data, gui::TreeData::isDirty(), gui::TreeData::resetDirty(), and gui::TreeData::update().
Referenced by settingUpdate().
TreeData* gui::TreeWindow::data [private] |
Tree data shared with tree items
Referenced by clear(), init(), paintEvent(), TreeWindow(), updateTreeSettings(), and ~TreeWindow().
QString gui::TreeWindow::rootName [private] |
Name of root object - if applicable
Referenced by init().
Q_ListViewItemIterator gui::TreeWindow::selIter [private] |
Iterator for selected item
Referenced by getSelectedItem(), and nextSelectedItem().
Q_ListView* gui::TreeWindow::tree [private] |
Treeview
Referenced by clear(), deleteNotify(), getSelectedItem(), init(), nextSelectedItem(), root(), treeSelectionChanged(), TreeWindow(), and ~TreeWindow().