xref: /haiku/src/servers/app/decorator/WindowBehaviour.h (revision 19ae20e67e91fc09cc9fc5c0e60e21e24e7a53eb)
1*f4f30311SClemens Zeidler /*
2*f4f30311SClemens Zeidler  * Copyright 2010, Haiku, Inc.
3*f4f30311SClemens Zeidler  * Distributed under the terms of the MIT license.
4*f4f30311SClemens Zeidler  *
5*f4f30311SClemens Zeidler  * Authors:
6*f4f30311SClemens Zeidler  *		Clemens Zeidler <haiku@clemens-zeidler.de>
7*f4f30311SClemens Zeidler  */
8*f4f30311SClemens Zeidler #ifndef WINDOW_BEHAVIOUR_H
9*f4f30311SClemens Zeidler #define WINDOW_BEHAVIOUR_H
10*f4f30311SClemens Zeidler 
11*f4f30311SClemens Zeidler 
12*f4f30311SClemens Zeidler #include <Region.h>
13*f4f30311SClemens Zeidler 
14*f4f30311SClemens Zeidler #include "Decorator.h"
15*f4f30311SClemens Zeidler 
16*f4f30311SClemens Zeidler 
17*f4f30311SClemens Zeidler class BMessage;
18*f4f30311SClemens Zeidler class ClickTarget;
19*f4f30311SClemens Zeidler class Window;
20*f4f30311SClemens Zeidler 
21*f4f30311SClemens Zeidler 
22*f4f30311SClemens Zeidler class WindowBehaviour {
23*f4f30311SClemens Zeidler public:
24*f4f30311SClemens Zeidler 								WindowBehaviour();
25*f4f30311SClemens Zeidler 	virtual						~WindowBehaviour();
26*f4f30311SClemens Zeidler 
27*f4f30311SClemens Zeidler 	virtual	bool				MouseDown(BMessage* message, BPoint where,
28*f4f30311SClemens Zeidler 									int32 lastHitRegion, int32& clickCount,
29*f4f30311SClemens Zeidler 									int32& _hitRegion) = 0;
30*f4f30311SClemens Zeidler 	virtual	void				MouseUp(BMessage* message, BPoint where) = 0;
31*f4f30311SClemens Zeidler 	virtual	void				MouseMoved(BMessage *message, BPoint where,
32*f4f30311SClemens Zeidler 									bool isFake) = 0;
33*f4f30311SClemens Zeidler 
34*f4f30311SClemens Zeidler 	virtual	void				ModifiersChanged(int32 modifiers);
35*f4f30311SClemens Zeidler 
IsDragging()36*f4f30311SClemens Zeidler 			bool				IsDragging() const { return fIsDragging; }
IsResizing()37*f4f30311SClemens Zeidler 			bool				IsResizing() const { return fIsResizing; }
38*f4f30311SClemens Zeidler 
39*f4f30311SClemens Zeidler protected:
40*f4f30311SClemens Zeidler 	/*! The window is going to be moved by delta. This hook should be used to
41*f4f30311SClemens Zeidler 	implement the magnetic screen border, i.e. alter the delta accordantly.
42*f4f30311SClemens Zeidler 	\return true if delta has been modified. */
43*f4f30311SClemens Zeidler 	virtual bool				AlterDeltaForSnap(Window* window, BPoint& delta,
44*f4f30311SClemens Zeidler 									bigtime_t now);
45*f4f30311SClemens Zeidler 
46*f4f30311SClemens Zeidler protected:
47*f4f30311SClemens Zeidler 			bool				fIsResizing : 1;
48*f4f30311SClemens Zeidler 			bool				fIsDragging : 1;
49*f4f30311SClemens Zeidler };
50*f4f30311SClemens Zeidler 
51*f4f30311SClemens Zeidler 
52*f4f30311SClemens Zeidler #endif
53