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

#include <IHierarchy.h>

Inheritance diagram for IHierarchy:
IPMUnknownCHierarchyNode

Public Types

enum  { kDefaultIID = IID_IHIERARCHY }
 
enum  { kAtTheEnd = -1 }
 
enum  { kIncludeHidden = 0x00000001 }
 

Public Member Functions

virtual IHierarchyQueryChild (int32 n) const =0
 
virtual UID GetChildUID (int32 n) const =0
 
virtual int32 GetChildIndex (const IHierarchy *p) const =0
 
virtual int32 GetChildCount () const =0
 
virtual IHierarchyQueryParent () const =0
 
virtual UID GetParentUID () const =0
 
virtual void SetParent (IHierarchy *newParent)=0
 
virtual IHierarchyQueryRoot () const =0
 
virtual UID GetRootUID () const =0
 
virtual void SetRootUID (UID newRoot)=0
 
virtual void Add (IHierarchy *newChild, int32 pos=kAtTheEnd)=0
 
virtual void Move (IHierarchy *childToMove, int32 to)=0
 
virtual void Remove (IHierarchy *childToRemove)=0
 
virtual void Remove (UID childToRemove)=0
 
virtual bool16 IsLessThan (IHierarchy *item)=0
 
virtual void GetDescendents (UIDList *resultList, const PMIID &interfaceID, int32 flags=0) const =0
 
virtual void GetAncestors (UIDList *resultList, const PMIID &interfaceID) const =0
 
virtual UID GetLayerUID () const =0
 
virtual UID GetSpreadUID () 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

The IHierarchy interface stores a persistent, UID-based tree structure. This tree structure is used for InDesign's display hierarchy. The boss objects that represent spreads, layers, and the various other types of page items (splines, images, etc.) aggregate an IHierarchy interface.

Member Enumeration Documentation

anonymous enum

Special position index for adding items to a hierarchy.

anonymous enum

Flags for GetDescendents.
Enumerator
kIncludeHidden 

Act on all children, including those that are hidden.

Member Function Documentation

virtual void IHierarchy::Add (IHierarchynewChild,
int32 pos = kAtTheEnd 
)
pure virtual

Add a new child before the index position. Or, if kAtTheEnd, add it to the end of the list.

Parameters
*newChildthe item to add to the hierarchy.
kAtTheEndposition to add, defaults to kAtTheEnd. Use 0 for initial position of hierarchy.

Implemented in CHierarchyNode.

virtual void IHierarchy::GetAncestors (UIDListresultList,
const PMIIDinterfaceID 
) const
pure virtual

Return ancestors that support interfaceID. Collection of ancestors ends when an ancestor is reached that doesn't support the interface.

Parameters
*resultList[OUT] the filled in list of ancestors meeting the requirements.
interfaceID[IN] the interfaceID to check each parent (and grandparent, etc) for.

Implemented in CHierarchyNode.

virtual int32 IHierarchy::GetChildCount () const
pure virtual

Return the number of children

Parameters
none
Returns
int32

Implemented in CHierarchyNode.

virtual int32 IHierarchy::GetChildIndex (const IHierarchyp) const
pure virtual

Return the index of this child

Parameters
pthe child hierarchy to find the position for.
Returns
int32 the child's position, -1 if not found.

Implemented in CHierarchyNode.

virtual UID IHierarchy::GetChildUID (int32 n) const
pure virtual

Return the n'th child UID in the hierarchy.

Parameters
nthe index of the child to return.
Returns
UID

Implemented in CHierarchyNode.

virtual void IHierarchy::GetDescendents (UIDListresultList,
const PMIIDinterfaceID,
int32 flags = 0 
) const
pure virtual

Return all the descendents that support interfaceID.

Parameters
*resultList[OUT] the filled in list of descendents meeting the requirements.
interfaceID[IN] the interfaceID to check each child (and grandchild, etc) for.
flagsGenerally 0, but may include hidden items (kIncludeHidden)

Implemented in CHierarchyNode.

virtual UID IHierarchy::GetLayerUID () const
pure virtual

Return the spread layer's UID for this hierarchy node.

Parameters
none
Returns
UID

Implemented in CHierarchyNode.

virtual UID IHierarchy::GetParentUID () const
pure virtual

Returns the immediate parent UID of this item. May be kInvalidUID.

Parameters
none
Returns
UID

Implemented in CHierarchyNode.

virtual UID IHierarchy::GetRootUID () const
pure virtual

Returns the UID of the ultimate parent of the hierarchy.

Parameters
none
Returns
UID

Implemented in CHierarchyNode.

virtual UID IHierarchy::GetSpreadUID () const
pure virtual

Return the spread's UID for this hierarchy node.

Parameters
none
Returns
UID

Implemented in CHierarchyNode.

virtual bool16 IHierarchy::IsLessThan (IHierarchyitem)
pure virtual

Answers, "Is this in before 'item' in the Z-order?" NOTE: Both items must be in the same hierarchy and be the same distance from the root.

Parameters
itemthe item to compare to this item
Returns
bool16 kTrue if before (underneath) this item, kFalse otherwise.

Implemented in CHierarchyNode.

virtual void IHierarchy::Move (IHierarchychildToMove,
int32 to 
)
pure virtual

Move the child to a new location in the z-order.

Parameters
*childToMovethe item to move
tothe index location to move the item

Implemented in CHierarchyNode.

virtual IHierarchy* IHierarchy::QueryChild (int32 n) const
pure virtual

Return the n'th child in the hierarchy. Called holds reference.

Parameters
nthe index of the child to return.
Returns
IHierarchy

Implemented in CHierarchyNode.

virtual IHierarchy* IHierarchy::QueryParent () const
pure virtual

Returns the immediate parent of this item. Caller holds reference. May be nil.

Parameters
none
Returns
IHierarchy

Implemented in CHierarchyNode.

virtual IHierarchy* IHierarchy::QueryRoot () const
pure virtual

Returns the ultimate parent of the hierarchy. Caller holds reference.

Parameters
none
Returns
IHierarchy

Implemented in CHierarchyNode.

virtual void IHierarchy::Remove (IHierarchychildToRemove)
pure virtual

Remove the child. It is disowned, and is no longer a child.

Parameters
*childToRemovethe item to remove.

Implemented in CHierarchyNode.

virtual void IHierarchy::Remove (UID childToRemove)
pure virtual

Same as above except it allows us to remove the child even if we can't access the IHierarchy interface.

Parameters
childToRemovethe UID of the child to remove.

Implemented in CHierarchyNode.

virtual void IHierarchy::SetParent (IHierarchynewParent)
pure virtual

SetParent is not for external use. It's in the external interface so that subclasses can call it on IHierarchy parameters. (protected doesn't work on parameters). See kRemoveFromHierarchyCmdBoss and kAddToHierarchyCmdBoss and IHierarchyUtils::AddToHierarchy and IHierarchyUtils::RemoveFromHierarchy

Parameters
*newParent

Implemented in CHierarchyNode.

virtual void IHierarchy::SetRootUID (UID newRoot)
pure virtual

SetRootUID is not for external use. It's in the external interface so that subclasses can call it on IHierarchy parameters. (protected doesn't work on parameters)

Parameters
newRoot

Implemented in CHierarchyNode.