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

#include <ITextUtils.h>

Inheritance diagram for ITextUtils:
IPMUnknown

Classes

struct  TextAttrs
 
struct  WhichTextAttrs
 

Public Types

enum  { kDefaultIID = IID_ITEXTUTILS }
 
enum  DisplayNamesFlag { kCombineSingleStyleIntoFamilyName, kSeparateFamilyAndStyleName, kStyleNameOnly, kFamilyNameOnly }
 
enum  WordCountUpdateAction { kUpdateAll = 0, kUpdateLine, kNoAction }
 
enum  WordCountUpdateState {
  kStartCounting = 0, kCustomizeStartCounting, kContinueCounting, kContinueCountingForComposedFrame,
  kEndCounting
}
 
enum  PageCountScopes { kSection = 0, kDocument }
 
typedef K2Vector< InterfacePtr
< IVisitorHelper > > 
VisitableItems
 
typedef K2Vector< TextIndex > HIndexList
 
typedef bool16(* StripMatchingCharactersFunction )(const UTF32TextChar &n)
 

Public Member Functions

virtual ICommandQueryCopyStoryCommand (const UIDRef &source, const UIDRef &dest, const StoryRange &sourceRange, const StoryRange &destRange, const bool16 ignoreAttributes=kFalse)=0
 
virtual ICommandQueryCopyStoryToEndCommand (const UIDRef &source, const UIDRef &dest, const StoryRange &sourceRange, const bool16 ignoreAttributes=kFalse)=0
 
virtual ICommandQueryCopyStoryFromAllToAllCommand (const UIDRef &source, const UIDRef &dest, const bool16 ignoreAttributes=kFalse)=0
 
virtual ICommandQueryCopyStoryFromAllToEndCommand (const UIDRef &source, const UIDRef &dest, const bool16 ignoreAttributes=kFalse)=0
 
virtual ICommandQueryMoveStoryCommand (const UIDRef &source, const UIDRef &dest, const StoryRange &sourceRange, const StoryRange &destRange, const bool16 ignoreAttributes=kFalse)=0
 
virtual ICommandQueryMoveStoryFromAllCommand (const UIDRef &source, const UIDRef &dest, const StoryRange &destRange, const bool16 ignoreAttributes=kFalse)=0
 
virtual ICommandQueryMoveStoryFromAllToAllCommand (const UIDRef &source, const UIDRef &dest, const bool16 ignoreAttributes=kFalse)=0
 
virtual ICommandQueryMoveStoryFromAllToEndCommand (const UIDRef &source, const UIDRef &dest, const bool16 ignoreAttributes=kFalse)=0
 
virtual ICommandCreateNewMCFrameCommand (UIDRef parent, bool16 noGraphicAttr, const PMRect &boundary, bool16 isHorizontal=kTrue, bool16 isFrameGrid=kFalse, bool16 isLeftToRight=kTrue, ClassID frameItem=kFrameItemBoss, bool16 isEndnoteStory=kFalse)=0
 
virtual ICommandCreateNewMCFrameCommand (UIDRef parent, bool16 noGraphicAttr, const PMPointList &opposingCorners, bool16 isHorizontal=kTrue, bool16 isFrameGrid=kFalse, bool16 isLeftToRight=kTrue, ClassID frameItem=kFrameItemBoss)=0
 
virtual ICommandCreateNewMCFrameForStoryCommand (UIDRef parent, bool16 noGraphicAttr, const PMRect &boundary, ITextModel *story, bool16 isHorizontal=kTrue, bool16 isFrameGrid=kFalse, bool16 isLeftToRight=kTrue, ClassID frameItem=kFrameItemBoss)=0
 
virtual ICommandCreateNewMCFrameForFrameListCommand (UIDRef parent, bool16 noGraphicAttr, const PMRect &boundary, IFrameList *frameList, bool16 atEnd=kTrue, ClassID frameItem=kFrameItemBoss)=0
 
virtual ICommandCreateNewMCFrameForFrameListCommand (UIDRef parent, bool16 noGraphicAttr, const PMRect &boundary, IMultiColumnTextFrame *mcFrame, bool16 insertAfter=kTrue, ClassID frameItem=kFrameItemBoss)=0
 
virtual ICommandCreateNewMCFrameForFrameListCommand (UIDRef parent, bool16 noGraphicAttr, const PMRect &boundary, IFrameList *frameList, int32 insertIndex, ClassID frameItem=kFrameItemBoss)=0
 
virtual ICommandCreateConvertToMCFrameCommand (UIDRef parent, bool16 isHorizontal=kTrue, bool16 isFrameGrid=kFalse, bool16 isLeftToRight=kTrue, ClassID frameItem=kFrameItemBoss)=0
 
virtual ICommandCreateConvertToMCFrameForStoryCommand (UIDRef parent, ITextModel *story, bool16 isHorizontal=kTrue, bool16 isFrameGrid=kFalse, bool16 isLeftToRight=kTrue, ClassID frameItem=kFrameItemBoss)=0
 
virtual ICommandCreateConvertToMCFrameForFrameListCommand (UIDRef parent, IFrameList *frameList, bool16 atEnd=kTrue, ClassID frameItem=kFrameItemBoss)=0
 
virtual ICommandCreateConvertToMCFrameForFrameListCommand (UIDRef parent, IMultiColumnTextFrame *mcFrame, bool16 insertAfter=kTrue, ClassID frameItem=kFrameItemBoss)=0
 
virtual ICommandCreateConvertToMCFrameForFrameListCommand (UIDRef parent, IFrameList *frameList, int32 insertIndex, ClassID frameItem=kFrameItemBoss)=0
 
virtual const WideStringConvertTextModelText (const WideString &rText, WideString *pStripped, bool16 stripHardHyphens=kTrue, bool16 stripDiscretionaryHyphens=kTrue, bool16 convertApostrophes=kTrue, bool16 stripNobreakNonspace=kTrue, bool16 convertHyphens=kTrue, bool16 stripLeadingSpaces=kTrue, bool16 convertForGrammarCheck=kFalse)=0
 
virtual bool16 CollectPageItemsFromFocus (const ITextFocus *pFocus, const PMIID &iid, UIDList *pList)=0
 
virtual bool16 FocusSpansMultiplePageItems (const ITextFocus *pFocus)=0
 
virtual int32 GetMultiColFrameIndex (const IMultiColumnTextFrame *mcf)=0
 
virtual TextIndex FindSurroundingWord (const ITextModel *pModel, TextIndex nPosition, int32 *pLength, FuncIsWordChar aFunction)=0
 
virtual TextIndex FindSurroundingWordUsingWordCharFuncOnly (const ITextModel *pModel, TextIndex nPosition, int32 *pLength, const FuncIsWordChar aFunction)=0
 
virtual bool16 IsPlainStyleName (const PMString &styleName)=0
 
virtual bool16 IsItalicStyleName (const PMString &styleName)=0
 
virtual bool16 IsBoldStyleName (const PMString &styleName)=0
 
virtual bool16 IsBoldItalicStyleName (const PMString &styleName)=0
 
virtual bool16 GetFontStyleName (ITextAttrFont *fromFont, ITextAttrFont *toFont, PMString *styleName)=0
 
virtual bool16 RemapFontStyles (IDataBase *dataBase, const AttributeBossList &stateOverrides, const AttributeBossList &newOverrides, PMString *styleName, Fixed *&axesInfo, int &numAxes, ClassID textAttrFontUIDBoss=kTextAttrFontUIDBoss, ClassID textAttrFontStyleBoss=kTextAttrFontStyleBoss, bool16 remapExactFontStylesOnly=kFalse)=0
 
virtual bool16 IsOpenTypeFont (const IPMFont *font)=0
 
virtual bool16 IsOpenTypeFamily (IFontFamily *fontFamily)=0
 
virtual bool16 IsAdobeFont (IPMFont const *font)=0
 
virtual bool16 IsWordBreak (const UTF32TextChar &curChar)=0
 
virtual void GetDisplayFontNames (IFontGroup *fontGroup, IPMFont *font, PMString &familyName, PMString &styleName, DisplayNamesFlag namesFlag)=0
 
virtual void GetDisplayFontNames (IDataBase *dataBase, const ITextAttrUID *fontUID, const ITextAttrFont *fontStyle, PMString &familyName, PMString &styleName, DisplayNamesFlag namesFlag)=0
 
virtual void CollectOwnedItems (const ITextModel *model, TextIndex start, int32 len, OwnedItemDataList *resultList, bool16 nested=kFalse)=0
 
virtual void CollectVisitableItems (ITextModel *model, TextIndex start, int32 len, VisitableItems *resultList)=0
 
virtual void GetUIDListOfInlines (IParcel *parcel, bool16 bWithDropCaps, UIDList *resultList)=0
 
virtual void CollectStoryRanges (const ITextModel *model, TextIndex start, int32 len, StoryRangeList *resultList, TextIndex hIndex=kInvalidTextIndex, ITextUtils::HIndexList *hIndexList=nil, bool16 bIncludeAnchorSpan=kTrue)=0
 
virtual void BuildLogicalStoryRangeList (ITextModel *model, TextIndex start, StoryRangeList *resultList)=0
 
virtual PMMatrix GetWaxToFrameMatrix (const IParcel *parcel)=0
 
virtual bool16 GetParcelContentBounds (ITextParcelList *tpl, TextIndex at, PMRect *pCBounds)=0
 
virtual bool16 IsOverset (const IFrameList *fl)=0
 
virtual bool16 IsScriptOfText (const char *anyText, int32 writingScript)=0
 
virtual int32 GuessScriptOfText (const char *anyText, int32 preferredWritingScript=kDontKnowScript)=0
 
virtual bool16 SkipTextCharForRemapping (const UTF32TextChar &textChar)=0
 
virtual bool16 SkipTextCharForFontLocking (const UTF32TextChar &textChar)=0
 
virtual UTF32TextChar RemapCharacterValue (IPMFont *oldFont, IPMFont *newFont, const UTF32TextChar &textChar)=0
 
virtual UID CreateNewStory (IDataBase *db, bool16 defaults=kTrue, ClassID clsID=kTextStoryBoss)=0
 
virtual LanguageID ScriptToLanguageID (int32 writingScript)=0
 
virtual ICommandCreateRecomposeThruNthParcelCmd (const ITextParcelList *tpl, int32 parcelIndex)=0
 
virtual ICommandCreateRecomposeThruTextIndexCmd (const ITextParcelList *tpl, TextIndex textIndex)=0
 
virtual int32 DeterminePairKern (const ITextModel *model, TextIndex index, ClassID kernService, PMReal &result)=0
 
virtual void GetDefaultTextAttrPreferences (const WhichTextAttrs which, TextAttrs &out, IDocument *prefsFromDocument)=0
 
virtual void AdjustForTableRange (const UIDRef &story, TextIndex *pStart, TextIndex *pEnd, TextIndex *nextLine)=0
 
virtual bool16 AlignToBaselineGrid (IGeometry *pageItem, IParcel *parcel, const IBaselineGridPrefs *gridPrefs, PMReal *pYTop, PMReal *pYBottom, Text::GridAlignmentMetric alignment, PMReal alignmentMetricOffset) const =0
 
virtual TextIndex FindResetOwnedItemUID (IItemStrand *itemStrand, const ClassID objectType, const UID findOldItemUID, const TextIndex start, const UID newItemUID)=0
 
virtual int32 RemapCharacterValues (IPMFont *oldFont, IPMFont *newFont, const textchar *buffer, int32 bufferLength, WideString *replacedChars)=0
 
virtual int32 CountChars (const UTF16TextChar *buffer, int32 length) const =0
 
virtual int32 CharOffsetToUTF16Offset (const UTF16TextChar *buffer, int32 length, int32 charOffset) const =0
 
virtual void GetSelectedTextItemsFromTextTarget (const ITextTarget *textTarget, UIDList *textframes, UIDList *mcfs, UIDList *splineItems)=0
 
virtual void GetSelectedTextItemsFromLayoutTarget (const ILayoutTarget *layoutTarget, UIDList *textframes, UIDList *mcfs, UIDList *splineItems)=0
 
virtual void GetSelectedTextItemsFromUIDList (const UIDList &pageITems, UIDList *textframes, UIDList *mcfs, UIDList *splineItems)=0
 
virtual void GetTextFramesContaining (const ITextModel *textModel, const RangeData &range, int32 *pFirstFrameIndex, int32 *pLastFrameIndex)=0
 
virtual UIDListCreateOppositeDirectionFrameList (UIDList *pStoryList, ITextOptions::WritingDirection dir)=0
 
virtual void GetUIDListOfTextFramesFromRange (const ITextModel *textModel, const RangeData &range, UIDList *resultList)=0
 
virtual void GetUsedInks (const ITextModel *textModel, TextIndex threadEnd, TextIndex start, int32 len, IInkResourceData *inkResourceData)=0
 
virtual void NotifyOversetChanged (const IFrameList *frameList)=0
 
virtual bool16 IsMultiColumnFrame (const IPMUnknown *obj) const
 
virtual IMultiColumnTextFrameQueryMultiColumnFrame (ITextFrameColumn *tfc) const =0
 
virtual const
IMultiColumnTextFrame
QueryMultiColumnFrame (const ITextFrameColumn *tfc) const =0
 
virtual UID QueryMultiColumnFrameUID (const ITextFrameColumn *tfc) const =0
 
virtual IMultiColumnTextFrameQueryMCFOrTOPFromSpline (const IGraphicFrameData *gfd) const =0
 
virtual UID GetMCFOrTOPFromSpline (const IGraphicFrameData *gfd) const =0
 
virtual ITextModelQueryTextModelFromSpline (const IGraphicFrameData *gfd) const =0
 
virtual IHierarchyQuerySplineFromTextFrame (const IMultiColumnTextFrame *mcf) const =0
 
virtual IHierarchyQuerySplineFromTextFrame (const ITextFrameColumn *tfc) const =0
 
virtual ErrorCode ProcessScaleParcelContent (const ITextParcelList *tpl, ParcelKey key, const PMReal &xScale, const PMReal &yScale, IScaleObject::ScaleContext &context) const =0
 
virtual UID GetTextFramesPageItemUID (IGeometry *pageItem) const =0
 
virtual void GetWordCountInfo (const ITextModel *iTextModel, const uint32 &startIndex, const int32 &lengthToCount, const ITextUtils::WordCountUpdateAction &action, const ITextUtils::WordCountUpdateState &state, bool16 &wordStarted, uint32 &characters, uint32 &words, uint32 &paragraphs, uint32 &lines, uint32 &oversetCharacters, uint32 &oversetWords, uint32 &oversetParagraphs, uint32 &oversetLines, bool16 &bWordAcrossOverset, TextStoryThreadHelper &helper)=0
 
virtual void GetWordCountInfo (const ITextModel *iTextModel, const uint32 &startIndex, const int32 &lengthToCount, const ITextUtils::WordCountUpdateAction &action, const ITextUtils::WordCountUpdateState &state, bool16 &wordStarted, uint32 &fullWidthChars, uint32 &oversetFullWidthChars, uint32 &halfWidthChars, uint32 &oversetHalfWidthChars, uint32 &japaneseChars, uint32 &oversetJapaneseChars, uint32 &kanjis, uint32 &oversetKanjis, uint32 &words, uint32 &oversetWords, uint32 &lines, uint32 &oversetLines, uint32 &paragraphs, uint32 &oversetParagraphs, uint32 &allChars, uint32 &oversetAllChars, bool16 &bWordAcrossOverset, TextStoryThreadHelper &helper)=0
 
virtual int32 CountOversetLines (const UIDRef &textModelUIDRef)=0
 
virtual bool16 IsFocusAFootnote (const ITextFocus *pFocus, UIDRef *pFootnoteUIDRef=nil)=0
 
virtual bool16 IsFootnote (const ITextModel *model, TextIndex position, UIDRef *pFootnoteUIDRef=nil)=0
 
virtual bool16 AnyFootnotes (const ITextModel *model, const RangeData &range)=0
 
virtual void GenerateListsOfAttributesThatCanBeCleared (IWorkspace *workspace, AttributeBossList *characterAttributes, AttributeBossList *paragraphAttributes)=0
 
virtual void GetPrimaryStoryAnchor (UIDRef &storyRef, RangeData &range) const =0
 
virtual boost::shared_ptr
< WideString
FilterInsertString (const WideString *data, StripMatchingCharactersFunction func) const =0
 
virtual void GetPrimaryThreadAnchor (const ITextModel *model, RangeData &range) const =0
 
virtual ErrorCode LinkTextFrames (const IMultiColumnTextFrame *textFrameA, const IMultiColumnTextFrame *textFrameB, bool16 prepend)=0
 
virtual IHierarchyQueryForHierarchyMember (IDataBase *db, const ITextFrameColumn *textFrame) const =0
 
virtual UIDRef GetPageUIDRef (const UIDRef &textFrameRef) const =0
 
virtual int32 GetPageNumber (const UIDRef &textFrameRef) const =0
 
virtual ClassID GetPageNumberFormatter (const UIDRef &textFrameRef) const =0
 
virtual void GetFormattedPageNumberString (const UIDRef &textFrameRef, PMString *s, IDrawingStyle::PositionIndicator whichPage=IDrawingStyle::kDataPosition_ThisPage) const =0
 
virtual void GetFormattedSectionNameString (const UIDRef &textFrameRef, PMString *s) const =0
 
virtual int32 GetChapterNumber (IDataBase *db) const =0
 
virtual void GetFormattedChapterNumberString (IDataBase *db, PMString *s, int32 v=kInvalidChapterNumber) const =0
 
virtual int32 GetPageCount (const UIDRef &target, enum PageCountScopes scope) const =0
 
virtual UIDRef GetPreviousPageNumberFrameRef (const UIDRef &textFrameRef) const =0
 
virtual UIDRef GetNextPageNumberFrameRef (const UIDRef &textFrameRef) const =0
 
virtual bool16 GetTargetIsInContinuedContainer (const UIDRef &target) const =0
 
virtual bool16 GetTargetContainerContinues (const UIDRef &target) const =0
 
virtual TextIndex GetTextIndexForTrackedParagraph (const UIDRef &paraStrandDiskPageRef, UID trackerUID, uint32 trackerData) const =0
 
virtual void GetLocaleFromTextIndex (const UIDRef &modelRef, const TextIndex position, bool16 &noLang, void *locale) const =0
 
virtual IDocumentGetLastDocInBook (bool16 &docWasAlreadyOpen, int32 &startPageNum) const =0
 
virtual int32 GetSpreadTextFrameColumns (const UIDRef &spreadRef, UIDList *pList) const =0
 
virtual int32 GetSpreadMultiColumnTextFrames (const UIDRef &spreadRef, UIDList *pList) const =0
 
virtual void EditTargetStyle (IDataBase *targetDB, const UID &targetStyle, AttributeBossList *attributesToApply, const UIDList &uidList) const =0
 
virtual void ApplySourceStyleAttrsToTargetStyle (IDataBase *sourceDB, const UID &sourceStyle, IDataBase *targetDB, const UID &targetStyle, const UIDList &uidList) const =0
 
virtual bool16 IsTextValidForInsertion (WideString const &text) const =0
 
virtual void RepairGenericDataLink (UIDRef oldStoryRef, UIDRef newStoryRef)=0
 
virtual const WideStringGetXRefPageNumberVariableName ()=0
 
virtual const WideStringGetXRefChapterNumberVariableName ()=0
 
virtual WideString GetFullVisibleParagraphString (IComposeScanner *scanner, TextIndex textIndex, int32 &paragraphSpan)=0
 
virtual bool16 IsLeftToRightRun (const IWaxLine *waxLine, TextIndex ti) const =0
 
virtual UIDRef GetFirstFrameOfStory (const UIDRef &story) const =0
 
virtual void ConvertSmartQuotes (ITextModel *model, TextIndex position, int32 length) const =0
 
virtual void GetGlyphsForOverrides (ITextModel *model, const RangeData &range, const AttributeBossList *overrides, std::vector< std::pair< Text::GlyphID, TextIndex >> *newGlyphPoints, bool16 clearOverrides=kFalse) const =0
 
virtual int32 GetPageNumberFromPageUID (const UIDRef &page) const =0
 
virtual
ITextStoryThreadDictHier::CompareResult 
CompareItemPosition (const ITextModel *txtModel, const TextIndex item1Position, const TextIndex item2Position) const =0
 
virtual bool16 IsVerticalColumnRuleActive (const IPMUnknown *shape)=0
 
virtual bool16 RemapFontStylesWithOPSZ (IDataBase *dataBase, const AttributeBossList &stateOverrides, const AttributeBossList &newOverrides, PMString *styleName, Fixed *&axesInfo, int &numAxes, ClassID textAttrFontUIDBoss=kTextAttrFontUIDBoss, ClassID textAttrFontStyleBoss=kTextAttrFontStyleBoss, bool16 remapExactFontStylesOnly=kFalse, PMReal pointSize=-1)=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

Utility functions for creating text-related commands and for gather text information. e.g.

Utils<ITextUtils>()->QueryCopyStoryCommand( ... ) ;

Member Typedef Documentation

typedef bool16(* ITextUtils::StripMatchingCharactersFunction)(const UTF32TextChar &n)

Filter illegal control characters from the string.

Parameters
datais the string to filter
funcis a function that returns kTrue if it is passed a character that should be stripped
Returns
the filtered string or nil if no filtering was required

Member Enumeration Documentation

How should the names be displayed?
Enumerator
kCombineSingleStyleIntoFamilyName 

If only one style for the font group familyName will have style name included. styleName will always be blank (Type->Font menu uses this)

kSeparateFamilyAndStyleName 

Used in style sheet description field

kStyleNameOnly 

familyName is blank, only styleName filled out. Character palette Style Menu uses this.

kFamilyNameOnly 

styleName is blank, only Family filled out. Character palette Famiy Menu uses this.

Enum defining the scope of the Page Count

Do character, word, paragraph and line count

Parameters
startIndex— start index for counting
lengthToCount— how far should count stop.
action— just update line or update all.
state— start or continue counting.
wordStarted— left over state(word is started or not) of last time.
characters— count of characters. (passed out parameter)
words— count of words. (passed out parameter)
paragraphs— count of paragraphs. (passed out parameter)
lines— count of lines. (passed out parameter)
oversetCharacters— count of characters in overset. (passed out parameter)
oversetWords— count of words in overset. (passed out parameter)
oversetParagraphs— count of paragraphs in overset. (passed out parameter)
oversetLines— (Deprecated, won`t return actual overset lines) count of lines in overset. (passed out parameter)

Member Function Documentation

virtual void ITextUtils::AdjustForTableRange (const UIDRefstory,
TextIndex * pStart,
TextIndex * pEnd,
TextIndex * nextLine 
)
pure virtual

2.0: Tables use one or more characters to "anchor" the table to the text flow. Inserting within these ranges is considered bad form and will lead to crashes. You may use this method to launder the ranges to encompass all of the table instead of just part.

virtual bool16 ITextUtils::AlignToBaselineGrid (IGeometrypageItem,
IParcelparcel,
const IBaselineGridPrefsgridPrefs,
PMRealpYTop,
PMRealpYBottom,
Text::GridAlignmentMetric alignment,
PMReal alignmentMetricOffset 
) const
pure virtual

Align text in the primary story thread in the specified text frame. This is NOT suitable for alignment in any other TextStoryThread.

virtual bool16 ITextUtils::AnyFootnotes (const ITextModelmodel,
const RangeDatarange 
)
pure virtual

returns whether the range in the model contains a footnote

Parameters
model— The model in question
range— The range in the given model
Returns
Whether that model-range contains a footnote.
virtual void ITextUtils::ApplySourceStyleAttrsToTargetStyle (IDataBasesourceDB,
const UIDsourceStyle,
IDataBasetargetDB,
const UIDtargetStyle,
const UIDListuidList 
) const
pure virtual
Description: Convert the attributes from the source database to target database first and

then apply the converted attributes to target style.

Parameters
sourceDB[IN] source database
sourceStyle[IN] source style
targetDB[IN] target database
targetStyle[IN] target style
uidList[IN] itemList to apply
virtual void ITextUtils::BuildLogicalStoryRangeList (ITextModelmodel,
TextIndex start,
StoryRangeList * resultList 
)
pure virtual

Builds a list of text ranges for the specified story that are in logical order. The first range will begin at 'start' and the rest of the ranges will wrap around the end of the story to end at 'start - 1'.

virtual int32 ITextUtils::CharOffsetToUTF16Offset (const UTF16TextChar * buffer,
int32 length,
int32 charOffset 
) const
pure virtual

Translates character (can be multiple UTF16s) offset into UTF16 offset in UTF16TextChar buffer

virtual void ITextUtils::CollectOwnedItems (const ITextModelmodel,
TextIndex start,
int32 len,
OwnedItemDataListresultList,
bool16 nested = kFalse 
)
pure virtual

Returns the list of owned items associated with a TextRange

Parameters
modelThe TextModel
startThe starting TextIndex of Text range to collect from.
lenThe length of the Text range to collect from.
resultList
nestedIf kFalse, only the OwnedItems in the specified Text range are returned. If kTrue, then all nested OwnedItems, that is OwnedItems that are contained in StoryRanges managed by found OwnedItems, are also returned. See CollectStoryRanges() for more information on nesting.
virtual bool16 ITextUtils::CollectPageItemsFromFocus (const ITextFocuspFocus,
const PMIIDiid,
UIDListpList 
)
pure virtual

Collects UIDs of items with specified interface from the text focus. e.g. IID_IGRAPHICFRAMEDATA, IID_ITOPFRAMEDATA Can be a costly function with a text selection that spans many pages. See FocusSpansMultiplePageItems.

virtual void ITextUtils::CollectStoryRanges (const ITextModelmodel,
TextIndex start,
int32 len,
StoryRangeList * resultList,
TextIndex hIndex = kInvalidTextIndex,
ITextUtils::HIndexListhIndexList = nil,
bool16 bIncludeAnchorSpan = kTrue 
)
pure virtual

Returns the list of logically sequential story ranges that derive from the specified span of the text model. For a typical model span with no special content this will simply return a single StoryRange as (start, start + len). If a table, or other type of owned item which contains nested text is within the specified span then the specified span will be returned as two ranges with the appropriate nested text range(s) inserted between them. The hIndex and hIndexList are optional parameters which allows the caller to identify the starting TextIndex of the hierarchical element that "owns" the equivalent range in the resultList. Ranges from the main story thread (which starts at TextIndex 0) will have the hIndex of kInvalidTextIndex. Hierarchical elements that are found in the main story thread will have hIndex values within the main story thread and if those elements have sub elements then those will be in other story threads.

Parameters
bIncludeAnchorSpanis optional parameter which provides flexibility to client if they want to include anchor when calculating net span. For example, we don't want to include anchor span(such as table) when when do line count, e.g., for a 4x4 table, we want the line count as 16 instead of 17.
virtual void ITextUtils::CollectVisitableItems (ITextModelmodel,
TextIndex start,
int32 len,
VisitableItemsresultList 
)
pure virtual

returns the list of owned items associated with a TextRange that have an IVisitorHelper interface.

virtual ITextStoryThreadDictHier::CompareResult ITextUtils::CompareItemPosition (const ITextModeltxtModel,
const TextIndex item1Position,
const TextIndex item2Position 
) const
pure virtual
Compare two items in the same text model by their text index to determine if an item appears visually before or after the other item. 

Parameters
txtModelThe text model for both the items to be compared
item1PositionText index of the first item
item2PositionText index of the second item
Returns
kIsBefore if item1 appears before item2, kIsEqual if both indexes are equal, kIsAfter if item1 appears after item2
virtual void ITextUtils::ConvertSmartQuotes (ITextModelmodel,
TextIndex position,
int32 length 
) const
pure virtual
Map quotes to smart quotes

Parameters
storyto convert quotes
positionwhere to start converting quotes
lengthto convert quotes
virtual const WideString& ITextUtils::ConvertTextModelText (const WideStringrText,
WideStringpStripped,
bool16 stripHardHyphens = kTrue,
bool16 stripDiscretionaryHyphens = kTrue,
bool16 convertApostrophes = kTrue,
bool16 stripNobreakNonspace = kTrue,
bool16 convertHyphens = kTrue,
bool16 stripLeadingSpaces = kTrue,
bool16 convertForGrammarCheck = kFalse 
)
pure virtual

Strip various types of characters from some text.

Parameters
rTextis the source text.
pStrippedwill be the converted text. If nil, nothing occurs and we return rText.
Returns
Returns the converted text (pStripped) unless nil, then return rText.
virtual int32 ITextUtils::CountChars (const UTF16TextChar * buffer,
int32 length 
) const
pure virtual

Counts number of Unicode characters in a UTF16TextChar buffer

virtual int32 ITextUtils::CountOversetLines (const UIDReftextModelUIDRef)
pure virtual

return the number of overset lines in a given text model

virtual ICommand* ITextUtils::CreateConvertToMCFrameCommand (UIDRef parent,
bool16 isHorizontal = kTrue,
bool16 isFrameGrid = kFalse,
bool16 isLeftToRight = kTrue,
ClassID frameItem = kFrameItemBoss 
)
pure virtual

Creates the command to convert an existing frame to a multi-column text frame with a new story and a new frame list.

Parameters
parent- Existing frame which will be converted to multi-column frame.
isHorizontal- kTrue if the new Story orientation is horizontal, kFalse if it is vertical. Default is kTrue.
isFrameGrid- kTrue if the new Story frame is a frame grid. kFalse if it is a text frame. Default is kFalse.
isLeftToRight- kTrue if the new Story direction is left to right. kFalse if it is right to left. Default is kTrue.
frameItem- ID of the frame item. Default is kFrameItemBoss.
Returns
ICommand - ICommand of kCreateMultiColumnItemCmdBoss created.
virtual ICommand* ITextUtils::CreateConvertToMCFrameForFrameListCommand (UIDRef parent,
IFrameListframeList,
bool16 atEnd = kTrue,
ClassID frameItem = kFrameItemBoss 
)
pure virtual

Creates the command to convert an existing frame to a multi-column text frame and insert at the end or beginning of an existing frame list.

Parameters
parent- Existing frame which will be converted to multi-column frame.
frameList- The existing frame list into which the multi-column frame will be inserted.
atEnd- kTrue if the multi-column frame will be appened to the end of the frame list, kFalse if it will be inserted to the beginning of the frame list. Default is kTrue.
frameItem- ID of the frame item. Default is kFrameItemBoss.
Returns
ICommand - ICommand of kCreateMultiColumnItemCmdBoss created.
virtual ICommand* ITextUtils::CreateConvertToMCFrameForFrameListCommand (UIDRef parent,
IMultiColumnTextFramemcFrame,
bool16 insertAfter = kTrue,
ClassID frameItem = kFrameItemBoss 
)
pure virtual

Creates the command to convert an existing frame to a multi-column text frame and insert into an existing frame list. The new frame will be inserted before or after the specified IMultiColumnTextFrame.

Parameters
parent- Existing frame which will be converted to multi-column frame.
mcFrame- The multi-column frame in the existing frame list before or after which the converted frame will be inserted.
insertAfter- kTrue if the converted frame will be inserted after mcFrame, kFalse if it will be inserted before mcFrame. Default is kTrue.
frameItem- ID of the frame item. Default is kFrameItemBoss.
Returns
ICommand - ICommand of kCreateMultiColumnItemCmdBoss created.
virtual ICommand* ITextUtils::CreateConvertToMCFrameForFrameListCommand (UIDRef parent,
IFrameListframeList,
int32 insertIndex,
ClassID frameItem = kFrameItemBoss 
)
pure virtual

Creates the command to convert an existing frame to a multi-column text frame and insert into an existing frame list.

The other 2 versions of ConvertToTextFrameForFrameList are recommended. This version is just for use in case if you want to insert the frame to the middle of the frame list and don't have the corresponding IMultiColumnTextFrame. But this case is rare.

Parameters
parent- Existing frame which will be converted to multi-column frame.
frameList- The existing frame list into which the multi-column frame will be inserted.
insertIndex- Index in the frame list where the multi-column frame will be inserted.
frameItem- ID of the frame item. Default is kFrameItemBoss.
Returns
ICommand - ICommand of kCreateMultiColumnItemCmdBoss created.
virtual ICommand* ITextUtils::CreateConvertToMCFrameForStoryCommand (UIDRef parent,
ITextModelstory,
bool16 isHorizontal = kTrue,
bool16 isFrameGrid = kFalse,
bool16 isLeftToRight = kTrue,
ClassID frameItem = kFrameItemBoss 
)
pure virtual

Creates the command to convert an existing frame to a multi-column text frame, attaches to an existing story and starts a new frame list.

Parameters
parent- Existing frame which will be converted to multi-column frame.
story- The existing story to which the multi-column frame will attach.
isHorizontal- kTrue if Story orientation set to horizontal, kFalse if it is vertical. Default is kTrue.
isFrameGrid- kTrue if the Story frame set to a frame grid. kFalse if it is a text frame. Default is kFalse.
isLeftToRight- kTrue if the Story direction set to left to right. kFalse if it is right to left. Default is kTrue.
frameItem- ID of the frame item. Default is kFrameItemBoss.
Returns
ICommand - ICommand of kCreateMultiColumnItemCmdBoss created.
virtual ICommand* ITextUtils::CreateNewMCFrameCommand (UIDRef parent,
bool16 noGraphicAttr,
const PMRectboundary,
bool16 isHorizontal = kTrue,
bool16 isFrameGrid = kFalse,
bool16 isLeftToRight = kTrue,
ClassID frameItem = kFrameItemBoss,
bool16 isEndnoteStory = kFalse 
)
pure virtual

Creates the command to create a new multi-column text frame with a new story and a new frame list.

Parameters
parent- Parent page item under which to create the new frame.
noGraphicAttr- kTrue if not to set object styles for the new frame. kFalse otherwise. Usually set to kTrue.
boundary- Boundary (in pasteboard coordinates) of the spline where multi-column frame will be created.
isHorizontal- kTrue if the new story orientation is horizontal, kFalse if it is vertical. Default is kTrue.
isFrameGrid- kTrue if the new story is a frame grid. kFalse if it is a text frame. Default is kFalse.
isLeftToRight- kTrue if the new story direction is left to right. kFalse if it is right to left. Default is kTrue.
frameItem- ID of the frame item. Default is kFrameItemBoss.
isEndnoteStory- Is the new text frame going to be part of an endnote story? Default is kFalse.
Returns
ICommand - ICommand of kCreateMultiColumnItemCmdBoss created.
virtual ICommand* ITextUtils::CreateNewMCFrameCommand (UIDRef parent,
bool16 noGraphicAttr,
const PMPointListopposingCorners,
bool16 isHorizontal = kTrue,
bool16 isFrameGrid = kFalse,
bool16 isLeftToRight = kTrue,
ClassID frameItem = kFrameItemBoss 
)
pure virtual

Creates the command to create a new multi-column text frame with a new story and a new frame list.

Parameters
parent- Parent page item under which to create the new frame.
noGraphicAttr- kTrue if not to set object styles for the new frame. kFalse otherwise. Usually set to kTrue.
opposingCorners- Opposing corners (in pasteboard coordinates) of the spline where multi-column frame will be created.
isHorizontal- kTrue if the new story orientation is horizontal, kFalse if it is vertical. Default is kTrue.
isFrameGrid- kTrue if the new story is a frame grid. kFalse if it is a text frame. Default is kFalse.
isLeftToRight- kTrue if the new story direction is left to right. kFalse if it is right to left. Default is kTrue.
frameItem- ID of the frame item. Default is kFrameItemBoss.
Returns
ICommand - ICommand of kCreateMultiColumnItemCmdBoss created.
virtual ICommand* ITextUtils::CreateNewMCFrameForFrameListCommand (UIDRef parent,
bool16 noGraphicAttr,
const PMRectboundary,
IFrameListframeList,
bool16 atEnd = kTrue,
ClassID frameItem = kFrameItemBoss 
)
pure virtual

Creates the command to create a new multi-column text frame and insert to the end or beginning of the specified frame list.

Parameters
parent- Parent page item under which to create the new frame.
noGraphicAttr- kTrue if not to set object styles for the new frame. kFalse otherwise. Usually set to kTrue.
boundary- Boundary of the spline where multi-column frame will be created.
frameList- The existing frame list into which the new frame will be inserted.
atEnd- kTrue if the new frame will be appended to the end of the frame list, kFalse if it will be inserted to the beginning of the frame list. Default is kTrue.
frameItem- ID of the frame item. Default is kFrameItemBoss.
Returns
ICommand - ICommand of kCreateMultiColumnItemCmdBoss created.
virtual ICommand* ITextUtils::CreateNewMCFrameForFrameListCommand (UIDRef parent,
bool16 noGraphicAttr,
const PMRectboundary,
IMultiColumnTextFramemcFrame,
bool16 insertAfter = kTrue,
ClassID frameItem = kFrameItemBoss 
)
pure virtual

Creates the command to create a new multi-column text frame and insert into an existing frame list. The new frame will be inserted before or after the specified IMultiColumnTextFrame.

Parameters
parent- Parent page item under which to create the new frame.
noGraphicAttr- kTrue if not to set object styles for the new frame. kFalse otherwise. Usually set to kTrue.
boundary- Boundary of the spline where multi-column frame will be created.
mcFrame- The multi-column frame in the existing frame list before or after which the new frame will be inserted.
insertAfter- kTrue if the new frame will be inserted after mcFrame, kFalse if it will be inserted before mcFrame. Default is kTrue.
frameItem- ID of the frame item. Default is kFrameItemBoss.
Returns
ICommand - ICommand of kCreateMultiColumnItemCmdBoss created.
virtual ICommand* ITextUtils::CreateNewMCFrameForFrameListCommand (UIDRef parent,
bool16 noGraphicAttr,
const PMRectboundary,
IFrameListframeList,
int32 insertIndex,
ClassID frameItem = kFrameItemBoss 
)
pure virtual

Creates the command to create a new multi-column text frame and insert into an existing frame list.

The other 2 versions of QueryNewMCFrameForFrameListCmd are recommended. This version is just for use in case if you want to insert the new frame to the middle of the frame list and don't have the corresponding IMultiColumnTextFrame. But this case is rare.

Parameters
parent- Parent page item under which to create the new frame.
noGraphicAttr- kTrue if not to set object styles for the new frame. kFalse otherwise. Default is kTrue.
boundary- Boundary of the spline where multi-column frame will be created.
frameList- The existing frame list into which the new frame will be inserted.
insertIndex- index in the frame list where the new frame will be inserted.
frameItem- ID of the frame item. Default is kFrameItemBoss.
Returns
ICommand - ICommand of kCreateMultiColumnItemCmdBoss created.
virtual ICommand* ITextUtils::CreateNewMCFrameForStoryCommand (UIDRef parent,
bool16 noGraphicAttr,
const PMRectboundary,
ITextModelstory,
bool16 isHorizontal = kTrue,
bool16 isFrameGrid = kFalse,
bool16 isLeftToRight = kTrue,
ClassID frameItem = kFrameItemBoss 
)
pure virtual

Creates the command to create a new multi-column text frame, attaches to an existing story and starts a new frame list.

Parameters
parent- Parent page item under which to create the new frame.
noGraphicAttr- kTrue if not to set object styles for the new frame. kFalse otherwise. Usually set to kTrue.
boundary- Boundary of the spline where multi-column frame will be created.
story- The existing story to which the new frame will attach.
isHorizontal- kTrue if the story orientation set to horizontal, kFalse if it is vertical. Default is kTrue.
isFrameGrid- kTrue if the story set to a frame grid. kFalse if it is a text frame. Default is kFalse.
isLeftToRight- kTrue if the story direction set left to right. kFalse if it is right to left. Default is kTrue.
frameItem- ID of the frame item. Default is kFrameItemBoss.
Returns
ICommand - ICommand of kCreateMultiColumnItemCmdBoss created.
virtual UID ITextUtils::CreateNewStory (IDataBasedb,
bool16 defaults = kTrue,
ClassID clsID = kTextStoryBoss 
)
pure virtual
Create a new story in the specified database.

Parameters
defaultsspecified whether the user's default attributes should be applied to the new story
clsIDspecifies whether user specified story boss should be created
virtual ICommand* ITextUtils::CreateRecomposeThruNthParcelCmd (const ITextParcelListtpl,
int32 parcelIndex 
)
pure virtual

Returns a command to force recomposition (use to avoid CmdBehaviorMonitor asserts if you need to force recomposition from within another command)

virtual ICommand* ITextUtils::CreateRecomposeThruTextIndexCmd (const ITextParcelListtpl,
TextIndex textIndex 
)
pure virtual

Returns a command to force recomposition (use to avoid CmdBehaviorMonitor asserts if you need to force recomposition from within another command)

virtual int32 ITextUtils::DeterminePairKern (const ITextModelmodel,
TextIndex index,
ClassID kernService,
PMRealresult 
)
pure virtual

Determines the pair kern at a particular text index.

Parameters
kernServicerefers to the ClassID of a boss that has the IPairKernDict interface to use.
Returns
this method returns an ErrorCode (kSuccess, kFailure, kCancel)
virtual void ITextUtils::EditTargetStyle (IDataBasetargetDB,
const UIDtargetStyle,
AttributeBossListattributesToApply,
const UIDListuidList 
) const
pure virtual
Description: Edit the given target style with the given style attributes.

Parameters
targetDB[IN] target database
targetStyle[IN] target style
attributesToApply[IN] the attributes in the target database to apply
uidList[IN] itemList to apply
virtual TextIndex ITextUtils::FindResetOwnedItemUID (IItemStranditemStrand,
const ClassID objectType,
const UID findOldItemUID,
const TextIndex start,
const UID newItemUID 
)
pure virtual

Looks for findOldItemUI from "start" and replaces it with newItemUID in the item strand. This is typically used by commands that create owned items during import. In case the owned item is contained in a table and there is text after the end of the table (ie after the table in the tables containing text story thread) then the TextIndex stored in the command may not be valid. The returned TextIndex is the new location at which findOldItemUID was found in the item strand.

virtual TextIndex ITextUtils::FindSurroundingWord (const ITextModelpModel,
TextIndex nPosition,
int32 * pLength,
FuncIsWordChar aFunction 
)
pure virtual

Find the word at a text location.

Parameters
pModelThe text model in question.
nPositionThe text location in question.
pLengthOUT the length of the word.
aFunctiona function that determines what characters are considered word breaking.
Returns
the beginning location of the surrounding word.
See Also
IComposeScanner.
ILanguage.
virtual TextIndex ITextUtils::FindSurroundingWordUsingWordCharFuncOnly (const ITextModelpModel,
TextIndex nPosition,
int32 * pLength,
const FuncIsWordChar aFunction 
)
pure virtual

Find the word at a text location.

Parameters
pModelThe text model in question.
nPositionThe text location in question.
pLengthOUT the length of the word.
aFunctiona function that determines what characters are considered word breaking.
Returns
the beginning location of the surrounding word.
See Also
IComposeScanner.
ILanguage.
virtual bool16 ITextUtils::FocusSpansMultiplePageItems (const ITextFocuspFocus)
pure virtual

Does the focus span more than one page item frames.

virtual void ITextUtils::GenerateListsOfAttributesThatCanBeCleared (IWorkspaceworkspace,
AttributeBossListcharacterAttributes,
AttributeBossListparagraphAttributes 
)
pure virtual

Populates the two passed in attribute boss lists with all the character attributes and paragraph attributes, respectively, that can exist in a style and therefore the attributes that can be "cleared".

Parameters
workspace— Workspace to use as the basis for collecting all possible "style" attributes.
characterAttributesAttributeBossList to populate with the complete list of character attributes that can be cleared (in a style)
paragraphAttributesAttributeBossList to populate with the complete list of paragraph attributes that can be cleared (in a style)
virtual int32 ITextUtils::GetChapterNumber (IDataBasedb) const
pure virtual
Return the chapter number

Parameters
targetThe relevant text frame or an owned item
virtual void ITextUtils::GetDefaultTextAttrPreferences (const WhichTextAttrs which,
TextAttrsout,
IDocumentprefsFromDocument 
)
pure virtual

Returns the requested attributes from the preferences of the document specified. prefsFromDocument should be non nil. For paragraph and character overrides only continuing attributes are returned.

virtual void ITextUtils::GetDisplayFontNames (IFontGroupfontGroup,
IPMFontfont,
PMStringfamilyName,
PMStringstyleName,
DisplayNamesFlag namesFlag 
)
pure virtual

Gets the display font names for font

Parameters
*fontGroupfont group for font
*fontfont to get name from
&familyNameOUT
&styleNameOUT
namesFlagSee enum DisplayNamesFlag.
virtual void ITextUtils::GetDisplayFontNames (IDataBasedataBase,
const ITextAttrUIDfontUID,
const ITextAttrFontfontStyle,
PMStringfamilyName,
PMStringstyleName,
DisplayNamesFlag namesFlag 
)
pure virtual

Gets the display font names for font

Parameters
*dataBasedatabase of family UID
fontUIDfamily UID
fontStylestyle of font
&familyNameOUT
&styleNameOUT
namesFlagSee enum DisplayNamesFlag.
virtual UIDRef ITextUtils::GetFirstFrameOfStory (const UIDRefstory) const
pure virtual
Returns the Ref of first frame of the story

Parameters
storywhose first frame we need to find.
Returns
ref of spline of first MCF, otherwise kInvalidUIDRef if not able to find one
virtual bool16 ITextUtils::GetFontStyleName (ITextAttrFontfromFont,
ITextAttrFonttoFont,
PMStringstyleName 
)
pure virtual

used by ApplyTextAttrToWorkspaceCmd, UserApplyAttrCmd, and TextState.

virtual void ITextUtils::GetFormattedChapterNumberString (IDataBasedb,
PMStrings,
int32 v = kInvalidChapterNumber 
) const
pure virtual
Return the chapter number as a string.

Parameters
targetThe relevant database
sThe returned formatted string
vThe optional value to format. If v==kInvalidChapterNumber, the value is retrieved from GetChapterNumber.
virtual void ITextUtils::GetFormattedPageNumberString (const UIDReftextFrameRef,
PMStrings,
IDrawingStyle::PositionIndicator whichPage = IDrawingStyle::kDataPosition_ThisPage 
) const
pure virtual

Return the formatted string for the current, previous, or next page the given textFrame is on.

virtual void ITextUtils::GetFormattedSectionNameString (const UIDReftextFrameRef,
PMStrings 
) const
pure virtual

Return the formatted string for the section the given textFrame is on

virtual WideString ITextUtils::GetFullVisibleParagraphString (IComposeScannerscanner,
TextIndex textIndex,
int32 & paragraphSpan 
)
pure virtual
Return the text of a paragraph including any paragraph numbers at the beginning. Any non-visible characters are also stripped out.

Parameters
scannerCompose Scanner for the story with the paragraph.
textIndexposition in the paragraph.
paragraphSpan[OUT]. Length of the paragraph according to the scanner. This will NOT be the length of the returned string.
Returns
the paragrah string with non-visible characters stripped out and any numbers prepended if there are any.
virtual void ITextUtils::GetGlyphsForOverrides (ITextModelmodel,
const RangeDatarange,
const AttributeBossListoverrides,
std::vector< std::pair< Text::GlyphID, TextIndex >> * newGlyphPoints,
bool16 clearOverrides = kFalse 
) const
pure virtual
Creates Glyphs for a given text range in text model with attributes to be overriden. Does not modify composed text frame.

Appends overrides to current style and finds the glyphs.

Parameters
modelon which the whole action isto be taken. Current styles will be picked from this.
rangeof model on which the overrides need to be applied.
overrideslist of attributes,that need to be applied on range.
newGlyphPoints(out)list of Pair (glyphs and corresponding text index) that would be used with override. Does not allocate memory. Please pass reference to valid object.
clearOverridesset to true if overrides need to be cleared and not applied.
virtual IDocument* ITextUtils::GetLastDocInBook (bool16 & docWasAlreadyOpen,
int32 & startPageNum 
) const
pure virtual

Return the last document in the current active book and whether it was already opened or not.

virtual void ITextUtils::GetLocaleFromTextIndex (const UIDRefmodelRef,
const TextIndex position,
bool16 & noLang,
void * locale 
) const
pure virtual
Return the ICU Locale for the given target and position.

If the target is a TextModel, then if the position is valid, it will return the LanguageID applied to that location.

Otherwise, if target refers to a valid document, the default languageID for the document is returned.

Otherwise, kLanguageNeutral is returned.

Parameters
targetPreferably a document or a TextModel, but can be an empty UIDRef or any reference to the desired document.
positionThe position in the model. Optional.
Returns
The ID of the language applied to the given location.
virtual int32 ITextUtils::GetMultiColFrameIndex (const IMultiColumnTextFramemcf)
pure virtual
returns the index of a multicolumn frame in its thread by simply calling

IMultiColumnTextFrame::GetMCFIndex(); Note: This was broken in CS2 and was returning the index first TextFrameColumn within the FrameList. It was fixed in CS5.

virtual UIDRef ITextUtils::GetNextPageNumberFrameRef (const UIDReftextFrameRef) const
pure virtual

Return the UIDRef for the page number after to the one the given textFrame is on

virtual int32 ITextUtils::GetPageCount (const UIDReftarget,
enum PageCountScopes scope 
) const
pure virtual
Return the page count based on the given scope

Parameters
targetThe relevant text frame or an owned item
virtual int32 ITextUtils::GetPageNumber (const UIDReftextFrameRef) const
pure virtual

Return the page number for the page the given textFrame is on

virtual ClassID ITextUtils::GetPageNumberFormatter (const UIDReftextFrameRef) const
pure virtual

Return the number formatter for the page the given textFrame is on. Formatter is also applicable for chapter numbers.

virtual int32 ITextUtils::GetPageNumberFromPageUID (const UIDRefpage) const
pure virtual

Return the page number for the page with given page uid

virtual UIDRef ITextUtils::GetPageUIDRef (const UIDReftextFrameRef) const
pure virtual
Return the UIDRef for the page the given textFrame is on

Parameters
targetThe textFrame or OwnedItem whose page number is desired.
virtual bool16 ITextUtils::GetParcelContentBounds (ITextParcelListtpl,
TextIndex at,
PMRectpCBounds 
)
pure virtual

Get the Content Bounds of the Parcel at the specified TextIndex. If there is no Parcel at that TextIndex then it returns kFalse. Note that if the text at that location isn't fully composed then the Parcel you get may not be the same Parcel after composition.

virtual UIDRef ITextUtils::GetPreviousPageNumberFrameRef (const UIDReftextFrameRef) const
pure virtual

Return the UIDRef for the page number previous to the one the given textFrame is on

virtual void ITextUtils::GetPrimaryStoryAnchor (UIDRefstoryRef,
RangeDatarange 
) const
pure virtual

Calculate the range in the main story thread that ultimately owns the given range. e.g. Works to backtrack from a footnote or note or inline to the owning text index.

Parameters
point1[IN/OUT] storyRef, the story that ultimately "owns" the given range.
point2[IN/OUT] range, the "owning" range of the original given range.
virtual void ITextUtils::GetPrimaryThreadAnchor (const ITextModelmodel,
RangeDatarange 
) const
pure virtual

Calculate the range in the main story thread that owns the given range. within the same TextModel. Unlike GetPrimaryStoryAnchor() above, this method does NOT attempt to back out of inlines into a different story.

Parameters
modelTextModel to work on
range[IN/OUT] the "owning" range of the original given range.
virtual void ITextUtils::GetSelectedTextItemsFromLayoutTarget (const ILayoutTargetlayoutTarget,
UIDListtextframes,
UIDListmcfs,
UIDListsplineItems 
)
pure virtual

GetSelectedTextItemsFromLayoutTarget gathers UIDs for the text frames that are currently selected.

Parameters
layoutTargetIN The current ILayoutTarget you want to gather selected text items from.
textframesOUT The text frames that are currently selected.
mcfsOUT The multi column frames that are currently selected.
splineItemsOUT The spline items that are currently selected.
virtual void ITextUtils::GetSelectedTextItemsFromTextTarget (const ITextTargettextTarget,
UIDListtextframes,
UIDListmcfs,
UIDListsplineItems 
)
pure virtual

GetSelectedTextItemsFromTextTarget gathers UIDs for the text frames that are currently selected.

Parameters
textTargetIN The current ITextTarget you want to gather selected text items from.
textframesOUT The text frames that are currently selected.
mcfsOUT The multi column frames that are currently selected.
splineItemsOUT The spline items that are currently selected.
virtual void ITextUtils::GetSelectedTextItemsFromUIDList (const UIDListpageITems,
UIDListtextframes,
UIDListmcfs,
UIDListsplineItems 
)
pure virtual

GetSelectedTextItemsFromLayoutTarget gathers UIDs for the text frames that are currently selected.

Parameters
UIDListIN The pageitems to look through for text frames
textframesOUT The text frames that are currently selected.
mcfsOUT The multi column frames that are currently selected.
splineItemsOUT The spline items that are currently selected.
virtual int32 ITextUtils::GetSpreadMultiColumnTextFrames (const UIDRefspreadRef,
UIDListpList 
) const
pure virtual
Description: Fills in list of IMultiColumnTextFrames known to the

spread. by calling the ISpreadMultiColumnFrames interface on the specified Spread.

Parameters
spreadRefUIDRef to spread to return MCFs from
pListUIDList to fill
Returns
Length of pList
virtual int32 ITextUtils::GetSpreadTextFrameColumns (const UIDRefspreadRef,
UIDListpList 
) const
pure virtual
Description: Fills in list of ITextFrameColumns known to the spread by

calling the ISpreadMultiColumnFrames interface on the specified Spread.

Parameters
spreadRefUIDRef to spread to return TFCs from
pListUIDList to fill
Returns
Length of pList
virtual bool16 ITextUtils::GetTargetContainerContinues (const UIDReftarget) const
pure virtual

Return whether or not the container for the given target continues elsewhere (e.g. a table continues to another frame)

virtual bool16 ITextUtils::GetTargetIsInContinuedContainer (const UIDReftarget) const
pure virtual

Return whether or not the container for the given target is continued from elsewhere (e.g. a table is continued from the previous frame)

virtual void ITextUtils::GetTextFramesContaining (const ITextModeltextModel,
const RangeDatarange,
int32 * pFirstFrameIndex,
int32 * pLastFrameIndex 
)
pure virtual

GetTextFramesContaining returns the range of TextFrames that the Parcels containing the Text Range map to. The Range MUST be within a single StoryThread. pFirstFrameIndex will be -1 if the Text Range does not map to a Text Frame.

virtual UID ITextUtils::GetTextFramesPageItemUID (IGeometrypageItem) const
pure virtual

Returns the uid of the page which this text frame is one, can return kInvalidUID

Parameters
pageItem– pageitem to find page UID of
Returns
UID
virtual void ITextUtils::GetUIDListOfInlines (IParcelparcel,
bool16 bWithDropCaps,
UIDListresultList 
)
pure virtual

returns the child for each Inline UID in the owned item strand

virtual void ITextUtils::GetUIDListOfTextFramesFromRange (const ITextModeltextModel,
const RangeDatarange,
UIDListresultList 
)
pure virtual

GetUIDListOfTextFrames returns a list of TextFrames that the Parcels containing the specified Text Range map to. The Range MAY cross StoryThread boundries.

virtual void ITextUtils::GetUsedInks (const ITextModeltextModel,
TextIndex threadEnd,
TextIndex start,
int32 len,
IInkResourceDatainkResourceData 
)
pure virtual

Fills in inkResourceData with the known inks in the specified Range. It incorporates handling of the last CR in the Story Thread, so callers need not take care of removing it from the range.

Notes:

  1. This routine only examines Text attributes from a canned list and is currently not extensible.
  2. The caller is responsible for making sure that the specified range is fully composed.
virtual PMMatrix ITextUtils::GetWaxToFrameMatrix (const IParcelparcel)
pure virtual

Return the PMMatrix to transform a point in WaxCoordinates in a Parcel to the owning Frame. Useful if you are an inline and you want to find out where you are relative to the Frame.

virtual void ITextUtils::GetWordCountInfo (const ITextModeliTextModel,
const uint32 & startIndex,
const int32 & lengthToCount,
const ITextUtils::WordCountUpdateActionaction,
const ITextUtils::WordCountUpdateState & state,
bool16 & wordStarted,
uint32 & fullWidthChars,
uint32 & oversetFullWidthChars,
uint32 & halfWidthChars,
uint32 & oversetHalfWidthChars,
uint32 & japaneseChars,
uint32 & oversetJapaneseChars,
uint32 & kanjis,
uint32 & oversetKanjis,
uint32 & words,
uint32 & oversetWords,
uint32 & lines,
uint32 & oversetLines,
uint32 & paragraphs,
uint32 & oversetParagraphs,
uint32 & allChars,
uint32 & oversetAllChars,
bool16 & bWordAcrossOverset,
TextStoryThreadHelperhelper 
)
pure virtual

Do roman character, all character, katakana, hiragana, kanji, paragraph and line count

Parameters
startIndex— start index for counting
lengthToCount— how far should count stop.
action— just update line or update all.
state— start or continue counting.
wordStarted— left over state(word is started or not) of last time.
fullWidthChars— count of full-width chars including full-width numbers, symbols and punctuations. (passed out parameter)
oversetFullWidthChars— count of full-width chars including full-width numbers, symbols and punctuations in overset. (passed out parameter)
halfWidthChars— count of half-width chars including half-width numbers, symbols and punctuations. (passed out parameter)
oversetHalfWidthChars— count of half-width chars including half-width numbers, symbols and punctuations in overset. (passed out parameter)
japaneseChars— count of japanese chars including full and half-width Hiragana and Katakana. (passed out parameter)
oversetJapaneseChars— count of japanese chars including full and half-width Hiragana and Katakana in overset. (passed out parameter)
kanjis— count of kanjis. (passed out parameter)
oversetKanjis— count of kanjis in overset. (passed out parameter)
words— count of words. (passed out parameter)
oversetWords— count of words in overset. (passed out parameter)
lines— count of lines. (passed out parameter)
oversetLines— count of lines in overset. (passed out parameter)
paragraphs— count of paragraphs. (passed out parameter)
oversetParagraphs— count of paragraphs in overset. (passed out parameter)
allChars— count of all characters(passed out parameter)
oversetAllChars— count of all characters in overset. (passed out parameter)
virtual const WideString& ITextUtils::GetXRefChapterNumberVariableName ()
pure virtual

Returns a pointer to a WideString with the name of the XRefChapterNumberVariable.

Returns
WideString
virtual const WideString& ITextUtils::GetXRefPageNumberVariableName ()
pure virtual

Returns a pointer to a WideString with the name of the XRefPageNumberVariable.

Returns
WideString
virtual int32 ITextUtils::GuessScriptOfText (const char * anyText,
int32 preferredWritingScript = kDontKnowScript 
)
pure virtual

returns the best guess for the text's writing script, preferredWritingScript is being used as a hint.

virtual bool16 ITextUtils::IsAdobeFont (IPMFont const * font)
pure virtual

Does this font carry an Adobe copyright?

virtual bool16 ITextUtils::IsBoldItalicStyleName (const PMStringstyleName)
pure virtual

Is this style name considered bold and italic?

virtual bool16 ITextUtils::IsBoldStyleName (const PMStringstyleName)
pure virtual

Is this style name considered bold? (For example, "Bold", "Heavy", "Black")

virtual bool16 ITextUtils::IsFocusAFootnote (const ITextFocuspFocus,
UIDRefpFootnoteUIDRef = nil 
)
pure virtual

returns whether the given ITextFocus is a footnote and optionally returns the UIDRef for that footnote

Parameters
pFocus— The ITextFocus in question
pFootnoteUIDRef— If non-nil and there is a footnote at that model-position, the UIDRef of the footnote
Returns
Whether the focus is a footnote.
virtual bool16 ITextUtils::IsFootnote (const ITextModelmodel,
TextIndex position,
UIDRefpFootnoteUIDRef = nil 
)
pure virtual

returns whether the position in the model is a footnote and optionally returns the UIDRef for that footnote

Parameters
model— The model in question
position— The position in the given model
pFootnoteUIDRef— If non-nil and there is a footnote at that model-position, the UIDRef of the footnote
Returns
Whether that model-position is a footnote.
virtual bool16 ITextUtils::IsItalicStyleName (const PMStringstyleName)
pure virtual

Is this style name considered italic? (For example, "Italic", "Oblique")

virtual bool16 ITextUtils::IsLeftToRightRun (const IWaxLinewaxLine,
TextIndex ti 
) const
pure virtual
Returns whether or not the run at the text index within the specified line is left to right direction.

Parameters
waxLinethe line to examine.
textIndexposition in the line.
Returns
kTrue if the run direction is left to right, otherwise kFalse.
virtual bool16 ITextUtils::IsMultiColumnFrame (const IPMUnknownobj) const
inlinevirtual
Return whether or not the given object is a MultiColumn TextFrame

Parameters
objcan be any object
virtual bool16 ITextUtils::IsOpenTypeFamily (IFontFamilyfontFamily)
pure virtual

Is this font family an opentype font family?

virtual bool16 ITextUtils::IsOpenTypeFont (const IPMFontfont)
pure virtual

Is this font an opentype font?

virtual bool16 ITextUtils::IsOverset (const IFrameListfl)
pure virtual
Is the text parcel list overset?

Returns
returns kTrue if the specified ParcelList has any characters in addition to the final carriage return not mapped to a Parcel. If it's ONLY the final carriage return that is overset that it is NOT considered overset.
virtual bool16 ITextUtils::IsPlainStyleName (const PMStringstyleName)
pure virtual

Is this style name considered plain? (For example, "Roman", "Regular", "")

virtual bool16 ITextUtils::IsScriptOfText (const char * anyText,
int32 writingScript 
)
pure virtual

returns false if writingScript and text are contradicting.

virtual bool16 ITextUtils::IsTextValidForInsertion (WideString const & text) const
pure virtual

Checks if the specified text is valid for insertion in the text model. Some control characters are not accepted by the text model.

See Also
TextChar::IsIllegalControlChar().
Parameters
text[IN] text to be checked for validity.
Returns
kTrue if the text is valid.
virtual bool16 ITextUtils::IsVerticalColumnRuleActive (const IPMUnknownshape)
pure virtual
Return kTrue if vertical column rule is active on given shape

Parameters
shapeThe shape of mcf
Returns
bool16 Is vertical column rule active on shape.
virtual ErrorCode ITextUtils::LinkTextFrames (const IMultiColumnTextFrametextFrameA,
const IMultiColumnTextFrametextFrameB,
bool16 prepend 
)
pure virtual

Link two text frames together as follows: If prepend is kFalse, then the textFrameA will be linked to textFrameB. Thus, existing text will flow from textFrameA to textFrameB. If prepend is kTrue, then the textFrameB will be linked to textFrameA. Thus, existing text will flow from textFrameB to textFrameA. In both cases, textFrameB will inherit textFrameA's attributes (e.g. vertical or horizontal frame).

Parameters
textFrameA- see desc above.
textFrameB- see desc above.
prepend- see desc above.
virtual void ITextUtils::NotifyOversetChanged (const IFrameListframeList)
pure virtual

Notifies the last Frame in the FrameList that its overset state may have changed. This call simply posts the appropriate inval rect for the location of the overset indicator and adds the Frame to the RecomposedFrames list. Note that the caller must ensure that at least one Frame in the FrameList is damaged or else the inval may never be played until the Frame becomes damaged and is recomposed.

Parameters
frameList
virtual ICommand* ITextUtils::QueryCopyStoryCommand (const UIDRefsource,
const UIDRefdest,
const StoryRangesourceRange,
const StoryRangedestRange,
const bool16 ignoreAttributes = kFalse 
)
pure virtual
Function for copying text from one story to another.

This replaces the range in the destination story with a copy of the specified text from the source story.

Parameters
sourceThe UIDRef of the source ITextModel.
destThe UIDRef of the destination ITextModel.
ignoreAttributesIgnore the attributes on copy, default to kFalse
virtual ICommand* ITextUtils::QueryCopyStoryFromAllToAllCommand (const UIDRefsource,
const UIDRefdest,
const bool16 ignoreAttributes = kFalse 
)
pure virtual
Function for copying all of the text from one story to another.

This replaces the destination story with a copy of the source story.

Parameters
sourceThe UIDRef of the source ITextModel.
destThe UIDRef of the destination ITextModel.
ignoreAttributesIgnore the attributes on copy, default to kFalse
virtual ICommand* ITextUtils::QueryCopyStoryFromAllToEndCommand (const UIDRefsource,
const UIDRefdest,
const bool16 ignoreAttributes = kFalse 
)
pure virtual
Function for copying text from one story to another.

This copies the entire source story to the end of the destination story.

Parameters
sourceThe UIDRef of the source ITextModel.
destThe UIDRef of the destination ITextModel.
ignoreAttributesIgnore the attributes on copy, default to kFalse
virtual ICommand* ITextUtils::QueryCopyStoryToEndCommand (const UIDRefsource,
const UIDRefdest,
const StoryRangesourceRange,
const bool16 ignoreAttributes = kFalse 
)
pure virtual
Function for copying text from one story to another.

This copies the specified text from the source story to the end of the destination story.

Parameters
sourceThe UIDRef of the source ITextModel.
destThe UIDRef of the destination ITextModel.
ignoreAttributesIgnore the attributes on copy, default to kFalse
virtual IHierarchy* ITextUtils::QueryForHierarchyMember (IDataBasedb,
const ITextFrameColumntextFrame 
) const
pure virtual

Convert the textFrame to a member of IHierarchy (even if the textFrame is Text-on-a-Path)

virtual IMultiColumnTextFrame* ITextUtils::QueryMCFOrTOPFromSpline (const IGraphicFrameDatagfd) const
pure virtual
If the spline contains text, return the associated multi-column object.

If spline doesn't contain text and if the spline has TOP, return the multi-column object associated with kTOPFrameItemBoss. return nil, for other conditions.

virtual ICommand* ITextUtils::QueryMoveStoryCommand (const UIDRefsource,
const UIDRefdest,
const StoryRangesourceRange,
const StoryRangedestRange,
const bool16 ignoreAttributes = kFalse 
)
pure virtual
Function for moving text from one story to another.

This replaces the range in the destination story with the specified text from the source story. The source range is removed from the source story.

Parameters
sourceThe UIDRef of the source ITextModel.
destThe UIDRef of the destination ITextModel.
ignoreAttributesIgnore the attributes on move, default to kFalse
virtual ICommand* ITextUtils::QueryMoveStoryFromAllCommand (const UIDRefsource,
const UIDRefdest,
const StoryRangedestRange,
const bool16 ignoreAttributes = kFalse 
)
pure virtual
Function for moving text from one story to another.

The entire source story is moved to the destination range.

Parameters
sourceThe UIDRef of the source ITextModel.
destThe UIDRef of the destination ITextModel.
ignoreAttributesIgnore the attributes on move, default to kFalse
virtual ICommand* ITextUtils::QueryMoveStoryFromAllToAllCommand (const UIDRefsource,
const UIDRefdest,
const bool16 ignoreAttributes = kFalse 
)
pure virtual
Function for moving text from one story to another.

This replaces the destination story with the source story. The source range is removed from the source story.

Parameters
sourceThe UIDRef of the source ITextModel.
destThe UIDRef of the destination ITextModel.
ignoreAttributesIgnore the attributes on move, default to kFalse
virtual ICommand* ITextUtils::QueryMoveStoryFromAllToEndCommand (const UIDRefsource,
const UIDRefdest,
const bool16 ignoreAttributes = kFalse 
)
pure virtual
Function for moving text from one story to another.

This moves the entire source story to the end of the destination story. The source range is removed from the source story.

Parameters
sourceThe UIDRef of the source ITextModel.
destThe UIDRef of the destination ITextModel.
ignoreAttributesIgnore the attributes on move, default to kFalse
virtual IMultiColumnTextFrame* ITextUtils::QueryMultiColumnFrame (ITextFrameColumntfc) const
pure virtual
Given an ITextFrameColumn, return the associated MultiColumn TextFrame.

Parameters
tfcPointer to ITextFrameColumn
virtual const IMultiColumnTextFrame* ITextUtils::QueryMultiColumnFrame (const ITextFrameColumntfc) const
pure virtual

Const version of QueryMultiColumnFrame

virtual UID ITextUtils::QueryMultiColumnFrameUID (const ITextFrameColumntfc) const
pure virtual

UID version of QueryMultiColumnFrame

virtual IHierarchy* ITextUtils::QuerySplineFromTextFrame (const IMultiColumnTextFramemcf) const
pure virtual
Given an IMultiColumnTextFrames, return the spline associated with it

Parameters
mcfPointer to IMultiColumnTextFrame
Returns
Pointer to IHierarchy
virtual IHierarchy* ITextUtils::QuerySplineFromTextFrame (const ITextFrameColumntfc) const
pure virtual
Given an ITextFrameColumn, return the spline associated with the parent MultiColumnTextFrame.

Parameters
tfcPointer to ITextFrameColumn
Returns
Pointer to IHierarchy
virtual UTF32TextChar ITextUtils::RemapCharacterValue (IPMFontoldFont,
IPMFontnewFont,
const UTF32TextChartextChar 
)
pure virtual

returns the remapped textchar after converting to platform encoding using oldFont and back to newFont.

virtual int32 ITextUtils::RemapCharacterValues (IPMFontoldFont,
IPMFontnewFont,
const textchar * buffer,
int32 bufferLength,
WideStringreplacedChars 
)
pure virtual

returns the position of first remapped textchar in buffer and copies the remapped textchars in replacedChars after converting to platform encoding using oldFont and back to newFont.

virtual bool16 ITextUtils::RemapFontStyles (IDataBasedataBase,
const AttributeBossListstateOverrides,
const AttributeBossListnewOverrides,
PMStringstyleName,
Fixed *& axesInfo,
int & numAxes,
ClassID textAttrFontUIDBoss = kTextAttrFontUIDBoss,
ClassID textAttrFontStyleBoss = kTextAttrFontStyleBoss,
bool16 remapExactFontStylesOnly = kFalse 
)
pure virtual

Remap font styles tries to choose the expected family/style and allow roundtripping.

Parameters
AxesInfo- pass this returns back axes info for variable font filled if variable font
numAxes- returns number of design axes in variable font

***Client responsibility to clear the design axes after API use***

example for reference if(numAxes && AxesInfo) { fontStyleAttr->SetMMAxes(numAxes,axesInfo); delete[] axesInfo; }

virtual bool16 ITextUtils::RemapFontStylesWithOPSZ (IDataBasedataBase,
const AttributeBossListstateOverrides,
const AttributeBossListnewOverrides,
PMStringstyleName,
Fixed *& axesInfo,
int & numAxes,
ClassID textAttrFontUIDBoss = kTextAttrFontUIDBoss,
ClassID textAttrFontStyleBoss = kTextAttrFontStyleBoss,
bool16 remapExactFontStylesOnly = kFalse,
PMReal pointSize = -1 
)
pure virtual

Remap font styles tries to choose the expected family/style and allow roundtripping.

Parameters
AxesInfo- pass this returns back axes info for variable font filled if variable font
numAxes- returns number of design axes in variable font

***Client responsibility to clear the design axes after API use***

example for reference if(numAxes && AxesInfo) { fontStyleAttr->SetMMAxes(numAxes,axesInfo); delete[] axesInfo; }

Parameters
pointSize- default -1, but for the cases where we want optical axis mapping we need to pass it.
virtual void ITextUtils::RepairGenericDataLink (UIDRef oldStoryRef,
UIDRef newStoryRef 
)
pure virtual

Fix up TOC/Index/Third party links when placing a story.

Parameters
oldStoryRef[IN] The destination of the fixing operation. The story being fixed.
newStoryRef[IN] The source of the fixing operation.
virtual LanguageID ITextUtils::ScriptToLanguageID (int32 writingScript)
pure virtual

Writing script to Language ID conversion.

virtual bool16 ITextUtils::SkipTextCharForFontLocking (const UTF32TextChartextChar)
pure virtual
returns whether the char needs to be skipped during remapping.

Used by UserApplyAttrCmd, ScriptUserEditCmdResp, and CJKUserEditCmdResp.

virtual bool16 ITextUtils::SkipTextCharForRemapping (const UTF32TextChartextChar)
pure virtual
returns whether the char needs to be skipped during remapping.

Used by Text::RemapCharacterValue.