/indra/newview/llfloaterworldmap.h

https://bitbucket.org/lindenlab/viewer-beta/ · C++ Header · 203 lines · 108 code · 47 blank · 48 comment · 0 complexity · 9f3894461d1c5483689246c929a839a8 MD5 · raw file

  1. /**
  2. * @file llfloaterworldmap.h
  3. * @brief LLFloaterWorldMap class definition
  4. *
  5. * $LicenseInfo:firstyear=2003&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. * Map of the entire world, with multiple background images,
  28. * avatar tracking, teleportation by double-click, etc.
  29. */
  30. #ifndef LL_LLFLOATERWORLDMAP_H
  31. #define LL_LLFLOATERWORLDMAP_H
  32. #include "lldarray.h"
  33. #include "llfloater.h"
  34. #include "llhudtext.h"
  35. #include "llmapimagetype.h"
  36. #include "lltracker.h"
  37. #include "llslurl.h"
  38. class LLCtrlListInterface;
  39. class LLFriendObserver;
  40. class LLInventoryModel;
  41. class LLInventoryObserver;
  42. class LLItemInfo;
  43. class LLLineEditor;
  44. class LLTabContainer;
  45. class LLFloaterWorldMap : public LLFloater
  46. {
  47. public:
  48. LLFloaterWorldMap(const LLSD& key);
  49. virtual ~LLFloaterWorldMap();
  50. // Prefer this to gFloaterWorldMap
  51. static LLFloaterWorldMap* getInstance();
  52. static void *createWorldMapView(void* data);
  53. BOOL postBuild();
  54. /*virtual*/ void onOpen(const LLSD& key);
  55. /*virtual*/ void onClose(bool app_quitting);
  56. static void reloadIcons(void*);
  57. /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE );
  58. /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
  59. /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
  60. /*virtual*/ void draw();
  61. // methods for dealing with inventory. The observe() method is
  62. // called during program startup. inventoryUpdated() will be
  63. // called by a helper object when an interesting change has
  64. // occurred.
  65. void observeInventory(LLInventoryModel* inventory);
  66. void inventoryChanged();
  67. // Calls for dealing with changes in friendship
  68. void observeFriends();
  69. void friendsChanged();
  70. // tracking methods
  71. void trackAvatar( const LLUUID& avatar_id, const std::string& name );
  72. void trackLandmark( const LLUUID& landmark_item_id );
  73. void trackLocation(const LLVector3d& pos);
  74. void trackEvent(const LLItemInfo &event_info);
  75. void trackGenericItem(const LLItemInfo &item);
  76. void trackURL(const std::string& region_name, S32 x_coord, S32 y_coord, S32 z_coord);
  77. static const LLUUID& getHomeID() { return sHomeID; }
  78. // A z_attenuation of 0.0f collapses the distance into the X-Y plane
  79. F32 getDistanceToDestination(const LLVector3d& pos_global, F32 z_attenuation = 0.5f) const;
  80. void clearLocationSelection(BOOL clear_ui = FALSE);
  81. void clearAvatarSelection(BOOL clear_ui = FALSE);
  82. void clearLandmarkSelection(BOOL clear_ui = FALSE);
  83. // Adjust the maximally zoomed out limit of the zoom slider so you can
  84. // see the whole world, plus a little.
  85. void adjustZoomSliderBounds();
  86. // Catch changes in the sim list
  87. void updateSims(bool found_null_sim);
  88. // teleport to the tracked item, if there is one
  89. void teleport();
  90. void onChangeMaturity();
  91. //Slapp instigated avatar tracking
  92. void avatarTrackFromSlapp( const LLUUID& id );
  93. protected:
  94. void onGoHome();
  95. void onLandmarkComboPrearrange();
  96. void onLandmarkComboCommit();
  97. void onAvatarComboPrearrange();
  98. void onAvatarComboCommit();
  99. void onComboTextEntry( );
  100. void onSearchTextEntry( );
  101. void onClearBtn();
  102. void onClickTeleportBtn();
  103. void onShowTargetBtn();
  104. void onShowAgentBtn();
  105. void onCopySLURL();
  106. void centerOnTarget(BOOL animate);
  107. void updateLocation();
  108. // fly to the tracked item, if there is one
  109. void fly();
  110. void buildLandmarkIDLists();
  111. void flyToLandmark();
  112. void teleportToLandmark();
  113. void setLandmarkVisited();
  114. void buildAvatarIDList();
  115. void flyToAvatar();
  116. void teleportToAvatar();
  117. void updateSearchEnabled();
  118. void onLocationFocusChanged( LLFocusableElement* ctrl );
  119. void onLocationCommit();
  120. void onCoordinatesCommit();
  121. void onCommitSearchResult();
  122. void cacheLandmarkPosition();
  123. private:
  124. LLPanel* mPanel; // Panel displaying the map
  125. // Ties to LLWorldMapView::sMapScale, in pixels per region
  126. F32 mCurZoomVal;
  127. LLFrameTimer mZoomTimer;
  128. // update display of teleport destination coordinates - pos is in global coordinates
  129. void updateTeleportCoordsDisplay( const LLVector3d& pos );
  130. // enable/disable teleport destination coordinates
  131. void enableTeleportCoordsDisplay( bool enabled );
  132. LLDynamicArray<LLUUID> mLandmarkAssetIDList;
  133. LLDynamicArray<LLUUID> mLandmarkItemIDList;
  134. static const LLUUID sHomeID;
  135. LLInventoryModel* mInventory;
  136. LLInventoryObserver* mInventoryObserver;
  137. LLFriendObserver* mFriendObserver;
  138. std::string mCompletingRegionName;
  139. // Local position from trackURL() request, used to select final
  140. // position once region lookup complete.
  141. LLVector3 mCompletingRegionPos;
  142. std::string mLastRegionName;
  143. BOOL mWaitingForTracker;
  144. BOOL mIsClosing;
  145. BOOL mSetToUserPosition;
  146. LLVector3d mTrackedLocation;
  147. LLTracker::ETrackingStatus mTrackedStatus;
  148. std::string mTrackedSimName;
  149. std::string mTrackedAvatarName;
  150. LLSLURL mSLURL;
  151. LLCtrlListInterface * mListFriendCombo;
  152. LLCtrlListInterface * mListLandmarkCombo;
  153. LLCtrlListInterface * mListSearchResults;
  154. };
  155. extern LLFloaterWorldMap* gFloaterWorldMap;
  156. #endif