PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llwindow/llmousehandler.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 78 lines | 38 code | 12 blank | 28 comment | 0 complexity | c2d1276690b229b3a11fe80ae9774e33 MD5 | raw file
 1/** 
 2 * @file llmousehandler.h
 3 * @brief LLMouseHandler class definition
 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_MOUSEHANDLER_H
28#define LL_MOUSEHANDLER_H
29
30#include "linden_common.h"
31#include "llrect.h"
32
33// Mostly-abstract interface.
34// Intended for use via multiple inheritance. 
35// A class may have as many interfaces as it likes, but never needs to inherit one more than once.
36
37class LLMouseHandler
38{
39public:
40	LLMouseHandler() {}
41	virtual ~LLMouseHandler() {}
42
43	typedef enum {
44		SHOW_NEVER,
45		SHOW_IF_NOT_BLOCKED,
46		SHOW_ALWAYS,
47	} EShowToolTip;
48
49	typedef enum {
50		CLICK_LEFT,
51		CLICK_MIDDLE,
52		CLICK_RIGHT,
53		CLICK_DOUBLELEFT
54	} EClickType;
55
56	virtual BOOL	handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down);
57	virtual BOOL	handleMouseDown(S32 x, S32 y, MASK mask) = 0;
58	virtual BOOL	handleMouseUp(S32 x, S32 y, MASK mask) = 0;
59	virtual BOOL	handleMiddleMouseDown(S32 x, S32 y, MASK mask) = 0;
60	virtual BOOL	handleMiddleMouseUp(S32 x, S32 y, MASK mask) = 0;
61	virtual BOOL	handleRightMouseDown(S32 x, S32 y, MASK mask) = 0;
62	virtual BOOL	handleRightMouseUp(S32 x, S32 y, MASK mask) = 0;
63	virtual BOOL	handleDoubleClick(S32 x, S32 y, MASK mask) = 0;
64
65	virtual BOOL	handleHover(S32 x, S32 y, MASK mask) = 0;
66	virtual BOOL	handleScrollWheel(S32 x, S32 y, S32 clicks) = 0;
67	virtual BOOL	handleToolTip(S32 x, S32 y, MASK mask) = 0;
68	virtual const std::string& getName() const = 0;
69
70	virtual void	onMouseCaptureLost() = 0;
71
72	virtual void	screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const = 0;
73	virtual void	localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const = 0;
74
75	virtual BOOL hasMouseCapture() = 0;
76};
77
78#endif