X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fbuttons%2Fpush-button.cpp;h=5e40b5569dae9d63de0f63860559818eeb6e2132;hb=af36dd11f3cec0275bfb15ab8b4222463cc20986;hp=d9e395ee160c94eb9a2edb2c67c3f038bb12a268;hpb=ded71874c72f72de672b8df770b4983a5d846944;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/public-api/controls/buttons/push-button.cpp b/dali-toolkit/public-api/controls/buttons/push-button.cpp index d9e395e..5e40b55 100644 --- a/dali-toolkit/public-api/controls/buttons/push-button.cpp +++ b/dali-toolkit/public-api/controls/buttons/push-button.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2015 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. @@ -16,13 +16,13 @@ */ // CLASS HEADER - #include -// INTERNAL INCLUDES +// EXTERNAL INCLUDES +#include +// INTERNAL INCLUDES #include -#include namespace Dali { @@ -74,104 +74,55 @@ PushButton PushButton::DownCast( BaseHandle handle ) return Control::DownCast(handle); } -void PushButton::SetButtonImage( Image image ) -{ - Actor imageActor = ImageActor::New( image ); - imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); - Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageActor ); -} +// Deprecated API void PushButton::SetButtonImage( Actor image ) { - Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image ); -} + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetButtonImage() is deprecated and will be removed from next release. Use Button.SetProperty UNSELECTED_STATE_IMAGE or Styling file instead.\n" ); -Actor PushButton::GetButtonImage() const -{ - return Dali::Toolkit::GetImplementation( *this ).GetButtonImage(); -} - -void PushButton::SetBackgroundImage( Image image ) -{ - Actor imageActor = ImageActor::New( image ); - imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); - Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( imageActor ); + Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image ); } void PushButton::SetBackgroundImage( Actor image ) { - Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image ); -} - -Actor PushButton::GetBackgroundImage() const -{ - return Dali::Toolkit::GetImplementation( *this ).GetBackgroundImage(); -} + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release.\n" ); -void PushButton::SetSelectedImage( Image image ) -{ - Actor imageActor = ImageActor::New( image ); - imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); - Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( imageActor ); + Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image ); } void PushButton::SetSelectedImage( Actor image ) { - Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image ); -} - -Actor PushButton::GetSelectedImage() const -{ - return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage(); -} + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedImage() is deprecated and will be removed from next release. Use Button.SetProperty SELECTED_STATE_IMAGE or Styling file instead.\n" ); -void PushButton::SetSelectedBackgroundImage( Image image ) -{ - Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( ImageActor::New( image ) ); + Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image ); } void PushButton::SetSelectedBackgroundImage( Actor image ) { - Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( image ); -} + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedBackgroundImage() is deprecated and will be removed from next release.\n" ); -Actor PushButton::GetSelectedBackgroundImage() const -{ - return Dali::Toolkit::GetImplementation( *this ).GetSelectedBackgroundImage(); -} - -void PushButton::SetDisabledBackgroundImage( Image image ) -{ - Actor imageActor = ImageActor::New( image ); - imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); - Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( imageActor ); + Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( image ); } void PushButton::SetDisabledBackgroundImage( Actor image ) { - Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image ); -} - -Actor PushButton::GetDisabledBackgroundImage() const -{ - return Dali::Toolkit::GetImplementation( *this ).GetDisabledBackgroundImage(); -} + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledBackgroundImage() is deprecated and will be removed from next release.\n" ); -void PushButton::SetDisabledImage( Image image ) -{ - Actor imageActor = ImageActor::New( image ); - imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); - Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( imageActor ); + Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image ); } void PushButton::SetDisabledImage( Actor image ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledImage() is deprecated and will be removed from next release. Use Button.SetProperty DISABLED_STATE_IMAGE or Styling file instead.\n" ); + Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image ); } -Actor PushButton::GetDisabledImage() const +void PushButton::SetDisabledSelectedImage( Actor image ) { - return Dali::Toolkit::GetImplementation( *this ).GetDisabledImage(); + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledSelectedImage() is deprecated and will be removed from next release.\n" ); + + Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( image ); } } // namespace Toolkit