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

#include <ITextRun.h>

Inheritance diagram for ITextRun:
IPMUnknown

Public Member Functions

virtual void InitializeForDraw ()=0
 
virtual bool16 IsVisible (const RunDescription &description)=0
 
virtual bool16 DrawsText ()=0
 
virtual bool16 GetRunThreadData (const RunDescription &description, ITextModel *primaryTextModel, UID &threadDictUID, uint32 &threadDictKey, TextIndex &threadStart, int32 &threadSpan)=0
 
virtual PMReal DrawRun (IGraphicsPort *gPort, int32 at, const RunDescription &description, PMRect &runRect, const PMPoint &textDrawPt, int32 runDrawLength, int32 runIndex, bool16 showInvisibles, const PMRect &highlightRect)=0
 
virtual void DrawHilite (int32 at, IGraphicsPort *gPort, const PMPoint &scrollCompensationValue)=0
 
virtual void DrawHilite (const TextIndex textModelStart, const TextIndex textModelEnd)=0
 
virtual void DrawRunOverlap (IGraphicsPort *gPort, int32 at, const RunDescription &description, PMRect &runRect, int32 runIndex)=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

ITextRun is an interface that is used to draw individual run types. There are run types for track change text, inline note text, footnote text, inline note begin/end markers and footnote begin/end markers. Regular text is drawn directly in the implementation of ITextRuns so there is no ITextRun implementation for that. More types may be added later. There is no way for a 3rd party to add a new type of runtype currently. There is not a separate instance of this for each run rather one per run type. Data on each individual run is passed in.

Member Function Documentation

virtual void ITextRun::DrawHilite (int32 at,
IGraphicsPortgPort,
const PMPointscrollCompensationValue 
)
pure virtual

Called at line draw time to draw the text highlight and is a good place to also draw any custom run background color.

Parameters
at- index of line to highlight
gPort- port to highlight in
scrollCompensationValue- what is the current scroll value for the view
Returns
none
virtual void ITextRun::DrawHilite (const TextIndex textModelStart,
const TextIndex textModelEnd 
)
pure virtual

Draw highlight for a specific range of text corresponding to a text run.

Parameters
textModelStart- index to start drawing highlight at in text model indices
textModelEnd- index to end drawing highlight at in text model indices
Returns
none
virtual PMReal ITextRun::DrawRun (IGraphicsPortgPort,
int32 at,
const RunDescriptiondescription,
PMRectrunRect,
const PMPointtextDrawPt,
int32 runDrawLength,
int32 runIndex,
bool16 showInvisibles,
const PMRecthighlightRect 
)
pure virtual

Given a run description and some information about the port and where and how to draw the run this routine will draw it.

Parameters
gPort- port to draw into
at- index of line the run lives in
description- description of the specific run to draw
runRect- bounds of the run can be altered by this routine to match width actually drawn
textDrawPt- position to start drawing text associated with this run
runDrawLength- how many characters is this run passed in
runIndex- what is the index of the run within the line, passed in.
showInvisibles- visibly show white space characters, passed in
highlightRect- the currently highlighted area rect within a single line. Use to determine background fill rect for the run.
Returns
width of run drawn
virtual void ITextRun::DrawRunOverlap (IGraphicsPortgPort,
int32 at,
const RunDescriptiondescription,
PMRectrunRect,
int32 runIndex 
)
pure virtual

This is used to draw the overlapping portion of runs that draw inbetween two lines. For instance footnotes and inline notes draw a border line inbetween two lines that must occasionally be refreshed when the line next to it gets erased but the line that this line lives in does not.

Parameters
gPort- port to draw into
at- index of line this run lives in
description- information about the run to draw the overlap for
runRect- bounds to draw into
runIndex- index of run with in the line.
Returns
none
virtual bool16 ITextRun::DrawsText ()
pure virtual

Answers the question of whether this run type draws text

Returns
kTrue if this draws text (as opposed to a marker or tag with no text associated)
virtual bool16 ITextRun::GetRunThreadData (const RunDescriptiondescription,
ITextModelprimaryTextModel,
UIDthreadDictUID,
uint32 & threadDictKey,
TextIndex & threadStart,
int32 & threadSpan 
)
pure virtual

Implementation of this will return information about the story thread associated with this run type

Parameters
description- passed in describes the specific run instance in the text that thread information is going to be returned for
primaryTextModel- passed in what text model does this run live in
threadDictUID- returns the dict UID for the story thread (see ITextModel)
threadDictKey- returns the threadDictKey for the story thread (see ITextModel)
threadStart- returns the start text Index of the story thread associated with the run passed in via description param
threadSpan- returns the span of the story thread associated with the run passed in via description param
Returns
kTrue if able to return data for the description passed in.
virtual void ITextRun::InitializeForDraw ()
pure virtual

Called at the beginning of each draw of a line to initialize run data if desired

Returns
none.
virtual bool16 ITextRun::IsVisible (const RunDescriptiondescription)
pure virtual

Answers the question of whether this run is currently displayed

Parameters
description- what is the information about this run passed in by TextRuns implementation
Returns
a RunDescription