PageRenderTime 332ms CodeModel.GetById 101ms app.highlight 17ms RepoModel.GetById 113ms app.codeStats 1ms

/indra/newview/llfloatergodtools.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 273 lines | 165 code | 58 blank | 50 comment | 0 complexity | d351e1de863725fc3e9bc885c626c76f MD5 | raw file
  1/** 
  2 * @file llfloatergodtools.h
  3 * @brief The on-screen rectangle with tool options.
  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_LLFLOATERGODTOOLS_H
 28#define LL_LLFLOATERGODTOOLS_H
 29
 30#include "llcoord.h"
 31#include "llhost.h"
 32#include "llframetimer.h"
 33
 34#include "llfloater.h"
 35#include "llpanel.h"
 36#include <vector>
 37
 38class LLAvatarName;
 39class LLButton;
 40class LLCheckBoxCtrl;
 41class LLComboBox;
 42class LLUICtrl;
 43class LLLineEditor;
 44class LLPanelGridTools;
 45class LLPanelRegionTools;
 46class LLPanelObjectTools;
 47class LLPanelRequestTools;
 48//class LLSliderCtrl;
 49class LLSpinCtrl;
 50class LLTabContainer;
 51class LLTextBox;
 52class LLMessageSystem;
 53
 54class LLFloaterGodTools
 55	: public LLFloater
 56{
 57	friend class LLFloaterReg;
 58public:
 59
 60	enum EGodPanel
 61	{
 62		PANEL_GRID,
 63		PANEL_REGION,
 64		PANEL_OBJECT,
 65		PANEL_REQUEST,
 66		PANEL_COUNT
 67	};
 68
 69	static void* createPanelGrid(void *userdata);
 70	static void* createPanelRegion(void *userdata);
 71	static void* createPanelObjects(void *userdata);
 72	static void* createPanelRequest(void *userdata);
 73
 74	static void refreshAll();
 75
 76	void showPanel(const std::string& panel_name);
 77
 78	virtual void onOpen(const LLSD& key);
 79
 80	virtual void draw();
 81
 82	// call this once per frame to handle visibility, rect location,
 83	// button highlights, etc.
 84	void updatePopup(LLCoordGL center, MASK mask);
 85
 86	// Get data to populate UI.
 87	void sendRegionInfoRequest();
 88
 89	// get and process region info if necessary.
 90	static void processRegionInfo(LLMessageSystem* msg);
 91
 92	// Send possibly changed values to simulator.
 93	void sendGodUpdateRegionInfo();
 94
 95private:
 96	
 97	LLFloaterGodTools(const LLSD& key);
 98	~LLFloaterGodTools();
 99	
100protected:
101	U32 computeRegionFlags() const;
102
103protected:
104
105	/*virtual*/	BOOL	postBuild();
106	// When the floater is going away, reset any options that need to be 
107	// cleared.
108	void resetToolState();
109
110public:
111	LLPanelRegionTools 	*mPanelRegionTools;
112	LLPanelObjectTools	*mPanelObjectTools;
113
114	LLHost mCurrentHost;
115	LLFrameTimer mUpdateTimer;
116};
117
118
119//-----------------------------------------------------------------------------
120// LLPanelRegionTools
121//-----------------------------------------------------------------------------
122
123class LLPanelRegionTools 
124: public LLPanel
125{
126public:
127	LLPanelRegionTools();
128	/*virtual*/ ~LLPanelRegionTools();
129
130	BOOL postBuild();
131
132	/*virtual*/ void refresh();
133
134	static void onSaveState(void* userdata);
135	static void onChangeSimName(LLLineEditor* caller, void* userdata);
136	
137	void onChangeAnything();
138	void onChangePrelude();
139	void onApplyChanges();
140	void onBakeTerrain();
141	void onRevertTerrain();
142	void onSwapTerrain();
143	void onSelectRegion();
144	void onRefresh();
145
146	// set internal checkboxes/spinners/combos 
147	const std::string getSimName() const;
148	U32 getEstateID() const;
149	U32 getParentEstateID() const;
150	U32 getRegionFlags() const;
151	U32 getRegionFlagsMask() const;
152	F32 getBillableFactor() const;
153	S32 getPricePerMeter() const;
154	S32 getGridPosX() const;
155	S32 getGridPosY() const;
156	S32 getRedirectGridX() const;
157	S32 getRedirectGridY() const;
158
159	// set internal checkboxes/spinners/combos 
160	void setSimName(const std::string& name);
161	void setEstateID(U32 id);
162	void setParentEstateID(U32 id);
163	void setCheckFlags(U32 flags);
164	void setBillableFactor(F32 billable_factor);
165	void setPricePerMeter(S32 price);
166	void setGridPosX(S32 pos);
167	void setGridPosY(S32 pos);
168	void setRedirectGridX(S32 pos);
169	void setRedirectGridY(S32 pos);
170
171	U32 computeRegionFlags(U32 initial_flags) const;
172	void clearAllWidgets();
173	void enableAllWidgets();
174
175protected:
176	// gets from internal checkboxes/spinners/combos
177	void updateCurrentRegion() const;
178};
179
180
181//-----------------------------------------------------------------------------
182// LLPanelGridTools
183//-----------------------------------------------------------------------------
184
185class LLPanelGridTools
186: public LLPanel
187{
188public:
189	LLPanelGridTools();
190	virtual ~LLPanelGridTools();
191
192	BOOL postBuild();
193
194	void refresh();
195
196	static void onDragSunPhase(LLUICtrl *ctrl, void *userdata);
197	void onClickFlushMapVisibilityCaches();
198	static bool flushMapVisibilityCachesConfirm(const LLSD& notification, const LLSD& response);
199
200protected:
201	std::string        mKickMessage; // Message to send on kick
202};
203
204
205//-----------------------------------------------------------------------------
206// LLPanelObjectTools
207//-----------------------------------------------------------------------------
208
209class LLPanelObjectTools 
210: public LLPanel
211{
212public:
213	LLPanelObjectTools();
214	/*virtual*/ ~LLPanelObjectTools();
215
216	BOOL postBuild();
217
218	/*virtual*/ void refresh();
219
220	void setTargetAvatar(const LLUUID& target_id);
221	U32 computeRegionFlags(U32 initial_flags) const;
222	void clearAllWidgets();
223	void enableAllWidgets();
224	void setCheckFlags(U32 flags);
225
226	void onChangeAnything();
227	void onApplyChanges();
228	void onClickSet();
229	void callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names);
230	void onClickDeletePublicOwnedBy();
231	void onClickDeleteAllScriptedOwnedBy();
232	void onClickDeleteAllOwnedBy();
233	static bool callbackSimWideDeletes(const LLSD& notification, const LLSD& response);
234	void onGetTopColliders();
235	void onGetTopScripts();
236	void onGetScriptDigest();
237	static void onClickSetBySelection(void* data);
238
239protected:
240	LLUUID		mTargetAvatar;
241
242	// For all delete dialogs, store flags here for message.
243	U32 mSimWideDeletesFlags;
244}; 
245
246
247//-----------------------------------------------------------------------------
248// LLPanelRequestTools
249//-----------------------------------------------------------------------------
250
251class LLPanelRequestTools : public LLPanel
252{
253public:
254	LLPanelRequestTools();
255	/*virtual*/ ~LLPanelRequestTools();
256
257	BOOL postBuild();
258
259	void refresh();
260
261	static void sendRequest(const std::string& request, 
262							const std::string& parameter, 
263							const LLHost& host);
264
265protected:
266	void onClickRequest();
267	void sendRequest(const LLHost& host);
268};
269
270// Flags are SWD_ flags.
271void send_sim_wide_deletes(const LLUUID& owner_id, U32 flags);
272
273#endif