2 * Copyright 2012 Samsung Electronics Co., Ltd
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
8 * http://floralicense.org/license/
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.
17 #ifndef __LIVEBOX_PANEL_H__
18 #define __LIVEBOX_PANEL_H__
20 #include <Elementary.h>
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
29 extern Evas_Object *livebox_panel_create(Evas_Object *parent);
32 * @brief [brief description]
33 * @details [long description]
35 extern void livebox_panel_fill(void);
40 void livebox_panel_update_dynamic_index(void);
44 * @brief Creates dynamic index for livebox panel
46 extern void livebox_panel_create_dynamic_index(void);
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
53 extern void livebox_panel_set_content(Evas_Object *layout);
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
60 extern void livebox_panel_unset_content(Evas_Object *layout);
63 * @brief Create empty livebox scroller
64 * @return The created scroller or null on error
66 extern Evas_Object *livebox_panel_create_scroller(void);
69 * @brief destroys the livebox scroller and all of it pages
71 extern void livebox_panel_destroy(void);
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
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,
89 * @brief Creates new livebox page
90 * @param node page representation in data structure
91 * @param livebox_scroller
92 * @return new empty page
94 extern Evas_Object *livebox_panel_add_page(Tree_node_t *node,
95 Evas_Object *livebox_scroller);
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
103 extern bool livebox_panel_add_empty_page(Evas_Object *livebox_scroller);
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
111 extern Evas_Object *livebox_panel_create_empty_page(Tree_node_t *node,
112 Evas_Object *livebox_scroller);
115 * @brief Changes the view mode of the livebox page
116 * @param turn_on True - edit mode on False - edit mode off
118 extern void livebox_panel_set_edit_mode_layout(bool turn_on);
121 * @brief Changes the view mode of the livebox scroller
122 * @param close True - edit mode off False - edit mode on
124 extern void livebox_panel_change_edit_mode_state(bool close);
127 * @brief Destroys given livebox page and all its content
128 * @param livebox_scroller_page page to destroy
130 extern void livebox_panel_destroy_page(Evas_Object *livebox_scroller_page);
133 * @brief Function sets the reposition data
134 * @param x mouse position x
135 * @param y mouse position y
137 extern void livebox_panel_move_mouse_cb(int x, int y);
140 * @brief sets the pages geometry based on scroller geometry that consits them
142 extern void livebox_panel_refresh_content_size(void);
145 * @brief Returns list of all pages in livebox panel
146 * @return Eina_List pointer of all livebox pages
148 extern Eina_List *livebox_panel_get_pages(void);
151 * @brief Gets the livebox dynamic index
152 * @return Pointer to dynamic index box
154 extern Evas_Object *livebox_panel_get_index(void);
157 * @brief Gets the livebox panel elm_scroller widget
158 * @return Pointer to elm_scroller with livebox pages
160 extern Evas_Object *livebox_panel_get(void);
163 * @brief Function return true if add page is visible.
165 extern bool livebox_panel_check_if_add_page_is_visible(void);
168 * @brief hide and shows add page button
169 * @param visible true - show false -hide
171 void livebox_panel_add_page_visible_state_set(bool visible);
174 * @brief Returns true if 'add_page' is the curently selected livebox page
176 extern bool livebox_panel_is_add_page_selected(void);
179 * Gets the current livebox page
180 * @return Current scroller page
182 extern Evas_Object *livebox_scroller_get_page(void);
185 * Returns the last page of the livebox_scroller
186 * @return last page or NULL on error
188 Evas_Object *livebox_scroller_get_last_page(void);
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
194 extern bool livebox_panel_can_add_page(void);
197 * Looks for empty space to put new widget to
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
205 extern int livebox_panel_find_empty_space(int span_w, int span_h,
206 int *pos_x, int *pos_y);
210 extern void livebox_panel_resumed(void);
214 extern void livebox_panel_paused(void);