PageRenderTime 14ms CodeModel.GetById 8ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llnearbychatbar.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 97 lines | 49 code | 21 blank | 27 comment | 0 complexity | 172f69a14f7b81fffdf245f35e8c19aa MD5 | raw file
 1/** 
 2 * @file llnearbychatbar.h
 3 * @brief LLNearbyChatBar class definition
 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
27#ifndef LL_LLNEARBYCHATBAR_H
28#define LL_LLNEARBYCHATBAR_H
29
30#include "llfloater.h"
31#include "llcombobox.h"
32#include "llgesturemgr.h"
33#include "llchat.h"
34#include "llvoiceclient.h"
35#include "lloutputmonitorctrl.h"
36#include "llspeakers.h"
37
38class LLNearbyChatBar :	public LLFloater
39{
40public:
41	// constructor for inline chat-bars (e.g. hosted in chat history window)
42	LLNearbyChatBar(const LLSD& key);
43	~LLNearbyChatBar() {}
44
45	virtual BOOL postBuild();
46	/*virtual*/ void onOpen(const LLSD& key);
47
48	static LLNearbyChatBar* getInstance();
49
50	LLLineEditor* getChatBox() { return mChatBox; }
51
52	virtual void draw();
53
54	std::string getCurrentChat();
55	virtual BOOL handleKeyHere( KEY key, MASK mask );
56
57	static void startChat(const char* line);
58	static void stopChat();
59
60	static void sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate);
61	static void sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate);
62
63	void showHistory();
64	void enableTranslationCheckbox(BOOL enable);
65	/*virtual*/void setMinimized(BOOL b);
66
67protected:
68	static BOOL matchChatTypeTrigger(const std::string& in_str, std::string* out_str);
69	static void onChatBoxKeystroke(LLLineEditor* caller, void* userdata);
70	static void onChatBoxFocusLost(LLFocusableElement* caller, void* userdata);
71	void onChatBoxFocusReceived();
72
73	void sendChat( EChatType type );
74	void onChatBoxCommit();
75	void onChatFontChange(LLFontGL* fontp);
76
77	/* virtual */ bool applyRectControl();
78
79	void onToggleNearbyChatPanel();
80
81	static LLWString stripChannelNumber(const LLWString &mesg, S32* channel);
82	EChatType processChatTypeTriggers(EChatType type, std::string &str);
83
84	void displaySpeakingIndicator();
85
86	// Which non-zero channel did we last chat on?
87	static S32 sLastSpecialChatChannel;
88
89	LLLineEditor*			mChatBox;
90	LLView*					mNearbyChat;
91	LLOutputMonitorCtrl*	mOutputMonitor;
92	LLLocalSpeakerMgr*		mSpeakerMgr;
93
94	S32 mExpandedHeight;
95};
96
97#endif