PageRenderTime 343ms CodeModel.GetById 181ms app.highlight 3ms RepoModel.GetById 158ms app.codeStats 0ms

/indra/newview/llnameeditor.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 79 lines | 37 code | 16 blank | 26 comment | 0 complexity | 4e4c5d45e313139e4dd924ca1bb5b5a9 MD5 | raw file
 1/** 
 2 * @file llnameeditor.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_LLNAMEEDITOR_H
28#define LL_LLNAMEEDITOR_H
29
30#include <set>
31
32#include "llview.h"
33#include "v4color.h"
34#include "llstring.h"
35#include "llfontgl.h"
36#include "lllineeditor.h"
37
38
39class LLNameEditor
40:	public LLLineEditor
41{
42public:
43	struct Params : public LLInitParam::Block<Params, LLLineEditor::Params>
44	{
45		Optional<bool>		is_group;
46		Optional<LLUUID>	name_id;
47
48		Params()
49		:	is_group("is_group"),
50			name_id("name_id")
51		{}
52	};
53
54protected:
55	LLNameEditor(const Params&);
56	friend class LLUICtrlFactory;
57public:
58	virtual ~LLNameEditor();
59
60	void setNameID(const LLUUID& name_id, BOOL is_group);
61
62	void refresh(const LLUUID& id, const std::string& full_name, bool is_group);
63
64	static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group);
65
66
67	// Take/return agent UUIDs
68	virtual void	setValue( const LLSD& value );
69	virtual LLSD	getValue() const;
70
71private:
72	static std::set<LLNameEditor*> sInstances;
73
74private:
75	LLUUID mNameID;
76
77};
78
79#endif