Button refactoring: rename properties
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / buttons / check-box-button-impl.cpp
index ea4909d..c15c15e 100644 (file)
  */
 
 // CLASS HEADER
-
 #include "check-box-button-impl.h"
 
 // EXTERNAL INCLUDES
-
 #include <algorithm>
+#include <dali/public-api/actors/image-actor.h>
+#include <dali/public-api/object/type-registry.h>
 
 // INTERNAL INCLUDES
-
 #include "check-box-button-default-painter-impl.h"
 
 namespace Dali
@@ -76,7 +75,7 @@ Dali::Toolkit::CheckBoxButton CheckBoxButton::New()
 
 void CheckBoxButton::SetChecked( bool checked )
 {
-  if( !mDimmed && ( checked != mChecked ) )
+  if( !mDisabled && ( checked != mChecked ) )
   {
     // Stores the state.
     mChecked = checked;
@@ -86,8 +85,8 @@ void CheckBoxButton::SetChecked( bool checked )
     // Notifies the painter the checkbox has been checked.
     GetCheckBoxButtonPainter( mPainter )->Checked( handle );
 
-    // Emit signal.
-    mClickedSignalV2.Emit( handle );
+    // Raise state changed signal
+    mStateChangedSignal.Emit( handle, mChecked );
   }
 }
 
@@ -138,46 +137,46 @@ Actor CheckBoxButton::GetCheckedImage() const
   return mCheckedImage;
 }
 
-void CheckBoxButton::SetDimmedBackgroundImage( Image image )
+void CheckBoxButton::SetDisabledBackgroundImage( Image image )
 {
-  SetDimmedBackgroundImage( ImageActor::New( image ) );
+  SetDisabledBackgroundImage( ImageActor::New( image ) );
 }
 
-void CheckBoxButton::SetDimmedBackgroundImage( Actor image )
+void CheckBoxButton::SetDisabledBackgroundImage( Actor image )
 {
   Toolkit::CheckBoxButton handle( GetOwner() );
-  GetCheckBoxButtonPainter( mPainter )->SetDimmedBackgroundImage( handle, image );
+  GetCheckBoxButtonPainter( mPainter )->SetDisabledBackgroundImage( handle, image );
 }
 
-Actor& CheckBoxButton::GetDimmedBackgroundImage()
+Actor& CheckBoxButton::GetDisabledBackgroundImage()
 {
-  return mDimmedBackgroundImage;
+  return mDisabledBackgroundImage;
 }
 
-Actor CheckBoxButton::GetDimmedBackgroundImage() const
+Actor CheckBoxButton::GetDisabledBackgroundImage() const
 {
-  return mDimmedBackgroundImage;
+  return mDisabledBackgroundImage;
 }
 
-void CheckBoxButton::SetDimmedCheckedImage( Image image )
+void CheckBoxButton::SetDisabledCheckedImage( Image image )
 {
-  SetDimmedCheckedImage( ImageActor::New( image ) );
+  SetDisabledCheckedImage( ImageActor::New( image ) );
 }
 
-void CheckBoxButton::SetDimmedCheckedImage( Actor image )
+void CheckBoxButton::SetDisabledCheckedImage( Actor image )
 {
   Toolkit::CheckBoxButton handle( GetOwner() );
-  GetCheckBoxButtonPainter( mPainter )->SetDimmedCheckedImage( handle, image );
+  GetCheckBoxButtonPainter( mPainter )->SetDisabledCheckedImage( handle, image );
 }
 
-Actor& CheckBoxButton::GetDimmedCheckedImage()
+Actor& CheckBoxButton::GetDisabledCheckedImage()
 {
-  return mDimmedCheckedImage;
+  return mDisabledCheckedImage;
 }
 
-Actor CheckBoxButton::GetDimmedCheckedImage() const
+Actor CheckBoxButton::GetDisabledCheckedImage() const
 {
-  return mDimmedCheckedImage;
+  return mDisabledCheckedImage;
 }
 
 Actor& CheckBoxButton::GetFadeOutBackgroundImage()
@@ -192,8 +191,6 @@ Actor& CheckBoxButton::GetFadeOutCheckedImage()
 
 void CheckBoxButton::OnButtonInitialize()
 {
-  mUseFadeAnimationProperty = Self().RegisterProperty( Toolkit::CheckBoxButton::USE_FADE_ANIMATION_PROPERTY_NAME, false );
-  mUseCheckAnimationProperty = Self().RegisterProperty( Toolkit::CheckBoxButton::USE_CHECK_ANIMATION_PROPERTY_NAME, true );
 }
 
 void CheckBoxButton::OnButtonUp()
@@ -218,7 +215,7 @@ float CheckBoxButton::OnAnimationTimeRequested() const
 void CheckBoxButton::OnActivated()
 {
   // When the button is activated, it performs the click action
-  std::vector<Property::Value> attributes;
+  PropertyValueContainer attributes;
   DoClickAction(attributes);
 }
 
@@ -234,7 +231,7 @@ void CheckBoxButton::DoClickAction(const PropertyValueContainer& attributes)
   }
 }
 
-bool CheckBoxButton::DoAction(BaseObject* object, const std::string& actionName, const std::vector<Property::Value>& attributes)
+bool CheckBoxButton::DoAction(BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes)
 {
   bool ret = false;