PageRenderTime 816ms CodeModel.GetById 570ms app.highlight 13ms RepoModel.GetById 229ms app.codeStats 0ms

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