1 #ifndef __DALI_INTERNAL_OBJECT_H__
2 #define __DALI_INTERNAL_OBJECT_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.0 (the License);
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://floralicense.org/license/
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an AS IS BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
21 #include <dali/public-api/object/base-object.h>
22 #include <dali/public-api/object/handle.h>
23 #include <dali/public-api/object/property.h>
28 class PropertyNotification;
34 class PropertyCondition;
37 * A base class for objects which optionally provide properties.
38 * The concrete derived class is responsible for implementing the property system methods.
39 * Classes may derive from Dali::BaseObject, until any properties are required.
41 class Object : public Dali::BaseObject
45 typedef Dali::Handle::Capability Capability;
48 * @copydoc Dali::Handle::Supports()
50 virtual bool Supports(Capability capability) const = 0;
53 * @copydoc Dali::Handle::GetPropertyCount()
55 virtual unsigned int GetPropertyCount() const = 0;
58 * @copydoc Dali::Handle::GetPropertyName()
60 virtual const std::string& GetPropertyName(Property::Index index) const = 0;
63 * @copydoc Dali::Handle::GetPropertyIndex()
65 virtual Property::Index GetPropertyIndex(const std::string& name) const = 0;
68 * @copydoc Dali::Handle::IsPropertyWritable()
70 virtual bool IsPropertyWritable(Property::Index index) const = 0;
73 * @copydoc Dali::Handle::IsPropertyAnimatable()
75 virtual bool IsPropertyAnimatable(Property::Index index) const = 0;
78 * @copydoc Dali::Handle::IsPropertyAConstraintInput()
80 virtual bool IsPropertyAConstraintInput(Property::Index index) const = 0;
83 * @copydoc Dali::Handle::GetPropertyType()
85 virtual Property::Type GetPropertyType(Property::Index index) const = 0;
88 * @copydoc Dali::Handle::SetProperty()
90 virtual void SetProperty(Property::Index index, const Property::Value& propertyValue) = 0;
93 * @copydoc Dali::Handle::GetProperty()
95 virtual Property::Value GetProperty(Property::Index index) const = 0;
98 * @copydoc Dali::Handle::GetPropertyIndices()
100 virtual void GetPropertyIndices( Property::IndexContainer& indices ) const = 0;
103 * @copydoc Dali::Handle::RegisterProperty()
105 virtual Property::Index RegisterProperty(std::string name, const Property::Value& propertyValue) = 0;
108 * @copydoc Dali::Handle::RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode)
110 virtual Property::Index RegisterProperty(std::string name, const Property::Value& propertyValue, Property::AccessMode accessMode) = 0;
113 * @copydoc Dali::Handle::AddPropertyNotification()
115 virtual Dali::PropertyNotification AddPropertyNotification(Property::Index index,
117 const Dali::PropertyCondition& condition) = 0;
120 * @copydoc Dali::Handle::RemovePropertyNotification()
122 virtual void RemovePropertyNotification(Dali::PropertyNotification propertyNotification) = 0;
125 * @copydoc Dali::Handle::RemovePropertyNotifications()
127 virtual void RemovePropertyNotifications() = 0;
133 * Default constructor.
140 * A reference counted object may only be deleted by calling Unreference()
149 Object(const Object& rhs);
152 Object& operator=(const Object& rhs);
155 } // namespace Internal
157 // Helpers for public-api forwarding methods
159 inline Internal::Object& GetImplementation(Dali::Handle& object)
161 DALI_ASSERT_ALWAYS( object && "Object handle is empty" );
163 BaseObject& handle = object.GetBaseObject();
165 return static_cast<Internal::Object&>(handle);
168 inline const Internal::Object& GetImplementation(const Dali::Handle& object)
170 DALI_ASSERT_ALWAYS( object && "Object handle is empty" );
172 const BaseObject& handle = object.GetBaseObject();
174 return static_cast<const Internal::Object&>(handle);
179 #endif // __DALI_INTERNAL_OBJECT_H__