PageRenderTime 18ms CodeModel.GetById 8ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llfloatereditsky.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 113 lines | 56 code | 22 blank | 35 comment | 0 complexity | 840214334132917ffad0ae8e40eb5332 MD5 | raw file
  1/** 
  2 * @file llfloatereditsky.h
  3 * @brief Floater to create or edit a sky preset
  4 *
  5 * $LicenseInfo:firstyear=2011&license=viewerlgpl$
  6 * Second Life Viewer Source Code
  7 * Copyright (C) 2011, 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_LLFLOATEREDITSKY_H
 28#define LL_LLFLOATEREDITSKY_H
 29
 30#include "llfloater.h"
 31#include "llwlparammanager.h"
 32
 33class LLButton;
 34class LLCheckBoxCtrl;
 35class LLComboBox;
 36class LLLineEditor;
 37
 38/**
 39 * Floater for creating or editing a sky preset.
 40 */
 41class LLFloaterEditSky : public LLFloater
 42{
 43	LOG_CLASS(LLFloaterEditSky);
 44
 45public:
 46	LLFloaterEditSky(const LLSD &key);
 47
 48	/*virtual*/	BOOL	postBuild();
 49	/*virtual*/ void	onOpen(const LLSD& key);
 50	/*virtual*/ void	onClose(bool app_quitting);
 51	/*virtual*/ void	draw();
 52
 53private:
 54	void initCallbacks(void);
 55
 56	//-- WL stuff begins ------------------------------------------------------
 57
 58	void syncControls(); /// sync up sliders with parameters
 59
 60	void setColorSwatch(const std::string& name, const WLColorControl& from_ctrl, F32 k);
 61
 62	// general purpose callbacks for dealing with color controllers
 63	void onColorControlMoved(LLUICtrl* ctrl, WLColorControl* color_ctrl);
 64	void onColorControlRMoved(LLUICtrl* ctrl, void* userdata);
 65	void onColorControlGMoved(LLUICtrl* ctrl, void* userdata);
 66	void onColorControlBMoved(LLUICtrl* ctrl, void* userdata);
 67	void onFloatControlMoved(LLUICtrl* ctrl, void* userdata);
 68
 69	// lighting callbacks for glow
 70	void onGlowRMoved(LLUICtrl* ctrl, void* userdata);
 71	void onGlowBMoved(LLUICtrl* ctrl, void* userdata);
 72
 73	// lighting callbacks for sun
 74	void onSunMoved(LLUICtrl* ctrl, void* userdata);
 75	void onTimeChanged();
 76
 77	// for handling when the star slider is moved to adjust the alpha
 78	void onStarAlphaMoved(LLUICtrl* ctrl);
 79
 80	// handle cloud scrolling
 81	void onCloudScrollXMoved(LLUICtrl* ctrl);
 82	void onCloudScrollYMoved(LLUICtrl* ctrl);
 83	void onCloudScrollXToggled(LLUICtrl* ctrl);
 84	void onCloudScrollYToggled(LLUICtrl* ctrl);
 85
 86	//-- WL stuff ends --------------------------------------------------------
 87
 88	void reset(); /// reset the floater to its initial state
 89	bool isNewPreset() const;
 90	void refreshSkyPresetsList();
 91	void enableEditing(bool enable);
 92	void saveRegionSky();
 93	LLWLParamKey getSelectedSkyPreset();
 94
 95	void onSkyPresetNameEdited();
 96	void onSkyPresetSelected();
 97	bool onSaveAnswer(const LLSD& notification, const LLSD& response);
 98	void onSaveConfirmed();
 99
100	void onBtnSave();
101	void onBtnCancel();
102
103	void onSkyPresetListChange();
104	void onRegionSettingsChange();
105	void onRegionInfoUpdate();
106
107	LLLineEditor*	mSkyPresetNameEditor;
108	LLComboBox*		mSkyPresetCombo;
109	LLCheckBoxCtrl*	mMakeDefaultCheckBox;
110	LLButton*		mSaveButton;
111};
112
113#endif // LL_LLFLOATEREDITSKY_H