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

#include <ITextLines.h>

Inheritance diagram for ITextLines:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ITEXTLINES }
 
enum  LinesType { kLayoutLineEnds = 0, kWindowLineEnds }
 
enum  ExtendType { kDontExtend = 0, kExtendLeft, kExtendRight }
 

Public Member Functions

virtual LinesType GetLinesType ()=0
 
virtual void SetLinesType (LinesType lType)=0
 
virtual void UpdateFontInfo (const PMString *fontName, bool16 initializeLines)=0
 
virtual void UpdateLeading ()=0
 
virtual PMStringGetDisplayFontName (IFontMgr::FontStyleBits styleBits=IFontMgr::kNormal)=0
 
virtual PMReal GetDisplayFontSize (IDrawingStyle::CapitalizeMode capMode=IDrawingStyle::kCapNormal)=0
 
virtual PMReal GetLineHeight (bool16 textOnly=kFalse)=0
 
virtual IFontInstanceQueryDisplayFontInstance (IFontMgr::FontStyleBits styleBits, IDrawingStyle::CapitalizeMode capMode)=0
 
virtual bool16 ComposeLayout ()=0
 
virtual void SetComposeLayout (bool16 shouldCompose)=0
 
virtual TextIndex GetLineStartOffsetAtLine (int32 at)=0
 
virtual TextIndex GetLineEndOffsetAtLine (int32 at)=0
 
virtual PMReal GetYPosition (int32 at)=0
 
virtual PMReal GetYPosition (int32 storyIndex, int32 at)=0
 
virtual PMReal GetXPosition (int32 at)=0
 
virtual PMRect CalculateLineRect (int32 at)=0
 
virtual PMRect CalculateLineRect (int32 storyIndex, int32 at)=0
 
virtual const LineDescription GetLine (int32 at, bool16 returnRuns=kFalse)=0
 
virtual const LineDescription GetLine (int32 storyIndex, int32 at, bool16 returnRuns)=0
 
virtual void InitializeLines (const K2Vector< ComposeInformation > &composeInformation, bool16 forceInitialization=kFalse, bool16 scrollARangeIntoView=kFalse)=0
 
virtual void AppendLine (const LineDescription &line, bool16 autoScroll=kTrue)=0
 
virtual bool16 InsertLine (int32 beforeIndex, const LineDescription &line, bool16 autoScroll=kTrue)=0
 
virtual bool16 DeleteLine (int32 at)=0
 
virtual void DeleteAllLines ()=0
 
virtual bool16 ReplaceLine (int32 at, const LineDescription &line)=0
 
virtual bool16 AddFrameDivider (IWaxLine *waxLine, int32 at, const PMPoint &atPosition, UID previousLineFrameUID, bool16 isFrontMost)=0
 
virtual void AddLineFromLayoutLine (IWaxLine *waxLine, int32 at, const PMPoint &atPosition, int32 lineNumber, uint32 lineID, bool16 isFrontMost)=0
 
virtual void RemoveExcessLines (int32 startIndex, bool16 isFrontMost, bool16 autoScroll=kTrue)=0
 
virtual void UpdateLine (int32 at)=0
 
virtual void UpdateLine (int32 storyIndex, int32 at)=0
 
virtual void SetLastValidIndex (int32 index)=0
 
virtual int32 GetLastValidIndex ()=0
 
virtual int32 GetLastValidIndex (int32 storyIndex)=0
 
virtual int32 GetLastLineIndex ()=0
 
virtual int32 GetLastLineIndex (int32 storyIndex)=0
 
virtual int32 GetFirstTrueTextLineIndex ()=0
 
virtual int32 GetFirstTrueTextLineIndex (int32 storyIndex)=0
 
virtual void DeleteCacheForAllLines ()=0
 
virtual void SyncScrolling (bool16 lockRelativePosition=kFalse, bool16 scrollToASelectionRange=kFalse)=0
 
virtual bool16 SetUniqueIDOfLine (int32 at, uint32 newID)=0
 
virtual int32 FindIndexOfLineWithID (uint32 id)=0
 
virtual int32 FindIndexOfLineWithID (int32 storyIndex, uint32 id)=0
 
virtual int32 FindIndexOfLineAtTextOffset (TextIndex offset, int32 &offsetIntoLine, RangeData::Lean lean, bool16 checkRunBoundary=kFalse)=0
 
virtual int32 FindIndexOfLineAtDisplayOffset (TextIndex offset, int32 &offsetIntoLine, RangeData::Lean lean)=0
 
virtual int32 FindIndexOfLineAtDisplayOffset (int32 storyIndex, TextIndex offset, int32 &offsetIntoLine, RangeData::Lean lean)=0
 
virtual void DisplayRangeToLineIndices (int32 storyIndex, const RangeData &range, int32 *low, int32 *high)=0
 
virtual int32 FindIndexOfLineAtPoint (const PMPoint &point)=0
 
virtual int32 FindIndexOfLineAtPoint (int32 storyIndex, const PMPoint &point)=0
 
virtual PMReal GetXPositionOfDisplayOffsetCharacter (int32 atLineIndex, int32 displayOffsetIntoLine)=0
 
virtual PMReal GetXPositionOfDisplayOffsetCharacter (int32 storyIndex, int32 atLineIndex, int32 displayOffsetIntoLine)=0
 
virtual PMReal GetXPositionOfCharacter (int32 atLineIndex, int32 characterOffsetIntoLine, TextIndex absoluteTextOffset=-1, bool16 isEndPosition=kFalse, ExtendType extend=kDontExtend, TextIndex absoluteTextEndOffset=-1)=0
 
virtual PMReal GetXPositionOfCharacterInRun (int32 atLineIndex, int32 runIndex, int32 characterOffsetIntoRun)=0
 
virtual bool16 FindCharacterAtXPosition (int32 atLineIndex, PMReal &xPosition, int32 &offsetIntoLine)=0
 
virtual PMReal HitTestText (int32 storyIndex, int32 *lineIndex, const PMPoint &x, TextIndex *nextLine)=0
 
virtual int32 GetIndexOfFirstLineInRect (PMRect rectToFit, bool16 partialFitOK=kTrue)=0
 
virtual void SetHilite (TextIndex start, TextIndex end, bool16 drawHilite=kTrue, UID extendToDeletedUID=kInvalidUID)=0
 
virtual void SetHilite (const RangeData &range, bool16 drawHilite=kTrue, UID extendToDeletedUID=kInvalidUID)=0
 
virtual void GetHilite (TextIndex &start, TextIndex &end, SelectionExtension *extendToDeletedUIDs=nil)=0
 
virtual void DrawTextHighlight (const InDesign::TextRange &newSelection, const InDesign::TextRange &oldSelection, SelectionExtension *newExtension=nil, SelectionExtension *oldExtension=nil)=0
 
virtual bool16 DrawLine (int32 at, IGraphicsPort *gPort, const PMRect &clipRect, const PMPoint &scrollCompensationValue, IPMFont *displayFont, PMReal displaySize, bool16 topLineInDraw)=0
 
virtual void InvalidateLine (int32 at, bool16 isFrontMost=kFalse)=0
 
virtual void InvalidateRun (int32 at, int32 whichRun, TextIndex startOffsetInRun, TextIndex endOffsetInRun, bool16 isFrontMost=kFalse)=0
 
virtual void ClearPendingInvalRect ()=0
 
virtual void AddToPendingInvalRect (const PMRect &rectToAdd)=0
 
virtual PMRect GetPendingInvalRect ()=0
 
virtual void PlayPendingInvals (bool16 instantDraw=kFalse)=0
 
virtual void SuspendPlayPendingInvals ()=0
 
virtual void ResumePlayPendingInvals ()=0
 
virtual bool16 GetPlayPendingInvals () const =0
 
virtual void RecordUndoRedoPendingInvals (const PMRect &invals)=0
 
virtual PMRectGetPendingInvalsForUndoRedo ()=0
 
virtual int32 GetPages (PMRect rectToFit, int32 columns)=0
 
virtual void SetRanges (PMString ranges)=0
 
virtual void GetLineNumberStartEnd (int32 &start, int32 &end)=0
 
virtual void InitializeStoryCollapsedState (K2Vector< StoryState > &storyList)=0
 
virtual TextIndex ModelOffsetToDisplayOffset (TextIndex modelOffset, int32 lineIndex, bool16 ignoreRunTypes=kFalse)=0
 
virtual TextIndex ModelIndexToDisplayIndex (TextIndex modelIndex)=0
 
virtual TextIndex ModelIndexToDisplayIndex (int32 storyIndex, TextIndex modelIndex)=0
 
virtual TextIndex DisplayIndexToModelIndex (TextIndex displayIndex)=0
 
virtual TextIndex DisplayIndexToModelIndex (int32 storyIndex, TextIndex displayIndex)=0
 
virtual void SetCurrentStoryIndex (int32 i)=0
 
virtual int32 GetCurrentStoryIndex ()=0
 
virtual int32 GetStoryCount ()=0
 
virtual UIDListGetStoryRefList ()=0
 
virtual int32 FindIndexOfStoryAtYPosition (PMReal yPosition, bool16 ExtendLastLineOfLastStoryDown=kFalse)=0
 
virtual const UIDRefGetStoryRef (int32 storyIndex)=0
 
virtual void SetStoryRef (const UIDRef &ref, int32 storyIndex)=0
 
virtual PMReal GetStoryYDrawStart (int32 storyIndex) const =0
 
virtual void SetStoryYDrawStart (PMReal yStartPosition, int32 storyIndex)=0
 
virtual bool16 IsStoryCollapsed (int32 storyIndex)=0
 
virtual void SetStoryCollapseState (const K2Vector< int32 > &storyIndexes, bool16 collapse)=0
 
virtual bool16 IsStoryBarSelected (int32 storyIndex)=0
 
virtual void SetStoryBarSelected (int32 storyIndex, bool16 selected)=0
 
virtual void RemoveAllStories ()=0
 
virtual bool8 GetUseTextRuns ()=0
 
virtual void DrawTextDisplayHighlight (int32 storyIndex, const RangeData &newRange, const RangeData &oldRange)=0
 
virtual TextIndex DisplayIndexToModelIndex_ (int32 storyIndex, TextIndex displayIndex)=0
 
virtual RangeData ModelToDisplayRange (int32 storyIndex, const RangeData &modelRange, UID leftExtra, UID rightExtra)=0
 
virtual RangeData DisplayToModelRange (int32 storyIndex, const RangeData &displayRange, UID *leftExtra, UID *rightExtra)=0
 
virtual RangeData AtomicRange (int32 storyIndex, RangeData caret, const RangeData &relativeTo)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Friends

class StoryManager
 

Detailed Description

The textlines are what defines what characters are in each line of the display on the screen. These are roughly equivalent to the WaxLines in the layout view. This interface owns all line information for the galley and story views. There are methods present in this interface for getting and setting of line information. Normally, non-internal callers will be interested in getting information only. The setting is generally left up the an interaction between this interface an the IQuickComposer interface. The methods are divided up into several sections... Global Attributes - like display font LineDescription Access - methods to get information about a specific line Line Maintenance - Methods used to modify lines (delete or add or recompose all). Also, there are methods to inform callers how many lines there are. Searching - Methods to search through lines and find one of interest based on textIndexes mostly. Text Display - Methods to display lines on screen. View Invaliing - Methods to cause parts of view corresponding to lines to redraw. Printing - mostly internal use for changes to drawing that occur when printing. Text Offset Type Conversion - story/galley uses two different types of text indices (Display and Model). The model indices match the indices in the ITextModel while the display indices match the order that text is actually displayed on the screen in galley/story. The methods in this section aid in the conversion between the two types. Story Management - methods that deal with the management of multiple stories in a single view. All the stories text lines that are displayed in a single view are owned by a single instance of the ITextLines interface. That is to say there is one instance of this interface for each story/galley view no matter how many stories are displayed in the view. The methods in the story management section help get access to each individual stories text lines.

Notes: For routines that do not take a storyIndex it is assumed that the operation will apply to the currently active story. See the methods GetCurrentStoryIndex() and SetCurrentStoryIndex(). InCopy can have more than one story active in a view. InDesign has a one per view approach.

Member Function Documentation

virtual bool16 ITextLines::AddFrameDivider (IWaxLinewaxLine,
int32 at,
const PMPointatPosition,
UID previousLineFrameUID,
bool16 isFrontMost 
)
pure virtual

This should typically only be used internally. This is used in galley view only (not story) to add the frame and column dividers. This items are actually lines of a specific type. This routine actually decides whether it's should add a divider or not base on the parameters passed in.

Parameters
waxLinelayout wax line information for the line that is after the potential frame divider.
atindex where the divider might be added before.
atPositionthe x position relative to the left side of the view to add the frame divider.
previousLineFrameUIDuid of the frame of the wax line before this line.
isFrontMostif view is front most then draw will occur right away otherwise it will simply invalidate and draw later.
Returns
kTrue if divider was added kFalse otherwise.
virtual void ITextLines::AddLineFromLayoutLine (IWaxLinewaxLine,
int32 at,
const PMPointatPosition,
int32 lineNumber,
uint32 lineID,
bool16 isFrontMost 
)
pure virtual

This should typically only be used internally. Used to create a matching galley line from a layout wax line. Not used in story view.

Parameters
waxLinelayout wax line information to create a matching galley line for.
atindex of galley line.
atPositionthe x position relative to the left side of the view to add the frame divider.
lineNumberused to display in the info column multiple galley lines may map to one waxline because galley lines also wrap at view edge.
lineIDa matching id is stored with the waxline.
isFrontMostif view is front most then draw will occur right away otherwise it will simply invalidate and draw later.
Returns
none.
virtual void ITextLines::AddToPendingInvalRect (const PMRectrectToAdd)
pure virtual

Internal use only. Stores rectanglar area to redraw when window is frontmost which draws sooner than a system inval would.

Parameters
rectToAdd
Returns
none
virtual void ITextLines::AppendLine (const LineDescriptionline,
bool16 autoScroll = kTrue 
)
pure virtual

Warning: This should typically only be used internally. The composer will call this to append new lines of text to the view.

Parameters
linedescription of the line to append
autoScrollshould the view scroll to the current text cursor location after appending the line.
Returns
none.
virtual RangeData ITextLines::AtomicRange (int32 storyIndex,
RangeData caret,
const RangeDatarelativeTo 
)
pure virtual

For a given caret position return an atomic range surrounding it (internal use)

Parameters
storyIndexindex of story to operate on
caretmodel index
relativeToextra data for internal use.
Returns
the atomic range
virtual PMRect ITextLines::CalculateLineRect (int32 at)
pure virtual

Get a rectangle describing a line bounds. The rectangle is described in local coordinates of the view.

Parameters
atindex of line.
Returns
a PMRect which describes the line. The rectangles right side will actually be a very large number not the width of the line. If the true line width is desired get the LineDescription and check the width field.
virtual PMRect ITextLines::CalculateLineRect (int32 storyIndex,
int32 at 
)
pure virtual

Get a rectangle describing a line bounds. The rectangle is described in local coordinates of the writingview

Parameters
storyIndexindex of story to get line from
atindex of line.
Returns
a PMRect which describes the line. The rectangles right side will actually be a very large number not the width of the line. If the true line width is desired get the LineDescription and check the width field.
virtual void ITextLines::ClearPendingInvalRect ()
pure virtual

Internal use only

Returns
none
virtual bool16 ITextLines::ComposeLayout ()
pure virtual

Deprecated (don't use won't do anything)

virtual void ITextLines::DeleteAllLines ()
pure virtual

This should typically only be used internally. The composer will call this to remove all lines from the view.

Returns
none.
virtual void ITextLines::DeleteCacheForAllLines ()
pure virtual

Internal use only

Returns
none.
virtual bool16 ITextLines::DeleteLine (int32 at)
pure virtual

This should typically only be used internally. The composer will call this to remove unneeded lines from the view.

Parameters
atindex of the line to remove.
Returns
kTrue if the line was removed successfully kFalse otherwise.
virtual TextIndex ITextLines::DisplayIndexToModelIndex (TextIndex displayIndex)
pure virtual

Convert a display text index to a model text index

Parameters
displayIndexindex to convert
Returns
model index corresponding to given display index.
virtual TextIndex ITextLines::DisplayIndexToModelIndex (int32 storyIndex,
TextIndex displayIndex 
)
pure virtual

Convert a display text index to a model text index

Parameters
storyIndexindex of story to use for conversion
displayIndexindex to convert
Returns
model index corresponding to given display index.
virtual TextIndex ITextLines::DisplayIndexToModelIndex_ (int32 storyIndex,
TextIndex displayIndex 
)
pure virtual

Convert a display index to a model index

Parameters
storyIndexindex of story to operate on
displayIndexdisplay index to convert
Returns
corresponding model index
virtual void ITextLines::DisplayRangeToLineIndices (int32 storyIndex,
const RangeDatarange,
int32 * low,
int32 * high 
)
pure virtual

Finds the corresponding line indeces for a given text index range.

Parameters
storyIndexto use to get the lines from the range
rangefind lines corresponding to this text range
lowfirst line with a value in the given range (returned to caller)
highlast line with a value in the given range (returned to caller)
Returns
none
virtual RangeData ITextLines::DisplayToModelRange (int32 storyIndex,
const RangeDatadisplayRange,
UIDleftExtra,
UIDrightExtra 
)
pure virtual

Convert a display range to a model index range

Parameters
storyIndexindex of story to operate on
displayRangedisplay index range to convert
leftExtraexternal callers may ignore.
rightExtraexternal callers may ignore.
Returns
corresponding model index range
virtual bool16 ITextLines::DrawLine (int32 at,
IGraphicsPortgPort,
const PMRectclipRect,
const PMPointscrollCompensationValue,
IPMFontdisplayFont,
PMReal displaySize,
bool16 topLineInDraw 
)
pure virtual

Draws a line to the view

Parameters
atindex of line to draw
gPortgraphics port to draw in
clipRectrectangle to clip drawing to
scrollCompensationValuevalue we are to within the view.
displayFontfont to display main text of line in may be overridden for special run types or missing glyphs
displaySizesize to display text of line at.
topLineInDrawis this the first line draw for this round of drawing. Pass kFalse if not sure
Returns
bool16 return kTrue if the line was draw otherwise kFalse (won't draw if does fall within clipRect)
virtual void ITextLines::DrawTextDisplayHighlight (int32 storyIndex,
const RangeDatanewRange,
const RangeDataoldRange 
)
pure virtual

Draw a highlight range while erasing previous range. Called internally to match selection state.

Parameters
storyIndexindex of story to operate on
newRangerange to select (highlight)
oldRangerange to deselect (unhighlight)
Returns
none
virtual void ITextLines::DrawTextHighlight (const InDesign::TextRangenewSelection,
const InDesign::TextRangeoldSelection,
SelectionExtensionnewExtension = nil,
SelectionExtensionoldExtension = nil 
)
pure virtual

Method to draw a text highlight in the story/galley views. Should be called from the selection hiliter (BaseTextSelectionHiliter) shouldn't call from other places doing so can cause highlight draws to occur.

Parameters
newSelectionNew selection range to draw
oldSelectionOld selection range to erase
newExtensionNew selection extension uids to draw
oldExtensionOld selection extension uids to erase
Returns
void
virtual bool16 ITextLines::FindCharacterAtXPosition (int32 atLineIndex,
PMRealxPosition,
int32 & offsetIntoLine 
)
pure virtual

Find a character at a given x (horizontal from view left) draw position

Parameters
atLineIndexline index within the current story
xPositionhorizontal postion (from view left)
offsetIntoLinegives the offset (index) within of the line of the hit character.
Returns
see note description below. The return value means the following: kFalse - everything went normally. All the values are accurate kTrue - The xPosition was past the end of line offsetIntoLine will contain the first character on the next line xPosition will contain the very end of the current line
virtual int32 ITextLines::FindIndexOfLineAtDisplayOffset (TextIndex offset,
int32 & offsetIntoLine,
RangeData::Lean lean 
)
pure virtual

Finds the line and the offset into the line of the display index requested.

Parameters
offsettext index to search for in the text lines
offsetIntoLinewill contain the number of characters into the line the display index falls at.
leanfor cases where the text index falls between two lines this param will facilitate the choice the method will make. LeanBack use first line while LeanForward will use the second
Returns
returns index of line that the given display index (offset param) falls in or if none found then -1
virtual int32 ITextLines::FindIndexOfLineAtDisplayOffset (int32 storyIndex,
TextIndex offset,
int32 & offsetIntoLine,
RangeData::Lean lean 
)
pure virtual

Finds the line and the offset into the line of the display index requested.

Parameters
storyIndexsearch in this story for the display index
offsettext index to search for in the text lines
offsetIntoLinewill contain the number of characters into the line the display index falls at.
leanfor cases where the text index falls between two lines this param will facilitate the choice the method will make. LeanBack use first line while LeanForward will use the second
Returns
returns index of line that the given display index (offset param) falls in or if none found then -1
virtual int32 ITextLines::FindIndexOfLineAtPoint (const PMPointpoint)
pure virtual

Given a coordinate in the view give the index of a line at this coordinate

Parameters
pointcoordinate to find line at
Returns
index of line at the given coordinate if none can be found then -1
virtual int32 ITextLines::FindIndexOfLineAtPoint (int32 storyIndex,
const PMPointpoint 
)
pure virtual

Given a coordinate in the view give the index of a line at this coordinate

Parameters
pointcoordinate to find line at
Returns
index of line at the given coordinate if none can be found then -1
virtual int32 ITextLines::FindIndexOfLineAtTextOffset (TextIndex offset,
int32 & offsetIntoLine,
RangeData::Lean lean,
bool16 checkRunBoundary = kFalse 
)
pure virtual

Finds the line and the offset into the line of the text index requested.

Parameters
offsettext index to search for in the text lines
offsetIntoLinewill contain the number of characters into the line the text index falls at.
leanfor cases where the text index falls between two lines this param will facilitate the choice the method will make. LeanBack use first line while LeanForward will use the second
checkRunBoundaryif true then for deleted text if the offset is at the start of deleted text make sure we get the first line not the line at the end of the deleted text run.
Returns
returns index of line that the given text index (offset param) falls in or if none found then -1
virtual int32 ITextLines::FindIndexOfLineWithID (uint32 id)
pure virtual

Return an index of a line with a specific id.

Parameters
idsearch the text lines for an id that matches this
Returns
returns index of line with matching id or -1 if none is found.
virtual int32 ITextLines::FindIndexOfLineWithID (int32 storyIndex,
uint32 id 
)
pure virtual

Return an index of a line with a specific id.

Parameters
storyIndexindex of the story to search in.
idsearch the text lines for an id that matches this
Returns
returns index of line with matching id or -1 if none is found.
virtual int32 ITextLines::FindIndexOfStoryAtYPosition (PMReal yPosition,
bool16 ExtendLastLineOfLastStoryDown = kFalse 
)
pure virtual

Find the index of a story at a given y view position

Parameters
yPositionthe y view position
ExtendLastLineOfStoryDowncount area below the last line of the story as belonging to the last story
Returns
index of story at the given yPosition (may be -1 if none found)
virtual int32 ITextLines::GetCurrentStoryIndex ()
pure virtual

Index of currently active story

Returns
index of active story
virtual PMString& ITextLines::GetDisplayFontName (IFontMgr::FontStyleBits styleBits = IFontMgr::kNormal)
pure virtual

Can be used to find out the name of the display font.

Parameters
styleBitsthe font variant type (see IFontMgr).
Returns
The display font name.
virtual PMReal ITextLines::GetDisplayFontSize (IDrawingStyle::CapitalizeMode capMode = IDrawingStyle::kCapNormal)
pure virtual

Get the point size of the display font.

Parameters
styleBitsthe font variant type (see IFontMgr).
Returns
The point size.
virtual int32 ITextLines::GetFirstTrueTextLineIndex ()
pure virtual

Index of first line that actually might hold text as opposed to a storyBar or other decoration

Returns
index of the first line with text in it.
virtual int32 ITextLines::GetFirstTrueTextLineIndex (int32 storyIndex)
pure virtual

Index of first line that actually might hold text as opposed to a storyBar or other decoration

Parameters
storyIndexindex of story to get first valid index of.
Returns
index of the first line with text in it.
virtual void ITextLines::GetHilite (TextIndex & start,
TextIndex & end,
SelectionExtensionextendToDeletedUIDs = nil 
)
pure virtual

Method to get the current text highlight information. It really just returns the current selection information

Parameters
startthe beginning of the current text selection
endthe end of the current text selection
extendToUIDPaircurrent uids for track change deleted text selection.
Returns
kTrue if selection was set.
virtual int32 ITextLines::GetIndexOfFirstLineInRect (PMRect rectToFit,
bool16 partialFitOK = kTrue 
)
pure virtual

Get first line that intersects the rectangle. This is a quick routine it uses a estimation to get close first then zeros in on the first line from there.

Parameters
rectToFitrectangle to check for a intersecting line
partialFitOKok to return a line that doesn't totally fall within a rectagle
Returns
index of line that first intersects a rectangle (first means starting at text index 0 and incrementing up).
virtual int32 ITextLines::GetLastLineIndex ()
pure virtual

Return the index of the last line in the current story

Returns
index of the last line.
virtual int32 ITextLines::GetLastLineIndex (int32 storyIndex)
pure virtual

Return the index of the last line in the specified story

Parameters
storyIndexindex of story to get the last line index of.
Returns
index of the last line.
virtual int32 ITextLines::GetLastValidIndex ()
pure virtual

Return the last updated line (see the UpdateLine() method).

Returns
index of the last valid line.
virtual int32 ITextLines::GetLastValidIndex (int32 storyIndex)
pure virtual

Return the last updated line (see the UpdateLine() method).

Parameters
storyIndexindex of story to get last valid line from
Returns
index of the last valid line.
virtual const LineDescription ITextLines::GetLine (int32 at,
bool16 returnRuns = kFalse 
)
pure virtual

Get a rectangle describing a line bounds. The rectangle is described in local coordinates of the writingview

Parameters
storyIndexindex of story to get line from
atindex of line.
Returns
a PMRect which describes the line. The rectangles right side will actually be a very large number not the width of the line. If the true line width is desired get the LineDescription and check the width field.
virtual const LineDescription ITextLines::GetLine (int32 storyIndex,
int32 at,
bool16 returnRuns 
)
pure virtual

Get a full line description for a specific line. Some data in this structure may not be up to date until UpdateLine() is called. Specifically, the text indexes associated with the line are updated with the UpdateLine() method (in this same interface see comments by the UpdateLine method).

Parameters
storyIndexindex of story to get line from
atindex of line.
returnRunsfill in kTrue to get the RunDescription pointer filled in kFalse (default) otherwise.
Returns
a LineDescription class that has information on what is contained in the line.
virtual TextIndex ITextLines::GetLineEndOffsetAtLine (int32 at)
pure virtual

Get the text model index of a line end.

Parameters
atindex of line.
Returns
a text model index of the last position in the line (index of character at the start of the next line).
virtual PMReal ITextLines::GetLineHeight (bool16 textOnly = kFalse)
pure virtual

Get the height of a line.

Parameters
textOnlyif you only want to get the text portion not the extra for line spacing pass true.
Returns
the height of a line.
virtual void ITextLines::GetLineNumberStartEnd (int32 & start,
int32 & end 
)
pure virtual

Get the line number (galley) of the last line and first line in a story

Parameters
startfirst line number in a story (returned)
endlast line number in a story (returned)
Returns
none.
virtual TextIndex ITextLines::GetLineStartOffsetAtLine (int32 at)
pure virtual

Get the text model index of a line start.

Parameters
atindex of line.
Returns
a text model index of the first character in a line.
virtual LinesType ITextLines::GetLinesType ()
pure virtual

Will describe the type of line endings in terms of the LinesType enum.

Returns
It will return either that the lines have kWindowLineEnds meaning that the lines are a story view. Or that the lines are kLayoutLineEnds meaning the lines are a galley view (galley view is InCopy only).
virtual int32 ITextLines::GetPages (PMRect rectToFit,
int32 columns 
)
pure virtual

Get number of pages to print text

Parameters
rectToFitspecifies page height
columnsnumber of columns to print on a page
Returns
index of page.
virtual PMRect ITextLines::GetPendingInvalRect ()
pure virtual

Internal use only doesn't include an area to be redrawn do to a system inval

Returns
rectangular area to redraw
virtual PMRect* ITextLines::GetPendingInvalsForUndoRedo ()
pure virtual

Internal use only.

virtual bool16 ITextLines::GetPlayPendingInvals () const
pure virtual

Is drawing currently suspended

Returns
kTrue if drawing is NOT suspended.
virtual int32 ITextLines::GetStoryCount ()
pure virtual

Returns the number of stories in displayed in the story/galley view

Returns
number of stories.
virtual const UIDRef& ITextLines::GetStoryRef (int32 storyIndex)
pure virtual

Get a story ref for a given story index

Parameters
storyIndexindex of story to get a ref for
Returns
a UIDRef of the story
virtual UIDList* ITextLines::GetStoryRefList ()
pure virtual

Get a list (in display order) of the uidref's of all stories displayed in the story/galley view.

Returns
list of story ref's (kTextStoryBoss)
virtual PMReal ITextLines::GetStoryYDrawStart (int32 storyIndex) const
pure virtual

Get the yDraw position of a story

Parameters
storyIndexstory index to get vertical position of
Returns
Vertical position from the top of the view where the story will start to draw at
virtual bool8 ITextLines::GetUseTextRuns ()
pure virtual

Is view displaying track changes and notes.

Returns
none
virtual PMReal ITextLines::GetXPosition (int32 at)
pure virtual

Get the left start X offset of a line of the current story.

Parameters
atindex of line.
Returns
a PMReal which is the X position of the line measured from the left edge of the view.
virtual PMReal ITextLines::GetXPositionOfCharacter (int32 atLineIndex,
int32 characterOffsetIntoLine,
TextIndex absoluteTextOffset = -1,
bool16 isEndPosition = kFalse,
ExtendType extend = kDontExtend,
TextIndex absoluteTextEndOffset = -1 
)
pure virtual

Given a text index offset into a line return the horizontal distance this character is drawn at on the screen from the left side of the view.

Parameters
atLineIndexindex of line we want the x-position of a character for
characterOffsetIntoLinetext model index of character (offset into line not from model start)
absoluteTextOffsettext model index of character (model start)
isEndPositionis this position at the end of a line.
extendused for track change deleted text (internally) if true extend distance to include the deleted text run adjacent (if present).
absoluteTextEndOffsetused internally for track change deleted text leave -1
Returns
draw horizontal distance (pixels) that the character lives at from view left.
virtual PMReal ITextLines::GetXPositionOfCharacterInRun (int32 atLineIndex,
int32 runIndex,
int32 characterOffsetIntoRun 
)
pure virtual

Given an index of a run within a line and a line index within the current story and a character offset within the run find the display distance of that character offset

Parameters
atLineIndexline index within the current story
indexof a run within a line
characteroffset within the run
Returns
return the display index of the requested character offset from run left.
virtual PMReal ITextLines::GetXPositionOfDisplayOffsetCharacter (int32 atLineIndex,
int32 displayOffsetIntoLine 
)
pure virtual

Given a display offset into a line return the horizontal distance this character is drawn at on the screen from the left side of the view.

Parameters
atLineIndexindex of line we want the x-position of a character for
displayOffsetIntoLinedisplay index into a line
Returns
draw horizontal distance (pixels) that the character lives at from view left.
virtual PMReal ITextLines::GetXPositionOfDisplayOffsetCharacter (int32 storyIndex,
int32 atLineIndex,
int32 displayOffsetIntoLine 
)
pure virtual

Given a display offset into a line return the horizontal distance this character is drawn at on the screen from the left side of the view.

Parameters
storyIndexstory that the line lives in
atLineIndexindex of line we want the x-position of a character for
displayOffsetIntoLinedisplay index into a line
Returns
draw horizontal distance (pixels) that the character lives at from view left.
virtual PMReal ITextLines::GetYPosition (int32 at)
pure virtual

Get the Y offset of the line.

Parameters
atindex of line.
Returns
The y position of the top of the line. The y position of the first line in the view is 0. This is an absolute position, windows and scrolling do not come into play.
virtual PMReal ITextLines::GetYPosition (int32 storyIndex,
int32 at 
)
pure virtual

Get the left start X offset of a line.

Parameters
storyIndexindex of story to get line from.
Returns
a PMReal which is the X position of the line measured from the left edge of the view.
virtual PMReal ITextLines::HitTestText (int32 storyIndex,
int32 * lineIndex,
const PMPointx,
TextIndex * nextLine 
)
pure virtual

Find line at point and return a text index hit in galley display indexes

Parameters
storyIndexstory being hit tested
lineIndexindex of line hit
xpoint to find line at
nextLinetext index of the first character in the next line after the line hit (useful for the selection code)
Returns
text index of last character in the hit line (text index is in display indexes must convert to model if you wish to use with the text model see DisplayToModelRange())
virtual void ITextLines::InitializeLines (const K2Vector< ComposeInformation > & composeInformation,
bool16 forceInitialization = kFalse,
bool16 scrollARangeIntoView = kFalse 
)
pure virtual

Recompose all lines.

Parameters
composeInformationlist of stories to recompose
forceInitializationrecompose even if already initialized if TRUE.
scrollARangeIntoViewif a range is selected scroll it into view if this is TRUe
Returns
none
virtual void ITextLines::InitializeStoryCollapsedState (K2Vector< StoryState > & storyList)
pure virtual

Set stories intial collapse or expanded state when printing

Parameters
storyListstories and their corresponding collapse state
Returns
none.
virtual bool16 ITextLines::InsertLine (int32 beforeIndex,
const LineDescriptionline,
bool16 autoScroll = kTrue 
)
pure virtual

This should typically only be used internally. The composer will call this to insert a new lines of text to the view.

Parameters
beforeIndextext line index to insert before.
linedescription of the line to insert.
autoScrollshould the view scroll to the current text cursor location after appending the line.
Returns
kTrue if the line was inserted successfully kFalse otherwise.
virtual void ITextLines::InvalidateLine (int32 at,
bool16 isFrontMost = kFalse 
)
pure virtual

Invalidate line for later refresh

Parameters
atindex of line to draw
isFrontMostis the view frontMost (can pass false if unsure it will still work)
Returns
none
virtual void ITextLines::InvalidateRun (int32 at,
int32 whichRun,
TextIndex startOffsetInRun,
TextIndex endOffsetInRun,
bool16 isFrontMost = kFalse 
)
pure virtual

Invalidate run within a line for later refresh. Normally, InvalidateLine is fine instead of this routine and much simpler to use

Parameters
atindex of line to draw
whichRunindex of run within line to draw
startOffsetInRuntextIndex into run to start inval at
endOffsetInRuntext index into run to end inval at
isFrontMostis the view frontMost (can pass false if unsure it will still work)
Returns
none
virtual bool16 ITextLines::IsStoryBarSelected (int32 storyIndex)
pure virtual

A story divider bar may be selected (InCopy only) see if it is selected

Parameters
storyIndexindex of story (and associated story bar to check)
Returns
is the bar selected if so returns kTrue
virtual bool16 ITextLines::IsStoryCollapsed (int32 storyIndex)
pure virtual

InCopy only stories may be collapsed (hidden except for story divider) see if this is true for a given story

Parameters
storyIndexindex to check if collapsed
Returns
kTrue if collapsed
virtual TextIndex ITextLines::ModelIndexToDisplayIndex (TextIndex modelIndex)
pure virtual

Convert a model text index to a display text index

Parameters
modelIndexto convert
Returns
best guess display index see ModelToDisplayRange() for a more accurate conversion (more that one display index may map to a single model index).
virtual TextIndex ITextLines::ModelIndexToDisplayIndex (int32 storyIndex,
TextIndex modelIndex 
)
pure virtual

Convert a model text index to a display text index

Parameters
storyIndexstory to use for the conversion
modelIndexto convert
Returns
best guess display index (more that one display index may map to a single model index).
virtual TextIndex ITextLines::ModelOffsetToDisplayOffset (TextIndex modelOffset,
int32 lineIndex,
bool16 ignoreRunTypes = kFalse 
)
pure virtual

Convert a model text index to a display text index. Mostly for internal use see ModelIndexToDisplayIndex instead.

Parameters
modelOffsetmodel text index to convert
lineIndexline that the model text index lives in
ignoreRunTypesnormally routine will only normally look through run types < RunDescription::endPrimaryStoryTypes if true this routine will look through other types as well. kFalse is normally what is wanted
Returns
none.
virtual RangeData ITextLines::ModelToDisplayRange (int32 storyIndex,
const RangeDatamodelRange,
UID leftExtra,
UID rightExtra 
)
pure virtual

Convert a model range to a display index range

Parameters
storyIndexindex of story to operate on
modelRangemodel index range to convert
leftExtraonly used for track changes external users should most likely pass kInvalidUID
rightExtraonly used for track changes external users should most likely pass kInvalidUID
Returns
corresponding display range
virtual void ITextLines::PlayPendingInvals (bool16 instantDraw = kFalse)
pure virtual

Internal use only. Draw all pending invals now don't wait for a system inval to come through

Parameters
instantDrawrequest immediate drawing instead of inval. May not happen if drawing is suspended. Usually fine to let inval handle it.
Returns
none
virtual IFontInstance* ITextLines::QueryDisplayFontInstance (IFontMgr::FontStyleBits styleBits,
IDrawingStyle::CapitalizeMode capMode 
)
pure virtual

Query an instance of the display font.

Parameters
styleBitsthe font variant type (see IFontMgr).
capModeinterested instance of display font for which type kCapSmallLowercase, kCapNormal, kCapAll, kCapSmallEverything, kCapLowercase.
Returns
instance of the display font.
virtual void ITextLines::RecordUndoRedoPendingInvals (const PMRectinvals)
pure virtual

Internal use only.

virtual void ITextLines::RemoveAllStories ()
pure virtual

Clear a view of all stories must put stories back in quickly. Should only be used internally normally

Returns
none
virtual void ITextLines::RemoveExcessLines (int32 startIndex,
bool16 isFrontMost,
bool16 autoScroll = kTrue 
)
pure virtual

This should typically only be used internally. Used to remove excess lines that may be present after compostion finishes.

Parameters
startIndex.
atPositionthe x position relative to the left side of the view to add the frame divider.
lineNumberused to display in the info column multiple galley lines may map to one waxline because galley lines also wrap at view edge.
lineIDa matching id is stored with the waxline.
isFrontMostif view is front most then draw will occur right away otherwise it will simply invalidate and draw later.
Returns
none.
virtual bool16 ITextLines::ReplaceLine (int32 at,
const LineDescriptionline 
)
pure virtual

This should typically only be used internally. The composer will call this to replace a line with a different line description.

Parameters
atthe index of the line to replace.
linedescription of the new line that will replace the old line information.
Returns
kTrue if the line was replaced successfully kFalse otherwise.
virtual void ITextLines::ResumePlayPendingInvals ()
pure virtual

Resume drawing (causes a full screen redraw)

Returns
none
virtual void ITextLines::SetComposeLayout (bool16 shouldCompose)
pure virtual

Deprecated (don't use won't do anything)

virtual void ITextLines::SetCurrentStoryIndex (int32 i)
pure virtual

Set the current model display index (used for all routines in ITextLines that don't take a storyIndex). Note that these indexes are specific to the story/galley view not the IStoryList interface. See the GetStoryRefList() routine in this file. They are indexes into the ref list returned by GetStoryRefList().

Parameters
iindex of story to use
Returns
none
virtual void ITextLines::SetHilite (TextIndex start,
TextIndex end,
bool16 drawHilite = kTrue,
UID extendToDeletedUID = kInvalidUID 
)
pure virtual

This no longer has meaning in Dragontail (depricated) Set a selection instead

virtual void ITextLines::SetHilite (const RangeDatarange,
bool16 drawHilite = kTrue,
UID extendToDeletedUID = kInvalidUID 
)
pure virtual

This no longer has meaning in Dragontail (depricated) Set a selection instead

virtual void ITextLines::SetLastValidIndex (int32 index)
pure virtual

It's not expected 3rd parties would use this. This is only set from the composer. Improper use can cause crashes and screen draw problems.

Parameters
indexindex of the last valid line
Returns
none.
virtual void ITextLines::SetLinesType (LinesType lType)
pure virtual

Allows the caller to change the type of line endings. Should normally go through the IGalleyUtils::SetDocWindowView() to do this. This call should only be used in InCopy since InDesign doesn't support galley view only story.

Parameters
lTypecan pass in either kWindowLineEnds or kLayoutLineEnds (see GetLinesType())
Returns
none.
virtual void ITextLines::SetRanges (PMString ranges)
pure virtual

Set ranges of text to print

Parameters
rangesranges of text to print
Returns
none.
virtual void ITextLines::SetStoryBarSelected (int32 storyIndex,
bool16 selected 
)
pure virtual

Mark a story bar as selected (internal use)

Parameters
storyIndexindex of story (and associated story bar to check)
selectedvalue to set selected state to. kTrue if want to select.
Returns
none
virtual void ITextLines::SetStoryCollapseState (const K2Vector< int32 > & storyIndexes,
bool16 collapse 
)
pure virtual

For a list of story indeces in a view set the collapse state

Parameters
storiesindices to collapse or expand
collapsekTrue to collapse or false to expand
Returns
none
virtual void ITextLines::SetStoryRef (const UIDRefref,
int32 storyIndex 
)
pure virtual

Used to rearrange draw order of stories set a ref at a given story index. Should use the higher level kReorderStoriesCmdBoss to do this correctly

Parameters
refstory to insert
storyIndexindex to place story at
Returns
none
virtual void ITextLines::SetStoryYDrawStart (PMReal yStartPosition,
int32 storyIndex 
)
pure virtual

Internal use, set the yDraw position of a story

Parameters
yStartPositionwhere to start drawing the given story at horizontally.
storyIndexstory index to set vertical position of
Returns
none
virtual bool16 ITextLines::SetUniqueIDOfLine (int32 at,
uint32 newID 
)
pure virtual

Set an ID is used to connect TextLines to WaxLines. Shouldn't be called externally. Specific to galley view story doesn't care about this

Parameters
atindex of line to assign an id to
newIDid to store with a text line this id will match an id stored with a equivalent IWaxLine.
Returns
none
virtual void ITextLines::SuspendPlayPendingInvals ()
pure virtual

Suspend drawing temporarily while we do some multiple step operations and we don't want to see the screen refreshing during these.

Returns
none
virtual void ITextLines::SyncScrolling (bool16 lockRelativePosition = kFalse,
bool16 scrollToASelectionRange = kFalse 
)
pure virtual

Update the scroll bar values and scroll the view to the current selection location.

Parameters
lockRelativePositiondon't scroll just update the scroll bars used during background composition if TRUE
scrollToASelectionRangescroll to a range not just an insertion point if TRUE
Returns
none
virtual void ITextLines::UpdateFontInfo (const PMStringfontName,
bool16 initializeLines 
)
pure virtual

Allows the caller to change the display font for the view. This is really for internal use external callers should go through kSetGalleyDisplayFontCmdBoss which will end up calling this.

Parameters
fontNamename of the font to use as a display font.
initializeLinespass true to cause the lines to be recomposed with the new display font information.
Returns
none.
virtual void ITextLines::UpdateLeading ()
pure virtual

Allows the caller to change the line spacing amount for the view. This is really for internal use external callers should go through kSetLeadingCmdBoss which will end up calling this.

Parameters
fontNamename of the font to use as a display font.
initializeLinespass true to cause the lines to be recomposed with the new display font information.
Returns
none.
virtual void ITextLines::UpdateLine (int32 at)
pure virtual

Causes the LineDescription (text index values) to be updated to match the model. This must be called prior to fetching any LineDescription and looking at any of the model or display text index fields. Also, it is not a good idea to simply update through the last line index this will cause a performance hit as then every line (that is not already updated) prior to the index of the line requested will need to be updated. It is highly recommended that the routine GetLineStartOffsetAtLine() or GetLineEndOffsetAtLine() be used when possible instead of this call for external users.

Parameters
atindex of line to update through.
Returns
none.
virtual void ITextLines::UpdateLine (int32 storyIndex,
int32 at 
)
pure virtual

Causes the LineDescription (text index values) to be updated to match the model. This must be called prior to fetching any LineDescription and looking at any of the model or display text index fields. Also, it is not a good idea to simply update through the last line index this will cause a performance hit as then every line (that is not already updated) prior to the index of the line requested will need to be updated. It is highly recommended that the routine GetLineStartOffsetAtLine() or GetLineEndOffsetAtLine() be used when possible instead of this call for external users.

Parameters
storyIndexindex of story to get line from
atindex of line to update through.
Returns
none.