PageRenderTime 51ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): LGPL-2.1
  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. #ifndef LLPARCELSELECTION_H
  27. #define LLPARCELSELECTION_H
  28. #include "llrefcount.h"
  29. #include "llsafehandle.h"
  30. class LLParcel;
  31. class LLParcelSelection : public LLRefCount
  32. {
  33. friend class LLViewerParcelMgr;
  34. protected:
  35. ~LLParcelSelection();
  36. public:
  37. LLParcelSelection(LLParcel* parcel);
  38. LLParcelSelection();
  39. // this can return NULL at any time, as parcel selection
  40. // might have been invalidated.
  41. LLParcel* getParcel() { return mParcel; }
  42. // Return the number of grid units that are owned by you within
  43. // the selection (computed by server).
  44. S32 getSelfCount() const { return mSelectedSelfCount; }
  45. // Returns area that will actually be claimed in meters squared.
  46. S32 getClaimableArea() const;
  47. bool hasOthersSelected() const;
  48. // Does the selection have multiple land owners in it?
  49. BOOL getMultipleOwners() const;
  50. // Is the entire parcel selected, or just a part?
  51. BOOL getWholeParcelSelected() const;
  52. static LLParcelSelection* getNullParcelSelection();
  53. private:
  54. void setParcel(LLParcel* parcel) { mParcel = parcel; }
  55. private:
  56. LLParcel* mParcel;
  57. BOOL mSelectedMultipleOwners;
  58. BOOL mWholeParcelSelected;
  59. S32 mSelectedSelfCount;
  60. S32 mSelectedOtherCount;
  61. S32 mSelectedPublicCount;
  62. static LLPointer<LLParcelSelection> sNullSelection;
  63. };
  64. typedef LLSafeHandle<LLParcelSelection> LLParcelSelectionHandle;
  65. #endif