PageRenderTime 29ms CodeModel.GetById 20ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llfloatergroups.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 128 lines | 64 code | 23 blank | 41 comment | 0 complexity | 3402038e8cddd6182ab0306d6dd37475 MD5 | raw file
  1/** 
  2 * @file llfloatergroups.h
  3 * @brief LLFloaterGroups 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/*
 28 * Shown from Edit -> Groups...
 29 * Shows the agent's groups and allows the edit window to be invoked.
 30 * Also overloaded to allow picking of a single group for assigning 
 31 * objects and land to groups.
 32 */
 33
 34#ifndef LL_LLFLOATERGROUPS_H
 35#define LL_LLFLOATERGROUPS_H
 36
 37//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 38// Class llfloatergroups
 39//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 40
 41#include "lluuid.h"
 42#include "llfloater.h"
 43#include <map>
 44#include <boost/function.hpp>
 45#include <boost/signals2.hpp>
 46
 47class LLUICtrl;
 48class LLTextBox;
 49class LLScrollListCtrl;
 50class LLButton;
 51class LLFloaterGroupPicker;
 52
 53class LLFloaterGroupPicker : public LLFloater
 54{
 55public:
 56	LLFloaterGroupPicker(const LLSD& seed);
 57	~LLFloaterGroupPicker();
 58	
 59	// Note: Don't return connection; use boost::bind + boost::signals2::trackable to disconnect slots
 60	typedef boost::signals2::signal<void (LLUUID id)> signal_t;	
 61	void setSelectGroupCallback(const signal_t::slot_type& cb) { mGroupSelectSignal.connect(cb); }
 62	void setPowersMask(U64 powers_mask);
 63	BOOL postBuild();
 64
 65	// implementation of factory policy
 66	static LLFloaterGroupPicker* findInstance(const LLSD& seed);
 67	static LLFloaterGroupPicker* createInstance(const LLSD& seed);
 68
 69	// for cases like inviting avatar to group we don't want the none option
 70	void removeNoneOption();
 71
 72protected:
 73	void ok();
 74	static void onBtnOK(void* userdata);
 75	static void onBtnCancel(void* userdata);
 76
 77protected:
 78	LLUUID mID;
 79	U64 mPowersMask;
 80	signal_t mGroupSelectSignal;
 81
 82	typedef std::map<const LLUUID, LLFloaterGroupPicker*> instance_map_t;
 83	static instance_map_t sInstances;
 84};
 85
 86class LLPanelGroups : public LLPanel, public LLOldEvents::LLSimpleListener
 87{
 88public:
 89	LLPanelGroups();
 90	virtual ~LLPanelGroups();
 91
 92	//LLEventListener
 93	/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
 94	
 95	// clear the group list, and get a fresh set of info.
 96	void reset();
 97
 98protected:
 99	// initialize based on the type
100	BOOL postBuild();
101
102	// highlight_id is a group id to highlight
103	void enableButtons();
104
105	static void onGroupList(LLUICtrl* ctrl, void* userdata);
106	static void onBtnCreate(void* userdata);
107	static void onBtnActivate(void* userdata);
108	static void onBtnInfo(void* userdata);
109	static void onBtnIM(void* userdata);
110	static void onBtnLeave(void* userdata);
111	static void onBtnSearch(void* userdata);
112	static void onBtnVote(void* userdata);
113	static void onDoubleClickGroup(void* userdata);
114
115	void create();
116	void activate();
117	void info();
118	void startIM();
119	void leave();
120	void search();
121	void callVote();
122
123	static bool callbackLeaveGroup(const LLSD& notification, const LLSD& response);
124
125};
126
127
128#endif // LL_LLFLOATERGROUPS_H