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 * Item Signals that you can add callbacks for are:
35 * @li "show,begin" - When the item is started to be top item.
36 * @li "hide,finished" - When a new top item is finished to push onto the
39 * Default content parts of the naviframe items that you can use content hooks
41 * @li "default" - The main content of the page
42 * @li "icon" - An icon in the title area
43 * @li "prev_btn" - A button to go to the previous page
44 * @li "next_btn" - A button to go to the next page
46 * Default text parts of the naviframe items that you can use for are:
47 * @li "default" - Title label in the title area
48 * @li "subtitle" - Sub-title label in the title area
50 * Supported elm_object common APIs.
51 * @li elm_object_signal_emit
52 * @li elm_object_part_text_set
53 * @li elm_object_part_text_get
54 * @li elm_object_part_content_set
55 * @li elm_object_part_content_get
56 * @li elm_object_part_content_unset
58 * Supported elm_object_item common APIs.
59 * @li elm_object_item_part_text_set
60 * @li elm_object_item_part_text_get
61 * @li elm_object_item_part_content_set
62 * @li elm_object_item_part_content_get
63 * @li elm_object_item_part_content_unset
64 * @li elm_object_item_signal_emit
68 * @addtogroup Naviframe
73 * @brief Add a new Naviframe object to the parent.
75 * @param parent Parent object
76 * @return New object or @c NULL, if it cannot be created
80 EAPI Evas_Object *elm_naviframe_add(Evas_Object *parent);
83 * @brief Push a new item to the top of the naviframe stack (and show it).
85 * @param obj The naviframe object
86 * @param title_label The label in the title area. The name of the title
87 * label part is "elm.text.title"
88 * @param prev_btn The button to go to the previous item. If it is NULL,
89 * then naviframe will create a back button automatically. The name of
90 * the prev_btn part is "elm.swallow.prev_btn"
91 * @param next_btn The button to go to the next item. Or It could be just an
92 * extra function button. The name of the next_btn part is
93 * "elm.swallow.next_btn"
94 * @param content The main content object. The name of content part is
95 * "elm.swallow.content"
96 * @param item_style The current item style name. @c NULL would be default.
97 * @return The created item or @c NULL upon failure.
99 * The item pushed becomes one page of the naviframe, this item will be
100 * deleted when it is popped.
102 * @see also elm_naviframe_item_style_set()
103 * @see also elm_naviframe_item_insert_before()
104 * @see also elm_naviframe_item_insert_after()
106 * The following styles are available for this item:
111 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);
114 * @brief Insert a new item into the naviframe before item @p before.
116 * @param obj The naviframe object
117 * @param before The naviframe item to insert before.
118 * @param title_label The label in the title area. The name of the title
119 * label part is "elm.text.title"
120 * @param prev_btn The button to go to the previous item. If it is NULL,
121 * then naviframe will create a back button automatically. The name of
122 * the prev_btn part is "elm.swallow.prev_btn"
123 * @param next_btn The button to go to the next item. Or It could be just an
124 * extra function button. The name of the next_btn part is
125 * "elm.swallow.next_btn"
126 * @param content The main content object. The name of content part is
127 * "elm.swallow.content"
128 * @param item_style The current item style name. @c NULL would be default.
129 * @return The created item or @c NULL upon failure.
131 * The item is inserted into the naviframe straight away without any
132 * transition operations. This item will be deleted when it is popped.
134 * @see also elm_naviframe_item_style_set()
135 * @see also elm_naviframe_item_push()
136 * @see also elm_naviframe_item_insert_after()
138 * The following styles are available for this item:
143 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);
146 * @brief Insert a new item into the naviframe after item @p after.
148 * @param obj The naviframe object
149 * @param after The naviframe item to insert after.
150 * @param title_label The label in the title area. The name of the title
151 * label part is "elm.text.title"
152 * @param prev_btn The button to go to the previous item. If it is NULL,
153 * then naviframe will create a back button automatically. The name of
154 * the prev_btn part is "elm.swallow.prev_btn"
155 * @param next_btn The button to go to the next item. Or It could be just an
156 * extra function button. The name of the next_btn part is
157 * "elm.swallow.next_btn"
158 * @param content The main content object. The name of content part is
159 * "elm.swallow.content"
160 * @param item_style The current item style name. @c NULL would be default.
161 * @return The created item or @c NULL upon failure.
163 * The item is inserted into the naviframe straight away without any
164 * transition operations. This item will be deleted when it is popped.
166 * @see also elm_naviframe_item_style_set()
167 * @see also elm_naviframe_item_push()
168 * @see also elm_naviframe_item_insert_before()
170 * The following styles are available for this item:
175 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);
178 * @brief Pop an item that is on top of the stack
180 * @param obj The naviframe object
181 * @return @c NULL or the content object(if the
182 * elm_naviframe_content_preserve_on_pop_get is true).
184 * This pops an item that is on the top(visible) of the naviframe, makes it
185 * disappear, then deletes the item. The item that was underneath it on the
186 * stack will become visible.
188 * @see also elm_naviframe_content_preserve_on_pop_get()
192 EAPI Evas_Object *elm_naviframe_item_pop(Evas_Object *obj);
195 * @brief Pop the items between the top and the above one on the given item.
197 * @param it The naviframe item
201 EAPI void elm_naviframe_item_pop_to(Elm_Object_Item *it);
204 * Promote an item already in the naviframe stack to the top of the stack
206 * @param it The naviframe item
208 * This will take the indicated item and promote it to the top of the stack
209 * as if it had been pushed there. The item must already be inside the
210 * naviframe stack to work.
213 EAPI void elm_naviframe_item_promote(Elm_Object_Item *it);
216 * @brief preserve the content objects when items are popped.
218 * @param obj The naviframe object
219 * @param preserve Enable the preserve mode if EINA_TRUE, disable otherwise
221 * @see also elm_naviframe_content_preserve_on_pop_get()
225 EAPI void elm_naviframe_content_preserve_on_pop_set(Evas_Object *obj, Eina_Bool preserve);
228 * @brief Get a value whether preserve mode is enabled or not.
230 * @param obj The naviframe object
231 * @return If @c EINA_TRUE, preserve mode is enabled
233 * @see also elm_naviframe_content_preserve_on_pop_set()
237 EAPI Eina_Bool elm_naviframe_content_preserve_on_pop_get(const Evas_Object *obj);
240 * @brief Get a top item on the naviframe stack
242 * @param obj The naviframe object
243 * @return The top item on the naviframe stack or @c NULL, if the stack is
248 EAPI Elm_Object_Item *elm_naviframe_top_item_get(const Evas_Object *obj);
251 * @brief Get a bottom item on the naviframe stack
253 * @param obj The naviframe object
254 * @return The bottom item on the naviframe stack or @c NULL, if the stack is
259 EAPI Elm_Object_Item *elm_naviframe_bottom_item_get(const Evas_Object *obj);
262 * @brief Set an item style
264 * @param it The naviframe item
265 * @param item_style The current item style name. @c NULL would be default
267 * The following styles are available for this item:
270 * @see also elm_naviframe_item_style_get()
274 EAPI void elm_naviframe_item_style_set(Elm_Object_Item *it, const char *item_style);
277 * @brief Get an item style
279 * @param it The naviframe item
280 * @return The current item style name
282 * @see also elm_naviframe_item_style_set()
286 EAPI const char *elm_naviframe_item_style_get(const Elm_Object_Item *it);
289 * @brief Show/Hide the title area
291 * @param it The naviframe item
292 * @param visible If @c EINA_TRUE, title area will be visible, hidden
295 * When the title area is invisible, then the controls would be hidden so as * to expand the content area to full-size.
297 * @see also elm_naviframe_item_title_visible_get()
301 EAPI void elm_naviframe_item_title_visible_set(Elm_Object_Item *it, Eina_Bool visible);
304 * @brief Get a value whether title area is visible or not.
306 * @param it The naviframe item
307 * @return If @c EINA_TRUE, title area is visible
309 * @see also elm_naviframe_item_title_visible_set()
313 EAPI Eina_Bool elm_naviframe_item_title_visible_get(const Elm_Object_Item *it);
316 * @brief Set creating prev button automatically or not
318 * @param obj The naviframe object
319 * @param auto_pushed If @c EINA_TRUE, the previous button(back button) will
320 * be created internally when you pass the @c NULL to the prev_btn
321 * parameter in elm_naviframe_item_push
323 * @see also elm_naviframe_item_push()
327 EAPI void elm_naviframe_prev_btn_auto_pushed_set(Evas_Object *obj, Eina_Bool auto_pushed);
330 * @brief Get a value whether prev button(back button) will be auto pushed or
333 * @param obj The naviframe object
334 * @return If @c EINA_TRUE, prev button will be auto pushed.
336 * @see also elm_naviframe_item_push()
337 * elm_naviframe_prev_btn_auto_pushed_set()
341 EAPI Eina_Bool elm_naviframe_prev_btn_auto_pushed_get(const Evas_Object *obj);
344 * @brief Get a list of all the naviframe items.
346 * @param obj The naviframe object
347 * @return An Eina_List of naviframe items, #Elm_Object_Item,
348 * or @c NULL on failure.
349 * @note The returned list MUST be freed.
353 EAPI Eina_List *elm_naviframe_items_get(const Evas_Object *obj) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
356 * @brief Set the event enabled when pushing/popping items
358 * If @c enabled is EINA_TRUE, the contents of the naviframe item will
359 * receives events from mouse and keyboard during view changing such as
362 * @param obj The naviframe object
363 * @param enabled Events are received when enabled is @c EINA_TRUE, and
366 * @warning Events will be blocked by calling evas_object_freeze_events_set()
367 * internally. So don't call the API whiling pushing/popping items.
369 * @see elm_naviframe_event_enabled_get()
370 * @see evas_object_freeze_events_set()
374 EAPI void elm_naviframe_event_enabled_set(Evas_Object *obj, Eina_Bool enabled);
377 * @brief Get the value of event enabled status.
379 * @param obj The naviframe object
380 * @return EINA_TRUE, when event is enabled
382 * @see elm_naviframe_event_enabled_set()
386 EAPI Eina_Bool elm_naviframe_event_enabled_get(const Evas_Object *obj);
389 * @brief Simple version of item_push.
391 * @see elm_naviframe_item_push
393 static inline Elm_Object_Item *
394 elm_naviframe_item_simple_push(Evas_Object *obj, Evas_Object *content)
397 it = elm_naviframe_item_push(obj, NULL, NULL, NULL, content, NULL);
398 elm_naviframe_item_title_visible_set(it, EINA_FALSE);
403 * @brief Simple version of item_promote.
405 * @see elm_naviframe_item_promote
407 EAPI void elm_naviframe_item_simple_promote(Evas_Object *obj, Evas_Object *content);