InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ITreeViewMgr Class Referenceabstract

#include <ITreeViewMgr.h>

Inheritance diagram for ITreeViewMgr:
IPMUnknownCTreeViewMgr

Public Types

enum  { kDefaultIID = IID_ITREEVIEWMGR }
 
enum  ScrollWhere { eScrollToTop, eScrollToMiddle, eScrollIntoView, eScrollToShowChildren }
 

Public Member Functions

virtual void ChangeRoot (bool16 widgetHeightIsConstant=kFalse)=0
 
virtual void NodeAdded (const NodeID &nodeAdded)=0
 
virtual void NodesAdded (const K2Vector< NodeID > &nodesAdded)=0
 
virtual void BeforeNodeDeleted (const NodeID &nodeDeleted)=0
 
virtual void BeforeNodesDeleted (K2Vector< NodeID > &nodesDeleted)=0
 
virtual void NodeMoved (const NodeID &nodeMoved, const NodeID &oldParent)=0
 
virtual void NodeChanged (const NodeID &nodeChanged, bool16 childrenChangedAlso=kFalse, int32 message=0)=0
 
virtual void ScrollToNode (const NodeID &scrollToNode, ScrollWhere whereToScroll)=0
 
virtual bool16 IsNodeExpanded (const NodeID &nodeInQuestion) const =0
 
virtual bool16 IsNodeExpanded (IControlView *widget) const =0
 
virtual void ExpandNode (const NodeID &nodeToExpand, bool16 expandAllDescendants=kFalse)=0
 
virtual void CollapseNode (const NodeID &nodeToCollapse, bool16 collapseAllDescendants=kFalse)=0
 
virtual void HandleScroll (int32 amount, bool16 up)=0
 
virtual void HandleResize ()=0
 
virtual void ScrollUp ()=0
 
virtual void ScrollDown ()=0
 
virtual NodeID_rv Search (const PMString &partialNodeName) const =0
 
virtual NodeID_rv Search (const NodeID &nodeToSearch) const =0
 
virtual void ClearTree (bool16 clearExpandedNodeList=kFalse)=0
 
virtual IControlViewQueryWidgetFromNode (const NodeID &node) const =0
 
virtual void Purge (int32 level)=0
 
virtual void RefreshSubTree (const NodeID &subTreeRoot, bool16 includeEntireHier=kTrue)=0
 
virtual void ArrangeWidgets ()=0
 
virtual PMRect GetViewableArea ()=0
 
virtual PMPoint GetSizeNeededWihtoutScrollbar ()=0
 
virtual void ScrollVerticalAbsoluteAmount (int32 amount, bool16 forceRedraw=kTrue)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Interface to keep the tree-view synchronised with changes to the tree-model.

Client code should call methods in this interface to let the tree know when changes to the tree have occurred. For instance, client code should call ChangeRoot() to initialize the treeview control.

Member Function Documentation

virtual void ITreeViewMgr::BeforeNodeDeleted (const NodeIDnodeDeleted)
pure virtual

This must be called before the object is actually deleted, so we can get it's size

Parameters
nodeDeleted

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::BeforeNodesDeleted (K2Vector< NodeID > & nodesDeleted)
pure virtual

Call this method before a collection of nodes are to be removed from the tree. This method has a K2Vector parameter that is non-const, because the nodes in this collection will be sorted after use

Parameters
nodesDeletednodes about to be deleted,
Postcondition
the nodesDeleted vector will be sorted

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::ChangeRoot (bool16 widgetHeightIsConstant = kFalse)
pure virtual

Call this method to initialize the tree, using the ITreeViewHierarchyAdapter. Call this if you want the tree to repopulate it's widgets. Node expansion will be preserved unless the root node is different. If you don't want node expansion preserved, you must call ClearTree(kTrue) before calling ChangeRoot()

Debug version of ChangeRoot() which had a test parameter has been removed. To get the Tree validation, use the test menu item Test > UI > Enable TreeView Validation to turn on TreeView debugging code. Enabling this will help you find bugs in your NodeID and ITreeViewHierarchyAdapter implementations.

Parameters
widgetHeightIsConstantif all of the widgets that will be created in your tree will have the same height, set widgetHeightIsConstant to kTrue to improve performance

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::ClearTree (bool16 clearExpandedNodeList = kFalse)
pure virtual

Call this to remove all the widgets. This is the same as calling ChangeRoot() when the TreeViewHierarchy will return nil for QueryRootNode(). It makes the tree empty and breaks the connection between the tree and it's root You need to call ChangeRoot() again for a new connection to be established. By default, the list of expanded nodes will not be cleared. To clear the list of expanded nodes, set clearExpandedNodeList to kTrue.

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::CollapseNode (const NodeIDnodeToCollapse,
bool16 collapseAllDescendants = kFalse 
)
pure virtual

Method to collapse given node and optionally collapse all the descendants

Parameters
nodeToCollapsespecifies node that is to be collapsed
collapseAllDescendantskFalse if only immediate children to be collapsed, kTrue if all descendants to be collapsed

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::ExpandNode (const NodeIDnodeToExpand,
bool16 expandAllDescendants = kFalse 
)
pure virtual

Method to expand node and optionally all its descendants.

Parameters
nodeToExpandspecifies node that is to be expanded
expandAllDescendantskTrue if all descendants are to be expanded also, kFalse to restrict expansion to immediate children

Implemented in CTreeViewMgr.

virtual PMPoint ITreeViewMgr::GetSizeNeededWihtoutScrollbar ()
pure virtual

Returns a rectangle that specify the size needed for whole tree to draw without scrollbar

Implemented in CTreeViewMgr.

virtual PMRect ITreeViewMgr::GetViewableArea ()
pure virtual

Returns a rectangle in scroller coordinates that represents the viewable area on the scrollable canvas.

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::HandleResize ()
pure virtual

This is typically only called by the scroll bar event handler/ resize widget

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::HandleScroll (int32 amount,
bool16 up 
)
pure virtual

This is typically only called by the scroll bar event handler/ resize widget

Implemented in CTreeViewMgr.

virtual bool16 ITreeViewMgr::IsNodeExpanded (const NodeIDnodeInQuestion) const
pure virtual

Determine if given node is expanded.

Parameters
nodeInQuestionnode of interest
Returns
kTrue if node is expanded, kFalse otherwise

Implemented in CTreeViewMgr.

virtual bool16 ITreeViewMgr::IsNodeExpanded (IControlViewwidget) const
pure virtual

Determine if given node is expanded.

Parameters
widgetthe corresponding widget that is responsible for rendering a node
Returns
kTrue if node is expanded, kFalse otherwise

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::NodeAdded (const NodeIDnodeAdded)
pure virtual

This should be called after the node has been added

Parameters
nodeAdded

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::NodeChanged (const NodeIDnodeChanged,
bool16 childrenChangedAlso = kFalse,
int32 message = 0 
)
pure virtual

This should only be called for a node whose height will not change. If the height could change call delete and then add

Parameters
nodeChanged
childrenChangedAlso
message

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::NodeMoved (const NodeIDnodeMoved,
const NodeIDoldParent 
)
pure virtual

This should be called when a node has moved to a new location. Do not call this if the height of the widget may have also changed. In that case, you'll have to use BeforeNodeDeleted and NodeAdded

Parameters
nodeMoved
oldParent

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::NodesAdded (const K2Vector< NodeID > & nodesAdded)
pure virtual

This should be called after a collection of nodes have been added

Parameters
nodesAdded

Implemented in CTreeViewMgr.

virtual IControlView* ITreeViewMgr::QueryWidgetFromNode (const NodeIDnode) const
pure virtual

Utility function to get the widget for a particular node. There is no guarantee that a widget will exist though. This call is rarely what you want. It will return nil in cases where the node in question is not visible in the tree, or when the tree has changed and the widgets have not yet been rearranged. Call NodeChanged() if you want to update data in a node. Typically, this is only called in response to mouse events.

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::RefreshSubTree (const NodeIDsubTreeRoot,
bool16 includeEntireHier = kTrue 
)
pure virtual

When a subtree has changed significantly or when you aren't sure of the nodes added/removed, you can call this method to regenerate the tree below the specified node

Parameters
thenode at the top of the subtree you want refreshed
falsewill only fix up the imediate children ignoring all grandchildren

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::ScrollDown ()
pure virtual

Would scroll down as if you had clicked in the scroll bar between the thumb and end buttons.

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::ScrollToNode (const NodeIDscrollToNode,
ScrollWhere whereToScroll 
)
pure virtual

This allows a certain node to be scrolled into view, ancestors will be expanded to make node visible

Parameters
scrollToNode
whereToScroll

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::ScrollUp ()
pure virtual

Would scroll up as if you had clicked in the scroll bar between the thumb and end buttons.

Implemented in CTreeViewMgr.

virtual void ITreeViewMgr::ScrollVerticalAbsoluteAmount (int32 amount,
bool16 forceRedraw = kTrue 
)
pure virtual

Scroll the tree view widget vertically with a specified amount in pixels

Implemented in CTreeViewMgr.

virtual NodeID_rv ITreeViewMgr::Search (const PMStringpartialNodeName) const
pure virtual

This method is used with typeahead to search for the first node in the tree that begins with 'partialNodeName'. TreeView must have ITreeViewTypeAhead interface for this to do anything useful

Parameters
searchthe tree for a node whose text representation starts with 'partialNodeName'
Returns
first node in the tree that begins with 'partialNodeName', or kInvalidNodeID if no match is found

Implemented in CTreeViewMgr.

virtual NodeID_rv ITreeViewMgr::Search (const NodeIDnodeToSearch) const
pure virtual

This method is used to determine if a node has been loaded in the tree widget.

Parameters
nodeToSearchsearch the tree for a node with this ID
Returns
the node, or kInvalidNodeID if no match is found

Implemented in CTreeViewMgr.