gui::MultiTreeWindow Class Reference

Treeview with tab support. More...

#include <multitreewindow.h>

List of all members.

Public Slots

void deleteCurrent ()
void settingUpdate (QString key)

Signals

void itemSelected ()
void treeClicked (int, QListViewItem *)
void itemDeleted (TreeItemAbstract *dest)
void itemDeleted (TreeItem *dest)
void itemInfo (const QString &info)

Public Member Functions

void uninit ()
void init (boost::shared_ptr< CPdf > pdfDoc, const QString &fileName)
void init (boost::shared_ptr< IProperty > doc, const QString &pName, const QString &pToolTip)
void activateMain ()
void activate (const OperatorVector &vec, const QString &pName, const QString &pToolTip)
void activate (const AnnotationVector &vec, boost::shared_ptr< CPage > page, const QString &pName, const QString &pToolTip)
void activate (boost::shared_ptr< CContentStream > cs, const QString &pName, const QString &pToolTip)
void activate (boost::shared_ptr< IProperty > doc, const QString &pName, const QString &pToolTip)
void deactivate (const OperatorVector &vec)
void deactivate (boost::shared_ptr< IProperty > doc)
void deactivate (boost::shared_ptr< CContentStream > cs)
void deactivate (const AnnotationVector &vec)
 MultiTreeWindow (Base *_base, QWidget *parent=0, const char *name=0)
 ~MultiTreeWindow ()
TreeItemAbstractroot ()
TreeItemAbstractrootMain ()
void reload ()
void reloadFrom (TreeItemAbstract *item)
TreeWindowgetTree (const QString &name)
QSCObjectgetSelected (const QString &name)
QSCObjectnextSelected ()
TreeItemAbstractgetSelectedItem (const QString &name)
TreeItemAbstractnextSelectedItem ()
void clear ()
void clearSecondary ()
void notifyDelete (TreeItemAbstract *dest)
void notifyDeleteItem (TreeItem *dest)

Protected Slots

void treeItemInfo (const QString &info)
void tabSwitchPopup ()
void treeItemSelected ()
void treeMouseClicked (int button, QListViewItem *item)
void pageChange (QWidget *newPage)

Private Member Functions

void connectSig (TreeWindow *tr)
TreeWindowcreatePage (const QString &caption, const QString &toolTip)
bool activate (TreeKey ptr)
void deactivate (TreeKey ptr)
void deleteWindow (TreeWindow *tr)
void updateCorner ()

Private Attributes

TreeWindowtree
TreeWindowtreeSelection
TreeWindowmainTree
TreeWindowList trees
TreeWindowListReverse treesReverse
QTabWidget * tab
QAbstractButton * cornerRight
QAbstractButton * cornerLeft
Basebase

Detailed Description

Treeview with tab support.

Class providing multiple treeviews, switchable by tabs It always have at least one (main) tree tabs, and 0 or more "secondary" tree tabs, that can be opened/closed as necessary. Main tree cannot be closed
The multi tree view contain widgets of TreeWindow class inside the tabs

See also:
TreeWindow

Constructor & Destructor Documentation

gui::MultiTreeWindow::MultiTreeWindow ( Base _base,
QWidget *  parent = 0,
const char *  name = 0 
)

constructor of MultiTreeWindow, creates window and fills it with elements, parameters are ignored

Parameters:
_base Scripting base
parent Parent widget
name Name of this widget (not used, just passed to QWidget)

References base, connectSig(), cornerLeft, cornerRight, debug::DBG_WARN, deleteCurrent(), gui::IconCache::getIcon(), guiPrintDbg, mainTree, Q_OUT, tab, tabSwitchPopup(), tree, and treeSelection.

gui::MultiTreeWindow::~MultiTreeWindow (  ) 

default destructor


Member Function Documentation

bool gui::MultiTreeWindow::activate ( TreeKey  ptr  )  [private]

Try to activate secondary tree that is identified by it key

Parameters:
ptr pointer used to identify tree to activate
Returns:
true if the tree exists and was activated, false if the tree does not exist.
void gui::MultiTreeWindow::activate ( boost::shared_ptr< IProperty doc,
const QString &  pName,
const QString &  pToolTip 
)

Create if not exist and then activate secondary tree that contains given IProperty as root item

Parameters:
doc IProperty used to identify secondary treeview
pName Name used for this property
pToolTip Tooltip used for this property
void gui::MultiTreeWindow::activate ( boost::shared_ptr< CContentStream cs,
const QString &  pName,
const QString &  pToolTip 
)

Create if not exist and then activate secondary tree that contains given CContentStream as root item

Parameters:
cs CContentStream used to identify secondary treeview
pName Name used for this content stream
pToolTip Tooltip used for this content stream
void gui::MultiTreeWindow::activate ( const AnnotationVector vec,
boost::shared_ptr< CPage page,
const QString &  pName,
const QString &  pToolTip 
)

Create if not exist and then activate secondary tree that contains given vector of annotations as root item This type of item is special, as if the tree already exist, its contents is replaced

Parameters:
vec Annotation vector
page Page with annotations
pName Name used for this property
pToolTip Tooltip used for this property
void gui::MultiTreeWindow::activate ( const OperatorVector vec,
const QString &  pName,
const QString &  pToolTip 
)

Create if not exist and then activate secondary tree that contains given vector of PDF operators as root item This type of item is special, as if the tree already exist, its contents is replaced

Parameters:
vec Operator vector
pName Name used for this property
pToolTip Tooltip used for this property

References createPage(), gui::TreeWindow::init(), gui::Tree_OperatorVector, trees, and treesReverse.

void gui::MultiTreeWindow::activateMain (  ) 

Activate the Main tree

void gui::MultiTreeWindow::clear (  ) 

Clears all items from MultiTreeWindow

void gui::MultiTreeWindow::clearSecondary (  ) 

Close all secondary Trees. Only the main tree remain active

void gui::MultiTreeWindow::connectSig ( TreeWindow tr  )  [private]

Connect signals from underlying tree window to this MultiTreeWindow

Parameters:
tr TreeWindow to connect

Referenced by MultiTreeWindow().

TreeWindow * gui::MultiTreeWindow::createPage ( const QString &  caption,
const QString &  toolTip 
) [private]

Create new tab and insert new empty TreeWindow in it

Parameters:
caption Caption of tab containing the new tree
toolTip Tooltip of tab containing the new tree
Returns:
Pointer to new treewindow

Referenced by activate().

void gui::MultiTreeWindow::deactivate ( TreeKey  ptr  )  [private]

Try to delete secondary tree that is identified by key

Parameters:
ptr pointer used to identify tree to activate
void gui::MultiTreeWindow::deactivate ( const AnnotationVector vec  ) 

Delete specified secondary tree that contains Annotation Vector

Parameters:
vec Annotation vector, but in fact it is ignored
void gui::MultiTreeWindow::deactivate ( boost::shared_ptr< CContentStream cs  ) 

Delete specified secondary tree that contains given CContentStream as root item

Parameters:
cs CContentStream used to identify secondary treeview
void gui::MultiTreeWindow::deactivate ( boost::shared_ptr< IProperty doc  ) 

Delete specified secondary tree that contains given IProperty as root item

Parameters:
doc IProperty used to identify secondary treeview
void gui::MultiTreeWindow::deactivate ( const OperatorVector vec  ) 

Delete specified secondary tree that contains Operator Vector

Parameters:
vec Operator vector, but in fact it is ignored
void gui::MultiTreeWindow::deleteCurrent (  )  [slot]

Called to delete currently shown treeview

Referenced by MultiTreeWindow().

void gui::MultiTreeWindow::deleteWindow ( TreeWindow tr  )  [private]

Try to delete specified secondary tree

Parameters:
tr Secondary tree to delete
QSCObject * gui::MultiTreeWindow::getSelected ( const QString &  name  ) 

In current tree: Return QSCObject from currently selected item Caller is responsible for freeing object

Returns:
QSCObject from current item

Parameters:
name Name of tree to use for getting selection
See also:
getTree
TreeItemAbstract * gui::MultiTreeWindow::getSelectedItem ( const QString &  name  ) 

In specified tree: Return pointer to currently selected tree item (single select) or first selected tree item (multiselect)

Returns:
currently selected item

Parameters:
name Name of tree to use for getting selection
See also:
getTree
TreeWindow * gui::MultiTreeWindow::getTree ( const QString &  name  ) 

Try to find tree window given its name
If the name is NULL, return current
If the name is invalid or not found, return NULL
Possible names:
"main" - main tree
"current" - current tree
"select" - tree with selected operators
Or use a number to select tree by its position

Parameters:
name Name of tree
Returns:
Given tree (or NULL)
void gui::MultiTreeWindow::init ( boost::shared_ptr< IProperty doc,
const QString &  pName,
const QString &  pToolTip 
)

Init first (main) tab of treeview from given IProperty (dictionary, etc ...)

Parameters:
doc IProperty used to initialize treeview
pName Name used for this property
pToolTip Tooltip used for this property
void gui::MultiTreeWindow::init ( boost::shared_ptr< CPdf pdfDoc,
const QString &  fileName 
)

Init contents of main tree from given PDF document

Parameters:
pdfDoc Document used to initialize treeview
fileName Name of PDF document (will be shown in treeview as name of root element)
void gui::MultiTreeWindow::itemDeleted ( TreeItem dest  )  [signal]

Signal emitted when tree item of type TreeItem is about to be deleted

Parameters:
dest item to be deleted
void gui::MultiTreeWindow::itemDeleted ( TreeItemAbstract dest  )  [signal]

Signal emitted when tree item is about to be deleted

Parameters:
dest item to be deleted
void gui::MultiTreeWindow::itemInfo ( const QString &  info  )  [signal]

Signal emitted when mouse moves over items.

Parameters:
info Info sent to statusbar
void gui::MultiTreeWindow::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

See also:
getSelected

QSCObject * gui::MultiTreeWindow::nextSelected (  ) 

In specified tree: Return QSCObject from next selected item Caller is responsible for freeing object

Returns:
QSCObject from next item

TreeItemAbstract * gui::MultiTreeWindow::nextSelectedItem (  ) 

In current tree: 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.

Returns:
next selected item or NULL if no more selected items

void gui::MultiTreeWindow::notifyDelete ( TreeItemAbstract dest  ) 

Notification function, that will be called when tree item is deleting itself

Parameters:
dest Treeitem about to be deleted

Referenced by gui::TreeItemAbstract::~TreeItemAbstract().

void gui::MultiTreeWindow::notifyDeleteItem ( TreeItem dest  ) 

Notification function, that will be called when tree item of type "TreeItem" is deleting itself, in addition of notifyDelete

Parameters:
dest Treeitem about to be deleted

Referenced by gui::TreeItem::remove().

void gui::MultiTreeWindow::pageChange ( QWidget *  newPage  )  [protected, slot]

Called when page is changed

Parameters:
newPage New page. Should be TreeWindow

References cornerRight, mainTree, and tree.

void gui::MultiTreeWindow::reload (  ) 

reinitialize/reload entire tree after some major change

void gui::MultiTreeWindow::reloadFrom ( TreeItemAbstract item  ) 

Reload part of tree that have given item as root (including that item) Reloading will stop at unopened reference targets

Parameters:
item root of subtree to reload
TreeItemAbstract * gui::MultiTreeWindow::root (  ) 

Return root item of currently selected tree.

Returns:
root item
TreeItemAbstract * gui::MultiTreeWindow::rootMain (  ) 

Return root item of main tree.

Returns:
root item

References gui::TreeWindow::root(), and tree.

void gui::MultiTreeWindow::settingUpdate ( QString  key  )  [slot]

Called when any settings are updated (in script, option editor, etc ...)

Parameters:
key Key of setting which have changed

References mainTree, and gui::TreeWindow::root().

void gui::MultiTreeWindow::tabSwitchPopup (  )  [protected, slot]

Invoke popup menu to switch tabs. Switch to selected tab.

Referenced by MultiTreeWindow().

void gui::MultiTreeWindow::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)

void gui::MultiTreeWindow::treeItemInfo ( const QString &  info  )  [protected, slot]

Signal called when received statusbar information from one of the trees (tree items).
Re-emit the signal

Parameters:
info Information from tree item
void gui::MultiTreeWindow::treeItemSelected (  )  [protected, slot]

Called upon changing selection in the tree window

void gui::MultiTreeWindow::treeMouseClicked ( int  button,
QListViewItem *  item 
) [protected, slot]

Slot called when someone click with mouse button anywhere in one of the trees

Parameters:
button Which button(s) are clicked (1=left, 2=right, 4=middle)
item Which item is clicked upon (NULL if clicked outside item)
void gui::MultiTreeWindow::uninit (  ) 

Resets the tree to be empty and show nothing

void gui::MultiTreeWindow::updateCorner (  )  [private]

Check the corner widget and update it's state


Member Data Documentation

Scripting base

Referenced by MultiTreeWindow().

QAbstractButton* gui::MultiTreeWindow::cornerLeft [private]

Left Corner widget

Referenced by MultiTreeWindow().

QAbstractButton* gui::MultiTreeWindow::cornerRight [private]

Right Corner widget

Referenced by MultiTreeWindow(), and pageChange().

QTabWidget* gui::MultiTreeWindow::tab [private]

Tab Widget

Referenced by MultiTreeWindow().

Current TreeWindow

Referenced by MultiTreeWindow(), pageChange(), and rootMain().

TreeWindow map

Referenced by activate().

TreeWindow to get selection from

Referenced by MultiTreeWindow().

TreeWindow map - reverse

Referenced by activate().


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