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