PageRenderTime 11ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llpanelblockedlist.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 111 lines | 47 code | 21 blank | 43 comment | 0 complexity | 6706a31d0449327a9fb6c617f5edba19 MD5 | raw file
  1/** 
  2 * @file llpanelblockedlist.h
  3 * @brief Container for blocked Residents & Objects list
  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_LLPANELBLOCKEDLIST_H
 28#define LL_LLPANELBLOCKEDLIST_H
 29
 30#include "llpanel.h"
 31#include "llmutelist.h"
 32#include "llfloater.h"
 33// #include <vector>
 34
 35// class LLButton;
 36// class LLLineEditor;
 37// class LLMessageSystem;
 38// class LLUUID;
 39class LLAvatarName;
 40class LLScrollListCtrl;
 41
 42class LLPanelBlockedList
 43	:	public LLPanel, public LLMuteListObserver
 44{
 45public:
 46	LLPanelBlockedList();
 47	~LLPanelBlockedList();
 48
 49	virtual BOOL postBuild();
 50	virtual void draw();
 51	virtual void onOpen(const LLSD& key);
 52	
 53	void selectBlocked(const LLUUID& id);
 54
 55	/**
 56	 *	Shows current Panel in side tray and select passed blocked item.
 57	 * 
 58	 *	@param idToSelect - LLUUID of blocked Resident or Object to be selected. 
 59	 *			If it is LLUUID::null, nothing will be selected.
 60	 */
 61	static void showPanelAndSelect(const LLUUID& idToSelect);
 62
 63	// LLMuteListObserver callback interface implementation.
 64	/* virtual */ void onChange() {	refreshBlockedList();}
 65	
 66private:
 67	void refreshBlockedList();
 68	void updateButtons();
 69
 70	// UI callbacks
 71	void onBackBtnClick();
 72	void onRemoveBtnClick();
 73	void onPickBtnClick();
 74	void onBlockByNameClick();
 75
 76	void callbackBlockPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names);
 77	static void callbackBlockByName(const std::string& text);
 78
 79private:
 80	LLScrollListCtrl* mBlockedList;
 81};
 82
 83//-----------------------------------------------------------------------------
 84// LLFloaterGetBlockedObjectName()
 85//-----------------------------------------------------------------------------
 86// Class for handling mute object by name floater.
 87class LLFloaterGetBlockedObjectName : public LLFloater
 88{
 89	friend class LLFloaterReg;
 90public:
 91	typedef boost::function<void (const std::string&)> get_object_name_callback_t;
 92
 93	virtual BOOL postBuild();
 94
 95	virtual BOOL handleKeyHere(KEY key, MASK mask);
 96
 97	static LLFloaterGetBlockedObjectName* show(get_object_name_callback_t callback);
 98
 99private:
100	LLFloaterGetBlockedObjectName(const LLSD& key);
101	virtual ~LLFloaterGetBlockedObjectName();
102
103	// UI Callbacks
104	void applyBlocking();
105	void cancelBlocking();
106
107	get_object_name_callback_t mGetObjectNameCallback;
108};
109
110
111#endif // LL_LLPANELBLOCKEDLIST_H