[ElmSharp*] Add Scrollable interface
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / Toolbar.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System;
18 using System.ComponentModel;
19
20 namespace ElmSharp
21 {
22     /// <summary>
23     /// Enumeration for the selection mode of Toolbar.
24     /// </summary>
25     public enum ToolbarSelectionMode
26     {
27         /// <summary>
28         /// Default select mode.
29         /// </summary>
30         Default = 0,
31
32         /// <summary>
33         /// Always select mode.
34         /// </summary>
35         Always,
36
37         /// <summary>
38         /// No select mode.
39         /// </summary>
40         None,
41
42         /// <summary>
43         /// No select mode with no finger size rule.
44         /// </summary>
45         DisplayOnly,
46     }
47
48     /// <summary>
49     /// Enumeration that sets the toolbar items display behavior, it can be scrollable, can show a menu with exceeding items, or simply hide them.
50     /// </summary>
51     public enum ToolbarShrinkMode
52     {
53         /// <summary>
54         /// Sets minimum toolbar size to fit all the items.
55         /// </summary>
56         None = 0,
57
58         /// <summary>
59         /// Hides exceeding items.
60         /// </summary>
61         Hide,
62
63         /// <summary>
64         /// Allows accessing exceeding items through a scroller.
65         /// </summary>
66         Scroll,
67
68         /// <summary>
69         /// Inserts a button to pop up a menu with exceeding items.
70         /// </summary>
71         Menu,
72
73         /// <summary>
74         /// Expands all items according to the size of the toolbar.
75         /// </summary>
76         Expand
77     }
78
79     /// <summary>
80     /// Enumeration for the icon lookup order of Toolbar.
81     /// </summary>
82     public enum ToolbarIconLookupOrder
83     {
84         /// <summary>
85         /// Icon look up order: freedesktop, theme.
86         /// </summary>
87         FreedesktopTheme,
88
89         /// <summary>
90         /// Icon look up order: theme, freedesktop.
91         /// </summary>
92         ThemeFreedesktop,
93
94         /// <summary>
95         /// Icon look up order: freedesktop.
96         /// </summary>
97         Freedesktop,
98
99         /// <summary>
100         /// Icon look up order: theme.
101         /// </summary>
102         Theme,
103     }
104
105     /// <summary>
106     /// Event arguments for events of <see cref="ToolbarItem"/>.
107     /// </summary>
108     /// <remarks>
109     /// Inherits EventArgs.
110     /// </remarks>
111     public class ToolbarItemEventArgs : EventArgs
112     {
113         /// <summary>
114         /// Gets the ToolbarItem.
115         /// </summary>
116         public ToolbarItem Item { get; private set; }
117
118         internal static ToolbarItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info)
119         {
120             ToolbarItem item = ItemObject.GetItemByHandle(info) as ToolbarItem;
121             return new ToolbarItemEventArgs() { Item = item };
122         }
123     }
124
125     /// <summary>
126     /// The Toolbar is a widget that displays a list of items inside a box.
127     /// </summary>
128     public class Toolbar : Widget, IScrollable
129     {
130         ScrollableAdapter _scroller;
131         SmartEvent<ToolbarItemEventArgs> _clicked;
132         SmartEvent<ToolbarItemEventArgs> _selected;
133         SmartEvent<ToolbarItemEventArgs> _longpressed;
134
135         /// <summary>
136         /// Creates and initializes a new instance of the Toolbar class.
137         /// </summary>
138         /// <param name="parent">
139         /// A EvasObject to which the new Table instance will be attached.
140         /// </param>
141         public Toolbar(EvasObject parent) : base(parent)
142         {
143             _selected = new SmartEvent<ToolbarItemEventArgs>(this, this.RealHandle, "selected", ToolbarItemEventArgs.CreateFromSmartEvent);
144             _selected.On += (s, e) =>
145             {
146                 if (e.Item != null)
147                 {
148                     Selected?.Invoke(this, e);
149                     e.Item.SendSelected();
150                 }
151             };
152             _longpressed = new SmartEvent<ToolbarItemEventArgs>(this, this.RealHandle, "longpressed", ToolbarItemEventArgs.CreateFromSmartEvent);
153             _longpressed.On += (s, e) =>
154             {
155                 e.Item?.SendLongPressed();
156             };
157             _clicked = new SmartEvent<ToolbarItemEventArgs>(this, this.RealHandle, "clicked", ToolbarItemEventArgs.CreateFromSmartEvent);
158             _clicked.On += (s, e) =>
159             {
160                 e.Item?.SendClicked();
161             };
162
163             _scroller = new ScrollableAdapter(this);
164         }
165
166         /// <summary>
167         /// Selected will be triggered when toolbar have been selected.
168         /// </summary>
169         public event EventHandler<ToolbarItemEventArgs> Selected;
170
171         /// <summary>
172         /// Sets or gets whether the layout of this toolbar is homogeneous.
173         /// </summary>
174         /// <remarks>True for homogeneous, False for no homogeneous</remarks>
175         public bool Homogeneous
176         {
177             get
178             {
179                 return Interop.Elementary.elm_toolbar_homogeneous_get(RealHandle);
180             }
181             set
182             {
183                 Interop.Elementary.elm_toolbar_homogeneous_set(RealHandle, value);
184             }
185         }
186
187         /// <summary>
188         /// Sets or gets the slection mode of a given Toolbar widget.
189         /// </summary>
190         public ToolbarSelectionMode SelectionMode
191         {
192             get
193             {
194                 return (ToolbarSelectionMode)Interop.Elementary.elm_toolbar_select_mode_get(RealHandle);
195             }
196             set
197             {
198                 Interop.Elementary.elm_toolbar_select_mode_set(RealHandle, (int)value);
199             }
200         }
201
202         /// <summary>
203         /// Sets or gets the shrink mode of a given Toolbar widget.
204         /// </summary>
205         public ToolbarShrinkMode ShrinkMode
206         {
207             get
208             {
209                 return (ToolbarShrinkMode)Interop.Elementary.elm_toolbar_shrink_mode_get(RealHandle);
210             }
211             set
212             {
213                 Interop.Elementary.elm_toolbar_shrink_mode_set(RealHandle, (int)value);
214             }
215         }
216
217         /// <summary>
218         /// Sets or gets toolbar's current orientation.
219         /// </summary>
220         [EditorBrowsable(EditorBrowsableState.Never)]
221         public bool IsHorizontal
222         {
223             get
224             {
225                 return Interop.Elementary.elm_toolbar_horizontal_get(RealHandle);
226             }
227             set
228             {
229                 Interop.Elementary.elm_toolbar_horizontal_set(RealHandle, value);
230             }
231         }
232
233         /// <summary>
234         /// Sets or gets the icon lookup order, for toolbar items' icons.
235         /// The default lookup order is ToolbarIocnLookupOrder.ThemeFreedesktop.
236         /// Icons added before calling this function will not be affected.
237         /// </summary>
238         public ToolbarIconLookupOrder IconLookupOrder
239         {
240             get
241             {
242                 return (ToolbarIconLookupOrder)Interop.Elementary.elm_toolbar_icon_order_lookup_get(RealHandle);
243             }
244             set
245             {
246                 Interop.Elementary.elm_toolbar_icon_order_lookup_set(RealHandle, (int)value);
247             }
248         }
249
250         /// <summary>
251         /// Sets or gets the icon size of a given toolbar widget.
252         /// Default value is 32 pixels, to be used by toolbar items.
253         /// </summary>
254         public int IconSize
255         {
256             get
257             {
258                 return Interop.Elementary.elm_toolbar_icon_size_get(RealHandle);
259             }
260             set
261             {
262                 Interop.Elementary.elm_toolbar_icon_size_set(RealHandle, value);
263             }
264         }
265
266         /// <summary>
267         /// Gets the number of items in a toolbar widget.
268         /// </summary>
269         public int ItemsCount
270         {
271             get
272             {
273                 return Interop.Elementary.elm_toolbar_items_count(RealHandle);
274             }
275         }
276
277         /// <summary>
278         /// Sets or gets the alignment of the items.
279         /// </summary>
280         /// <remarks>The toolbar items alignment, a float between 0.0 and 1.0</remarks>
281         public double ItemAlignment
282         {
283             get
284             {
285                 return Interop.Elementary.elm_toolbar_align_get(RealHandle);
286             }
287             set
288             {
289                 Interop.Elementary.elm_toolbar_align_set(RealHandle, value);
290             }
291         }
292
293         /// <summary>
294         /// Sets or gets the item's transverse expansion of a given toolbar widget.
295         /// </summary>
296         /// <remarks>
297         /// The transverse expansion of the item, true for on and false for off.
298         /// By default it's false.
299         /// </remarks>
300         public bool TransverseExpansion
301         {
302             get
303             {
304                 return Interop.Elementary.elm_toolbar_transverse_expanded_get(RealHandle);
305             }
306             set
307             {
308                 Interop.Elementary.elm_toolbar_transverse_expanded_set(RealHandle, value);
309             }
310         }
311
312         /// <summary>
313         /// Appends ToolbarItem which just contains label to the toolbar.
314         /// </summary>
315         /// <param name="label">The label of the item</param>
316         /// <returns>The new ToolbarItem which appended to the toolbar</returns>
317         /// <seealso cref="Append(string, string)"/>
318         /// <seealso cref="Prepend(string)"/>
319         public ToolbarItem Append(string label)
320         {
321             return Append(label, null);
322         }
323
324         /// <summary>
325         /// Appends ToolbarItem which contains label and icon to the toolbar.
326         /// </summary>
327         /// <param name="label">The label of the item</param>
328         /// <param name="icon">A string with the icon name or the absolute path of an image file</param>
329         /// <returns>The new ToolbarItem which appended to the toolbar</returns>
330         /// <seealso cref="Append(string)"/>
331         /// <seealso cref="Prepend(string)"/>
332         /// <seealso cref="Prepend(string, string)"/>
333         public ToolbarItem Append(string label, string icon)
334         {
335             ToolbarItem item = new ToolbarItem(label, icon);
336             item.Handle = Interop.Elementary.elm_toolbar_item_append(RealHandle, icon, label, null, (IntPtr)item.Id);
337             return item;
338         }
339
340         /// <summary>
341         /// Prepends ToolbarItem which just contains label to the toolbar.
342         /// </summary>
343         /// <param name="label">The label of the item</param>
344         /// <returns>The new ToolbarItem which prepended to the toolbar</returns>
345         /// <seealso cref="Append(string)"/>
346         /// <seealso cref="Append(string, string)"/>
347         /// <seealso cref="Prepend(string, string)"/>
348         public ToolbarItem Prepend(string label)
349         {
350             return Prepend(label, null);
351         }
352
353         /// <summary>
354         /// Prepends ToolbarItem which contains label and icon to the toolbar.
355         /// </summary>
356         /// <param name="label">The label of the item</param>
357         /// <param name="icon">A string with the icon name or the absolute path of an image file</param>
358         /// <returns>The new <see cref="ToolbarItem"/> which prepended to the toolbar</returns>
359         /// <seealso cref="Append(string)"/>
360         /// <seealso cref="Append(string, string)"/>
361         /// <seealso cref="Prepend(string)"/>
362         public ToolbarItem Prepend(string label, string icon)
363         {
364             ToolbarItem item = new ToolbarItem(label, icon);
365             item.Handle = Interop.Elementary.elm_toolbar_item_prepend(RealHandle, icon, label, null, (IntPtr)item.Id);
366             return item;
367         }
368
369         /// <summary>
370         /// Inserts a new item which just contains label into the toolbar object before item <paramref name="before"/>.
371         /// </summary>
372         /// <param name="before">The toolbar item to insert before</param>
373         /// <param name="label">The label of the item</param>
374         /// <returns>The new <see cref="ToolbarItem"/> which insert into the toolbar</returns>
375         /// <seealso cref="InsertBefore(ToolbarItem, string, string)"/>
376         public ToolbarItem InsertBefore(ToolbarItem before, string label)
377         {
378             return InsertBefore(before, label, string.Empty);
379         }
380
381         /// <summary>
382         /// Inserts a new item which contains label and icon into the toolbar object before item <paramref name="before"/>.
383         /// </summary>
384         /// <param name="before">The toolbar item to insert before</param>
385         /// <param name="label">The label of the item</param>
386         /// <param name="icon">A string with the icon name or the absolute path of an image file</param>
387         /// <returns>The new <see cref="ToolbarItem"/> which insert into the toolbar</returns>
388         /// <seealso cref="InsertBefore(ToolbarItem, string)"/>
389         public ToolbarItem InsertBefore(ToolbarItem before, string label, string icon)
390         {
391             ToolbarItem item = new ToolbarItem(label, icon);
392             item.Handle = Interop.Elementary.elm_toolbar_item_insert_before(RealHandle, before, icon, label, null, (IntPtr)item.Id);
393             return item;
394         }
395
396         /// <summary>
397         /// Inserts a new item which contains label and icon into the toolbar object after item <paramref name="after"/>.
398         /// </summary>
399         /// <param name="after">The toolbar item to insert after</param>
400         /// <param name="label">The label of the item</param>
401         /// <param name="icon">A string with the icon name or the absolute path of an image file</param>
402         /// <returns>The new <see cref="ToolbarItem"/> which insert into the toolbar</returns>
403         public ToolbarItem InsertAfter(ToolbarItem after, string label, string icon)
404         {
405             ToolbarItem item = new ToolbarItem(label, icon);
406             item.Handle = Interop.Elementary.elm_toolbar_item_insert_after(RealHandle, after, icon, label, null, (IntPtr)item.Id);
407             return item;
408         }
409
410         /// <summary>
411         /// Find the item with that label in the toolbar.
412         /// </summary>
413         /// <param name="label">The label of the item</param>
414         /// <returns>The <see cref="ToolbarItem"/> into the toolbar</returns>
415         public ToolbarItem FindItemByLabel(string label)
416         {
417             IntPtr handle = Interop.Elementary.elm_toolbar_item_find_by_label(RealHandle, label);
418             return ItemObject.GetItemByHandle(handle) as ToolbarItem;
419         }
420
421         /// <summary>
422         /// Gets the selected ToolbarItemItem of the toolbar.
423         /// </summary>
424         public ToolbarItem SelectedItem
425         {
426             get
427             {
428                 IntPtr handle = Interop.Elementary.elm_toolbar_selected_item_get(RealHandle);
429                 return ItemObject.GetItemByHandle(handle) as ToolbarItem;
430             }
431         }
432
433         /// <summary>
434         /// Gets the first ToolbarItemItem of the toolbar.
435         /// </summary>
436         public ToolbarItem FirstItem
437         {
438             get
439             {
440                 IntPtr handle = Interop.Elementary.elm_toolbar_first_item_get(RealHandle);
441                 return ItemObject.GetItemByHandle(handle) as ToolbarItem;
442             }
443         }
444
445         /// <summary>
446         /// Gets the last ToolbarItemItem of the toolbar.
447         /// </summary>
448         public ToolbarItem LastItem
449         {
450             get
451             {
452                 IntPtr handle = Interop.Elementary.elm_toolbar_last_item_get(RealHandle);
453                 return ItemObject.GetItemByHandle(handle) as ToolbarItem;
454             }
455         }
456
457         /// <summary>
458         /// Creates a widget handle.
459         /// </summary>
460         /// <param name="parent">Parent EvasObject</param>
461         /// <returns>Handle IntPtr</returns>
462         protected override IntPtr CreateHandle(EvasObject parent)
463         {
464             IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
465             Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default");
466
467             RealHandle = Interop.Elementary.elm_toolbar_add(handle);
468             Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle);
469
470             return handle;
471         }
472
473         #region IScroller Implementation
474
475         /// <summary>
476         /// Scrolled will be triggered when the content has been scrolled.
477         /// </summary>
478         public event EventHandler Scrolled
479         {
480             add => _scroller.Scrolled += value;
481             remove => _scroller.Scrolled -= value;
482         }
483
484         /// <summary>
485         /// DragStart will be triggered when dragging the contents around has started.
486         /// </summary>
487         public event EventHandler DragStart
488         {
489             add => _scroller.DragStart += value;
490             remove => _scroller.DragStart -= value;
491         }
492
493         /// <summary>
494         /// DragStop will be triggered when dragging the contents around has stopped.
495         /// </summary>
496         public event EventHandler DragStop
497         {
498             add => _scroller.DragStop += value;
499             remove => _scroller.DragStop -= value;
500         }
501
502         /// <summary>
503         /// PageScrolled will be triggered when the visible page has changed.
504         /// </summary>
505         public event EventHandler PageScrolled
506         {
507             add => _scroller.PageScrolled += value;
508             remove => _scroller.PageScrolled -= value;
509         }
510
511         /// <summary>
512         /// Gets the current region in the content object that is visible through the Scroller.
513         /// </summary>
514         public Rect CurrentRegion => _scroller.CurrentRegion;
515
516         /// <summary>
517         /// Sets or gets the value of HorizontalScrollBarVisiblePolicy
518         /// </summary>
519         /// <remarks>
520         /// ScrollBarVisiblePolicy.Auto means the horizontal scrollbar is made visible if it is needed, and otherwise kept hidden.
521         /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
522         /// </remarks>
523         public virtual ScrollBarVisiblePolicy HorizontalScrollBarVisiblePolicy
524         {
525             get => _scroller.HorizontalScrollBarVisiblePolicy;
526             set => _scroller.HorizontalScrollBarVisiblePolicy = value;
527         }
528
529         /// <summary>
530         /// Sets or gets the value of VerticalScrollBarVisiblePolicy
531         /// </summary>
532         /// <remarks>
533         /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden.
534         /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
535         /// </remarks>
536         public virtual ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy
537         {
538             get => _scroller.VerticalScrollBarVisiblePolicy;
539             set => _scroller.VerticalScrollBarVisiblePolicy = value;
540         }
541
542         /// <summary>
543         /// Sets or gets the value of ScrollBlock.
544         /// </summary>
545         /// <remarks>
546         /// This function will block scrolling movement  in a given direction.One can disable movements in the X axis, the Y axis or both.
547         /// The default value is ScrollBlock.None, where movements are allowed in both directions.
548         /// </remarks>
549         public ScrollBlock ScrollBlock
550         {
551             get => _scroller.ScrollBlock;
552             set => _scroller.ScrollBlock = value;
553         }
554
555         /// <summary>
556         /// Sets or gets scroll current page number.
557         /// </summary>
558         /// <remarks>
559         /// Current page means the page which meets the top of the viewport.
560         /// If there are two or more pages in the viewport, it returns the number of the page which meets the top of the viewport.
561         /// The page number starts from 0. 0 is the first page.
562         /// </remarks>
563         public int VerticalPageIndex => _scroller.VerticalPageIndex;
564
565         /// <summary>
566         /// Sets or gets scroll current page number.
567         /// </summary>
568         /// <remarks>
569         /// Current page means the page which meets the left of the viewport.
570         /// If there are two or more pages in the viewport, it returns the number of the page which meets the left of the viewport.
571         /// The page number starts from 0. 0 is the first page.
572         /// </remarks>
573         public int HorizontalPageIndex => _scroller.HorizontalPageIndex;
574
575         /// <summary>
576         /// Sets or gets the maximum limit of the movable page at vertical direction.
577         /// </summary>
578         public int VerticalPageScrollLimit
579         {
580             get => _scroller.VerticalPageScrollLimit;
581             set => _scroller.VerticalPageScrollLimit = value;
582         }
583
584         /// <summary>
585         /// Sets or gets the maximum limit of the movable page at horizontal direction.
586         /// </summary>
587         public int HorizontalPageScrollLimit
588         {
589             get => _scroller.HorizontalPageScrollLimit;
590             set => _scroller.HorizontalPageScrollLimit = value;
591         }
592
593         /// <summary>
594         /// Sets or gets the vertical bounce behaviour.
595         /// When scrolling, the scroller may "bounce" when reaching an edge of the content object.
596         /// This is a visual way to indicate the end has been reached.
597         /// This is enabled by default for both axis.
598         /// This API will set if it is enabled for the given axis with the boolean parameters for each axis.
599         /// </summary>
600         public bool VerticalBounce
601         {
602             get => _scroller.VerticalBounce;
603             set => _scroller.VerticalBounce = value;
604         }
605
606         /// <summary>
607         /// Sets or gets the horizontal bounce behaviour.
608         /// When scrolling, the scroller may "bounce" when reaching an edge of the content object.
609         /// This is a visual way to indicate the end has been reached.
610         /// This is enabled by default for both axis.
611         /// This API will set if it is enabled for the given axis with the boolean parameters for each axis.
612         /// </summary>
613         public bool HorizontalBounce
614         {
615             get => _scroller.HorizontalBounce;
616             set => _scroller.HorizontalBounce = value;
617         }
618
619         /// <summary>
620         /// Gets the width of the content object of the scroller.
621         /// </summary>
622         public int ChildWidth
623         {
624             get => _scroller.ChildWidth;
625         }
626
627         /// <summary>
628         /// Gets the height of the content object of the scroller.
629         /// </summary>
630         public int ChildHeight
631         {
632             get => _scroller.ChildHeight;
633         }
634
635         /// <summary>
636         /// Set scrolling gravity values for a scroller.
637         /// The gravity, defines how the scroller will adjust its view when the size of the scroller contents increase.
638         /// The scroller will adjust the view to glue itself as follows.
639         /// x=0.0, for staying where it is relative to the left edge of the content x=1.0, for staying where it is relative to the rigth edge of the content y=0.0, for staying where it is relative to the top edge of the content y=1.0, for staying where it is relative to the bottom edge of the content
640         /// Default values for x and y are 0.0
641         /// </summary>
642         public double HorizontalGravity
643         {
644             get => _scroller.HorizontalGravity;
645             set => _scroller.HorizontalGravity = value;
646         }
647
648         /// <summary>
649         /// Set scrolling gravity values for a scroller.
650         /// The gravity, defines how the scroller will adjust its view when the size of the scroller contents increase.
651         /// The scroller will adjust the view to glue itself as follows.
652         /// x=0.0, for staying where it is relative to the left edge of the content x=1.0, for staying where it is relative to the rigth edge of the content y=0.0, for staying where it is relative to the top edge of the content y=1.0, for staying where it is relative to the bottom edge of the content
653         /// Default values for x and y are 0.0
654         /// </summary>
655         public double VerticalGravity
656         {
657             get => _scroller.VerticalGravity;
658             set => _scroller.VerticalGravity = value;
659         }
660
661         /// <summary>
662         /// Get scroll last page number.
663         /// The page number starts from 0. 0 is the first page. This returns the last page number among the pages.
664         /// </summary>
665         public int LastVerticalPageNumber => _scroller.LastVerticalPageNumber;
666
667         /// <summary>
668         /// Get scroll last page number.
669         /// The page number starts from 0. 0 is the first page. This returns the last page number among the pages.
670         /// </summary>
671         public int LastHorizontalPageNumber => _scroller.LastHorizontalPageNumber;
672
673         /// <summary>
674         /// Set an infinite loop_ for a scroller.
675         /// This function sets the infinite loop vertically.
676         /// If the content is set, it will be shown repeatedly.
677         /// </summary>
678         public bool VerticalLoop
679         {
680             get => _scroller.VerticalLoop;
681             set => _scroller.VerticalLoop = value;
682         }
683
684         /// <summary>
685         /// Set an infinite loop_ for a scroller.
686         /// This function sets the infinite loop horizontally.
687         /// If the content is set, it will be shown repeatedly.
688         /// </summary>
689         public bool HorizontalLoop
690         {
691             get => _scroller.HorizontalLoop;
692             set => _scroller.HorizontalLoop = value;
693         }
694
695         /// <summary>
696         /// Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis.
697         /// </summary>
698         public int HorizontalPageSize
699         {
700             get => _scroller.HorizontalPageSize;
701             set => _scroller.HorizontalPageSize = value;
702         }
703
704         /// <summary>
705         /// Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis.
706         /// </summary>
707         public int VerticalPageSize
708         {
709             get => _scroller.VerticalPageSize;
710             set => _scroller.VerticalPageSize = value;
711         }
712
713         /// <summary>
714         /// Gets or sets a given scroller widget's scrolling page size, relative to its viewport size.
715         /// </summary>
716         public double VerticalRelativePageSize
717         {
718             get => _scroller.VerticalRelativePageSize;
719             set => _scroller.VerticalRelativePageSize = value;
720         }
721
722         /// <summary>
723         /// Gets or sets a given scroller widget's scrolling page size, relative to its viewport size.
724         /// </summary>
725         public double HorizontalRelativePageSize
726         {
727             get => _scroller.HorizontalRelativePageSize;
728             set => _scroller.HorizontalRelativePageSize = value;
729         }
730
731         /// <summary>
732         /// Gets or Sets the page snapping behavior of a scroller.
733         /// </summary>
734         /// <remarks>
735         /// When scrolling, if a scroller is paged (see VerticalRelativePageSize),
736         /// the scroller may snap to pages when being scrolled, i.e., even if it had momentum to scroll further,
737         /// it will stop at the next page boundaries. This is disabled, by default, for both axis.
738         /// This function will set if it that is enabled or not, for each axis.
739         /// </remarks>
740         public bool VerticalSnap
741         {
742             get => _scroller.VerticalSnap;
743             set => _scroller.VerticalSnap = value;
744         }
745
746         /// <summary>
747         /// Gets or Sets the page snapping behavior of a scroller.
748         /// </summary>
749         /// <remarks>
750         /// When scrolling, if a scroller is paged (see HorizontalRelativePageSize),
751         /// the scroller may snap to pages when being scrolled, i.e., even if it had momentum to scroll further,
752         /// it will stop at the next page boundaries. This is disabled, by default, for both axis.
753         /// This function will set if it that is enabled or not, for each axis.
754         /// </remarks>
755         public bool HorizontalSnap
756         {
757             get => _scroller.HorizontalSnap;
758             set => _scroller.HorizontalSnap = value;
759         }
760
761         /// <summary>
762         /// Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis.
763         /// </summary>
764         public int PageHeight
765         {
766             get => _scroller.PageHeight;
767             set => _scroller.PageHeight = value;
768         }
769
770         /// <summary>
771         /// Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis.
772         /// </summary>
773         public int PageWidth
774         {
775             get => _scroller.PageWidth;
776             set => _scroller.PageWidth = value;
777         }
778
779         /// <summary>
780         /// Gets or sets the step size to move scroller by key event.
781         /// </summary>
782         public int HorizontalStepSize
783         {
784             get => _scroller.HorizontalStepSize;
785             set => _scroller.HorizontalStepSize = value;
786         }
787
788         /// <summary>
789         /// Gets or sets the step size to move scroller by key event.
790         /// </summary>
791         public int VerticalStepSize
792         {
793             get => _scroller.VerticalStepSize;
794             set => _scroller.VerticalStepSize = value;
795         }
796
797         /// <summary>
798         /// Gets or sets a value whether mouse wheel is enabled or not over the scroller.
799         /// </summary>
800         public bool WheelDisabled
801         {
802             get => _scroller.WheelDisabled;
803             set => _scroller.WheelDisabled = value;
804         }
805
806         /// <summary>
807         /// Gets or sets the type of single direction scroll.
808         /// </summary>
809         public ScrollSingleDirection SingleDirection
810         {
811             get => _scroller.SingleDirection;
812             set => _scroller.SingleDirection = value;
813         }
814
815         /// <summary>
816         /// Sets the scroller minimum size limited to the minimum size of the content.
817         /// By default the scroller will be as small as its design allows, irrespective of its content.
818         /// This will make the scroller minimum size the right size horizontally and/or vertically to perfectly fit its content in that direction.
819         /// </summary>
820         /// <param name="horizontal">Enable limiting minimum size horizontally</param>
821         /// <param name="vertical">Enable limiting minimum size vertically</param>
822         public void MinimumLimit(bool horizontal, bool vertical)
823         {
824             _scroller.MinimumLimit(horizontal, vertical);
825         }
826
827         /// <summary>
828         /// Shows a specific virtual region within the scroller content object by the page number.
829         /// (0, 0) of the indicated page is located at the top-left corner of the viewport.
830         /// </summary>
831         /// <param name="horizontalPageIndex">The horizontal page number.</param>
832         /// <param name="verticalPageIndex">The vertical page number.</param>
833         /// <param name="animated">True means slider with animation.</param>
834         public void ScrollTo(int horizontalPageIndex, int verticalPageIndex, bool animated)
835         {
836             _scroller.ScrollTo(horizontalPageIndex, verticalPageIndex, animated);
837         }
838
839         /// <summary>
840         /// Shows a specific virtual region within the scroller content object.
841         /// </summary>
842         /// <remarks>
843         /// This ensures that all (or part, if it does not fit) of the designated region in the virtual content object ((0, 0)
844         /// starting at the top-left of the virtual content object) is shown within the scroller.
845         /// If set "animated" to true, it will allows the scroller to "smoothly slide" to this location
846         /// (if configuration in general calls for transitions).
847         /// It may not jump immediately to the new location and may take a while and show other content along the way.
848         /// </remarks>
849         /// <param name="region">Rect struct of region.</param>
850         /// <param name="animated">True means allows the scroller to "smoothly slide" to this location.</param>
851         public void ScrollTo(Rect region, bool animated)
852         {
853             _scroller.ScrollTo(region, animated);
854         }
855
856         #endregion
857     }
858 }