X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fbuttons%2Fbutton.cpp;h=f4723753214fd95a8c23d12221ce1103e844e9b8;hb=bea7b708b28cb38349ff99c3a656d40c065a8c54;hp=3b251da39fc9dc85b1860249be26ae09a53d4e00;hpb=2acdedcc7c7e732a9ec97d08c8cee7423ed6ebf7;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/public-api/controls/buttons/button.cpp b/dali-toolkit/public-api/controls/buttons/button.cpp index 3b251da..f472375 100644 --- a/dali-toolkit/public-api/controls/buttons/button.cpp +++ b/dali-toolkit/public-api/controls/buttons/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. @@ -23,19 +23,15 @@ #include +// EXTERNAL INCLUDES +#include + namespace Dali { namespace Toolkit { -const char* const Button::SIGNAL_PRESSED = "pressed"; -const char* const Button::SIGNAL_RELEASED = "released"; -const char* const Button::SIGNAL_CLICKED = "clicked"; -const char* const Button::SIGNAL_STATE_CHANGED = "state-changed"; - -const char* const Button::ACTION_BUTTON_CLICK = "button-click"; - Button::Button() {} @@ -132,19 +128,49 @@ float Button::GetAnimationTime() const return Dali::Toolkit::GetImplementation( *this ).GetAnimationTime(); } -void Button::SetLabel( const std::string& label ) +void Button::SetLabelText( const std::string& label ) { - Dali::Toolkit::GetImplementation( *this ).SetLabel( label ); + Dali::Toolkit::GetImplementation( *this ).SetLabelText( label ); } -void Button::SetLabel( Actor label ) +std::string Button::GetLabelText() const { - Dali::Toolkit::GetImplementation( *this ).SetLabel( label ); + return Dali::Toolkit::GetImplementation( *this ).GetLabelText(); +} + +void Button::SetUnselectedImage( const std::string& filename ) +{ + Dali::Toolkit::GetImplementation( *this ).SetUnselectedImage( filename ); +} + +void Button::SetBackgroundImage( const std::string& filename ) +{ + Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( filename ); +} + +void Button::SetSelectedImage( const std::string& filename ) +{ + Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( filename ); } -Actor Button::GetLabel() const +void Button::SetSelectedBackgroundImage( const std::string& filename ) { - return Dali::Toolkit::GetImplementation( *this ).GetLabel(); + Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( filename ); +} + +void Button::SetDisabledBackgroundImage( const std::string& filename ) +{ + Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( filename ); +} + +void Button::SetDisabledImage( const std::string& filename ) +{ + Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( filename ); +} + +void Button::SetDisabledSelectedImage( const std::string& filename ) +{ + Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( filename ); } Button::ButtonSignalType& Button::PressedSignal() @@ -167,6 +193,38 @@ Button::ButtonSignalType& Button::StateChangedSignal() return Dali::Toolkit::GetImplementation( *this ).StateChangedSignal(); } +// Deprecated API + +void Button::SetLabel( Actor label ) +{ + Dali::Toolkit::GetImplementation( *this ).SetLabel( label ); +} + +void Button::SetButtonImage( Image image ) +{ + Actor imageActor = ImageActor::New( image ); + imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageActor ); +} + +void Button::SetSelectedImage( Image image ) +{ + Actor imageActor = ImageActor::New( image ); + imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( imageActor ); +} + +Actor Button::GetButtonImage() const +{ + return Dali::Toolkit::GetImplementation( *this ).GetButtonImage(); +} + +Actor Button::GetSelectedImage() const +{ + return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage(); +} + + Button::Button( Internal::Button& implementation ) : Control( implementation ) {