#include <ITextStoryThreadDictHier.h>
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
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) |
| 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
| dict1 | UID of first dictionary |
| pos1 | TextIndex within the first dictionary's thread block |
| dict2 | UID of second dictionary, may be the same as the first |
| pos2 | TextIndex within the second dictionary's thread block |
- Returns
- CompareResult
| virtual void ITextStoryThreadDictHier::Insert | ( | UID | dictUID | ) | |
| pure virtual |
| 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
| dictUID | UID 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 |