PageRenderTime 79ms CodeModel.GetById 65ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 1ms

/indra/newview/llpanelgroup.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 173 lines | 88 code | 47 blank | 38 comment | 0 complexity | a306f68a6efef8533019011e8712949f MD5 | raw file
  1/** 
  2 * @file llpanelgroup.h
  3 *
  4 * $LicenseInfo:firstyear=2006&license=viewerlgpl$
  5 * Second Life Viewer Source Code
  6 * Copyright (C) 2010, Linden Research, Inc.
  7 * 
  8 * This library is free software; you can redistribute it and/or
  9 * modify it under the terms of the GNU Lesser General Public
 10 * License as published by the Free Software Foundation;
 11 * version 2.1 of the License only.
 12 * 
 13 * This library is distributed in the hope that it will be useful,
 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 16 * Lesser General Public License for more details.
 17 * 
 18 * You should have received a copy of the GNU Lesser General Public
 19 * License along with this library; if not, write to the Free Software
 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 21 * 
 22 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
 23 * $/LicenseInfo$
 24 */
 25
 26#ifndef LL_LLPANELGROUP_H
 27#define LL_LLPANELGROUP_H
 28
 29#include "llgroupmgr.h"
 30#include "llpanel.h"
 31#include "lltimer.h"
 32#include "llvoiceclient.h"
 33
 34class LLOfferInfo;
 35
 36const S32 UPDATE_MEMBERS_PER_FRAME = 500;
 37
 38// Forward declares
 39class LLPanelGroupTab;
 40class LLTabContainer;
 41class LLAgent;
 42
 43
 44class LLPanelGroup : public LLPanel,
 45					 public LLGroupMgrObserver,
 46					 public LLVoiceClientStatusObserver
 47{
 48public:
 49	LLPanelGroup();
 50	virtual ~LLPanelGroup();
 51
 52	virtual BOOL postBuild();
 53
 54	void setGroupID(const LLUUID& group_id);
 55
 56	void draw();
 57
 58	void onOpen(const LLSD& key);
 59
 60	// Group manager observer trigger.
 61	virtual void changed(LLGroupChange gc);
 62
 63	// Implements LLVoiceClientStatusObserver::onChange() to enable the call
 64	// button when voice is available
 65	/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
 66
 67	void showNotice(const std::string& subject,
 68					const std::string& message,
 69					const bool& has_inventory,
 70					const std::string& inventory_name,
 71					LLOfferInfo* inventory_offer);
 72
 73	void notifyObservers();
 74
 75	bool apply();
 76	void refreshData();
 77	void callGroup();
 78	void chatGroup();
 79
 80	virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
 81
 82	static void refreshCreatedGroup(const LLUUID& group_id);
 83
 84	static void showNotice(const std::string& subject,
 85						   const std::string& message,
 86						   const LLUUID& group_id,
 87						   const bool& has_inventory,
 88						   const std::string& inventory_name,
 89						   LLOfferInfo* inventory_offer);
 90
 91
 92protected:
 93	virtual void update(LLGroupChange gc);
 94
 95	void onBtnCreate();
 96	void onBackBtnClick();
 97	void onBtnJoin();
 98	void onBtnCancel();
 99
100	static void onBtnApply(void*);
101	static void onBtnRefresh(void*);
102	static void onBtnGroupCallClicked(void*);
103	static void onBtnGroupChatClicked(void*);
104
105	void reposButton(const std::string& name);
106	void reposButtons();
107	
108
109protected:
110	bool	apply(LLPanelGroupTab* tab);
111
112	LLTimer mRefreshTimer;
113
114	BOOL mSkipRefresh;
115
116	std::string mDefaultNeedsApplyMesg;
117	std::string mWantApplyMesg;
118
119	std::vector<LLPanelGroupTab* > mTabs;
120
121	LLButton*		mButtonJoin;
122	LLUICtrl*		mJoinText;
123};
124
125class LLPanelGroupTab : public LLPanel
126{
127public:
128	LLPanelGroupTab();
129	virtual ~LLPanelGroupTab();
130
131	// Triggered when the tab becomes active.
132	virtual void activate() { }
133	
134	// Triggered when the tab becomes inactive.
135	virtual void deactivate() { }
136
137	// Asks if something needs to be applied.
138	// If returning true, this function should modify the message to the user.
139	virtual bool needsApply(std::string& mesg) { return false; }
140
141	// Asks if there is currently a modal dialog being shown.
142	virtual BOOL hasModal() { return mHasModal; }
143
144	// Request to apply current data.
145	// If returning fail, this function should modify the message to the user.
146	virtual bool apply(std::string& mesg) { return true; }
147
148	// Request a cancel of changes
149	virtual void cancel() { }
150
151	// Triggered when group information changes in the group manager.
152	virtual void update(LLGroupChange gc) { }
153
154	// This just connects the help button callback.
155	virtual BOOL postBuild();
156
157	virtual BOOL isVisibleByAgent(LLAgent* agentp);
158
159	virtual void setGroupID(const LLUUID& id) {mGroupID = id;};
160
161	void notifyObservers() {};
162
163	const LLUUID& getGroupID() const { return mGroupID;}
164
165	virtual void setupCtrls	(LLPanel* parent) {};
166
167protected:
168	LLUUID	mGroupID;
169	BOOL mAllowEdit;
170	BOOL mHasModal;
171};
172
173#endif // LL_LLPANELGROUP_H