InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IHierarchyUtils Class Referenceabstract
Inheritance diagram for IHierarchyUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IHIERARCHYUTILS }
 

Public Member Functions

virtual ErrorCode AddToHierarchy (IDataBase *db, UID itemToAdd, UID parent, int32 pos=IHierarchy::kAtTheEnd)=0
 
virtual ErrorCode AddToHierarchy (const UIDRef &itemToAdd, UID parent, int32 pos=IHierarchy::kAtTheEnd)=0
 
virtual ErrorCode RemoveFromHierarchy (const UIDRef &itemToRemove)=0
 
virtual void FilterItemsFromOtherSpreads (UID keepSpreadUID, UIDList *itemList)=0
 
virtual void CollapsePageUIDsToSpreadUIDs (const UIDList &pageUIDList, UIDList *spreadUIDList, const bool16 bCompleteSpreadsOnly)=0
 
virtual void ExpandSpreadUIDsToPageUIDs (const UIDList &spreadUIDList, UIDList *pageUIDList)=0
 
virtual void ExpandPageUIDToSection (const UIDRef &pageRef, UIDList *pageUIDList, const bool16 bRequireNamedLayout)=0
 
virtual void CollapsePageUIDsToSections (const UIDList &pageUIDList, K2Vector< UIDList > &pagesBySection, const bool16 bRequireNamedLayout)=0
 
virtual IHierarchyQueryEffectiveHierarchyParent (IHierarchy *pi) const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Member Function Documentation

virtual ErrorCode IHierarchyUtils::AddToHierarchy (IDataBasedb,
UID itemToAdd,
UID parent,
int32 pos = IHierarchy::kAtTheEnd 
)
pure virtual
Add an item to the hierarchy. Processes a kAddToHierarchyCmdBoss command.

db The database the page item is in (what document)

Parameters
itemToAddThe page item we want to add to the hierarchy
parentitemToAdd's new parent
positemToAdd will appear as the n'th child of parent, or the last if pos is not specified.
Returns
kSuccess if it worked.
virtual ErrorCode IHierarchyUtils::AddToHierarchy (const UIDRefitemToAdd,
UID parent,
int32 pos = IHierarchy::kAtTheEnd 
)
pure virtual
Add an item to the hierarchy. Processes a kAddToHierarchyCmdBoss command.

Parameters
itemToAddThe page item we want to add to the hierarchy
parentitemToAdd's new parent
positemToAdd will appear as the n'th child of parent, or the last if pos is not specified.
Returns
kSuccess if it worked.
virtual void IHierarchyUtils::CollapsePageUIDsToSections (const UIDListpageUIDList,
K2Vector< UIDList > & pagesBySection,
const bool16 bRequireNamedLayout 
)
pure virtual

Given a list of pages, divide them into a vector by sections.

Parameters
pageUIDListIN, a UIDList reference containing one or more page UIDs.
pagesBySectionIN/OUT, a vector filled out with pages in each entry by section.
bRequireNamedLayout- if kTrue, the pages returned in each vector will all be in a named layout. May span several non-named sections.
virtual void IHierarchyUtils::CollapsePageUIDsToSpreadUIDs (const UIDListpageUIDList,
UIDListspreadUIDList,
const bool16 bCompleteSpreadsOnly 
)
pure virtual

Collapse a list of one or more page UIDs into their parent spread UIDs. May return empty list.

Parameters
pageUIDListIN, a UIDList reference containing one or more page UIDs.
spreadUIDListIN/OUT, a filled out UIDList of spread UIDs. May be empty depending on bCompleteSpreadsOnly parameter.
bCompleteSpreadsOnlyIN, pass kTrue if you only want spreads with all their pages in pageUIDList, kFalse to get partially represented spreads as well.
virtual void IHierarchyUtils::ExpandPageUIDToSection (const UIDRefpageRef,
UIDListpageUIDList,
const bool16 bRequireNamedLayout 
)
pure virtual

Expand a single page, find it's section, then gather all the pages that fall in this section

Parameters
pageRefIN, a UIDRef to a page
bRequireNamedLayout- if kTrue, the pages returned will all be in a named layout. May span several non-named sections.
pageUIDListIN/OUT, the filled out list of all the pages that are in the same section as pageRef.
virtual void IHierarchyUtils::ExpandSpreadUIDsToPageUIDs (const UIDListspreadUIDList,
UIDListpageUIDList 
)
pure virtual

Expand a list of one or more spread UIDs into their constituent page UIDs. The input spreadUIDList may also contain page UIDs, in which case they are simply copied into the pageUIDList.

Parameters
spreadUIDListIN, a UIDList reference containing one or more spread UIDs
pageUIDListIN/OUT, the filled out list of page UIDs belonging to the passed in spreads.
virtual void IHierarchyUtils::FilterItemsFromOtherSpreads (UID keepSpreadUID,
UIDListitemList 
)
pure virtual
Filter out items from a list that don't have the same spread UID as the given UID.

Typically used to remove all items not on a given spread, passing iHierarchy->GetSpreadUID() for keepSpreadUID.

Parameters
keepSpreadUIDIN, The spread UID to keep items from.
itemListIN/OUT, The page item list to process.
Returns
void.
virtual IHierarchy* IHierarchyUtils::QueryEffectiveHierarchyParent (IHierarchypi) const
pure virtual

Get the parent of an object taking into account inlines and other cases that don't follow the usual hierarchy.

Parameters
piIN, The page item who's parent we would like.
Returns
the parent object or nil if no parent.
virtual ErrorCode IHierarchyUtils::RemoveFromHierarchy (const UIDRefitemToRemove)
pure virtual
Remove an item from the hierarchy. Processes a kRemoveFromHierarchyCmdBoss command.

Parameters
itemToRemoveThe page item we want to add to the hierarchy
Returns
kSuccess if it worked.