PageRenderTime 28ms CodeModel.GetById 17ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/lltoolpie.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 123 lines | 80 code | 17 blank | 26 comment | 0 complexity | 986d9f656fbb95e090232a16da559c71 MD5 | raw file
  1/** 
  2 * @file lltoolpie.h
  3 * @brief LLToolPie class header file
  4 *
  5 * $LicenseInfo:firstyear=2001&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#ifndef LL_TOOLPIE_H
 28#define LL_TOOLPIE_H
 29
 30#include "lltool.h"
 31#include "lluuid.h"
 32#include "llviewerwindow.h" // for LLPickInfo
 33#include "llhudeffectblob.h" // for LLPointer<LLHudEffectBlob>, apparently
 34
 35class LLViewerObject;
 36class LLObjectSelection;
 37
 38class LLToolPie : public LLTool, public LLSingleton<LLToolPie>
 39{
 40	LOG_CLASS(LLToolPie);
 41public:
 42	LLToolPie( );
 43
 44	// Virtual functions inherited from LLMouseHandler
 45	virtual BOOL		handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down);
 46	virtual BOOL		handleMouseDown(S32 x, S32 y, MASK mask);
 47	virtual BOOL		handleRightMouseDown(S32 x, S32 y, MASK mask);
 48	virtual BOOL		handleMouseUp(S32 x, S32 y, MASK mask);
 49	virtual BOOL		handleRightMouseUp(S32 x, S32 y, MASK mask);
 50	virtual BOOL		handleHover(S32 x, S32 y, MASK mask);
 51	virtual BOOL		handleDoubleClick(S32 x, S32 y, MASK mask);
 52	virtual BOOL		handleScrollWheel(S32 x, S32 y, S32 clicks);
 53	virtual BOOL		handleToolTip(S32 x, S32 y, MASK mask);
 54
 55	virtual void		render();
 56
 57	virtual void		stopEditing();
 58
 59	virtual void		onMouseCaptureLost();
 60	virtual void		handleSelect();
 61	virtual void		handleDeselect();
 62	virtual LLTool*		getOverrideTool(MASK mask);
 63
 64	LLPickInfo&			getPick() { return mPick; }
 65	U8					getClickAction() { return mClickAction; }
 66	LLViewerObject*		getClickActionObject() { return mClickActionObject; }
 67	LLObjectSelection*	getLeftClickSelection() { return (LLObjectSelection*)mLeftClickSelection; }
 68	void 				resetSelection();
 69	void				walkToClickedLocation();
 70	void				blockClickToWalk() { mBlockClickToWalk = true; }
 71	void				stopClickToWalk();
 72	
 73	static void			selectionPropertiesReceived();
 74
 75	static void			showAvatarInspector(const LLUUID& avatar_id);
 76	static void			showObjectInspector(const LLUUID& object_id);
 77	static void			showObjectInspector(const LLUUID& object_id, const S32& object_face);
 78	static void			playCurrentMedia(const LLPickInfo& info);
 79	static void			VisitHomePage(const LLPickInfo& info);
 80	
 81private:
 82	BOOL outsideSlop		(S32 x, S32 y, S32 start_x, S32 start_y);
 83	BOOL handleLeftClickPick();
 84	BOOL handleRightClickPick();
 85	BOOL useClickAction		(MASK mask, LLViewerObject* object,LLViewerObject* parent);
 86	
 87	void showVisualContextMenuEffect();
 88	ECursorType cursorFromObject(LLViewerObject* object);
 89
 90	bool handleMediaClick(const LLPickInfo& info);
 91	bool handleMediaHover(const LLPickInfo& info);
 92	bool handleMediaMouseUp(); 
 93	BOOL handleTooltipLand(std::string line, std::string tooltip_msg);
 94	BOOL handleTooltipObject( LLViewerObject* hover_object, std::string line, std::string tooltip_msg);
 95
 96	void steerCameraWithMouse(S32 x, S32 y);
 97	void startCameraSteering();
 98	void stopCameraSteering();
 99	bool inCameraSteerMode();
100
101private:
102	bool				mMouseButtonDown;
103	bool				mMouseOutsideSlop;		// for this drag, has mouse moved outside slop region
104	S32					mMouseDownX;
105	S32					mMouseDownY;
106	S32					mMouseSteerX;
107	S32					mMouseSteerY;
108	LLPointer<LLHUDEffectBlob>	mAutoPilotDestination;
109	LLPointer<LLHUDEffectBlob>	mMouseSteerGrabPoint;
110	bool				mClockwise;			
111	bool				mBlockClickToWalk;
112	LLUUID				mMediaMouseCaptureID;
113	LLPickInfo			mPick;
114	LLPickInfo			mHoverPick;
115	LLPickInfo			mSteerPick;
116	LLPointer<LLViewerObject> mClickActionObject;
117	U8					mClickAction;
118	LLSafeHandle<LLObjectSelection> mLeftClickSelection;
119	BOOL				mClickActionBuyEnabled;
120	BOOL				mClickActionPayEnabled;
121};
122
123#endif