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
7 #ifndef SETTINGS_MESSAGE_H
8 #define SETTINGS_MESSAGE_H
11 #include <FindDirectory.h>
23 SETTINGS_VALUE_CHANGED
= '_svc'
27 class SettingsMessage
: public BMessage
, public BLocker
{
29 SettingsMessage(directory_which directory
,
30 const char* filename
);
31 virtual ~SettingsMessage();
34 status_t
InitCheck() const;
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
,
51 status_t
SetValue(const char* name
,
52 const BString
& value
);
53 status_t
SetValue(const char *name
,
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
,
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;
97 void _NotifyValueChanged(const char* name
) const;
105 #endif // SETTINGS_MESSAGE_H