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

#include <ITreeViewHierarchyAdapter.h>

Inheritance diagram for ITreeViewHierarchyAdapter:
IPMUnknownCPMUnknown< ITreeViewHierarchyAdapter >ListTreeViewAdapterPstLstUITVHierarchyAdapterCusDtLnkUITreeTVHierarchyAdapterDataUpdaterUITVHierarchyAdapterPnlTrvTVHierarchyAdapterBscSlDlgTreeViewAdapterCusCondTxtTreeViewAdapterDCLSizTreeViewAdapterLnkWtchTreeViewAdapterTKITreeViewHierarchyAdapterWLBCmpTreeViewAdapter

Public Types

enum  { kDefaultIID = IID_ITREEVIEWHIERARCHYADAPTER }
 

Public Member Functions

virtual NodeID_rv GetRootNode () const =0
 
virtual NodeID_rv GetParentNode (const NodeID &node) const =0
 
virtual int32 GetNumChildren (const NodeID &node) const =0
 
virtual bool16 ShouldAddNthChild (const NodeID &node, const int32 &nth) const =0
 
virtual NodeID_rv GetNthChild (const NodeID &node, const int32 &nth) const =0
 
virtual int32 GetChildIndex (const NodeID &parent, const NodeID &child) const =0
 
virtual NodeID_rv GetGenericNodeID () const =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 that provides the means for navigating through a tree model. It is like the adapter pattern in that it provides a way for the TreeView widget to navigate a tree-model without requiring the tree-model to conform to any given interface.

Client code wishing to use a tree view widget should implement this interface.

To aid in debugging your ITreeViewHierarchyAdapter implementation, check the test menu item Test > UI > Enable TreeView Validation. This enables more debug only code to check that your hierarchy and NodeID implementations are correct.

Member Function Documentation

virtual int32 ITreeViewHierarchyAdapter::GetChildIndex (const NodeIDparent,
const NodeIDchild 
) const
pure virtual

Accessor to determine the index of a given child node in its parent's collection of children.

Parameters
parentspecifies the parent node whose child we are querying about
childspecifies child of interest
Returns
index of given child in parent's collection, (-1) if not in collection

Implemented in CusDtLnkUITreeTVHierarchyAdapter, PnlTrvTVHierarchyAdapter, DataUpdaterUITVHierarchyAdapter, PstLstUITVHierarchyAdapter, CusCondTxtTreeViewAdapter, and ListTreeViewAdapter.

virtual NodeID_rv ITreeViewHierarchyAdapter::GetGenericNodeID () const
pure virtual

Return a dummy node that can be used as a generic node anywhere in the tree.

Returns
reference to a generic node

Implemented in CusDtLnkUITreeTVHierarchyAdapter, PnlTrvTVHierarchyAdapter, DataUpdaterUITVHierarchyAdapter, PstLstUITVHierarchyAdapter, CusCondTxtTreeViewAdapter, and ListTreeViewAdapter.

virtual NodeID_rv ITreeViewHierarchyAdapter::GetNthChild (const NodeIDnode,
const int32 & nth 
) const
pure virtual

Accessor for a child of a given node by index.

Parameters
nodespecifies the parent node
nthspecifies index of child to choose
Returns
reference to the child at the given index

Implemented in CusDtLnkUITreeTVHierarchyAdapter, PnlTrvTVHierarchyAdapter, DataUpdaterUITVHierarchyAdapter, PstLstUITVHierarchyAdapter, CusCondTxtTreeViewAdapter, and ListTreeViewAdapter.

virtual int32 ITreeViewHierarchyAdapter::GetNumChildren (const NodeIDnode) const
pure virtual

Accessor for the number of children given a node that is in the tree-model. specifies the node of interest

Returns
number of children of given node

Implemented in CusDtLnkUITreeTVHierarchyAdapter, PnlTrvTVHierarchyAdapter, DataUpdaterUITVHierarchyAdapter, PstLstUITVHierarchyAdapter, CusCondTxtTreeViewAdapter, and ListTreeViewAdapter.

virtual NodeID_rv ITreeViewHierarchyAdapter::GetParentNode (const NodeIDnode) const
pure virtual

Accessor for the parent node of a given node. If the given node is the root node, this should return nil.

Implemented in CusDtLnkUITreeTVHierarchyAdapter, PnlTrvTVHierarchyAdapter, DataUpdaterUITVHierarchyAdapter, PstLstUITVHierarchyAdapter, CusCondTxtTreeViewAdapter, and ListTreeViewAdapter.

virtual NodeID_rv ITreeViewHierarchyAdapter::GetRootNode () const
pure virtual

Accessor for the root node of the tree model. Should return an instance of a node that represents the root node, with data allowing it to be uniquely identified as such.

Returns
reference to root node

Implemented in CusDtLnkUITreeTVHierarchyAdapter, PnlTrvTVHierarchyAdapter, DataUpdaterUITVHierarchyAdapter, PstLstUITVHierarchyAdapter, CusCondTxtTreeViewAdapter, DCLSizTreeViewAdapter, WLBCmpTreeViewAdapter, ListTreeViewAdapter, and TKITreeViewHierarchyAdapter.

virtual bool16 ITreeViewHierarchyAdapter::ShouldAddNthChild (const NodeIDnode,
const int32 & nth 
) const
pure virtual

When building subtrees, this is called so the client can choose to add this particular node or not. In most cases, returning true here is what you want.

Parameters
nodespecifies the parent node
nthspecifies index of child to choose
Returns
if the node should be added to the tree or not

Implemented in CusDtLnkUITreeTVHierarchyAdapter, PnlTrvTVHierarchyAdapter, DataUpdaterUITVHierarchyAdapter, PstLstUITVHierarchyAdapter, and ListTreeViewAdapter.