PageRenderTime 52ms CodeModel.GetById 43ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llregioninfomodel.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 99 lines | 45 code | 21 blank | 33 comment | 0 complexity | 008841c8fcfd88730ff284605ab0bd47 MD5 | raw file
 1/** 
 2 * @file llregioninfomodel.h
 3 * @brief Region info model
 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_LLREGIONINFOMODEL_H
28#define LL_LLREGIONINFOMODEL_H
29
30class LLMessageSystem;
31
32#include "llsingleton.h"
33
34/**
35 * Contains region info, notifies interested parties of its changes.
36 */
37class LLRegionInfoModel : public LLSingleton<LLRegionInfoModel>
38{
39	LOG_CLASS(LLRegionInfoModel);
40
41public:
42	typedef boost::signals2::signal<void()> update_signal_t;
43	boost::signals2::connection setUpdateCallback(const update_signal_t::slot_type& cb);
44
45	void sendRegionTerrain(const LLUUID& invoice) const; /// upload region terrain data
46
47	bool getUseFixedSun() const;
48
49	void setUseFixedSun(bool fixed);
50
51	// *TODO: Add getters and make the data private.
52	U8			mSimAccess;
53	U8			mAgentLimit;
54
55	U32			mRegionFlags;
56	U32			mEstateID;
57	U32			mParentEstateID;
58
59	S32			mPricePerMeter;
60	S32			mRedirectGridX;
61	S32			mRedirectGridY;
62
63	F32			mBillableFactor;
64	F32			mObjectBonusFactor;
65	F32			mWaterHeight;
66	F32			mTerrainRaiseLimit;
67	F32			mTerrainLowerLimit;
68	F32			mSunHour; // 6..30
69
70	BOOL		mUseEstateSun;
71
72	std::string	mSimName;
73	std::string	mSimType;
74
75protected:
76	friend class LLSingleton<LLRegionInfoModel>;
77	friend class LLViewerRegion;
78
79	LLRegionInfoModel();
80
81	/**
82	 * Refresh model with data from the incoming server message.
83	 */
84	void update(LLMessageSystem* msg);
85
86private:
87	void reset();
88
89	// *FIXME: Duplicated code from LLPanelRegionInfo
90	static void sendEstateOwnerMessage(
91		LLMessageSystem* msg,
92		const std::string& request,
93		const LLUUID& invoice,
94		const std::vector<std::string>& strings);
95
96	update_signal_t mUpdateSignal;
97};
98
99#endif // LL_LLREGIONINFOMODEL_H