X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol.cpp;h=ec37028d164bbe3af0bf39e6aa984667ae414a75;hb=f25156f6460c7b288797ed40aaeca1ae6fc827dd;hp=18eaeeb33a7a7a7b102b1b18b2b50b4ede77fa31;hpb=820c66e71516e7a25600b8b5de2e84b5d44d8ff3;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 18eaeeb..ec37028 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) 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,27 +38,21 @@ Control::Control() { } -Control::Control( const Control& uiControl ) -: CustomActor( uiControl ) -{ -} +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::operator=(Control&& rhs) = default; -Control Control::DownCast( BaseHandle handle ) +Control Control::DownCast(BaseHandle handle) { - return DownCast< Control, Internal::Control >(handle); + return DownCast(handle); } void Control::SetKeyInputFocus() @@ -94,9 +90,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 @@ -104,24 +100,29 @@ const std::string& Control::GetStyleName() const return Internal::GetImplementation(*this).GetStyleName(); } -void Control::SetBackgroundColor( const Vector4& color ) +void Control::SetBackgroundColor(const Vector4& color) { - Internal::GetImplementation(*this).SetBackgroundColor( color ); + Internal::GetImplementation(*this).SetBackgroundColor(color); } -Vector4 Control::GetBackgroundColor() const +void Control::ClearBackground() { - return Internal::GetImplementation(*this).GetBackgroundColor(); + Internal::GetImplementation(*this).ClearBackground(); } -void Control::SetBackgroundImage( Image image ) +bool Control::IsResourceReady() const { - Internal::GetImplementation(*this).SetBackgroundImage( image ); + const Internal::Control& internalControl = Toolkit::Internal::GetImplementation(*this); + const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get(internalControl); + + return controlDataImpl.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() @@ -139,6 +140,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) {