Merge "Fix for font validation." into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / buttons / button.cpp
index 86746c3..56cd667 100644 (file)
@@ -22,6 +22,7 @@
 // INTERNAL INCLUDES
 
 #include <dali-toolkit/internal/controls/buttons/button-impl.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
 
 namespace Dali
 {
@@ -125,19 +126,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 );
+}
+
+void Button::SetSelectedBackgroundImage( const std::string& filename )
+{
+  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 );
 }
 
-Actor Button::GetLabel() const
+void Button::SetDisabledSelectedImage( const std::string& filename )
 {
-  return Dali::Toolkit::GetImplementation( *this ).GetLabel();
+  Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( filename );
 }
 
 Button::ButtonSignalType& Button::PressedSignal()
@@ -160,6 +191,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 = Toolkit::ImageView::New( image );
+  imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+  Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageActor );
+}
+
+void Button::SetSelectedImage( Image image )
+{
+  Actor imageActor = Toolkit::ImageView::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 )
 {