2 using System.Collections.Generic;
8 /// Interface for all other scrollable widgets
10 public interface IScrollable
14 /// Scrolled will be triggered when the content has been scrolled.
16 event EventHandler Scrolled;
19 /// DragStart will be triggered when dragging the contents around has started.
21 event EventHandler DragStart;
24 /// DragStop will be triggered when dragging the contents around has stopped.
26 event EventHandler DragStop;
29 /// PageScrolled will be triggered when the visible page has changed.
31 event EventHandler PageScrolled;
34 /// Set scrolling gravity values for a scroller.
35 /// The gravity, defines how the scroller will adjust its view when the size of the scroller contents increase.
36 /// The scroller will adjust the view to glue itself as follows.
37 /// 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
38 /// Default values for x and y are 0.0
40 double VerticalGravity { get; set; }
43 /// Set scrolling gravity values for a scroller.
44 /// The gravity, defines how the scroller will adjust its view when the size of the scroller contents increase.
45 /// The scroller will adjust the view to glue itself as follows.
46 /// 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
47 /// Default values for x and y are 0.0
49 double HorizontalGravity { get; set; }
52 /// Sets or gets the vertical bounce behaviour.
53 /// When scrolling, the scroller may "bounce" when reaching an edge of the content object.
54 /// This is a visual way to indicate the end has been reached.
55 /// This is enabled by default for both axis.
56 /// This API will set if it is enabled for the given axis with the boolean parameters for each axis.
58 bool VerticalBounce { get; set; }
61 /// Sets or gets the horizontal bounce behaviour.
62 /// When scrolling, the scroller may "bounce" when reaching an edge of the content object.
63 /// This is a visual way to indicate the end has been reached.
64 /// This is enabled by default for both axis.
65 /// This API will set if it is enabled for the given axis with the boolean parameters for each axis.
67 bool HorizontalBounce { get; set; }
70 /// Gets or sets a value whether mouse wheel is enabled or not over the scroller.
72 bool WheelDisabled { get; set; }
75 /// Sets or gets the value of ScrollBlock.
78 /// This function will block scrolling movement in a given direction.One can disable movements in the X axis, the Y axis or both.
79 /// The default value is ScrollBlock.None, where movements are allowed in both directions.
81 ScrollBlock ScrollBlock { get; set; }
84 /// Sets or gets the value of VerticalScrollBarVisiblePolicy
87 /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden.
88 /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
90 ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy { get; set; }
93 /// Sets or gets the value of HorizontalScrollBarVisiblePolicy
96 /// ScrollBarVisiblePolicy.Auto means the horizontal scrollbar is made visible if it is needed, and otherwise kept hidden.
97 /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
99 ScrollBarVisiblePolicy HorizontalScrollBarVisiblePolicy { get; set; }
102 /// Gets the current region in the content object that is visible through the Scroller.
104 Rect CurrentRegion { get; }
107 /// Sets or gets the maximum limit of the movable page at vertical direction.
109 int VerticalPageScrollLimit { get; set; }
112 /// Sets or gets the maximum limit of the movable page at horizontal direction.
114 int HorizontalPageScrollLimit { get; set; }
117 /// Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis.
119 int HorizontalPageSize { get; set; }
122 /// Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis.
124 int VerticalPageSize { get; set; }
127 /// Gets or Sets the page snapping behavior of a scroller.
130 /// When scrolling, if a scroller is paged (see VerticalRelativePageSize),
131 /// the scroller may snap to pages when being scrolled, i.e., even if it had momentum to scroll further,
132 /// it will stop at the next page boundaries. This is disabled, by default, for both axis.
133 /// This function will set if it that is enabled or not, for each axis.
135 bool VerticalSnap { get; set; }
138 /// Gets or Sets the page snapping behavior of a scroller.
141 /// When scrolling, if a scroller is paged (see HorizontalRelativePageSize),
142 /// the scroller may snap to pages when being scrolled, i.e., even if it had momentum to scroll further,
143 /// it will stop at the next page boundaries. This is disabled, by default, for both axis.
144 /// This function will set if it that is enabled or not, for each axis.
146 bool HorizontalSnap { get; set; }
149 /// Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis.
151 int PageHeight { get; set; }
154 /// Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis.
156 int PageWidth { get; set; }
159 /// Gets or sets the type of single direction scroll.
161 ScrollSingleDirection SingleDirection { get; set; }
164 /// Gets or sets the step size to move scroller by key event.
166 int HorizontalStepSize { get; set; }
169 /// Gets or sets the step size to move scroller by key event.
171 int VerticalStepSize { get; set; }
174 /// Set an infinite loop_ for a scroller.
175 /// This function sets the infinite loop vertically.
176 /// If the content is set, it will be shown repeatedly.
178 bool VerticalLoop { get; set; }
181 /// Set an infinite loop_ for a scroller.
182 /// This function sets the infinite loop horizontally.
183 /// If the content is set, it will be shown repeatedly.
185 bool HorizontalLoop { get; set; }
188 /// Gets or sets a given scroller widget's scrolling page size, relative to its viewport size.
190 double VerticalRelativePageSize { get; set; }
193 /// Gets or sets a given scroller widget's scrolling page size, relative to its viewport size.
195 double HorizontalRelativePageSize { get; set; }
198 /// Get scroll last page number.
199 /// The page number starts from 0. 0 is the first page. This returns the last page number among the pages.
201 int LastVerticalPageNumber { get; }
204 /// Get scroll last page number.
205 /// The page number starts from 0. 0 is the first page. This returns the last page number among the pages.
207 int LastHorizontalPageNumber { get; }
210 /// Sets or gets scroll current page number.
213 /// Current page means the page which meets the top of the viewport.
214 /// If there are two or more pages in the viewport, it returns the number of the page which meets the top of the viewport.
215 /// The page number starts from 0. 0 is the first page.
217 int VerticalPageIndex { get; }
220 /// Sets or gets scroll current page number.
223 /// Current page means the page which meets the left of the viewport.
224 /// If there are two or more pages in the viewport, it returns the number of the page which meets the left of the viewport.
225 /// The page number starts from 0. 0 is the first page.
227 int HorizontalPageIndex { get; }
230 /// Gets the width of the content object of the scroller.
232 int ChildWidth { get; }
235 /// Gets the height of the content object of the scroller.
237 int ChildHeight { get; }
240 /// Sets the scroller minimum size limited to the minimum size of the content.
241 /// By default the scroller will be as small as its design allows, irrespective of its content.
242 /// This will make the scroller minimum size the right size horizontally and/or vertically to perfectly fit its content in that direction.
244 /// <param name="horizontal">Enable limiting minimum size horizontally</param>
245 /// <param name="vertical">Enable limiting minimum size vertically</param>
246 void MinimumLimit(bool horizontal, bool vertical);
249 /// Shows a specific virtual region within the scroller content object by the page number.
250 /// (0, 0) of the indicated page is located at the top-left corner of the viewport.
252 /// <param name="horizontalPageIndex">The horizontal page number.</param>
253 /// <param name="verticalPageIndex">The vertical page number.</param>
254 /// <param name="animated">True means slider with animation.</param>
255 void ScrollTo(int horizontalPageIndex, int verticalPageIndex, bool animated);
258 /// Shows a specific virtual region within the scroller content object.
261 /// This ensures that all (or part, if it does not fit) of the designated region in the virtual content object ((0, 0)
262 /// starting at the top-left of the virtual content object) is shown within the scroller.
263 /// If set "animated" to true, it will allows the scroller to "smoothly slide" to this location
264 /// (if configuration in general calls for transitions).
265 /// It may not jump immediately to the new location and may take a while and show other content along the way.
267 /// <param name="region">Rect struct of region.</param>
268 /// <param name="animated">True means allows the scroller to "smoothly slide" to this location.</param>
269 void ScrollTo(Rect region, bool animated);
273 /// Enumeration for visible type of scrollbar.
275 public enum ScrollBarVisiblePolicy
278 /// Show scrollbars as needed
283 /// Always show scrollbars
288 /// Never show scrollbars
294 /// Enumeration for visible type of scrollbar.
296 public enum ScrollBlock
299 /// Scrolling movement is allowed in both direction.(X axis and Y axis)
304 /// Scrolling movement is not allowed in Y axis direction.
309 /// Scrolling movement is not allowed in X axis direction.
315 /// Type that controls how the content is scrolled.
317 public enum ScrollSingleDirection
320 /// Scroll every direction.
325 /// Scroll single direction if the direction is certain.
330 /// Scroll only single direction.