1 #ifndef DALI_INTERNAL_PROPERTY_BUFFER_H
2 #define DALI_INTERNAL_PROPERTY_BUFFER_H
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/common/dali-common.h> // DALI_ASSERT_ALWAYS
23 #include <dali/public-api/common/intrusive-ptr.h> // Dali::IntrusivePtr
24 #include <dali/public-api/object/property-buffer.h> // Dali::PropertyBuffer
25 #include <dali/internal/event/common/connectable.h> // Dali::Internal::Connectable
26 #include <dali/internal/event/common/object-connector.h> // Dali::Internal::ObjectConnector
27 #include <dali/internal/event/common/object-impl.h> // Dali::Internal::Object
39 typedef IntrusivePtr<PropertyBuffer> PropertyBufferPtr;
42 * PropertyBuffer is an object that contains an array of structures of values that
43 * can be accessed as properties.
45 class PropertyBuffer : public Object, public Connectable
50 * @copydoc PropertBuffer::New()
52 static PropertyBufferPtr New();
55 * @copydoc PropertBuffer::SetSize()
57 void SetSize( std::size_t size );
60 * @copydoc PropertBuffer::GetSize()
62 std::size_t GetSize() const;
65 * @copydoc PropertBuffer::SetData()
67 void SetData( void* data );
70 * @copydoc PropertBuffer::GetPropertyIndex()
72 Dali::Property::Index GetPropertyIndex( const std::string name, std::size_t index );
74 public: // Default property extensions from Object
77 * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
79 virtual unsigned int GetDefaultPropertyCount() const;
82 * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
84 virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
87 * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
89 virtual const char* GetDefaultPropertyName(Property::Index index) const;
92 * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
94 virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
97 * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
99 virtual bool IsDefaultPropertyWritable(Property::Index index) const;
102 * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
104 virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
107 * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
109 virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
112 * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
114 virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
117 * @copydoc Dali::Internal::Object::SetDefaultProperty()
119 virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
122 * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
124 virtual void SetSceneGraphProperty( Property::Index index, const CustomProperty& entry, const Property::Value& value );
127 * @copydoc Dali::Internal::Object::GetDefaultProperty()
129 virtual Property::Value GetDefaultProperty( Property::Index index ) const;
132 * @copydoc Dali::Internal::Object::GetPropertyOwner()
134 virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
137 * @copydoc Dali::Internal::Object::GetSceneObject()
139 virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
142 * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
144 virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
147 * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
149 virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
152 * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
154 virtual int GetPropertyComponentIndex( Property::Index index ) const;
156 public: // Functions from Connectable
158 * @copydoc Dali::Internal::Connectable::OnStage()
160 virtual bool OnStage() const;
163 * @copydoc Dali::Internal::Connectable::Connect()
165 virtual void Connect();
168 * @copydoc Dali::Internal::Connectable::Disconnect()
170 virtual void Disconnect();
172 private: // implementation
175 private: // unimplemented methods
176 PropertyBuffer( const PropertyBuffer& );
177 PropertyBuffer& operator=( const PropertyBuffer& );
180 SceneGraph::PropertyBuffer* mSceneObject;
184 } // namespace Internal
186 // Helpers for public-api forwarding methods
187 inline Internal::PropertyBuffer& GetImplementation(Dali::PropertyBuffer& handle)
189 DALI_ASSERT_ALWAYS(handle && "PropertyBuffer handle is empty");
191 BaseObject& object = handle.GetBaseObject();
193 return static_cast<Internal::PropertyBuffer&>(object);
196 inline const Internal::PropertyBuffer& GetImplementation(const Dali::PropertyBuffer& handle)
198 DALI_ASSERT_ALWAYS(handle && "PropertyBuffer handle is empty");
200 const BaseObject& object = handle.GetBaseObject();
202 return static_cast<const Internal::PropertyBuffer&>(object);
207 #endif // DALI_INTERNAL_PROPERTY_BUFFER_H