2 * Copyright 2006, Haiku.
3 * Distributed under the terms of the MIT License.
6 * Stephan Aßmus <superstippi@gmx.de>
9 #ifndef PROPERTY_OBJECT_H
10 #define PROPERTY_OBJECT_H
12 #include "Observable.h"
18 class PropertyObject
: public Observable
{
21 PropertyObject(const PropertyObject
& other
);
22 virtual ~PropertyObject();
24 status_t
Archive(BMessage
* into
) const;
25 status_t
Unarchive(const BMessage
* archive
);
27 bool AddProperty(Property
* property
);
29 Property
* PropertyAt(int32 index
) const;
30 Property
* PropertyAtFast(int32 index
) const;
31 int32
CountProperties() const;
33 Property
* FindProperty(uint32 propertyID
) const;
34 bool HasProperty(Property
* property
) const;
36 bool ContainsSameProperties(
37 const PropertyObject
& other
) const;
39 status_t
Assign(const PropertyObject
& other
);
42 void DeleteProperties();
43 bool DeleteProperty(uint32 propertyID
);
45 virtual void ValueChanged(uint32 propertyID
);
47 // common interface for any property
48 bool SetValue(uint32 propertyID
,
50 bool GetValue(uint32 propertyID
,
51 BString
& value
) const;
54 // access to more specific property types
55 bool SetValue(uint32 propertyID
,
57 int32
Value(uint32 propertyID
,
58 int32 defaultValue
) const;
60 bool SetValue(uint32 propertyID
,
62 int64
Value(uint32 propertyID
,
63 int64 defaultValue
) const;
65 bool SetValue(uint32 propertyID
,
67 float Value(uint32 propertyID
,
68 float defaultValue
) const;
70 bool SetValue(uint32 propertyID
,
72 bool Value(uint32 propertyID
,
73 bool defaultValue
) const;
79 #endif // PROPERTY_OBJECT_H