PageRenderTime 33ms CodeModel.GetById 23ms app.highlight 7ms RepoModel.GetById 2ms 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
  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
 28#ifndef LL_LLCHAT_H
 29#define LL_LLCHAT_H
 30
 31#include "lluuid.h"
 32#include "v3math.h"
 33
 34// enumerations used by the chat system
 35typedef enum e_chat_source_type
 36{
 37	CHAT_SOURCE_SYSTEM = 0,
 38	CHAT_SOURCE_AGENT = 1,
 39	CHAT_SOURCE_OBJECT = 2,
 40	CHAT_SOURCE_UNKNOWN = 3
 41} EChatSourceType;
 42
 43typedef enum e_chat_type
 44{
 45	CHAT_TYPE_WHISPER = 0,
 46	CHAT_TYPE_NORMAL = 1,
 47	CHAT_TYPE_SHOUT = 2,
 48	CHAT_TYPE_START = 4,
 49	CHAT_TYPE_STOP = 5,
 50	CHAT_TYPE_DEBUG_MSG = 6,
 51	CHAT_TYPE_REGION = 7,
 52	CHAT_TYPE_OWNER = 8,
 53	CHAT_TYPE_DIRECT = 9		// From llRegionSayTo()
 54} EChatType;
 55
 56typedef enum e_chat_audible_level
 57{
 58	CHAT_AUDIBLE_NOT = -1,
 59	CHAT_AUDIBLE_BARELY = 0,
 60	CHAT_AUDIBLE_FULLY = 1
 61} EChatAudible;
 62
 63typedef enum e_chat_style
 64{
 65	CHAT_STYLE_NORMAL,
 66	CHAT_STYLE_IRC,
 67	CHAT_STYLE_HISTORY
 68}EChatStyle;
 69
 70// A piece of chat
 71class LLChat
 72{
 73public:
 74	LLChat(const std::string& text = std::string())
 75	:	mText(text),
 76		mFromName(),
 77		mFromID(),
 78		mNotifId(),
 79		mOwnerID(),
 80		mSourceType(CHAT_SOURCE_AGENT),
 81		mChatType(CHAT_TYPE_NORMAL),
 82		mAudible(CHAT_AUDIBLE_FULLY),
 83		mMuted(FALSE),
 84		mTime(0.0),
 85		mTimeStr(),
 86		mPosAgent(),
 87		mURL(),
 88		mChatStyle(CHAT_STYLE_NORMAL),
 89		mSessionID()
 90	{ }
 91	
 92	std::string		mText;		// UTF-8 line of text
 93	std::string		mFromName;	// agent or object name
 94	LLUUID			mFromID;	// agent id or object id
 95	LLUUID			mNotifId;
 96	LLUUID			mOwnerID;
 97	EChatSourceType	mSourceType;
 98	EChatType		mChatType;
 99	EChatAudible	mAudible;
100	BOOL			mMuted;		// pass muted chat to maintain list of chatters
101	F64				mTime;		// viewer only, seconds from viewer start
102	std::string		mTimeStr;
103	LLVector3		mPosAgent;
104	std::string		mURL;
105	EChatStyle		mChatStyle;
106	LLUUID			mSessionID;
107};
108
109#endif