PageRenderTime 38ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llcommon/llchat.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 109 lines | 72 code | 9 blank | 28 comment | 0 complexity | 4c5e03db2d573e08f1ad9ab85bbbb1c6 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llchat.h
  3. * @author James Cook
  4. * @brief Chat constants and data structures.
  5. *
  6. * $LicenseInfo:firstyear=2006&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2010, Linden Research, Inc.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation;
  13. * version 2.1 of the License only.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  25. * $/LicenseInfo$
  26. */
  27. #ifndef LL_LLCHAT_H
  28. #define LL_LLCHAT_H
  29. #include "lluuid.h"
  30. #include "v3math.h"
  31. // enumerations used by the chat system
  32. typedef enum e_chat_source_type
  33. {
  34. CHAT_SOURCE_SYSTEM = 0,
  35. CHAT_SOURCE_AGENT = 1,
  36. CHAT_SOURCE_OBJECT = 2,
  37. CHAT_SOURCE_UNKNOWN = 3
  38. } EChatSourceType;
  39. typedef enum e_chat_type
  40. {
  41. CHAT_TYPE_WHISPER = 0,
  42. CHAT_TYPE_NORMAL = 1,
  43. CHAT_TYPE_SHOUT = 2,
  44. CHAT_TYPE_START = 4,
  45. CHAT_TYPE_STOP = 5,
  46. CHAT_TYPE_DEBUG_MSG = 6,
  47. CHAT_TYPE_REGION = 7,
  48. CHAT_TYPE_OWNER = 8,
  49. CHAT_TYPE_DIRECT = 9 // From llRegionSayTo()
  50. } EChatType;
  51. typedef enum e_chat_audible_level
  52. {
  53. CHAT_AUDIBLE_NOT = -1,
  54. CHAT_AUDIBLE_BARELY = 0,
  55. CHAT_AUDIBLE_FULLY = 1
  56. } EChatAudible;
  57. typedef enum e_chat_style
  58. {
  59. CHAT_STYLE_NORMAL,
  60. CHAT_STYLE_IRC,
  61. CHAT_STYLE_HISTORY
  62. }EChatStyle;
  63. // A piece of chat
  64. class LLChat
  65. {
  66. public:
  67. LLChat(const std::string& text = std::string())
  68. : mText(text),
  69. mFromName(),
  70. mFromID(),
  71. mNotifId(),
  72. mOwnerID(),
  73. mSourceType(CHAT_SOURCE_AGENT),
  74. mChatType(CHAT_TYPE_NORMAL),
  75. mAudible(CHAT_AUDIBLE_FULLY),
  76. mMuted(FALSE),
  77. mTime(0.0),
  78. mTimeStr(),
  79. mPosAgent(),
  80. mURL(),
  81. mChatStyle(CHAT_STYLE_NORMAL),
  82. mSessionID()
  83. { }
  84. std::string mText; // UTF-8 line of text
  85. std::string mFromName; // agent or object name
  86. LLUUID mFromID; // agent id or object id
  87. LLUUID mNotifId;
  88. LLUUID mOwnerID;
  89. EChatSourceType mSourceType;
  90. EChatType mChatType;
  91. EChatAudible mAudible;
  92. BOOL mMuted; // pass muted chat to maintain list of chatters
  93. F64 mTime; // viewer only, seconds from viewer start
  94. std::string mTimeStr;
  95. LLVector3 mPosAgent;
  96. std::string mURL;
  97. EChatStyle mChatStyle;
  98. LLUUID mSessionID;
  99. };
  100. #endif