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

#include <ITextRangeItem.h>

Inheritance diagram for ITextRangeItem:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ITEXTRANGEITEM }
 

Public Member Functions

virtual ICommandQueryRemoveFromDocumentCmd () const =0
 
virtual ITextModelMementoQueryMemento () const =0
 
virtual void SetRangeReference (TextRangeReference reference)=0
 
virtual bool16 CanReturnIScript () const =0
 
virtual IScriptQueryIScript () const =0
 
virtual void Rebuilt (ITextModel *textModel, IParcelList *pl, const IWaxLine *waxLine, IWaxRun *waxRun, const RangeData &textRangeItemRange, TextIndex waxLineTextIndex)=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

ITextRangeItem needs to be implemented by any object tracked by text range strand.

This interface is used by the text range strand to communicate information between the small boss range object with the real text object occupying the range during text operations, such as copy/paste.

Member Function Documentation

virtual bool16 ITextRangeItem::CanReturnIScript () const
pure virtual

The range item is asked it supports Scripting - the object itself does not have to have an IScript, just that it will return an object that does if asked.

Returns
kTrue if the range item can return an object with an IScript interfaces, kFalse otherwise.
virtual IScript* ITextRangeItem::QueryIScript () const
pure virtual

The range item is asked to return an object associated with it that supports scripting. The range item does not necessarily have to have an IScript to do this - just that it returns something asked.

Returns
Pointer to boss with IScript interface
virtual ITextModelMemento* ITextRangeItem::QueryMemento () const
pure virtual

The ITextModelMomento provides a mechanism for the ITextModel to notify the associated object about changes to the model that affect the object.

Returns
Pointer to Memento for this object.
virtual ICommand* ITextRangeItem::QueryRemoveFromDocumentCmd () const
pure virtual

When the ITextModel which the ITextRangeItem is anchored in is being deleted it will query the ITextRangeItems via this method for Command to remove it from the document. At the time the returned command is executed the ITextModel will be in an indeterminate state and so it must not access it in any way. Further, this command should NOT remove any Text (ITextStoryThreads, etc) in the same ITextModel as a result of this operation - the entire ITextModel is processed at this time and anything in those ITextStoryThreads will be found. In addition, callees are NOT required to return a command.

Returns
Pointer to remove from document command
virtual void ITextRangeItem::Rebuilt (ITextModeltextModel,
IParcelListpl,
const IWaxLinewaxLine,
IWaxRunwaxRun,
const RangeDatatextRangeItemRange,
TextIndex waxLineTextIndex 
)
pure virtual

This method is called when WaxRuns are rebuilt for the specied WaxLine and the ITextRangeItem span intersects the text range of the WaxRun. Implementations may find this useful to attach TextAdornments at this time. Note that more than one ITextRangeItem may intersect the same WaxRun text range is implementations must give some thought to how they avoid collisions for the same type of ITextRangeItem.

Parameters
textModelThe ITextModel containing the IOwnedItem
plIParcelList of the TextStoryThread containing the IWaxLine
waxLineThe IWaxLine containing the IOwnedItem
waxRunThe IWaxRun containing the IOwnedItem
textRangeItemRangeRangeData of the TextRangeItem. May be beyond the start/end of the WaxRun or WaxLine
waxLineTextIndexThe TextIndex of the IWaxLine