summaryrefslogtreecommitdiff
path: root/inc/scroller.h
blob: ded4292efc2e4cab517b9ea588848965a53f18ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/*
* Copyright 2016  Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://floralicense.org/license/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef __TIZEN_SHARE_PANEL_SCROLLER_H__
#define __TIZEN_SHARE_PANEL_SCROLLER_H__

#include <Elementary.h>

/**
 * @ingroup View
 * @defgroup Scroller Scroller
 * @addtogroup Scroller
 * @{
 */

/**
 * @brief Enumerations for share panel event error.
 */
typedef enum {
	SCROLLER_EVENT_TYPE_INVALID = 0,
	SCROLLER_EVENT_TYPE_SCROLL,
	SCROLLER_EVENT_TYPE_APPEND_PAGE,
	SCROLLER_EVENT_TYPE_REMOVE_PAGE,
	SCROLLER_EVENT_TYPE_MAX,
} scroller_event_type_e;

/**
 * @brief Creates application page scroller.
 *
 * @param ui_manager The main parent layout
 * @param share_panel The share panel info structure
 *
 * @return created scroller
 */
extern Evas_Object *_scroller_create(Evas_Object *ui_manager, share_panel_s *share_panel);

/**
 * @brief Destroys application page scroller.
 *
 * @param scroller The scroller to be destroyed
 */
extern void _scroller_destroy(Evas_Object *scroller);

/**
 * @brief Appends new page to the scroller.
 *
 * @param scroller The scroller widget
 * @param page The page to be appended
 */
extern void _scroller_append_page(Evas_Object *scroller, Evas_Object *page);

/**
 * @brief Removes page form the scroller.
 *
 * @param scroller The scroller widget
 * @param page The page to be removed
 */
extern void _scroller_remove_page(Evas_Object *scroller, Evas_Object *page);

/**
 * @brief Appends list items into the scroller.
 *
 * @param scroller The scroller widget
 * @param list The list of applications to be appended
 * @param page_width Width of the pages to be appended
 * @param page_height Height of the pages to be appended
 */
extern void _scroller_append_list(Evas_Object *scroller, Eina_List *list, int page_width, int page_height);

/**
 * @brief Removes list items from the scroller.
 *
 * @param scroller The scroller widget
 * @param list The list of applications to be removed
 */
extern void _scroller_remove_list(Evas_Object *scroller, Eina_List *list);

/**
 * @brief Brings in scroller's page.
 *
 * @param scroller The scroller widget
 * @param page The page to be bringed
 */
extern void _scroller_bring_in_page(Evas_Object *scroller, Evas_Object *page);

/**
 * @brief Gets region of the scroller's index.
 *
 * @param scroller The scroller widget
 *
 * @return index's region
 */
extern int _scroller_get_region_index(Evas_Object *scroller);

/**
 * @brief Gets the number of pages in scroller's box.
 *
 * @param scroller The scroller widget
 *
 * @return number of pages
 */
extern unsigned int _scroller_count(Evas_Object *scroller);

/**
 * @brief Gets current scroller's scrolling status
 *
 * @param scroller The scroller widget
 *
 * @return scroller's scrolling status
 */
extern int _scroller_is_scrolling(Evas_Object *scroller);

/**
 * @brief Resizes share panel scroller.
 *
 * @param scroller The scroller widget
 * @param width The new width value to be set
 * @param height The new height value to be set
 */
extern void _scroller_resize(Evas_Object *scroller, int width, int height);

/**
 * @brief Registers scroller event callbacks.
 *
 * @param scroller The scroller widget
 * @param event_type The type of the event
 * @param event_cb The callback function to be called
 * @param data The data to be passed to the event callback function
 *
 * @return share_panel_error_e enumeration value
 */
extern int _scroller_register_event_cb(Evas_Object *scroller, int event_type, void (*event_cb)(Evas_Object *scroller, int event_type, void *event_info, void *data), void *data);

/**
 * @brief Unregister scroller event callbacks.
 *
 * @param scroller The scroller widget
 * @param event_type The type of the event
 * @param event_cb The scroller's event callback function to be unregistered
 *
 * @return share_panel_error_e enumeration value
 */
extern int _scroller_unregister_event_cb(Evas_Object *scroller, int event_type, void (*event_cb)(Evas_Object *scroller, int event_type, void *event_info, void *data));

/**
 * @}
 */

#endif /* __TIZEN_SHARE_PANEL_SCROLLER_H__ */