X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fobject%2Fhandle.cpp;h=80da5589d75f0d1e36c40676eed732c6c70e8520;hb=72d3e464f0fdaaf6db6206873408e8d845f02cd4;hp=4c1b4829fece53138a6e4a364176ada0f6867a6c;hpb=de63578ce84d4c314d78ca6322721204e0029788;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/object/handle.cpp b/dali/public-api/object/handle.cpp index 4c1b482..80da558 100644 --- a/dali/public-api/object/handle.cpp +++ b/dali/public-api/object/handle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,33 +19,42 @@ #include // INTERNAL INCLUDES +#include #include #include +#include #include +#include #include namespace Dali { -Handle::Handle(Dali::Internal::Object* handle) - : BaseHandle(handle) +Handle::Handle( Dali::Internal::Object* handle ) +: BaseHandle(handle) { } + Handle::Handle() { } +Handle Handle::New() +{ + return Handle( Internal::CustomObject::New() ); +} + Handle::~Handle() { } -Handle::Handle(const Handle& handle) - : BaseHandle(handle) +Handle::Handle( const Handle& handle ) +: BaseHandle( handle ) { } -Handle& Handle::operator=(const Handle& rhs) +Handle& Handle::operator=( const Handle& rhs ) { if( this != &rhs ) { @@ -61,7 +70,7 @@ Handle Handle::DownCast( BaseHandle handle ) } -bool Handle::Supports(Capability capability) const +bool Handle::Supports( Capability capability ) const { return GetImplementation(*this).Supports( capability ); } @@ -71,52 +80,52 @@ unsigned int Handle::GetPropertyCount() const return GetImplementation(*this).GetPropertyCount(); } -std::string Handle::GetPropertyName(Property::Index index) const +std::string Handle::GetPropertyName( Property::Index index ) const { return GetImplementation(*this).GetPropertyName( index ); } -Property::Index Handle::GetPropertyIndex(std::string name) const +Property::Index Handle::GetPropertyIndex( const std::string& name ) const { return GetImplementation(*this).GetPropertyIndex( name ); } -bool Handle::IsPropertyWritable(Property::Index index) const +bool Handle::IsPropertyWritable( Property::Index index ) const { return GetImplementation(*this).IsPropertyWritable( index ); } -bool Handle::IsPropertyAnimatable(Property::Index index) const +bool Handle::IsPropertyAnimatable( Property::Index index ) const { return GetImplementation(*this).IsPropertyAnimatable( index ); } -bool Handle::IsPropertyAConstraintInput(Property::Index index) const +bool Handle::IsPropertyAConstraintInput( Property::Index index ) const { return GetImplementation(*this).IsPropertyAConstraintInput( index ); } -Property::Type Handle::GetPropertyType(Property::Index index) const +Property::Type Handle::GetPropertyType( Property::Index index ) const { return GetImplementation(*this).GetPropertyType( index ); } -void Handle::SetProperty(Property::Index index, Property::Value propertyValue) +void Handle::SetProperty( Property::Index index, const Property::Value& propertyValue ) { GetImplementation(*this).SetProperty( index, propertyValue ); } -Property::Index Handle::RegisterProperty(std::string name, Property::Value propertyValue) +Property::Index Handle::RegisterProperty( const std::string& name, const Property::Value& propertyValue ) { return GetImplementation(*this).RegisterProperty( name, propertyValue ); } -Property::Index Handle::RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode) +Property::Index Handle::RegisterProperty( const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode ) { return GetImplementation(*this).RegisterProperty( name, propertyValue, accessMode ); } -Property::Value Handle::GetProperty(Property::Index index) const +Property::Value Handle::GetProperty( Property::Index index ) const { return GetImplementation(*this).GetProperty( index ); } @@ -126,20 +135,20 @@ void Handle::GetPropertyIndices( Property::IndexContainer& indices ) const GetImplementation(*this).GetPropertyIndices( indices ); } -Dali::PropertyNotification Handle::AddPropertyNotification(Property::Index index, - const PropertyCondition& condition) +Dali::PropertyNotification Handle::AddPropertyNotification( Property::Index index, + const PropertyCondition& condition ) { return GetImplementation(*this).AddPropertyNotification( index, -1, condition ); } -Dali::PropertyNotification Handle::AddPropertyNotification(Property::Index index, - int componentIndex, - const PropertyCondition& condition) +Dali::PropertyNotification Handle::AddPropertyNotification( Property::Index index, + int componentIndex, + const PropertyCondition& condition ) { return GetImplementation(*this).AddPropertyNotification( index, componentIndex, condition ); } -void Handle::RemovePropertyNotification(Dali::PropertyNotification propertyNotification) +void Handle::RemovePropertyNotification( Dali::PropertyNotification propertyNotification ) { GetImplementation(*this).RemovePropertyNotification( propertyNotification ); } @@ -149,4 +158,30 @@ void Handle::RemovePropertyNotifications() GetImplementation(*this).RemovePropertyNotifications(); } +void Handle::RemoveConstraints() +{ + GetImplementation(*this).RemoveConstraints(); +} + +void Handle::RemoveConstraints( unsigned int tag ) +{ + GetImplementation(*this).RemoveConstraints( tag ); +} + +namespace WeightObject +{ + +const Property::Index WEIGHT = PROPERTY_CUSTOM_START_INDEX; + +Handle New() +{ + Handle handle = Handle::New(); + + handle.RegisterProperty( "weight", 0.0f ); + + return handle; +} + +} // namespace WeightObject + } // namespace Dali