Class: TTool

Declaration: CursorTools.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible, MEventTarget

Inherited By:

TDelegatingMouseTool TSimpleMouseTool

Purpose:

TTool is a class which implements a tool. You can derive classes from TTool to act on specific types of general and pervasive objects, such as MGraphic. TTool also provides local access to the remote tool server.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Derive classes from TTool to create tools to act on specific types of objects. No functions are required to be overridden. Developers should derive from TDelegatingMouseTool or TSimpleMouseTool rather than this class, unless they are attempting to create a new category of cursor tools, or cursor tools not based on the mouse input device.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TTool::TTool

  1. TTool ()
  2. TTool (const TTypeDescription &)
  3. TTool (const TTool &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Creates a tool of the specified type with the specified description.
  3. Copy constructor.

Calling Context:

  1. Called to create a TTool instance suitable for streaming into.
  2. Called to create a specific type of tool with a specific description.
  3. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::~TTool

virtual ~ TTool ()

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: TTool::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Returns a hash value for this object.

Calling Context:

Called to return a hash value for this object.

Parameters:

Return Value:

Returns a hash value for this object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::operator=

TTool & operator =(const TTool &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

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:

None.

Member Function: TTool::operator>>=

TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

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

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::operator<<=

TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

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

Exceptions:

Throws kStreamBadException if the object created from the stream is not the original version.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::GetTargetType

virtual TTypeDescription GetTargetType () const

Interface Category:

API.

Purpose:

Returns this tool's target type.

Calling Context:

Called to return this tool's target type. Called by TSimpleMouseTool::MouseDown. Call this function directly.

Parameters:

Return Value:

Tool type description.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::SetToolHandler

virtual void SetToolHandler (MToolHandler *)

Interface Category:

API.

Purpose:

Sets this tool's handler.

Calling Context:

Called to set this tool's handler. Called by TToolNegotiator::DispatchEvent.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::GetToolHandler

  1. virtual MToolHandler * GetToolHandler ()
  2. virtual const MToolHandler * GetToolHandler () const

Interface Category:

API.

Purpose:

Returns this tool's current handler.

Calling Context:

Called to obtain this tool's current handler. Called by TDelegatingMouseTool::MouseDown and TSimpleMouseTool::MouseDown.

Parameters:

Return Value:

A reference to this tool's handler.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::CreatePaletteGraphic

virtual MGraphic * CreatePaletteGraphic () const

Interface Category:

API.

Purpose:

Creates a palette graphic for this tool.

Calling Context:

Called to create a palette graphic for this tool. Call this function directly.

Parameters:

Return Value:

Returns a reference to the palette graphic.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::GetPaletteText

virtual void GetPaletteText (TText &) const

Interface Category:

API.

Purpose:

Returns the palette text for this tool in TText supplied.

Calling Context:

Called to obtain the palette text for this tool. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::CreateCursorGraphic

virtual MGraphic * CreateCursorGraphic () const

Interface Category:

API.

Purpose:

Creates a cursor graphic for this tool.

Calling Context:

Called to create this tool's cursor graphic. Called by TToolNegotiator when managing the cursor graphic. Call this function directly.

Parameters:

Return Value:

Returns a reference to the cursor graphic created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::SetCurrentTool

static void SetCurrentTool (const TTool &)

Interface Category:

API.

Purpose:

Copies the given tool and sets its cursor graphic.

Calling Context:

Called to copy a tool and set its cursor graphic. Called by TCursorToolSelectionState's Select function. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::CopyCurrentTool

static TTool * CopyCurrentTool ()

Interface Category:

API.

Purpose:

Returns a copy of the current tool.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to a copy of the current tool.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::GetCursor

static TCursor * GetCursor ()

Interface Category:

API.

Purpose:

Returns a pointer to the cursor.

Calling Context:

Called to obtain a reference to the default cursor. Called by TTool::ChangeCursorToDefault.

Parameters:

Return Value:

A pointer to the cursor.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::ChangeCursorToDefault

static void ChangeCursorToDefault ()

Interface Category:

API.

Purpose:

Changes the cursor to the default cursor.

Calling Context:

Called by TToolNegotiator when managing the cursor graphic.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::ChangeCursorToCurrentTool

static void ChangeCursorToCurrentTool ()

Interface Category:

API.

Purpose:

Changes the cursor to the cursor graphic of current tool.

Calling Context:

Called by TToolNegotiator when managing the cursor graphic.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::GetCurrentTool

static TTool * GetCurrentTool ()

Interface Category:

API.

Purpose:

Returns a pointer to the current tool.

Calling Context:

Called to obtain a pointer to the current tool.

Parameters:

Return Value:

A pointer to the current tool.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::GetToolView

virtual TViewHandle GetToolView () const

Interface Category:

API.

Purpose:

Returns a handle to this tool's view.

Calling Context:

Called to obtain this tool's view. Call this function directly.

Parameters:

Return Value:

A handle to this tool's view.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTool::SetToolView

virtual void SetToolView (const TViewHandle &)

Interface Category:

API.

Purpose:

Sets the view associated with this tool.

Calling Context:

Called to set the view associated with this tool. Called by TToolNegotiator's DispatchEvent function.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

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