X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol.cpp;h=d9b2f8f1c5bf84f8b194aca58267d23cbe990d96;hp=6f75dfccaf7db866f313247158714bce29ebd9dc;hb=344c6952fcea2510e7492d3c1b07d11b61d50925;hpb=dc3613bb6248908c267a76e378b04962bce85664 diff --git a/dali-toolkit/public-api/controls/control.cpp b/dali-toolkit/public-api/controls/control.cpp index 6f75dfc..d9b2f8f 100644 --- a/dali-toolkit/public-api/controls/control.cpp +++ b/dali-toolkit/public-api/controls/control.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -15,8 +15,15 @@ * */ +// CLASS HEADER #include + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES #include +#include namespace Dali { @@ -33,8 +40,8 @@ Control::Control() { } -Control::Control(const Control& uiControl) -: CustomActor( uiControl ? static_cast< const Internal::Control& >( uiControl.GetImplementation() ).GetOwner() : NULL) +Control::Control( const Control& uiControl ) +: CustomActor( uiControl ) { } @@ -56,124 +63,97 @@ Control Control::DownCast( BaseHandle handle ) return DownCast< Control, Internal::Control >(handle); } -Internal::Control& Control::GetImplementation() -{ - return static_cast(CustomActor::GetImplementation()); -} - -const Internal::Control& Control::GetImplementation() const -{ - return static_cast(CustomActor::GetImplementation()); -} - -void Control::SetSizePolicy( SizePolicy widthPolicy, SizePolicy heightPolicy ) -{ - GetImplementation().SetSizePolicy( widthPolicy, heightPolicy ); -} - -void Control::GetSizePolicy( SizePolicy& widthPolicy, SizePolicy& heightPolicy ) const -{ - GetImplementation().GetSizePolicy( widthPolicy, heightPolicy ); -} - -void Control::SetMinimumSize( const Vector3& size ) -{ - GetImplementation().SetMinimumSize( size ); -} - -const Vector3& Control::GetMinimumSize() const +void Control::SetKeyInputFocus() { - return GetImplementation().GetMinimumSize(); + Internal::GetImplementation(*this).SetKeyInputFocus(); } -void Control::SetMaximumSize( const Vector3& size ) +bool Control::HasKeyInputFocus() { - GetImplementation().SetMaximumSize( size ); + return Internal::GetImplementation(*this).HasKeyInputFocus(); } -const Vector3& Control::GetMaximumSize() const +void Control::ClearKeyInputFocus() { - return GetImplementation().GetMaximumSize(); + Internal::GetImplementation(*this).ClearKeyInputFocus(); } -Vector3 Control::GetNaturalSize() +PinchGestureDetector Control::GetPinchGestureDetector() const { - return GetImplementation().GetNaturalSize(); + return Internal::GetImplementation(*this).GetPinchGestureDetector(); } -float Control::GetHeightForWidth( float width ) +PanGestureDetector Control::GetPanGestureDetector() const { - return GetImplementation().GetHeightForWidth( width ); + return Internal::GetImplementation(*this).GetPanGestureDetector(); } -float Control::GetWidthForHeight( float height ) +TapGestureDetector Control::GetTapGestureDetector() const { - return GetImplementation().GetWidthForHeight( height ); + return Internal::GetImplementation(*this).GetTapGestureDetector(); } -void Control::SetKeyInputFocus() +LongPressGestureDetector Control::GetLongPressGestureDetector() const { - GetImplementation().SetKeyInputFocus(); + return Internal::GetImplementation(*this).GetLongPressGestureDetector(); } -bool Control::HasKeyInputFocus() +void Control::SetStyleName( const std::string& styleName ) { - return GetImplementation().HasKeyInputFocus(); + Internal::GetImplementation(*this).SetStyleName( styleName ); } -void Control::ClearKeyInputFocus() +const std::string& Control::GetStyleName() const { - GetImplementation().ClearKeyInputFocus(); + return Internal::GetImplementation(*this).GetStyleName(); } -PinchGestureDetector Control::GetPinchGestureDetector() const +void Control::SetBackgroundColor( const Vector4& color ) { - return GetImplementation().GetPinchGestureDetector(); + Internal::GetImplementation(*this).SetBackgroundColor( color ); } -PanGestureDetector Control::GetPanGestureDetector() const +void Control::ClearBackground() { - return GetImplementation().GetPanGestureDetector(); + Internal::GetImplementation(*this).ClearBackground(); } -TapGestureDetector Control::GetTapGestureDetector() const +bool Control::IsResourceReady() const { - return GetImplementation().GetTapGestureDetector(); -} + const Internal::Control& internalControl = Toolkit::Internal::GetImplementation( *this ); + const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl ); -LongPressGestureDetector Control::GetLongPressGestureDetector() const -{ - return GetImplementation().GetLongPressGestureDetector(); + return controlDataImpl.IsResourceReady(); } -void Control::SetBackgroundColor( const Vector4& color ) +Toolkit::Visual::ResourceStatus Control::GetVisualResourceStatus( Dali::Property::Index index ) { - GetImplementation().SetBackgroundColor( color ); + const Internal::Control& internalControl = Toolkit::Internal::GetImplementation( *this ); + const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl ); + return controlDataImpl.GetVisualResourceStatus( index ); } -Vector4 Control::GetBackgroundColor() const +Control::KeyEventSignalType& Control::KeyEventSignal() { - return GetImplementation().GetBackgroundColor(); + return Internal::GetImplementation(*this).KeyEventSignal(); } -void Control::SetBackground( Image image ) +Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal() { - GetImplementation().SetBackground( image ); + return Internal::GetImplementation(*this).KeyInputFocusGainedSignal(); } -void Control::ClearBackground() +Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal() { - GetImplementation().ClearBackground(); + return Internal::GetImplementation(*this).KeyInputFocusLostSignal(); } -Actor Control::GetBackgroundActor() const +Control::ResourceReadySignalType& Control::ResourceReadySignal() { - return GetImplementation().GetBackgroundActor(); -} + Internal::Control& internalControl = Toolkit::Internal::GetImplementation( *this ); + Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( internalControl ); -Control::KeyEventSignalType& Control::KeyEventSignal() -{ - return GetImplementation().KeyEventSignal(); + return controlImpl.mResourceReadySignal; } Control::Control(Internal::Control& implementation)