llpanelplace.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /**
  2. * @file llpanelplace.h
  3. * @brief Display of a place in the Find directory.
  4. *
  5. * $LicenseInfo:firstyear=2004&license=viewergpl$
  6. *
  7. * Copyright (c) 2004-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLPANELPLACE_H
  33. #define LL_LLPANELPLACE_H
  34. #include "boost/signals2.hpp"
  35. #include "llpanel.h"
  36. #include "llvector3d.h"
  37. #include "llviewerparcelmgr.h"
  38. #define CREATE_LANDMARK 0
  39. class LLButton;
  40. class LLTextBox;
  41. class LLLineEditor;
  42. class LLTextEditor;
  43. class LLTextureCtrl;
  44. class LLInventoryItem;
  45. class LLPanelPlace final : public LLPanel, LLParcelInfoObserver
  46. {
  47. protected:
  48. LOG_CLASS(LLPanelPlace);
  49. public:
  50. LLPanelPlace(bool can_close_parent = true);
  51. ~LLPanelPlace() override;
  52. bool postBuild() override;
  53. // Ignore all old location information, useful if you are recycling an
  54. // existing dialog and need to clear it.
  55. void resetLocation();
  56. // Sends a request for data about the given parcel, which will only update
  57. // the location if there is none already available.
  58. void setParcelID(const LLUUID& parcel_id) override;
  59. void setErrorStatus(S32 status, const std::string& reason) override;
  60. void processParcelInfo(const LLParcelData& parcel_data) override;
  61. void displayItemInfo(const LLInventoryItem* item);
  62. void setRegionID(const LLUUID& region_id) { mRegionID = region_id; }
  63. void setSnapshot(const LLUUID& snapshot_id);
  64. void setLocationString(const std::string& location);
  65. void setLandTypeString(const std::string& land_type);
  66. void resetName(const std::string& name);
  67. void sendParcelInfoRequest();
  68. void displayParcelInfo(const LLVector3& pos_region,
  69. const LLUUID& landmark_asset_id,
  70. const LLUUID& landmark_item_id, // so we can send map floater the correct inventory item id
  71. const LLUUID& region_id,
  72. const LLVector3d& pos_global);
  73. LLTextureCtrl* getSnapshotCtrl() const { return mSnapshotCtrl; }
  74. bool canCloseParent() { return mCanCloseParent; }
  75. protected:
  76. static void onClickTeleport(void* data);
  77. static void onClickMap(void* data);
  78. #if CREATE_LANDMARK
  79. static void onClickLandmark(void* data);
  80. #endif
  81. static void onClickAuction(void* data);
  82. static void onClickOwnerName(void* data);
  83. static void nameCallback(const LLUUID& id, const std::string& name,
  84. bool is_group, LLPanelPlace* self);
  85. // Go to auction web page if user clicked OK
  86. static bool callbackAuctionWebPage(const LLSD& notification,
  87. const LLSD& response);
  88. static void onTeleportArriving(LLPanelPlace* self);
  89. static void onTeleportFailed(LLPanelPlace* self);
  90. protected:
  91. LLTextureCtrl* mSnapshotCtrl;
  92. LLTextEditor* mDescEditor;
  93. LLTextBox* mParcelNameText;
  94. LLTextBox* mParcelInfoText;
  95. LLTextBox* mLandTypeText;
  96. LLTextBox* mOwnerLabel;
  97. LLTextBox* mOwnerText;
  98. LLTextBox* mLocationText;
  99. LLButton* mTeleportBtn;
  100. LLButton* mMapBtn;
  101. LLButton* mAuctionBtn;
  102. #if CREATE_LANDMARK
  103. LLButton* mLandmarkBtn;
  104. #endif
  105. LLUUID mParcelID;
  106. LLUUID mRequestedID;
  107. LLUUID mRegionID;
  108. LLUUID mLandmarkAssetID;
  109. LLUUID mLandmarkItemID;
  110. LLUUID mOwnerID;
  111. // Absolute position of the location for teleport, may not be available
  112. // (hence zero)
  113. LLVector3d mPosGlobal;
  114. // Region-local position for teleport, always available.
  115. LLVector3 mPosRegion;
  116. // Zero if this is not an auction
  117. S32 mAuctionID;
  118. boost::signals2::connection mTeleportArrivingConnection;
  119. boost::signals2::connection mTeleportFailedConnection;
  120. bool mCanCloseParent;
  121. bool mTeleportRequested;
  122. bool mOwnerIsGroup;
  123. typedef std::set<LLPanelPlace*> panel_list_t;
  124. static panel_list_t sInstances;
  125. };
  126. #endif // LL_LLPANELPLACE_H