naviframe now supports content_get

SVN revision: 68037
This commit is contained in:
Mike Blumenkrantz 2012-02-16 21:14:32 +00:00
parent 840da81ce2
commit ebdb8e497d
2 changed files with 24 additions and 3 deletions

View File

@ -59,6 +59,8 @@ static const Evas_Smart_Cb_Description _signals[] = {
{NULL, NULL}
};
static Evas_Object *_content_get_hook(const Evas_Object *obj,
const char *part);
static void _del_hook(Evas_Object *obj);
static void _theme_hook(Evas_Object *obj);
static void _emit_hook(Evas_Object *obj,
@ -463,6 +465,21 @@ _back_btn_new(Evas_Object *obj)
return btn;
}
static Evas_Object *
_content_get_hook(const Evas_Object *obj, const char *part)
{
Widget_Data *wd;
Elm_Naviframe_Item *it;
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
if (part && strcmp(part, "default")) return NULL;
wd = elm_widget_data_get(obj);
if ((!wd) || (!wd->stack)) return NULL;
it = (Elm_Naviframe_Item *) (EINA_INLIST_CONTAINER_GET(wd->stack->last,
Elm_Naviframe_Item));
return it->content;
}
static void
_title_content_del(void *data,
Evas *e __UNUSED__,
@ -1051,6 +1068,7 @@ elm_naviframe_add(Evas_Object *parent)
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_disable_hook_set(obj, _disable_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
elm_widget_content_get_hook_set(obj, _content_get_hook);
elm_widget_signal_emit_hook_set(obj, _emit_hook);
elm_widget_can_focus_set(obj, EINA_FALSE);
elm_widget_focus_next_hook_set(obj, _focus_next_hook);

View File

@ -14,14 +14,17 @@
* Since each item could keep the different styles, users could keep the
* same look & feel for the pages or different styles for the items in it's
* application.
*
*
* Default content parts of the naviframe that you can use content hooks for are:
* @li "default" - The main content of the current page
*
* Signals that you can add callback for are:
* @li "transition,finished" - When the transition is finished in changing
* the item
* @li "title,clicked" - User clicked title area
*
* Default contents parts of the naviframe items that you can use for are:
* @li "default" - A main content of the page
* Default content parts of the naviframe items that you can use content hooks for are:
* @li "default" - The main content of the page
* @li "icon" - An icon in the title area
* @li "prev_btn" - A button to go to the previous page
* @li "next_btn" - A button to go to the next page