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