1 /* 2 * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef SETTINGS_H 6 #define SETTINGS_H 7 8 9 #include <Point.h> 10 #include <Volume.h> 11 12 13 class Settings { 14 public : 15 Settings(); 16 virtual ~Settings(); 17 18 BPoint WindowPosition() const { return fWindowPosition; } 19 void SetWindowPosition(BPoint position); 20 21 bool SwapEnabled() const { return fSwapEnabled; } 22 off_t SwapSize() const { return fSwapSize; } 23 BVolume& SwapVolume() { return fSwapVolume; } 24 void SetSwapEnabled(bool enabled); 25 void SetSwapSize(off_t size); 26 void SetSwapVolume(BVolume& volume); 27 28 void RevertSwapChanges(); 29 bool IsRevertible(); 30 31 private: 32 void _ReadWindowSettings(); 33 void _WriteWindowSettings(); 34 35 void _ReadSwapSettings(); 36 void _WriteSwapSettings(); 37 38 void _SetSwapNull(); 39 40 BPoint fWindowPosition; 41 42 bool fSwapEnabled; 43 off_t fSwapSize; 44 BVolume fSwapVolume; 45 46 bool fInitialSwapEnabled; 47 off_t fInitialSwapSize; 48 dev_t fInitialSwapVolume; 49 50 bool fPositionUpdated; 51 const char* fBadVolName; 52 }; 53 54 #endif /* SETTINGS_H */ 55