Class: TSimpleTextTool

Declaration: TextToolsCore.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TSimpleMouseTool

Inherited By:

None.

Purpose:

TSimpleTextTool is derived from TSimpleMouseTool. It is a tool that creates and starts a TSimpleTextToolInteractor that will apply either a TCommandOn<MTextSelection> or a TCommandOn<TTextPresenterStateSelection> to the text selected during tool interaction.

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.

Member Function: TSimpleTextTool::TSimpleTextTool

  1. TSimpleTextTool (TCommandOn < MTextSelection > * commandToAdopt, TColor * highlightColorToAdopt =NIL, MGraphic * cursorGraphicToAdopt =NIL, MGraphic * paletteGraphicToAdopt =NIL, const TText & paletteText =TStandardText :: GetEmptyText ())
  2. TSimpleTextTool (const TSimpleTextTool &)
  3. TSimpleTextTool ()

Interface Category:

API.

Purpose:

  1. Constructs a TSimpleTextTool whose interactor will apply the specified TCommandOn < MTextSelection > command. Adopts the specified highlight color, cursor graphic, palette graphic, and palette text.
  2. Copy constructor.
  3. Default constructor. This constructor is protected.

Calling Context:

  1. Typically not called directly by clients.
  2. Typically not called directly by clients.
  3. Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleTextTool::~TSimpleTextTool

virtual ~ TSimpleTextTool ()

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:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleTextTool::GetHighlightColor

virtual void GetHighlightColor (TColor & color) const

Interface Category:

API.

Purpose:

Accessor that returns the tool's current highlight color.

Calling Context:

Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleTextTool::SetHighlightColor

virtual void SetHighlightColor (const TColor & color)

Interface Category:

API.

Purpose:

Sets the tool's highlight color to the specified color.

Calling Context:

Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSimpleTextTool::operator=

TSimpleTextTool & operator =(const TSimpleTextTool &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Typically not called directly by clients.

Parameters:

Return Value:

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

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited MCollectible function.

Member Function: TSimpleTextTool::operator>>=

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

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Typically not called directly by clients.

Parameters:

Return Value:

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

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited MCollectible function.

Member Function: TSimpleTextTool::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Typically not called directly by clients.

Parameters:

Return Value:

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

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited MCollectible function.

Member Function: TSimpleTextTool::GetPaletteText

virtual void GetPaletteText (TText &) const

Interface Category:

API.

Purpose:

Returns the palette text, as specified in the constructor (default: empty).

Calling Context:

Typically not called directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TTool function.

Member Function: TSimpleTextTool::CreatePaletteGraphic

virtual MGraphic * CreatePaletteGraphic () const

Interface Category:

API.

Purpose:

Returns the palette graphic, as specified in the constructor (default: NIL).

Calling Context:

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

Parameters:

Return Value:

A pointer to the palette graphic.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TTool function.

Member Function: TSimpleTextTool::CreateCursorGraphic

virtual MGraphic * CreateCursorGraphic () const

Interface Category:

API.

Purpose:

Returns the cursor graphic, as specified in the constructor (default: highlight pen).

Calling Context:

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

Parameters:

Return Value:

A pointer to the cursor graphic.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Overrides inherited TTool function.

Member Function: TSimpleTextTool::CreateInteractor

virtual TToolInteractor * CreateInteractor (MToolTarget* adoptTarget) const

Interface Category:

API.

Purpose:

Creates and returns a pointer to a TSimpleTextToolInteractor if the target is a TTextToolInteractionTarget. Otherwise returns NIL. Provides the interactor with either a TCommandOn<MTextSelection> or a TCommandOn<TTextPresenterStateSelection> to be applied to the text selected during tool interaction.

Calling Context:

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

Parameters:

Return Value:

A pointer to a TSimpleTextToolInteractor if the target is a TTextToolInteractionTarget. Otherwise returns NIL.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

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