X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol.cpp;h=f411d4d5ba129391656445bf91f9d05e9450e471;hb=a1d6238d1bb9d8ca13d9bca6a4d58b633b0eb906;hp=b83a6523ba15f4435d4136d2779c084822fe8036;hpb=caf7677175a0e8b9c690d4f2ab73adc295f22c0e;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 b83a652..f411d4d 100644 --- a/dali-toolkit/public-api/controls/control.cpp +++ b/dali-toolkit/public-api/controls/control.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -22,44 +22,42 @@ #include // INTERNAL INCLUDES +#include #include namespace Dali { - namespace Toolkit { - Control Control::New() { - return Internal::Control::New(); + return Toolkit::Internal::Control::New(); } -Control::Control() +Control Control::New(ControlBehaviour additionalBehaviour) { + return Toolkit::Internal::Control::New(static_cast(additionalBehaviour)); } -Control::Control( const Control& uiControl ) -: CustomActor( uiControl ) +Control::Control() { } +Control::Control(const Control& uiControl) = default; + +Control::Control(Control&& rhs) = default; + Control::~Control() { } -Control& Control::operator=( const Control& handle ) -{ - if( &handle != this ) - { - CustomActor::operator=( handle ); - } - return *this; -} +Control& Control::operator=(const Control& handle) = default; -Control Control::DownCast( BaseHandle handle ) +Control& Control::operator=(Control&& rhs) = default; + +Control Control::DownCast(BaseHandle handle) { - return DownCast< Control, Internal::Control >(handle); + return DownCast(handle); } void Control::SetKeyInputFocus() @@ -97,9 +95,9 @@ LongPressGestureDetector Control::GetLongPressGestureDetector() const return Internal::GetImplementation(*this).GetLongPressGestureDetector(); } -void Control::SetStyleName( const std::string& styleName ) +void Control::SetStyleName(const std::string& styleName) { - Internal::GetImplementation(*this).SetStyleName( styleName ); + Internal::GetImplementation(*this).SetStyleName(styleName); } const std::string& Control::GetStyleName() const @@ -107,28 +105,26 @@ const std::string& Control::GetStyleName() const return Internal::GetImplementation(*this).GetStyleName(); } -void Control::SetBackgroundColor( const Vector4& color ) +void Control::SetBackgroundColor(const Vector4& color) { - DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" ); - - Internal::GetImplementation(*this).SetBackgroundColor( color ); + Internal::GetImplementation(*this).SetBackgroundColor(color); } -Vector4 Control::GetBackgroundColor() const +void Control::ClearBackground() { - DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetBackgroundColor() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" ); - - return Internal::GetImplementation(*this).GetBackgroundColor(); + Internal::GetImplementation(*this).ClearBackground(); } -void Control::SetBackgroundImage( Image image ) +bool Control::IsResourceReady() const { - Internal::GetImplementation(*this).SetBackgroundImage( image ); + return Internal::GetImplementation(*this).IsResourceReady(); } -void Control::ClearBackground() +Toolkit::Visual::ResourceStatus Control::GetVisualResourceStatus(Dali::Property::Index index) { - Internal::GetImplementation(*this).ClearBackground(); + const Internal::Control& internalControl = Toolkit::Internal::GetImplementation(*this); + const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get(internalControl); + return controlDataImpl.GetVisualResourceStatus(index); } Control::KeyEventSignalType& Control::KeyEventSignal() @@ -146,6 +142,14 @@ Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal() return Internal::GetImplementation(*this).KeyInputFocusLostSignal(); } +Control::ResourceReadySignalType& Control::ResourceReadySignal() +{ + Internal::Control& internalControl = Toolkit::Internal::GetImplementation(*this); + Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get(internalControl); + + return controlImpl.mResourceReadySignal; +} + Control::Control(Internal::Control& implementation) : CustomActor(implementation) {