repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / showimage / ShowImageSettings.h
blob68775d2d99785abce525dc52bce8fb7623fe451c
1 /*
2 * Copyright 2003-2011 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Michael Pfeiffer, laplace@haiku-os.org
7 */
8 #ifndef SHOW_IMAGE_SETTINGS_H
9 #define SHOW_IMAGE_SETTINGS_H
12 #include <Locker.h>
13 #include <Message.h>
16 class BFile;
19 class ShowImageSettings {
20 public:
21 ShowImageSettings();
22 virtual ~ShowImageSettings();
24 bool Lock();
25 void Unlock();
27 bool GetBool(const char* name, bool defaultValue);
28 int32 GetInt32(const char* name, int32 defaultValue);
29 float GetFloat(const char* name, float defaultValue);
30 BRect GetRect(const char* name, BRect defaultValue);
31 bigtime_t GetTime(const char* name,
32 bigtime_t defaultValue);
33 const char* GetString(const char* name,
34 const char* defaultValue);
36 void SetBool(const char* name, bool value);
37 void SetInt32(const char* name, int32 value);
38 void SetFloat(const char* name, float value);
39 void SetRect(const char* name, BRect value);
40 void SetTime(const char* name, bigtime_t value);
41 void SetString(const char* name, const char* value);
43 private:
44 bool _OpenSettingsFile(BFile* file, bool forReading);
45 void _Load();
46 void _Save();
48 private:
49 BLocker fLock;
50 BMessage fSettings;
51 bool fUpdated;
55 #endif // SHOW_IMAGE_SETTINGS_H