2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 #include <dali/public-api/object/handle.h>
21 #include <dali/public-api/object/property-conditions.h>
22 #include <dali/public-api/object/property-notification.h>
23 #include <dali/internal/event/common/object-impl.h>
24 #include <dali/integration-api/debug.h>
29 Handle::Handle(Dali::Internal::Object* handle)
42 Handle::Handle(const Handle& handle)
47 Handle& Handle::operator=(const Handle& rhs)
51 BaseHandle::operator=(rhs);
57 Handle Handle::DownCast( BaseHandle handle )
59 return Handle( dynamic_cast<Dali::Internal::Object*>(handle.GetObjectPtr()) );
63 bool Handle::Supports(Capability capability) const
65 return GetImplementation(*this).Supports( capability );
68 unsigned int Handle::GetPropertyCount() const
70 return GetImplementation(*this).GetPropertyCount();
73 const std::string& Handle::GetPropertyName(Property::Index index) const
75 return GetImplementation(*this).GetPropertyName( index );
78 Property::Index Handle::GetPropertyIndex(std::string name) const
80 return GetImplementation(*this).GetPropertyIndex( name );
83 bool Handle::IsPropertyWritable(Property::Index index) const
85 return GetImplementation(*this).IsPropertyWritable( index );
88 bool Handle::IsPropertyAnimatable(Property::Index index) const
90 return GetImplementation(*this).IsPropertyAnimatable( index );
93 bool Handle::IsPropertyAConstraintInput(Property::Index index) const
95 return GetImplementation(*this).IsPropertyAConstraintInput( index );
98 Property::Type Handle::GetPropertyType(Property::Index index) const
100 return GetImplementation(*this).GetPropertyType( index );
103 void Handle::SetProperty(Property::Index index, Property::Value propertyValue)
105 GetImplementation(*this).SetProperty( index, propertyValue );
108 Property::Index Handle::RegisterProperty(std::string name, Property::Value propertyValue)
110 return GetImplementation(*this).RegisterProperty( name, propertyValue );
113 Property::Index Handle::RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode)
115 return GetImplementation(*this).RegisterProperty( name, propertyValue, accessMode );
118 Property::Value Handle::GetProperty(Property::Index index) const
120 return GetImplementation(*this).GetProperty( index );
123 void Handle::GetPropertyIndices( Property::IndexContainer& indices ) const
125 GetImplementation(*this).GetPropertyIndices( indices );
128 Dali::PropertyNotification Handle::AddPropertyNotification(Property::Index index,
129 const PropertyCondition& condition)
131 return GetImplementation(*this).AddPropertyNotification( index, -1, condition );
134 Dali::PropertyNotification Handle::AddPropertyNotification(Property::Index index,
136 const PropertyCondition& condition)
138 return GetImplementation(*this).AddPropertyNotification( index, componentIndex, condition );
141 void Handle::RemovePropertyNotification(Dali::PropertyNotification propertyNotification)
143 GetImplementation(*this).RemovePropertyNotification( propertyNotification );
146 void Handle::RemovePropertyNotifications()
148 GetImplementation(*this).RemovePropertyNotifications();