1 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 2 // 3 // Copyright (c) 2004, Haiku 4 // 5 // This software is part of the Haiku distribution and is covered 6 // by the Haiku license. 7 // 8 // 9 // File: MouseSettings.h 10 // Authors: Jérôme Duval, 11 // Andrew McCall (mccall@digitalparadise.co.uk), 12 // Axel Dörfler (axeld@pinc-software.de) 13 // Description: Input Server 14 // Created: August 29, 2004 15 // 16 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 17 18 #ifndef MOUSE_SETTINGS_H_ 19 #define MOUSE_SETTINGS_H_ 20 21 #include <SupportDefs.h> 22 #include <InterfaceDefs.h> 23 #include <kb_mouse_settings.h> 24 25 26 class MouseSettings { 27 public: 28 MouseSettings(); 29 ~MouseSettings(); 30 31 void Defaults(); 32 void Dump(); 33 34 int32 MouseType() const { return fSettings.type; } 35 void SetMouseType(int32 type); 36 37 bigtime_t ClickSpeed() const; 38 void SetClickSpeed(bigtime_t click_speed); 39 40 int32 MouseSpeed() const { return fSettings.accel.speed; } 41 void SetMouseSpeed(int32 speed); 42 43 int32 AccelerationFactor() const { return fSettings.accel.accel_factor; } 44 void SetAccelerationFactor(int32 factor); 45 46 uint32 Mapping(int32 index) const; 47 void Mapping(mouse_map &map) const; 48 void SetMapping(int32 index, uint32 button); 49 void SetMapping(mouse_map &map); 50 51 mode_mouse MouseMode() const { return fMode; } 52 void SetMouseMode(mode_mouse mode); 53 54 status_t SaveSettings(); 55 56 private: 57 static status_t GetSettingsPath(BPath &path); 58 void RetrieveSettings(); 59 60 mouse_settings fSettings, fOriginalSettings; 61 mode_mouse fMode, fOriginalMode; 62 }; 63 64 #endif 65