Eina_Bool preserve: 1;
Eina_Bool auto_pushed: 1;
Eina_Bool freeze_events: 1;
+ Eina_Stringshare *item_style;
};
struct _Elm_Naviframe_Content_Item_Pair
if (!wd->stack) break;
}
}
+ eina_stringshare_del(wd->item_style);
free(wd);
}
Elm_Naviframe_Content_Item_Pair *content_pair;
Elm_Naviframe_Text_Item_Pair *text_pair;
Widget_Data *wd;
+ wd = elm_widget_data_get(WIDGET(navi_it));
+ if (!wd) return;
char buf[256];
if (!item_style)
{
- strcpy(buf, "item/basic");
- eina_stringshare_replace(&navi_it->style, "basic");
+ snprintf(buf, sizeof(buf), "item/%s", wd->item_style);
}
else
{
navi_it->title_visible = EINA_TRUE;
_sizing_eval(WIDGET(navi_it));
- wd = elm_widget_data_get(WIDGET(navi_it));
- if (!wd) return;
-
if (wd->freeze_events)
evas_object_freeze_events_set(VIEW(navi_it), EINA_FALSE);
}
wd->auto_pushed = EINA_TRUE;
wd->freeze_events = EINA_TRUE;
+ wd->item_style = eina_stringshare_add("basic");
return obj;
}
Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
//Return if new style is exsiting one.
- if (item_style)
- if (!strcmp(item_style, navi_it->style)) return;
+ if ((item_style && navi_it->style) && (!strcmp(item_style, navi_it->style)))
+ return;
- if (!item_style)
- if (!strcmp("basic", navi_it->style)) return;
+ if ((!item_style) && (!navi_it->style))
+ return;
_item_style_set(navi_it, item_style);
}
return wd->auto_pushed;
}
-EAPI Eina_Inlist *
+EAPI Eina_List *
elm_naviframe_items_get(const Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return NULL;
- return wd->stack;
+ Eina_List *ret = NULL;
+ Elm_Naviframe_Item *itr;
+ EINA_INLIST_FOREACH(wd->stack, itr)
+ {
+ ret = eina_list_append(ret, itr);
+ }
+ return ret;
}
EAPI void
if (!wd) return EINA_FALSE;
return !wd->freeze_events;
}
+
+EAPI void
+elm_naviframe_item_style_default_set(Evas_Object *obj, const char *style)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ eina_stringshare_replace(&wd->item_style, style);
+ _theme_hook(obj);
+}
+
+EAPI const char *
+elm_naviframe_item_style_default_get(const Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+ return wd->item_style;
+}
* @brief Get a list of all the naviframe items.
*
* @param obj The naviframe object
- * @return An Eina_Inlist* of naviframe items, #Elm_Object_Item,
+ * @return An Eina_List of naviframe items, #Elm_Object_Item,
* or @c NULL on failure.
*
* @ingroup Naviframe
*/
-EAPI Eina_Inlist *elm_naviframe_items_get(const Evas_Object *obj);
+EAPI Eina_List *elm_naviframe_items_get(const Evas_Object *obj) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
/**
* @brief Set the event enabled when pushing/popping items
EAPI Eina_Bool elm_naviframe_event_enabled_get(const Evas_Object *obj);
/**
+ * @brief Set the default item style.
+ *
+ * Default item style will be used with items who's style is NULL
+ *
+ * @param obj The naviframe object
+ * @param style The style
+ *
+ * @ingroup Naviframe
+ */
+EAPI void elm_naviframe_item_style_default_set(Evas_Object *obj, const char *style);
+
+/**
+ * @brief Get the default item style
+ *
+ * @param obj The naviframe object
+ * @return the default item style
+ *
+ * @see elm_naviframe_item_style_default_set()
+ *
+ * @ingroup Naviframe
+ */
+EAPI const char *elm_naviframe_item_style_default_get(const Evas_Object *obj);
+
+/**
* @}
*/