2 * Copyright 2005, Axel Dörfler, axeld@pinc-software.de
3 * All rights reserved. Distributed under the terms of the MIT License.
5 * Copyright 2010-2012 Haiku, Inc. All rights reserved.
6 * Distributed under the terms of the MIT License.
9 * Hamish Morrison, hamish@lavabit.com
10 * Alexander von Gluck, kallisti5@unixzen.com
22 static const int32 kErrorSettingsNotFound
= B_ERRORS_END
+ 1;
23 static const int32 kErrorSettingsInvalid
= B_ERRORS_END
+ 2;
24 static const int32 kErrorVolumeNotFound
= B_ERRORS_END
+ 3;
31 bool SwapEnabled() const
32 { return fCurrentSettings
.enabled
; }
33 bool SwapAutomatic() const
34 { return fCurrentSettings
.automatic
; }
35 off_t
SwapSize() const { return fCurrentSettings
.size
; }
36 dev_t
SwapVolume() { return fCurrentSettings
.volume
; }
37 BPoint
WindowPosition() const { return fWindowPosition
; }
40 void SetSwapEnabled(bool enabled
,
41 bool revertable
= true);
42 void SetSwapAutomatic(bool automatic
,
43 bool revertable
= true);
44 void SetSwapSize(off_t size
, bool revertable
= true);
45 void SetSwapVolume(dev_t volume
,
46 bool revertable
= true);
47 void SetWindowPosition(BPoint position
);
49 status_t
ReadWindowSettings();
50 status_t
WriteWindowSettings();
51 status_t
ReadSwapSettings();
52 status_t
WriteSwapSettings();
55 void RevertSwapSettings();
58 void DefaultSwapSettings(bool revertable
= true);
67 BPoint fWindowPosition
;
69 SwapSettings fCurrentSettings
;
70 SwapSettings fInitialSettings
;
71 SwapSettings fDefaultSettings
;
74 #endif /* SETTINGS_H */