1import efl_ui_layout_orientable;
2type @beta Elm_Interface_Scrollable_Cb: __undefined_type; [[Elementary interface scrollable callback type]]
3type @beta Elm_Interface_Scrollable_Resize_Cb: __undefined_type; [[Elementary interface scrollable resize callback type]]
4type @beta Elm_Interface_Scrollable_Min_Limit_Cb: __undefined_type; [[Elementary interface scrollable minimal limit callback type]]
5
6/* FIXME: Rename the namespace of the types. */
7enum @beta Elm.Scroller.Policy
8{
9   [[Type that controls when scrollbars should appear.
10
11     See also @Elm.Interface_Scrollable.policy.set.
12   ]]
13   auto = 0, [[Show scrollbars as needed.]]
14   on, [[Always show scrollbars.]]
15   off, [[Never show scrollbars.]]
16   last [[Internal. Sentinel value to indicate last enum field during iteration.]]
17}
18
19enum @beta Elm.Scroller.Single_Direction
20{
21   [[Type that controls how the content is scrolled.
22
23     See also @Elm.Interface_Scrollable.single_direction.set.
24   ]]
25   none = 0, [[Scroll every direction.]]
26   soft, [[Scroll single direction if the direction is certain.]]
27   hard, [[Scroll only single direction.]]
28   last  [[Internal. Sentinel value to indicate last enum field during iteration.]]
29}
30
31mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Focus.Manager_Sub, Efl.Ui.Widget_Focus_Manager
32{
33   [[Elm scrollable mixin]]
34   c_prefix: elm_interface_scrollable;
35   data: Elm_Scrollable_Smart_Interface_Data;
36   methods {
37      @property gravity {
38         [[Control scrolling gravity on the scrollable
39
40           The gravity defines how the scroller will adjust its view
41           when the size of the scroller contents increases.
42
43           The scroller will adjust the view to glue itself as follows.
44
45            x=0.0, for staying where it is relative to the left edge of the content
46            x=1.0, for staying where it is relative to the right edge of the content
47            y=0.0, for staying where it is relative to the top edge of the content
48            y=1.0, for staying where it is relative to the bottom edge of the content
49
50           Default values for x and y are 0.0]]
51         set {
52         }
53         get {
54         }
55         values {
56            x: double; [[Horizontal scrolling gravity]]
57            y: double; [[Vertical scrolling gravity]]
58         }
59      }
60      @property bounce_allow {
61         [[Bouncing behavior
62
63           When scrolling, the scroller may "bounce" when reaching an edge of the
64           content object. This is a visual way to indicate the end has been reached.
65           This is enabled by default for both axis. This API will set if it is enabled
66           for the given axis with the boolean parameters for each axis.]]
67         set {
68         }
69         get {
70         }
71         values {
72            horiz: bool; [[Horizontal bounce policy.]]
73            vert: bool; [[Vertical bounce policy.]]
74         }
75      }
76      @property wheel_disabled {
77         [[Control Wheel disable
78           Enable or disable mouse wheel to be used to scroll the scroller content.
79           heel is enabled by default.]]
80         set {
81         }
82         get {
83         }
84         values {
85            disabled: bool; [[$true if wheel is disabled, $false otherwise]]
86         }
87      }
88      @property movement_block {
89         [[Blocking of scrolling (per axis)
90
91           This function will block scrolling movement (by input of a user) in
92           a given direction. One can disable movements in the X axis, the Y
93           axis or both. The default value is $none, where movements are
94           allowed in both directions.
95
96           What makes this function different from
97           freeze_push(), hold_push() and lock_x_set() (or lock_y_set())
98           is that it doesn't propagate its effects to any parent or child
99           widget of $obj. Only the target scrollable widget will be locked
100           with regard to scrolling.
101         ]]
102         values {
103            block: Efl.Ui.Layout_Orientation(Efl.Ui.Layout_Orientation.default); [[Which axis (or axes) to block]]
104         }
105      }
106      @property momentum_animator_disabled {
107          [[Momentum animator]]
108         set {
109         }
110         get {
111         }
112         values {
113            disabled: bool; [[$true if disabled, $false otherwise]]
114         }
115      }
116      @property policy {
117          [[Scrollbar visibility policy]]
118         set {
119         }
120         get {
121         }
122         values {
123            hbar: Elm.Scroller.Policy; [[Horizontal scrollbar policy]]
124            vbar: Elm.Scroller.Policy; [[Vertical scrollbar policy]]
125         }
126      }
127      @property content_region {
128         [[Currently visible content region
129
130           This gets the current region in the content object that is visible through
131           the scroller. The region co-ordinates are returned in the $x, $y,
132           $w, $h values pointed to.
133
134           Note: All coordinates are relative to the content.
135
136           See: @.content_region_show.]]
137
138
139         set {
140         }
141         get {
142         }
143         values {
144            x: int; [[X coordinate of the region]]
145            y: int; [[Y coordinate of the region]]
146            w: int; [[Width of the region]]
147            h: int; [[Height of the region]]
148         }
149      }
150      @property content_events {
151         [[It decides whether the scrollable object propagates the events to content object or not.]]
152         set {
153         }
154         get {
155         }
156         values {
157            repeat_events: bool; [[$true if events are propagated, $false otherwise]]
158         }
159      }
160      @property page_size {
161         [[Scroll page size relative to viewport size.
162
163           The scroller is capable of limiting scrolling by the user to "pages". That
164           is to jump by and only show a "whole page" at a time as if the continuous
165           area of the scroller content is split into page sized pieces. This sets
166           the size of a page relative to the viewport of the scroller. 1.0 is "1
167           viewport" is size (horizontally or vertically). 0.0 turns it off in that
168           axis. This is mutually exclusive with page size
169           (see @.page_size for more information). Likewise 0.5
170           is "half a viewport". Sane usable values are normally between 0.0 and 1.0
171           including 1.0. If you only want 1 axis to be page "limited", use 0.0 for
172           the other axis.]]
173         set {
174         }
175         get {
176         }
177         values {
178            x: int; [[The horizontal page relative size]]
179            y: int; [[The vertical page relative size]]
180         }
181      }
182      @property bounce_animator_disabled {
183          [[Bounce animator]]
184         set {
185         }
186         get {
187         }
188         values {
189            disabled: bool; [[$true if bounce animation is disabled, $false otherwise]]
190         }
191      }
192      @property page_scroll_limit {
193          [[Page scroll limit]]
194         set {
195         }
196         get {
197         }
198         values {
199            page_limit_h: int; [[Page limit horizontal]]
200            page_limit_v: int; [[Page limit vertical]]
201         }
202      }
203      @property page_snap_allow {
204         [[Page snapping behavior
205
206           When scrolling, if a scroller is paged (see
207           elm_scroller_page_size_set() and elm_scroller_page_relative_set()),
208           the scroller may snap to pages when being scrolled, i.e., even if
209           it had momentum to scroll further, it will stop at the next page
210           boundaries. This is disabled, by default, for both axis. This
211           function will set if it that is enabled or not, for each axis.
212
213           Note: If $obj is not set to have pages, nothing will happen after
214           this call.
215         ]]
216         set {
217         }
218         get {
219         }
220         values {
221            horiz: bool; [[Allow snap horizontally]]
222            vert: bool;  [[Allow snap vertically]]
223         }
224      }
225      @property paging {
226          [[Paging property]]
227         set {
228         }
229         get {
230         }
231         values {
232            pagerel_h: double; [[Page relation horizontal]]
233            pagerel_v: double; [[Page relation vertical]]
234            pagesize_h: int; [[Page size horizontal]]
235            pagesize_v: int; [[Page size vertical]]
236         }
237      }
238      @property single_direction {
239         [[Single direction scroll configuration
240
241           This makes it possible to restrict scrolling to a single direction,
242           with a "soft" or "hard" behavior.
243
244           The hard behavior restricts the scrolling to a single direction all
245           of the time while the soft one will restrict depending on factors
246           such as the movement angle. If the user scrolls roughly in one
247           direction only, it will only move according to it while if the move
248           was clearly wanted on both axes, it will happen on both of them.
249         ]]
250         set {
251         }
252         get {
253         }
254         values {
255            single_dir: Elm.Scroller.Single_Direction; [[The single direction scroll policy]]
256         }
257      }
258      @property step_size {
259          [[Step size]]
260         set {
261         }
262         get {
263         }
264         values {
265            x: int; [[X coordinate]]
266            y: int; [[Y coordinate]]
267         }
268      }
269      @property content_loop {
270         [[Controls an infinite loop for a scroller.
271         ]]
272         set {
273         }
274         get {
275         }
276         values {
277            loop_h: bool; [[The scrolling horizontal loop]]
278            loop_v: bool; [[The scrolling vertical loop]]
279         }
280      }
281      @property scroll_up_cb {
282         [[Set the callback to run when the content has been moved up.]]
283         set {
284         }
285         values {
286            scroll_up_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
287         }
288      }
289      @property hbar_drag_cb {
290         [[Set the callback to run when the horizontal scrollbar is dragged.]]
291         set {
292         }
293         values {
294            hbar_drag_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
295         }
296      }
297      @property drag_start_cb {
298         [[Set the callback to run when dragging of the contents has started.]]
299         set {
300         }
301         values {
302            drag_start_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
303         }
304      }
305      @property freeze {
306         [[Freeze property]]
307         set {
308         }
309         values {
310            freeze: bool; [[$true if freeze, $false otherwise]]
311         }
312      }
313      @property content_viewport_resize_cb {
314         [[When the viewport is resized, the callback is called.]]
315         set {
316         }
317         values {
318            viewport_resize_cb: Elm_Interface_Scrollable_Resize_Cb; [[The callback]]
319         }
320      }
321      @property scroll_left_cb {
322         [[Set the callback to run when the content has been moved to the left]]
323         set {
324         }
325         values {
326            scroll_left_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
327         }
328      }
329      @property vbar_press_cb {
330         [[Set the callback to run when the vertical scrollbar is pressed.]]
331         set {
332         }
333         values {
334            vbar_press_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
335         }
336      }
337      @property hbar_press_cb {
338         [[Set the callback to run when the horizontal scrollbar is pressed.]]
339         set {
340         }
341         values {
342            hbar_press_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
343         }
344      }
345      @property hbar_unpress_cb {
346         [[Set the callback to run when the horizontal scrollbar is unpressed.]]
347         set {
348         }
349         values {
350            hbar_unpress_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
351         }
352      }
353      @property drag_stop_cb {
354         [[Set the callback to run when dragging of the contents has stopped.]]
355         set {
356         }
357         values {
358            drag_stop_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
359         }
360      }
361      @property extern_pan {
362          [[Extern pan]]
363         set {
364         }
365         values {
366            pan: Efl.Canvas.Object; [[Pan object]]
367         }
368      }
369      @property page_change_cb {
370         [[Set the callback to run when the visible page changes.]]
371         set {
372         }
373         values {
374            page_change_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
375         }
376      }
377      @property hold {
378          [[Hold property]]
379         set {
380         }
381         values {
382            hold: bool; [[$true if hold, $false otherwise]]
383         }
384      }
385      @property animate_start_cb {
386         [[Set the callback to run when the scrolling animation has started.]]
387         set {
388         }
389         values {
390            animate_start_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
391         }
392      }
393      @property scroll_down_cb {
394         [[Set the callback to run when the content has been moved down.]]
395         set {
396         }
397         values {
398            scroll_down_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
399         }
400      }
401      @property page_relative {
402         [[Set scroll page size relative to viewport size.]]
403         set {
404         }
405         values {
406            h_pagerel: double; [[Page relation horizontal]]
407            v_pagerel: double; [[Page relation vertical]]
408         }
409      }
410      @property scroll_cb {
411         [[Set the callback to run when the content has been moved.]]
412         set {
413         }
414         values {
415            scroll_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
416         }
417      }
418      @property animate_stop_cb {
419         [[Set the callback to run when the scrolling animation has stopped.]]
420         set {
421         }
422         values {
423            animate_stop_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
424         }
425      }
426      @property content_min_limit_cb {
427         [[set the callback to run on minimal limit content]]
428         set {
429         }
430         values {
431            min_limit_cb: Elm_Interface_Scrollable_Min_Limit_Cb; [[The callback]]
432         }
433      }
434      @property scroll_right_cb {
435         [[Set the callback to run when the content has been moved to the right.]]
436         set {
437         }
438         values {
439            scroll_right_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
440         }
441      }
442      @property scrollable_content {
443         [[Content property]]
444         set {
445         }
446         values {
447            content: Efl.Canvas.Object; [[Content object]]
448         }
449      }
450      @property edge_left_cb {
451         [[Set the callback to run when the left edge of the content has been reached.]]
452         set {
453         }
454         values {
455            edge_left_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
456         }
457      }
458      @property vbar_drag_cb {
459         [[Set the callback to run when the horizontal scrollbar is dragged.]]
460         set {
461         }
462         values {
463            vbar_drag_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
464         }
465      }
466      @property vbar_unpress_cb {
467         [[Set the callback to run when the horizontal scrollbar is unpressed.]]
468         set {
469         }
470         values {
471            vbar_unpress_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
472         }
473      }
474      @property edge_bottom_cb {
475         [[Set the callback to run when the bottom edge of the content has been reached.]]
476         set {
477         }
478         values {
479            edge_bottom_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
480         }
481      }
482      @property edge_right_cb {
483         [[Set the callback to run when the right edge of the content has been reached.]]
484         set {
485         }
486         values {
487            edge_right_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
488         }
489      }
490      @property edge_top_cb {
491         [[Set the callback to run when the top edge of the content has been reached.]]
492         set {
493         }
494         values {
495            edge_top_cb: Elm_Interface_Scrollable_Cb; [[The callback]]
496         }
497      }
498      @property objects {
499         [[Object property]]
500         set {
501         }
502         values {
503            edje_object: Efl.Canvas.Object; [[Edje object]]
504            hit_rectangle: Efl.Canvas.Object; [[Evas object]]
505         }
506      }
507      @property last_page {
508         [[Scroll last page number.
509
510           The page number starts from 0. 0 is the first page.
511           This returns the last page number among the pages.
512
513           See: @.current_page, @.page_show and @.page_bring_in.]]
514         get {
515         }
516         values {
517            pagenumber_h: int; [[The horizontal page number]]
518            pagenumber_v: int; [[The vertical page number]]
519         }
520      }
521      @property current_page {
522         [[Scroll current page number.
523
524           The page number starts from 0. 0 is the first page.
525           Current page means the page which meets the top-left of the viewport.
526           If there are two or more pages in the viewport, it returns the number of the page
527           which meets the top-left of the viewport.
528
529           See: @.last_page, @.page_show and @.page_bring_in.]]
530         get {
531         }
532         values {
533            pagenumber_h: int; [[The horizontal page number]]
534            pagenumber_v: int; [[The vertical page number]]
535         }
536      }
537      @property content_viewport_geometry {
538          [[Content viewport geometry]]
539         get {
540         }
541         values {
542            x: int; [[X coordinate]]
543            y: int; [[Y coordinate]]
544            w: int; [[Width]]
545            h: int; [[Height]]
546         }
547      }
548      @property content_size {
549         [[Get the size of the content object
550
551           This gets the size of the content object of the scroller.]]
552         get {
553         }
554         values {
555            w: int; [[Width of the content object.]]
556            h: int; [[Height of the content object.]]
557
558         }
559      }
560      content_pos_set {
561          [[Set the content position]]
562         params {
563            @in x: int; [[X coordinate]]
564            @in y: int; [[Y coordinate]]
565            @in sig: bool; [[Send signals to the theme corresponding to the
566                             scroll direction, or if an edge was reached.]]
567         }
568      }
569      content_pos_get @const {
570          [[Get content position]]
571         params {
572            @out x: int; [[X coordinate]]
573            @out y: int; [[Y coordinate]]
574         }
575      }
576      page_show {
577         [[Show a specific virtual region within the scroller content object by page number.
578
579           0, 0 of the indicated page is located at the top-left of the viewport.
580           This will jump to the page directly without animation.
581
582           See @.page_bring_in.]]
583         params {
584            @in pagenumber_h: int; [[The horizontal page number]]
585            @in pagenumber_v: int; [[The vertical page number]]
586         }
587      }
588      region_bring_in {
589         [[Show a specific virtual region within the scroller content object.
590
591           This will ensure all (or part if it does not fit) of the designated
592           region in the virtual content object (0, 0 starting at the top-left of the
593           virtual content object) is shown within the scroller. Unlike
594           elm_scroller_region_show(), this allows the scroller to "smoothly slide"
595           to this location (if configuration in general calls for transitions). It
596           may not jump immediately to the new location and make take a while and
597           show other content along the way.
598
599           See @.content_region_show]]
600         params {
601            @in x: int; [[X coordinate of the region]]
602            @in y: int; [[Y coordinate of the region]]
603            @in w: int; [[Width of the region]]
604            @in h: int; [[Height of the region]]
605         }
606      }
607      page_bring_in {
608         [[Show a specific virtual region within the scroller content object by page number.
609
610           0, 0 of the indicated page is located at the top-left of the viewport.
611           This will slide to the page with animation.
612
613           @.page_show]]
614         params {
615            @in pagenumber_h: int; [[The horizontal page number]]
616            @in pagenumber_v: int; [[The vertical page number]]
617         }
618      }
619      content_region_show {
620         [[Show a specific virtual region within the scroller content object
621
622           This will ensure all (or part if it does not fit) of the designated
623           region in the virtual content object (0, 0 starting at the top-left of the
624           virtual content object) is shown within the scroller.]]
625         params {
626            @in x: int; [[X coordinate of the region]]
627            @in y: int; [[Y coordinate of the region]]
628            @in w: int; [[Width of the region]]
629            @in h: int; [[Height of the region]]
630         }
631      }
632      content_min_limit {
633         [[Prevent the scrollable from being smaller than the minimum size of the content.
634
635           By default the scroller will be as small as its design allows,
636           irrespective of its content. This will make the scroller minimum size the
637           right size horizontally and/or vertically to perfectly fit its content in
638           that direction.]]
639         params {
640            @in w: bool; [[Whether to limit the minimum horizontal size]]
641            @in h: bool; [[Whether to limit the minimum vertical size]]
642         }
643      }
644      @property item_loop_enabled {
645         [[Whether scrolling should loop around.]]
646         values {
647            enable: bool; [[True to enable looping.]]
648         }
649      }
650      reset_signals {
651        [[Call this if you have changed the group of the object passed to @.objects]]
652      }
653   }
654   implements {
655      class.constructor;
656      Efl.Object.constructor;
657      Efl.Ui.Focus.Manager.border_elements { get; }
658      Efl.Ui.Widget_Focus_Manager.focus_manager_create;
659      Efl.Ui.I18n.mirrored { set; }
660   }
661   events {
662      changed: void; [[Called when content changed]]
663   }
664}
665