# IRsSysToolManager Interface Reference

Inherits IUnknown.

List of all members.

## Public Member Functions
HRESULT | Initialize ()
HRESULT | Destroy ()
HRESULT | ProcessToolCommandQueue ()
HRESULT | ProcessUIToolCommandQueue ()
HRESULT | AttachToolMng ([in] IRsNode *pView,[in] IRsToolManager *pNewToolMng)
HRESULT | DetachToolMngFromWindow ([in] IRsNode *pView,[in] IRsToolManager *pToolMng)
HRESULT | DetachToolMng ([in] IRsToolManager *pToolMng)
HRESULT | GetAssignedToolMng ([in] IRsNode *pViewNode,[out, retval] IRsToolManager **ppToolMng)
HRESULT | GetDefaultToolMng ([out, retval] IRsToolManager **ppToolMng)
HRESULT | GetActiveTool ([out, retval] IRsTool **ppActiveTool)
HRESULT | GetActiveViewNode ([out, retval] IRsNode **ppActiveViewNode)
HRESULT | OnLButtonDown ([in] RtMouseEvent *pEvent,[in] IRsNode *pViewNode)
HRESULT | OnLButtonUp ([in] RtMouseEvent *pEvent,[in] IRsNode *pViewNode)
HRESULT | OnRButtonDown ([in] RtMouseEvent *pEvent,[in] IRsNode *pViewNode)
HRESULT | OnRButtonUp ([in] RtMouseEvent *pEvent,[in] IRsNode *pViewNode)
HRESULT | OnMButtonDown ([in] RtMouseEvent *pEvent,[in] IRsNode *pViewNode)
HRESULT | OnMButtonUp ([in] RtMouseEvent *pEvent,[in] IRsNode *pViewNode)
HRESULT | OnMouseMove ([in] RtMouseEvent *pEvent,[in] IRsNode *pViewNode)
HRESULT | OnMouseWheel ([in] RtMouseEvent *pEvent,[in] IRsNode *pViewNode)
HRESULT | OnMouseLeave ([in] RtMouseEvent *pEvent,[in] IRsNode *pViewNode)
HRESULT | SynchronizeToolEvents ()
HRESULT | RegisterToolManagerListener (IRsToolManagerListener *pListener)
HRESULT | UnregisterToolManagerListener (IRsToolManagerListener *pListener)
HRESULT | SendToolMngEvent (RtToolMsgId msgId, VARIANT *vParam)
HRESULT | GetLastEvent ([out]RtMouseEvent *pToolEvent,[out]IRsNode **ppNode)
HRESULT | EnumToolManagers (IRsEnumToolManagers **ppEnum)
HRESULT | MoveToTop (IRsTool *pTool)

## Detailed Description

System tool manager performs windows mouse event to internal mouse event conversion, thread synchronization and Window Tool Manager processing.

## Member Function Documentation

HRESULT IRsSysToolManager::Initialize | ( |  | ) |

Initialize system tool manager.

HRESULT IRsSysToolManager::Destroy | ( |  | ) |

Uninitialize system tool manager and release all references to external objects.

HRESULT IRsSysToolManager::ProcessToolCommandQueue | ( |  | ) |

Process all commands in Master thread command queue.

HRESULT IRsSysToolManager::ProcessUIToolCommandQueue | ( |  | ) |

Process all commands in UI thread command queue.

HRESULT IRsSysToolManager::AttachToolMng | ( | [in] IRsNode * | pView,
|  | [in] IRsToolManager * | pNewToolMng |
| ) |  |  |

Attach tool manager to specific window.

Parameters:

  | pView | [in] View node.
  | pNewToolMng | [in] New tool manager to attach to view node.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::DetachToolMngFromWindow | ( | [in] IRsNode * | pView,
|  | [in] IRsToolManager * | pToolMng |
| ) |  |  |

Detach tool manager from specified window.

Parameters:

  | pView | [in] View node.
  | pToolMng | [in] Tool manager to detach.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::DetachToolMng | ( | [in] IRsToolManager * | pToolMng | ) |

Detach specified tool manager from all views.

Parameters:

  | pToolMng | [in] Pointer to tool manager.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::GetAssignedToolMng | ( | [in] IRsNode * | pViewNode,
|  | [out, retval] IRsToolManager ** | ppToolMng |
| ) |  |  |

For specific window return attached tool manager.

Parameters:

  | pViewNode | [in] View node.

Returns:
  ppToolMng [out,retval] Attached tool manager.

  S_OK if succeeded.

HRESULT IRsSysToolManager::GetDefaultToolMng | ( | [out, retval] IRsToolManager ** | ppToolMng | ) |

Get default tool manager.

Returns:
  ppToolMng [out,retval] Pointer to default tool manager.

  S_OK if succeeded.

HRESULT IRsSysToolManager::GetActiveTool | ( | [out, retval] IRsTool ** | ppActiveTool | ) |

Get active tool (tool which is being processed).

Returns:
  ppActiveTool [out,retval] Pointer to active tool.

  S_OK if succeeded.

HRESULT IRsSysToolManager::GetActiveViewNode | ( | [out, retval] IRsNode ** | ppActiveViewNode | ) |

Get active (focused) view node.

Returns:
  ppActiveViewNode [out,retval] Pointer to active view node.

  S_OK if succeeded.

HRESULT IRsSysToolManager::OnLButtonDown | ( | [in] RtMouseEvent * | pEvent,
|  | [in] IRsNode * | pViewNode |
| ) |  |  |

Process Windows mouse message.

Parameters:

  | pEvent | [in] Initialized mouse event.
  | pViewNode | [in] View node from which event is originated.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::OnLButtonUp | ( | [in] RtMouseEvent * | pEvent,
|  | [in] IRsNode * | pViewNode |
| ) |  |  |

Process Windows mouse message.

Parameters:

  | pEvent | [in] Initialized mouse event.
  | pViewNode | [in] View node from which event is originated.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::OnRButtonDown | ( | [in] RtMouseEvent * | pEvent,
|  | [in] IRsNode * | pViewNode |
| ) |  |  |

Process Windows mouse message.

Parameters:

  | pEvent | [in] Initialized mouse event.
  | pViewNode | [in] View node from which event is originated.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::OnRButtonUp | ( | [in] RtMouseEvent * | pEvent,
|  | [in] IRsNode * | pViewNode |
| ) |  |  |

Process Windows mouse message.

Parameters:

  | pEvent | [in] Initialized mouse event.
  | pViewNode | [in] View node from which event is originated.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::OnMButtonDown | ( | [in] RtMouseEvent * | pEvent,
|  | [in] IRsNode * | pViewNode |
| ) |  |  |

Process Windows mouse message.

Parameters:

  | pEvent | [in] Initialized mouse event.
  | pViewNode | [in] View node from which event is originated.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::OnMButtonUp | ( | [in] RtMouseEvent * | pEvent,
|  | [in] IRsNode * | pViewNode |
| ) |  |  |

Process Windows mouse message.

Parameters:

  | pEvent | [in] Initialized mouse event.
  | pViewNode | [in] View node from which event is originated.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::OnMouseMove | ( | [in] RtMouseEvent * | pEvent,
|  | [in] IRsNode * | pViewNode |
| ) |  |  |

Process Windows mouse message.

Parameters:

  | pEvent | [in] Initialized mouse event.
  | pViewNode | [in] View node from which event is originated.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::OnMouseWheel | ( | [in] RtMouseEvent * | pEvent,
|  | [in] IRsNode * | pViewNode |
| ) |  |  |

Process Windows mouse message.

Parameters:

  | pEvent | [in] Initialized mouse event.
  | pViewNode | [in] View node from which event is originated.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::OnMouseLeave | ( | [in] RtMouseEvent * | pEvent,
|  | [in] IRsNode * | pViewNode |
| ) |  |  |

Process Windows mouse message.

Parameters:

  | pEvent | [in] Initialized mouse event.
  | pViewNode | [in] View node from which event is originated.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::SynchronizeToolEvents | ( |  | ) |

Insert synchronization command into tool commands queue which will postpone execution of accumulated tool commands until Rosetta command manager is empty.

HRESULT IRsSysToolManager::RegisterToolManagerListener | ( | IRsToolManagerListener * | pListener | ) |

Register tool manager listener.

Parameters:

  | pListener | Interface to object which will receive tool manager messages.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::UnregisterToolManagerListener | ( | IRsToolManagerListener * | pListener | ) |

Unregister tool manager listener.

Parameters:

  | pListener | Interface to object to unregister.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::SendToolMngEvent | ( | RtToolMsgId | msgId,
|  | VARIANT * | vParam |
| ) |  |  |

Dispatch event to registered tool manager listeners.

Parameters:

  | msgId | Message ID.
  | vParam | Message parameter.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::GetLastEvent | ( | [out] RtMouseEvent * | pToolEvent,
|  | [out] IRsNode ** | ppNode |
| ) |  |  |

Return last processed mouse tool event and view node where it belonged.

Parameters:

  | pToolEvent | [out] Tool event.
  | ppNode | [out] View node.

Returns:
  S_OK if succeeded.

HRESULT IRsSysToolManager::EnumToolManagers | ( | IRsEnumToolManagers ** | ppEnum | ) |

Enumerate all tool managers.

Parameters:

  | ppEnum | Tool managers enum.

Returns:
  S_OK if succeeded.

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

Move specified persistent tool to top on all tool managers where it is registered.

Parameters:

  | pTool | Tool ID.

Returns:
  S_OK if succeeded.