6 (c) 2000, Georges-Edouard Berenger, All Rights Reserved.
7 Copyright (C) 2004 beunited.org
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 class Preferences
: public BMessage
, public BLocker
{
34 Preferences(const char* thename
, const char* thesignature
= NULL
, bool doSave
= true);
35 Preferences(const entry_ref
& ref
, const char* thesignature
= NULL
, bool doSave
= true);
38 void SaveWindowPosition(BWindow
* window
, const char* name
);
39 void LoadWindowPosition(BWindow
* window
, const char* name
);
40 void SaveWindowFrame(BWindow
* window
, const char* name
);
41 void LoadWindowFrame(BWindow
* window
, const char* name
);
42 void SaveInt32(int32 val
, const char* name
);
43 bool ReadInt32(int32
& val
, const char* name
);
44 void SaveFloat(float val
, const char* name
);
45 bool ReadFloat(float& val
, const char* name
);
46 void SaveRect(BRect
& rect
, const char* name
);
47 BRect
& ReadRect(BRect
& rect
, const char* name
);
48 void SaveString(BString
& string
, const char* name
);
49 void SaveString(const char* string
, const char* name
);
50 bool ReadString(BString
& string
, const char* name
);
54 bool fSavePreferences
;
57 entry_ref
* fSettingsFile
;
60 extern Preferences gPreferences
;
62 // ggPreferences.LoadWindowPosition(this, kPosPrefName);
63 // ggPreferences.SaveWindowPosition(this, kPosPrefName);
65 // ggPreferences.LoadWindowFrame(this, frame);
66 // ggPreferences.SaveWindowFrame(this, frame);
68 #endif // PREFERENCES_H