Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TInputMethodTextPresentation
Inherited By:
None.
Purpose:
TTextInputMethodTextPresentation is derived from TInputMethodTextPresentation. It uses a typing interactor and text view to implement the pure virtual functions defined by the base class, as well as a filter to superpose styles on text being edited without the styles actually being in the text.
TTextInputMethodTextPresentation is used by the CommonPoint Text Editing Framework and text editors derived from that framework.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
This class is designed to be used directly.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
Other Considerations:
None.
virtual ~ TTextInputMethodTextPresentation ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TTextInputMethodTextPresentation (TTypingInteractor * inter, TTextView * view)
Interface Category:
API.
Purpose:
Standard constructor. Creates a TTextInputMethodTextPresentation object that uses the specified typing interactor and text view to implement its member functions.
Calling Context:
Called by a text editor to create a TTextInputMethodTextPresentation object that uses the specified typing interactor and text view to implement its member functions.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void AdoptBehavior (MEventTarget * behavior)
Interface Category:
API.
Purpose:
Adopts the specified input method behavior.
Calling Context:
Called to implement the input method's user interface by having the input method behavior adopted. The behavior intercepts keystrokes and mouse clicks, and performs appropriate actions to implement the user interface.
Parameters:
- MEventTarget * behavior -The input method behavior to adopt.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void OrphanBehavior (MEventTarget * behavior)
Interface Category:
API.
Purpose:
Orphans the specified input method behavior.
Calling Context:
Called by the input method when the active area closes, or when the input method is removed.
Parameters:
- MEventTarget * behavior -The input method behavior to orphan.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void AddActiveStyles (const TStyleSet & stylesToAdd, const TTextRange & whereToAdd, const TStyleKind & kind =TCharacterStyleRuns :: GetStyleKind ())
Interface Category:
Sets and displays the specified styles for the specified range of text.
Calling Context:
Called by the input method when the styles are added during input.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
API.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void RemoveActiveStyles (const TStyleSet & stylesToRemove, const TTextRange & whereToRemove, const TStyleKind & kind =TCharacterStyleRuns :: GetStyleKind ())
Interface Category:
API.
Purpose:
Removes the specified styles from the specified range of text.
Calling Context:
Called by the input method when the styles are removed during user input.
Parameters:
- const TStyleSet & stylesToRemove -The styles to remove.
- const TTextRange & whereToRemove -The range of text for which the styles are to be removed.
- const TStyleKind & kind =TCharacterStyleRuns :: GetStyleKind () -The kind of styles to remove (default: character).
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void ReplaceActiveStyles (const TStyleSet & incomingStyles, const TTextRange & whereToReplace, const TStyleKind & kind =TCharacterStyleRuns :: GetStyleKind ())
Interface Category:
API.
Purpose:
Replaces the current styles on the specified range of text with the specified styles, and updates the display accordingly.
Calling Context:
Called by the input method when the styles are replaced during user input.
Parameters:
- const TStyleSet & incomingStyles -The new styles to replace the current ones.
- const TTextRange & whereToReplace -The range of text where the new styles should replace the old.
- const TStyleKind & kind =TCharacterStyleRuns :: GetStyleKind () -The kind of styles to replace (default: character).
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void InsertActiveStyles (TTextOffset where, TTextCount howMuch)
Interface Category:
API.
Purpose:
Updates the styles used to represent the active area, in response to the insertion of the number of characters specified by howMuch, starting at the specified text offset.
Calling Context:
Called to alert the presentation to character insertions so that it can keep the active area styles synchronized with the actual text.
Parameters:
- TTextOffset where -The location where characters have been inserted.
- TTextCount howMuch -The number of inserted characters.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void DeleteActiveStyles (const TTextRange & where)
Interface Category:
API.
Purpose:
Updates the styles used to represent the active area, in response to the deletion of characters in the specified range of text.
Calling Context:
Called to alert the presentation to character deletions so that it can keep the active area styles synchronized with the actual text.
Parameters:
- const TTextRange & where -The range of deleted text.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void RemoveAllActiveStyles (const TStyleKind & kind =TCharacterStyleRuns :: GetStyleKind ())
Interface Category:
API.
Purpose:
This function removes all traces of input method styles of the specified kind from the display.
Calling Context:
Called by the input method when closing the current active area.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void FlushInput ()
Interface Category:
API.
Purpose:
Flushes all pending keystrokes into the text being edited.
Calling Context:
Called by input method behaviors that are installed by the input method, and by any other input method function that needs to ensure all typing has been processed.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void SetSelection (const TTextArea &)
Interface Category:
API.
Purpose:
Sets the selection in the text being edited to the specified area of text.
Calling Context:
Called by the input method to set the current selection.
Parameters:
- const TTextArea & -The area of text to be selected.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void GetSelection (TTextArea &)
Interface Category:
API.
Purpose:
Gets the current selection in the text being edited.
Calling Context:
Called by the input method to get the current selection.
Parameters:
- TTextArea & -Receives the text selection area.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void LocalCoordinateToInsertionOffset (const TGPoint & where, TInsertionOffset & offset) const
Interface Category:
API.
Purpose:
Converts the specified local coordinate in the view containing the edited text to an insertion offset in the text being edited.
Calling Context:
Called by the input method to process mouse clicks, and to position user interface elements such as palette windows close to the text being edited.
Parameters:
- const TGPoint & where -The local coordinate in the view containing the edited text.
- TInsertionOffset & offset -The corresponding insertion offset in the text.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void InsertionOffsetToLocalCoordinate (const TInsertionOffset & offset, TGPoint & where) const
Interface Category:
API.
Purpose:
Converts the specified insertion offset in the text being edited to the corresponding local coordinate in the view containing the edited text.
Calling Context:
Called by the input method to process mouse clicks, and to position user interface elements such as palette windows close to the text being edited.
Parameters:
- const TInsertionOffset & offset -The insertion offset in the text.
- TGPoint & where -The corresponding coordinate in the view containing the edited text.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void GlobalCoordinateToInsertionOffset (const TGPoint & where, TInsertionOffset & offset) const
Interface Category:
API.
Purpose:
Converts the specified global screen coordinate to an insertion offset in the text being edited.
Calling Context:
Called by the input method to process mouse clicks, and to position user interface elements such as palette windows close to the text being edited.
Parameters:
- const TGPoint & where -The global screen coordinate.
- TInsertionOffset & offset -The corresponding insertion offset in the text.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void InsertionOffsetToGlobalCoordinate (const TInsertionOffset & offset, TGPoint & where) const
Interface Category:
API.
Purpose:
Converts the specified insertion offset in the text being edited to the corresponding global screen coordinate.
Calling Context:
Called by the input method to process mouse clicks, and to position user interface elements such as palette windows close to the text being edited.
Parameters:
- const TInsertionOffset & offset -The insertion offset in the text.
- TGPoint & where -The corresponding global screen coordinate.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void AdoptAlertWindow (TWindow * alert)
Interface Category:
API.
Purpose:
Adopts and installs the specified alert window.
Calling Context:
Called by the input method to install the alert window.
Parameters:
- TWindow * alert -The alert window to install.
Return Value:
None.
Exceptions:
Throws TInputMethodCantUseGUIElementException if the alert window cannot be installed.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void AdoptPaletteWindow (TWindow * palette)
Interface Category:
API.
Purpose:
Adopts and installs the specified palette window.
Calling Context:
Called by the input method to install the palette window.
Parameters:
- TWindow * palette -The palette window to install.
Return Value:
None.
Exceptions:
Throws TInputMethodCantUseGUIElementException if the palette window cannot be installed.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void AdoptMenuWindow (TWindow * menu)
Interface Category:
API.
Purpose:
Adopts and installs the specified menu window.
Calling Context:
Called by the input method to install the menu window.
Parameters:
- TWindow * menu -The menu window to install.
Return Value:
None.
Exceptions:
Throws TInputMethodCantUseGUIElementException if the menu window cannot be installed.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual TWindow * OrphanWindow (TWindow &)
Interface Category:
API.
Purpose:
Removes the specified window installed using one of the Adopt Window functions (AdoptAlertWindow, AdoptPaletteWindow, or AdoptMenuWindow), and returns ownership of storage to the caller.
Calling Context:
Called when the input method is being deactivated (because the typing configuration is being changed, for example). Not called if the Adopt Window function threw TInputMethodCantUseGUIElementException.
Parameters:
Return Value:
A pointer to the window.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual void AdoptInputMethodMenuItem (MMenuItem * adoptMenuItem)
Interface Category:
API.
Purpose:
Adopts and installs the specified input method menu. This menu provides access to all the other functions of the input method, such as bringing up additional tool palettes.
Calling Context:
Called by the input method to install its own menu.
Parameters:
- MMenuItem * adoptMenuItem -The menu to be installed.
Return Value:
None.
Exceptions:
Throws TInputMethodCantUseGUIElementException if the menu cannot be installed.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
virtual MMenuItem * OrphanInputMethodMenuItem (MMenuItem & orphanMenuItem)
Interface Category:
API.
Purpose:
Removes the specified menu installed using AdoptInputMethodMenuItem, and returns ownership of storage to the caller.
Calling Context:
Called when the input method is being deactivated (because the typing configuration is being changed, for example). Not called if AdoptInputMethodMenuItem threw TInputMethodCantUseGUIElementException.
Parameters:
- MMenuItem & orphanMenuItem -The menu to be orphaned.
Return Value:
A pointer to the menu.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Overrides inherited TInputMethodTextPresentation function.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.