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 it's 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 callback 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 callback 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 before The naviframe item to insert before.
117 * @param title_label The label in the title area. The name of the title
118 * label part is "elm.text.title"
119 * @param prev_btn The button to go to the previous item. If it is NULL,
120 * then naviframe will create a back button automatically. The name of
121 * the prev_btn part is "elm.swallow.prev_btn"
122 * @param next_btn The button to go to the next item. Or It could be just an
123 * extra function button. The name of the next_btn part is
124 * "elm.swallow.next_btn"
125 * @param content The main content object. The name of content part is
126 * "elm.swallow.content"
127 * @param item_style The current item style name. @c NULL would be default.
128 * @return The created item or @c NULL upon failure.
130 * The item is inserted into the naviframe straight away without any
131 * transition operations. This item will be deleted when it is popped.
133 * @see also elm_naviframe_item_style_set()
134 * @see also elm_naviframe_item_push()
135 * @see also elm_naviframe_item_insert_after()
137 * The following styles are available for this item:
142 EAPI Elm_Object_Item *elm_naviframe_item_insert_before(Elm_Object_Item *before, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style);
145 * @brief Insert a new item into the naviframe after item @p after.
147 * @param after The naviframe item to insert after.
148 * @param title_label The label in the title area. The name of the title
149 * label part is "elm.text.title"
150 * @param prev_btn The button to go to the previous item. If it is NULL,
151 * then naviframe will create a back button automatically. The name of
152 * the prev_btn part is "elm.swallow.prev_btn"
153 * @param next_btn The button to go to the next item. Or It could be just an
154 * extra function button. The name of the next_btn part is
155 * "elm.swallow.next_btn"
156 * @param content The main content object. The name of content part is
157 * "elm.swallow.content"
158 * @param item_style The current item style name. @c NULL would be default.
159 * @return The created item or @c NULL upon failure.
161 * The item is inserted into the naviframe straight away without any
162 * transition operations. This item will be deleted when it is popped.
164 * @see also elm_naviframe_item_style_set()
165 * @see also elm_naviframe_item_push()
166 * @see also elm_naviframe_item_insert_before()
168 * The following styles are available for this item:
173 EAPI Elm_Object_Item *elm_naviframe_item_insert_after(Elm_Object_Item *after, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style);
176 * @brief Pop an item that is on top of the stack
178 * @param obj The naviframe object
179 * @return @c NULL or the content object(if the
180 * elm_naviframe_content_preserve_on_pop_get is true).
182 * This pops an item that is on the top(visible) of the naviframe, makes it
183 * disappear, then deletes the item. The item that was underneath it on the
184 * stack will become visible.
186 * @see also elm_naviframe_content_preserve_on_pop_get()
190 EAPI Evas_Object *elm_naviframe_item_pop(Evas_Object *obj);
193 * @brief Pop the items between the top and the above one on the given item.
195 * @param it The naviframe item
199 EAPI void elm_naviframe_item_pop_to(Elm_Object_Item *it);
202 * Promote an item already in the naviframe stack to the top of the stack
204 * @param it The naviframe item
206 * This will take the indicated item and promote it to the top of the stack
207 * as if it had been pushed there. The item must already be inside the
208 * naviframe stack to work.
211 EAPI void elm_naviframe_item_promote(Elm_Object_Item *it);
214 * @brief preserve the content objects when items are popped.
216 * @param obj The naviframe object
217 * @param preserve Enable the preserve mode if EINA_TRUE, disable otherwise
219 * @see also elm_naviframe_content_preserve_on_pop_get()
223 EAPI void elm_naviframe_content_preserve_on_pop_set(Evas_Object *obj, Eina_Bool preserve);
226 * @brief Get a value whether preserve mode is enabled or not.
228 * @param obj The naviframe object
229 * @return If @c EINA_TRUE, preserve mode is enabled
231 * @see also elm_naviframe_content_preserve_on_pop_set()
235 EAPI Eina_Bool elm_naviframe_content_preserve_on_pop_get(const Evas_Object *obj);
238 * @brief Get a top item on the naviframe stack
240 * @param obj The naviframe object
241 * @return The top item on the naviframe stack or @c NULL, if the stack is
246 EAPI Elm_Object_Item *elm_naviframe_top_item_get(const Evas_Object *obj);
249 * @brief Get a bottom item on the naviframe stack
251 * @param obj The naviframe object
252 * @return The bottom item on the naviframe stack or @c NULL, if the stack is
257 EAPI Elm_Object_Item *elm_naviframe_bottom_item_get(const Evas_Object *obj);
260 * @brief Set an item style
262 * @param it The naviframe item
263 * @param item_style The current item style name. @c NULL would be default
265 * The following styles are available for this item:
268 * @see also elm_naviframe_item_style_get()
272 EAPI void elm_naviframe_item_style_set(Elm_Object_Item *it, const char *item_style);
275 * @brief Get an item style
277 * @param it The naviframe item
278 * @return The current item style name
280 * @see also elm_naviframe_item_style_set()
284 EAPI const char *elm_naviframe_item_style_get(const Elm_Object_Item *it);
287 * @brief Show/Hide the title area
289 * @param it The naviframe item
290 * @param visible If @c EINA_TRUE, title area will be visible, hidden
293 * When the title area is invisible, then the controls would be hidden so as * to expand the content area to full-size.
295 * @see also elm_naviframe_item_title_visible_get()
299 EAPI void elm_naviframe_item_title_visible_set(Elm_Object_Item *it, Eina_Bool visible);
302 * @brief Get a value whether title area is visible or not.
304 * @param it The naviframe item
305 * @return If @c EINA_TRUE, title area is visible
307 * @see also elm_naviframe_item_title_visible_set()
311 EAPI Eina_Bool elm_naviframe_item_title_visible_get(const Elm_Object_Item *it);
314 * @brief Set creating prev button automatically or not
316 * @param obj The naviframe object
317 * @param auto_pushed If @c EINA_TRUE, the previous button(back button) will
318 * be created internally when you pass the @c NULL to the prev_btn
319 * parameter in elm_naviframe_item_push
321 * @see also elm_naviframe_item_push()
325 EAPI void elm_naviframe_prev_btn_auto_pushed_set(Evas_Object *obj, Eina_Bool auto_pushed);
328 * @brief Get a value whether prev button(back button) will be auto pushed or
331 * @param obj The naviframe object
332 * @return If @c EINA_TRUE, prev button will be auto pushed.
334 * @see also elm_naviframe_item_push()
335 * elm_naviframe_prev_btn_auto_pushed_set()
339 EAPI Eina_Bool elm_naviframe_prev_btn_auto_pushed_get(const Evas_Object *obj);
342 * @brief Get a list of all the naviframe items.
344 * @param obj The naviframe object
345 * @return An Eina_List of naviframe items, #Elm_Object_Item,
346 * or @c NULL on failure.
347 * @note The returned list MUST be freed.
351 EAPI Eina_List *elm_naviframe_items_get(const Evas_Object *obj) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
354 * @brief Set the event enabled when pushing/popping items
356 * If @c enabled is EINA_TRUE, the contents of the naviframe item will
357 * receives events from mouse and keyboard during view changing such as
360 * @param obj The naviframe object
361 * @param enabled Events are received when enabled is @c EINA_TRUE, and
364 * @warning Events will be blocked by calling evas_object_freeze_events_set()
365 * internally. So don't call the API whiling pushing/popping items.
367 * @see elm_naviframe_event_enabled_get()
368 * @see evas_object_freeze_events_set()
372 EAPI void elm_naviframe_event_enabled_set(Evas_Object *obj, Eina_Bool enabled);
375 * @brief Get the value of event enabled status.
377 * @param obj The naviframe object
378 * @return EINA_TRUE, when event is enabled
380 * @see elm_naviframe_event_enabled_set()
384 EAPI Eina_Bool elm_naviframe_event_enabled_get(const Evas_Object *obj);
387 * @brief Set the default item style.
389 * Default item style will be used with items who's style is NULL
391 * @param obj The naviframe object
392 * @param style The style
396 EAPI void elm_naviframe_item_style_default_set(Evas_Object *obj, const char *style);
399 * @brief Get the default item style
401 * @param obj The naviframe object
402 * @return the default item style
404 * @see elm_naviframe_item_style_default_set()
408 EAPI const char *elm_naviframe_item_style_default_get(const Evas_Object *obj);
411 * @brief Simple version of item_push.
413 * @see elm_naviframe_item_push
415 static inline Elm_Object_Item *
416 elm_naviframe_item_simple_push(Evas_Object *obj, Evas_Object *content)
419 it = elm_naviframe_item_push(obj, NULL, NULL, NULL, content, NULL);
420 elm_naviframe_item_title_visible_set(it, EINA_FALSE);
425 * @brief Simple version of item_promote.
427 * @see elm_naviframe_item_promote
429 EAPI void elm_naviframe_item_simple_promote(Evas_Object *obj, Evas_Object *content);