Alpha function changes
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / scrollable / scroll-view / scroll-view.h
index 1dcfb85..e7b02f2 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_VIEW_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/animation/alpha-function.h>
+
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
 
@@ -33,6 +36,26 @@ class ScrollView;
 }
 
 /**
+ * @brief How axes/rotation or scale are clamped
+ */
+enum ClampState
+{
+  NotClamped,   ///< The quantity isn't clamped
+  ClampedToMin, ///< The quantity is clamped to the min value
+  ClampedToMax  ///< The quantity is clamped to the max value
+};
+
+/**
+ * @brief A 3 dimensional clamp
+ */
+struct ClampState3D
+{
+  ClampState x; ///< The clamp state of the x axis
+  ClampState y; ///< The clamp state of the y axis
+  ClampState z; ///< The clamp state of the z axis
+};
+
+/**
  * @brief The snap type
  */
 enum SnapType
@@ -386,22 +409,6 @@ class DALI_IMPORT_API ScrollView : public Scrollable
 {
 public:
 
-  // Custom properties
-
-  static const std::string SCROLL_PAGE_CURRENT;                         ///< Property, name "scroll-page-current",       type INT
-  static const std::string SCROLL_TIME_PROPERTY_NAME;                   ///< Property, name "scroll-time",               type FLOAT
-  static const std::string SCROLL_POSITION_PROPERTY_NAME;               ///< Property, name "scroll-position",           type VECTOR3
-  static const std::string SCROLL_PRE_POSITION_PROPERTY_NAME;           ///< Property, name "scroll-pre-position",       type VECTOR3
-  static const std::string SCROLL_OVERSHOOT_X_PROPERTY_NAME;            ///< Property, name "scroll-overshoot-x",         type float
-  static const std::string SCROLL_OVERSHOOT_Y_PROPERTY_NAME;            ///< Property, name "scroll-overshoot-y",         type float
-  static const std::string SCROLL_FINAL_PROPERTY_NAME;                  ///< Property, name "scroll-final",              type VECTOR3
-  static const std::string SCROLL_SCALE_PROPERTY_NAME;                  ///< Property, name "scroll-scale",              type VECTOR3
-  static const std::string SCROLL_WRAP_PROPERTY_NAME;                   ///< Property, name "scroll-wrap",               type BOOLEAN
-  static const std::string SCROLL_PANNING_PROPERTY_NAME;                ///< Property, name "scroll-panning",            type BOOLEAN
-  static const std::string SCROLL_SCROLLING_PROPERTY_NAME;              ///< Property, name "scroll-scrolling",          type BOOLEAN
-  static const std::string SCROLL_POSITION_DELTA_PROPERTY_NAME;         ///< Property, name "scroll-position-delta"      type VECTOR3
-  static const std::string SCROLL_START_PAGE_POSITION_PROPERTY_NAME;    ///< Property, name "scroll-start-page-position" type VECTOR3
-
   // Default settings
 
   static const float DEFAULT_SLOW_SNAP_ANIMATION_DURATION;              ///< Default Drag-Release animation time.
@@ -414,21 +421,18 @@ public:
   static const float DEFAULT_FLICK_SPEED_COEFFICIENT;                   ///< Default Flick speed coefficient (multiples input touch velocity)
   static const float DEFAULT_MAX_FLICK_SPEED;                           ///< Default Maximum flick speed. (in stage diagonals per second)
 
-  /// Direction of transitions
-  enum EDirectionFlag
+public:
+
+  /**
+   * @brief Clamp signal event's data
+   */
+  struct ClampEvent
   {
-    DirectionFlagLeft               = 0x01,
-    DirectionFlagRight              = 0x02,
-    DirectionFlagUp                 = 0x04,
-    DirectionFlagDown               = 0x08,
-    DirectionFlagTransitionOn       = 0x10,            ///< doesnt mean a page is moving towards centre, it affects whether the current page is using values for moving onto screen or off screen, if the user changes scroll direction we dont want things to flip over when in view
-    DirectionFlagTransitionOff      = 0x20,
-    DirectionFlagMask_Direction     = DirectionFlagLeft | DirectionFlagRight | DirectionFlagUp | DirectionFlagDown,
-    DirectionFlagMask_Transition    = DirectionFlagTransitionOn | DirectionFlagTransitionOff
+    ClampState3D scale;       ///< Clamp information for scale axes
+    ClampState3D position;    ///< Clamp information for position axes
+    ClampState   rotation;    ///< Clamp information for rotation
   };
 
-public:
-
   /**
    * @brief Snap signal event's data.
    */
@@ -439,6 +443,36 @@ public:
     float duration;   ///< Duration of snap animation.
   };
 
+  /**
+   * @brief The start and end property ranges for this control.
+   */
+  enum PropertyRange
+  {
+    ANIMATABLE_PROPERTY_START_INDEX = Toolkit::Scrollable::ANIMATABLE_PROPERTY_END_INDEX + 1,
+    ANIMATABLE_PROPERTY_END_INDEX   = ANIMATABLE_PROPERTY_START_INDEX + 1000                   ///< Reserve animatable property indices
+  };
+
+  /**
+   * @brief An enumeration of properties belonging to the ScrollView class.
+   */
+  struct Property
+  {
+    enum
+    {
+      SCROLL_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "scroll-position",       type Vector3
+      SCROLL_PRE_POSITION,                               ///< Property, name "scroll-pre-position",   type Vector3
+      OVERSHOOT_X,                                       ///< Property, name "overshoot-x",           type float
+      OVERSHOOT_Y,                                       ///< Property, name "overshoot-y",           type float
+      SCROLL_FINAL,                                      ///< Property, name "scroll-final",          type Vector3
+      WRAP,                                              ///< Property, name "wrap",                  type bool
+      PANNING,                                           ///< Property, name "panning",               type bool
+      SCROLLING,                                         ///< Property, name "scrolling",             type bool
+      SCROLL_DOMAIN_OFFSET,                              ///< Property, name "scroll-domain-offset"   type Vector3
+      SCROLL_POSITION_DELTA,                             ///< Property, name "scroll-position-delta"  type Vector3
+      START_PAGE_POSITION                                ///< Property, name "start-page-position"    type Vector3
+    };
+  };
+
   typedef Signal< void ( const SnapEvent& ) > SnapStartedSignalType; ///< SnapStarted signal type
 
   /**
@@ -623,24 +657,6 @@ public:
   void SetSnapOvershootDuration(float duration);
 
   /**
-   * @brief Sets Touches required for pan gestures.
-   *
-   * Panning requires number of touches to be within (minTouches) and
-   * (maxTouches).
-   *
-   * If (endOutside) is true, then outside this range of touches,
-   * the pan gesture will end and thus will snap.
-   *
-   * If (endOutside) is false, then outside this range of touches,
-   * the pan gesture will pause. but will not end until touches = 0.
-   *
-   * @param[in] minTouches Minimum touches for panning to occur.
-   * @param[out] maxTouches Maxiumum touches for panning to occur.
-   * @param[in] endOutside Whether to end the panning gesture outside of touch range
-   */
-  void SetTouchesRequiredForPanning(unsigned int minTouches = 1, unsigned int maxTouches = 1, bool endOutside = true);
-
-  /**
    * @brief Enables or Disables Actor Auto-Snap mode.
    *
    * When Actor Auto-Snap mode has been enabled, ScrollView will automatically