xref: /haiku/src/preferences/virtualmemory/Settings.h (revision 16d5c24e533eb14b7b8a99ee9f3ec9ba66335b1e)
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 IsDefaultable();
31 		bool SwapChanged();
32 
33 	private:
34 		void ReadWindowSettings();
35 		void WriteWindowSettings();
36 
37 		void ReadSwapSettings();
38 		void WriteSwapSettings();
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, fSwapUpdated;
51 };
52 
53 #endif	/* SETTINGS_H */
54