PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 5ms RepoModel.GetById 35ms app.codeStats 0ms

/indra/newview/llpanelsnapshot.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 71 lines | 33 code | 9 blank | 29 comment | 0 complexity | 7494b46fc5721f482a4301c142f8dbab MD5 | raw file
 1/** 
 2 * @file llpanelsnapshot.h
 3 * @brief Snapshot panel base class
 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_LLPANELSNAPSHOT_H
28#define LL_LLPANELSNAPSHOT_H
29
30#include "llfloatersnapshot.h"
31
32class LLSideTrayPanelContainer;
33
34/**
35 * Snapshot panel base class.
36 */
37class LLPanelSnapshot: public LLPanel
38{
39public:
40	/*virtual*/ BOOL postBuild();
41	/*virtual*/ void onOpen(const LLSD& key);
42
43	virtual std::string getWidthSpinnerName() const = 0;
44	virtual std::string getHeightSpinnerName() const = 0;
45	virtual std::string getAspectRatioCBName() const = 0;
46	virtual std::string getImageSizeComboName() const = 0;
47	virtual std::string getImageSizePanelName() const = 0;
48
49	virtual S32 getTypedPreviewWidth() const;
50	virtual S32 getTypedPreviewHeight() const;
51	virtual LLSpinCtrl* getWidthSpinner();
52	virtual LLSpinCtrl* getHeightSpinner();
53	virtual void enableAspectRatioCheckbox(BOOL enable);
54	virtual LLFloaterSnapshot::ESnapshotFormat getImageFormat() const;
55	virtual void updateControls(const LLSD& info) = 0; ///< Update controls from saved settings
56	void enableControls(BOOL enable);
57
58protected:
59	LLSideTrayPanelContainer* getParentContainer();
60	virtual void updateCustomResControls();
61	void updateImageQualityLevel();
62	void goBack(); ///< Switch to the default (Snapshot Options) panel
63	void cancel();
64
65	// common UI callbacks
66	void onCustomResolutionCommit();
67	void onResolutionComboCommit(LLUICtrl* ctrl);
68	void onKeepAspectRatioCommit(LLUICtrl* ctrl);
69};
70
71#endif // LL_LLPANELSNAPSHOT_H