1//
2// TPreferences
3// Using BMessages to save user settings.
4//
5// Eric Shepherd
6//
7/*
8	Copyright 1999, Be Incorporated.   All Rights Reserved.
9	This file may be used under the terms of the Be Sample Code License.
10
11	Modified by H. Reh "SetData" added - Dec. 2001
12	                   "SetRef"  added - Dec. 2003
13*/
14
15#ifndef __TPREFS_H__
16#define __TPREFS_H__
17
18#include <Path.h>
19#include <Message.h>
20#include <Directory.h>
21
22class _EXPORT TPreferences : public BMessage
23{
24	public:
25									TPreferences(char *filename);
26									~TPreferences();
27
28
29			status_t		InitCheck(void);
30
31			status_t		SetBool(const char *name, bool b);
32			status_t		SetInt8(const char *name, int8 i);
33			status_t		SetInt16(const char *name, int16 i);
34			status_t		SetInt32(const char *name, int32 i);
35			status_t		SetInt64(const char *name, int64 i);
36			status_t		SetFloat(const char *name, float f);
37			status_t		SetDouble(const char *name, double d);
38			status_t		SetString(const char *name, const char *string);
39			status_t		SetPoint(const char *name, BPoint p);
40			status_t		SetRect(const char *name, BRect r);
41			status_t		SetMessage(const char *name, const BMessage *message);
42			status_t		SetFlat(const char *name, const BFlattenable *obj);
43			status_t		SetData(const char *name, type_code type, const void *data, ssize_t numBytes);
44			status_t		SetRef(const char *name, entry_ref *ref);
45
46	private:
47			BPath				path;
48			BPath				parent;
49			status_t		status;
50};
51
52inline status_t TPreferences::InitCheck(void)
53{
54	return status;
55}
56
57#endif
58