PageRenderTime 273ms CodeModel.GetById 150ms app.highlight 7ms RepoModel.GetById 114ms app.codeStats 0ms

/indra/newview/llfloatersnapshot.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 104 lines | 60 code | 18 blank | 26 comment | 0 complexity | 32866f11064e731de84ed19a88f4c05b MD5 | raw file
  1/** 
  2 * @file llfloatersnapshot.h
  3 * @brief Snapshot preview window, allowing saving, e-mailing, etc.
  4 *
  5 * $LicenseInfo:firstyear=2004&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_LLFLOATERSNAPSHOT_H
 28#define LL_LLFLOATERSNAPSHOT_H
 29
 30#include "llimage.h"
 31#include "llfloater.h"
 32
 33class LLSpinCtrl;
 34
 35class LLFloaterSnapshot : public LLFloater
 36{
 37	LOG_CLASS(LLFloaterSnapshot);
 38
 39public:
 40	typedef enum e_snapshot_format
 41	{
 42		SNAPSHOT_FORMAT_PNG,
 43		SNAPSHOT_FORMAT_JPEG,
 44		SNAPSHOT_FORMAT_BMP
 45	} ESnapshotFormat;
 46
 47	LLFloaterSnapshot(const LLSD& key);
 48	virtual ~LLFloaterSnapshot();
 49    
 50	/*virtual*/ BOOL postBuild();
 51	/*virtual*/ void draw();
 52	/*virtual*/ void onOpen(const LLSD& key);
 53	/*virtual*/ void onClose(bool app_quitting);
 54	/*virtual*/ S32 notify(const LLSD& info);
 55	
 56	static void update();
 57
 58	// TODO: create a snapshot model instead
 59	static LLFloaterSnapshot* getInstance();
 60	static void saveTexture();
 61	static BOOL saveLocal();
 62	static void preUpdate();
 63	static void postUpdate();
 64	static void postSave();
 65	static void postPanelSwitch();
 66	static LLPointer<LLImageFormatted> getImageData();
 67	static const LLVector3d& getPosTakenGlobal();
 68	static void setAgentEmail(const std::string& email);
 69
 70	static const LLRect& getThumbnailPlaceholderRect() { return sThumbnailPlaceholder->getRect(); }
 71
 72private:
 73	static LLUICtrl* sThumbnailPlaceholder;
 74	LLUICtrl *mRefreshBtn, *mRefreshLabel;
 75	LLUICtrl *mSucceessLblPanel, *mFailureLblPanel;
 76
 77	class Impl;
 78	Impl& impl;
 79};
 80
 81class LLSnapshotFloaterView : public LLFloaterView
 82{
 83public:
 84	struct Params 
 85	:	public LLInitParam::Block<Params, LLFloaterView::Params>
 86	{
 87	};
 88
 89protected:
 90	LLSnapshotFloaterView (const Params& p);
 91	friend class LLUICtrlFactory;
 92
 93public:
 94	virtual ~LLSnapshotFloaterView();
 95
 96	/*virtual*/	BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
 97	/*virtual*/	BOOL handleMouseDown(S32 x, S32 y, MASK mask);
 98	/*virtual*/	BOOL handleMouseUp(S32 x, S32 y, MASK mask);
 99	/*virtual*/	BOOL handleHover(S32 x, S32 y, MASK mask);
100};
101
102extern LLSnapshotFloaterView* gSnapshotFloaterView;
103
104#endif // LL_LLFLOATERSNAPSHOT_H