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=b882c1d1481c9daa49979e949310809364653a07;hp=6f75dfccaf7db866f313247158714bce29ebd9dc;hb=380cdb40c8cb0aaefb60134268744e0331c35385;hpb=1b1e10a3f4e486553200d8ddeb57d953c2284579 diff --git a/dali-toolkit/public-api/controls/control.cpp b/dali-toolkit/public-api/controls/control.cpp index 6f75dfc..b882c1d 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) 2016 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,7 +15,13 @@ * */ +// CLASS HEADER #include + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES #include namespace Dali @@ -33,8 +39,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 +62,88 @@ 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 -{ - return GetImplementation().GetMinimumSize(); -} - -void Control::SetMaximumSize( const Vector3& size ) +void Control::SetKeyInputFocus() { - GetImplementation().SetMaximumSize( size ); + Internal::GetImplementation(*this).SetKeyInputFocus(); } -const Vector3& Control::GetMaximumSize() const +bool Control::HasKeyInputFocus() { - return GetImplementation().GetMaximumSize(); + return Internal::GetImplementation(*this).HasKeyInputFocus(); } -Vector3 Control::GetNaturalSize() +void Control::ClearKeyInputFocus() { - return GetImplementation().GetNaturalSize(); + Internal::GetImplementation(*this).ClearKeyInputFocus(); } -float Control::GetHeightForWidth( float width ) +PinchGestureDetector Control::GetPinchGestureDetector() const { - return GetImplementation().GetHeightForWidth( width ); + return Internal::GetImplementation(*this).GetPinchGestureDetector(); } -float Control::GetWidthForHeight( float height ) +PanGestureDetector Control::GetPanGestureDetector() const { - return GetImplementation().GetWidthForHeight( height ); + return Internal::GetImplementation(*this).GetPanGestureDetector(); } -void Control::SetKeyInputFocus() +TapGestureDetector Control::GetTapGestureDetector() const { - GetImplementation().SetKeyInputFocus(); + return Internal::GetImplementation(*this).GetTapGestureDetector(); } -bool Control::HasKeyInputFocus() +LongPressGestureDetector Control::GetLongPressGestureDetector() const { - return GetImplementation().HasKeyInputFocus(); + return Internal::GetImplementation(*this).GetLongPressGestureDetector(); } -void Control::ClearKeyInputFocus() +void Control::SetStyleName( const std::string& styleName ) { - GetImplementation().ClearKeyInputFocus(); + Internal::GetImplementation(*this).SetStyleName( styleName ); } -PinchGestureDetector Control::GetPinchGestureDetector() const +const std::string& Control::GetStyleName() const { - return GetImplementation().GetPinchGestureDetector(); + return Internal::GetImplementation(*this).GetStyleName(); } -PanGestureDetector Control::GetPanGestureDetector() const +void Control::SetBackgroundColor( const Vector4& color ) { - return GetImplementation().GetPanGestureDetector(); + Internal::GetImplementation(*this).SetBackgroundColor( color ); } -TapGestureDetector Control::GetTapGestureDetector() const +Vector4 Control::GetBackgroundColor() const { - return GetImplementation().GetTapGestureDetector(); -} + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetBackgroundColor() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" ); -LongPressGestureDetector Control::GetLongPressGestureDetector() const -{ - return GetImplementation().GetLongPressGestureDetector(); + return Internal::GetImplementation(*this).GetBackgroundColor(); } -void Control::SetBackgroundColor( const Vector4& color ) +void Control::SetBackgroundImage( Image image ) { - GetImplementation().SetBackgroundColor( color ); -} + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" ); -Vector4 Control::GetBackgroundColor() const -{ - return GetImplementation().GetBackgroundColor(); + Internal::GetImplementation(*this).SetBackgroundImage( image ); } -void Control::SetBackground( Image image ) +void Control::ClearBackground() { - GetImplementation().SetBackground( image ); + Internal::GetImplementation(*this).ClearBackground(); } -void Control::ClearBackground() +Control::KeyEventSignalType& Control::KeyEventSignal() { - GetImplementation().ClearBackground(); + return Internal::GetImplementation(*this).KeyEventSignal(); } -Actor Control::GetBackgroundActor() const +Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal() { - return GetImplementation().GetBackgroundActor(); + return Internal::GetImplementation(*this).KeyInputFocusGainedSignal(); } -Control::KeyEventSignalType& Control::KeyEventSignal() +Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal() { - return GetImplementation().KeyEventSignal(); + return Internal::GetImplementation(*this).KeyInputFocusLostSignal(); } Control::Control(Internal::Control& implementation)