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

#include <ITextStoryThreadDictHier.h>

Inheritance diagram for ITextStoryThreadDictHier:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ITEXTSTORYTHREADDICTHIER }
 
enum  CompareResult { kIsBefore = -1, kIsEqual = 0, kIsAfter = 1 }
 

Public Member Functions

virtual void Insert (UID dictUID)=0
 
virtual void Remove (UID dictUID)=0
 
virtual UID NextUID (UID dictUID) const =0
 
virtual CompareResult Compare (UID dict1, TextIndex pos1, UID dict2, TextIndex pos2) 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

This interface is implemented on every kTextStoryBoss and is used to manage the layout of ITextStoryThreadDict thread blocks within the ITextModel. The proper ordering of thread blocks within the the ITextModel is vital because of undo issues. Consider the case of nested tables - within one thread block (the primary story thread) is anchored the first table. Within its thread block is anchored another table. It is important that the relative ordering be maintained.

See Also
ITextStoryThreadDict
ITextModel
ITextStoryThread

Member Enumeration Documentation

For comparing positions relative to the hierarchy of TextIndexes in different dictionaries.
Enumerator
kIsBefore 

(dict1, pos1) is hierarchicaly before (dict2, pos2)

kIsEqual 

pos1 is the same as pos2

kIsAfter 

(dict1, pos1) is hierarchicaly after (dict2, pos2)

Member Function Documentation

virtual CompareResult ITextStoryThreadDictHier::Compare (UID dict1,
TextIndex pos1,
UID dict2,
TextIndex pos2 
) const
pure virtual

This method is used to determine the hierarchical ordering of TextIndexes in dictionaries. Ordering is determined not by strict TextIndex ordering but rather by ordering relative to the anchors of the dictionaries themselves. For example, if dict2 is anchored in dict1 and pos2 is within the thread block of dict2, then if pos1 in dict1 is greater than the anchor TextIndex of dict2 then this method will return kIsAfter.

Parameters
dict1UID of first dictionary
pos1TextIndex within the first dictionary's thread block
dict2UID of second dictionary, may be the same as the first
pos2TextIndex within the second dictionary's thread block
Returns
CompareResult
virtual void ITextStoryThreadDictHier::Insert (UID dictUID)
pure virtual

Insert the boss implementing ITextStoryThreadDict into the hierarchy.

Parameters
dictUIDUID of the boss
virtual UID ITextStoryThreadDictHier::NextUID (UID dictUID) const
pure virtual

This method aids in determing the neighboring boss within the hierchy. This is done by flattening the hierarchy and returning the next boss relative to the specified one. One use of this method is in determing where the thread block range for the dictionary is to be located. This can be accomplished as follows:

InterfacePtr<const ITextStoryThreadDictHier> dictHier(myTextModel, UseDefaultIID());

const UID nextDictUID = dictHier->NextUID(myDictUID);

if (nextDictUID.IsValid())

{

   InterfacePtr<const ITextStoryThreadDict> nextDict(::GetDataBase(myTextModel), nextDictUID, UseDefaultIID());

   retIndex = nextDict->GetThreadBlockTextRange().GetStart();

}

else

{

   // no next, so we use the end of the TextModel.

   retIndex = myTextModel->TotalLength();

}

Parameters
dictUIDUID of the boss you wish to find the next boss of
Returns
UID of the next boss in the hierarchy, or kInvalidUID if no bosses follow.
virtual void ITextStoryThreadDictHier::Remove (UID dictUID)
pure virtual

Insert the boss implementing ITextStoryThreadDict into the hierarchy.

Parameters
dictUIDUID of the boss