2 * @defgroup Naviframe Naviframe
5 * @brief Naviframe is a kind of view manager for the applications.
7 * Naviframe provides functions to switch different pages with stack
8 * mechanism. It means if one page(item) needs to be changed to the new one,
9 * then naviframe would push the new page to its internal stack. Of course,
10 * it can be back to the previous page by popping the top page. Naviframe
11 * provides some transition effect while the pages are switching (same as
14 * Since each item could keep the different styles, users could keep the
15 * same look & feel for the pages or different styles for the items in it's
18 * Default content parts of the naviframe that you can use content hooks for
20 * @li "default" - The main content of the current page
21 * @li "icon" - An icon in the title area of the current page
22 * @li "prev_btn" - A button of the current page to go to the previous page
23 * @li "next_btn" - A button of the current page to go to the next page
25 * Default text parts of the naviframe that you can use for are:
26 * @li "default" - Title label in the title area of the current page
27 * @li "subtitle" - Sub-title label in the title area of the current page
29 * Signals that you can add callbacks for are:
30 * @li "transition,finished" - When the transition is finished in changing the
32 * @li "title,clicked" - User clicked title area
34 * Default content parts of the naviframe items that you can use content hooks
36 * @li "default" - The main content of the page
37 * @li "icon" - An icon in the title area
38 * @li "prev_btn" - A button to go to the previous page
39 * @li "next_btn" - A button to go to the next page
41 * Default text parts of the naviframe items that you can use for are:
42 * @li "default" - Title label in the title area
43 * @li "subtitle" - Sub-title label in the title area
45 * Supported elm_object common APIs.
46 * @li elm_object_signal_emit
47 * @li elm_object_part_text_set
48 * @li elm_object_part_text_get
49 * @li elm_object_part_content_set
50 * @li elm_object_part_content_get
51 * @li elm_object_part_content_unset
53 * Supported elm_object_item common APIs.
54 * @li elm_object_item_part_text_set
55 * @li elm_object_item_part_text_get
56 * @li elm_object_item_part_content_set
57 * @li elm_object_item_part_content_get
58 * @li elm_object_item_part_content_unset
59 * @li elm_object_item_signal_emit
63 * @addtogroup Naviframe
68 * @brief Add a new Naviframe object to the parent.
70 * @param parent Parent object
71 * @return New object or @c NULL, if it cannot be created
75 EAPI Evas_Object *elm_naviframe_add(Evas_Object *parent);
78 * @brief Push a new item to the top of the naviframe stack (and show it).
80 * @param obj The naviframe object
81 * @param title_label The label in the title area. The name of the title
82 * label part is "elm.text.title"
83 * @param prev_btn The button to go to the previous item. If it is NULL,
84 * then naviframe will create a back button automatically. The name of
85 * the prev_btn part is "elm.swallow.prev_btn"
86 * @param next_btn The button to go to the next item. Or It could be just an
87 * extra function button. The name of the next_btn part is
88 * "elm.swallow.next_btn"
89 * @param content The main content object. The name of content part is
90 * "elm.swallow.content"
91 * @param item_style The current item style name. @c NULL would be default.
92 * @return The created item or @c NULL upon failure.
94 * The item pushed becomes one page of the naviframe, this item will be
95 * deleted when it is popped.
97 * @see also elm_naviframe_item_style_set()
98 * @see also elm_naviframe_item_insert_before()
99 * @see also elm_naviframe_item_insert_after()
101 * The following styles are available for this item:
106 EAPI Elm_Object_Item *elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style);
109 * @brief Insert a new item into the naviframe before item @p before.
111 * @param obj The naviframe object
112 * @param before The naviframe item to insert before.
113 * @param title_label The label in the title area. The name of the title
114 * label part is "elm.text.title"
115 * @param prev_btn The button to go to the previous item. If it is NULL,
116 * then naviframe will create a back button automatically. The name of
117 * the prev_btn part is "elm.swallow.prev_btn"
118 * @param next_btn The button to go to the next item. Or It could be just an
119 * extra function button. The name of the next_btn part is
120 * "elm.swallow.next_btn"
121 * @param content The main content object. The name of content part is
122 * "elm.swallow.content"
123 * @param item_style The current item style name. @c NULL would be default.
124 * @return The created item or @c NULL upon failure.
126 * The item is inserted into the naviframe straight away without any
127 * transition operations. This item will be deleted when it is popped.
129 * @see also elm_naviframe_item_style_set()
130 * @see also elm_naviframe_item_push()
131 * @see also elm_naviframe_item_insert_after()
133 * The following styles are available for this item:
138 EAPI Elm_Object_Item *elm_naviframe_item_insert_before(Evas_Object *obj, Elm_Object_Item *before, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style);
141 * @brief Insert a new item into the naviframe after item @p after.
143 * @param obj The naviframe object
144 * @param after The naviframe item to insert after.
145 * @param title_label The label in the title area. The name of the title
146 * label part is "elm.text.title"
147 * @param prev_btn The button to go to the previous item. If it is NULL,
148 * then naviframe will create a back button automatically. The name of
149 * the prev_btn part is "elm.swallow.prev_btn"
150 * @param next_btn The button to go to the next item. Or It could be just an
151 * extra function button. The name of the next_btn part is
152 * "elm.swallow.next_btn"
153 * @param content The main content object. The name of content part is
154 * "elm.swallow.content"
155 * @param item_style The current item style name. @c NULL would be default.
156 * @return The created item or @c NULL upon failure.
158 * The item is inserted into the naviframe straight away without any
159 * transition operations. This item will be deleted when it is popped.
161 * @see also elm_naviframe_item_style_set()
162 * @see also elm_naviframe_item_push()
163 * @see also elm_naviframe_item_insert_before()
165 * The following styles are available for this item:
170 EAPI Elm_Object_Item *elm_naviframe_item_insert_after(Evas_Object *obj, Elm_Object_Item *after, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style);
173 * @brief Pop an item that is on top of the stack
175 * @param obj The naviframe object
176 * @return @c NULL or the content object(if the
177 * elm_naviframe_content_preserve_on_pop_get is true).
179 * This pops an item that is on the top(visible) of the naviframe, makes it
180 * disappear, then deletes the item. The item that was underneath it on the
181 * stack will become visible.
183 * @see also elm_naviframe_content_preserve_on_pop_get()
187 EAPI Evas_Object *elm_naviframe_item_pop(Evas_Object *obj);
190 * @brief Pop the items between the top and the above one on the given item.
192 * @param it The naviframe item
196 EAPI void elm_naviframe_item_pop_to(Elm_Object_Item *it);
199 * Promote an item already in the naviframe stack to the top of the stack
201 * @param it The naviframe item
203 * This will take the indicated item and promote it to the top of the stack
204 * as if it had been pushed there. The item must already be inside the
205 * naviframe stack to work.
208 EAPI void elm_naviframe_item_promote(Elm_Object_Item *it);
211 * @brief preserve the content objects when items are popped.
213 * @param obj The naviframe object
214 * @param preserve Enable the preserve mode if EINA_TRUE, disable otherwise
216 * @see also elm_naviframe_content_preserve_on_pop_get()
220 EAPI void elm_naviframe_content_preserve_on_pop_set(Evas_Object *obj, Eina_Bool preserve);
223 * @brief Get a value whether preserve mode is enabled or not.
225 * @param obj The naviframe object
226 * @return If @c EINA_TRUE, preserve mode is enabled
228 * @see also elm_naviframe_content_preserve_on_pop_set()
232 EAPI Eina_Bool elm_naviframe_content_preserve_on_pop_get(const Evas_Object *obj);
235 * @brief Get a top item on the naviframe stack
237 * @param obj The naviframe object
238 * @return The top item on the naviframe stack or @c NULL, if the stack is
243 EAPI Elm_Object_Item *elm_naviframe_top_item_get(const Evas_Object *obj);
246 * @brief Get a bottom item on the naviframe stack
248 * @param obj The naviframe object
249 * @return The bottom item on the naviframe stack or @c NULL, if the stack is
254 EAPI Elm_Object_Item *elm_naviframe_bottom_item_get(const Evas_Object *obj);
257 * @brief Set an item style
259 * @param it The naviframe item
260 * @param item_style The current item style name. @c NULL would be default
262 * The following styles are available for this item:
265 * @see also elm_naviframe_item_style_get()
269 EAPI void elm_naviframe_item_style_set(Elm_Object_Item *it, const char *item_style);
272 * @brief Get an item style
274 * @param it The naviframe item
275 * @return The current item style name
277 * @see also elm_naviframe_item_style_set()
281 EAPI const char *elm_naviframe_item_style_get(const Elm_Object_Item *it);
284 * @brief Show/Hide the title area
286 * @param it The naviframe item
287 * @param visible If @c EINA_TRUE, title area will be visible, hidden
290 * When the title area is invisible, then the controls would be hidden so as * to expand the content area to full-size.
292 * @see also elm_naviframe_item_title_visible_get()
296 EAPI void elm_naviframe_item_title_visible_set(Elm_Object_Item *it, Eina_Bool visible);
299 * @brief Get a value whether title area is visible or not.
301 * @param it The naviframe item
302 * @return If @c EINA_TRUE, title area is visible
304 * @see also elm_naviframe_item_title_visible_set()
308 EAPI Eina_Bool elm_naviframe_item_title_visible_get(const Elm_Object_Item *it);
311 * @brief Set creating prev button automatically or not
313 * @param obj The naviframe object
314 * @param auto_pushed If @c EINA_TRUE, the previous button(back button) will
315 * be created internally when you pass the @c NULL to the prev_btn
316 * parameter in elm_naviframe_item_push
318 * @see also elm_naviframe_item_push()
322 EAPI void elm_naviframe_prev_btn_auto_pushed_set(Evas_Object *obj, Eina_Bool auto_pushed);
325 * @brief Get a value whether prev button(back button) will be auto pushed or
328 * @param obj The naviframe object
329 * @return If @c EINA_TRUE, prev button will be auto pushed.
331 * @see also elm_naviframe_item_push()
332 * elm_naviframe_prev_btn_auto_pushed_set()
336 EAPI Eina_Bool elm_naviframe_prev_btn_auto_pushed_get(const Evas_Object *obj);
339 * @brief Get a list of all the naviframe items.
341 * @param obj The naviframe object
342 * @return An Eina_List of naviframe items, #Elm_Object_Item,
343 * or @c NULL on failure.
344 * @note The returned list MUST be freed.
348 EAPI Eina_List *elm_naviframe_items_get(const Evas_Object *obj) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
351 * @brief Set the event enabled when pushing/popping items
353 * If @c enabled is EINA_TRUE, the contents of the naviframe item will
354 * receives events from mouse and keyboard during view changing such as
357 * @param obj The naviframe object
358 * @param enabled Events are received when enabled is @c EINA_TRUE, and
361 * @warning Events will be blocked by calling evas_object_freeze_events_set()
362 * internally. So don't call the API whiling pushing/popping items.
364 * @see elm_naviframe_event_enabled_get()
365 * @see evas_object_freeze_events_set()
369 EAPI void elm_naviframe_event_enabled_set(Evas_Object *obj, Eina_Bool enabled);
372 * @brief Get the value of event enabled status.
374 * @param obj The naviframe object
375 * @return EINA_TRUE, when event is enabled
377 * @see elm_naviframe_event_enabled_set()
381 EAPI Eina_Bool elm_naviframe_event_enabled_get(const Evas_Object *obj);
384 * @brief Simple version of item_push.
386 * @see elm_naviframe_item_push
388 static inline Elm_Object_Item *
389 elm_naviframe_item_simple_push(Evas_Object *obj, Evas_Object *content)
392 it = elm_naviframe_item_push(obj, NULL, NULL, NULL, content, NULL);
393 elm_naviframe_item_title_visible_set(it, EINA_FALSE);
398 * @brief Simple version of item_promote.
400 * @see elm_naviframe_item_promote
402 EAPI void elm_naviframe_item_simple_promote(Evas_Object *obj, Evas_Object *content);