RemoteDrawingEngine: Reduce RP_READ_BITMAP result timeout.
[haiku.git] / src / preferences / virtualmemory / Settings.h
blob672bc6064349b580263ef4396d0e2b8772e1df8c
1 /*
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.
8 * Authors:
9 * Hamish Morrison, hamish@lavabit.com
10 * Alexander von Gluck, kallisti5@unixzen.com
12 #ifndef SETTINGS_H
13 #define SETTINGS_H
16 #include <stdio.h>
17 #include <stdlib.h>
19 #include <Point.h>
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;
27 class Settings {
28 public:
29 Settings();
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();
54 bool IsRevertable();
55 void RevertSwapSettings();
57 bool IsDefaultable();
58 void DefaultSwapSettings(bool revertable = true);
59 private:
60 struct SwapSettings {
61 bool enabled;
62 bool automatic;
63 off_t size;
64 dev_t volume;
67 BPoint fWindowPosition;
69 SwapSettings fCurrentSettings;
70 SwapSettings fInitialSettings;
71 SwapSettings fDefaultSettings;
74 #endif /* SETTINGS_H */