#include <ITextEditorUtils.h>
|
| enum | { kDefaultIID = IID_ITEXTEDITORUTILS } |
| |
|
| 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 IDialog * | ShowCharacterAlternatesUI (const PMPoint &globalPt, const char *classForLogs) const =0 |
| |
| virtual bool16 | IsCharacterAlternatesUIShown () const =0 |
| |
| virtual IControlView * | GetCharacterAlternatesView () 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 |
| |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| |
| virtual void | AddRef () const =0 |
| |
| virtual void | Release () const =0 |
| |
Utilities related to the text editor. e.g.
Utils<ITextEditorUtils>()->HitTestStoryThread( ... ) ;
| virtual bool16 ITextEditorUtils::ActivateTextEditorView | ( | IControlView * | view, | | | const UIDRef & | splineRef | | ) | | 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
- Returns
- kTrue if the editor was activated, kFalse otherwise.
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
| storyThread | IN the story thread to hit test. |
| view | IN the control view to use for hittesting. |
| charHit | IN/OUT the value returned from HitTestStoryThread. |
| nextLine | IN text index of the first character in the next line after the line hit (as generated from HitTestStoryThread) |
| useCharHitForParagraphSnap | OUT – 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 | ( | ITextModel * | pModel, | | | 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 | ( | ITextModel * | model | ) | 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 PMMatrix & | innerToPBMatrix, | | | CursorSpec & | spec | | ) | | |
| pure virtual |
Compute the cursor spec for the given matrix. Returns one of eight different cursor depending on degree of rotation in matrix.
- Parameters
| innerToPBMatrix | IN the matrix for the object in question |
| spec | OUT the returned cursor spec to match the given matrix. |
- Returns
- the appropriate I-Beam cursor given an innerToPasteboard matrix.
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
| currentPt | global mouse point |
| view | the view the point is in |
| modifiers | the cursor modifier keys |
| defaultCursor | the default cursor to use |
- Returns
- CursorSpec the new cursor to use
Get the adornment on text selection if any.
- Returns
- adornment on text selection, nil otherwise.
Find the text index of the hit character in a story thread. Works in layout and galley view.
- Parameters
| storyThread | IN the story thread to hit test. |
| parcelKey | IN the ParcelKey to use for hittesting. |
| view | IN the control view to use for hittesting. |
| viewLoc | IN the pasteboard coordinates of the point to hit test. |
| nextLine | OUT 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
| alternatesData | IN character alternates data |
| index | IN index of the character alternate to preview or replace instead of selection. |
| preview | IN 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.
Invoke the dialog to manage text variables.
- Parameters
| varTable | IN the variable table to manage. |
| varName | IN if non-empty, the variable to select in the list within the dialog. |
Convert a model text range to a display text range. In Galley and Story, text model and text display indices can differ.
- Parameters
| model | IN the text model. |
| view | IN the control view to use for hittesting. |
| hitIndex | IN the text model index to adjust to display index. |
| rangeToConvert | IN 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
| isWordSelection | OUT 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 PMPoint & | globalPt, | | | const char * | classForLogs | | ) | | const |
| pure virtual |
Show the On context UI for character alternates for the text selection if any.
- Parameters
| globalPt | IN Point in global space at whice to show the alternates UI. |
| classForLogs | IN for internal use only |
| virtual void ITextEditorUtils::ShowOpenTypeIcon | ( | | ) | const |
| pure virtual |
Show the icon for OpenType ContextMenu
- Parameters
| globalPt | IN Point in global space at whice to show the widget with icon. |
| classForLogs | IN for internal use only |