1/*
2 * Copyright 2008-2009, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Clemens Zeidler (haiku@Clemens-Zeidler.de)
7 */
8#ifndef TOUCHPAD_PREF_H
9#define TOUCHPAD_PREF_H
10
11
12#define DEBUG 1
13#include <Debug.h>
14
15#include "touchpad_settings.h"
16#include <Input.h>
17#include <Path.h>
18
19#if DEBUG
20#	define LOG(text...) PRINT((text))
21#else
22#	define LOG(text...)
23#endif
24
25
26class TouchpadPref {
27public:
28								TouchpadPref();
29								~TouchpadPref();
30
31			void				Revert();
32			void				Defaults();
33
34			BPoint 				WindowPosition()
35									{ return fWindowPosition; }
36			void				SetWindowPosition(BPoint position)
37									{ fWindowPosition = position; }
38
39			touchpad_settings&	Settings()
40									{ return fSettings; }
41
42			status_t			UpdateSettings();
43
44private:
45			status_t			GetSettingsPath(BPath& path);
46			status_t			LoadSettings();
47			status_t			SaveSettings();
48
49			status_t			ConnectToTouchPad();
50
51			bool 				fConnected;
52			BInputDevice* 		fTouchPad;
53
54			touchpad_settings	fSettings;
55			touchpad_settings	fStartSettings;
56			BPoint				fWindowPosition;
57};
58
59
60#endif	// TOUCHPAD_PREF_H
61