Class: TTypingCommand

Declaration: TextCommandsCore.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TCommandOn

Inherited By:

TDocumentTypingCommand

Purpose:

TTypingCommand, derived from the template class TCommandOn<MTextSelection>, applies a specified number of backspaces at the selected text range and then inserts the input text at the resulting offset in the text representation. If the text selection is an insertion point, each backspace applied deletes the character preceding the insertion offset. If the text selection is a range of characters, the text in that range is deleted.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

This class is designed to be used directly.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TTypingCommand::TTypingCommand

  1. TTypingCommand ()
  2. TTypingCommand (const TTypingCommand &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators. Call this function directly.
  2. Called to copy an object. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Other Considerations:

None.

Member Function: TTypingCommand::~TTypingCommand

virtual ~ TTypingCommand ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Other Considerations:

None.

Member Function: TTypingCommand::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Other Considerations:

None.

Member Function: TTypingCommand::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws TInvalidVersionError if the object has detected an unsupportable version during the stream-in process.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Other Considerations:

None.

Member Function: TTypingCommand::operator=

TTypingCommand & operator =(const TTypingCommand &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function directly.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Other Considerations:

None.

Member Function: TTypingCommand::HandleDoBegin

virtual void HandleDoBegin (MTextSelection &)

Interface Category:

API.

Purpose:

Begins execution of this incremental command. Saves the undo information, then saves the redo information for the begin text, and finally inserts the begin text into the text representation. If the selection that this command is working on is an insertion point, each backspace applied deletes the character preceding the insertion offset, and then the begin text is inserted. If the selection is a range of text, then that text is first removed from the representation and the begin text is inserted where that range was.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Other Considerations:

This protected function overrides the inherited TCommandOn function.

Member Function: TTypingCommand::HandleDoIncrement

virtual void HandleDoIncrement (MTextSelection &)

Interface Category:

API.

Purpose:

Continues execution of this incremental command, inserting user-input text into the representation. Saves the redo information for the incremental text and then inserts the incremental text into the text representation. Note that the redo information saved by this command is the same information as the command processes. It is saved in the command's state data so that when and if the command is redone it can be redone all at once and not incrementally.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Other Considerations:

This protected function overrides the inherited TCommandOn function.

Member Function: TTypingCommand::HandleDoEnd

virtual void HandleDoEnd ()

Interface Category:

API.

Purpose:

Ends execution of this incremental command. Finalizes the redo information.

Calling Context:

Called by the framework when this incremental command is finished executing.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Other Considerations:

This protected function overrides the inherited TCommandOn function.

Member Function: TTypingCommand::HandleUndo

virtual void HandleUndo (MTextSelection &)

Interface Category:

API.

Purpose:

Undoes this command by replacing the new text that had been inserted by this command with the text that was originally selected in the representation (if there was an original selection), and by restoring any characters that had been deleted.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Other Considerations:

This protected function overrides the inherited TCommandOn function.

Member Function: TTypingCommand::HandleRedo

virtual void HandleRedo (MTextSelection &)

Interface Category:

API.

Purpose:

Redoes the command after it has been undone. This can be thought of as an undo of the undo -it puts the text representation back into the state it was in when the command originally finished.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Other Considerations:

This protected function overrides the inherited TCommandOn function.

Member Function: TTypingCommand::HandleStreamOutIncrementDelta

virtual void HandleStreamOutIncrementDelta (TStream &) const

Interface Category:

API.

Purpose:

Streams out the most recent text and number of backspaces values. Called to stream out the information accrued in each incremental execution of the command. Called by the Document Frameworks for collaboration.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Other Considerations:

This protected function overrides the inherited TCommandOn function.

Member Function: TTypingCommand::HandleStreamInIncrementDelta

virtual void HandleStreamInIncrementDelta (TStream &)

Interface Category:

API.

Purpose:

Streams in text and number of backspaces values. Called to stream in the information accrued in each incremental execution of the command. Called by the Document Frameworks for collaboration.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Other Considerations:

This protected function overrides the inherited TCommandOn function.

Member Function: TTypingCommand::EditRepresentation

virtual void EditRepresentation (MTextRepresentation & representation, MTextSelection & selection, const TText & textToInsert, const TTextRange & rangeToRemove)

Interface Category:

API.

Purpose:

Modifies the text representation by deleting the specified rangeToRemove., and inserting the specified textToInsert. Then sets the selection to an insertion offset at the end of the inserted text. Called to edit the text representation in response to typing input. Called by HandleDoBegin and HandleDoIncrement.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Other Considerations:

None.

Member Function: TTypingCommand::SetNewText

virtual void SetNewText (const TTextRange & newRange, const TText & newText)

Interface Category:

API.

Purpose:

Specifies the text to be inserted by this command, replacing the specified range of text. Called to set up this command for execution. Called by the text interactor so the command will have the data it needs.

Calling Context:

Called by the Text Framework classes. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

This command's functions assume that any required locks have already been acquired by the client.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.