Purge underscored header file barriers
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / push-button-impl.h
index 7a23474..d7e91d3 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.
@@ -19,8 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/animation/animation.h>
+#include <dali/public-api/common/vector-wrapper.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
@@ -62,141 +61,102 @@ 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();
+public:
 
-  /**
-   * @copydoc Toolkit::Internal::Button::OnSelectedImageSet()
-   */
-  virtual void OnSelectedImageSet();
+  // Properties
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnBackgroundImage()
+   * Enum for the alignment modes of the icon.
    */
-  virtual void OnBackgroundImageSet();
+  enum IconAlignment
+  {
+    LEFT,
+    RIGHT,
+    TOP,
+    BOTTOM,
+    DEFAULT = RIGHT
+  };
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnSelectedBackgroundImageSet()
+   * 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 OnSelectedBackgroundImageSet();
+  static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value );
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnDisabledImageSet()
+   * 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 OnDisabledImageSet();
+  static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnDisabledBackgroundImageSet()
+   * Deprecated API for Setting Pushbutton image using an Actor
+   * @param[in] image, Image Actor that has a url which can be used to create an image visual
    */
-  virtual void OnDisabledBackgroundImageSet();
+  void SetButtonImage( Actor image );
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnSelected()
+   * Deprecated API for Setting Pushbutton image using an Actor
+   * @param[in] image, Image Actor that has a url which can be used to create an image visual
    */
-  virtual bool OnSelected();
+  void SetBackgroundImage( Actor image );
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnDisabled()
+   * Deprecated API for Setting Pushbutton image using an Actor
+   * @param[in] image, Image Actor that has a url which can be used to create an image visual
    */
-  virtual bool OnDisabled();
+  void SetSelectedImage( Actor image );
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnPressed()
+   * Deprecated API for Setting Pushbutton image using an Actor
+   * @param[in] image, Image Actor that has a url which can be used to create an image visual
    */
-  virtual bool OnPressed();
+  void SetSelectedBackgroundImage( Actor image );
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnReleased()
+   * Deprecated API for Setting Pushbutton image using an Actor
+   * @param[in] image, Image Actor that has a url which can be used to create an image visual
    */
-  virtual bool OnReleased();
+  void SetDisabledBackgroundImage( Actor image );
 
   /**
-   * @copydoc Toolkit::Internal::Button::StopAllAnimations()
+   * Deprecated API for Setting Pushbutton image using an Actor
+   * @param[in] image, Image Actor that has a url which can be used to create an image visual
    */
-  virtual void StopAllAnimations();
-
-private: // From Control
+  void SetDisabledImage( Actor image );
 
   /**
-   * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& targetSize )
+   * Deprecated API for Setting Pushbutton image using an Actor
+   * @param[in] image, Image Actor that has a url which can be used to create an image visual
    */
-  virtual void OnControlSizeSet( const Vector3& targetSize );
+  void SetDisabledSelectedImage( Actor image );
 
-  /**
-   * @copydoc Toolkit::Control::GetNaturalSize
-   */
-  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:
 
   /**
-   * Starts the transition animation.
-   * PushButton::TransitionAnimationFinished slot is called when the animation finishes.
-   */
-  void StartTransitionAnimation();
-
-  /**
-   * Stops the transition animation.
-   * @param[in] remove If true, removes the fadeout actor from root.
-   */
-  void StopTransitionAnimation( bool remove = true );
-
-  /**
-   * It adds the actor to the root actor and to the fade in animation.
-   * @param[inout] image The actor.
-   * @param[in] opacity The initial opacity.
-   * @param[in] scale The initial scale.
-   */
-  void FadeInImage( Actor& image, float opacity = 0.f, Vector3 scale = Vector3( 1.f, 1.f, 1.f ) );
-
-  /**
-   * It adds the actor fade out animation and stores it to be removed when the animation finishes.
-   * @param[in] layer Defines if the actor is going to be stored in the mFadeOutBackgroundImage or mFadeOutCheckedImage member.
-   * @param[inout] image The actor.
-   * @param[in] opacity The initial opacity.
-   * @param[in] scale The initial scale.
-   */
-  void FadeOutImage( Actor& image, float opacity = 1.f, Vector3 scale = Vector3( 1.f, 1.f, 1.f ) );
-
-  /**
-   * @brief Custom configuration for size negotiation
-   */
-  void ConfigureSizeNegotiation();
-
-  /**
-   * @brief Configure size negotiation for a given dimension
+   * @brief Sets the alignment mode to use 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
+   * @param[in] iconAlignment The alignment mode to use
    */
-  void ConfigureSizeNegotiationDimension( Dimension::Type dimension, const ActorContainer& images, Actor& label );
-
-  // slots
+  void SetIconAlignment( const PushButton::IconAlignment iconAlignment );
 
   /**
-   * Called when the transition animation finishes.
+   * @brief Gets the alignment mode used to align the icon to the label.
+   *
+   * @return The alignment mode in use
    */
-  void TransitionAnimationFinished( Dali::Animation& source );
+  const PushButton::IconAlignment GetIconAlignment() const;
 
 private:
 
@@ -208,8 +168,7 @@ private:
 
 private:
 
-  Animation             mTransitionAnimation;       ///< Animation used in the state transitions.
-  Vector3               mSize;                      ///< The button's size.
+  IconAlignment  mIconAlignment;                 ///< The alignment of the icon against the label.
 };
 
 } // namespace Internal
@@ -238,4 +197,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