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
35 typedef IntrusivePtr<PropertyBuffer> PropertyBufferPtr;
38 * PropertyBuffer is an object that contains an array of structures of values that
39 * can be accessed as properties.
41 class PropertyBuffer : public Object, public Connectable
46 * @copydoc PropertBuffer::New()
48 static PropertyBufferPtr New();
51 * @copydoc PropertBuffer::SetSize()
53 void SetSize( std::size_t size );
56 * @copydoc PropertBuffer::GetSize()
58 std::size_t GetSize() const;
61 * @copydoc PropertBuffer::SetData()
63 void SetData( void* data );
66 * @copydoc PropertBuffer::GetPropertyIndex()
68 Dali::Property::Index GetPropertyIndex( const std::string name, std::size_t index );
70 public: // Default property extensions from Object
73 * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
75 virtual unsigned int GetDefaultPropertyCount() const;
78 * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
80 virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
83 * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
85 virtual const char* GetDefaultPropertyName(Property::Index index) const;
88 * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
90 virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
93 * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
95 virtual bool IsDefaultPropertyWritable(Property::Index index) const;
98 * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
100 virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
103 * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
105 virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
108 * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
110 virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
113 * @copydoc Dali::Internal::Object::SetDefaultProperty()
115 virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
118 * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
120 virtual void SetSceneGraphProperty( Property::Index index, const CustomProperty& entry, const Property::Value& value );
123 * @copydoc Dali::Internal::Object::GetDefaultProperty()
125 virtual Property::Value GetDefaultProperty( Property::Index index ) const;
128 * @copydoc Dali::Internal::Object::GetPropertyOwner()
130 virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
133 * @copydoc Dali::Internal::Object::GetSceneObject()
135 virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
138 * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
140 virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
143 * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
145 virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
148 * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
150 virtual int GetPropertyComponentIndex( Property::Index index ) const;
152 public: // Functions from Connectable
154 * @copydoc Dali::Internal::Connectable::OnStage()
156 virtual bool OnStage() const;
159 * @copydoc Dali::Internal::Connectable::Connect()
161 virtual void Connect();
164 * @copydoc Dali::Internal::Connectable::Disconnect()
166 virtual void Disconnect();
168 private: // implementation
171 private: // unimplemented methods
172 PropertyBuffer( const PropertyBuffer& );
173 PropertyBuffer& operator=( const PropertyBuffer& );
177 } // namespace Internal
179 // Helpers for public-api forwarding methods
180 inline Internal::PropertyBuffer& GetImplementation(Dali::PropertyBuffer& handle)
182 DALI_ASSERT_ALWAYS(handle && "PropertyBuffer handle is empty");
184 BaseObject& object = handle.GetBaseObject();
186 return static_cast<Internal::PropertyBuffer&>(object);
189 inline const Internal::PropertyBuffer& GetImplementation(const Dali::PropertyBuffer& handle)
191 DALI_ASSERT_ALWAYS(handle && "PropertyBuffer handle is empty");
193 const BaseObject& object = handle.GetBaseObject();
195 return static_cast<const Internal::PropertyBuffer&>(object);
200 #endif // DALI_INTERNAL_PROPERTY_BUFFER_H