The source code moved from the SPIN with license changed to Flora 1.1
[apps/native/home/homescreen-efl.git] / inc / livebox / livebox_panel.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 #ifndef __LIVEBOX_PANEL_H__
18 #define __LIVEBOX_PANEL_H__
19
20 #include <Elementary.h>
21 #include "tree.h"
22
23 /**
24  * @brief creates main livebox view
25  * @details Creates the livebox scroller and adds pages with liveboxes to it
26  * @param parent Layout where the livebox panel will be added
27  * @return Created livebox view or NULL on error
28  */
29 extern Evas_Object *livebox_panel_create(Evas_Object *parent);
30
31 /**
32  * @brief [brief description]
33  * @details [long description]
34  */
35 extern void livebox_panel_fill(void);
36
37 /**
38  *
39  */
40 void livebox_panel_update_dynamic_index(void);
41
42
43 /**
44  * @brief Creates dynamic index for livebox panel
45  */
46 extern void livebox_panel_create_dynamic_index(void);
47
48 /**
49  * @brief Sets livebox panel and its dynamic index to layout
50  * @note @p layout has to have "content" and "index" parts
51  * @param layout layout to add widgets to
52  */
53 extern void livebox_panel_set_content(Evas_Object *layout);
54
55 /**
56  * @brief Unsets livebox panel and its dynamic index from layout
57  * @note @p layout has to have "content" and "index" parts
58  * @param layout layout to remove widgets from
59  */
60 extern void livebox_panel_unset_content(Evas_Object *layout);
61
62 /**
63  * @brief Create empty livebox scroller
64  * @return The created scroller or null on error
65  */
66 extern Evas_Object *livebox_panel_create_scroller(void);
67
68 /**
69  * @brief destroys the livebox scroller and all of it pages
70  */
71 extern void livebox_panel_destroy(void);
72
73 /**
74  * Adds new livebox to @p page
75  * @param node widget representation in data structure
76  * @param page Page where livebox will be added
77  * @param livebox_pkgname livebo pkgname
78  * @param pos_x position in grid
79  * @param pos_y position in grid
80  * @param width width of livebox in grid
81  * @param height height of livebox in grid
82  */
83 void livebox_panel_add_livebox(Tree_node_t *node, Evas_Object *page,
84         const char *livebox_pkgname, int pos_x, int pos_y,
85         int width, int height,
86         char *content_info);
87
88 /**
89  * @brief Creates new livebox page
90  * @param node page representation in data structure
91  * @param livebox_scroller
92  * @return new empty page
93  */
94 extern Evas_Object *livebox_panel_add_page(Tree_node_t *node,
95         Evas_Object *livebox_scroller);
96
97 /**
98  * @brief adds an empty page (page layout is described in @p
99  * livebox_container.edc to the @p livebox_scroller
100  * @param livebox_scroller Scroller to which thepage is added
101  * @return TRUE on success FALSE otherwise
102  */
103 extern bool livebox_panel_add_empty_page(Evas_Object *livebox_scroller);
104
105 /**
106  * @brief Creates an empty page but doesn't add it to the scoller
107  * @param node page node in the data model
108  * @param livebox_scroller Scroller to which the page can be appended
109  * @return
110  */
111 extern Evas_Object *livebox_panel_create_empty_page(Tree_node_t *node,
112         Evas_Object *livebox_scroller);
113
114 /**
115  * @brief Changes the view mode of the livebox page
116  * @param turn_on True - edit mode on False - edit mode off
117  */
118 extern void livebox_panel_set_edit_mode_layout(bool turn_on);
119
120 /**
121  * @brief Changes the view mode of the livebox scroller
122  * @param close True - edit mode off False - edit mode on
123  */
124 extern void livebox_panel_change_edit_mode_state(bool close);
125
126 /**
127  * @brief Destroys given livebox page and all its content
128  * @param livebox_scroller_page page to destroy
129  */
130 extern void livebox_panel_destroy_page(Evas_Object *livebox_scroller_page);
131
132 /**
133  * @brief Function sets the reposition data
134  * @param x mouse position x
135  * @param y mouse position y
136  */
137 extern void livebox_panel_move_mouse_cb(int x, int y);
138
139 /**
140  *  @brief sets the pages geometry based on scroller geometry that consits them
141  */
142 extern void livebox_panel_refresh_content_size(void);
143
144 /**
145  * @brief Returns list of all pages in livebox panel
146  * @return Eina_List pointer of all livebox pages
147  */
148 extern Eina_List *livebox_panel_get_pages(void);
149
150 /**
151  * @brief Gets the livebox dynamic index
152  * @return Pointer to dynamic index box
153  */
154 extern Evas_Object *livebox_panel_get_index(void);
155
156 /**
157  * @brief Gets the livebox panel elm_scroller widget
158  * @return Pointer to elm_scroller with livebox pages
159  */
160 extern Evas_Object *livebox_panel_get(void);
161
162 /**
163  * @brief Function return true if add page is visible.
164  */
165 extern bool livebox_panel_check_if_add_page_is_visible(void);
166
167 /**
168  * @brief hide and shows add page button
169  * @param visible true - show false -hide
170  */
171 void livebox_panel_add_page_visible_state_set(bool visible);
172
173 /**
174  * @brief Returns true if 'add_page' is the curently selected livebox page
175  */
176 extern bool livebox_panel_is_add_page_selected(void);
177
178 /**
179  * Gets the current livebox page
180  * @return Current scroller page
181  */
182 extern Evas_Object *livebox_scroller_get_page(void);
183
184 /**
185  *  Returns the last page of the livebox_scroller
186  * @return last page or NULL on error
187  */
188 Evas_Object *livebox_scroller_get_last_page(void);
189
190 /**
191  * Check if a new widget page can be added. Shows a popup if not
192  * @return true if page can be added, false if not
193  */
194 extern bool livebox_panel_can_add_page(void);
195
196 /**
197  * Looks for empty space to put new widget to
198  *
199  * @param span_w widget size
200  * @param span_h widget height
201  * @param pos_x position to put new widget
202  * @param pos_y position to put new widget
203  * @return Index of page where new widget can be placed
204  */
205 extern int livebox_panel_find_empty_space(int span_w, int span_h,
206         int *pos_x, int *pos_y);
207
208 /**
209  */
210 extern void livebox_panel_resumed(void);
211
212 /**
213  */
214 extern void livebox_panel_paused(void);
215
216 #endif