1/*
2 * Copyright 2003-2006, Haiku.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Michael Phipps
7 *		Axel Dörfler, axeld@pinc-software.de
8 */
9#ifndef SCREEN_CORNER_SELECTOR_H
10#define SCREEN_CORNER_SELECTOR_H
11
12
13#include "ScreenSaverSettings.h"
14
15#include <Control.h>
16
17
18class ScreenCornerSelector : public BControl {
19	public:
20		ScreenCornerSelector(BRect frame, const char *name, BMessage* message,
21			uint32 resizingMode);
22
23		virtual void Draw(BRect update);
24		virtual void MouseDown(BPoint point);
25		virtual void MouseUp(BPoint point);
26		virtual void MouseMoved(BPoint where, uint32 transit, const BMessage* dragMessage);
27		virtual void KeyDown(const char* bytes, int32 numBytes);
28
29		virtual void SetValue(int32 value);
30		virtual int32 Value();
31
32		void SetCorner(screen_corner corner);
33		screen_corner Corner() const;
34
35	private:
36		BRect _MonitorFrame() const;
37		BRect _InnerFrame(BRect monitorFrame) const;
38		BRect _CenterFrame(BRect innerFrame) const;
39		void _DrawStop(BRect innerFrame);
40		void _DrawArrow(BRect innerFrame);
41		screen_corner _ScreenCorner(BPoint point, screen_corner previous) const;
42
43		screen_corner fCurrentCorner;
44		int32 fPreviousCorner;
45};
46
47#endif	// SCREEN_CORNER_SELECTOR_H
48