00001
00032
00033
00034
00035
00036
00037 #ifndef LL_LLFLOATERWORLDMAP_H
00038 #define LL_LLFLOATERWORLDMAP_H
00039
00040 #include "lldarray.h"
00041 #include "llfloater.h"
00042 #include "llhudtext.h"
00043 #include "llmapimagetype.h"
00044 #include "lltracker.h"
00045
00046 class LLEventInfo;
00047 class LLFriendObserver;
00048 class LLInventoryModel;
00049 class LLInventoryObserver;
00050 class LLItemInfo;
00051 class LLTabContainer;
00052 class LLWorldMapView;
00053
00054 class LLFloaterWorldMap : public LLFloater
00055 {
00056 public:
00057 LLFloaterWorldMap();
00058 virtual ~LLFloaterWorldMap();
00059
00060 static void *createWorldMapView(void* data);
00061 BOOL postBuild();
00062
00063 void onClose(bool app_quitting);
00064
00065 static void show(void*, BOOL center_on_target );
00066 static void reloadIcons(void*);
00067 static void toggle(void*);
00068 static void hide(void*);
00069
00070 void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE );
00071 BOOL handleHover(S32 x, S32 y, MASK mask);
00072 BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
00073 void setVisible(BOOL visible);
00074 void draw();
00075
00076
00077
00078
00079
00080 void observeInventory(LLInventoryModel* inventory);
00081 void inventoryChanged();
00082
00083
00084 void observeFriends();
00085 void friendsChanged();
00086
00087
00088 void trackAvatar( const LLUUID& avatar_id, const LLString& name );
00089 void trackLandmark( const LLUUID& landmark_item_id );
00090 void trackLocation(const LLVector3d& pos);
00091 void trackEvent(const LLItemInfo &event_info);
00092 void trackGenericItem(const LLItemInfo &item);
00093 void trackURL(const LLString& region_name, S32 x_coord, S32 y_coord, S32 z_coord);
00094
00095 static const LLUUID& getHomeID() { return sHomeID; }
00096
00097
00098 F32 getDistanceToDestination(const LLVector3d& pos_global, F32 z_attenuation = 0.5f) const;
00099
00100 void clearLocationSelection(BOOL clear_ui = FALSE);
00101 void clearAvatarSelection(BOOL clear_ui = FALSE);
00102 void clearLandmarkSelection(BOOL clear_ui = FALSE);
00103
00104
00105
00106 void adjustZoomSliderBounds();
00107
00108
00109 void updateSims(bool found_null_sim);
00110
00111
00112 void teleport();
00113
00114 protected:
00115 static void onPanBtn( void* userdata );
00116
00117 static void onGoHome(void* data);
00118
00119 static void onLandmarkComboPrearrange( LLUICtrl* ctrl, void* data );
00120 static void onLandmarkComboCommit( LLUICtrl* ctrl, void* data );
00121
00122 static void onAvatarComboPrearrange( LLUICtrl* ctrl, void* data );
00123 static void onAvatarComboCommit( LLUICtrl* ctrl, void* data );
00124
00125 static void onCommitBackground(void* data, bool from_click);
00126
00127 static void onClearBtn(void*);
00128 static void onFlyBtn(void*);
00129 static void onClickTeleportBtn(void*);
00130 static void onShowTargetBtn(void*);
00131 static void onShowAgentBtn(void*);
00132 static void onCopySLURL(void*);
00133
00134 static void onCheckEvents(LLUICtrl* ctrl, void*);
00135
00136 void centerOnTarget(BOOL animate);
00137 void updateLocation();
00138
00139
00140 void fly();
00141
00142 void buildLandmarkIDLists();
00143 static void onGoToLandmarkDialog(S32 option,void* userdata);
00144 void flyToLandmark();
00145 void teleportToLandmark();
00146 void setLandmarkVisited();
00147
00148 void buildAvatarIDList();
00149 void flyToAvatar();
00150 void teleportToAvatar();
00151
00152 static void updateSearchEnabled( LLUICtrl* ctrl, void* userdata );
00153 static void onLocationCommit( void* userdata );
00154 static void onCommitLocation( LLUICtrl* ctrl, void* userdata );
00155 static void onCommitSearchResult( LLUICtrl* ctrl, void* userdata );
00156
00157 void cacheLandmarkPosition();
00158
00159 protected:
00160 LLTabContainerCommon* mTabs;
00161
00162
00163 F32 mCurZoomVal;
00164 LLFrameTimer mZoomTimer;
00165
00166 LLDynamicArray<LLUUID> mLandmarkAssetIDList;
00167 LLDynamicArray<LLUUID> mLandmarkItemIDList;
00168 BOOL mHasLandmarkPosition;
00169
00170 static const LLUUID sHomeID;
00171
00172 LLInventoryModel* mInventory;
00173 LLInventoryObserver* mInventoryObserver;
00174 LLFriendObserver* mFriendObserver;
00175
00176 LLString mCompletingRegionName;
00177 LLString mLastRegionName;
00178 BOOL mWaitingForTracker;
00179 BOOL mExactMatch;
00180
00181 BOOL mIsClosing;
00182 BOOL mSetToUserPosition;
00183
00184 LLVector3d mTrackedLocation;
00185 LLTracker::ETrackingStatus mTrackedStatus;
00186 LLString mTrackedSimName;
00187 LLString mTrackedAvatarName;
00188 LLString mSLURL;
00189 };
00190
00191 extern LLFloaterWorldMap* gFloaterWorldMap;
00192
00193 #endif
00194