Seperate the API macros
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / scrollable / scroll-view / scroll-view.h
1 #ifndef __DALI_TOOLKIT_SCROLL_VIEW_H__
2 #define __DALI_TOOLKIT_SCROLL_VIEW_H__
3
4 /*
5  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/animation/alpha-function.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
26
27 namespace Dali
28 {
29
30 namespace Toolkit
31 {
32
33 namespace Internal DALI_INTERNAL
34 {
35 class ScrollView;
36 }
37 /**
38  * @addtogroup dali_toolkit_controls_scroll_view
39  * @{
40  */
41
42 /**
43  * @brief Enumeration for how axes/rotation or scale are clamped.
44  * @SINCE_1_0.0
45  */
46 enum ClampState
47 {
48   NotClamped,   ///< The quantity isn't clamped @SINCE_1_0.0
49   ClampedToMin, ///< The quantity is clamped to the min value @SINCE_1_0.0
50   ClampedToMax  ///< The quantity is clamped to the max value @SINCE_1_0.0
51 };
52
53 /**
54  * @brief A 2 dimensional clamp.
55  * @SINCE_1_0.0
56  */
57 struct ClampState2D
58 {
59   ClampState x; ///< The clamp state of the x axis
60   ClampState y; ///< The clamp state of the y axis
61 };
62
63 /**
64  * @brief Enumeration for the snap type.
65  * @SINCE_1_0.0
66  */
67 enum SnapType
68 {
69   Snap,  ///< Snap @SINCE_1_0.0
70   Flick  ///< Flick @SINCE_1_0.0
71 };
72
73 /**
74  * @brief Enumeration for DirectionBias types.
75  * @SINCE_1_0.0
76  */
77 enum DirectionBias
78 {
79   DirectionBiasLeft  = -1,  ///< Bias scroll snap to Left @SINCE_1_0.0
80   DirectionBiasNone  =  0,  ///< Don't bias scroll snap @SINCE_1_0.0
81   DirectionBiasRight =  1   ///< Bias scroll snap to Right @SINCE_1_0.0
82 };
83
84 /**
85  * @brief Used for specifying minimum/maximum extents of a ruler.
86  * @SINCE_1_0.0
87  */
88 class DALI_TOOLKIT_API RulerDomain
89 {
90 public:
91
92   /**
93    * @brief Creates Ruler domain allowing a point to traverse between min and max extents.
94    *
95    * @SINCE_1_0.0
96    * @param[in] min Minimum extent (point cannot traverse less than this)
97    * @param[in] max Maximum extent (point cannot traverse greater than this)
98    * @param[in] enabled Whether domain has been enabled or not
99    */
100   explicit RulerDomain(float min, float max, bool enabled = true);
101
102 public:
103
104   float min;    ///< Minimum extent (point cannot traverse less than this)
105   float max;    ///< Maximum extent (point cannot traverse greater than this)
106   bool enabled; ///< Whether domain has been enabled or not.
107
108   /**
109    * @brief Clamps value (x) from (min) to (max).
110    *
111    * An optional length parameter can be specified to suggest that the
112    * subject is not a point but a line to that should be clamped.
113    *
114    * @SINCE_1_0.0
115    * @param[in] x X point to be clamped between (min) and (max) extents
116    * @param[in] length (optional) The Length of the line from (x) to (x + length) to be clamped
117    * @param[in] scale Scaling parameter which treats domain as scaled in calculations
118    * @return The clamped value
119    */
120   float Clamp(float x, float length = 0.0f, float scale = 1.0f) const;
121
122   /**
123    * @brief Clamps value (x) from (min) to (max).
124    *
125    * An optional length parameter can be specified to suggest that the
126    * subject is not a point but a line to that should be clamped.
127    *
128    * @SINCE_1_0.0
129    * @param[in] x X point to be clamped between (min) and (max) extents
130    * @param[in] length (optional) The Length of the line from (x) to (x + length) to be clamped
131    * @param[in] scale Scaling parameter which treats domain as scaled in calculations
132    * @param[out] clamped Whether clamping occurred and which size (None, Min or Max)
133    * @return The clamped value
134    */
135   float Clamp(float x, float length, float scale, ClampState &clamped) const;
136
137   /**
138    * @brief Returns (max-min) size of ruler.
139    *
140    * @SINCE_1_0.0
141    * @return The size of the ruler from min to max
142    */
143   float GetSize() const;
144
145 };
146
147 // Forward declare future extension interface
148 class RulerExtension;
149
150 /**
151  * @brief Abstracts class to define scroll axes.
152  *
153  * It can specify whether they are traversable,
154  * where their snap points are and their domain.
155  * @SINCE_1_0.0
156  */
157 class DALI_TOOLKIT_API Ruler : public RefObject
158 {
159 public:
160   /**
161    * @brief Enumeration for the type of the ruler.
162    * @SINCE_1_0.0
163    */
164   enum RulerType {
165     Fixed,  ///< A fixed ruler @SINCE_1_0.0
166     Free    ///< A free ruler @SINCE_1_0.0
167   };
168
169 public:
170
171   /**
172    * @brief Constructs ruler, enabled by default, with limitless domain.
173    * @SINCE_1_0.0
174    */
175   Ruler();
176
177   /**
178    * @brief Snaps (x) in accordance to the ruler settings.
179    *
180    * @SINCE_1_0.0
181    * @param[in] x The input value on the ruler to be snapped
182    * @param[in] bias (optional) The biasing employed for snapping
183    * 0 floor input (floor x) "Used for Flick Left"
184    * 0.5 round input (floor x + 0.5) "Used for Release"
185    * 1 ceil input (floor x + 1.0) "Used for Flick Right"
186    * @return The position of the one dimensional point passed in once snapped.
187    */
188   virtual float Snap(float x, float bias = 0.5f) const = 0;
189
190   /**
191    * @brief Returns position from page, based on whatever the ruler
192    * defines as a page.
193    *
194    * If (wrap) is true, then will set volume to the number of
195    * times page has exceeded the domain's volume (volume being the
196    * number of pages within the domain), while wrapping the position
197    * within the domain.
198    *
199    * @SINCE_1_0.0
200    * @param[in] page The page index
201    * @param[out] volume The overflow volume when the page exceeds the domain (wrap must be enabled)
202    * @param[in] wrap Enable wrap mode
203    * @return The position representing this page point
204    */
205   virtual float GetPositionFromPage(unsigned int page, unsigned int &volume, bool wrap) const = 0;
206
207   /**
208    * @brief Returns page from position, based on whatever the ruler
209    * defines as a page.
210    *
211    * If (wrap) is true, then will return a page wrapped within the domain.
212    *
213    * @SINCE_1_0.0
214    * @param[in] position The position on the domain
215    * @param[in] wrap Enable wrap mode
216    * @return The page where this position resides
217    */
218   virtual unsigned int GetPageFromPosition(float position, bool wrap) const = 0;
219
220   /**
221    * @brief Returns the total number of pages within this Ruler.
222    *
223    * @SINCE_1_0.0
224    * @return The number of pages in the Ruler
225    */
226   virtual unsigned int GetTotalPages() const = 0;
227
228   /**
229    * @brief Gets the extension interface of the Ruler.
230    *
231    * @SINCE_1_0.0
232    * @return The extension interface of the Ruler
233    */
234   virtual RulerExtension* GetExtension() { return NULL; }
235
236 public:
237
238   /**
239    * @brief Gets the ruler type.
240    *
241    * @SINCE_1_0.0
242    * @return The ruler type
243    */
244   Ruler::RulerType GetType() const;
245
246   /**
247    * @brief Returns whether this axis has been enabled or not.
248    *
249    * @SINCE_1_0.0
250    * @return true if axis is enabled
251    */
252   bool IsEnabled() const;
253
254   /**
255    * @brief Enables ruler (ruler must be enabled in order to traverse along it).
256    * @SINCE_1_0.0
257    */
258   void Enable();
259
260   /**
261    * @brief Disables ruler.
262    * @SINCE_1_0.0
263    */
264   void Disable();
265
266   /**
267    * @brief Sets the Domain.
268    *
269    * @SINCE_1_0.0
270    * @param[in] domain Ruler domain object
271    */
272   void SetDomain(RulerDomain domain);
273
274   /**
275    * @brief Gets the Domain.
276    *
277    * @SINCE_1_0.0
278    * @return The domain
279    */
280   const RulerDomain &GetDomain() const;
281
282   /**
283    * @brief Disables Domain (minimum/maximum extents for this axis).
284    * @SINCE_1_0.0
285    */
286   void DisableDomain();
287
288   /**
289    * @brief Clamps value (x) from (min) to (max).
290    *
291    * An optional length parameter can be specified to suggest that the
292    * subject is not a point but a line that should be clamped.
293    *
294    * @SINCE_1_0.0
295    * @param[in] x X point to be clamped between (min) and (max) extents
296    * @param[in] length (optional) The Length of the line from (x) to (x + length) to be clamped
297    * @param[in] scale Scaling parameter which treats domain as scaled in calculations
298    * @return The clamped value
299    */
300   float Clamp(float x, float length = 0.0f, float scale = 1.0f) const;
301
302
303   /**
304    * @brief Clamps value (x) from (min) to (max).
305    *
306    * An optional length parameter can be specified to suggest that the
307    * subject is not a point but a line to that should be clamped.
308    *
309    * @SINCE_1_0.0
310    * @param[in] x X point to be clamped between (min) and (max) extents
311    * @param[in] length (optional) The Length of the line from (x) to (x + length) to be clamped
312    * @param[in] scale Scaling parameter which treats domain as scaled in calculations
313    * @param[out] clamped Whether clamping occurred and which size (None, Min or Max)
314    * @return The clamped value
315    */
316   float Clamp(float x, float length, float scale, ClampState &clamped) const;
317
318   /**
319    * @brief Snaps and Clamps (x) in accordance to ruler settings.
320    *
321    * @SINCE_1_0.0
322    * @param[in] x X value to be snapped in accordance to ruler snap value,
323    *            and clamped in accordance to the ruler's domain (if set)
324    * @param[in] bias (optional) The biasing employed for snapping
325    *            0 floor input (floor x) "Used for Flick Left"
326    *            0.5 round input (floor x + 0.5) "Used for Release"
327    *            1 ceil input (floor x + 1.0) "Used for Flick Right"
328    * @param[in] length (optional) The Length of the line from (x) to (x + length)
329    *            to be clamped
330    * @param[in] scale Scaling parameter which treats domain as scaled in calculations
331    * @return The clamped value after snapping
332    */
333   float SnapAndClamp(float x, float bias = 0.5f, float length = 0.0f, float scale = 1.0f) const;
334
335   /**
336    * @brief Snaps and Clamps (x) in accordance to ruler settings.
337    *
338    * @SINCE_1_0.0
339    * @param[in] x X value to be snapped in accordance to ruler snap value,
340    *            and clamped in accordance to the ruler's domain (if set)
341    * @param[in] bias (optional) The biasing employed for snapping
342    * 0 floor input (floor x) "Used for Flick Left"
343    * 0.5 round input (floor x + 0.5) "Used for Release"
344    * 1 ceil input (floor x + 1.0) "Used for Flick Right"
345    * @param[in] length (optional) The Length of the line from (x) to (x + length)
346    * to be clamped
347    * @param[in] scale Scaling parameter which treats domain as scaled in calculations
348    * @param[out] clamped Whether clamping occurred and which size (None, Min or Max)
349    * @return The clamped value after snapping
350    */
351   float SnapAndClamp(float x, float bias, float length, float scale, ClampState &clamped) const;
352
353 protected:
354
355   /**
356    * @brief Destructor - A reference counted object may only be deleted by calling Unreference().
357    * @SINCE_1_0.0
358    */
359   virtual ~Ruler();
360
361 protected:
362
363   RulerType mType;               ///< Type of Ruler (Fixed or Free).
364   bool mEnabled;                 ///< If the ruler is enabled.
365   RulerDomain mDomain;           ///< The domain of the ruler.
366
367 };
368
369 typedef IntrusivePtr<Ruler> RulerPtr; ///< Pointer to Dali::Toolkit::Ruler object @SINCE_1_0.0
370
371 /**
372  * @brief Concrete implementation of Ruler that has no snapping and has one single page.
373  * @SINCE_1_0.0
374  */
375 class DALI_TOOLKIT_API DefaultRuler : public Ruler
376 {
377 public:
378   /**
379    * @brief DefaultRuler constructor.
380    * @SINCE_1_0.0
381    */
382   DefaultRuler();
383
384   /**
385    * @copydoc Toolkit::Ruler::Snap
386    */
387   virtual float Snap(float x, float bias) const;
388
389   /**
390    * @copydoc Toolkit::Ruler::GetPositionFromPage
391    */
392   virtual float GetPositionFromPage(unsigned int page, unsigned int &volume, bool wrap) const;
393
394   /**
395    * @copydoc Toolkit::Ruler::GetPageFromPosition
396    */
397   virtual unsigned int GetPageFromPosition(float position, bool wrap) const;
398
399   /**
400    * @copydoc Toolkit::Ruler::GetTotalPages
401    */
402   virtual unsigned int GetTotalPages() const;
403 };
404
405 /**
406  * @brief Concrete implementation of Ruler that has fixed snapping.
407  * @SINCE_1_0.0
408  */
409 class DALI_TOOLKIT_API FixedRuler : public Ruler
410 {
411 public:
412   /**
413    * @brief Constructor.
414    *
415    * @SINCE_1_0.0
416    * @param[in] spacing The spacing between each interval on this ruler
417    */
418   FixedRuler(float spacing = 1.0f);
419
420   /**
421    * @copydoc Toolkit::Ruler::Snap
422    */
423   virtual float Snap(float x, float bias) const;
424
425   /**
426    * @copydoc Toolkit::Ruler::GetPositionFromPage
427    */
428   virtual float GetPositionFromPage(unsigned int page, unsigned int &volume, bool wrap) const;
429
430   /**
431    * @copydoc Toolkit::Ruler::GetPageFromPosition
432    */
433   virtual unsigned int GetPageFromPosition(float position, bool wrap) const;
434
435   /**
436    * @copydoc Toolkit::Ruler::GetTotalPages
437    */
438   virtual unsigned int GetTotalPages() const;
439
440 private:
441   float mSpacing; ///< The spacing between each interval
442 };
443
444 class ScrollViewEffect;
445 class ScrollView;
446
447 /**
448  * @brief ScrollView contains actors that can be scrolled manually (via touch)
449  * or automatically.
450  *
451  * Signals
452  * | %Signal Name      | Method                     |
453  * |-------------------|----------------------------|
454  * | snap-started      | @ref SnapStartedSignal()   |
455  * @SINCE_1_0.0
456  */
457 class DALI_TOOLKIT_API ScrollView : public Scrollable
458 {
459
460 public:
461
462   /**
463    * @brief Clamps signal event's data.
464    * @SINCE_1_0.0
465    */
466   struct ClampEvent
467   {
468     ClampState2D scale;       ///< Clamp information for scale axes
469     ClampState2D position;    ///< Clamp information for position axes
470     ClampState   rotation;    ///< Clamp information for rotation
471   };
472
473   /**
474    * @brief Snaps signal event's data.
475    * @SINCE_1_0.0
476    */
477   struct SnapEvent
478   {
479     SnapType type;    ///< Current snap commencing
480     Vector2 position; ///< Target snap position
481     float duration;   ///< Duration of snap animation.
482   };
483
484   /**
485    * @brief Enumeration for the start and end property ranges for this control.
486    * @SINCE_1_0.0
487    */
488   enum PropertyRange
489   {
490     PROPERTY_START_INDEX = Toolkit::Scrollable::PROPERTY_END_INDEX + 1,                        ///< @SINCE_1_1.18
491     PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000,                                        ///< Reserve property indices, @SINCE_1_1.18
492
493     ANIMATABLE_PROPERTY_START_INDEX = Toolkit::Scrollable::ANIMATABLE_PROPERTY_END_INDEX + 1,
494     ANIMATABLE_PROPERTY_END_INDEX   = ANIMATABLE_PROPERTY_START_INDEX + 1000                   ///< Reserve animatable property indices @SINCE_1_0.0
495   };
496
497   /**
498    * @brief Enumeration for the instance of properties belonging to the ScrollView class.
499    * @SINCE_1_0.0
500    */
501   struct Property
502   {
503     /**
504      * @brief Enumeration for the instance of properties belonging to the ScrollView class.
505      * @SINCE_1_0.0
506      */
507     enum
508     {
509       ///////////////////////////////////////////////////////////////////////////////
510       // Event side (non-animatable) properties
511       ///////////////////////////////////////////////////////////////////////////////
512
513       /**
514        * @brief Whether wrapping is enabled.
515        * @details Name "wrapEnabled", type Property::BOOLEAN.
516        * @SINCE_1_1.18
517        * @see SetWrapMode()
518        */
519       WRAP_ENABLED = PROPERTY_START_INDEX,
520
521       /**
522        * @brief Whether panning is enabled.
523        * @details Name "panningEnabled", type Property::BOOLEAN.
524        * @SINCE_1_1.18
525        * @see SetScrollSensitive()
526        */
527       PANNING_ENABLED,
528
529       /**
530        * @brief Whether the Axis Auto Lock mode for panning within the ScrollView is enabled.
531        * @details Name "axisAutoLockEnabled", type Property::BOOLEAN.
532        * @SINCE_1_1.18
533        * @see SetAxisAutoLock()
534        */
535       AXIS_AUTO_LOCK_ENABLED,
536
537       /**
538        * @brief The step of scroll distance in actor coordinates for each wheel event received in free panning mode.
539        * @details Name "wheelScrollDistanceStep", type Property::VECTOR2.
540        * @SINCE_1_1.18
541        * @see SetWheelScrollDistanceStep()
542        */
543       WHEEL_SCROLL_DISTANCE_STEP,
544
545       /**
546        * @brief The scroll mode.
547        * @details Name "scrollMode", type Property::MAP.
548        * The scroll mode map is a frontend for the Ruler helper class, containing the following keys:
549        *
550        * | %Property Name       | Type     | Required | Description                                                                                                                           |
551        * |----------------------|----------|----------|---------------------------------------------------------------------------------------------------------------------------------------|
552        * | xAxisScrollEnabled   | BOOLEAN  | No       | True if the content can be scrolled in X axis or false if not.                                                                        |
553        * | xAxisSnapToInterval  | FLOAT    | No       | When set, causes scroll view to snap to multiples of the value of the interval in the X axis while flicking. (by default no snapping) |
554        * | xAxisScrollBoundary  | FLOAT    | No       | When set, causes scroll view unable to scroll beyond the value of the boundary in the X axis (by default no boundary)                 |
555        * | yAxisScrollEnabled   | BOOLEAN  | No       | True if the content can be scrolled in Y axis or false if not.                                                                        |
556        * | yAxisSnapToInterval  | FLOAT    | No       | When set, causes scroll view to snap to multiples of the value of the interval in the Y axis while flicking. (by default no snapping) |
557        * | yAxisScrollBoundary  | FLOAT    | No       | When set, causes scroll view unable to scroll beyond the value of the boundary in the Y axis (by default no boundary)                 |
558        *
559        * Alternatively, one can use the keys defined in the Dali::Toolkit::ScrollMode::Type enumeration.
560        * @SINCE_1_2.60
561        */
562       SCROLL_MODE,
563
564       ///////////////////////////////////////////////////////////////////////////////
565       // Animatable Properties
566       ///////////////////////////////////////////////////////////////////////////////
567
568       /**
569        * @brief The current scroll position.
570        * @details Name "scrollPosition", type Property::VECTOR2.
571        * @SINCE_1_0.0
572        */
573       SCROLL_POSITION = ANIMATABLE_PROPERTY_START_INDEX,
574
575       /**
576        * @brief The position before we set the clamp at scroll boundaries.
577        * @details Name "scrollPrePosition", type Property::VECTOR2.
578        * @SINCE_1_0.0
579        */
580       SCROLL_PRE_POSITION,
581
582       /**
583        * @brief The X component of SCROLL_PRE_POSITION.
584        * @details Name "scrollPrePositionX", type Property::FLOAT.
585        * @SINCE_1_0.0
586        */
587       SCROLL_PRE_POSITION_X,
588
589       /**
590        * @brief The Y component of SCROLL_PRE_POSITION.
591        * @details Name "scrollPrePositionY", type Property::VECTOR2.
592        * @SINCE_1_0.0
593        */
594       SCROLL_PRE_POSITION_Y,
595
596       /**
597        * @brief The maximum value that SCROLL_PRE_POSITION can be.
598        * @details Name "scrollPrePositionMax", type Property::VECTOR2.
599        * @SINCE_1_0.0
600        */
601       SCROLL_PRE_POSITION_MAX,
602
603       /**
604        * @brief The X component of SCROLL_PRE_POSITION_MAX.
605        * @details Name "scrollPrePositionMaxX", type Property::FLOAT.
606        * @SINCE_1_0.0
607        */
608       SCROLL_PRE_POSITION_MAX_X,
609
610       /**
611        * @brief The Y component of SCROLL_PRE_POSITION_MAX.
612        * @details Name "scrollPrePositionMaxY", type Property::FLOAT.
613        * @SINCE_1_0.0
614        */
615       SCROLL_PRE_POSITION_MAX_Y,
616
617       /**
618        * @brief The amount that we can scroll beyond the boundary along the X axis.
619        * @details Name "overshootX", type Property::FLOAT.
620        * @SINCE_1_0.0
621        */
622       OVERSHOOT_X,
623
624       /**
625        * @brief The amount that we can scroll beyond the boundary along the Y axis.
626        * @details Name "overshootY", type Property::FLOAT.
627        * @SINCE_1_0.0
628        */
629       OVERSHOOT_Y,
630
631       /**
632        * @brief The position after the overshoot value has been considered in the calculation.
633        * @details Name "scrollFinal", type Property::VECTOR2.
634        * @SINCE_1_0.0
635        */
636       SCROLL_FINAL,
637
638       /**
639        * @brief The X component of SCROLL_FINAL.
640        * @details Name "scrollFinalX", type Property::FLOAT.
641        * @SINCE_1_0.0
642        */
643       SCROLL_FINAL_X,
644
645       /**
646        * @brief The Y component of SCROLL_FINAL.
647        * @details Name "scrollFinalY", type Property::FLOAT.
648        * @SINCE_1_0.0
649        */
650       SCROLL_FINAL_Y,
651
652       /**
653        * @brief Whether scrolling wraps.
654        * @details Name "wrap", type Property::BOOLEAN.
655        * @SINCE_1_0.0
656        */
657       WRAP,
658
659       /**
660        * @brief Whether we are currently panning.
661        * @details Name "panning", type Property::BOOLEAN.
662        * @SINCE_1_0.0
663        */
664       PANNING,
665
666       /**
667        * @brief Whether we are currently scrolling.
668        * @details Name "scrolling", type Property::BOOLEAN.
669        * @SINCE_1_0.0
670        */
671       SCROLLING,
672
673       /**
674        * @brief The size of the scrolling domain.
675        * @details Name "scrollDomainSize", type Property::VECTOR2.
676        * @SINCE_1_0.0
677        */
678       SCROLL_DOMAIN_SIZE,
679
680       /**
681        * @brief The X component of SCROLL_DOMAIN_SIZE.
682        * @details Name "scrollDomainSizeX", type Property::FLOAT.
683        * @SINCE_1_0.0
684        */
685       SCROLL_DOMAIN_SIZE_X,
686
687       /**
688        * @brief The Y component of SCROLL_DOMAIN_SIZE.
689        * @details Name "scrollDomainSizeY", type Property::FLOAT.
690        * @SINCE_1_0.0
691        */
692       SCROLL_DOMAIN_SIZE_Y,
693
694       /**
695        * @brief The offset of the scroll domain.
696        * @details Name "scrollDomainOffset", type Property::VECTOR2.
697        * @SINCE_1_0.0
698        */
699       SCROLL_DOMAIN_OFFSET,
700
701       /**
702        * @brief The delta in the position when scrolling.
703        * @details Name "scrollPositionDelta", type Property::VECTOR2.
704        * @SINCE_1_0.0
705        */
706       SCROLL_POSITION_DELTA,
707
708       /**
709        * @brief The starting page position.
710        * @details Name "startPagePosition", type Property::VECTOR3.
711        * @SINCE_1_0.0
712        */
713       START_PAGE_POSITION,
714     };
715   };
716
717   // Typedefs
718
719   typedef Signal< void ( const SnapEvent& ) > SnapStartedSignalType; ///< SnapStarted signal type @SINCE_1_0.0
720
721 public:
722
723   /**
724    * @brief Creates an empty ScrollView handle.
725    * @SINCE_1_0.0
726    */
727   ScrollView();
728
729   /**
730    * @brief Copy constructor.
731    *
732    * Creates another handle that points to the same real object.
733    *
734    * @SINCE_1_0.0
735    * @param[in] handle Handle to copy from
736    */
737   ScrollView( const ScrollView& handle );
738
739   /**
740    * @brief Assignment operator.
741    *
742    * Changes this handle to point to another real object.
743    * @SINCE_1_0.0
744    * @param[in] handle The handle to copy from
745    * @return A reference to this
746    */
747   ScrollView& operator=( const ScrollView& handle );
748
749   /**
750    * @brief Destructor.
751    *
752    * This is non-virtual since derived Handle types must not contain data or virtual methods.
753    * @SINCE_1_0.0
754    */
755   ~ScrollView();
756
757   /**
758    * @brief Creates an initialized ScrollView.
759    *
760    * @SINCE_1_0.0
761    * @return A handle to a newly allocated Dali resource
762    */
763   static ScrollView New();
764
765   /**
766    * @brief Downcasts a handle to ScrollView handle.
767    *
768    * If handle points to a ScrollView, the downcast produces valid handle.
769    * If not, the returned handle is left uninitialized.
770    *
771    * @SINCE_1_0.0
772    * @param[in] handle Handle to an object
773    * @return A handle to a ScrollView or an uninitialized handle
774    */
775   static ScrollView DownCast( BaseHandle handle );
776
777 public:
778
779   /**
780    * @brief Gets snap-animation's AlphaFunction.
781    *
782    * @SINCE_1_0.0
783    * @return Current easing alpha function of the snap animation
784    */
785   AlphaFunction GetScrollSnapAlphaFunction() const;
786
787   /**
788    * @brief Sets snap-animation's AlphaFunction.
789    *
790    * @SINCE_1_0.0
791    * @param[in] alpha Easing alpha function of the snap animation
792    */
793   void SetScrollSnapAlphaFunction(AlphaFunction alpha);
794
795   /**
796    * @brief Gets flick-animation's AlphaFunction.
797    *
798    * @SINCE_1_0.0
799    * @return Current easing alpha function of the flick animation
800    */
801   AlphaFunction GetScrollFlickAlphaFunction() const;
802
803   /**
804    * @brief Sets flick-animation's AlphaFunction.
805    *
806    * @SINCE_1_0.0
807    * @param[in] alpha Easing alpha function of the flick animation
808    */
809   void SetScrollFlickAlphaFunction(AlphaFunction alpha);
810
811   /**
812    * @brief Gets the time for the scroll snap-animation.
813    *
814    * This animation occurs when the user drags, and releases.
815    *
816    * @SINCE_1_0.0
817    * @return The time in seconds for the animation to take
818    */
819   float GetScrollSnapDuration() const;
820
821   /**
822    * @brief Sets the time for the scroll snap-animation.
823    *
824    * This animation occurs when the user drags, and releases.
825    *
826    * @SINCE_1_0.0
827    * @param[in] time The time in seconds for the animation to take
828    */
829   void SetScrollSnapDuration(float time);
830
831   /**
832    * @brief Gets the time for the scroll flick-animation.
833    *
834    * This animation occurs when the user flicks scroll view.
835    *
836    * @SINCE_1_0.0
837    * @return The time in seconds for the animation to take
838    */
839   float GetScrollFlickDuration() const;
840
841   /**
842    * @brief Sets the time for the scroll flick-animation.
843    *
844    * This animation occurs when the user flicks scroll view.
845    *
846    * @SINCE_1_0.0
847    * @param[in] time The time in seconds for the animation to take
848    */
849   void SetScrollFlickDuration(float time);
850
851   /**
852    * @brief Sets X axis ruler.
853    *
854    * Defines how scrolling horizontally is snapped, and
855    * the boundary (domain) in which the ScrollView can pan.
856    *
857    * @SINCE_1_0.0
858    * @param[in] ruler The ruler to be used for the X axis
859    */
860   void SetRulerX(RulerPtr ruler);
861
862   /**
863    * @brief Sets Y axis ruler.
864    *
865    * Defines how scrolling vertically is snapped, and the boundary
866    * (domain) in which the ScrollView can pan.
867    *
868    * @SINCE_1_0.0
869    * @param[in] ruler The ruler to be used for the Y axis
870    */
871   void SetRulerY(RulerPtr ruler);
872
873   /**
874    * @brief Sets scroll sensitivity of pan gesture.
875    *
876    * @SINCE_1_0.0
877    * @param[in] sensitive @c true to enable scroll, @c false to disable scrolling
878    * @note Unlike Actor::SetSensitive(), this determines whether this ScrollView
879    * should react (e.g. pan), without disrupting the sensitivity of its children.
880    *
881    */
882   void SetScrollSensitive(bool sensitive);
883
884   /**
885    * @brief Sets maximum overshoot amount.
886    *
887    * The final overshoot value is within 0.0f to 1.0f, but the maximum
888    * overshoot is in pixels (e.g. if you scroll 75 pixels beyond the
889    * edge of a scrollable area and the maximum overshoot is 100 then
890    * the final overshoot value will be 0.75f).
891    *
892    * @SINCE_1_0.0
893    * @param[in] overshootX The maximum number of horizontally scrolled pixels before overshoot X reaches 1.0f
894    * @param[in] overshootY The maximum number of vertically scrolled pixels before overshoot Y reaches 1.0f
895    */
896   void SetMaxOvershoot(float overshootX, float overshootY);
897
898   /**
899    * @brief Sets Snap Overshoot animation's AlphaFunction.
900    *
901    * @SINCE_1_0.0
902    * @param[in] alpha Easing alpha function of the overshoot snap animation
903    */
904   void SetSnapOvershootAlphaFunction(AlphaFunction alpha);
905
906   /**
907    * @brief Sets Snap Overshoot animation's Duration.
908    *
909    * @SINCE_1_0.0
910    * @param[in] duration The duration of the overshoot snap animation
911    * @note Set duration to 0 seconds to disable Animation.
912    *
913    */
914   void SetSnapOvershootDuration(float duration);
915
916   /**
917    * @brief Enables or Disables Actor Auto-Snap mode.
918    *
919    * When Actor Auto-Snap mode has been enabled, ScrollView will automatically
920    * snap to the closest actor (The closest actor will appear in the center of
921    * the ScrollView).
922    *
923    * @SINCE_1_0.0
924    * @param[in] enable Enables (true), or disables (false) Actor AutoSnap
925    */
926   void SetActorAutoSnap(bool enable);
927
928   /**
929    * @brief Enables or Disables Wrap mode for ScrollView contents.
930    *
931    * When enabled, the ScrollView contents are wrapped over the X/Y Domain.
932    *
933    * @SINCE_1_0.0
934    * @param[in] enable Enables (true), or disables (false) Wrap Mode
935    * @note You must apply a position constraint that causes Wrapping
936    * to all children.
937    *
938    */
939   void SetWrapMode(bool enable);
940
941   /**
942    * @brief Gets the current distance needed to scroll for ScrollUpdatedSignal to be emitted.
943    *
944    * @SINCE_1_0.0
945    * @return Current scroll update distance
946    */
947   int GetScrollUpdateDistance() const;
948
949   /**
950    * @brief Sets the distance needed to scroll for ScrollUpdatedSignal to be emitted.
951    *
952    * The scroll update distance tells ScrollView how far to move before ScrollUpdatedSignal the informs application.
953    * Each time the ScrollView crosses this distance the signal will be emitted.
954    *
955    * @SINCE_1_0.0
956    * @param[in] distance The distance for ScrollView to move before emitting update signal
957    */
958   void SetScrollUpdateDistance(int distance);
959
960   /**
961    * @brief Returns state of Axis Auto Lock mode.
962    *
963    * @SINCE_1_0.0
964    * @return Whether Axis Auto Lock mode has been enabled or not
965    */
966   bool GetAxisAutoLock() const;
967
968   /**
969    * @brief Enables or Disables Axis Auto Lock mode for panning within the ScrollView.
970    *
971    * When enabled, any pan gesture that appears mostly horizontal or mostly
972    * vertical, will be automatically restricted to horizontal only or vertical
973    * only panning, until the pan gesture has completed.
974    *
975    * @SINCE_1_0.0
976    * @param[in] enable Enables (true), or disables (false) AxisAutoLock mode
977    */
978   void SetAxisAutoLock(bool enable);
979
980   /**
981    * @brief Gets the gradient threshold at which a panning gesture
982    * should be locked to the Horizontal or Vertical axis.
983    *
984    * @SINCE_1_0.0
985    * @return The gradient, a value between 0.0 and 1.0f
986    */
987   float GetAxisAutoLockGradient() const;
988
989   /**
990    * @brief Sets the gradient threshold at which a panning gesture should be locked to the
991    * Horizontal or Vertical axis.
992    *
993    * By default, this is 0.36 (0.36:1) which means angles less than 20
994    * degrees to an axis will lock to that axis.
995    *
996    * @SINCE_1_0.0
997    * @param[in] gradient A value between 0.0 and 1.0 (auto-lock for all angles)
998    * @note Specifying a value of 1.0 (the maximum value accepted) indicates that
999    * all panning gestures will auto-lock either to the horizontal or vertical axis.
1000    *
1001    */
1002   void SetAxisAutoLockGradient(float gradient);
1003
1004   /**
1005    * @brief Gets the friction coefficient setting for ScrollView when
1006    * flicking in free panning mode.
1007    *
1008    * This is a value in stage-diagonals per second^2.
1009    * stage-diagonal = Length( stage.width, stage.height )
1010    * @SINCE_1_0.0
1011    * @return Friction coefficient is returned
1012    */
1013   float GetFrictionCoefficient() const;
1014
1015   /**
1016    * @brief Sets the friction coefficient for ScrollView when flicking
1017    * in free panning mode.
1018    *
1019    * This is a value in stage-diagonals per second^2.
1020    * stage-diagonal = Length( stage.width, stage.height ).
1021    * example:
1022    * A stage 480x800 in size has a diagonal length of 933.
1023    * Friction coefficient of 1.0 means the swipe velocity will
1024    * reduce by 1.0 * 933 pixels/sec^2.
1025    * @SINCE_1_0.0
1026    * @param[in] friction Friction coefficient must be greater than 0.0 (default = 1.0)
1027    */
1028   void SetFrictionCoefficient(float friction);
1029
1030   /**
1031    * @brief Gets the flick speed coefficient for ScrollView when
1032    * flicking in free panning mode.
1033    *
1034    * This is a constant which multiplies the input touch
1035    * flick velocity to determine the actual velocity at
1036    * which to move the scrolling area.
1037    * @SINCE_1_0.0
1038    * @return The flick speed coefficient is returned
1039    */
1040   float GetFlickSpeedCoefficient() const;
1041
1042   /**
1043    * @brief Sets the flick speed coefficient for ScrollView when
1044    * flicking in free panning mode.
1045    *
1046    * This is a constant which multiplies the input touch
1047    * flick velocity to determine the actual velocity at
1048    * which to move the scrolling area.
1049    * @SINCE_1_0.0
1050    * @param[in] speed The flick speed coefficient (default = 1.0)
1051    */
1052   void SetFlickSpeedCoefficient(float speed);
1053
1054   /**
1055    * @brief Returns the minimum pan distance required for a flick gesture in pixels.
1056    *
1057    * @SINCE_1_0.0
1058    * @return Minimum pan distance vector with separate x and y distance
1059    */
1060   Vector2 GetMinimumDistanceForFlick() const;
1061
1062   /**
1063    * @brief Sets the minimum pan distance required for a flick in pixels.
1064    *
1065    * Takes a Vector2 containing separate x and y values. As long as the pan distance exceeds one of these axes, a flick will be allowed.
1066    *
1067    * @SINCE_1_0.0
1068    * @param[in] distance The minimum pan distance for a flick
1069    */
1070   void SetMinimumDistanceForFlick( const Vector2& distance );
1071
1072   /**
1073    * @brief Returns the minimum pan speed required for a flick gesture in pixels per second.
1074    *
1075    * @SINCE_1_0.0
1076    * @return Minimum pan speed
1077    */
1078   float GetMinimumSpeedForFlick() const;
1079
1080   /**
1081    * @brief Sets the minimum pan speed required for a flick in pixels per second.
1082    *
1083    * @SINCE_1_0.0
1084    * @param[in] speed The minimum pan speed for a flick
1085    */
1086   void SetMinimumSpeedForFlick( float speed );
1087
1088   /**
1089    * @brief Gets the maximum flick speed setting for ScrollView when
1090    * flicking in free panning mode.
1091    *
1092    * This is a value in stage-diagonals per second.
1093    * stage-diagonal = Length( stage.width, stage.height )
1094    * @SINCE_1_0.0
1095    * @return Maximum flick speed is returned
1096    */
1097   float GetMaxFlickSpeed() const;
1098
1099   /**
1100    * @brief Sets the maximum flick speed for the ScrollView when
1101    * flicking in free panning mode.
1102    *
1103    * This is a value in stage-diagonals per second.
1104    * stage-diagonal = Length( stage.width, stage.height )
1105    * example:
1106    * A stage 480x800 in size has a diagonal length of 933.
1107    * Max Flick speed of 1.0 means the maximum velocity of
1108    * a swipe can be 1.0 * 933 pixels/sec.
1109    * @SINCE_1_0.0
1110    * @param[in] speed Maximum flick speed (default = 3.0)
1111    */
1112   void SetMaxFlickSpeed(float speed);
1113
1114   /**
1115    * @brief Gets the step of scroll distance in actor coordinates for
1116    * each wheel event received in free panning mode.
1117    *
1118    * @SINCE_1_0.0
1119    * @return The step of scroll distance(pixel) in X and Y axes
1120    */
1121   Vector2 GetWheelScrollDistanceStep() const;
1122
1123   /**
1124    * @brief Sets the step of scroll distance in actor coordinates for
1125    * each wheel event received in free panning mode.
1126    *
1127    * @SINCE_1_0.0
1128    * @param[in] step The step of scroll distance(pixel) in X and Y axes
1129    *
1130    * @note If snap points are defined in the rulers, it will always
1131    * scroll to the next snap point towards the scroll direction while
1132    * receiving the wheel events.
1133    *
1134    */
1135   void SetWheelScrollDistanceStep(Vector2 step);
1136
1137   /**
1138    * @brief Retrieves current scroll position.
1139    *
1140    * @SINCE_1_0.0
1141    * @return The current scroll position
1142    */
1143   Vector2 GetCurrentScrollPosition() const;
1144
1145   /**
1146    * @brief Retrieves current scroll page based on ScrollView
1147    * dimensions being the size of one page, and all pages laid out in
1148    * a grid fashion, increasing from left to right until the end of
1149    * the X-domain.
1150    *
1151    * @SINCE_1_0.0
1152    * @note Pages start from 0 as the first page, not 1.
1153    *
1154    * @return The Current page
1155    */
1156   unsigned int GetCurrentPage() const;
1157
1158   /**
1159    * @brief Scrolls View to position specified (contents will scroll to this position).
1160    *
1161    * Position 0,0 is the origin. Increasing X scrolls contents left, while
1162    * increasing Y scrolls contents up.
1163    * - If Rulers have been applied to the axes, then the contents will scroll until
1164    * reaching the domain boundary.
1165    * @SINCE_1_0.0
1166    * @param[in] position The position to scroll to
1167    * @note Contents will not snap to ruler snap points.
1168    *
1169    */
1170   void ScrollTo(const Vector2& position);
1171
1172   /**
1173    * @brief Scrolls View to position specified (contents will scroll to this position).
1174    *
1175    * Position 0,0 is the origin. Increasing X scrolls contents left, while
1176    * increasing Y scrolls contents up.
1177    * - If Rulers have been applied to the axes, then the contents will scroll until
1178    * reaching the domain boundary.
1179    * @SINCE_1_0.0
1180    * @param[in] position The position to scroll to
1181    * @param[in] duration The duration of the animation in seconds
1182    * @note Contents will not snap to ruler snap points.
1183    *
1184    */
1185   void ScrollTo(const Vector2& position, float duration);
1186
1187   /**
1188    * @brief Scrolls View to position specified (contents will scroll to this position).
1189    *
1190    * Position 0,0 is the origin. Increasing X scrolls contents left, while
1191    * increasing Y scrolls contents up.
1192    * - If Rulers have been applied to the axes, then the contents will scroll until
1193    * reaching the domain boundary.
1194    * @SINCE_1_0.0
1195    * @param[in] position The position to scroll to
1196    * @param[in] duration The duration of the animation in seconds
1197    * @param[in] alpha The alpha function to use
1198    * @note Contents will not snap to ruler snap points.
1199    *
1200    */
1201   void ScrollTo(const Vector2& position, float duration, AlphaFunction alpha);
1202
1203   /**
1204    * @brief Scrolls View to position specified (contents will scroll to this position).
1205    *
1206    * Position 0,0 is the origin. Increasing X scrolls contents left, while
1207    * increasing Y scrolls contents up.
1208    * - If Rulers have been applied to the axes, then the contents will scroll until
1209    * reaching the domain boundary.
1210    * @SINCE_1_0.0
1211    * @param[in] position The position to scroll to
1212    * @param[in] duration The duration of the animation in seconds
1213    * @param[in] horizontalBias Whether to bias scrolling to left or right
1214    * @param[in] verticalBias Whether to bias scrolling to top or bottom
1215    * @note Contents will not snap to ruler snap points.
1216    * Biasing parameters are provided such that in scenarios with 2 or 2x2 pages in
1217    * wrap mode, the application developer can decide whether to scroll left or right
1218    * to get to the target page.
1219    *
1220    */
1221   void ScrollTo(const Vector2& position, float duration,
1222                 DirectionBias horizontalBias, DirectionBias verticalBias);
1223
1224   /**
1225    * @brief Scrolls View to position specified (contents will scroll to this position).
1226    *
1227    * Position 0,0 is the origin. Increasing X scrolls contents left, while
1228    * increasing Y scrolls contents up.
1229    * - If Rulers have been applied to the axes, then the contents will scroll until
1230    * reaching the domain boundary.
1231    * @SINCE_1_0.0
1232    * @param[in] position The position to scroll to
1233    * @param[in] duration The duration of the animation in seconds
1234    * @param[in] horizontalBias Whether to bias scrolling to left or right
1235    * @param[in] verticalBias Whether to bias scrolling to top or bottom
1236    * @param[in] alpha Alpha function to use
1237    * @note Contents will not snap to ruler snap points.
1238    * Biasing parameters are provided such that in scenarios with 2 or 2x2 pages in
1239    * wrap mode, the application developer can decide whether to scroll left or right
1240    * to get to the target page.
1241    *
1242    */
1243   void ScrollTo(const Vector2& position, float duration, AlphaFunction alpha,
1244                 DirectionBias horizontalBias, DirectionBias verticalBias);
1245
1246   /**
1247    * @brief Scrolls View to page currently based on assumption that each page is
1248    * "(page) * ScrollViewSize.width, 0".
1249    *
1250    * @SINCE_1_0.0
1251    * @param[in] page The page to scroll to
1252    * @note Should probably be upgraded so that page is an abstract class, that can be
1253    * a function of ScrollViewSize, ruler domain, ruler snap points etc. as pages may be
1254    * orchestrated in a 2D grid fashion, or variable width.
1255    *
1256    */
1257   void ScrollTo(unsigned int page);
1258
1259   /**
1260    * @brief Scrolls View to page currently based on assumption that each page is
1261    * "(page) * ScrollViewSize.width, 0".
1262    *
1263    * @SINCE_1_0.0
1264    * @param[in] page The page to scroll to
1265    * @param[in] duration The duration of the animation in seconds
1266    * @note Should probably be upgraded so that page is an abstract class, that can be
1267    * a function of ScrollViewSize, ruler domain, ruler snap points etc. as pages may be
1268    * orchestrated in a 2D grid fashion, or variable width.
1269    *
1270    */
1271   void ScrollTo(unsigned int page, float duration);
1272
1273   /**
1274    * @brief Scrolls View to page currently based on assumption that each page is
1275    * "(page) * ScrollViewSize.width, 0".
1276    *
1277    * @SINCE_1_0.0
1278    * @param[in] page The page to scroll to
1279    * @param[in] duration The duration of the animation in seconds
1280    * @param[in] bias Whether to bias scrolling to left or right
1281    * @note Should probably be upgraded so that page is an abstract class, that can be
1282    * a function of ScrollViewSize, ruler domain, ruler snap points etc. as pages may be
1283    * orchestrated in a 2D grid fashion, or variable width.
1284    * A biasing parameter is provided such that in scenarios with 2 pages in wrap mode,
1285    * the application developer can decide whether to scroll left or right to get to
1286    * the target page.
1287    *
1288    */
1289   void ScrollTo(unsigned int page, float duration, DirectionBias bias);
1290
1291   /**
1292    * @brief Scrolls View such that actor appears in the center of the ScrollView.
1293    *
1294    * @SINCE_1_0.0
1295    * @param[in] actor The actor to center in on (via Scrolling)
1296    * @note Actor must be a direct child of ScrollView, otherwise will
1297    * cause an assertion failure.
1298    */
1299   void ScrollTo(Actor& actor);
1300
1301   /**
1302    * @brief Scrolls View such that actor appears in the center of the ScrollView.
1303    *
1304    * @SINCE_1_0.0
1305    * @param[in] actor The actor to center in on (via Scrolling)
1306    * @param[in] duration The duration of the animation in seconds
1307    * @note Actor must be a direct child of ScrollView, otherwise will
1308    * cause an assertion failure.
1309    */
1310   void ScrollTo(Actor& actor, float duration);
1311
1312   /**
1313    * @brief Scrolls View to the nearest snap points as specified by the Rulers.
1314    *
1315    * If already at snap points, then will return false, and not scroll.
1316    *
1317    * @SINCE_1_0.0
1318    * @return True if Snapping necessary
1319    */
1320   bool ScrollToSnapPoint();
1321
1322   /**
1323    * @brief Applies a constraint that will affect the children of ScrollView.
1324    *
1325    * @SINCE_1_0.0
1326    * @param[in] constraint The constraint to apply
1327    * @note This affects all existing and future Actors that are added to scrollview.
1328    */
1329   void ApplyConstraintToChildren(Constraint constraint);
1330
1331   /**
1332    * @brief Removes all constraints that will affect the children of ScrollView.
1333    *
1334    * @SINCE_1_0.0
1335    * @note This removes all constraints from actors that have been added
1336    * to scrollview.
1337    */
1338   void RemoveConstraintsFromChildren();
1339
1340   /**
1341    * @brief Applies Effect to ScrollView.
1342    *
1343    * @SINCE_1_0.0
1344    * @param[in] effect The effect to apply to scroll view
1345    */
1346   void ApplyEffect(ScrollViewEffect effect);
1347
1348   /**
1349    * @brief Removes Effect from ScrollView.
1350    *
1351    * @SINCE_1_0.0
1352    * @param[in] effect The effect to remove
1353    */
1354   void RemoveEffect(ScrollViewEffect effect);
1355
1356   /**
1357    * @brief Remove All Effects from ScrollView.
1358    * @SINCE_1_0.0
1359    */
1360   void RemoveAllEffects();
1361
1362   /**
1363    * @brief Binds actor to this ScrollView.
1364    *
1365    * Once an actor is bound to a ScrollView, it will be subject to
1366    * that ScrollView's properties.
1367    *
1368    * @SINCE_1_0.0
1369    * @param[in] child The actor to add to this ScrollView
1370    */
1371   void BindActor(Actor child);
1372
1373   /**
1374    * @brief Unbinds Actor from this ScrollView.
1375    *
1376    * Once Unbound, this ScrollView will not affect the actor.
1377    * @SINCE_1_0.0
1378    * @param[in] child The actor to be unbound
1379    * @note This does not remove the child from the ScrollView container
1380    *
1381    */
1382   void UnbindActor(Actor child);
1383
1384   /**
1385    * @brief Allows the user to constrain the scroll view in a particular direction.
1386    *
1387    * @SINCE_1_0.0
1388    * @param[in] direction The axis to constrain the scroll-view to.
1389    *                      Usually set to PanGestureDetector::DIRECTION_VERTICAL or PanGestureDetector::DIRECTION_HORIZONTAL (but can be any other angle if desired).
1390    * @param[in] threshold The threshold to apply around the axis
1391    * @note If no threshold is specified, then the default threshold of PI * 0.25 radians (or 45 degrees) is used.
1392    */
1393   void SetScrollingDirection( Radian direction, Radian threshold = PanGestureDetector::DEFAULT_THRESHOLD );
1394
1395   /**
1396    * @brief Removes a direction constraint from the scroll view.
1397    *
1398    * @SINCE_1_0.0
1399    * @param[in] direction The axis to stop constraining to.
1400    *                      Usually will be PanGestureDetector::DIRECTION_VERTICAL or PanGestureDetector::DIRECTION_HORIZONTAL (but can be any other angle if desired).
1401    */
1402   void RemoveScrollingDirection( Radian direction );
1403
1404 public: // Signals
1405
1406   /**
1407    * @brief Signal emitted when the ScrollView has started to snap or flick (it tells the target
1408    * position, scale, rotation for the snap or flick).
1409    *
1410    * A callback of the following type may be connected:
1411    * @code
1412    *   void YourCallbackName(const SnapEvent& event);
1413    * @endcode
1414    * @SINCE_1_0.0
1415    * @return The signal to connect to
1416    * @pre The Object has been initialized.
1417    */
1418   SnapStartedSignalType& SnapStartedSignal();
1419
1420 public: // Not intended for application developers
1421
1422   /// @cond internal
1423   /**
1424    * @brief Creates a handle using the Toolkit::Internal implementation.
1425    *
1426    * @SINCE_1_0.0
1427    * @param[in] implementation The Control implementation
1428    */
1429   DALI_INTERNAL ScrollView(Internal::ScrollView& implementation);
1430
1431   /**
1432    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
1433    *
1434    * @SINCE_1_0.0
1435    * @param[in] internal A pointer to the internal CustomActor
1436    */
1437   explicit DALI_INTERNAL ScrollView( Dali::Internal::CustomActor* internal );
1438   /// @endcond
1439 };
1440
1441 /**
1442  * @}
1443  */
1444 } // namespace Toolkit
1445
1446 } // namespace Dali
1447
1448 #endif // __DALI_TOOLKIT_SCROLL_VIEW_H__