PageRenderTime 263ms CodeModel.GetById 111ms app.highlight 4ms RepoModel.GetById 147ms app.codeStats 0ms

/indra/newview/llnamebox.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 76 lines | 36 code | 15 blank | 25 comment | 0 complexity | 3a6fc3e9a25b70b1f458898bcb34c334 MD5 | raw file
 1/** 
 2 * @file llnamebox.h
 3 * @brief display and refresh a name from the name cache
 4 *
 5 * $LicenseInfo:firstyear=2003&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_LLNAMEBOX_H
28#define LL_LLNAMEBOX_H
29
30#include <set>
31
32#include "llview.h"
33#include "llstring.h"
34#include "llfontgl.h"
35#include "lltextbox.h"
36
37class LLNameBox
38:	public LLTextBox
39{
40public:
41	struct Params : public LLInitParam::Block<Params, LLTextBox::Params>
42	{
43		Optional<bool>		is_group;
44		Optional<bool>		link;
45
46		Params()
47		:	is_group("is_group", false)
48		,	link("link", false)
49		{}
50	};
51
52	virtual ~LLNameBox();
53
54	void setNameID(const LLUUID& name_id, BOOL is_group);
55
56	void refresh(const LLUUID& id, const std::string& full_name, bool is_group);
57
58	static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group);
59
60protected:
61	LLNameBox (const Params&);
62
63	friend class LLUICtrlFactory;
64private:
65	void setName(const std::string& name, BOOL is_group);
66
67	static std::set<LLNameBox*> sInstances;
68
69private:
70	LLUUID mNameID;
71	BOOL mLink;
72	std::string mInitialValue;
73
74};
75
76#endif