Fix compile error. Non initialized variable.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / push-button-impl.h
index 51164b5..8e11d79 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H__
-#define __DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H__
+#ifndef DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H
+#define DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -61,112 +61,60 @@ protected:
    */
   virtual ~PushButton();
 
-private: // From Button
-
-  /**
-   * @copydoc Toolkit::Internal::Button::OnButtonInitialize()
-   */
-  virtual void OnButtonInitialize();
-
-  /**
-   * @copydoc Toolkit::Internal::Button::OnLabelSet()
-   */
-  virtual void OnLabelSet();
-
-  /**
-   * @copydoc Toolkit::Internal::Button::OnButtonImageSet()
-   */
-  virtual void OnButtonImageSet();
-
-  /**
-   * @copydoc Toolkit::Internal::Button::OnSelectedImageSet()
-   */
-  virtual void OnSelectedImageSet();
-
-  /**
-   * @copydoc Toolkit::Internal::Button::OnBackgroundImage()
-   */
-  virtual void OnBackgroundImageSet();
-
-  /**
-   * @copydoc Toolkit::Internal::Button::OnSelectedBackgroundImageSet()
-   */
-  virtual void OnSelectedBackgroundImageSet();
-
-  /**
-   * @copydoc Toolkit::Internal::Button::OnDisabledImageSet()
-   */
-  virtual void OnDisabledImageSet();
-
-  /**
-   * @copydoc Toolkit::Internal::Button::OnDisabledSelectedImageSet()
-   */
-  virtual void OnDisabledSelectedImageSet();
-
-  /**
-   * @copydoc Toolkit::Internal::Button::OnDisabledBackgroundImageSet()
-   */
-  virtual void OnDisabledBackgroundImageSet();
+public:
 
-  /**
-   * @copydoc Toolkit::Internal::Button::PrepareForTranstionIn( Actor actor )
-   */
-  virtual void PrepareForTranstionIn( Actor actor );
+  // Properties
 
   /**
-   * @copydoc Toolkit::Internal::Button::PrepareForTranstionOut( Actor actor )
+   * Enum for the alignment modes of the icon.
    */
-  virtual void PrepareForTranstionOut( Actor actor );
+  enum IconAlignment
+  {
+    LEFT,
+    RIGHT,
+    TOP,
+    BOTTOM,
+    DEFAULT = RIGHT
+  };
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnTransitionIn( Actor actor )
+   * Called when a property of an object of this type is set.
+   * @param[in] object The object whose property is set.
+   * @param[in] index The property index.
+   * @param[in] value The new property value.
    */
-  virtual void OnTransitionIn( Actor actor );
+  static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value );
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnTransitionOut( Actor actor )
+   * Called to retrieve a property of an object of this type.
+   * @param[in] object The object whose property is to be retrieved.
+   * @param[in] index The property index.
+   * @return The current value of the property.
    */
-  virtual void OnTransitionOut( Actor actor );
-
-private: // From Control
+  static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
 
-  /**
-   * @copydoc CustomActorImpl::OnSizeSet( const Vector3& targetSize )
-   */
-  virtual void OnSizeSet( const Vector3& targetSize );
-
-  /**
-   * @copydoc Toolkit::Control::GetNaturalSize
-   */
-  virtual Vector3 GetNaturalSize();
+private: // From Button
 
   /**
-   * @copydoc Toolkit::Control::OnSetResizePolicy
+   * @copydoc Toolkit::Internal::Button::OnInitialize
    */
-  virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension );
+  virtual void OnInitialize();
 
 private:
 
   /**
-   * It adds the actor to the root actor and to the fade in animation.
-   * @param[inout] actor The actor.
-   * @param[in] opacity The opacity to fade to
-   */
-  void FadeImageTo( Actor actor, float opacity );
-
-  /**
-   * @brief Custom configuration for size negotiation
+   * @brief Sets the alignment mode to use to align the icon to the label.
+   *
+   * @param[in] iconAlignment The alignment mode to use
    */
-  void ConfigureSizeNegotiation();
+  void SetIconAlignment( const PushButton::IconAlignment iconAlignment );
 
   /**
-   * @brief Configure size negotiation for a given dimension
+   * @brief Gets the alignment mode used to align the icon to the label.
    *
-   * @param[in] dimension The dimension to configure
-   * @param[in] images The list of images to configure
-   * @param[in] label The text label to configure
+   * @return The alignment mode in use
    */
-  void ConfigureSizeNegotiationDimension( Dimension::Type dimension, const std::vector< Actor >& images, Actor& label );
+  const PushButton::IconAlignment GetIconAlignment() const;
 
 private:
 
@@ -178,7 +126,7 @@ private:
 
 private:
 
-  Vector3               mSize;                      ///< The button's size.
+  IconAlignment  mIconAlignment;                 ///< The alignment of the icon against the label.
 };
 
 } // namespace Internal
@@ -207,4 +155,4 @@ inline const Toolkit::Internal::PushButton& GetImplementation( const Toolkit::Pu
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H__
+#endif // DALI_TOOLKIT_INTERNAL_PUSH_BUTTON_H