hbfloatersearch.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /**
  2. * @file hbfloatersearch.h
  3. * @brief The "Search" floater definition.
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewergpl$
  6. *
  7. * Copyright (c) 2002-2009, Linden Research, Inc. (c) 2009-2021, Henri Beauchamp.
  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. // This used to be LL's v1 viewer "Directory" floater (llfloaterdirectory.h),
  33. // and was modified/expanded by Henri Beauchamp to add web search, showcase and
  34. // Marketplace when LL added them to their own v2+ viewers, as well as support
  35. // for OpenSim grids (optional) web search.
  36. #ifndef LL_HBFLOATERSEARCH_H
  37. #define LL_HBFLOATERSEARCH_H
  38. #include "llfloater.h"
  39. class LLPanelDirClassified;
  40. class LLPanelDirEvents;
  41. class LLPanelDirFind;
  42. class LLPanelDirLand;
  43. class HBPanelWebSearch;
  44. class LLPanelAvatar;
  45. class LLPanelEvent;
  46. class LLPanelGroup;
  47. class LLPanelPlace;
  48. class LLPanelClassified;
  49. class LLTabContainer;
  50. class HBFloaterSearch final : public LLFloater,
  51. public LLFloaterSingleton<HBFloaterSearch>
  52. {
  53. friend class LLUISingleton<HBFloaterSearch,
  54. VisibilityPolicy<LLFloater> >;
  55. public:
  56. ~HBFloaterSearch() override;
  57. void setVisible(bool visible) override;
  58. void hideAllDetailPanels();
  59. // Outside UI widgets can spawn this floater with various tabs selected.
  60. static void showFindAll(const std::string& search_text);
  61. static void showClassified(const LLUUID& classified_id);
  62. static void showEvents(S32 event_id);
  63. static void showLandForSale(const LLUUID& parcel_id);
  64. static void showGroups();
  65. static void toggle();
  66. static void setSearchURL(const std::string& url, bool on_login = false);
  67. static bool wasSearchURLSetOnLogin();
  68. // Used for toggling God mode, which changes to visibility of some picks.
  69. static void requestClassifieds();
  70. static void refreshGroup(const LLUUID& group_id);
  71. private:
  72. // Open only via the show*() or toggle() static methods defined above.
  73. HBFloaterSearch(const LLSD&);
  74. void focusCurrentPanel();
  75. static void onTabChanged(void*, bool);
  76. static void onTeleportArriving();
  77. static void showPanel(const std::string& tabname);
  78. static void* createFindAll(void* userdata);
  79. static void* createClassified(void* userdata);
  80. static void* createEvents(void* userdata);
  81. static void* createPlaces(void* userdata);
  82. static void* createLand(void* userdata);
  83. static void* createPeople(void* userdata);
  84. static void* createGroups(void* userdata);
  85. static void* createWebSearch(void* userdata);
  86. static void* createClassifiedDetail(void* userdata);
  87. static void* createAvatarDetail(void* userdata);
  88. static void* createEventDetail(void* userdata);
  89. static void* createGroupDetail(void* userdata);
  90. static void* createGroupDetailHolder(void* userdata);
  91. static void* createPlaceDetail(void* userdata);
  92. static void* createPlaceDetailSmall(void* userdata);
  93. static void* createPanelAvatar(void* userdata);
  94. public:
  95. LLPanelAvatar* mPanelAvatarp;
  96. LLPanelEvent* mPanelEventp;
  97. LLPanelGroup* mPanelGroupp;
  98. LLPanel* mPanelGroupHolderp;
  99. LLPanelPlace* mPanelPlacep;
  100. LLPanelPlace* mPanelPlaceSmallp;
  101. LLPanelClassified* mPanelClassifiedp;
  102. private:
  103. boost::signals2::connection mTeleportArrivingConnection;
  104. LLPanelDirFind* mFindAllPanel;
  105. LLPanelDirClassified* mClassifiedPanel;
  106. LLPanelDirEvents* mEventsPanel;
  107. LLPanelDirLand* mLandPanel;
  108. HBPanelWebSearch* mSearchWebPanel;
  109. LLTabContainer* mTabsContainer;
  110. static bool sSearchURLSetOnLogin;
  111. };
  112. extern bool gDisplayEventHack;
  113. #endif // LL_HBFLOATERSEARCH_H