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

#include <ITextStoryThreadDict.h>

Inheritance diagram for ITextStoryThreadDict:
IPMUnknownCPMUnknown< ITextStoryThreadDict >HidTxtStoryThreadDict

Public Types

enum  { kDefaultIID = IID_ITEXTSTORYTHREADDICT }
 

Public Member Functions

virtual ITextStoryThreadQueryThread (uint32 key) const =0
 
virtual Text::StoryRange GetAnchorTextRange (bool16 *wasAnchored=nil) const =0
 
virtual Text::StoryRange GetThreadBlockTextRange () const =0
 
virtual uint32 GetFirstKey ()=0
 
virtual uint32 GetNextKey ()=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 ITextStoryThreadDict is responsible for managing one or more ITextStoryThreads within a given ITextModel. All the ITextStoryThreads managed by a single dictionary are stored contiguously within the ITextModel.

All ITextStoryThreads managed in this way share the same dictionar (see ITextStoryThread::GetDictUID()) but are uniquely identified within the managing dictionary by a uint32 whose mapping is defined only the dictionary.

The key value is expected to be the same throughout the life of the ITextStoryThread. The addition or removal of other ITextStoryThreads in the same dictionary must change the keys of the remaining ITextStoryThreads.

A ITextStoryThreadDict can be anchored or not. Examples of dictionaries which are anchored are Notes, Tables and Footnotes. Examples of unanchored dictionaries are Text Macros. All unanchored dictionaries should return an anchor position of the last carriage return of the primary story thread.

Every ITextModel boss implements an ITextStoryThreadDict which is responsible for managing the primary story thread. This dictionary is not anchored with its thread block text range starting at zero and ending at the end of the primary story thread. Unlike all other unanchored dictionaries, this dictionary returns an anchor position of zero.

The location of the dictionary's thread block is determined by the location of the dictionary's anchor relative to other dictionaries in the same and other thread blocks. Determining this relative location is the job of the ITextStoryThreadDictHier.

See Also
ITextStoryThreadDictHier
ITextStoryThread
ITextModel

Member Function Documentation

virtual Text::StoryRange ITextStoryThreadDict::GetAnchorTextRange (bool16 * wasAnchored = nil) const
pure virtual

Returns the current StoryRange where the dictionary is anchored into the ITextModel. Implementations that are not anchored should return the TextIndex of the last carriage return in the primary story thread. The ITextModel, which implements the primary story thread, will return an anchor position of zero.

Parameters
wasAnchoredOptional parameter which will be set to kTrue if the dictionary is anchored, kFalse otherwise.
Returns
StoryRange where the dictionary is anchored in the ITextModel.

Implemented in HidTxtStoryThreadDict.

virtual uint32 ITextStoryThreadDict::GetFirstKey ()
pure virtual

When whole ITextStoryThreads are pasted into the ITextModel the StoryThread Strand provides a hook to allow these ITextStoryThreads to switch owners. This occurs, for example, if the ITextStoryThreads from one table were deleted and pasted into a different table. The assumption is that the manager of this operation will ensure that reference conversion occurs on the UIDs in the ITextStoryThreads but there is no way to fix up the Keys. The iteration that is implied by this operation is setup by the code managing the copy and the StoryThread Strand will call GetFirstKey() on the first ITextStoryThread pasted and then will call GetNextKey() repeatedly for each remaining ITextStoryThread copied.

Returns
The first key for the converting range.

Implemented in HidTxtStoryThreadDict.

virtual uint32 ITextStoryThreadDict::GetNextKey ()
pure virtual

Returns the next key during the paste operation.

Returns
The first key for the converting range.

Implemented in HidTxtStoryThreadDict.

virtual Text::StoryRange ITextStoryThreadDict::GetThreadBlockTextRange () const
pure virtual

Returns the current StoryRange where the dictionary maintains its block of ITextStoryThreads. Although unusual, a dictionary which does not currently have any ITextStoryThreads in the ITextmodel must return StoryRange(kInvalidTextIndex, kInvalidTextIndex).

Returns
StoryRange of text spanned by the threads of the dictionary

Implemented in HidTxtStoryThreadDict.

virtual ITextStoryThread* ITextStoryThreadDict::QueryThread (uint32 key) const
pure virtual

Instantiate the ITextStoryThread with the given key.

Parameters
keyPrivate unique key that identifies which ITextStoryThread to instantiate
Returns
Pointer to ITextStoryThread

Implemented in HidTxtStoryThreadDict.