Tizen Native API

Functions

void elm_scroller_propagate_events_set (Elm_Scroller *obj, Eina_Bool propagation)
 Set event propagation on a scroller.
Eina_Bool elm_scroller_propagate_events_get (const Elm_Scroller *obj)
 Get event propagation for a scroller.
void elm_scroller_page_scroll_limit_set (const Elm_Scroller *obj, int page_limit_h, int page_limit_v)
 Set the maximum of the movable page at a flicking.
void elm_scroller_page_scroll_limit_get (const Elm_Scroller *obj, int *page_limit_h, int *page_limit_v)
 Get the maximum of the movable page at a flicking.
Evas_Objectelm_scroller_add (Evas_Object *parent)
 Add a new scroller to the parent.
void elm_scroller_content_min_limit (Evas_Object *obj, Eina_Bool w, Eina_Bool h)
 Make the scroller minimum size limited to the minimum size of the content.
void elm_scroller_region_show (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
 Show a specific virtual region within the scroller content object.
void elm_scroller_policy_set (Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v)
 Set the scrollbar visibility policy.
void elm_scroller_policy_get (const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
 Get scrollbar visibility policy.
void elm_scroller_single_direction_set (Evas_Object *obj, Elm_Scroller_Single_Direction single_dir)
 Set the type of single direction scroll.
Elm_Scroller_Single_Direction elm_scroller_single_direction_get (const Evas_Object *obj)
 Get the type of single direction scroll.
void elm_scroller_region_get (const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
 Get the currently visible content region.
void elm_scroller_child_size_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
 Get the size of the content object.
void elm_scroller_bounce_set (Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
 Set bouncing behavior.
void elm_scroller_bounce_get (const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce)
 Get the bounce behaviour.
void elm_scroller_page_relative_set (Evas_Object *obj, double h_pagerel, double v_pagerel)
 Set scroll page size relative to viewport size.
void elm_scroller_page_relative_get (const Evas_Object *obj, double *h_pagerel, double *v_pagerel)
 Get a given scroller widget's scrolling page size, relative to its viewport size.
void elm_scroller_page_size_set (Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize)
 Set scroll page size.
void elm_scroller_page_size_get (const Evas_Object *obj, Evas_Coord *h_pagesize, Evas_Coord *v_pagesize)
 Get a scroller widget's current page size.
void elm_scroller_current_page_get (const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber)
 Get scroll current page number.
void elm_scroller_last_page_get (const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber)
 Get scroll last page number.
void elm_scroller_page_show (Evas_Object *obj, int h_pagenumber, int v_pagenumber)
 Show a specific virtual region within the scroller content object by page number.
void elm_scroller_page_bring_in (Evas_Object *obj, int h_pagenumber, int v_pagenumber)
 Show a specific virtual region within the scroller content object by page number.
void elm_scroller_region_bring_in (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
 Show a specific virtual region within the scroller content object.
void elm_scroller_gravity_set (Evas_Object *obj, double x, double y)
 Set scrolling gravity on a scroller.
void elm_scroller_gravity_get (const Evas_Object *obj, double *x, double *y)
 Get scrolling gravity values for a scroller.
void elm_scroller_movement_block_set (Evas_Object *obj, Elm_Scroller_Movement_Block block)
 Set blocking of scrolling (per axis) on a given scroller.
Elm_Scroller_Movement_Block elm_scroller_movement_block_get (const Evas_Object *obj)
 Get a scroller's scroll blocking state.
void elm_scroller_loop_set (Evas_Object *obj, Eina_Bool loop_h, Eina_Bool loop_v)
 Set an infinite loop_ for a scroller.

scroller_inheritance_tree.png

A scroller holds (and clips) a single object and "scrolls it around". This means that it allows the user to use a scroll bar (or a finger) to drag the viewable region around, moving through a much larger object that is contained in the scroller. The scroller will always have a small minimum size by default as it won't be limited by the contents of the scroller.

This widget inherits from the Layout one, so that all the functions acting on it also work for scroller objects.

This widget emits the following signals, besides the ones sent from

  • "edge,left" - the left edge of the content has been reached
  • "edge,right" - the right edge of the content has been reached
  • "edge,top" - the top edge of the content has been reached
  • "edge,bottom" - the bottom edge of the content has been reached
  • "scroll" - the content has been scrolled (moved)
  • "scroll,left" - the content has been scrolled (moved) leftwards
  • "scroll,right" - the content has been scrolled (moved) rightwards
  • "scroll,up" - the content has been scrolled (moved) upwards
  • "scroll,down" - the content has been scrolled (moved) downwards
  • "scroll,anim,start" - scrolling animation has started
  • "scroll,anim,stop" - scrolling animation has stopped
  • "scroll,drag,start" - dragging the contents around has started
  • "scroll,drag,stop" - dragging the contents around has stopped
  • "vbar,drag" - the vertical scroll bar has been dragged
  • "vbar,press" - the vertical scroll bar has been pressed
  • "vbar,unpress" - the vertical scroll bar has been unpressed
  • "hbar,drag" - the horizontal scroll bar has been dragged
  • "hbar,press" - the horizontal scroll bar has been pressed
  • "hbar,unpress" - the horizontal scroll bar has been unpressed
  • "scroll,page,changed" - the visible page has changed
  • "focused" - When the scroller has received focus. (since 1.8)
  • "unfocused" - When the scroller has lost focus. (since 1.8)

This widget implements the elm-scrollable-interface interface. Its (non-deprecated) API functions, except for elm_scroller_add(), which gives basic scroller objects, are meant to be a basis for all other scrollable widgets (i.e. widgets implementing elm-scrollable-interface). So, they will work both on pristine scroller widgets and on other "specialized" scrollable widgets.

Note:
The "scroll,anim,*" and "scroll,drag,*" signals are only emitted by user intervention.
When Elementary is under its default profile and theme (meant for touch interfaces), scroll bars will not be draggable -- their function is merely to indicate how much has been scrolled.
When Elementary is under its desktop/standard profile and theme, the thumb scroll (a.k.a. finger scroll) won't work.

Default content parts of the scroller widget that you can use are:

  • "default" - A content of the scroller

Enumeration Type Documentation

Type that blocks the scroll movement in one or more direction.

See also:
elm_scroller_movement_block()
Since (EFL) :
1.8
Enumerator:
ELM_SCROLLER_MOVEMENT_NO_BLOCK 

Do not block movements

ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL 

Block vertical movements

ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL 

Block horizontal movements

Type that controls when scrollbars should appear.

See also:
elm_scroller_policy_set()
Enumerator:
ELM_SCROLLER_POLICY_AUTO 

Show scrollbars as needed

ELM_SCROLLER_POLICY_ON 

Always show scrollbars

ELM_SCROLLER_POLICY_OFF 

Never show scrollbars

Type that controls how the content is scrolled.

See also:
elm_scroller_single_direction_set()
Enumerator:
ELM_SCROLLER_SINGLE_DIRECTION_NONE 

Scroll every direction

ELM_SCROLLER_SINGLE_DIRECTION_SOFT 

Scroll single direction if the direction is certain

ELM_SCROLLER_SINGLE_DIRECTION_HARD 

Scroll only single direction


Function Documentation

Add a new scroller to the parent.

Since :
2.3
Parameters:
[in]parentThe parent object
Returns:
The new object or NULL if it cannot be created
void elm_scroller_bounce_get ( const Evas_Object obj,
Eina_Bool h_bounce,
Eina_Bool v_bounce 
)

Get the bounce behaviour.

Since :
2.3
Parameters:
[in]objThe Scroller object
[out]h_bounceWill the scroller bounce horizontally or not
[out]v_bounceWill the scroller bounce vertically or not
See also:
elm_scroller_bounce_set()
void elm_scroller_bounce_set ( Evas_Object obj,
Eina_Bool  h_bounce,
Eina_Bool  v_bounce 
)

Set bouncing behavior.

Since :
2.3
Parameters:
[in]objThe scroller object
[in]h_bounceAllow bounce horizontally
[in]v_bounceAllow bounce vertically
Remarks:
When scrolling, the scroller may "bounce" when reaching an edge of the content object. This is a visual way to indicate the end has been reached. This is enabled by default for both axis. This API will set if it is enabled for the given axis with the boolean parameters for each axis.
void elm_scroller_child_size_get ( const Evas_Object obj,
Evas_Coord w,
Evas_Coord h 
)

Get the size of the content object.

Since :
2.3
Parameters:
[in]objThe scroller object
[out]wWidth of the content object.
[out]hHeight of the content object.
Remarks:
This gets the size of the content object of the scroller.

Make the scroller minimum size limited to the minimum size of the content.

Since :
2.3
Parameters:
[in]objThe scroller object
[in]wEnable limiting minimum size horizontally
[in]hEnable limiting minimum size vertically
Remarks:
By default the scroller will be as small as its design allows, irrespective of its content. This will make the scroller minimum size the right size horizontally and/or vertically to perfectly fit its content in that direction.
void elm_scroller_current_page_get ( const Evas_Object obj,
int *  h_pagenumber,
int *  v_pagenumber 
)

Get scroll current page number.

Since :
2.3
Parameters:
[in]objThe scroller object
[out]h_pagenumberThe horizontal page number
[out]v_pagenumberThe vertical page number
Remarks:
The page number starts from 0. 0 is the first page. Current page means the page which meets the top-left of the viewport. If there are two or more pages in the viewport, it returns the number of the page which meets the top-left of the viewport.
See also:
elm_scroller_last_page_get()
elm_scroller_page_show()
elm_scroller_page_bring_in()
void elm_scroller_gravity_get ( const Evas_Object obj,
double *  x,
double *  y 
)

Get scrolling gravity values for a scroller.

Since :
2.3
Parameters:
[in]objThe scroller object
[out]xThe scrolling horizontal gravity
[out]yThe scrolling vertical gravity
Remarks:
This gets gravity values for a scroller.
See also:
elm_scroller_gravity_set()
void elm_scroller_gravity_set ( Evas_Object obj,
double  x,
double  y 
)

Set scrolling gravity on a scroller.

Since :
2.3
Parameters:
[in]objThe scroller object
[in]xThe scrolling horizontal gravity
[in]yThe scrolling vertical gravity
Remarks:
The gravity, defines how the scroller will adjust its view when the size of the scroller contents increase.
The scroller will adjust the view to glue itself as follows.
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
Default values for x and y are 0.0
void elm_scroller_last_page_get ( const Evas_Object obj,
int *  h_pagenumber,
int *  v_pagenumber 
)

Get scroll last page number.

Since :
2.3
Parameters:
[in]objThe scroller object
[out]h_pagenumberThe horizontal page number
[out]v_pagenumberThe vertical page number
Remarks:
The page number starts from 0. 0 is the first page. This returns the last page number among the pages.
See also:
elm_scroller_current_page_get()
elm_scroller_page_show()
elm_scroller_page_bring_in()
void elm_scroller_loop_set ( Evas_Object obj,
Eina_Bool  loop_h,
Eina_Bool  loop_v 
)

Set an infinite loop_ for a scroller.

Since :
2.3
Parameters:
[in]objThe scroller object
[in]loop_hThe scrolling horizontal loop
[in]loop_vThe scrolling vertical loop
Remarks:
This function sets the infinite loop horizontally or vertically. If the content is set, it will be shown repeatedly.
Since (EFL) :
1.14

Get a scroller's scroll blocking state.

Since :
2.3
Parameters:
[in]parentThe scroller object
Returns:
The blocking state
Since (EFL) :
1.8
See also:
elm_scroller_movement_block_set() for more details

Set blocking of scrolling (per axis) on a given scroller.

Since :
2.3
Parameters:
[in]objThe scroller object
[in]blockThe axis to block
Remarks:
This function will block scrolling movement (by input of a user) in a given direction. One can disable movements in the X axis, the Y axis or both. The default value is ELM_SCROLLER_MOVEMENT_NO_BLOCK, where movements are allowed in both directions.
What makes this function different from elm_object_scroll_freeze_push(), elm_object_scroll_hold_push() and elm_object_scroll_lock_x_set() (or elm_object_scroll_lock_y_set()) is that it doesn't propagate its effects to any parent or child widget of obj. Only the target scrollable widget will be locked with regard to scrolling.
Since (EFL) :
1.8
void elm_scroller_page_bring_in ( Evas_Object obj,
int  h_pagenumber,
int  v_pagenumber 
)

Show a specific virtual region within the scroller content object by page number.

Since :
2.3
Parameters:
[in]objThe scroller object
[in]h_pagenumberThe horizontal page number
[in]v_pagenumberThe vertical page number
Remarks:
0, 0 of the indicated page is located at the top-left of the viewport. This will slide to the page with animation.
Example of usage:
 sc = elm_scroller_add(win);
 elm_object_content_set(sc, content);
 elm_scroller_page_relative_set(sc, 1, 0);
 elm_scroller_last_page_get(sc, &h_page, &v_page);
 elm_scroller_page_bring_in(sc, h_page, v_page);
See also:
elm_scroller_page_show()
void elm_scroller_page_relative_get ( const Evas_Object obj,
double *  h_pagerel,
double *  v_pagerel 
)

Get a given scroller widget's scrolling page size, relative to its viewport size.

Since :
2.3
Parameters:
[in]objThe scroller object
[out]h_pagerelPointer to a variable where to store the horizontal page (relative) size
[out]v_pagerelPointer to a variable where to store the vertical page (relative) size
See also:
elm_scroller_page_relative_set() for more details
Since (EFL) :
1.7
void elm_scroller_page_relative_set ( Evas_Object obj,
double  h_pagerel,
double  v_pagerel 
)

Set scroll page size relative to viewport size.

Since :
2.3
Parameters:
[in]objThe scroller object
[in]h_pagerelThe horizontal page relative size
[in]v_pagerelThe vertical page relative size
Remarks:
The scroller is capable of limiting scrolling by the user to "pages". That is to jump by and only show a "whole page" at a time as if the continuous area of the scroller content is split into page sized pieces. This sets the size of a page relative to the viewport of the scroller. 1.0 is "1 viewport" is size (horizontally or vertically). 0.0 turns it off in that axis. This is mutually exclusive with page size (see elm_scroller_page_size_set() for more information). Likewise 0.5 is "half a viewport". Sane usable values are normally between 0.0 and 1.0 including 1.0. If you only want 1 axis to be page "limited", use 0.0 for the other axis.
void elm_scroller_page_scroll_limit_get ( const Elm_Scroller *  obj,
int *  page_limit_h,
int *  page_limit_v 
)

Get the maximum of the movable page at a flicking.

Since :
2.3
See also:
elm_scroller_page_scroll_limit_set()
Since (EFL) :
1.8
Parameters:
[in]objThe elm scroller object
[in]page_limit_hThe maximum of the movable horizontal page
[in]page_limit_vThe maximum of the movable vertical page
void elm_scroller_page_scroll_limit_set ( const Elm_Scroller *  obj,
int  page_limit_h,
int  page_limit_v 
)

Set the maximum of the movable page at a flicking.

Since :
2.3
Remarks:
The value of maximum movable page should be more than 1.
See also:
elm_scroller_page_scroll_limit_get()
Since (EFL) :
1.8
Parameters:
[in]objThe elm scroller object
[in]page_limit_hThe maximum of the movable horizontal page
[in]page_limit_vThe maximum of the movable vertical page
void elm_scroller_page_show ( Evas_Object obj,
int  h_pagenumber,
int  v_pagenumber 
)

Show a specific virtual region within the scroller content object by page number.

Since :
2.3
Parameters:
[in]objThe scroller object
[in]h_pagenumberThe horizontal page number
[in]v_pagenumberThe vertical page number
Remarks:
0, 0 of the indicated page is located at the top-left of the viewport. This will jump to the page directly without animation.
Example of usage:
 sc = elm_scroller_add(win);
 elm_object_content_set(sc, content);
 elm_scroller_page_relative_set(sc, 1, 0);
 elm_scroller_current_page_get(sc, &h_page, &v_page);
 elm_scroller_page_show(sc, h_page + 1, v_page);
See also:
elm_scroller_page_bring_in()
void elm_scroller_page_size_get ( const Evas_Object obj,
Evas_Coord h_pagesize,
Evas_Coord v_pagesize 
)

Get a scroller widget's current page size.

Since :
2.3
Parameters:
[in]objThe scroller object
[out]h_pagesizeWhere to store its horizontal page size
[out]v_pagesizeWhere to store its vertical page size
See also:
elm_scroller_page_size_set() for more details
elm_scroller_page_relative_set()
Since (EFL) :
1.7
void elm_scroller_page_size_set ( Evas_Object obj,
Evas_Coord  h_pagesize,
Evas_Coord  v_pagesize 
)

Set scroll page size.

Since :
2.3
Parameters:
[in]objThe scroller object
[in]h_pagesizeThe horizontal page size
[in]v_pagesizeThe vertical page size
Remarks:
This sets the page size to an absolute fixed value, with 0 turning it off for that axis.
See also:
elm_scroller_page_relative_set()
elm_scroller_page_size_get()
void elm_scroller_policy_get ( const Evas_Object obj,
Elm_Scroller_Policy policy_h,
Elm_Scroller_Policy policy_v 
)

Get scrollbar visibility policy.

Since :
2.3
Parameters:
[in]objThe scroller object
[out]policy_hHorizontal scrollbar policy
[out]policy_vVertical scrollbar policy
See also:
elm_scroller_policy_set()
void elm_scroller_policy_set ( Evas_Object obj,
Elm_Scroller_Policy  policy_h,
Elm_Scroller_Policy  policy_v 
)

Set the scrollbar visibility policy.

Since :
2.3
Parameters:
[in]objThe scroller object
[in]policy_hHorizontal scrollbar policy
[in]policy_vVertical scrollbar policy
Remarks:
This sets the scrollbar visibility policy for the given scroller. ELM_SCROLLER_POLICY_AUTO means the scrollbar is made visible if it is needed, and otherwise kept hidden. ELM_SCROLLER_POLICY_ON turns it on all the time, and ELM_SCROLLER_POLICY_OFF always keeps it off. This applies respectively for the horizontal and vertical scrollbars.
Eina_Bool elm_scroller_propagate_events_get ( const Elm_Scroller *  obj)

Get event propagation for a scroller.

Since :
2.3
Returns:
The propagation state
Remarks:
This gets the event propagation for a scroller.
See also:
elm_scroller_propagate_events_set()
Parameters:
[in]objThe elm scroller object
void elm_scroller_propagate_events_set ( Elm_Scroller *  obj,
Eina_Bool  propagation 
)

Set event propagation on a scroller.

Since :
2.3
Remarks:
This enables or disables event propagation from the scroller content to the scroller and its parent. By default event propagation is enabled.
Parameters:
[in]objThe elm scroller object
[in]propagationIf propagation is enabled or not

Show a specific virtual region within the scroller content object.

Since :
2.3
Parameters:
[in]objThe scroller object
[in]xX coordinate of the region
[in]yY coordinate of the region
[in]wWidth of the region
[in]hHeight of the region
Remarks:
This will ensure all (or part if it does not fit) of the designated region in the virtual content object (0, 0 starting at the top-left of the virtual content object) is shown within the scroller. Unlike elm_scroller_region_show(), this allow the scroller to "smoothly slide" to this location (if configuration in general calls for transitions). It may not jump immediately to the new location and make take a while and show other content along the way.
See also:
elm_scroller_region_show()
void elm_scroller_region_get ( const Evas_Object obj,
Evas_Coord x,
Evas_Coord y,
Evas_Coord w,
Evas_Coord h 
)

Get the currently visible content region.

Since :
2.3
Parameters:
[in]objThe scroller object
[out]xX coordinate of the region
[out]yY coordinate of the region
[out]wWidth of the region
[out]hHeight of the region
Remarks:
This gets the current region in the content object that is visible through the scroller. The region co-ordinates are returned in the x, y, w, h values pointed to.
All coordinates are relative to the content.
See also:
elm_scroller_region_show()

Show a specific virtual region within the scroller content object.

Since :
2.3
Parameters:
[in]objThe scroller object
[in]xX coordinate of the region
[in]yY coordinate of the region
[in]wWidth of the region
[in]hHeight of the region
Remarks:
This will ensure all (or part if it does not fit) of the designated region in the virtual content object (0, 0 starting at the top-left of the virtual content object) is shown within the scroller.

Get the type of single direction scroll.

Since :
2.3
Parameters:
[in]objThe scroller object
Returns:
the type of single direction
See also:
elm_scroller_single_direction_get()
Since (EFL) :
1.8

Set the type of single direction scroll.

Since :
2.3
Parameters:
[in]objThe scroller object
[in]single_dirThe type of single direction
See also:
elm_scroller_single_direction_get()
Since (EFL) :
1.8