PageRenderTime 28ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llviewergesture.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 87 lines | 37 code | 18 blank | 32 comment | 0 complexity | 460efb9f8b5a09a6680e3de9ddcdf319 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llviewergesture.h
  3. * @brief LLViewerGesture class header file
  4. *
  5. * $LicenseInfo:firstyear=2002&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_LLVIEWERGESTURE_H
  27. #define LL_LLVIEWERGESTURE_H
  28. #include "llanimationstates.h"
  29. #include "lluuid.h"
  30. #include "llstring.h"
  31. #include "lldarray.h"
  32. #include "llgesture.h"
  33. class LLMessageSystem;
  34. class LLViewerGesture : public LLGesture
  35. {
  36. public:
  37. LLViewerGesture();
  38. LLViewerGesture(KEY key, MASK mask, const std::string &trigger,
  39. const LLUUID &sound_item_id, const std::string &animation,
  40. const std::string &output_string);
  41. LLViewerGesture(U8 **buffer, S32 max_size); // deserializes, advances buffer
  42. LLViewerGesture(const LLViewerGesture &gesture);
  43. // Triggers if a key/mask matches it
  44. virtual BOOL trigger(KEY key, MASK mask);
  45. // Triggers if case-insensitive substring matches (assumes string is lowercase)
  46. virtual BOOL trigger(const std::string &string);
  47. void doTrigger( BOOL send_chat );
  48. protected:
  49. static const F32 SOUND_VOLUME;
  50. };
  51. class LLViewerGestureList : public LLGestureList
  52. {
  53. public:
  54. LLViewerGestureList();
  55. //void requestFromServer();
  56. BOOL getIsLoaded() { return mIsLoaded; }
  57. //void requestResetFromServer( BOOL is_male );
  58. // See if the prefix matches any gesture. If so, return TRUE
  59. // and place the full text of the gesture trigger into
  60. // output_str
  61. BOOL matchPrefix(const std::string& in_str, std::string* out_str);
  62. static void xferCallback(void *data, S32 size, void** /*user_data*/, S32 status);
  63. protected:
  64. LLGesture *create_gesture(U8 **buffer, S32 max_size);
  65. protected:
  66. BOOL mIsLoaded;
  67. };
  68. extern LLViewerGestureList gGestureList;
  69. #endif