Class: TTextInputMethodTextPresentation

Declaration: TextInputMethodPresentation.h

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.

Member Function: TTextInputMethodTextPresentation::~TTextInputMethodTextPresentation

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.

Member Function: TTextInputMethodTextPresentation::TTextInputMethodTextPresentation

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.

Member Function: TTextInputMethodTextPresentation::AdoptBehavior

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::OrphanBehavior

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::AddActiveStyles

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.

Member Function: TTextInputMethodTextPresentation::RemoveActiveStyles

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::ReplaceActiveStyles

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::InsertActiveStyles

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::DeleteActiveStyles

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::RemoveAllActiveStyles

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.

Member Function: TTextInputMethodTextPresentation::FlushInput

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.

Member Function: TTextInputMethodTextPresentation::SetSelection

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::GetSelection

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::LocalCoordinateToInsertionOffset

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::InsertionOffsetToLocalCoordinate

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::GlobalCoordinateToInsertionOffset

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::InsertionOffsetToGlobalCoordinate

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::AdoptAlertWindow

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:

Return Value:

None.

Exceptions:

Throws TInputMethodCantUseGUIElementException if the alert window cannot be installed.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::AdoptPaletteWindow

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:

Return Value:

None.

Exceptions:

Throws TInputMethodCantUseGUIElementException if the palette window cannot be installed.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::AdoptMenuWindow

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:

Return Value:

None.

Exceptions:

Throws TInputMethodCantUseGUIElementException if the menu window cannot be installed.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::OrphanWindow

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.

Member Function: TTextInputMethodTextPresentation::AdoptInputMethodMenuItem

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:

Return Value:

None.

Exceptions:

Throws TInputMethodCantUseGUIElementException if the menu cannot be installed.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TInputMethodTextPresentation function.

Member Function: TTextInputMethodTextPresentation::OrphanInputMethodMenuItem

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:

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.