btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / apps / webpositive / support / SettingsMessage.h
blob8f227857888f5df66ad31ab42b80bb4b2e6472a1
1 /*
2 * Copyright 2008-2010 Stephan Aßmus <superstippi@gmx.de>.
3 * Copyright 1998 Eric Shepherd.
4 * All rights reserved. Distributed under the terms of the Be Sample Code
5 * license.
6 */
7 #ifndef SETTINGS_MESSAGE_H
8 #define SETTINGS_MESSAGE_H
11 #include <FindDirectory.h>
12 #include <Font.h>
13 #include <List.h>
14 #include <Locker.h>
15 #include <Message.h>
16 #include <Path.h>
18 class BMessenger;
19 class BString;
22 enum {
23 SETTINGS_VALUE_CHANGED = '_svc'
27 class SettingsMessage : public BMessage, public BLocker {
28 public:
29 SettingsMessage(directory_which directory,
30 const char* filename);
31 virtual ~SettingsMessage();
34 status_t InitCheck() const;
35 status_t Load();
36 status_t Save() const;
38 bool AddListener(const BMessenger& listener);
39 void RemoveListener(const BMessenger& listener);
41 status_t SetValue(const char* name, bool value);
42 status_t SetValue(const char* name, int8 value);
43 status_t SetValue(const char* name, int16 value);
44 status_t SetValue(const char* name, int32 value);
45 status_t SetValue(const char* name, uint32 value);
46 status_t SetValue(const char* name, int64 value);
47 status_t SetValue(const char* name, float value);
48 status_t SetValue(const char* name, double value);
49 status_t SetValue(const char* name,
50 const char* value);
51 status_t SetValue(const char* name,
52 const BString& value);
53 status_t SetValue(const char *name,
54 const BPoint& value);
55 status_t SetValue(const char* name, const BRect& value);
56 status_t SetValue(const char* name,
57 const entry_ref& value);
58 status_t SetValue(const char* name,
59 const BMessage& value);
60 status_t SetValue(const char* name,
61 const BFlattenable* value);
62 status_t SetValue(const char* name,
63 const BFont& value);
65 bool GetValue(const char* name,
66 bool defaultValue) const;
67 int8 GetValue(const char* name,
68 int8 defaultValue) const;
69 int16 GetValue(const char* name,
70 int16 defaultValue) const;
71 int32 GetValue(const char* name,
72 int32 defaultValue) const;
73 uint32 GetValue(const char* name,
74 uint32 defaultValue) const;
75 int64 GetValue(const char* name,
76 int64 defaultValue) const;
77 float GetValue(const char* name,
78 float defaultValue) const;
79 double GetValue(const char* name,
80 double defaultValue) const;
81 const char* GetValue(const char* name,
82 const char* defaultValue) const;
83 BString GetValue(const char* name,
84 const BString& defaultValue) const;
85 BPoint GetValue(const char *name,
86 BPoint defaultValue) const;
87 BRect GetValue(const char* name,
88 BRect defaultValue) const;
89 entry_ref GetValue(const char* name,
90 const entry_ref& defaultValue) const;
91 BMessage GetValue(const char* name,
92 const BMessage& defaultValue) const;
93 BFont GetValue(const char* name,
94 const BFont& defaultValue) const;
96 private:
97 void _NotifyValueChanged(const char* name) const;
99 private:
100 BPath fPath;
101 status_t fStatus;
102 BList fListeners;
105 #endif // SETTINGS_MESSAGE_H