PageRenderTime 106ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llwindow/llmousehandler.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 78 lines | 38 code | 12 blank | 28 comment | 0 complexity | c2d1276690b229b3a11fe80ae9774e33 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llmousehandler.h
  3. * @brief LLMouseHandler class definition
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_MOUSEHANDLER_H
  27. #define LL_MOUSEHANDLER_H
  28. #include "linden_common.h"
  29. #include "llrect.h"
  30. // Mostly-abstract interface.
  31. // Intended for use via multiple inheritance.
  32. // A class may have as many interfaces as it likes, but never needs to inherit one more than once.
  33. class LLMouseHandler
  34. {
  35. public:
  36. LLMouseHandler() {}
  37. virtual ~LLMouseHandler() {}
  38. typedef enum {
  39. SHOW_NEVER,
  40. SHOW_IF_NOT_BLOCKED,
  41. SHOW_ALWAYS,
  42. } EShowToolTip;
  43. typedef enum {
  44. CLICK_LEFT,
  45. CLICK_MIDDLE,
  46. CLICK_RIGHT,
  47. CLICK_DOUBLELEFT
  48. } EClickType;
  49. virtual BOOL handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down);
  50. virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) = 0;
  51. virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask) = 0;
  52. virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) = 0;
  53. virtual BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) = 0;
  54. virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) = 0;
  55. virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) = 0;
  56. virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask) = 0;
  57. virtual BOOL handleHover(S32 x, S32 y, MASK mask) = 0;
  58. virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) = 0;
  59. virtual BOOL handleToolTip(S32 x, S32 y, MASK mask) = 0;
  60. virtual const std::string& getName() const = 0;
  61. virtual void onMouseCaptureLost() = 0;
  62. virtual void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const = 0;
  63. virtual void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const = 0;
  64. virtual BOOL hasMouseCapture() = 0;
  65. };
  66. #endif