# IRsToolManager Interface Reference

List of all members.

## Public Member Functions
HRESULT | ExecuteTool ([in] IRsTool *pTool,[in] RtMouseEvent *pMouseEvent,[in] IRsNode *pViewNode)
HRESULT | GetAttachedTool ([in] RtMouseEvent *pMouseEvent,[in] IRsNode *pViewNode,[out, retval] IRsTool **ppTool)
HRESULT | AttachToWindow ([in]IRsNode *pViewNode)
HRESULT | DetachFromWindow ([in]IRsNode *pViewNode)
HRESULT | OnFocusLost ()
HRESULT | OnFocus ()
HRESULT | ActivateToolPersistent ([in] IRsTool *pTool)
HRESULT | DeactivateToolPersistent ([in] IRsTool *pTool)
HRESULT | ActivateToolById ([in] CLSID gToolId)
HRESULT | DeactivateToolById ([in] CLSID gToolId)
HRESULT | GetActiveToolId ([in] CLSID *pToolId)
HRESULT | GetActiveTool ([out, retval] IRsTool **ppTool)
HRESULT | Initialize ()
HRESULT | Destroy (void)
HRESULT | AddHook ([in] IRsToolManagerHook *pHook)
HRESULT | RemoveHook ([in] IRsToolManagerHook *pHook)
HRESULT | MoveToTop (IRsTool *pTool)
HRESULT | GetToolsCount (RtUlong *pdwCnt)
HRESULT | GetToolId (RtUlong dwId, GUID *pGuid)
HRESULT | DeactivateToolGroup ([in] GUID *pgId)

## Detailed Description

Tool manager performs interface between IRsSysToolManager and Rosetta windows.
It performs tool selection and tool commands execution according to mouse tool events.

## Member Function Documentation

HRESULT IRsToolManager::ExecuteTool | ( | [in] IRsTool * | pTool,
|  | [in] RtMouseEvent * | pMouseEvent,
|  | [in] IRsNode * | pViewNode |
| ) |  |  |

Called by IRsSysToolManager to execute specified tool.

Parameters:

  | pTool | [in] Tool to execute (must be registered in tool manager tools).
  | pMouseEvent | [in] Mouse event to pass to tool.
  | pViewNode | [in] Registered view node.

Returns:
  S_OK if succeeded.

HRESULT IRsToolManager::GetAttachedTool | ( | [in] RtMouseEvent * | pMouseEvent,
|  | [in] IRsNode * | pViewNode,
|  | [out, retval] IRsTool ** | ppTool |
| ) |  |  |

Get attached tool according to provided mouse tool ID and internal tool manager state machine and priorities.

Parameters:

  | pMouseEvent | [in] Mouse event for which tool is searched.
  | pViewNode | [in] Active view node.

Returns:
  ppTool [out,retval] Tool to process.

  S_OK if succeeded.

HRESULT IRsToolManager::AttachToWindow | ( | [in] IRsNode * | pViewNode | ) |

Attach view node to this tool manager.

Parameters:

  | pViewNode | [in] View node to attach.

Returns:
  S_OK if succeeded.

HRESULT IRsToolManager::DetachFromWindow | ( | [in] IRsNode * | pViewNode | ) |

Dettach view node to this tool manager.

Parameters:

  | pViewNode | [in] View node to attach.

Returns:
  S_OK if succeeded.

HRESULT IRsToolManager::OnFocusLost | ( |  | ) |

Call if tool manager lost focus (eg. focus was changed to different window).

Parameters:

  | gToolId | Tool class ID to remove.

Returns:
  S_OK if succeeded.

HRESULT IRsToolManager::OnFocus | ( |  | ) |

Call if tool manager is focused (eg. window that uses this tool manager received focus).

Parameters:

  | gToolId | Tool class ID to remove.

Returns:
  S_OK if succeeded.

HRESULT IRsToolManager::ActivateToolPersistent | ( | [in] IRsTool * | pTool | ) |

Add persistent tool into tool manager's tools list.

Parameters:

  | pTool | [in] Tool to add.

Returns:
  S_OK if succeeded.

HRESULT IRsToolManager::DeactivateToolPersistent | ( | [in] IRsTool * | pTool | ) |

Remove persistent tool from tool manager's tools list.

Parameters:

  | pTool | [in] Tool to remove.

Returns:
  S_OK if succeeded.

HRESULT IRsToolManager::ActivateToolById | ( | [in] CLSID | gToolId | ) |

Add tool specified by class id into tool manager's tools list.

Parameters:

  | gToolId | [in] Tool class ID to add.

Returns:
  S_OK if succeeded.

HRESULT IRsToolManager::DeactivateToolById | ( | [in] CLSID | gToolId | ) |

Remove tool specified by class ID from tool manager.

Parameters:

  | gToolId | [in] Tool class ID to remove.

Returns:
  S_OK if succeeded.

HRESULT IRsToolManager::GetActiveToolId | ( | [in] CLSID * | pToolId | ) |

Return class id of active tool.

Parameters:

  | pToolId | [in] Tool class ID.

Returns:
  S_OK if succeeded.

HRESULT IRsToolManager::GetActiveTool | ( | [out, retval] IRsTool ** | ppTool | ) |

Return interface to active tool.

Returns:
  ppTool [out,retval] Filled with active tool (in any).

  S_OK if succeeded.

HRESULT IRsToolManager::Initialize | ( |  | ) |

Initialize tool manager.

HRESULT IRsToolManager::Destroy | ( | void |  | ) |

Uninitialize tool manager and release all references to external objects.

HRESULT IRsToolManager::AddHook | ( | [in] IRsToolManagerHook * | pHook | ) |

Register tool manager hook.

Parameters:

  | pHook | [in] Hook pointer to add to list of hooks.

Returns:
  S_OK returned if succeeded.

HRESULT IRsToolManager::RemoveHook | ( | [in] IRsToolManagerHook * | pHook | ) |

Remove registered tool manager hook.

Parameters:

  | pHook | [in] Hook pointer to unregister.

Returns:
  S_OK returned if succeeded.

HRESULT IRsToolManager::MoveToTop | ( | IRsTool * | pTool | ) |

Move specified tool to top of tool managers tools queue.

Parameters:

  | pTool | Pointer to tool to move to top.

Returns:
  S_OK if succeeded.

HRESULT IRsToolManager::GetToolsCount | ( | RtUlong * | pdwCnt | ) |

Get number of tools in tool manager queue.

Parameters:

  | pdwCnt | Number of tools registered in tool manager.

Returns:
  S_OK if succeeded.

HRESULT IRsToolManager::GetToolId | ( | RtUlong | dwId,
|  | GUID * | pGuid |
| ) |  |  |

Get tool manager's queue tool ID.

Parameters:

  | dwId | Tool index.
  | pGuid | Filled with class ID of requested tool.

Returns:
  S_OK if succeeded.

HRESULT IRsToolManager::DeactivateToolGroup | ( | [in] GUID * | pgId | ) |

Deactivate tool group.

Parameters:

  | pgId | [in] Group ID to deactivate.

Returns:
  S_OK if succeeded.