PageRenderTime 51ms CodeModel.GetById 12ms app.highlight 32ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/newview/llfloatertools.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 208 lines | 132 code | 40 blank | 36 comment | 0 complexity | d25a354bc7328267eb9f46ea959ba682 MD5 | raw file
  1/** 
  2 * @file llfloatertools.h
  3 * @brief The edit tools, including move, position, land, etc.
  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_LLFLOATERTOOLS_H
 28#define LL_LLFLOATERTOOLS_H
 29
 30#include "llfloater.h"
 31#include "llcoord.h"
 32#include "llparcelselection.h"
 33
 34class LLButton;
 35class LLCheckBoxCtrl;
 36class LLPanelPermissions;
 37class LLPanelObject;
 38class LLPanelVolume;
 39class LLPanelContents;
 40class LLPanelFace;
 41class LLPanelLandInfo;
 42class LLRadioGroup;
 43class LLSlider;
 44class LLTabContainer;
 45class LLTextBox;
 46class LLMediaCtrl;
 47class LLTool;
 48class LLParcelSelection;
 49class LLObjectSelection;
 50class LLLandImpactsObserver;
 51
 52typedef LLSafeHandle<LLObjectSelection> LLObjectSelectionHandle;
 53
 54class LLFloaterTools
 55: public LLFloater
 56{
 57public:
 58	virtual	BOOL	postBuild();
 59	static	void*	createPanelPermissions(void*	vdata);
 60	static	void*	createPanelObject(void*	vdata);
 61	static	void*	createPanelVolume(void*	vdata);
 62	static	void*	createPanelFace(void*	vdata);
 63	static	void*	createPanelContents(void*	vdata);
 64	static	void*	createPanelLandInfo(void*	vdata);
 65
 66	LLFloaterTools(const LLSD& key);
 67	virtual ~LLFloaterTools();
 68
 69	/*virtual*/ void onOpen(const LLSD& key);
 70	/*virtual*/ BOOL canClose();
 71	/*virtual*/ void onClose(bool app_quitting);
 72	/*virtual*/ void draw();
 73	/*virtual*/ void onFocusReceived();
 74
 75	// call this once per frame to handle visibility, rect location,
 76	// button highlights, etc.
 77	void updatePopup(LLCoordGL center, MASK mask);
 78
 79	// When the floater is going away, reset any options that need to be 
 80	// cleared.
 81	void resetToolState();
 82
 83	enum EInfoPanel
 84	{
 85		PANEL_GENERAL=0,
 86		PANEL_OBJECT,
 87		PANEL_FEATURES,
 88		PANEL_FACE,
 89		PANEL_CONTENTS,
 90		PANEL_COUNT
 91	};
 92
 93	void dirty();
 94	void showPanel(EInfoPanel panel);
 95
 96	void setStatusText(const std::string& text);
 97	static void setEditTool(void* data);
 98	void setTool(const LLSD& user_data);
 99	void saveLastTool();
100	void onClickBtnDeleteMedia();
101	void onClickBtnAddMedia();
102	void onClickBtnEditMedia();
103	void clearMediaSettings();
104	void updateMediaTitle();
105	void navigateToTitleMedia( const std::string url );
106	bool selectedMediaEditable();
107	void updateLandImpacts();
108
109private:
110	void refresh();
111	void refreshMedia();
112	void getMediaState();
113	void updateMediaSettings();
114	static bool deleteMediaConfirm(const LLSD& notification, const LLSD& response);
115	static bool multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response);
116	static void setObjectType( LLPCode pcode );
117	void onClickGridOptions();
118
119public:
120	LLButton		*mBtnFocus;
121	LLButton		*mBtnMove;
122	LLButton		*mBtnEdit;
123	LLButton		*mBtnCreate;
124	LLButton		*mBtnLand;
125
126	LLTextBox		*mTextStatus;
127
128	// Focus buttons
129	LLRadioGroup*	mRadioGroupFocus;
130
131	// Move buttons
132	LLRadioGroup*	mRadioGroupMove;
133
134	// Edit buttons
135	LLRadioGroup*	mRadioGroupEdit;
136
137	LLCheckBoxCtrl	*mCheckSelectIndividual;
138	LLButton*		mBtnLink;
139	LLButton*		mBtnUnlink;
140
141	LLCheckBoxCtrl*	mCheckSnapToGrid;
142	LLButton*		mBtnGridOptions;
143	LLCheckBoxCtrl*	mCheckStretchUniform;
144	LLCheckBoxCtrl*	mCheckStretchTexture;
145
146	// !HACK! Replacement of mCheckStretchUniform label because LLCheckBoxCtrl
147	//  doesn't support word_wrap of its label. Need to fix truncation bug EXT-6658
148	LLTextBox*		mCheckStretchUniformLabel;
149
150	LLButton	*mBtnRotateLeft;
151	LLButton	*mBtnRotateReset;
152	LLButton	*mBtnRotateRight;
153
154	LLButton	*mBtnDelete;
155	LLButton	*mBtnDuplicate;
156	LLButton	*mBtnDuplicateInPlace;
157
158	// Create buttons
159	LLCheckBoxCtrl	*mCheckSticky;
160	LLCheckBoxCtrl	*mCheckCopySelection;
161	LLCheckBoxCtrl	*mCheckCopyCenters;
162	LLCheckBoxCtrl	*mCheckCopyRotates;
163
164	// Land buttons
165	LLRadioGroup*	mRadioGroupLand;
166	LLSlider		*mSliderDozerSize;
167	LLSlider		*mSliderDozerForce;
168
169	LLButton		*mBtnApplyToSelection;
170
171	std::vector<LLButton*>	mButtons;//[ 15 ];
172
173	LLTabContainer	*mTab;
174	LLPanelPermissions		*mPanelPermissions;
175	LLPanelObject			*mPanelObject;
176	LLPanelVolume			*mPanelVolume;
177	LLPanelContents			*mPanelContents;
178	LLPanelFace				*mPanelFace;
179	LLPanelLandInfo			*mPanelLandInfo;
180
181	LLViewBorder*			mCostTextBorder;
182
183	LLTabContainer*			mTabLand;
184
185	LLLandImpactsObserver*  mLandImpactsObserver;
186
187	LLParcelSelectionHandle	mParcelSelection;
188	LLObjectSelectionHandle	mObjectSelection;
189
190	LLMediaCtrl				*mTitleMedia;
191	bool					mNeedMediaTitle;
192
193private:
194	BOOL					mDirty;
195
196	std::map<std::string, std::string> mStatusText;
197
198protected:
199	LLSD				mMediaSettings;
200
201public:
202	static bool		sShowObjectCost;
203	
204};
205
206extern LLFloaterTools *gFloaterTools;
207
208#endif