X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fbuttons%2Fpush-button.cpp;h=dd3fddedd63f6c3bcf7ce4bf7a1d1a37d3976152;hb=HEAD;hp=d9e395ee160c94eb9a2edb2c67c3f038bb12a268;hpb=935e800159c04fa5d389628add6183eb68f778ee;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..dd3fdde 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) 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. @@ -16,46 +16,38 @@ */ // CLASS HEADER - #include -// INTERNAL INCLUDES +// EXTERNAL INCLUDES +#include +// INTERNAL INCLUDES #include -#include namespace Dali { - namespace Toolkit { - PushButton::PushButton() : Button() { } -PushButton::PushButton( Internal::PushButton& implementation ) -: Button( implementation ) +PushButton::PushButton(Internal::PushButton& implementation) +: Button(implementation) { } -PushButton::PushButton( const PushButton& pushButton ) -: Button( pushButton ) -{ -} +PushButton::PushButton(const PushButton& pushButton) = default; -PushButton& PushButton::operator=( const PushButton& pushButton ) -{ - if( &pushButton != this ) - { - Button::operator=( pushButton ); - } - return *this; -} +PushButton::PushButton(PushButton&& rhs) noexcept = default; -PushButton::PushButton( Dali::Internal::CustomActor* internal ) -: Button( internal ) +PushButton& PushButton::operator=(const PushButton& pushButton) = default; + +PushButton& PushButton::operator=(PushButton&& rhs) noexcept = default; + +PushButton::PushButton(Dali::Internal::CustomActor* internal) +: Button(internal) { VerifyCustomActorPointer(internal); } @@ -69,111 +61,11 @@ PushButton PushButton::New() return Internal::PushButton::New(); } -PushButton PushButton::DownCast( BaseHandle handle ) +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 ); -} - -void PushButton::SetButtonImage( Actor image ) -{ - Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image ); -} - -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 ); -} - -void PushButton::SetBackgroundImage( Actor image ) -{ - Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image ); -} - -Actor PushButton::GetBackgroundImage() const -{ - return Dali::Toolkit::GetImplementation( *this ).GetBackgroundImage(); -} - -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 ); -} - -void PushButton::SetSelectedImage( Actor image ) -{ - Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image ); -} - -Actor PushButton::GetSelectedImage() const -{ - return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage(); -} - -void PushButton::SetSelectedBackgroundImage( Image image ) -{ - Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( ImageActor::New( image ) ); -} - -void PushButton::SetSelectedBackgroundImage( Actor image ) -{ - Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( image ); -} - -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 ); -} - -void PushButton::SetDisabledBackgroundImage( Actor image ) -{ - Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image ); -} - -Actor PushButton::GetDisabledBackgroundImage() const -{ - return Dali::Toolkit::GetImplementation( *this ).GetDisabledBackgroundImage(); -} - -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 ); -} - -void PushButton::SetDisabledImage( Actor image ) -{ - Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image ); -} - -Actor PushButton::GetDisabledImage() const -{ - return Dali::Toolkit::GetImplementation( *this ).GetDisabledImage(); -} - } // namespace Toolkit } // namespace Dali