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 );
75 * @brief Get the propertyBuffer scene object
77 * @return the propertyBuffer scene object
79 const SceneGraph::PropertyBuffer* GetPropertyBufferSceneObject() const;
81 public: // Default property extensions from Object
84 * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
86 virtual unsigned int GetDefaultPropertyCount() const;
89 * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
91 virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
94 * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
96 virtual const char* GetDefaultPropertyName(Property::Index index) const;
99 * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
101 virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
104 * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
106 virtual bool IsDefaultPropertyWritable(Property::Index index) const;
109 * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
111 virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
114 * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
116 virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
119 * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
121 virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
124 * @copydoc Dali::Internal::Object::SetDefaultProperty()
126 virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
129 * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
131 virtual void SetSceneGraphProperty( Property::Index index, const CustomProperty& entry, const Property::Value& value );
134 * @copydoc Dali::Internal::Object::GetDefaultProperty()
136 virtual Property::Value GetDefaultProperty( Property::Index index ) const;
139 * @copydoc Dali::Internal::Object::GetPropertyOwner()
141 virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
144 * @copydoc Dali::Internal::Object::GetSceneObject()
146 virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
149 * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
151 virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
154 * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
156 virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
159 * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
161 virtual int GetPropertyComponentIndex( Property::Index index ) const;
163 public: // Functions from Connectable
165 * @copydoc Dali::Internal::Connectable::OnStage()
167 virtual bool OnStage() const;
170 * @copydoc Dali::Internal::Connectable::Connect()
172 virtual void Connect();
175 * @copydoc Dali::Internal::Connectable::Disconnect()
177 virtual void Disconnect();
179 private: // implementation
182 private: // unimplemented methods
183 PropertyBuffer( const PropertyBuffer& );
184 PropertyBuffer& operator=( const PropertyBuffer& );
187 SceneGraph::PropertyBuffer* mSceneObject;
191 } // namespace Internal
193 // Helpers for public-api forwarding methods
194 inline Internal::PropertyBuffer& GetImplementation(Dali::PropertyBuffer& handle)
196 DALI_ASSERT_ALWAYS(handle && "PropertyBuffer handle is empty");
198 BaseObject& object = handle.GetBaseObject();
200 return static_cast<Internal::PropertyBuffer&>(object);
203 inline const Internal::PropertyBuffer& GetImplementation(const Dali::PropertyBuffer& handle)
205 DALI_ASSERT_ALWAYS(handle && "PropertyBuffer handle is empty");
207 const BaseObject& object = handle.GetBaseObject();
209 return static_cast<const Internal::PropertyBuffer&>(object);
214 #endif // DALI_INTERNAL_PROPERTY_BUFFER_H