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

#include <ITextEditorUtils.h>

Inheritance diagram for ITextEditorUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ITEXTEDITORUTILS }
 

Public Member Functions

virtual void GetIBeamCursor (const PMMatrix &innerToPBMatrix, CursorSpec &spec)=0
 
virtual CursorSpec GetPointerCursorForTextTool (const SysPoint currentPt, IControlView *view, ICursorMgr::eCursorModifierState modifiers, CursorSpec defaultCursor)=0
 
virtual PMReal HitTestStoryThread (ITextStoryThread *storyThread, ParcelKey key, IControlView *view, const PMPoint &viewLoc, TextIndex *nextLine)=0
 
virtual RangeData AdjustHitTestTextIndex (ITextStoryThread *storyThread, IControlView *view, PMReal &charHit, const TextIndex nextLine, bool16 *useCharHitForParagraphSnap=nil)=0
 
virtual RangeData PrepareToConvertToDisplay (ITextModel *model, IControlView *view, TextIndex hitIndex, RangeData rangeToConvert)=0
 
virtual ErrorCode ManageVariables (ITextVariableTable *varTable, const PMString *varName)=0
 
virtual bool16 ActivateTextEditorView (IControlView *view, const UIDRef &splineRef) const =0
 
virtual const
ITextSelectionAdornment
GetTextSelectionAdornment () const =0
 
virtual IDialogShowCharacterAlternatesUI (const PMPoint &globalPt, const char *classForLogs) const =0
 
virtual bool16 IsCharacterAlternatesUIShown () const =0
 
virtual IControlViewGetCharacterAlternatesView () const =0
 
virtual void CloseCharacterAlternatesUI () const =0
 
virtual bool16 ShouldShowCharacterAlternatesUI (bool16 &isWordSelection, TextIndex &indexOfFirstCharWithAlt) const =0
 
virtual ErrorCode FillWithPlaceHolderText (ITextModel *model) const =0
 
virtual ErrorCode DeletePlaceHolderText (ITextModel *pModel, bool16 &deleted) const =0
 
virtual void InsertAlternateForSelection (const ICharacterAlternatesData *alternatesData, const int32 &index) const =0
 
virtual void ShowOpenTypeIcon () const =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

Utilities related to the text editor. e.g.

Utils<ITextEditorUtils>()->HitTestStoryThread( ... ) ;

Member Function Documentation

virtual bool16 ITextEditorUtils::ActivateTextEditorView (IControlViewview,
const UIDRefsplineRef 
) const
pure virtual
Activate TextEditor View

This method represents code pulled out of CreateMultiColumnItemCmd to activate the text editor view (by selecting text) after the MCF was created. The restrictions are: 1) the specified splineRef must NOT be for a TOP, 2) the MCF which is the child of the specified spline must own the first TextFrameColumn in its IFrameList, and 3) the active tool has to be ITool::kTextSelection.

Parameters
viewPointer to IControlView
splineRefUIDRef of object with IGraphicFrameData interface
Returns
kTrue if the editor was activated, kFalse otherwise.
virtual RangeData ITextEditorUtils::AdjustHitTestTextIndex (ITextStoryThreadstoryThread,
IControlViewview,
PMRealcharHit,
const TextIndex nextLine,
bool16 * useCharHitForParagraphSnap = nil 
)
pure virtual
Interpret the result from HitTestStoryThread an return a range (of length 0) to be used by text selection tracking code. Works in layout and galley view.

Parameters
storyThreadIN the story thread to hit test.
viewIN the control view to use for hittesting.
charHitIN/OUT the value returned from HitTestStoryThread.
nextLineIN text index of the first character in the next line after the line hit (as generated from HitTestStoryThread)
useCharHitForParagraphSnapOUT – used only by the TextSelectionSuite for when to snap the paragraph
Returns
text range (of length 0) adjusted for where the cursor caret will be.
virtual void ITextEditorUtils::CloseCharacterAlternatesUI () const
pure virtual

Close the On context UI for character alternates for the text selection if any.

virtual ErrorCode ITextEditorUtils::DeletePlaceHolderText (ITextModelpModel,
bool16 & deleted 
) const
pure virtual

Delete the place holder text. This method detects if the text present is user content or place holder text. If it is a placeholder text then deletes it.

virtual ErrorCode ITextEditorUtils::FillWithPlaceHolderText (ITextModelmodel) const
pure virtual

Fill with place holder text.

virtual IControlView* ITextEditorUtils::GetCharacterAlternatesView () const
pure virtual

Return the character alternates context UI view if the alternates context UI is shown for the text selection.

Returns
control view for the character alternates context UI.
virtual void ITextEditorUtils::GetIBeamCursor (const PMMatrixinnerToPBMatrix,
CursorSpecspec 
)
pure virtual
Compute the cursor spec for the given matrix. Returns one of eight different cursor depending on degree of rotation in matrix.

Parameters
innerToPBMatrixIN the matrix for the object in question
specOUT the returned cursor spec to match the given matrix.
Returns
the appropriate I-Beam cursor given an innerToPasteboard matrix.
virtual CursorSpec ITextEditorUtils::GetPointerCursorForTextTool (const SysPoint currentPt,
IControlViewview,
ICursorMgr::eCursorModifierState modifiers,
CursorSpec defaultCursor 
)
pure virtual

Compute the pointer cursor to use with the given modifier keys. Used when IBeam or TOP tool is active, but user has toggled to pointer tool with command/ctrl key (and possibly other modifiers) down.

Parameters
currentPtglobal mouse point
viewthe view the point is in
modifiersthe cursor modifier keys
defaultCursorthe default cursor to use
Returns
CursorSpec the new cursor to use
virtual const ITextSelectionAdornment* ITextEditorUtils::GetTextSelectionAdornment () const
pure virtual

Get the adornment on text selection if any.

Returns
adornment on text selection, nil otherwise.
virtual PMReal ITextEditorUtils::HitTestStoryThread (ITextStoryThreadstoryThread,
ParcelKey key,
IControlViewview,
const PMPointviewLoc,
TextIndex * nextLine 
)
pure virtual
Find the text index of the hit character in a story thread. Works in layout and galley view.

Parameters
storyThreadIN the story thread to hit test.
parcelKeyIN the ParcelKey to use for hittesting.
viewIN the control view to use for hittesting.
viewLocIN the pasteboard coordinates of the point to hit test.
nextLineOUT text 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. Returns -1 if no hit (e.g. parcel is from text that damaged)
virtual void ITextEditorUtils::InsertAlternateForSelection (const ICharacterAlternatesData * alternatesData,
const int32 & index 
) const
pure virtual

Insert the character at the specified index in the mini glyph panel for preview.

Parameters
alternatesDataIN character alternates data
indexIN index of the character alternate to preview or replace instead of selection.
previewIN is preview only.
virtual bool16 ITextEditorUtils::IsCharacterAlternatesUIShown () const
pure virtual

Return true if the character alternates context UI is shown for the text selection.

Returns
kTrue if character alternates context UI is shown, kFalse otherwise.
virtual ErrorCode ITextEditorUtils::ManageVariables (ITextVariableTablevarTable,
const PMStringvarName 
)
pure virtual
Invoke the dialog to manage text variables.

Parameters
varTableIN the variable table to manage.
varNameIN if non-empty, the variable to select in the list within the dialog.
virtual RangeData ITextEditorUtils::PrepareToConvertToDisplay (ITextModelmodel,
IControlViewview,
TextIndex hitIndex,
RangeData rangeToConvert 
)
pure virtual
Convert a model text range to a display text range. In Galley and Story, text model and text display indices can differ.

Parameters
modelIN the text model.
viewIN the control view to use for hittesting.
hitIndexIN the text model index to adjust to display index.
rangeToConvertIN the text model range to convert to a display text range
Returns
the display text range.
virtual bool16 ITextEditorUtils::ShouldShowCharacterAlternatesUI (bool16 & isWordSelection,
TextIndex & indexOfFirstCharWithAlt 
) const
pure virtual

Return true if the character alternates context UI should be shown for the text selection.

Parameters
isWordSelectionOUT kTrue is selection is a word, kFalse otherwise.
Returns
kTrue if character alternates context UI should be shown, kFalse otherwise.
virtual IDialog* ITextEditorUtils::ShowCharacterAlternatesUI (const PMPointglobalPt,
const char * classForLogs 
) const
pure virtual

Show the On context UI for character alternates for the text selection if any.

Parameters
globalPtIN Point in global space at whice to show the alternates UI.
classForLogsIN for internal use only
virtual void ITextEditorUtils::ShowOpenTypeIcon () const
pure virtual

Show the icon for OpenType ContextMenu

Parameters
globalPtIN Point in global space at whice to show the widget with icon.
classForLogsIN for internal use only