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

#include <IStyleGroupHierarchy.h>

Inheritance diagram for IStyleGroupHierarchy:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ISTYLEGROUPHIERARCHY }
 
enum  { kAtTheEnd = -1 }
 
enum  HierarchyTypeEnum { kHierarchyTypeUnknown = 0, kHierarchyTypeRoot = 1, kHierarchyTypeStyle = 2, kHierarchyTypeStyleGroup = 3 }
 
enum  SortFlag {
  kSortAscending = 0x00000001, kSortDescending = 0x00000002, kSortImmediateChildren = 0x00000004, kSortHierarchy = 0x00000008,
  kSortAscendingHierarchy = kSortAscending|kSortHierarchy
}
 

Public Member Functions

virtual IStyleGroupHierarchyQueryChild (int32 n) const =0
 
virtual UID GetChildUID (int32 n) const =0
 
virtual int32 GetChildIndex (const IStyleGroupHierarchy *p) const =0
 
virtual int32 GetChildCount () const =0
 
virtual IStyleGroupHierarchyQueryParent () const =0
 
virtual UID GetParentUID () const =0
 
virtual IStyleGroupHierarchyQueryRoot () const =0
 
virtual UID GetRootUID () const =0
 
virtual void Add (IStyleGroupHierarchy *newChild, int32 pos=kAtTheEnd)=0
 
virtual void Move (IStyleGroupHierarchy *childToMove, int32 to)=0
 
virtual void Remove (IStyleGroupHierarchy *childToRemove)=0
 
virtual void Remove (UID childToRemove)=0
 
virtual bool16 IsLessThan (IStyleGroupHierarchy *item) const =0
 
virtual void GetDescendents (UIDList *resultList, const PMIID &interfaceID) const =0
 
virtual void GetAncestors (UIDList *resultList, const PMIID &interfaceID) const =0
 
virtual UID FindByName (const PMString &nodeName) const =0
 
virtual void Sort (SortFlag flag=kSortAscendingHierarchy)=0
 
virtual PMString GetName (bool16 translated=kFalse) const =0
 
virtual PMString GetLocation (bool16 translated=kFalse) const =0
 
virtual PMString GetFullPath (bool16 translated=kFalse) const =0
 
virtual HierarchyTypeEnum GetHierarchyType () const =0
 
virtual void SetParent (IStyleGroupHierarchy *newParent)=0
 
virtual void SetRootUID (UID newRoot)=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 IStyleGroupHierarchy interface stores a persistent, UID-based tree structure. This tree structure is used for InDesign's display hierarchy. The boss objects that represent (StyleGroups and Styles) aggregate an IStyleGroupHierarchy interface.

Member Enumeration Documentation

anonymous enum

Special position index for adding items to a hierarchy.
Enumerator
kAtTheEnd 

Position to add at the end of list

Enum to distinguish different type of hierarchy elements Currently we have Styles , Style sets. In future we may have style links, etc.
Enumerator
kHierarchyTypeUnknown 

Type is unknown

kHierarchyTypeRoot 

Type is the root of the style set hierarchy. Not visible in palettes

kHierarchyTypeStyle 

Type is a style

kHierarchyTypeStyleGroup 

Type is a style set

Flag to be passed for sorting children.
Enumerator
kSortAscending 

Sort ascending

kSortDescending 

Sort descending

kSortImmediateChildren 

Sort only only immediate children

kSortHierarchy 

Sort entire hierarchy of this node

kSortAscendingHierarchy 

Sort all the hierarchy in Ascening order

Member Function Documentation

virtual void IStyleGroupHierarchy::Add (IStyleGroupHierarchynewChild,
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
newChild[IN] the item to add to the hierarchy.
pos[IN] kAtTheEnd position to add, defaults to kAtTheEnd. Use 0 for initial position of hierarchy.
virtual UID IStyleGroupHierarchy::FindByName (const PMStringnodeName) const
pure virtual

Returns the UID of the node if the node name is found in the immediate children of this Hierarchy. kInvalidUID otherwise.

Parameters
nodeName[IN] node name to find.
virtual void IStyleGroupHierarchy::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.
virtual int32 IStyleGroupHierarchy::GetChildCount () const
pure virtual

Return the number of children

Returns
int32
virtual int32 IStyleGroupHierarchy::GetChildIndex (const IStyleGroupHierarchyp) const
pure virtual

Return the index of this child

Parameters
p[IN] the child hierarchy to find the position for.
Returns
int32 the child's position, -1 if not found.
virtual UID IStyleGroupHierarchy::GetChildUID (int32 n) const
pure virtual

Return the n'th child UID in the hierarchy.

Parameters
n[IN] the index of the child to return.
Returns
UID
virtual void IStyleGroupHierarchy::GetDescendents (UIDListresultList,
const PMIIDinterfaceID 
) 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.
virtual PMString IStyleGroupHierarchy::GetFullPath (bool16 translated = kFalse) const
pure virtual

Returns the full path including name of this hierarchy object e.g. "StyleGroup1:ChildSet2:StyleName1"

Parameters
translated[IN] if you want the full path returned to have translated components
virtual HierarchyTypeEnum IStyleGroupHierarchy::GetHierarchyType () const
pure virtual

Returns the HierarchyTypeEnum of this hierarchy.

virtual PMString IStyleGroupHierarchy::GetLocation (bool16 translated = kFalse) const
pure virtual

Returns the location of this hierarchy object e.g "StyleGroup1:ChildSet2"

virtual PMString IStyleGroupHierarchy::GetName (bool16 translated = kFalse) const
pure virtual

Returns the name of this node.

virtual UID IStyleGroupHierarchy::GetParentUID () const
pure virtual

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

Returns
UID
virtual UID IStyleGroupHierarchy::GetRootUID () const
pure virtual

Returns the UID of the ultimate parent of the hierarchy.

Returns
UID
virtual bool16 IStyleGroupHierarchy::IsLessThan (IStyleGroupHierarchyitem) const
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
item[IN] the item to compare to this item
Returns
bool16 kTrue if before (underneath) this item, kFalse otherwise.
virtual void IStyleGroupHierarchy::Move (IStyleGroupHierarchychildToMove,
int32 to 
)
pure virtual

Move the child to a new location in the index order, Child must be immediate child of this node.

Parameters
childToMove[IN] the item to move
to[IN] the index location to move the item
virtual IStyleGroupHierarchy* IStyleGroupHierarchy::QueryChild (int32 n) const
pure virtual

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

Parameters
n[IN] the index of the child to return.
Returns
IStyleGroupHierarchy
virtual IStyleGroupHierarchy* IStyleGroupHierarchy::QueryParent () const
pure virtual

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

Returns
IStyleGroupHierarchy
virtual IStyleGroupHierarchy* IStyleGroupHierarchy::QueryRoot () const
pure virtual

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

Returns
IStyleGroupHierarchy
virtual void IStyleGroupHierarchy::Remove (IStyleGroupHierarchychildToRemove)
pure virtual

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

Parameters
childToRemove[IN] the item to remove.
virtual void IStyleGroupHierarchy::Remove (UID childToRemove)
pure virtual

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

Parameters
childToRemove[IN] the UID of the child to remove.
virtual void IStyleGroupHierarchy::SetParent (IStyleGroupHierarchynewParent)
pure virtual

PRIVATE USE ONLY, DO NOT USE, SetParent is not for external use. It's in the external interface so that subclasses can call it on IStyleGroupHierarchy parameters. (protected doesn't work on parameters). Use appropriate commands

Parameters
*newParent
See Also
kMoveStyleOrSetCmdBoss
virtual void IStyleGroupHierarchy::SetRootUID (UID newRoot)
pure virtual

FOR PRIVATE USE ONLY, DONT CALL THIS, SetRootUID is not for external use. It's in the external interface so that subclasses can call it on IStyleGroupHierarchy parameters. (protected doesn't work on parameters)

Parameters
newRoot
virtual void IStyleGroupHierarchy::Sort (SortFlag flag = kSortAscendingHierarchy)
pure virtual

Sort the hierarchy based on the flag.

Parameters
flag[IN] see SortFlag for details.