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 Property::Type Handle::GetPropertyType(Property::Index index) const
95 return GetImplementation(*this).GetPropertyType( index );
98 void Handle::SetProperty(Property::Index index, Property::Value propertyValue)
100 GetImplementation(*this).SetProperty( index, propertyValue );
103 Property::Index Handle::RegisterProperty(std::string name, Property::Value propertyValue)
105 return GetImplementation(*this).RegisterProperty( name, propertyValue );
108 Property::Index Handle::RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode)
110 return GetImplementation(*this).RegisterProperty( name, propertyValue, accessMode );
113 Property::Value Handle::GetProperty(Property::Index index) const
115 return GetImplementation(*this).GetProperty( index );
118 Dali::PropertyNotification Handle::AddPropertyNotification(Property::Index index,
119 const PropertyCondition& condition)
121 return GetImplementation(*this).AddPropertyNotification( index, -1, condition );
124 Dali::PropertyNotification Handle::AddPropertyNotification(Property::Index index,
126 const PropertyCondition& condition)
128 return GetImplementation(*this).AddPropertyNotification( index, componentIndex, condition );
131 void Handle::RemovePropertyNotification(Dali::PropertyNotification propertyNotification)
133 GetImplementation(*this).RemovePropertyNotification( propertyNotification );
136 void Handle::RemovePropertyNotifications()
138 GetImplementation(*this).RemovePropertyNotifications();