Fix compile error. Non initialized variable.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / push-button-impl.cpp
index cb5a747..d09f781 100644 (file)
@@ -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.
@@ -21,7 +21,6 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
-#include <dali/public-api/images/resource-image.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 
@@ -47,8 +46,6 @@ namespace Internal
 namespace
 {
 
-const float   ANIMATION_TIME( 0.2f );
-
 BaseHandle Create()
 {
   return Toolkit::PushButton::New();
@@ -58,24 +55,11 @@ BaseHandle Create()
 
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::PushButton, Toolkit::Button, Create )
 
-DALI_PROPERTY_REGISTRATION( Toolkit, PushButton, "unselectedIcon",  STRING, UNSELECTED_ICON )
-DALI_PROPERTY_REGISTRATION( Toolkit, PushButton, "selectedIcon",  STRING, SELECTED_ICON )
-DALI_PROPERTY_REGISTRATION( Toolkit, PushButton, "iconAlignment",  STRING, ICON_ALIGNMENT )
 DALI_PROPERTY_REGISTRATION( Toolkit, PushButton, "labelPadding",  STRING, LABEL_PADDING )
 DALI_PROPERTY_REGISTRATION( Toolkit, PushButton, "iconPadding",  STRING, ICON_PADDING )
 
 DALI_TYPE_REGISTRATION_END()
 
-/*
- * Table to define Text-to-enum conversions for IconAlignment.
- */
-const Dali::Scripting::StringEnum IconAlignmentTable[] = {
-  { "LEFT",   Toolkit::Internal::PushButton::LEFT },
-  { "RIGHT",  Toolkit::Internal::PushButton::RIGHT },
-  { "TOP",    Toolkit::Internal::PushButton::TOP },
-  { "BOTTOM", Toolkit::Internal::PushButton::BOTTOM },
-}; const unsigned int IconAlignmentTableCount = sizeof( IconAlignmentTable ) / sizeof( IconAlignmentTable[0] );
-
 } // unnamed namespace
 
 namespace
@@ -102,7 +86,6 @@ PushButton::PushButton()
 : Button(),
   mIconAlignment( RIGHT )
 {
-  SetAnimationTime( ANIMATION_TIME );
 }
 
 PushButton::~PushButton()
@@ -115,7 +98,7 @@ void PushButton::OnInitialize()
 
   // Push button requires the Leave event.
   Actor self = Self();
-  self.SetLeaveRequired( true );
+  self.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
 }
 
 void PushButton::SetIconAlignment( const PushButton::IconAlignment iconAlignment )
@@ -165,25 +148,6 @@ void PushButton::SetProperty( BaseObject* object, Property::Index propertyIndex,
 
     switch ( propertyIndex )
     {
-      case Toolkit::PushButton::Property::UNSELECTED_ICON:
-      {
-        pushButtonImpl.CreateVisualsForComponent( Toolkit::Button::Property::UNSELECTED_VISUAL, value, DepthIndex::CONTENT );
-        break;
-      }
-      case Toolkit::PushButton::Property::SELECTED_ICON:
-      {
-        pushButtonImpl.CreateVisualsForComponent( Toolkit::Button::Property::SELECTED_VISUAL, value, DepthIndex::CONTENT );
-        break;
-      }
-      case Toolkit::PushButton::Property::ICON_ALIGNMENT:
-      {
-        IconAlignment iconAlignment;
-        if( Scripting::GetEnumeration< IconAlignment >( value.Get< std::string >().c_str(), IconAlignmentTable, IconAlignmentTableCount, iconAlignment ) )
-        {
-          pushButtonImpl.SetIconAlignment( iconAlignment );
-        }
-        break;
-      }
       case Toolkit::PushButton::Property::LABEL_PADDING:
       {
         Vector4 padding ( value.Get< Vector4 >() );
@@ -212,21 +176,6 @@ Property::Value PushButton::GetProperty( BaseObject* object, Property::Index pro
 
     switch ( propertyIndex )
     {
-      case Toolkit::PushButton::Property::UNSELECTED_ICON:
-      {
-        //value = pushButtonImpl.GetIcon( UNSELECTED_DECORATION );
-        break;
-      }
-      case Toolkit::PushButton::Property::SELECTED_ICON:
-      {
-        //value = pushButtonImpl.GetIcon( UNSELECTED_DECORATION );
-        break;
-      }
-      case Toolkit::PushButton::Property::ICON_ALIGNMENT:
-      {
-        value = Scripting::GetLinearEnumerationName< IconAlignment >( pushButtonImpl.GetIconAlignment(), IconAlignmentTable, IconAlignmentTableCount );
-        break;
-      }
       case Toolkit::PushButton::Property::LABEL_PADDING:
       {
         Padding padding = pushButtonImpl.Button::GetLabelPadding();
@@ -245,46 +194,6 @@ Property::Value PushButton::GetProperty( BaseObject* object, Property::Index pro
   return value;
 }
 
-void PushButton::PrepareForTranstionIn( Actor actor )
-{
-  // Set Toolkit::Button::Property::SELECTED_VISUAL and Toolkit::Button::Property::UNSELECTED_VISUAL to opacity 0
-  // Then get and start animation
-}
-
-void PushButton::PrepareForTranstionOut( Actor actor )
-{
-  // Set Toolkit::Button::Property::SELECTED_VISUAL and Toolkit::Button::Property::UNSELECTED_VISUAL to opacity 1
-  // Then get and start animation
-}
-
-void PushButton::OnTransitionIn( Actor actor )
-{
-  // Only transition selected and unselected visual, background doesn't change.
-  // Start Fade animation to 1
-}
-
-void PushButton::OnTransitionOut( Actor actor )
-{
-  // Only transition selected and unselected visual, background doesn't change.
-  // Start Fade animation to 0
-}
-
-void PushButton::FadeImageTo( Actor actor , float opacity )
-{
-  if( actor )
-  {
-    Dali::Animation transitionAnimation = GetTransitionAnimation();
-    DALI_ASSERT_DEBUG( transitionAnimation );
-
-    if( transitionAnimation )
-    {
-      DALI_LOG_INFO( gLogButtonFilter, Debug::Verbose, "PushButton::FadeImageTo(%f)\n", opacity );
-
-      transitionAnimation.AnimateTo( Property( actor, Actor::Property::COLOR_ALPHA ), opacity );
-    }
-  }
-}
-
 } // namespace Internal
 
 } // namespace Toolkit