BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / apps / icon-o-matic / generic / property / PropertyObject.h
blob549148823cee1848e0824225ba2250f56e503c46
1 /*
2 * Copyright 2006, Haiku.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Stephan Aßmus <superstippi@gmx.de>
7 */
9 #ifndef PROPERTY_OBJECT_H
10 #define PROPERTY_OBJECT_H
12 #include "Observable.h"
14 class BMessage;
15 class BString;
16 class Property;
18 class PropertyObject : public Observable {
19 public:
20 PropertyObject();
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;
38 private:
39 status_t Assign(const PropertyObject& other);
41 public:
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,
49 const char* value);
50 bool GetValue(uint32 propertyID,
51 BString& value) const;
54 // access to more specific property types
55 bool SetValue(uint32 propertyID,
56 int32 value);
57 int32 Value(uint32 propertyID,
58 int32 defaultValue) const;
60 bool SetValue(uint32 propertyID,
61 int64 value);
62 int64 Value(uint32 propertyID,
63 int64 defaultValue) const;
65 bool SetValue(uint32 propertyID,
66 float value);
67 float Value(uint32 propertyID,
68 float defaultValue) const;
70 bool SetValue(uint32 propertyID,
71 bool value);
72 bool Value(uint32 propertyID,
73 bool defaultValue) const;
75 private:
76 BList fProperties;
79 #endif // PROPERTY_OBJECT_H