X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol.cpp;h=245bdd5e889691645147bf2a05bde6fdb6cfc35a;hb=3ff7f1def424f0ea497f41f1ee5053291cbf722b;hp=5bbc4e72ac3dfb48c715e4fe960acdc33e8ac859;hpb=b3aff14cae6b3af637e75171422c16661878ba8e;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 5bbc4e7..245bdd5 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. @@ -18,140 +18,139 @@ // CLASS HEADER #include +// EXTERNAL INCLUDES +#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 ? static_cast< const Internal::Control& >( uiControl.GetImplementation() ).GetOwner() : NULL) +Control::Control() { } -Control::~Control() -{ -} +Control::Control(const Control& uiControl) = default; -Control& Control::operator=( const Control& handle ) -{ - if( &handle != this ) - { - CustomActor::operator=( handle ); - } - return *this; -} +Control::Control(Control&& rhs) = default; -Control Control::DownCast( BaseHandle handle ) +Control::~Control() { - return DownCast< Control, Internal::Control >(handle); } -Internal::Control& Control::GetImplementation() -{ - return static_cast(CustomActor::GetImplementation()); -} +Control& Control::operator=(const Control& handle) = default; + +Control& Control::operator=(Control&& rhs) = default; -const Internal::Control& Control::GetImplementation() const +Control Control::DownCast(BaseHandle handle) { - return static_cast(CustomActor::GetImplementation()); + return DownCast(handle); } void Control::SetKeyInputFocus() { - GetImplementation().SetKeyInputFocus(); + Internal::GetImplementation(*this).SetKeyInputFocus(); } bool Control::HasKeyInputFocus() { - return GetImplementation().HasKeyInputFocus(); + return Internal::GetImplementation(*this).HasKeyInputFocus(); } void Control::ClearKeyInputFocus() { - GetImplementation().ClearKeyInputFocus(); + Internal::GetImplementation(*this).ClearKeyInputFocus(); } PinchGestureDetector Control::GetPinchGestureDetector() const { - return GetImplementation().GetPinchGestureDetector(); + return Internal::GetImplementation(*this).GetPinchGestureDetector(); } PanGestureDetector Control::GetPanGestureDetector() const { - return GetImplementation().GetPanGestureDetector(); + return Internal::GetImplementation(*this).GetPanGestureDetector(); } TapGestureDetector Control::GetTapGestureDetector() const { - return GetImplementation().GetTapGestureDetector(); + return Internal::GetImplementation(*this).GetTapGestureDetector(); } LongPressGestureDetector Control::GetLongPressGestureDetector() const { - return GetImplementation().GetLongPressGestureDetector(); + return Internal::GetImplementation(*this).GetLongPressGestureDetector(); } -void Control::SetStyleName( const std::string& styleName ) +void Control::SetStyleName(const std::string& styleName) { - GetImplementation().SetStyleName( styleName ); + Internal::GetImplementation(*this).SetStyleName(styleName); } const std::string& Control::GetStyleName() const { - return GetImplementation().GetStyleName(); + return Internal::GetImplementation(*this).GetStyleName(); } -void Control::SetBackgroundColor( const Vector4& color ) +void Control::SetBackgroundColor(const Vector4& color) { - GetImplementation().SetBackgroundColor( color ); + Internal::GetImplementation(*this).SetBackgroundColor(color); } -Vector4 Control::GetBackgroundColor() const +void Control::ClearBackground() { - return GetImplementation().GetBackgroundColor(); + Internal::GetImplementation(*this).ClearBackground(); } -void Control::SetBackgroundImage( Image image ) +bool Control::IsResourceReady() const { - GetImplementation().SetBackgroundImage( image ); -} + const Internal::Control& internalControl = Toolkit::Internal::GetImplementation(*this); + const Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get(internalControl); -void Control::ClearBackground() -{ - GetImplementation().ClearBackground(); + return controlDataImpl.IsResourceReady(); } -Actor Control::GetBackgroundActor() const +Toolkit::Visual::ResourceStatus Control::GetVisualResourceStatus(Dali::Property::Index index) { - return GetImplementation().GetBackgroundActor(); + 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() { - return GetImplementation().KeyEventSignal(); + return Internal::GetImplementation(*this).KeyEventSignal(); } Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal() { - return GetImplementation().KeyInputFocusGainedSignal(); + return Internal::GetImplementation(*this).KeyInputFocusGainedSignal(); } Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal() { - return GetImplementation().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)