[AT-SPI] Synchronize with AT-SPI cleanup in dali-adaptor
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / scrollable / scrollable-impl.h
index 97b3107..44d9a33 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLLABLE_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLLABLE_H__
+#ifndef DALI_TOOLKIT_INTERNAL_SCROLLABLE_H
+#define DALI_TOOLKIT_INTERNAL_SCROLLABLE_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  *
  */
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/animation/alpha-function.h>
+
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
 namespace Internal
 {
-
 class Scrollable;
 typedef IntrusivePtr<Scrollable> ScrollablePtr;
 
@@ -40,7 +42,6 @@ typedef IntrusivePtr<Scrollable> ScrollablePtr;
 class Scrollable : public Control
 {
 public:
-
   /**
    * @copydoc Dali::Toolkit::Scrollable::IsOvershootEnabled
    */
@@ -52,12 +53,6 @@ public:
   void SetOvershootEnabled(bool enable);
 
   /**
-   * Gets the size of the domain (minimum/maximum extents for each axis to scroll to)
-   * @return the domain size
-   */
-  virtual Vector2 GetDomainSize() const = 0;
-
-  /**
    * Adds actor as an Overlay to Scrollable
    * This method is called by Add-on UI components
    * such as scroll bars, page indicators.
@@ -86,13 +81,13 @@ public:
    * @param[in] position The position to scroll to.
    * @param[in] duration The duration of the animation in seconds
    */
-  virtual void ScrollTo(const Vector2 &position, float duration) = 0;
+  virtual void ScrollTo(const Vector2position, float duration) = 0;
 
   /**
    * Set the color of the overshoot effect.
    * @parm[in] color The color of the overshoot effect
    */
-  virtual void SetOvershootEffectColor( const Vector4& color ) = 0;
+  virtual void SetOvershootEffectColor(const Vector4& color) = 0;
 
   /**
    * Retrieve the color of the overshoot effect.
@@ -103,7 +98,7 @@ public:
   /**
    * @copydoc Dali::Toolkit::Scrollable::SetOvershootAnimationSpeed(float pixelsPerSecond)
    */
-  void SetOvershootAnimationSpeed( float pixelsPerSecond );
+  void SetOvershootAnimationSpeed(float pixelsPerSecond);
 
   /**
    * @copydoc Dali::Toolkit::Scrollable::GetOvershootAnimationSpeed()
@@ -115,17 +110,36 @@ public:
    */
   const Vector2& GetOvershootSize() const;
 
-private:
+  /**
+   * Set the size of the overshoot effect.
+   * @parm[in] size The size of the overshoot effect
+   */
+  virtual void SetOvershootSize(const Vector2& size) = 0;
 
+protected: // From Control
+  struct AccessibleImpl : public DevelControl::ControlAccessible
+  {
+    using DevelControl::ControlAccessible::ControlAccessible;
+
+    bool IsScrollable() const override;
+  };
+
+  /**
+   * @copydoc Control::OnInitialize
+   */
+  virtual void OnInitialize() override;
+
+private:
   /**
    * Temporary function to override EnableScrollOvershoot functionality for overshoot
    * Only ScrollView needs to override this as HQ has not requested disable functionality in ItemView
    * @param[in] enable true to enable, false to disable overshoot indicator
    */
-  virtual void EnableScrollOvershoot(bool enable) {}
+  virtual void EnableScrollOvershoot(bool enable)
+  {
+  }
 
 public: //Signals
-
   /**
    * @copydoc Dali::Toolkit::Scrollable::ScrollStartedSignal()
    */
@@ -150,7 +164,7 @@ public: //Signals
    * @return True if the signal was connected.
    * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
    */
-  static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
+  static bool DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor);
 
   //properties
 
@@ -160,7 +174,7 @@ public: //Signals
    * @param[in] index The property index.
    * @param[in] value The new property value.
    */
-  static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value );
+  static void SetProperty(BaseObject* object, Property::Index index, const Property::Value& value);
 
   /**
    * Called to retrieve a property of an object of this type.
@@ -168,21 +182,20 @@ public: //Signals
    * @param[in] index The property index.
    * @return The current value of the property.
    */
-  static Property::Value GetProperty( BaseObject* object, Property::Index index );
+  static Property::Value GetProperty(BaseObject* object, Property::Index index);
 
 protected:
-
   /**
-   * Construct a new Scrollable.
+   * Removed default constructor.
    */
-  Scrollable();
+  Scrollable() = delete;
 
   /**
    * @brief Construct a new Scrollable.
    *
    * @param[in] behaviourFlags Flags to enable
    */
-  Scrollable( ControlBehaviour behaviourFlags );
+  Scrollable(ControlBehaviour behaviourFlags);
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
@@ -190,7 +203,6 @@ protected:
   virtual ~Scrollable();
 
 private:
-
   /**
    * Gets position property.
    *
@@ -199,7 +211,6 @@ private:
   Vector2 GetPropertyPosition() const;
 
 private:
-
   // Undefined
   Scrollable(const Scrollable&);
 
@@ -207,18 +218,18 @@ private:
   Scrollable& operator=(const Scrollable& rhs);
 
 protected:
+  Vector4 mOvershootEffectColor;    ///<The color of the overshoot bouncing effect
+  float   mOvershootAnimationSpeed; ///<The speed of the overshoot animation (pixels per second)
+  Vector2 mOvershootSize;           ///<The size of the overshoot effect
 
-  Vector4         mOvershootEffectColor;    ///<The color of the overshoot bouncing effect
-  float           mOvershootAnimationSpeed; ///<The speed of the overshoot animation (pixels per second)
-  Vector2         mOvershootSize;           ///<The size of the overshoot effect
+  Dali::AlphaFunction::BuiltinFunction mScrollToAlphaFunction; ///< The ScrollTo() animations use this
 
-  Toolkit::Scrollable::ScrollStartedSignalType mScrollStartedSignal;
-  Toolkit::Scrollable::ScrollUpdatedSignalType mScrollUpdatedSignal;
+  Toolkit::Scrollable::ScrollStartedSignalType   mScrollStartedSignal;
+  Toolkit::Scrollable::ScrollUpdatedSignalType   mScrollUpdatedSignal;
   Toolkit::Scrollable::ScrollCompletedSignalType mScrollCompletedSignal;
 
 private:
-
-  bool mOvershootEnabled:1;
+  bool mOvershootEnabled : 1;
 };
 
 } // namespace Internal
@@ -247,4 +258,4 @@ inline const Toolkit::Internal::Scrollable& GetImpl(const Toolkit::Scrollable& s
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLLABLE_H__
+#endif // DALI_TOOLKIT_INTERNAL_SCROLLABLE_H