[dali_1.2.19] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / buttons / push-button.cpp
index 7133c03..80f8b16 100644 (file)
@@ -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.
  */
 
 // CLASS HEADER
-
 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
 
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
+#include <dali/public-api/images/resource-image.h>
 
+// INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/buttons/push-button-impl.h>
 
 namespace Dali
@@ -29,11 +32,6 @@ namespace Dali
 namespace Toolkit
 {
 
-const char* const PushButton::SIGNAL_PRESSED = "pressed";
-const char* const PushButton::SIGNAL_RELEASED = "released";
-
-const char* const PushButton::ACTION_PUSH_BUTTON_CLICK = "push-button-click";
-
 PushButton::PushButton()
 : Button()
 {
@@ -78,154 +76,52 @@ PushButton PushButton::DownCast( BaseHandle handle )
   return Control::DownCast<PushButton, Internal::PushButton>(handle);
 }
 
-void PushButton::SetAutoRepeating( bool autoRepeating )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetAutoRepeating( autoRepeating );
-}
-
-bool PushButton::IsAutoRepeating() const
-{
-  return Dali::Toolkit::GetImplementation( *this ).IsAutoRepeating();
-}
-
-void PushButton::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetInitialAutoRepeatingDelay( initialAutoRepeatingDelay );
-}
-
-float PushButton::GetInitialAutoRepeatingDelay() const
-{
-  return Dali::Toolkit::GetImplementation( *this ).GetInitialAutoRepeatingDelay();
-}
-
-void PushButton::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetNextAutoRepeatingDelay( nextAutoRepeatingDelay );
-}
-
-float PushButton::GetNextAutoRepeatingDelay() const
-{
-  return Dali::Toolkit::GetImplementation( *this ).GetNextAutoRepeatingDelay();
-}
-
-void PushButton::SetToggleButton( bool toggle )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetToggleButton( toggle );
-}
-
-bool PushButton::IsToggleButton() const
-{
-  return Dali::Toolkit::GetImplementation( *this ).IsToggleButton();
-}
-
-void PushButton::SetToggled( bool toggle )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetToggled( toggle );
-}
-
-bool PushButton::IsToggled() const
-{
-  return Dali::Toolkit::GetImplementation( *this ).IsToggled();
-}
-
-void PushButton::SetButtonImage( Image image )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image );
-}
+// 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 )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
+  // Passing Image as Actor not supported
 }
 
 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 )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
+  // Passing Image as Actor not supported}
 }
 
 void PushButton::SetSelectedImage( Actor image )
 {
-  Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
-}
+  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" );
 
-Actor PushButton::GetSelectedImage() const
-{
-  return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage();
+  // Passing Image as Actor not supported}
 }
 
-void PushButton::SetDisabledBackgroundImage( Image image )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
-}
-
-void PushButton::SetDisabledBackgroundImage( Actor image )
+void PushButton::SetSelectedBackgroundImage( Actor image )
 {
-  Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
-}
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedBackgroundImage() is deprecated and will be removed from next release.\n" );
 
-Actor PushButton::GetDisabledBackgroundImage() const
-{
-  return Dali::Toolkit::GetImplementation( *this ).GetDisabledBackgroundImage();
+  // Passing Image as Actor not supported}
 }
 
-void PushButton::SetDisabledImage( Image image )
+void PushButton::SetDisabledBackgroundImage( Actor image )
 {
-  Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image );
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledBackgroundImage() is deprecated and will be removed from next release.\n" );
+  // Passing Image as Actor not supported}
 }
 
 void PushButton::SetDisabledImage( Actor image )
 {
-  Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image );
-}
-
-Actor PushButton::GetDisabledImage() const
-{
-  return Dali::Toolkit::GetImplementation( *this ).GetDisabledImage();
-}
-
-void PushButton::SetLabel( const std::string& label )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
-}
-
-void PushButton::SetLabel( Actor label )
-{
-  Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
-}
-
-Actor PushButton::GetLabel() const
-{
-  return Dali::Toolkit::GetImplementation( *this ).GetLabel();
-}
-
-PushButton::PressedSignalType& PushButton::PressedSignal()
-{
-  return Dali::Toolkit::GetImplementation( *this ).PressedSignal();
+  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" );
+  // Passing Image as Actor not supported
 }
 
-PushButton::ReleasedSignalType& PushButton::ReleasedSignal()
+void PushButton::SetDisabledSelectedImage( Actor image )
 {
-  return Dali::Toolkit::GetImplementation( *this ).ReleasedSignal();
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledSelectedImage() is deprecated and will be removed from next release.\n" );
+  // Passing Image as Actor not supported
 }
 
 } // namespace Toolkit