xref: /haiku/src/preferences/virtualmemory/Settings.h (revision 1e36cfc2721ef13a187c6f7354dc9cbc485e89d3)
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 SetSwapDefaults();
29 		void RevertSwapChanges();
30 		bool SwapChanged();
31 
32 	private:
33 		void ReadWindowSettings();
34 		void WriteWindowSettings();
35 
36 		void ReadSwapSettings();
37 		void WriteSwapSettings();
38 
39 		BPoint		fWindowPosition;
40 
41 		bool		fSwapEnabled;
42 		off_t		fSwapSize;
43 		BVolume		fSwapVolume;
44 
45 		bool		fInitialSwapEnabled;
46 		off_t		fInitialSwapSize;
47 		dev_t		fInitialSwapVolume;
48 
49 		bool		fPositionUpdated, fSwapUpdated;
50 };
51 
52 #endif	/* SETTINGS_H */
53