PageRenderTime 193ms CodeModel.GetById 80ms app.highlight 4ms RepoModel.GetById 106ms app.codeStats 1ms

/indra/newview/llparcelselection.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 82 lines | 33 code | 17 blank | 32 comment | 0 complexity | 8ec6d62f22971defbb2b609f5ed096ad MD5 | raw file
 1/**
 2 * @file llparcelselection.h
 3 * @brief Information about the currently selected parcel
 4 *
 5 * $LicenseInfo:firstyear=2007&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 LLPARCELSELECTION_H
28#define LLPARCELSELECTION_H
29
30#include "llrefcount.h"
31#include "llsafehandle.h"
32
33class LLParcel;
34
35class LLParcelSelection : public LLRefCount
36{
37	friend class LLViewerParcelMgr;
38
39protected:
40	~LLParcelSelection();
41
42public:
43	LLParcelSelection(LLParcel* parcel);
44	LLParcelSelection();
45
46	// this can return NULL at any time, as parcel selection
47	// might have been invalidated.
48	LLParcel* getParcel() { return mParcel; }
49
50	// Return the number of grid units that are owned by you within
51	// the selection (computed by server).
52	S32 getSelfCount() const { return mSelectedSelfCount; }
53
54	// Returns area that will actually be claimed in meters squared.
55	S32		getClaimableArea() const;
56	bool	hasOthersSelected() const;
57
58	// Does the selection have multiple land owners in it?
59	BOOL	getMultipleOwners() const;
60
61	// Is the entire parcel selected, or just a part?
62	BOOL	getWholeParcelSelected() const;
63
64	static LLParcelSelection* getNullParcelSelection();
65
66private:
67	void setParcel(LLParcel* parcel) { mParcel = parcel; }
68
69private:
70	LLParcel*	mParcel;
71	BOOL		mSelectedMultipleOwners;
72	BOOL		mWholeParcelSelected;
73	S32			mSelectedSelfCount;
74	S32			mSelectedOtherCount;
75	S32			mSelectedPublicCount;
76
77	static LLPointer<LLParcelSelection> sNullSelection;
78};
79
80typedef LLSafeHandle<LLParcelSelection> LLParcelSelectionHandle;
81
82#endif