PageRenderTime 31ms CodeModel.GetById 21ms app.highlight 6ms RepoModel.GetById 1ms 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
 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
27#ifndef LL_LLVIEWERGESTURE_H
28#define LL_LLVIEWERGESTURE_H
29
30#include "llanimationstates.h"
31#include "lluuid.h"
32#include "llstring.h"
33#include "lldarray.h"
34#include "llgesture.h"
35
36class LLMessageSystem;
37
38class LLViewerGesture : public LLGesture
39{
40public:
41	LLViewerGesture();
42	LLViewerGesture(KEY key, MASK mask, const std::string &trigger, 
43		const LLUUID &sound_item_id, const std::string &animation, 
44		const std::string &output_string);
45
46	LLViewerGesture(U8 **buffer, S32 max_size); // deserializes, advances buffer
47	LLViewerGesture(const LLViewerGesture &gesture);
48
49	// Triggers if a key/mask matches it
50	virtual BOOL trigger(KEY key, MASK mask);
51
52	// Triggers if case-insensitive substring matches (assumes string is lowercase)
53	virtual BOOL trigger(const std::string &string);
54
55	void doTrigger( BOOL send_chat );
56
57protected:
58	static const F32	SOUND_VOLUME;
59};
60
61class LLViewerGestureList : public LLGestureList
62{
63public:
64	LLViewerGestureList();
65
66	//void requestFromServer();
67	BOOL getIsLoaded() { return mIsLoaded; }
68
69	//void requestResetFromServer( BOOL is_male );
70
71	// See if the prefix matches any gesture.  If so, return TRUE
72	// and place the full text of the gesture trigger into
73	// output_str
74	BOOL matchPrefix(const std::string& in_str, std::string* out_str);
75
76	static void xferCallback(void *data, S32 size, void** /*user_data*/, S32 status);
77
78protected:
79	LLGesture *create_gesture(U8 **buffer, S32 max_size);
80
81protected:
82	BOOL mIsLoaded;
83};
84
85extern LLViewerGestureList gGestureList;
86
87#endif