X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol.cpp;h=ec37028d164bbe3af0bf39e6aa984667ae414a75;hb=f25156f6460c7b288797ed40aaeca1ae6fc827dd;hp=255589a98fd82d945f4364ab8b1d794e32bfaa35;hpb=0c3c919519ffe6b2872c1dcf76f7c4c84c0f1cee;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/public-api/controls/control.cpp b/dali-toolkit/public-api/controls/control.cpp index 255589a..ec37028 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) 2020 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. @@ -18,15 +18,17 @@ // CLASS HEADER #include +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES +#include #include namespace Dali { - namespace Toolkit { - Control Control::New() { return Internal::Control::New(); @@ -36,147 +38,114 @@ Control::Control() { } -Control::Control(const Control& uiControl) -: CustomActor( uiControl ? static_cast< const Internal::Control& >( uiControl.GetImplementation() ).GetOwner() : NULL) -{ -} - -Control::~Control() -{ -} - -Control& Control::operator=( const Control& handle ) -{ - if( &handle != this ) - { - CustomActor::operator=( handle ); - } - return *this; -} - -Control Control::DownCast( BaseHandle handle ) -{ - return DownCast< Control, Internal::Control >(handle); -} +Control::Control(const Control& uiControl) = default; -Internal::Control& Control::GetImplementation() -{ - return static_cast(CustomActor::GetImplementation()); -} +Control::Control(Control&& rhs) = default; -const Internal::Control& Control::GetImplementation() const +Control::~Control() { - return static_cast(CustomActor::GetImplementation()); } -void Control::SetSizePolicy( SizePolicy widthPolicy, SizePolicy heightPolicy ) -{ - GetImplementation().SetSizePolicy( widthPolicy, heightPolicy ); -} +Control& Control::operator=(const Control& handle) = default; -void Control::GetSizePolicy( SizePolicy& widthPolicy, SizePolicy& heightPolicy ) const -{ - GetImplementation().GetSizePolicy( widthPolicy, heightPolicy ); -} +Control& Control::operator=(Control&& rhs) = default; -void Control::SetMinimumSize( const Vector3& size ) +Control Control::DownCast(BaseHandle handle) { - GetImplementation().SetMinimumSize( size ); + return DownCast(handle); } -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::SetBackgroundImage( Image image ) +Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal() { - GetImplementation().SetBackgroundImage( 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)