PageRenderTime 116ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llwindow/llwindowcallbacks.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 94 lines | 57 code | 9 blank | 28 comment | 0 complexity | c701c9447daeca8e3a8e305a5c4ccb80 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llwindowcallbacks.h
  3. * @brief OS event callback class
  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 LLWINDOWCALLBACKS_H
  27. #define LLWINDOWCALLBACKS_H
  28. class LLCoordGL;
  29. class LLWindow;
  30. class LLWindowCallbacks
  31. {
  32. public:
  33. virtual ~LLWindowCallbacks() {}
  34. virtual BOOL handleTranslatedKeyDown(KEY key, MASK mask, BOOL repeated);
  35. virtual BOOL handleTranslatedKeyUp(KEY key, MASK mask);
  36. virtual void handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level);
  37. virtual BOOL handleUnicodeChar(llwchar uni_char, MASK mask);
  38. virtual BOOL handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask);
  39. virtual BOOL handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask);
  40. virtual void handleMouseLeave(LLWindow *window);
  41. // return TRUE to allow window to close, which will then cause handleQuit to be called
  42. virtual BOOL handleCloseRequest(LLWindow *window);
  43. // window is about to be destroyed, clean up your business
  44. virtual void handleQuit(LLWindow *window);
  45. virtual BOOL handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK mask);
  46. virtual BOOL handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask);
  47. virtual BOOL handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask);
  48. virtual BOOL handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask);
  49. virtual BOOL handleActivate(LLWindow *window, BOOL activated);
  50. virtual BOOL handleActivateApp(LLWindow *window, BOOL activating);
  51. virtual void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask);
  52. virtual void handleScrollWheel(LLWindow *window, S32 clicks);
  53. virtual void handleResize(LLWindow *window, S32 width, S32 height);
  54. virtual void handleFocus(LLWindow *window);
  55. virtual void handleFocusLost(LLWindow *window);
  56. virtual void handleMenuSelect(LLWindow *window, S32 menu_item);
  57. virtual BOOL handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S32 height);
  58. virtual BOOL handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask); // double-click of left mouse button
  59. virtual void handleWindowBlock(LLWindow *window); // window is taking over CPU for a while
  60. virtual void handleWindowUnblock(LLWindow *window); // window coming back after taking over CPU for a while
  61. virtual void handleDataCopy(LLWindow *window, S32 data_type, void *data);
  62. virtual BOOL handleTimerEvent(LLWindow *window);
  63. virtual BOOL handleDeviceChange(LLWindow *window);
  64. enum DragNDropAction {
  65. DNDA_START_TRACKING = 0,// Start tracking an incoming drag
  66. DNDA_TRACK, // User is dragging an incoming drag around the window
  67. DNDA_STOP_TRACKING, // User is no longer dragging an incoming drag around the window (may have either cancelled or dropped on the window)
  68. DNDA_DROPPED // User dropped an incoming drag on the window (this is the "commit" event)
  69. };
  70. enum DragNDropResult {
  71. DND_NONE = 0, // No drop allowed
  72. DND_MOVE, // Drop accepted would result in a "move" operation
  73. DND_COPY, // Drop accepted would result in a "copy" operation
  74. DND_LINK // Drop accepted would result in a "link" operation
  75. };
  76. virtual DragNDropResult handleDragNDrop(LLWindow *window, LLCoordGL pos, MASK mask, DragNDropAction action, std::string data);
  77. virtual void handlePingWatchdog(LLWindow *window, const char * msg);
  78. virtual void handlePauseWatchdog(LLWindow *window);
  79. virtual void handleResumeWatchdog(LLWindow *window);
  80. // Look up a localized string, usually for an error message
  81. virtual std::string translateString(const char* tag);
  82. virtual std::string translateString(const char* tag,
  83. const std::map<std::string, std::string>& args);
  84. };
  85. #endif