llpanelpick.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /**
  2. * @file llpanelpick.h
  3. * @brief LLPanelPick class definition
  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. // Display of a "Top Pick" used both for the global top picks in the Search
  33. // floater, and also for each individual user's picks in their profile.
  34. #ifndef LL_LLPANELPICK_H
  35. #define LL_LLPANELPICK_H
  36. #include "llpanel.h"
  37. #include "llvector3d.h"
  38. #include "lluuid.h"
  39. #include "llavatarproperties.h"
  40. class LLButton;
  41. class LLCheckBoxCtrl;
  42. class LLIconCtrl;
  43. class LLLineEditor;
  44. class LLTextBox;
  45. class LLTextEditor;
  46. class LLTextureCtrl;
  47. class LLUICtrl;
  48. class LLPanelPick final : public LLPanel, LLAvatarPropertiesObserver
  49. {
  50. protected:
  51. LOG_CLASS(LLPanelPick);
  52. public:
  53. LLPanelPick(bool top_pick);
  54. ~LLPanelPick() override;
  55. void reset();
  56. bool postBuild() override;
  57. void draw() override;
  58. void refresh() override;
  59. // LLAvatarPropertiesObserver override
  60. void processProperties(S32 type, void* data) override;
  61. // Setup a new pick, including creating an id, giving a sane
  62. // initial position, etc.
  63. void initNewPick();
  64. // We need to know the creator id so the database knows which partition to
  65. // query for the pick data.
  66. void setPickID(const LLUUID& pick_id, const LLUUID& creator_id);
  67. // Schedules the panel to request data from server next time it is drawn
  68. void markForServerRequest();
  69. std::string getPickName();
  70. LL_INLINE const LLUUID& getPickID() const { return mPickID; }
  71. LL_INLINE const LLUUID& getPickCreatorID() const { return mCreatorID; }
  72. void sendPickInfoRequest();
  73. void sendPickInfoUpdate();
  74. protected:
  75. static std::string createLocationText(const std::string& owner_name,
  76. std::string parcel_name,
  77. const std::string& sim_name,
  78. const LLVector3d& pos_global);
  79. static void onClickTeleport(void* data);
  80. static void onClickMap(void* data);
  81. static void onClickSetLocation(void* data);
  82. static void onCommitAny(LLUICtrl* ctrl, void* data);
  83. protected:
  84. LLTextureCtrl* mSnapshotCtrl;
  85. LLLineEditor* mNameEditor;
  86. LLTextEditor* mDescEditor;
  87. LLLineEditor* mLocationEditor;
  88. LLButton* mTeleportBtn;
  89. LLButton* mMapBtn;
  90. LLTextBox* mSortOrderText;
  91. LLLineEditor* mSortOrderEditor;
  92. LLCheckBoxCtrl* mEnabledCheck;
  93. LLButton* mSetBtn;
  94. LLUUID mPickID;
  95. LLUUID mCreatorID;
  96. LLUUID mParcelID;
  97. LLVector3d mPosGlobal;
  98. std::string mSimName;
  99. bool mTopPick;
  100. // Data will be requested on first draw
  101. bool mDataRequested;
  102. bool mDataReceived;
  103. };
  104. #endif // LL_LLPANELPICK_H