Merge "[elc_navigationbar]: prevent defect fix 20519, removed unnecessary test as...
authorShilpa Singh <shilpa.singh@samsung.com>
Tue, 20 Sep 2011 06:21:55 +0000 (15:21 +0900)
committerGerrit Code Review <git@Maetan>
Tue, 20 Sep 2011 06:21:55 +0000 (15:21 +0900)
17 files changed:
TC/elm_ts/box/Makefile
configure.ac
data/themes/default.edc
debian/changelog
debian/control
src/lib/Elementary.h.in
src/lib/elc_ctxpopup.c
src/lib/elc_naviframe.c
src/lib/elm_config.c
src/lib/elm_datefield.c
src/lib/elm_factory.c
src/lib/elm_main.c
src/lib/elm_multibuttonentry.c
src/lib/elm_store.c
src/lib/elm_widget.c
src/lib/elm_widget.h
src/lib/els_scroller.c

index d4a889d..a953b6e 100755 (executable)
@@ -9,10 +9,9 @@ TARGETS = utc_UIFW_elm_box_add_func \
          utc_UIFW_elm_box_pack_after_func \
          utc_UIFW_elm_box_clear_func \
          utc_UIFW_elm_box_unpack_func \
-         utc_UIFW_elm_box_unpack_all_func 
-         
+         utc_UIFW_elm_box_unpack_all_func
 
-PKGS = elementary
+PKGS = elementary evas
 
 LDFLAGS = `pkg-config --libs $(PKGS)`
 LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
@@ -25,8 +24,8 @@ CFLAGS += -Wall
 
 all: $(TARGETS)
 
-$(TARGET): %: %.c
-       $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
+$(TARGETS): %: %.c
+       $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
 
 clean:
        rm -f *~ *.o tet_captured tet_lock $(TARGETS)
index 45c83ab..38fa434 100755 (executable)
@@ -216,6 +216,7 @@ PKG_CHECK_MODULES([ELEMENTARY],
     ecore-file >= 1.0.0
     ecore-imf >= 1.0.0
     edje >= 1.0.999
+    icu-i18n >= 4.6.0
    ]
 )
 
@@ -250,7 +251,7 @@ PKG_CHECK_MODULES([EMOTION],
 
 AM_CONDITIONAL([HAVE_EMOTION], [test "x${have_emotion}" = "xyes"])
 
-requirement_elm="edje >= 1.0.0 ecore-file >= 1.0.0 ecore-evas >= 1.0.0 ecore >= 1.0.0 evas >= 1.0.0 eet >= 1.4.0 eina >= 1.0.0 ${requirement_elm}"
+requirement_elm="edje >= 1.0.0 ecore-file >= 1.0.0 ecore-evas >= 1.0.0 ecore >= 1.0.0 evas >= 1.0.0 eet >= 1.4.0 eina >= 1.0.0 icu-i18n >= 4.6.0 ${requirement_elm}"
 
 have_elementary_x="no"
 want_elementary_x="auto"
index 185ac30..93d86cd 100644 (file)
@@ -33690,6 +33690,16 @@ collections {
      }
   }
 
+  group { name: "elm/conformant/layout/content";
+   parts {
+      part { name: "elm.swallow.content";
+         type: SWALLOW;
+         description { state: "default" 0.0;
+         }
+      }
+   }
+}
+
 /////////////////////////////////////////////////////////////////////////////
 // CALENDAR
 /////////////////////////////////////////////////////////////////////////////
index be0695c..ed0b4ec 100644 (file)
@@ -1,3 +1,63 @@
+elementary (1.0.0+svn.61256slp2+build37) unstable; urgency=low
+
+  * Package Upload.
+  * Git: 165.213.180.234:slp/pkgs/e/elementary
+  * Tag: elementary_1.0.0+svn.61256slp2+build37
+
+ -- Daniel Juyung Seo <juyung.seo@samsung.com>  Mon, 19 Sep 2011 19:15:52 +0900
+
+elementary (1.0.0+svn.61256slp2+build36) unstable; urgency=low
+
+  * Package Upload.
+  * Git: 165.213.180.234:slp/pkgs/e/elementary
+  * Tag: elementary_1.0.0+svn.61256slp2+build36
+
+ -- Ilkook Yun <ilkook.yun@samsung.com>  Sat, 17 Sep 2011 19:45:56 +0900
+
+elementary (1.0.0+svn.61256slp2+build35) unstable; urgency=low
+
+  * Package Upload.
+  * Git: 165.213.180.234:slp/pkgs/e/elementary
+  * Tag: elementary_1.0.0+svn.61256slp2+build35
+
+ -- Ilkook Yun <ilkook.yun@samsung.com>  Fri, 16 Sep 2011 18:10:34 +0900
+
+elementary (1.0.0+svn.61256slp2+build34) unstable; urgency=low
+
+  * temporal disable smart calc of elm_factory
+  * Git: 165.213.180.234:slp/pkgs/e/elementary
+  * Tag: elementary_1.0.0+svn.61256slp2+build34
+
+ -- Hyoyoung Chang <hyoyoung.chang@samsung.com>  Fri, 16 Sep 2011 13:11:49 +0900
+
+elementary (1.0.0+svn.61256slp2+build33) unstable; urgency=low
+
+  * Package Upload.
+  * Important Changes
+       Rollback to elementary_1.0.0+svn.61256slp2+build29
+  * Git: 165.213.180.234:slp/pkgs/e/elementary
+  * Tag: elementary_1.0.0+svn.61256slp2+build33
+
+ -- Daniel Juyung Seo <juyung.seo@samsung.com>  Fri, 16 Sep 2011 11:13:07 +0900
+
+elementary (1.0.0+svn.61256slp2+build32) unstable; urgency=low
+
+  * Package Upload.
+  * Git: 165.213.180.234:slp/pkgs/e/elementary
+  * Tag: elementary_1.0.0+svn.61256slp2+build32
+
+ -- Daniel Juyung Seo <juyung.seo@samsung.com>  Thu, 15 Sep 2011 17:58:04 +0900
+
+elementary (1.0.0+svn.61256slp2+build31) unstable; urgency=low
+
+  * Package Upload.
+  * Important Changes
+       [Button] Applied upstream commit r63378. This fixes conference call issue.
+  * Git: 165.213.180.234:slp/pkgs/e/elementary
+  * Tag: elementary_1.0.0+svn.61256slp2+build31
+
+ -- Daniel Juyung Seo <juyung.seo@samsung.com>  Thu, 15 Sep 2011 15:59:38 +0900
+
 elementary (1.0.0+svn.61256slp2+build30) unstable; urgency=low
 
   * Package Upload.
index 0eebee9..11bc875 100644 (file)
@@ -3,14 +3,14 @@ Section: x11
 Priority: optional
 Maintainer: Jaehwan Kim <jae.hwan.kim@samsung.com>, Chuneon Park <chuneon.park@samsung.com>, Juyung Seo <juyung.seo@samsung.com>, Myungjae Lee <mjae.lee@samsung.com>, Woohyun Jung <wh0705.jung@samsung.com>, Jihoon Kim <jihoon48.kim@samsung.com>, Jeonghyun Yun <jh0506.yun@samsung.com>, Seunggyun Kim <sgyun.kim@samsung.com>, Shinwoo Kim <cinoo.kim@samsung.com>
 Uploaders: Doyoun Kang <doyoun.kang@samsung.com>, Hyoyoung Chang <hyoyoung.chang@samsung.com>, Myoungwoon Kim <myoungwoon.kim@samsung.com>, Shinwoo Kim <cinoo.kim@samsung.com>
-Build-Depends: debhelper (>= 6), cdbs, libecore-dev, libevas-dev, libeet-dev, libeet-bin, libedje-dev, pkg-config, libtool, libeina-dev, libefreet-dev, libethumb-dev
+Build-Depends: debhelper (>= 6), cdbs, libecore-dev, libevas-dev, libeet-dev, libeet-bin, libedje-dev, pkg-config, libtool, libeina-dev, libefreet-dev, libethumb-dev, libicu-dev
 Standards-Version: 3.8.1
 Homepage: http://www.enlightenment.org
 
 Package: libelm-dev
 Section: libdevel
 Architecture: any
-Depends: libelm (= ${binary:Version}), libecore-dev, libevas-dev, libeet-dev, libedje-dev, libedbus-dev, libefreet-dev, libethumb-dev
+Depends: libelm (= ${binary:Version}), libecore-dev, libevas-dev, libeet-dev, libedje-dev, libedbus-dev, libefreet-dev, libethumb-dev, libicu-dev
 Description: Elementary - a basic widget set that is easy to use based on EFL for mobile
  This package contains devel content.
 
index 78f1819..1bc75cd 100644 (file)
@@ -786,7 +786,7 @@ extern "C" {
     */
    EAPI Evas_Object *elm_object_item_content_part_get(const Elm_Object_Item *it, const char *item);
 
-#define elm_object_item_content_get(it, content) elm_object_item_content_part_get((it), NULL, (content))
+#define elm_object_item_content_get(it) elm_object_item_content_part_get((it), NULL)
 
    /**
     * Unset a content of an object item
@@ -872,6 +872,20 @@ extern "C" {
    EAPI void elm_object_item_data_set(Elm_Object_Item *it, void *data);
 
    /**
+    * Send a signal to the edje object of the widget item.
+    *
+    * This function sends a signal to the edje object of the obj item. An
+    * edje program can respond to a signal by specifying matching
+    * 'signal' and 'source' fields.
+    *
+    * @param it The Elementary object item
+    * @param emission The signal's name.
+    * @param source The signal's source.
+    * @ingroup General
+    */
+   EAPI void             elm_object_item_signal_emit(Elm_Object_Item *it, const char *emission, const char *source) EINA_ARG_NONNULL(1);
+
+   /**
     * @}
     */
 
@@ -7029,6 +7043,7 @@ extern "C" {
         ELM_CTXPOPUP_DIRECTION_RIGHT,
         ELM_CTXPOPUP_DIRECTION_LEFT,
         ELM_CTXPOPUP_DIRECTION_UP,
+        ELM_CTXPOPUP_DIRECTION_UNKNOWN, /**< ctxpopup does not determine it's direction yet*/
      } Elm_Ctxpopup_Direction;
 
    EAPI Evas_Object  *elm_ctxpopup_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
@@ -7049,6 +7064,7 @@ extern "C" {
    EAPI Evas_Object  *elm_ctxpopup_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
    EAPI void          elm_ctxpopup_direction_priority_set(Evas_Object *obj, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth) EINA_ARG_NONNULL(1);
    EAPI void          elm_ctxpopup_direction_priority_get(Evas_Object *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth) EINA_ARG_NONNULL(1);
+   EAPI Elm_Ctxpopup_Direction elm_ctxpopup_direction_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
    /* smart callbacks called:
     * "dismissed" - the ctxpopup was dismissed
     */
@@ -8086,25 +8102,49 @@ extern "C" {
         ELM_DATEFIELD_LAYOUT_DATEANDTIME
      } Elm_Datefield_Layout;
 
+   typedef enum _Elm_Datefield_ItemType
+     {
+        ELM_DATEFIELD_YEAR = 0,
+        ELM_DATEFIELD_MONTH,
+        ELM_DATEFIELD_DATE,
+        ELM_DATEFIELD_HOUR,
+        ELM_DATEFIELD_MINUTE,
+        ELM_DATEFIELD_AMPM
+     } Elm_Datefield_ItemType;
+
    EAPI Evas_Object *elm_datefield_add(Evas_Object *parent);
    EAPI void         elm_datefield_layout_set(Evas_Object *obj, Elm_Datefield_Layout layout);
    EAPI Elm_Datefield_Layout elm_datefield_layout_get(const Evas_Object *obj);
-   EAPI void         elm_datefield_date_set(Evas_Object *obj, int year, int month, int day, int hour, int min);
-   EAPI void         elm_datefield_date_get(const Evas_Object *obj, int *year, int *month, int *day, int *hour, int *min);
-   EAPI Eina_Bool elm_datefield_date_max_set(Evas_Object *obj, int year, int month, int day);
-   EAPI void         elm_datefield_date_max_get(const Evas_Object *obj, int *year, int *month, int *day);
-   EAPI Eina_Bool elm_datefield_date_min_set(Evas_Object *obj, int year, int month, int day);
-   EAPI void         elm_datefield_date_min_get(const Evas_Object *obj, int *year, int *month, int *day);
-   EAPI void         elm_datefield_time_mode_set(Evas_Object *obj, Eina_Bool mode);
-   EAPI Eina_Bool    elm_datefield_time_mode_get(const Evas_Object *obj);
    EAPI void         elm_datefield_date_format_set(Evas_Object *obj, const char *fmt);
    EAPI const char  *elm_datefield_date_format_get(const Evas_Object *obj);
-   EAPI void         elm_datefield_input_panel_state_callback_add(Evas_Object *obj, void (*pEventCallbackFunc) (void *data, Evas_Object *obj, int value), void *data);
-   EAPI void         elm_datefield_input_panel_state_callback_del(Evas_Object *obj, void (*pEventCallbackFunc) (void *data, Evas_Object *obj, int value));
+   EAPI void         elm_datefield_item_enable_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype, Eina_Bool enable);
+   EAPI Eina_Bool    elm_datefield_item_enable_get(Evas_Object *obj, Elm_Datefield_ItemType itemtype);
+   EAPI void         elm_datefield_item_value_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype, int value);
+   EAPI int          elm_datefield_item_value_get(const Evas_Object *obj, Elm_Datefield_ItemType itemtype);
+   EAPI void         elm_datefield_item_min_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype, int value, Eina_Bool abs_limit);
+   EAPI int          elm_datefield_item_min_get(const Evas_Object *obj, Elm_Datefield_ItemType itemtype);
+   EAPI Eina_Bool    elm_datefield_item_min_is_absolute(const Evas_Object *obj, Elm_Datefield_ItemType itemtype);
+   EAPI void         elm_datefield_item_max_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype, int value, Eina_Bool abs_limit);
+   EAPI int          elm_datefield_item_max_get(const Evas_Object *obj, Elm_Datefield_ItemType itemtype);
+   EAPI Eina_Bool    elm_datefield_item_max_is_absolute(const Evas_Object *obj, Elm_Datefield_ItemType itemtype);
+   EAPI void         elm_datefield_time_mode_set(Evas_Object *obj, Eina_Bool mode);
+   EAPI Eina_Bool    elm_datefield_time_mode_get(const Evas_Object *obj);
    /* smart callbacks called:
-   * "changed" - when datefield entry is changed, this signal is sent.
+   * "changed" - when datefield value is changed, this signal is sent.
    */
 
+////////////////////// DEPRECATED ///////////////////////////////////
+   EINA_DEPRECATED EAPI void         elm_datefield_date_set(Evas_Object *obj, int year, int month, int day, int hour, int min);
+   EINA_DEPRECATED EAPI void         elm_datefield_date_get(const Evas_Object *obj, int *year, int *month, int *day, int *hour, int *min);
+   EINA_DEPRECATED EAPI Eina_Bool    elm_datefield_date_max_set(Evas_Object *obj, int year, int month, int day);
+   EINA_DEPRECATED EAPI void         elm_datefield_date_max_get(const Evas_Object *obj, int *year, int *month, int *day);
+   EINA_DEPRECATED EAPI Eina_Bool    elm_datefield_date_min_set(Evas_Object *obj, int year, int month, int day);
+   EINA_DEPRECATED EAPI void         elm_datefield_date_min_get(const Evas_Object *obj, int *year, int *month, int *day);
+   EINA_DEPRECATED EAPI void         elm_datefield_input_panel_state_callback_add(Evas_Object *obj, void (*pEventCallbackFunc) (void *data, Evas_Object *obj, int value), void *data);
+   EINA_DEPRECATED EAPI void         elm_datefield_input_panel_state_callback_del(Evas_Object *obj, void (*pEventCallbackFunc) (void *data, Evas_Object *obj, int value));
+/////////////////////////////////////////////////////////////////////
+
    /* popup */
    typedef enum _Elm_Popup_Response
      {
@@ -8236,21 +8276,16 @@ extern "C" {
   /* naviframe */
   #define ELM_NAVIFRAME_ITEM_ICON "elm.swallow.icon"
   #define ELM_NAVIFRAME_ITEM_OPTIONHEADER "elm.swallow.optionheader"
-   typedef enum
-     {
-        ELM_NAVIFRAME_PREV_BUTTON,
-        ELM_NAVIFRAME_NEXT_BUTTON
-     } Elm_Naviframe_Button_Type;
+  #define ELM_NAVIFRAME_ITEM_TITLE_LABEL "elm.text.title"
+  #define ELM_NAVIFRAME_ITEM_PREV_BTN "elm.swallow.prev_btn"
+  #define ELM_NAVIFRAME_ITEM_SIGNAL_OPTIONHEADER_CLOSE "elm,state,optionheader,instant_close", ""
+  #define ELM_NAVIFRAME_ITEM_SIGNAL_OPTIONHEADER_OPEN "elm,state,optionheader,instant_open", ""
 
    EAPI Evas_Object        *elm_naviframe_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
    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) EINA_ARG_NONNULL(1, 5);
    EAPI Evas_Object        *elm_naviframe_item_pop(Evas_Object *obj) EINA_ARG_NONNULL(1);
    EAPI void                elm_naviframe_content_preserve_on_pop_set(Evas_Object *obj, Eina_Bool preserve) EINA_ARG_NONNULL(1);
    EAPI Eina_Bool           elm_naviframe_content_preserve_on_pop_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
-   EAPI void                elm_naviframe_item_title_label_set(Elm_Object_Item *it, const char *label) EINA_ARG_NONNULL(1);
-   EAPI const char         *elm_naviframe_item_title_label_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
-   EAPI void                elm_naviframe_item_subtitle_label_set(Elm_Object_Item *it, const char *label) EINA_ARG_NONNULL(1);
-   EAPI const char         *elm_naviframe_item_subtitle_label_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
    EAPI Elm_Object_Item    *elm_naviframe_top_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
    EAPI Elm_Object_Item    *elm_naviframe_bottom_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
    EAPI void                elm_naviframe_item_style_set(Elm_Object_Item *it, const char *item_style) EINA_ARG_NONNULL(1);
index 2fdffef..a890dec 100644 (file)
@@ -1625,3 +1625,24 @@ elm_ctxpopup_direction_priority_get(Evas_Object *obj,
    if (third) *third = wd->dir_priority[2];
    if (fourth) *fourth = wd->dir_priority[3];
 }
+
+/**
+ * @brief Get the current direction of a ctxpopup.
+ *
+ * @param obj Ctxpopup object
+ * @return current direction of a ctxpopup
+ *
+ * @warning Once the ctxpopup showed up, the direction would be determined
+ */
+
+EAPI Elm_Ctxpopup_Direction
+elm_ctxpopup_direction_get(const Evas_Object *obj)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) ELM_CTXPOPUP_DIRECTION_UNKNOWN;
+   Widget_Data *wd;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd) return ELM_CTXPOPUP_DIRECTION_UNKNOWN;
+   return wd->dir;
+}
+
index 41aed8d..dc24e21 100644 (file)
@@ -53,19 +53,25 @@ static const Evas_Smart_Cb_Description _signals[] = {
 
 static void _del_hook(Evas_Object *obj);
 static void _theme_hook(Evas_Object *obj);
+static void _emit_hook(Evas_Object *obj,
+                       const char *emission,
+                       const char *source);
 static void _disable_hook(Evas_Object *obj);
-static void _text_set_hook(Elm_Object_Item *it,
-                           const char *part,
-                           const char *label);
-static const char *_text_get_hook(const Elm_Object_Item *it,
-                                   const char *part);
-static void _content_set_hook(Elm_Object_Item *it,
-                              const char *part,
-                              Evas_Object *content);
-static Evas_Object *_content_get_hook(const Elm_Object_Item *it,
-                                      const char *part);
-static Evas_Object *_content_unset_hook(Elm_Object_Item *it,
-                                        const char *part);
+static void _item_text_set_hook(Elm_Object_Item *it,
+                                const char *part,
+                                const char *label);
+static const char *_item_text_get_hook(const Elm_Object_Item *it,
+                                       const char *part);
+static void _item_content_set_hook(Elm_Object_Item *it,
+                                   const char *part,
+                                   Evas_Object *content);
+static Evas_Object *_item_content_get_hook(const Elm_Object_Item *it,
+                                           const char *part);
+static Evas_Object *_item_content_unset_hook(Elm_Object_Item *it,
+                                             const char *part);
+static void _item_signal_emit_hook(Elm_Object_Item *it,
+                                   const char *emission,
+                                   const char *source);
 static void _sizing_eval(Evas_Object *obj);
 static void _item_sizing_eval(Elm_Naviframe_Item *it);
 static void _move(void *data, Evas *e, Evas_Object *obj, void *event_info);
@@ -142,6 +148,18 @@ _theme_hook(Evas_Object *obj __UNUSED__)
    //FIXME:
 }
 
+static void _emit_hook(Evas_Object *obj,
+                       const char *emission,
+                       const char *source)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+
+   edje_object_signal_emit(wd->base, emission, source);
+}
+
 static void
 _disable_hook(Evas_Object *obj __UNUSED__)
 {
@@ -149,7 +167,9 @@ _disable_hook(Evas_Object *obj __UNUSED__)
 }
 
 static void
-_text_set_hook(Elm_Object_Item *it, const char *part, const char *label)
+_item_text_set_hook(Elm_Object_Item *it,
+                    const char *part,
+                    const char *label)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
 
@@ -158,11 +178,14 @@ _text_set_hook(Elm_Object_Item *it, const char *part, const char *label)
    Elm_Naviframe_Item *navi_it = ELM_CAST(it);
    char buf[1024];
 
-   if (!part) return;
+   if (!part)
+     snprintf(buf, sizeof(buf), "elm.text.title");
+   else
+     snprintf(buf, sizeof(buf), "%s", part);
 
    EINA_LIST_FOREACH(navi_it->text_list, l, pair)
      {
-        if (!strcmp(part, pair->part))
+        if (!strcmp(buf, pair->part))
           {
              if (pair->text)
                {
@@ -181,14 +204,14 @@ _text_set_hook(Elm_Object_Item *it, const char *part, const char *label)
              ERR("Failed to allocate new text part of the item! : naviframe=%p", navi_it->base.widget);
              return;
           }
-        eina_stringshare_replace(&pair->part, part);
+        eina_stringshare_replace(&pair->part, buf);
         navi_it->text_list = eina_list_append(navi_it->text_list, pair);
      }
 
    eina_stringshare_replace(&pair->text, label);
-   edje_object_part_text_set(navi_it->base.view, part, label);
+   edje_object_part_text_set(navi_it->base.view, buf, label);
 
-   snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
+   snprintf(buf, sizeof(buf), "elm,state,%s,show", buf);
 
    if (label)
      edje_object_signal_emit(navi_it->base.view, buf, "elm");
@@ -199,37 +222,39 @@ _text_set_hook(Elm_Object_Item *it, const char *part, const char *label)
 }
 
 static const char *
-_text_get_hook(const Elm_Object_Item *it, const char *part)
+_item_text_get_hook(const Elm_Object_Item *it, const char *part)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
    Eina_List *l = NULL;
    Elm_Naviframe_Text_Item_Pair *pair = NULL;
    Elm_Naviframe_Item *navi_it = ELM_CAST(it);
+   char buf[1024];
 
-   if (!part) return NULL;
+   if (!part)
+     snprintf(buf, sizeof(buf), "elm.text.title");
+   else
+     snprintf(buf, sizeof(buf), "%s", part);
 
    EINA_LIST_FOREACH(navi_it->text_list, l, pair)
      {
-        if (!strcmp(part, pair->part))
+        if (!strcmp(buf, pair->part))
           return pair->text;
      }
    return NULL;
 }
 
 static void
-_content_set_hook(Elm_Object_Item *it,
-                  const char *part,
-                  Evas_Object *content)
+_item_content_set_hook(Elm_Object_Item *it,
+                       const char *part,
+                       Evas_Object *content)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
 
    Elm_Naviframe_Content_Item_Pair *pair = NULL;
    Elm_Naviframe_Item *navi_it = ELM_CAST(it);
 
-   if (!part) return;
-
    //specified parts
-   if (!strcmp(part, "elm.swallow.content"))
+   if ((!part) || (!strcmp(part, "elm.swallow.content")))
      {
        _item_content_set(navi_it, content);
        return;
@@ -252,8 +277,7 @@ _content_set_hook(Elm_Object_Item *it,
 /*
    */
 static Evas_Object *
-_content_get_hook(const Elm_Object_Item *it,
-                  const char *part)
+_item_content_get_hook(const Elm_Object_Item *it, const char *part)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
    Eina_List *l = NULL;
@@ -261,7 +285,7 @@ _content_get_hook(const Elm_Object_Item *it,
    Elm_Naviframe_Item *navi_it = ELM_CAST(it);
 
    //specified parts
-   if (!strcmp(part, "elm.swallow.content"))
+   if ((!part) || (!strcmp(part, "elm.swallow.content")))
      return navi_it->content;
    else if (!strcmp(part, "elm.swallow.prev_btn"))
      return navi_it->title_prev_btn;
@@ -278,8 +302,7 @@ _content_get_hook(const Elm_Object_Item *it,
 }
 
 static Evas_Object *
-_content_unset_hook(Elm_Object_Item *it __UNUSED__,
-                    const char *part __UNUSED__)
+_item_content_unset_hook(Elm_Object_Item *it, const char *part)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
    Eina_List *l = NULL;
@@ -288,11 +311,10 @@ _content_unset_hook(Elm_Object_Item *it __UNUSED__,
    Evas_Object *content = NULL;
    char buf[1028];
 
-  if (!part) return NULL;
-
-  //specified parts
-  //FIXME: could be unset the below specified contents also.
-   if (!strcmp(part, "elm.swallow.content") ||
+   //specified parts
+   //FIXME: could be unset the below specified contents also.
+   if (!part ||
+       !strcmp(part, "elm.swallow.content") ||
        !strcmp(part, "elm.swallow.prev_btn") ||
        !strcmp(part, "elm.swallow.next_btn"))
      {
@@ -301,7 +323,7 @@ _content_unset_hook(Elm_Object_Item *it __UNUSED__,
         return NULL;
      }
 
-  //common parts
+   //common parts
    EINA_LIST_FOREACH(navi_it->content_list, l, pair)
      {
         if (!strcmp(part, pair->part))
@@ -330,6 +352,16 @@ _content_unset_hook(Elm_Object_Item *it __UNUSED__,
 }
 
 static void
+_item_signal_emit_hook(Elm_Object_Item *it,
+                       const char *emission,
+                       const char *source)
+{
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
+   Elm_Naviframe_Item *navi_it = ELM_CAST(it);
+   edje_object_signal_emit(navi_it->base.view, emission, source);
+}
+
+static void
 _sizing_eval(Evas_Object *obj)
 {
    Widget_Data *wd;
@@ -512,8 +544,6 @@ _title_content_set(Elm_Naviframe_Item *it,
 static void
 _title_prev_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn, Eina_Bool back_btn)
 {
-   char buf[1024];
-
    if (it->title_prev_btn == btn) return;
 
    if (it->title_prev_btn)
@@ -537,8 +567,6 @@ _title_prev_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn, Eina_Bool back_btn
 static void
 _title_next_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn)
 {
-   char buf[1024];
-
    if (it->title_next_btn == btn) return;
 
    if (it->title_next_btn)
@@ -548,7 +576,6 @@ _title_next_btn_set(Elm_Naviframe_Item *it, Evas_Object *btn)
 
    if (!btn) return;
 
-   elm_object_style_set(btn, buf);
    elm_widget_sub_object_add(it->base.widget, btn);
    evas_object_event_callback_add(btn,
                                   EVAS_CALLBACK_DEL,
@@ -677,6 +704,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_signal_emit_hook_set(obj, _emit_hook);
 
    //base
    wd->base = edje_object_add(e);
@@ -710,11 +738,12 @@ elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *
         return NULL;
      }
 
-   elm_widget_item_text_set_hook_set(it, _text_set_hook);
-   elm_widget_item_text_get_hook_set(it, _text_get_hook);
-   elm_widget_item_content_set_hook_set(it, _content_set_hook);
-   elm_widget_item_content_get_hook_set(it, _content_get_hook);
-   elm_widget_item_content_unset_hook_set(it, _content_unset_hook);
+   elm_widget_item_text_set_hook_set(it, _item_text_set_hook);
+   elm_widget_item_text_get_hook_set(it, _item_text_get_hook);
+   elm_widget_item_content_set_hook_set(it, _item_content_set_hook);
+   elm_widget_item_content_get_hook_set(it, _item_content_get_hook);
+   elm_widget_item_content_unset_hook_set(it, _item_content_unset_hook);
+   elm_widget_item_signal_emit_hook_set(it, _item_signal_emit_hook);
 
    //item base layout
    it->base.view = edje_object_add(evas_object_evas_get(obj));
@@ -736,11 +765,11 @@ elm_naviframe_item_push(Evas_Object *obj, const char *title_label, Evas_Object *
 
    //title
    edje_object_signal_callback_add(it->base.view,
-                                   "elm,title,clicked",
+                                   "elm,action,title,clicked",
                                    "elm",
                                    _title_clicked, it);
 
-   _text_set_hook(ELM_CAST(it), "elm.text.title", title_label);
+   _item_text_set_hook(ELM_CAST(it), "elm.text.title", title_label);
 
    //title buttons
    if ((!prev_btn) && (eina_list_count(wd->stack)))
index ca87a80..b8a3033 100644 (file)
@@ -74,7 +74,7 @@ static size_t _elm_user_dir_snprintf(char       *dst,
 #ifdef HAVE_ELEMENTARY_X
 static Ecore_Event_Handler *_prop_change_handler = NULL;
 static Ecore_X_Window _root_1st = 0;
-#define ATOM_COUNT 22
+#define ATOM_COUNT 25
 static Ecore_X_Atom _atom[ATOM_COUNT];
 static Ecore_X_Atom _atom_config = 0;
 static const char *_atom_names[ATOM_COUNT] =
index 19b23d8..f7cfb84 100644 (file)
@@ -1,6 +1,11 @@
+#include <locale.h>
+#include <unicode/udat.h>
+#include <unicode/ucal.h>
+#include <unicode/putil.h>
+#include <unicode/ustring.h>
+#include <unicode/uchar.h>
 #include <Elementary.h>
 #include "elm_priv.h"
-
 #ifdef HAVE_ELEMENTARY_X
 # include <langinfo.h>
 #else
  * @defgroup Datefield Datefield
  * @ingroup Elementary
  *
- * This is a date editfield. it is used to input date and time using keypad
+ * This is a date edit field. it is used to input date and time using
+ * diskselector integrated ctxpopup.
  */
 
 typedef struct _Widget_Data Widget_Data;
 
-enum
+#define DATEFIELD_TYPE_COUNT        6
+#define BUFFER_SIZE                 64
+#define MAX_FORMAT_LEN              32
+#define MAX_SEPARATOR_LEN           3
+#define MAX_ITEM_FORMAT_LEN         6
+#define DISKSELECTOR_ITEMS_NUM_MIN  4
+
+// Interface between EDC & C code. Item names & signal names.
+// Values 0 to 6 are valid range, can be substituted for %d.
+#define EDC_DATEFIELD_ENABLE_SIG_STR        "elm,state,enabled"
+#define EDC_DATEFIELD_DISABLE_SIG_STR       "elm,state,disabled"
+#define EDC_DATEFIELD_FOCUSIN_SIG_STR       "elm,action,focus"
+#define EDC_DATEFIELD_FOCUSOUT_SIG_STR      "elm,action,unfocus"
+#define EDC_PART_ITEM_STR                   "item%d"
+#define EDC_PART_SEPARATOR_STR              "separator%d"
+#define EDC_PART_ITEM_OVER_STR              "item%d.over"
+#define EDC_PART_ITEM_ENABLE_SIG_STR        "item%d,enable"
+#define EDC_PART_ITEM_DISABLE_SIG_STR       "item%d,disable"
+#define EDC_PART_ITEM_FOCUSIN_SIG_STR       "item%d,focus,in"
+#define EDC_PART_ITEM_FOCUSOUT_SIG_STR      "item%d,focus,out"
+#define EDC_PART_ITEM_STYLE_DEFAULT_SIG_STR "item%d,style,default"
+#define EDC_PART_ITEM_STYLE_AMPM_SIG_STR    "item%d,style,ampm"
+
+typedef struct _ICU_Format
 {
-  DATE_FORMAT_YYMMDD,
-  DATE_FORMAT_YYDDMM,
-  DATE_FORMAT_MMYYDD,
-  DATE_FORMAT_MMDDYY,
-  DATE_FORMAT_DDYYMM,
-  DATE_FORMAT_DDMMYY,
-  DATE_FORMAT_MAX
+   Elm_Datefield_ItemType type;
+   UChar fmt_char[2];
+   const char *def_sep;
+   UDateFormatField icu_type;
+   int def_min;
+   int def_max;
+}ICU_Format_Map;
+
+static const UChar icu_fmt_chars[] = {'y', 'M', 'd', 'h', 'H',
+                                      'm', 's', 'a', 'z', 'E',
+                                      'Q', 'L', 'v'};
+
+//-1 denotes, get the value from ICU dynamically.
+static const ICU_Format_Map mapping[DATEFIELD_TYPE_COUNT] = {
+   { ELM_DATEFIELD_YEAR,   {'y',0},   "",  UDAT_YEAR_FIELD,         1970, 2037},
+   { ELM_DATEFIELD_MONTH,  {'M',0},   "",  UDAT_MONTH_FIELD,        0,    11 },
+   { ELM_DATEFIELD_DATE,   {'d',0},   "",  UDAT_DATE_FIELD,         1,    -1 },
+   { ELM_DATEFIELD_HOUR,   {'H','h'}, ":", UDAT_HOUR_OF_DAY0_FIELD, -1,   -1 },
+   { ELM_DATEFIELD_MINUTE, {'m',0},   " ", UDAT_MINUTE_FIELD,       0,    59 },
+   { ELM_DATEFIELD_AMPM,   {'a',0},   " ", UDAT_AM_PM_FIELD,        0,    1 }
 };
 
-enum
+typedef struct _Datefield_Item
 {
-  ENTRY_YEAR,
-  ENTRY_MON,
-  ENTRY_DAY,
-  ENTRY_HOUR,
-  ENTRY_MIN
-};
-
-#define MONTH_MAXIMUM 12
-#define HOUR_24H_MAXIMUM 23
-#define HOUR_12H_MAXIMUM 12
-#define MIN_MAXIMUM 59
-#define YEAR_MAX_LENGTH 4
+   UChar format[MAX_ITEM_FORMAT_LEN]; //format being set for the current item
+   const char *content; //string to be displayed
+   const char *separator;
+   int location; //location of the item as per the current format
+   int value;
+   int min, max;
+   int default_min, default_max;
+   UDateFormatField type; //type of the item
+   UDateFormatField sub_type; //mainly used for Time, whether 12hr/24Hr format
+   Eina_Bool fmt_exist:1; //if item format is present or not
+   Eina_Bool enabled:1; //if item is to be shown or not
+   Eina_Bool abs_min:1;
+   Eina_Bool abs_max:1;
+} Datefield_Item;
 
 struct _Widget_Data
 {
    Evas_Object *base;
-   Evas_Object *time_ampm;
+   Datefield_Item *item_list; //Fixed set of items, so no Eina list.
    Evas_Object *ctxpopup;
-   Evas_Object *diskselector;
-   unsigned int layout;
-   int year, month, day, hour, min;
-   int y_max, m_max, d_max;
-   int y_min, m_min, d_min;
-   int date_format,date_focusedpart;
-   Eina_Bool pm:1;
-   Eina_Bool time_mode:1;
-   Eina_Bool format_exists:1;
-   Eina_Bool ctxpopup_show:1;
+   Datefield_Item *selected_it;
+   UChar format[MAX_FORMAT_LEN];
+   UCalendar *calendar;
+   UDateFormat* date_fmt; //ICU date format
+   UDateFormatStyle date_style;
+   UDateFormatStyle time_style;
+   Eina_Bool user_format:1; //whether user set format or the default format.
+
+   //////////////////////DEPRECATED//////////////////////
+   unsigned int datefield_layout; // user set layout
+   const char *old_style_format; // user set format
+   Eina_Bool time_mode; // current time mode 12hr/24hr
+   //////////////////////////////////////////////////////
 };
 
+typedef struct _DiskItem_Data
+{
+   Evas_Object *datefield;
+   unsigned int sel_item_value;
+} DiskItem_Data;
+
 static const char *widtype = NULL;
 
 static void _del_hook(Evas_Object *obj);
 static void _on_focus_hook(void *data __UNUSED__, Evas_Object *obj);
-static void _theme_hook(Evas_Object *obj);
+static void _disable_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
 static void _sizing_eval(Evas_Object *obj);
-static void _datefield_resize_cb(void *data, Evas *e __UNUSED__,
-                                 Evas_Object *obj, void *event_info __UNUSED__);
-static void _ampm_clicked_cb(void *data, Evas_Object *obj, void *event_info);
-static void _signal_rect_mouse_down(void *data, Evas_Object *obj __UNUSED__,
-                                    const char *emission __UNUSED__,
-                                    const char *source);
+static void _theme_hook(Evas_Object *obj);
+static void _ctxpopup_dismissed_cb(void *data, Evas_Object *obj __UNUSED__,
+                                   void *event_info __UNUSED__);
+static void _datefield_resize_cb(void *data, Evas *e __UNUSED__,Evas_Object *obj
+                                 __UNUSED__, void *event_info __UNUSED__);
+static void _datefield_move_cb(void *data, Evas *e __UNUSED__,Evas_Object *obj
+                                 __UNUSED__, void *event_info __UNUSED__);
+static void _contextual_field_limit_get(Evas_Object * obj, Datefield_Item * it,
+                 UDateFormatField udtype, int * range_min, int * range_max );
+static void _update_items(Evas_Object *obj);
+static void _field_value_set(Evas_Object * obj, UDateFormatField icu_type,
+                             int value, Eina_Bool adjust_time);
 static void _diskselector_cb(void *data, Evas_Object *obj __UNUSED__,
-                             void *event_info);
-static void _datefield_focus_set(Evas_Object *data);
-static int _maximum_day_get(int year, int month);
-static int _check_date_boundary(Evas_Object *obj, int num, int flag);
-static char* _get_i18n_string(Evas_Object *obj, nl_item item);
-static void _date_update(Evas_Object *obj);
+                             void *event_info __UNUSED__);
+static void _ampm_clicked (void *data);
+static void _diskselector_item_free_cb(void *data, Evas_Object *obj __UNUSED__,
+                                       void *event_info __UNUSED__);
+static void _load_field_options(Evas_Object * data, Evas_Object *diskselector,
+                                Datefield_Item *it);
+static void _datefield_clicked_cb(void *data, Evas_Object *obj __UNUSED__,
+                     const char *emission __UNUSED__, const char *source);
+static void _format_reload(Evas_Object *obj);
+static void _item_list_init(Evas_Object *obj);
+
+static const char SIG_CHANGED[] = "changed";
+static const Evas_Smart_Cb_Description _signals[] = {
+       {SIG_CHANGED, ""},
+       {NULL, NULL}
+};
 
 static void
 _del_hook(Evas_Object *obj)
 {
-   Widget_Data *wd = elm_widget_data_get(obj);
+   Widget_Data *wd;
+   Datefield_Item *tmp;
+   unsigned int idx;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
+     {
+        tmp = wd->item_list + idx;
+        if (tmp->content)  eina_stringshare_del(tmp->content);
+        if (tmp->separator) eina_stringshare_del(tmp->separator);
+     }
+   free( wd->item_list );
+   ucal_close(wd->calendar);
+   wd->calendar = NULL;
+   udat_close(wd->date_fmt);
+   wd->date_fmt = NULL;
+   evas_object_del(wd->ctxpopup);
 
-   if (!wd) return ;
    free(wd);
 }
 
 static void
+_disable_hook(Evas_Object *obj)
+{
+   Widget_Data *wd;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd || !wd->base) return;
+   if (elm_widget_disabled_get(obj))
+     {
+        evas_object_hide(wd->ctxpopup);
+        edje_object_signal_emit(wd->base, EDC_DATEFIELD_DISABLE_SIG_STR,"elm");
+     }
+   else
+     edje_object_signal_emit(wd->base, EDC_DATEFIELD_ENABLE_SIG_STR, "elm");
+}
+
+static void
 _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
 {
-   Widget_Data *wd = elm_widget_data_get(obj);
+   Widget_Data *wd;
 
-   if (!wd || !wd->base) return ;
+   wd = elm_widget_data_get(obj);
+   if (!wd ) return;
+   if (elm_widget_focus_get(obj))
+      edje_object_signal_emit(wd->base, EDC_DATEFIELD_FOCUSIN_SIG_STR, "elm");
+   else
+      edje_object_signal_emit(wd->base, EDC_DATEFIELD_FOCUSOUT_SIG_STR, "elm");
 }
 
 static void
-_theme_hook(Evas_Object *obj)
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
 {
-   Widget_Data *wd = elm_widget_data_get(obj);
-   char sig[32] = {0,};
-   char buf[1024];
+   Widget_Data *wd;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   evas_object_hide(wd->ctxpopup);
+   edje_object_mirrored_set(wd->base, rtl);
+}
+
+static void
+_sizing_eval(Evas_Object *obj)
+{
+   Widget_Data *wd;
+   Evas_Coord minw = -1, minh = -1;
 
+   wd = elm_widget_data_get(obj);
    if (!wd || !wd->base) return;
+   edje_object_size_min_calc(wd->base, &minw, &minh);
+   evas_object_size_hint_min_set(obj, minw, minh);
+   evas_object_size_hint_max_set(obj, -1, -1);
+}
 
-   if (wd->layout == ELM_DATEFIELD_LAYOUT_DATEANDTIME)
-      _elm_theme_object_set(obj, wd->base, "datefield", "dateandtime",
-                            elm_widget_style_get(obj));
-   else if (wd->layout == ELM_DATEFIELD_LAYOUT_DATE)
-      _elm_theme_object_set(obj, wd->base, "datefield", "date",
-                            elm_widget_style_get(obj));
-   else if (wd->layout == ELM_DATEFIELD_LAYOUT_TIME)
-      _elm_theme_object_set(obj, wd->base, "datefield", "time",
-                            elm_widget_style_get(obj));
-
-   if (wd->time_ampm)
-     {
-        edje_object_part_unswallow(wd->base,wd->time_ampm);
-        evas_object_del(wd->time_ampm);
-        wd->time_ampm = NULL;
-   }
-   if ((wd->layout == ELM_DATEFIELD_LAYOUT_DATEANDTIME
-                  || wd->layout == ELM_DATEFIELD_LAYOUT_TIME) && wd->time_mode)
-     {
-        wd->time_ampm = elm_button_add(obj);
-        elm_widget_sub_object_add(obj, wd->time_ampm);
-        edje_object_part_swallow(wd->base, "elm.swallow.time.ampm",
-                                 wd->time_ampm);
-        snprintf(buf,sizeof(buf),"datefield.ampm/%s",elm_widget_style_get(obj));
-        elm_object_style_set(wd->time_ampm, buf);
-        evas_object_size_hint_weight_set(wd->time_ampm, EVAS_HINT_EXPAND,
-                                         EVAS_HINT_EXPAND);
-        evas_object_size_hint_align_set(wd->time_ampm, EVAS_HINT_FILL,
-                                        EVAS_HINT_FILL);
-        evas_object_smart_callback_add(wd->time_ampm, "clicked",
-                                       _ampm_clicked_cb, obj);
-     }
+static void
+_theme_hook(Evas_Object *obj)
+{
+   Widget_Data *wd;
+   Datefield_Item *it;
+   char buf[BUFFER_SIZE];
+   int idx;
+   //Evas_Object *diskselector;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd || !wd->base) return;
+   _elm_theme_object_set(obj, wd->base, "datefield", "base",
+                         elm_widget_style_get(obj));
+   _elm_widget_mirrored_reload(obj);
+   _mirrored_set(obj, elm_widget_mirrored_get(obj));
 
+   snprintf(buf, sizeof(buf), "datefield/%s", elm_object_style_get(obj));
+   elm_object_style_set(wd->ctxpopup, buf);
+   /*//Enabled once elm_object_content_get() API comes to git.
+   if (diskselector = elm_object_content_get(wd->ctxpopup))
+   elm_object_style_set(diskselector, buf);*/
    edje_object_scale_set(wd->base,elm_widget_scale_get(obj)*_elm_config->scale);
 
-   //set date format
-   if (wd->format_exists)
-     sprintf(sig, "elm,state,format,%s", elm_datefield_date_format_get(obj));
+   if (elm_widget_disabled_get(obj))
+     edje_object_signal_emit(wd->base, EDC_DATEFIELD_DISABLE_SIG_STR,"elm");
    else
+     edje_object_signal_emit(wd->base, EDC_DATEFIELD_ENABLE_SIG_STR, "elm");
+
+   for (idx= 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
      {
-        char *str = _get_i18n_string(obj, D_FMT);
-        if (str)
+        it = wd->item_list + idx;
+        if (it->fmt_exist && it->enabled )
+          {
+             snprintf(buf, sizeof(buf), EDC_PART_ITEM_STR, it->location);
+             edje_object_part_text_set(wd->base, buf, it->content);
+             snprintf(buf, sizeof(buf), EDC_PART_SEPARATOR_STR, it->location);
+             edje_object_part_text_set(wd->base, buf, it->separator);
+             snprintf(buf, sizeof(buf), EDC_PART_ITEM_ENABLE_SIG_STR,
+                      it->location);
+             edje_object_signal_emit(wd->base, buf, "elm");
+             if (it->type == UDAT_AM_PM_FIELD)
+               snprintf(buf, sizeof(buf), EDC_PART_ITEM_STYLE_AMPM_SIG_STR,
+                        it->location);
+             else
+               snprintf(buf, sizeof(buf), EDC_PART_ITEM_STYLE_DEFAULT_SIG_STR,
+                        it->location);
+             edje_object_signal_emit(wd->base, buf, "elm");
+          }
+        else
           {
-             if (!strcmp(str, "yymmdd")) wd->date_format = DATE_FORMAT_YYMMDD;
-             else if (!strcmp(str, "yyddmm"))
-                wd->date_format = DATE_FORMAT_YYDDMM;
-             else if (!strcmp(str, "mmyydd"))
-                wd->date_format = DATE_FORMAT_MMYYDD;
-             else if (!strcmp(str, "mmddyy"))
-                wd->date_format = DATE_FORMAT_MMDDYY;
-             else if (!strcmp(str, "ddyymm"))
-                wd->date_format = DATE_FORMAT_DDYYMM;
-             else if (!strcmp(str, "ddmmyy"))
-                wd->date_format = DATE_FORMAT_DDMMYY;
-             sprintf(sig, "elm,state,format,%s",str);
-             free(str);
+             snprintf(buf, sizeof(buf),EDC_PART_ITEM_DISABLE_SIG_STR,
+                      it->location);
+             edje_object_signal_emit(wd->base, buf, "elm");
           }
      }
-   edje_object_signal_emit(wd->base, sig, "elm");
    edje_object_message_signal_process(wd->base);
-
-   _date_update(obj);
    _sizing_eval(obj);
 }
 
 static void
-_sizing_eval(Evas_Object *obj)
+_ctxpopup_dismissed_cb(void *data, Evas_Object *obj __UNUSED__,
+                       void *event_info __UNUSED__)
 {
-   Widget_Data *wd = elm_widget_data_get(obj);
-   Evas_Coord minw = -1, minh = -1;
+   Widget_Data *wd;
+   Evas_Object *diskselector;
+   char buf[BUFFER_SIZE];
 
-   edje_object_size_min_calc(wd->base, &minw, &minh);
-   evas_object_size_hint_min_set(obj, minw, minh);
-   evas_object_size_hint_max_set(obj, -1, -1);
+   wd = elm_widget_data_get(data);
+   if (!wd || !wd->base) return;
+   diskselector = elm_ctxpopup_content_unset(wd->ctxpopup);
+   if (diskselector) evas_object_del(diskselector);
+
+   if (wd->selected_it)
+     {
+        snprintf(buf, sizeof(buf), EDC_PART_ITEM_FOCUSOUT_SIG_STR,
+                 wd->selected_it->location);
+        edje_object_signal_emit(wd->base, buf, "elm");
+        wd->selected_it = NULL;
+     }
 }
 
 static void
-_datefield_resize_cb(void *data,Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
+_datefield_resize_cb(void *data, Evas *e __UNUSED__,Evas_Object *obj __UNUSED__,
                      void *event_info __UNUSED__)
 {
-   Widget_Data *wd = elm_widget_data_get(data);
-
-   if (!wd || !wd->base) return ;
+   Widget_Data *wd;
 
-   Evas_Object *disk = elm_ctxpopup_content_unset(wd->ctxpopup);
-   if (disk) evas_object_del(disk);
-   if (wd->ctxpopup_show)
-     wd->ctxpopup_show = EINA_FALSE;
+   wd = elm_widget_data_get(data);
+   if (!wd) return;
    evas_object_hide(wd->ctxpopup);
 }
 
 static void
-_ctxpopup_dismissed_cb(void *data, Evas_Object *obj __UNUSED__,
-                       void *event_info __UNUSED__)
+_datefield_move_cb(void *data, Evas *e __UNUSED__,Evas_Object *obj __UNUSED__,
+                     void *event_info __UNUSED__)
 {
-   Widget_Data *wd = elm_widget_data_get(data);
-
-   if (!wd || !wd->base) return ;
+   Widget_Data *wd;
 
-   Evas_Object *disk = elm_ctxpopup_content_unset(wd->ctxpopup);
-   if (disk) evas_object_del(disk);
-   if (wd->ctxpopup_show)
-     wd->ctxpopup_show = EINA_FALSE;
+   wd = elm_widget_data_get(data);
+   if (!wd) return;
+   evas_object_hide(wd->ctxpopup);
+}
 
-   switch (wd->date_focusedpart)
+static void
+_contextual_field_limit_get(Evas_Object * obj, Datefield_Item * it,
+                    UDateFormatField udtype, int *range_min, int *range_max)
+{
+   Widget_Data *wd;
+   Datefield_Item * tmp;
+   int idx,icu_min, icu_max;
+   UErrorCode status = U_ZERO_ERROR;
+   Eina_Bool min_limit = EINA_TRUE;
+   Eina_Bool max_limit = EINA_TRUE;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd || !it) return;
+   //Top down check all the fields until current field for Min/Max limit
+   for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++)
      {
-      case ENTRY_YEAR:
-        edje_object_signal_emit(wd->base, "elm,state,year,focus,out", "elm");
-        break;
-      case ENTRY_MON:
-        edje_object_signal_emit(wd->base, "elm,state,month,focus,out", "elm");
-        break;
-      case ENTRY_DAY:
-        edje_object_signal_emit(wd->base, "elm,state,day,focus,out", "elm");
-        break;
-      case ENTRY_HOUR:
-        edje_object_signal_emit(wd->base, "elm,state,hour,focus,out", "elm");
-        break;
-      case ENTRY_MIN:
-        edje_object_signal_emit(wd->base, "elm,state,min,focus,out", "elm");
-        break;
+        tmp = wd->item_list + idx;
+        if (tmp->type == it->type) break;
+
+        if (max_limit && ((int)tmp->value < tmp->max)) max_limit = EINA_FALSE;
+        if (min_limit && ((int)tmp->value > tmp->min)) min_limit = EINA_FALSE;
      }
+
+   if (it->abs_min || min_limit) (*range_min) = it->min;
+   else (*range_min) = it->default_min;
+
+   if (it->abs_max || max_limit) (*range_max) = it->max;
+   else (*range_max) = it->default_max;
+
+   icu_min = ucal_getLimit( wd->calendar, udat_toCalendarDateField(udtype),
+                           UCAL_ACTUAL_MINIMUM, &status );
+   icu_max = ucal_getLimit( wd->calendar, udat_toCalendarDateField(udtype),
+                           UCAL_ACTUAL_MAXIMUM, &status );
+
+   if ((*range_min == -1) || (*range_min < icu_min))
+     *range_min = icu_min;
+   if ((*range_max == -1) || (*range_max > icu_max))
+     *range_max = icu_max;
 }
 
 static void
-_ampm_clicked_cb(void *data, Evas_Object *obj __UNUSED__,
-                 void *event_info __UNUSED__)
+_update_items(Evas_Object *obj)
 {
-   Widget_Data *wd = elm_widget_data_get(data);
-   char *str;
-
-   if (!wd || !wd->base) return ;
-
-   wd->pm = !wd->pm;
-   if (wd->pm)
-     {
-   str = _get_i18n_string(data, PM_STR);
-   if (str)
+   Widget_Data *wd;
+   Datefield_Item *it;
+   char buf[BUFFER_SIZE];
+   int idx= 0;
+   UDate date;
+   UChar result[BUFFER_SIZE];
+   UErrorCode status = U_ZERO_ERROR;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd || !wd->base) return;
+   for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++)
      {
-         elm_object_text_set(wd->time_ampm, str);
-        free(str);
+        it = wd->item_list + idx;
+        ucal_set (wd->calendar, udat_toCalendarDateField(it->type), it->value);
      }
-        wd->hour += HOUR_12H_MAXIMUM;
-     }
-   else
+   date = ucal_getMillis (wd->calendar, &status);
+   for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
      {
-   str = _get_i18n_string(data, AM_STR);
-   if (str)
-     {
-         elm_object_text_set(wd->time_ampm, str);
-        free(str);
-     }
-        wd->hour -= HOUR_12H_MAXIMUM;
+        it = wd->item_list + idx;
+        if ( it->fmt_exist && it->enabled )
+          {
+             udat_applyPattern(wd->date_fmt, TRUE, it->format,
+                               u_strlen(it->format));
+             udat_format(wd->date_fmt, date, result, BUFFER_SIZE, NULL, &status);
+             u_strToUTF8(buf, BUFFER_SIZE, 0, result, -1, &status);
+             if (it->content) eina_stringshare_del(it->content);
+             it->content = eina_stringshare_add(buf);
+             snprintf(buf, sizeof(buf), EDC_PART_ITEM_STR, it->location);
+             edje_object_part_text_set(wd->base, buf, it->content);
+             snprintf(buf, sizeof(buf), EDC_PART_SEPARATOR_STR, it->location+1);
+             edje_object_part_text_set(wd->base, buf, it->separator);
+          }
      }
-   evas_object_smart_callback_call(data, "changed", NULL);
 }
 
 static void
-_signal_rect_mouse_down(void *data, Evas_Object *obj __UNUSED__,
-                        const char *emission __UNUSED__, const char *source)
+_field_value_set(Evas_Object * obj, UDateFormatField icu_type, int value, Eina_Bool adjust_time)
 {
-   Widget_Data *wd = elm_widget_data_get(data);
+   Widget_Data *wd;
+   Datefield_Item * it, *it2 = NULL;
+   int idx, min, max;
+   UErrorCode status = U_ZERO_ERROR;
+   Eina_Bool validate = EINA_FALSE;
+   Eina_Bool value_changed = EINA_FALSE;
 
+   wd = elm_widget_data_get(obj);
    if (!wd) return;
+   //Validate & reset lower order fields
+   for ( idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
+     {
+        if (mapping[idx].icu_type == icu_type) validate = EINA_TRUE;
+        if (!validate) continue;
 
-   if (!strcmp(source, "elm.rect.date.year.over"))
-      wd->date_focusedpart = ENTRY_YEAR;
-   else if (!strcmp(source, "elm.rect.date.month.over"))
-      wd->date_focusedpart = ENTRY_MON;
-   else if (!strcmp(source, "elm.rect.date.day.over"))
-      wd->date_focusedpart = ENTRY_DAY;
-   else if (!strcmp(source, "elm.rect.time.hour.over"))
-      wd->date_focusedpart = ENTRY_HOUR;
-   else if (!strcmp(source, "elm.rect.time.min.over"))
-     wd->date_focusedpart = ENTRY_MIN;
-
-   _datefield_focus_set(data);
-}
-
-static void
-_diskselector_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info)
-{
-    const char *label = elm_diskselector_item_label_get(
-                        (Elm_Diskselector_Item *) event_info);
-    Widget_Data *wd = elm_widget_data_get(data);
-    int i=0, mon = 0, hour =0;
-
-    if (!wd || !wd->base) return;
+        it = wd->item_list + idx;
+        _contextual_field_limit_get(obj, it, it->type, &min, &max);
 
-    if (label)
-      {
-        if ((wd->date_focusedpart == ENTRY_YEAR) && (wd->year!=atoi(label)))
+        if (it->type == icu_type ) //Set the value now
           {
-             wd->year = _check_date_boundary(data, atoi(label), ENTRY_YEAR);
-             edje_object_signal_emit(wd->base,"elm,state,year,focus,out","elm");
-             _date_update(data);
-          }
-        else if (wd->date_focusedpart == ENTRY_MON)
-          {
-             char *month_list[] = {
-                             E_("Jan"), E_("Feb"), E_("Mar"), E_("Apr"),
-                             E_("May"), E_("Jun"), E_("Jul"), E_("Aug"),
-                             E_("Sep"), E_("Oct"), E_("Nov"), E_("Dec"),
-             };
-             for (i=0; i <12; i++)
-               {
-                   if (!(strcmp(month_list[i],label)))
-                     mon = _check_date_boundary(data, i+1, ENTRY_MON);
-               }
-             if (wd->month != mon)
+            // Updating time may alter AM/PM and viceversa. Read back from ICU.
+             if (it->type == UDAT_HOUR_OF_DAY0_FIELD )
                {
-                  wd->month = mon;
-                  edje_object_signal_emit(wd->base, "elm,state,month,focus,out",
-                                          "elm");
-                  _date_update(data);
+                  it2 = wd->item_list + ELM_DATEFIELD_AMPM;
+                  //12 hr format & PM then add 12 to value.
+                  if (it->sub_type == UDAT_HOUR1_FIELD && adjust_time &&
+                           it2->value && value < 12)
+                     value += 12;
                }
+             else if (it->type == UDAT_AM_PM_FIELD )
+                  it2 = wd->item_list + ELM_DATEFIELD_HOUR;
+
+             if (value < min) value = min;
+             else if (value > max) value = max;
+             if (it->value == value) continue;
+             it->value = value;
+             value_changed = EINA_TRUE;
+             ucal_set(wd->calendar, udat_toCalendarDateField (it->type),
+                     it->value);
+             //Read back AM/PM or hour value. update based new 24hr format time value.
+             if (it2)
+               it2->value = ucal_get(wd->calendar,
+                            udat_toCalendarDateField(it2->type),&status);
           }
-        else if ((wd->date_focusedpart == ENTRY_DAY) && (wd->day!=atoi(label)))
-          {
-             wd->day = _check_date_boundary(data, atoi(label), ENTRY_DAY);
-             edje_object_signal_emit(wd->base,"elm,state,day,focus,out", "elm");
-             _date_update(data);
-          }
-        else if (wd->date_focusedpart == ENTRY_HOUR)
+        else
           {
-             if ((wd->hour > 12)&& (wd->time_mode)&& (wd->pm))
-               hour = wd->hour - HOUR_12H_MAXIMUM;
-             else
-               hour = wd->hour;
-             if (hour!=atoi(label))
+             //Validate current value against context based Min/Max restriction.
+             if (it->value < min)
                {
-                  wd->hour = atoi(label);
-                  edje_object_signal_emit(wd->base, "elm,state,hour,focus,out",
-                                          "elm");
-                  _date_update(data);
+                  it->value = min;
+                  value_changed = EINA_TRUE;
                }
+             else if (it->value > max)
+               {
+                  it->value = max;
+                  value_changed = EINA_TRUE;
+               }
+             ucal_set(wd->calendar, udat_toCalendarDateField (it->type),
+                       it->value);
           }
-        else if ((wd->date_focusedpart == ENTRY_MIN) && (wd->min!=atoi(label)))
-          {
-             wd->min = atoi(label);
-             edje_object_signal_emit(wd->base,"elm,state,min,focus,out", "elm");
-             _date_update(data);
-          }
-        evas_object_smart_callback_call(data, "changed", NULL);
      }
+   _update_items(obj);
+
+   if (value_changed)
+     evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
 }
 
 static void
-_datefield_focus_set(Evas_Object *data)
+_diskselector_cb(void *data, Evas_Object *obj __UNUSED__,
+                 void *event_info __UNUSED__)
 {
-   Elm_Diskselector_Item *item = NULL;
-   Evas_Object *diskselector, *disk, *edj_part = NULL;
-   const char *item_list[138], *value = NULL;
-   int idx, count_start = 0, count_end = 0;
-   Evas_Coord x, y, w, h;
+   DiskItem_Data *cb_data;
+   Widget_Data *wd;
 
-   Widget_Data *wd = elm_widget_data_get(data);
-   if (!wd || !wd->base) return;
+   cb_data = (DiskItem_Data *)data;
+   if (!cb_data) return;
+   wd = elm_widget_data_get(cb_data->datefield);
+   if (!wd ) return;
+   _field_value_set(cb_data->datefield, wd->selected_it->type,
+                    cb_data->sel_item_value, EINA_TRUE);
+   evas_object_hide(wd->ctxpopup);
+}
 
-   diskselector = elm_diskselector_add(elm_widget_top_get(data));
-   elm_object_style_set(diskselector, "extended/timepicker");
-   evas_object_size_hint_weight_set(diskselector, EVAS_HINT_EXPAND,
-                                    EVAS_HINT_EXPAND);
-   evas_object_size_hint_align_set(diskselector, EVAS_HINT_FILL,EVAS_HINT_FILL);
-   elm_diskselector_display_item_num_set(diskselector, 8);
-   elm_object_focus_allow_set(diskselector, EINA_FALSE);
-   elm_diskselector_side_label_lenght_set(diskselector, 4);
+static void
+_ampm_clicked (void *data)
+{
+   Widget_Data *wd;
+   Datefield_Item * it;
+   char buf[BUFFER_SIZE];
+   UErrorCode status = U_ZERO_ERROR;
 
-   char *month_list[] = {
-               E_("Jan"), E_("Feb"), E_("Mar"), E_("Apr"), E_("May"), E_("Jun"),
-               E_("Jul"), E_("Aug"), E_("Sep"), E_("Oct"), E_("Nov"), E_("Dec"),
-    };
+   wd = elm_widget_data_get(data);
+   if (!wd || !wd->base) return;
+   wd->selected_it->value = !wd->selected_it->value;
+   ucal_set(wd->calendar, udat_toCalendarDateField(wd->selected_it->type),
+            wd->selected_it->value );
+
+   //Read back hour according to updated AM/PM
+   it = wd->item_list + ELM_DATEFIELD_HOUR;
+   it->value = ucal_get(wd->calendar, udat_toCalendarDateField(it->type),
+                        &status );
+   snprintf(buf, sizeof(buf), EDC_PART_ITEM_FOCUSOUT_SIG_STR,
+            wd->selected_it->location);
+   edje_object_signal_emit(wd->base, buf, "elm");
+   wd->selected_it = NULL;
+   _update_items(data);
+   evas_object_smart_callback_call(data, SIG_CHANGED, NULL);
+}
 
-   if (wd->date_focusedpart == ENTRY_YEAR)
+static void
+_diskselector_item_free_cb(void *data, Evas_Object *obj __UNUSED__,
+                           void *event_info __UNUSED__)
+{
+   if (data) free(data);
+}
+\r
+static void
+_load_field_options(Evas_Object * data, Evas_Object *diskselector,
+                    Datefield_Item *it)
+{
+   Widget_Data *wd;
+   Datefield_Item *it2, *it3;
+   DiskItem_Data *disk_data;
+   Elm_Diskselector_Item *item;
+   int idx, min, max, selected_val;
+   int text_len, max_len = 0;
+   char item_label[BUFFER_SIZE];
+   UCalendarDateFields  cfield;
+   UChar result[BUFFER_SIZE];
+   UErrorCode status = U_ZERO_ERROR;
+
+   wd = elm_widget_data_get(data);
+   if (!wd) return;
+   //Apply field format to Date Format Object
+   udat_applyPattern(wd->date_fmt, TRUE, it->format,
+                      u_strlen(it->format));
+   for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
      {
-        edje_object_signal_emit(wd->base, "elm,state,year,focus,in", "elm");
-        value = edje_object_part_text_get(wd->base,"elm.text.date.year");
-        edj_part = (Evas_Object *)edje_object_part_object_get(wd->base,
-                                                   "elm.rect.date.year.over");
-        count_start = wd->y_min;
-        if (wd->y_max > wd->y_min)
-           count_end = wd->y_max ;
+        it3 = wd->item_list + idx;
+        // To avoid month roll over based on date value, set to min value.
+        if (it3->type == UDAT_DATE_FIELD)
+          ucal_set (wd->calendar, udat_toCalendarDateField (it3->type), 1);
         else
-           count_end = 2037 ;
-        //Maximum limit is set for making it compatible with Calendar widget.
-     }
-   else if (wd->date_focusedpart == ENTRY_MON)
-     {
-        edje_object_signal_emit(wd->base, "elm,state,month,focus,in", "elm");
-        value= edje_object_part_text_get(wd->base,"elm.text.date.month");
-        edj_part = (Evas_Object *)edje_object_part_object_get(wd->base,
-                                                   "elm.rect.date.month.over");
-        count_start = 0;
-        count_end = MONTH_MAXIMUM - 1;
+          ucal_set (wd->calendar, udat_toCalendarDateField (it3->type), it3->value);
      }
-   else if (wd->date_focusedpart == ENTRY_DAY)
+   _contextual_field_limit_get(data, it, it->sub_type, &min, &max );
+
+   cfield = udat_toCalendarDateField (it->type);
+   selected_val = it->value;
+   if (it->sub_type == UDAT_HOUR1_FIELD)
      {
-        edje_object_signal_emit(wd->base, "elm,state,day,focus,in", "elm");
-        value = edje_object_part_text_get(wd->base,"elm.text.date.day");
-        edj_part =(Evas_Object *) edje_object_part_object_get(wd->base,
-                                                   "elm.rect.date.day.over");
-        count_start = 1;
-        count_end = _maximum_day_get(wd->year, wd->month);
+        it2 = wd->item_list + ELM_DATEFIELD_AMPM;
+        if (it2->value) selected_val -= 12;  // if 12hr format & PM, reduce 12
      }
-   else if (wd->date_focusedpart == ENTRY_HOUR)
+
+   for (idx = min; idx <= max; idx++)\r
      {
-        edje_object_signal_emit(wd->base, "elm,state,hour,focus,in", "elm");
-        value = edje_object_part_text_get(wd->base,"elm.text.time.hour");
-        edj_part = (Evas_Object *)edje_object_part_object_get(wd->base,
-                                                   "elm.rect.time.hour.over");
-        if (wd->time_mode)
+        ucal_set (wd->calendar, cfield, idx);
+        udat_format(wd->date_fmt, ucal_getMillis (wd->calendar, &status),
+                    result, BUFFER_SIZE, NULL, &status);
+        u_strToUTF8(item_label, BUFFER_SIZE, &text_len, result, -1, &status);
+        if (text_len > max_len ) max_len = text_len; //Store max. label length
+
+        if (idx == selected_val) //Selected Item, don't attach a callback to handle
           {
-             count_start = 1;
-             count_end = HOUR_12H_MAXIMUM ;
+             item = elm_diskselector_item_append(diskselector, item_label,
+                                                 NULL, NULL, NULL);
+             elm_diskselector_item_selected_set(item, EINA_TRUE);
           }
         else
           {
-             count_start = 0;
-             count_end = HOUR_24H_MAXIMUM ;
+             disk_data = (DiskItem_Data *) malloc (sizeof(DiskItem_Data));
+             disk_data->datefield = data;
+             disk_data->sel_item_value = idx;
+             item = elm_diskselector_item_append(diskselector,
+                                 item_label, NULL, _diskselector_cb, disk_data);
+             elm_diskselector_item_del_cb_set(item, _diskselector_item_free_cb);
           }
      }
-   else if (wd->date_focusedpart == ENTRY_MIN)
+   elm_diskselector_side_label_length_set(diskselector, max_len);
+}
+
+static void
+_datefield_clicked_cb(void *data, Evas_Object *obj __UNUSED__,
+                      const char *emission __UNUSED__, const char *source)
+{
+   Widget_Data *wd = elm_widget_data_get(data);
+   Evas_Object *diskselector;
+   const Evas_Object *edj_part;
+   char buf[BUFFER_SIZE];
+   int idx = 0, idx1 = 0, display_item_num;
+   Evas_Coord x = 0, y = 0, w = 0, h = 0;
+   Evas_Coord disksel_width;
+
+   if (!wd || !wd->base) return;
+   if (elm_widget_disabled_get(data)) return;
+
+   wd->selected_it = NULL;
+   //Locate the selected Index & Selected Datefield_Item
+   for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
      {
-        edje_object_signal_emit(wd->base, "elm,state,min,focus,in", "elm");
-        value = edje_object_part_text_get(wd->base,"elm.text.time.min");
-        edj_part = (Evas_Object *)edje_object_part_object_get(wd->base,
-                                                   "elm.rect.time.min.over");
-        count_start = 0;
-        count_end = MIN_MAXIMUM;
+        snprintf(buf, sizeof(buf), EDC_PART_ITEM_OVER_STR, idx);
+        if (!strncmp(buf, source, sizeof(buf)))
+          {
+             for (idx1 = 0; idx1 < DATEFIELD_TYPE_COUNT; idx1++ )
+               {
+                 if ((wd->item_list + idx1)->location == (int)idx)
+                   {
+                      wd->selected_it = wd->item_list + idx1;
+                      break;
+                   }
+               }
+             break;
+          }
      }
-   if (wd->ctxpopup_show) return;
-   for (idx=count_start; idx<= count_end; idx++)
+
+   if ( !wd->selected_it || !wd->selected_it->fmt_exist
+                         || !wd->selected_it->enabled ) return;
+   snprintf(buf, sizeof(buf), EDC_PART_ITEM_FOCUSIN_SIG_STR,
+            wd->selected_it->location);
+   edje_object_signal_emit(wd->base, buf, "elm");
+
+   if ( wd->selected_it->type == UDAT_AM_PM_FIELD )
      {
-        char str[5];
-        if (wd->date_focusedpart == ENTRY_MON)
-          snprintf(str, sizeof(str), month_list[idx]);
-        else
-          snprintf(str, sizeof(str), "%02d", idx);
-        item_list[idx] = eina_stringshare_add(str);
-        if ((value) && (strcmp(value, item_list[idx]) == 0))
-          item = elm_diskselector_item_append(diskselector,item_list[idx],NULL,
-                                              _diskselector_cb, data);
-        else
-          elm_diskselector_item_append(diskselector, item_list[idx], NULL,
-                                       _diskselector_cb, data);
-        eina_stringshare_del(item_list[idx]);
+        _ampm_clicked (data);
+        return;
      }
-   elm_diskselector_round_set(diskselector, EINA_TRUE);
-   if(item != NULL) elm_diskselector_item_selected_set(item, EINA_TRUE);
 
-   disk = elm_ctxpopup_content_unset(wd->ctxpopup);
-   if (disk) evas_object_del(disk);
+   //Recreating diskselector everytime due to diskselector behavior
+   diskselector = elm_diskselector_add(elm_widget_top_get(data));
+   snprintf(buf, sizeof(buf), "datefield/%s", elm_object_style_get(data));
+   elm_object_style_set(diskselector, buf);
+
+   //Load the options list
+   _load_field_options(data, diskselector, wd->selected_it);
+
    elm_ctxpopup_content_set(wd->ctxpopup, diskselector);
-   evas_object_show(wd->ctxpopup);
-   wd->ctxpopup_show = EINA_TRUE;
+   snprintf(buf,sizeof(buf), EDC_PART_ITEM_OVER_STR, wd->selected_it->location);
+   edj_part = edje_object_part_object_get(wd->base, buf);
    evas_object_geometry_get(edj_part, &x, &y, &w, &h);
-   evas_object_move(wd->ctxpopup, (x+w/2), (y+h) );
-}
-
-static int
-_maximum_day_get(int year, int month)
-{
-   int day_of_month = 0;
-   if (year == 0 || month == 0) return 0;
+   evas_object_move(wd->ctxpopup, (x+w/2), (y+h));
+   if (elm_ctxpopup_direction_get (wd->ctxpopup) == ELM_CTXPOPUP_DIRECTION_DOWN)
+     evas_object_move(wd->ctxpopup, (x+w/2), y);
+   evas_object_show(wd->ctxpopup);
 
-   switch (month)
-     {
-      case 4:
-      case 6:
-      case 9:
-      case 11:
-        day_of_month = 30;
-        break;
-      case 2:
-        {
-           if ((!(year % 4) && (year % 100)) || !(year % 400))
-             day_of_month = 29;
-           else
-             day_of_month = 28;
-        }
-        break;
-      default:
-        day_of_month = 31;
-        break;
-     }
+   evas_object_geometry_get(diskselector, NULL, NULL, &disksel_width, NULL);
+   display_item_num = disksel_width / (w +  elm_finger_size_get()/2);
+   //odd number of items leads to auto selection.
+   //making as event number of item to prevent auto selection.
+   if (display_item_num%2) display_item_num-=1;
+   if (display_item_num < DISKSELECTOR_ITEMS_NUM_MIN)
+      display_item_num = DISKSELECTOR_ITEMS_NUM_MIN;
 
-   return day_of_month;
+   elm_diskselector_display_item_num_set(diskselector, display_item_num);
+   elm_diskselector_round_set(diskselector, EINA_TRUE);
 }
 
-static int
-_check_date_boundary(Evas_Object *obj, int num, int flag)
+static void
+_parse_separator( const UChar *fmt, UChar *separator, unsigned int len )
 {
-   Widget_Data *wd = elm_widget_data_get(obj);
-   if (flag == ENTRY_YEAR)
-     {
-        if ((num > wd->y_max)&&(wd->y_max > wd->y_min)) num = wd->y_max;
-        else if (num < wd->y_min) num = wd->y_min;
-        return num;
-     }
+   unsigned int i = 0;
+   while( (*fmt) && (i < len-2))
+    {
+     if ( !u_strchr(icu_fmt_chars, *fmt) && !u_isspace(*fmt))
+         separator[i++] = *fmt++;
+      else  break;
+    }
+   separator[i] = 0;
+}
 
-   else if (flag == ENTRY_MON)
+static unsigned int
+_parse_format( Evas_Object *obj )
+{
+   Widget_Data *wd;
+   unsigned int len, idx, location = 0;
+   Datefield_Item *it;
+   UChar *fmt_ptr;
+   UChar cur;
+   UChar usep[MAX_SEPARATOR_LEN];
+   char separator[2*MAX_SEPARATOR_LEN];
+   UErrorCode status = U_ZERO_ERROR;
+
+   wd = elm_widget_data_get(obj);
+   fmt_ptr = wd->format;
+   while( (cur = *fmt_ptr ) )
      {
-        if (wd->year == wd->y_max && num > wd->m_max) num = wd->m_max;
-        else if (wd->year == wd->y_min && num < wd->m_min) num = wd->m_min;
-        else if (num > MONTH_MAXIMUM) num = MONTH_MAXIMUM;
-        else if (num <= 0) num = 1;
-        return num;
-     }
+      len = 0;
+      for ( idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
+       {
+          if (mapping[idx].fmt_char[0] == cur ||
+              mapping[idx].fmt_char[1] == cur)
+            {
+               while( *(fmt_ptr+len) == cur ) len++;
+               fmt_ptr += len;
+               break;
+            }
+       }
+
+      if (!len)
+        {
+           fmt_ptr++;
+           continue;
+        }
 
-   else if (flag == ENTRY_DAY)
-     {
-        int day_of_month = _maximum_day_get(wd->year, wd->month);
-        if (wd->year == wd->y_max && wd->month == wd->m_max && num > wd->d_max)
-          num = wd->d_max;
-        else if (wd->year == wd->y_min && wd->month == wd->m_min
-                 && num < wd->d_min) num = wd->d_min;
-        else if (num > day_of_month) num = day_of_month;
-        else if (num <= 0) num = 1;
-        return num;
-     }
-   return num;
-}
+      it = wd->item_list + idx;
+      // ignore the items already have or disabled
+      // valid formats, means already parsed, repeated format, ignore.
+      if (!it->enabled || it->location != -1) continue;
 
-static char*
-_get_i18n_string(Evas_Object *obj, nl_item item)
-{
-   Widget_Data *wd = elm_widget_data_get(obj);
-   const char *fmt;
-   char *str = NULL;
-   int i = 0, j = 0;
+      // In default format, Months larger than MMM are restricted.
+      if ((!wd->user_format) && (it->type == UDAT_MONTH_FIELD) && (len > 3))
+         len = 3;
 
-   if (!wd) return NULL;
+      u_memset(it->format, cur, len);
+      it->format[len] = 0; //NULL terminating
 
-   fmt = nl_langinfo(item);
-   if (!fmt) return NULL;
+     //set the hour display format 12h/24h
+      if (it->type == UDAT_HOUR_OF_DAY0_FIELD)
+        {
+           if (cur == 'H')  it->sub_type = UDAT_HOUR_OF_DAY0_FIELD;
+           else if (cur == 'h')  it->sub_type = UDAT_HOUR1_FIELD;
+        }
 
-   switch (item)
-     {
-      case D_FMT:
-    str = calloc(7, sizeof(char));
-    while (fmt[i])
-      {
-         if (fmt[i] == '%' && fmt[i+1])
-      {
-         i++;
-         switch (fmt[i])
-           {
-            case 'Y': case 'M': case 'D': case 'y': case 'm': case 'd':
-          str[j++] = tolower(fmt[i]);
-          str[j++] = tolower(fmt[i]);
-          break;
-           }
-      }
-         i++;
-      }
-    return str;
-      case AM_STR:
-      case PM_STR:
-    if (strlen(fmt) > 0)
-      {
-         str = calloc(strlen(fmt)+1, sizeof(char));
-         strcpy(str, fmt);
-      }
-    else
-      {
-         str = calloc(3, sizeof(char));
-         if (item == AM_STR) strcpy(str, "AM");
-         else if (item == PM_STR) strcpy(str, "PM");
-      }
-    return str;
-      case ABMON_1: case ABMON_2: case ABMON_3: case ABMON_4: case ABMON_5:
-      case ABMON_6: case ABMON_7: case ABMON_8: case ABMON_9: case ABMON_10:
-      case ABMON_11: case ABMON_12:
-    str = calloc(strlen(fmt)+1, sizeof(char));
-    while (fmt[i])
-      {
-         str[j++] = fmt[i];
-         if (fmt[i] >= '1' && fmt[i] <= '9')
-      {
-         if (fmt[i+1] >= '1' && fmt[i+1] <= '9')
-           str[j] = fmt[i+1];
-         break;
-      }
-         i++;
-      }
-    return str;
-     }
-   return NULL;
+      it->fmt_exist = EINA_TRUE;
+      it->location = location++;
+      if (!strncmp(mapping[idx].def_sep,"",MAX_SEPARATOR_LEN))
+        {
+           _parse_separator(fmt_ptr, usep, MAX_SEPARATOR_LEN );
+           u_strToUTF8(separator, BUFFER_SIZE, 0, usep, -1, &status);
+           if (it->separator) eina_stringshare_del(it->separator);
+           it->separator = eina_stringshare_add(separator);
+       }
+   }
+   //Return the number of valid items parsed.
+   return location;
 }
 
 static void
-_date_update(Evas_Object *obj)
+_format_reload(Evas_Object *obj)
 {
-   Widget_Data *wd = elm_widget_data_get(obj);
-   Evas_Object *diskselector;
-   char str[YEAR_MAX_LENGTH+1] = {0,};
-   char *i18n_str;
-
-   if (!wd || !wd->base) return;
-
-   sprintf(str, "%d", wd->year);
-   edje_object_part_text_set(wd->base, "elm.text.date.year", str);
-
-   i18n_str = _get_i18n_string(obj, ABMON_1+wd->month-1);
-   if (i18n_str)
+   Widget_Data *wd;
+   Datefield_Item *it;
+   char buf[BUFFER_SIZE];
+   UChar timezone[BUFFER_SIZE];
+   UErrorCode status = U_ZERO_ERROR;
+   const char *locale;
+   unsigned int idx, location;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd) return;
+    // fetch the format from ICU, if not user format
+   if (!wd->user_format )
      {
-        edje_object_part_text_set(wd->base, "elm.text.date.month", i18n_str);
-        free(i18n_str);
+        if ( wd->date_fmt ) udat_close( wd->date_fmt );
+        locale = uloc_getDefault();
+        ucal_getDefaultTimeZone(timezone, BUFFER_SIZE, &status);
+        wd->date_fmt = udat_open(wd->time_style, wd->date_style, locale,
+                                timezone, -1, NULL, -1, &status);
+        udat_toPattern(wd->date_fmt, 0, wd->format, BUFFER_SIZE, &status);
      }
 
-   sprintf(str, "%02d", wd->day);
-   edje_object_part_text_set(wd->base, "elm.text.date.day", str);
+   //reset all the items to disable state
+   for ( idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++ )
+     {
+        it = wd->item_list + idx;
+        if (it->content) eina_stringshare_del(it->content);
+        it->content = NULL;
+        it->fmt_exist = EINA_FALSE;
+        it->location = -1;
+     }
+   location = _parse_format( obj );
 
-   if (!wd->time_mode) //24 mode
-     sprintf(str, "%02d", wd->hour);
-   else
+   //assign locations to disabled fields for uniform usage
+   for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++)
      {
-        if (wd->hour >= HOUR_12H_MAXIMUM)
+        it = wd->item_list + idx;
+        if (it->location == -1) it->location = location++;
+
+        if (it->fmt_exist && it->enabled)
           {
-             wd->pm = EINA_TRUE;
-             i18n_str = _get_i18n_string(obj, PM_STR);
-             if ((i18n_str)&&(wd->time_ampm))
-               {
-                  elm_object_text_set(wd->time_ampm, i18n_str);
-                  free(i18n_str);
-               }
+             snprintf(buf, sizeof(buf), EDC_PART_ITEM_ENABLE_SIG_STR,
+                      it->location);
+             edje_object_signal_emit(wd->base, buf, "elm");
+             if (it->type == UDAT_AM_PM_FIELD)
+               snprintf(buf, sizeof(buf), EDC_PART_ITEM_STYLE_AMPM_SIG_STR,
+                        it->location);
+             else
+               snprintf(buf, sizeof(buf), EDC_PART_ITEM_STYLE_DEFAULT_SIG_STR,
+                        it->location);
+             edje_object_signal_emit(wd->base, buf, "elm");
           }
         else
           {
-             wd->pm = EINA_FALSE;
-             i18n_str = _get_i18n_string(obj, AM_STR);
-             if ((i18n_str)&&(wd->time_ampm))
-               {
-                  elm_object_text_set(wd->time_ampm, i18n_str);
-                  free(i18n_str);
-               }
+             snprintf(buf, sizeof(buf),EDC_PART_ITEM_DISABLE_SIG_STR,
+                      it->location);
+             edje_object_signal_emit(wd->base, buf, "elm");
           }
-
-        if (wd->hour > HOUR_12H_MAXIMUM)
-          sprintf(str, "%02d", wd->hour - HOUR_12H_MAXIMUM);
-        else if (wd->hour == 0)
-          sprintf(str, "%02d", HOUR_12H_MAXIMUM);
-        else
-          sprintf(str, "%02d", wd->hour);
      }
-   edje_object_part_text_set(wd->base, "elm.text.time.hour", str);
-   sprintf(str, "%02d", wd->min);
-   edje_object_part_text_set(wd->base, "elm.text.time.min", str);
+   edje_object_message_signal_process(wd->base);
 
-   diskselector = elm_ctxpopup_content_unset(wd->ctxpopup);
-   if (diskselector) evas_object_del(diskselector);
-   evas_object_hide(wd->ctxpopup);
-   if (wd->ctxpopup_show)
-     wd->ctxpopup_show = EINA_FALSE;
+   wd->time_mode = ((wd->item_list + ELM_DATEFIELD_HOUR)->sub_type
+                        == UDAT_HOUR1_FIELD);
+
+   _update_items(obj);
 }
 
+static void
+_item_list_init(Evas_Object *obj)
+{
+   Widget_Data *wd;
+   Datefield_Item *it;
+   char buf[BUFFER_SIZE];
+   UChar timezone[BUFFER_SIZE];
+   UErrorCode status = U_ZERO_ERROR;
+   const char *locale=NULL;
+   unsigned int idx;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   ucal_getDefaultTimeZone(timezone, BUFFER_SIZE, &status);
+   locale = uloc_getDefault();
+   wd->calendar = ucal_open (timezone, -1, locale, UCAL_DEFAULT, &status);
+   wd->date_fmt = udat_open( wd->time_style, wd->date_style, locale, timezone,
+                             -1, NULL, -1, &status);
+
+   wd->item_list = calloc(1, DATEFIELD_TYPE_COUNT * sizeof(Datefield_Item));
+   for (idx = 0; idx < DATEFIELD_TYPE_COUNT; idx++)
+     {
+        it = wd->item_list + idx;
+        it->type = mapping[idx].icu_type;
+        it->sub_type = mapping[idx].icu_type;
+        it->fmt_exist = EINA_FALSE;
+        it->enabled  = EINA_TRUE;
+        it->min = mapping[idx].def_min;
+        it->default_min = mapping[idx].def_min;
+        it->max = mapping[idx].def_max;
+        it->default_max = mapping[idx].def_max;
+        it->separator = strdup(mapping[idx].def_sep);
+
+        //get the default value from Calendar
+        it->value = ucal_get(wd->calendar, udat_toCalendarDateField(it->type),
+                             &status );
+
+        snprintf(buf, sizeof(buf), EDC_PART_ITEM_OVER_STR, idx);
+        edje_object_signal_callback_add(wd->base, "mouse,clicked,1", buf,
+                                        _datefield_clicked_cb, obj);
+     }
+}
 
 /**
- * Add a new datefield object
+ * @brief Add a new datefield Widget
  * The date format and strings are based on current locale
  *
- * @param parent The parent object
+ * @param[in] parent The parent object
  * @return The new object or NULL if it cannot be created
  *
  * @ingroup Datefield
@@ -676,37 +874,36 @@ elm_datefield_add(Evas_Object *parent)
 {
    Evas_Object *obj;
    Evas *e;
-   char buf[4096];
    Widget_Data *wd;
 
    ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
 
    ELM_SET_WIDTYPE(widtype, "datefield");
-   elm_widget_type_set(obj, "datefield");
+   elm_widget_type_set(obj, widtype);
    elm_widget_sub_object_add(parent, obj);
    elm_widget_data_set(obj, wd);
    elm_widget_del_hook_set(obj, _del_hook);
    elm_widget_theme_hook_set(obj, _theme_hook);
    elm_widget_on_focus_hook_set( obj, _on_focus_hook, NULL );
+   elm_widget_disable_hook_set(obj, _disable_hook);
    elm_widget_can_focus_set(obj, EINA_TRUE);
 
    wd->base = edje_object_add(e);
    elm_widget_resize_object_set(obj, wd->base);
-   edje_object_signal_callback_add(wd->base, "mouse,down,1",
-                    "elm.rect.date.year.over", _signal_rect_mouse_down, obj);
-   edje_object_signal_callback_add(wd->base, "mouse,down,1",
-                    "elm.rect.date.month.over", _signal_rect_mouse_down, obj);
-   edje_object_signal_callback_add(wd->base, "mouse,down,1",
-                    "elm.rect.date.day.over", _signal_rect_mouse_down, obj);
-
-   edje_object_signal_callback_add(wd->base, "mouse,down,1",
-                    "elm.rect.time.hour.over", _signal_rect_mouse_down, obj);
-   edje_object_signal_callback_add(wd->base, "mouse,down,1",
-                     "elm.rect.time.min.over", _signal_rect_mouse_down, obj);
+   _elm_theme_object_set(obj, wd->base, "datefield", "base", "default");
+   evas_object_smart_callbacks_descriptions_set(obj, _signals);
+
+   wd->time_style = UDAT_LONG;
+   wd->date_style = UDAT_LONG;
+   _item_list_init(obj);
+   _format_reload(obj);
+
+   wd->datefield_layout = ELM_DATEFIELD_LAYOUT_DATEANDTIME;
+   wd->time_mode = EINA_TRUE;
+   wd->old_style_format = "mmddyy";
 
    wd->ctxpopup = elm_ctxpopup_add(elm_widget_top_get(obj));
-   snprintf(buf,sizeof(buf),"extended/timepicker/%s",elm_widget_style_get(obj));
-   elm_object_style_set(wd->ctxpopup, buf);
+   elm_object_style_set(wd->ctxpopup, "datefield/default");
    elm_ctxpopup_horizontal_set(wd->ctxpopup, EINA_TRUE);
    elm_ctxpopup_direction_priority_set(wd->ctxpopup,ELM_CTXPOPUP_DIRECTION_DOWN,
                ELM_CTXPOPUP_DIRECTION_UP,ELM_CTXPOPUP_DIRECTION_LEFT,
@@ -714,306 +911,552 @@ elm_datefield_add(Evas_Object *parent)
    evas_object_size_hint_weight_set(wd->ctxpopup, EVAS_HINT_EXPAND,
                                     EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(wd->ctxpopup, EVAS_HINT_FILL,EVAS_HINT_FILL);
-   elm_object_focus_allow_set(wd->ctxpopup, EINA_FALSE);
    evas_object_smart_callback_add(wd->ctxpopup, "dismissed",
                                   _ctxpopup_dismissed_cb, obj);
    evas_object_event_callback_add(wd->base, EVAS_CALLBACK_RESIZE,
                                   _datefield_resize_cb, obj);
-
-   wd->y_min = 1900;
-   wd->m_min = 1;
-   wd->d_min = 1;
-   wd->y_max = -1;
-   wd->m_max = 12;
-   wd->d_max = 31;
-   wd->year = wd->y_min;
-   wd->month = 1;
-   wd->day = 1;
-   wd->ctxpopup_show = EINA_FALSE;
-
-   wd->layout = ELM_DATEFIELD_LAYOUT_DATEANDTIME;
-   wd->time_mode = EINA_TRUE;
-
-   _theme_hook(obj);
+   evas_object_event_callback_add(wd->base, EVAS_CALLBACK_MOVE,
+                                  _datefield_move_cb, obj);
+   _mirrored_set(obj, elm_widget_mirrored_get(obj));
 
    return obj;
 }
 
 /**
- * set layout for the datefield
+ * Set the format of datefield
+ * Maximum allowed format length is 32 chars.
+ * Default value is taken according to the system locale format.
+ * The Caller has to free the memory of input format string.
  *
- * @param obj The datefield object
- * @param layout set layout for date/time/dateandtime
- * (default: ELM_DATEFIELD_LAYOUT_DATEANDTIME)
+ * @param[in] obj The datefield object
+ * @param[in] fmt The date format, ex) MMMddy hh:mm.
  *
- * @ingroup Datefield
  */
-EAPI void
-elm_datefield_layout_set(Evas_Object *obj, Elm_Datefield_Layout layout)
+void
+elm_datefield_format_set(Evas_Object *obj, const char *fmt)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
-   Widget_Data *wd = elm_widget_data_get(obj);
+   Widget_Data *wd;
+   UErrorCode status = U_ZERO_ERROR;
 
+   wd = elm_widget_data_get(obj);
    if (!wd) return;
-   if (layout > ELM_DATEFIELD_LAYOUT_DATEANDTIME) return;
 
-   if (wd->layout != layout)
+   if (fmt)
      {
-        if (wd->time_ampm)
-          {
-             edje_object_part_unswallow(wd->base,wd->time_ampm);
-             evas_object_del(wd->time_ampm);
-             wd->time_ampm = NULL;
-          }
-        wd->layout = layout;
-        _theme_hook(obj);
+        u_strFromUTF8(wd->format, MAX_FORMAT_LEN, 0, fmt, strlen(fmt), &status);
+        wd->user_format = EINA_TRUE;
      }
-   return;
+   else  wd->user_format = EINA_FALSE;
+
+   _format_reload(obj);
 }
 
 /**
- * get layout of the datefield
+ * Get the format of datefield
  *
- * @param obj The datefield object
- * @return layout of the datefield
+ * @param[in] obj The datefield object
+ * @return date format string. ex) MMMddyhhmm
+ * The Caller has to free the memory of return string.
  *
- * @ingroup Datefield
  */
-EAPI Elm_Datefield_Layout
-elm_datefield_layout_get(const Evas_Object *obj)
+char *
+elm_datefield_format_get(const Evas_Object *obj)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype) 0;
-   Widget_Data *wd = elm_widget_data_get(obj);
+   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+   Widget_Data *wd;
+   int length;
+   char *format;
+   UErrorCode status = U_ZERO_ERROR;
 
-   if (!wd) return 0;
+   wd = elm_widget_data_get(obj);
+   if (!wd ) return NULL;
 
-   return wd->layout;
+   //get the length : pre flighting.
+   u_strToUTF8(NULL, 0, &length, wd->format, u_strlen(wd->format), &status);
+   format = malloc (length);
+   u_strToUTF8(format, length, 0, wd->format, u_strlen(wd->format), &status);
+
+   return format;
 }
 
 /**
- * Set selected date of the datefield
+ * @brief Set the selected value of the datefield
+ * Year : default range is from 1970 to 2037.
+ * Month value range is from 0 to 11
+ * Date value range is from 1 to 31 according to the month value.
+ * The hour value should be set according to 24hr format (0~23)
+ * Minute value range is from 0 to 59.
+ * AM/PM. Value 0 for AM and 1 for PM.
+ * If the value is beyond the range,
+ * a) Value is less than Min range value, then Min range value is set.
+ * b) Greater than Max range value, then Max Range value is set.
+ * Both Min and Max range of individual fields are bound to the current context.
+ * ex:-If month is Feb, Max date can be 28 or 29 for leap years.
  *
- * @param obj The datefield object
- * @param year The year to set
- * @param month The month to set
- * @param day The day to set
- * @param hour The hours to set (24hour mode - 0~23)
- * @param min The minutes to set (0~59)
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @param[in] value The data to be set. ex. year/month/date/hour/minute/ampm
  *
  * @ingroup Datefield
  */
 EAPI void
-elm_datefield_date_set(Evas_Object *obj, int year, int month, int day, int hour,
-                       int min)
+elm_datefield_item_value_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype,
+                             int value)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
-   Widget_Data *wd = elm_widget_data_get(obj);
+   Widget_Data *wd;
+   Datefield_Item *it;
 
-   if (!wd) return;
+   wd = elm_widget_data_get(obj);
+   if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return;
 
-   wd->year = _check_date_boundary(obj, year, ENTRY_YEAR);
-   wd->month = _check_date_boundary(obj, month, ENTRY_MON);
-   wd->day = _check_date_boundary(obj, day, ENTRY_DAY);
+   it = wd->item_list + itemtype;
+   _field_value_set(obj, it->type, value, EINA_FALSE);
+}
 
-   if (hour > HOUR_24H_MAXIMUM) wd->hour = HOUR_24H_MAXIMUM;
-   else if (hour < 0) wd->hour = 0;
-   else wd->hour = hour;
+/**
+ * @brief Get Current value date of the datefield
+ * Year : default range is from 1970 to 2037.
+ * Month value range is from 0 to 11
+ * Date value range is from 1 to 31 according to the month value.
+ * The hour value should be set according to 24hr format (0~23)
+ * Minute value range is from 0 to 59.
+ * AM/PM. Value 0 for AM and 1 for PM.
+ * If the value is beyond the range,
+ * a) Value is less than Min range value, then Min range value is set.
+ * b) Greater than Max range value, then Max Range value is set.
+ * Both Min and Max range of individual fields are bound to the current context.
+ * ex:-If month is Feb, Max date can be 28 or 29 for leap years.
+ *
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @return int The value of the field.
+ *
+ * @ingroup Datefield
+ */
+EAPI int
+elm_datefield_item_value_get(const Evas_Object *obj, Elm_Datefield_ItemType
+                             itemtype)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) -1;
+   Widget_Data *wd;
 
-   if (min > MIN_MAXIMUM) wd->min = MIN_MAXIMUM;
-   else if (min < 0) wd->min = 0;
-   else wd->min = min;
+   wd = elm_widget_data_get(obj);
+   if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return -1;
 
-   _date_update(obj);
+   return ((wd->item_list + itemtype)->value);
 }
 
+
 /**
- * Get selected date of the datefield
+ * @brief Enable/Disable an item of the datefield
  *
- * @param obj The datefield object
- * @param year The pointer to the variable get the selected year
- * @param month The pointer to the variable get the selected month
- * @param day The pointer to the variable get the selected day
- * @param hour The pointer to the variable get the selected hour (24hour mode)
- * @param hour The pointer to the variable get the selected min
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @param[in] enable Item is Enabled or disabled.
  *
  * @ingroup Datefield
  */
+
 EAPI void
-elm_datefield_date_get(const Evas_Object *obj, int *year, int *month, int *day,
-                       int *hour, int *min)
+elm_datefield_item_enable_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype,
+                              Eina_Bool enable)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
-   Widget_Data *wd = elm_widget_data_get(obj);
+   Widget_Data *wd;
+   Datefield_Item *it;
 
-   if (!wd) return;
+   wd = elm_widget_data_get(obj);
+   if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return;
 
-   if (year)
-     *year = wd->year;
-   if (month)
-     *month = wd->month;
-   if (day)
-     *day = wd->day;
-   if (hour)
-     *hour = wd->hour;
-   if (min)
-     *min = wd->min;
+   it = wd->item_list + itemtype;
+   if ( it->enabled == enable ) return;
+   it->enabled = enable;
+   _format_reload(obj);
 }
 
 /**
- * Set upper boundary of the datefield
+ * @brief Get whether the item is Enabled/Disabled
  *
- * @param obj The datefield object
- * @param year The year to set
- * @param month The month to set
- * @param day The day to set
- * @return TRUE/FALSE
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @return EINA_TRUE = Item is Enabled or EINA_FALSE = disabled.
  *
  * @ingroup Datefield
  */
+
 EAPI Eina_Bool
-elm_datefield_date_max_set(Evas_Object *obj, int year, int month, int day)
+elm_datefield_item_enable_get(Evas_Object *obj, Elm_Datefield_ItemType itemtype)
 {
    ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
-   Widget_Data *wd = elm_widget_data_get(obj);
-   int day_of_month;
-   Eina_Bool update = EINA_FALSE;
+   Widget_Data *wd;
+   Datefield_Item *it;
 
-   if (!wd) return EINA_FALSE;
-   if (month < 1 || month > MONTH_MAXIMUM) return EINA_FALSE;
-   day_of_month = _maximum_day_get(year, month);
-   if (day < 1 || day > day_of_month) return EINA_FALSE;
+   wd = elm_widget_data_get(obj);
+   if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return EINA_FALSE;
 
-   wd->y_max = year;
-   wd->m_max = month;
-   wd->d_max = day;
+   it = wd->item_list + itemtype;
+   return it->enabled;
+}
 
-   if (wd->year > wd->y_max)
-     {
-        wd->year = wd->y_max;
-        update = EINA_TRUE;
-     }
-   if (wd->year == wd->y_max && wd->month > wd->m_max)
-     {
-        wd->month = wd->m_max;
-        update = EINA_TRUE;
-     }
-   if (wd->year == wd->y_max && wd->month == wd->m_max && wd->day > wd->d_max)
-     {
-        wd->day = wd->d_max;
-        update = EINA_TRUE;
-     }
+/**
+ * @brief Get lower boundary of the datefield
+ * Year : default range is from 1970 to 2037.
+ * Month default value range is from 0 to 11
+ * Date default value range is from 1 to 31 according to the month value.
+ * Hour default value will be in terms of 24 hr format (0~23)
+ * Minute default value range will be from 0 to 59.
+ * AM/PM. Value 0 for AM and 1 for PM.
+ * If the value is beyond the range,
+ * a) Value is less than Min range value, then Min range value is set.
+ * b) Greater than Max range value, then Max Range value is set.
+ * Both Min and Max range of individual fields are bound to the current context.
+ * ex:-If month is Feb, Max date can be 28 or 29 for leap years.
+ *
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @param[in] value The minimum value of the field that is to be set.
+ * @ingroup Datefield
+ */
+EAPI void
+elm_datefield_item_min_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype,
+                           int value,  Eina_Bool abs_limit)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd;
+   Datefield_Item *it;
+   UDateFormatField icu_dftype;
+   UErrorCode status = U_ZERO_ERROR;
+   int icu_min;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return;
+
+   it = wd->item_list + itemtype;
+   icu_dftype = it->type;
+   icu_min = ucal_getLimit(wd->calendar, udat_toCalendarDateField(icu_dftype),
+                           UCAL_MINIMUM, &status);
+   if ( value < icu_min ) value = icu_min;
+   it->min = value;
+   it->abs_min = abs_limit;
+   _field_value_set(obj, icu_dftype, it->value, EINA_FALSE);  // Trigger the validation
+}
 
-   if (update) _date_update(obj);
-   return EINA_TRUE;
+/**
+ * @brief Get lower boundary of the datefield
+ * Year : default range is from 1970 to 2037.
+ * Month default value range is from 0 to 11
+ * Date default value range is from 1 to 31 according to the month value.
+ * Hour default value will be in terms of 24 hr format (0~23)
+ * Minute default value range will be from 0 to 59.
+ * AM/PM. Value 0 for AM and 1 for PM.
+ * If the value is beyond the range,
+ * a) Value is less than Min range value, then Min range value is set.
+ * b) Greater than Max range value, then Max Range value is set.
+ * Both Min and Max range of individual fields are bound to the current context.
+ * ex:-If month is Feb, Max date can be 28 or 29 for leap years.
+ *
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @return int The minimum value of the field.
+ *
+ * @ingroup Datepicker
+ */
+EAPI int
+elm_datefield_item_min_get(const Evas_Object *obj, Elm_Datefield_ItemType
+                           itemtype)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) -1;
+   Widget_Data *wd;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return -1;
+
+   return ((wd->item_list + itemtype)->min);
+}
+
+/**
+ * @brief Get whether the minimum value of the item is absolute or not
+ *
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @return EINA_TRUE = Minimim is absolute or EINA_FALSE = Minimum is relative.
+ *
+ * @ingroup Datefield
+ */
+
+EAPI Eina_Bool
+elm_datefield_item_min_is_absolute(const Evas_Object *obj,
+                                   Elm_Datefield_ItemType itemtype)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+   Widget_Data *wd;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return EINA_FALSE;
+
+   return ((wd->item_list + itemtype)->abs_min);
 }
 
 /**
- * Get upper boundary of the datefield
+ * @brief Set upper boundary of the datefield
+ * Year : default range is from 1970 to 2037.
+ * Month:default value range is from 0 to 11
+ * Date : default value range is from 1 to 31 according to the month value.
+ * Hour : default value will be in terms of 24 hr format (0~23)
+ * Minute  : default value range will be from 0 to 59.
+ * AM/PM: Value 0 for AM and 1 for PM.
+ * If the value is beyond the contextual range,
+ * a) Value is less than Min range value, then Min range value is set.
+ * b) Greater than Max range value, then Max Range value is set.
+ * Both Min and Max range of individual fields are bound to the current context.
+ * ex:-If month is Feb, Max date can be 28 or 29 for leap years.
  *
- * @param obj The datefield object
- * @param year The pointer to the variable get the maximum year
- * @param month The pointer to the variable get the maximum month
- * @param day The pointer to the variable get the maximum day
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @param[in] value The maximum field value that is to be set.
  *
  * @ingroup Datefield
  */
 EAPI void
-elm_datefield_date_max_get(const Evas_Object *obj, int *year, int *month,
-                           int *day)
+elm_datefield_item_max_set(Evas_Object *obj, Elm_Datefield_ItemType itemtype,
+                           int value, Eina_Bool abs_limit )
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
-   Widget_Data *wd = elm_widget_data_get(obj);
+   Widget_Data *wd;
+   Datefield_Item *it;
+   UDateFormatField icu_dftype;
+   UErrorCode status = U_ZERO_ERROR;
+   int icu_max;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return;
+
+   it = wd->item_list + itemtype;
+   icu_dftype = it->type;
+   icu_max = ucal_getLimit(wd->calendar, udat_toCalendarDateField(icu_dftype),
+                           UCAL_MAXIMUM, &status);
+   if ( value > icu_max ) value = icu_max;
+   it->max = value;
+   it->abs_max = abs_limit;
+   _field_value_set(obj, icu_dftype, it->value, EINA_FALSE);  // Trigger the validation
+}
 
-   if (!wd) return;
 
-   if (year)
-     *year = wd->y_max;
-   if (month)
-     *month = wd->m_max;
-   if (day)
-     *day = wd->d_max;
+/**
+ * @brief Get upper boundary of the datefield
+ * Year : default range is from 1970 to 2037.
+ * Month default value range is from 0 to 11
+ * Date default value range is from 1 to 31 according to the month value.
+ * Hour default value will be in terms of 24 hr format (0~23)
+ * Minute default value range will be from 0 to 59.
+ * AM/PM. Value 0 for AM and 1 for PM.
+ * If the value is beyond the range,
+ * a) Value is less than Min range value, then Min range value is set.
+ * b) Greater than Max range value, then Max Range value is set.
+ * Both Min and Max range of individual fields are bound to the current context.
+ * ex:-If month is Feb, Max date can be 28 or 29 for leap years.
+ *
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @return int The maximum value of the field.
+ *
+ * @ingroup Datefield
+ */
+EAPI int
+elm_datefield_item_max_get(const Evas_Object *obj, Elm_Datefield_ItemType
+                           itemtype)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) -1;
+   Widget_Data *wd;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return -1;
+
+   return ((wd->item_list + itemtype)->max);
 }
 
 /**
- * Set lower boundary of the datefield
+ * @brief Get whether the max value of the item is absolute or not
  *
- * @param obj The datefield object
- * @param year The year to set
- * @param month The month to set
- * @param day The day to set
- * @return TRUE/FALSE
+ * @param[in] obj The datefield object
+ * @param[in] itemtype The field type of datefield. ELM_DATEFIELD_YEAR etc.
+ * @return EINA_TRUE = Max is absolute or EINA_FALSE = Max is relative.
  *
- * @ingroup Datepicker
+ * @ingroup Datefield
  */
+
 EAPI Eina_Bool
-elm_datefield_date_min_set(Evas_Object *obj, int year, int month, int day)
+elm_datefield_item_max_is_absolute(const Evas_Object *obj,
+                                   Elm_Datefield_ItemType itemtype)
 {
    ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+   Widget_Data *wd;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd || itemtype > ELM_DATEFIELD_AMPM ) return EINA_FALSE;
+
+   return ((wd->item_list + itemtype)->abs_max);
+}
+
+
+#define DATE_FORMAT_TYPE_COUNT  6
+
+typedef struct _format_mapper
+{
+   char old_fmt[BUFFER_SIZE];
+   char new_fmt[BUFFER_SIZE];
+}format_mapper;
+
+format_mapper map_format[DATE_FORMAT_TYPE_COUNT] = {
+   { "ddmmyy",  "ddMMy"},
+   { "ddyymm",  "ddyMM"},
+   { "mmddyy",  "MMddy"},
+   { "mmyydd",  "MMydd"},
+   { "yymmdd",  "yMMdd"},
+   { "yyddmm",  "yddMM"}
+};
+
+static char*
+_get_format(Evas_Object *obj, const char * format)
+{
    Widget_Data *wd = elm_widget_data_get(obj);
-   int day_of_month;
-   Eina_Bool update = EINA_FALSE;
+   Eina_Strbuf *strbuf;
+   char * fmt;
+   int i= 0;
 
-   if (!wd) return EINA_FALSE;
-   if (month < 1 || month > MONTH_MAXIMUM) return EINA_FALSE;
-   day_of_month = _maximum_day_get(year, month);
-   if (day < 1 || day > day_of_month) return EINA_FALSE;
+   if (!wd) return NULL;
 
-   wd->y_min = year;
-   wd->m_min = month;
-   wd->d_min = day;
+   strbuf =  eina_strbuf_new();
 
-   if (wd->year < wd->y_min)
-     {
-        wd->year = wd->y_min;
-        update = EINA_TRUE;
-     }
-   if (wd->year == wd->y_min && wd->month < wd->m_min)
+   if (wd->datefield_layout == ELM_DATEFIELD_LAYOUT_DATE ||
+              wd->datefield_layout == ELM_DATEFIELD_LAYOUT_DATEANDTIME)
      {
-        wd->month = wd->m_min;
-        update = EINA_TRUE;
+        for (i =0; i< DATE_FORMAT_TYPE_COUNT; i++)
+          {
+             if (!strncmp(format, map_format[i].old_fmt, BUFFER_SIZE))
+               {
+                  eina_strbuf_append(strbuf, map_format[i].new_fmt);
+                  break;
+               }
+          }
      }
-   if (wd->year == wd->y_min && wd->month == wd->m_min && wd->day < wd->d_min)
+
+   if (wd->datefield_layout == ELM_DATEFIELD_LAYOUT_TIME ||
+              wd->datefield_layout == ELM_DATEFIELD_LAYOUT_DATEANDTIME)
      {
-        wd->day = wd->d_min;
-        update = EINA_TRUE;
+        if (wd->time_mode)
+          eina_strbuf_append(strbuf, "hh:mma");
+        else
+          eina_strbuf_append(strbuf, "HH:mm");
      }
 
-   if (update) _date_update(obj);
-   return EINA_TRUE;
+   eina_strbuf_append_char(strbuf, 0); // NULL terminated string
+   fmt = eina_strbuf_string_steal(strbuf);
+   eina_strbuf_free( strbuf );
+
+   return fmt;
 }
 
 /**
- * Get lower boundary of the datefield
+ * @brief Set layout for the datefield
  *
- * @param obj The datefield object
- * @param year The pointer to the variable get the maximum year
- * @param month The pointer to the variable get the maximum month
- * @param day The pointer to the variable get the maximum day
+ * @param[in] obj The datefield object
+ * @param[in] layout set layout for date/time/dateandtime
+ * (default: ELM_DATEFIELD_LAYOUT_DATEANDTIME)
  *
  * @ingroup Datefield
  */
 EAPI void
-elm_datefield_date_min_get(const Evas_Object *obj, int *year, int *month,
-                           int *day)
+elm_datefield_layout_set(Evas_Object *obj, Elm_Datefield_Layout layout)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   Eina_Bool date_enabled;
+   Eina_Bool time_enabled;
+
+   if (!wd || layout > ELM_DATEFIELD_LAYOUT_DATEANDTIME) return;
+   if (layout == wd->datefield_layout) return;
+   wd->datefield_layout = layout;
+   date_enabled = ((wd->datefield_layout == ELM_DATEFIELD_LAYOUT_DATE)
+                  || (wd->datefield_layout == ELM_DATEFIELD_LAYOUT_DATEANDTIME));
+
+   time_enabled = ((wd->datefield_layout == ELM_DATEFIELD_LAYOUT_TIME)
+                  || (wd->datefield_layout == ELM_DATEFIELD_LAYOUT_DATEANDTIME));
+
+    elm_datefield_item_enable_set(obj, ELM_DATEFIELD_YEAR, date_enabled);
+    elm_datefield_item_enable_set(obj, ELM_DATEFIELD_MONTH, date_enabled);
+    elm_datefield_item_enable_set(obj, ELM_DATEFIELD_DATE, date_enabled);
+    elm_datefield_item_enable_set(obj, ELM_DATEFIELD_HOUR, time_enabled);
+    elm_datefield_item_enable_set(obj, ELM_DATEFIELD_MINUTE, time_enabled);
+    elm_datefield_item_enable_set(obj, ELM_DATEFIELD_AMPM, (time_enabled && wd->time_mode));
+}
+
+/**
+ * @brief Get layout of the datefield
+ *
+ * @param[in] obj The datefield object
+ * @return layout of the datefield
+ *
+ * @ingroup Datefield
+ */
+EAPI Elm_Datefield_Layout
+elm_datefield_layout_get(const Evas_Object *obj)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype)-1;
+   Widget_Data *wd = elm_widget_data_get(obj);
+
+   if (!wd) return -1;
+
+   return (wd->datefield_layout);
+}
+
+/**
+ * @brief Set date format of datefield
+ *
+ * @param[in] obj The datefield object
+ * @param[in] fmt The date format, ex) mmddyy.
+ * Default value is taken according to the system locale settings.
+ *
+ * @ingroup Datefield
+ */
+EAPI void
+elm_datefield_date_format_set(Evas_Object *obj, const char *fmt)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
 
    if (!wd) return;
 
-   if (year)
-     *year = wd->y_min;
-   if (month)
-     *month = wd->m_min;
-   if (day)
-     *day = wd->d_min;
+   wd->old_style_format = strdup(fmt);
+   elm_datefield_format_set(obj, _get_format(obj, fmt));
+}
+
+/**
+ * @brief Get the user set format of the datefield
+ *
+ * @param[in] obj The datefield object
+ * @return date format string. ex) mmddyy
+ *
+ * @ingroup Datefield
+ */
+EAPI const char *
+elm_datefield_date_format_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->old_style_format);
 }
 
 /**
- * Set if the datefield show hours in military or am/pm mode
+ * @brief Set if the datefield show hours in military or am/pm mode
  *
- * @param obj The datefield object
- * @param mode option for the hours mode. If true, it is shown as 12h mode,
+ * @param[in] obj The datefield object
+ * @param[in] mode option for the hours mode. If true, it is shown as 12h mode,
  * if false, it is shown as 24h mode. Default value is true
  *
  * @ingroup Datefield
@@ -1026,22 +1469,14 @@ elm_datefield_time_mode_set(Evas_Object *obj, Eina_Bool mode)
 
    if (!wd) return;
 
-   if (wd->time_mode != mode)
-     {
-        wd->time_mode = mode;
-        if (!wd->time_mode)
-          edje_object_signal_emit(wd->base, "elm,state,mode,24h","elm");
-        else
-          edje_object_signal_emit(wd->base, "elm,state,mode,12h", "elm");
-        edje_object_message_signal_process(wd->base);
-        _date_update(obj);
-     }
+   wd->time_mode = mode;
+   elm_datefield_format_set(obj, _get_format(obj, wd->old_style_format));
 }
 
 /**
- * get time mode of the datefield
+ * @brief get time mode of the datefield
  *
- * @param obj The datefield object
+ * @param[in] obj The datefield object
  * @return time mode (EINA_TRUE: 12hour mode / EINA_FALSE: 24hour mode)
  *
  * @ingroup Datefield
@@ -1054,108 +1489,203 @@ elm_datefield_time_mode_get(const Evas_Object *obj)
 
    if (!wd) return EINA_FALSE;
 
-   return wd->time_mode;
+   return (wd->time_mode);
 }
 
+
+/////////////////////////////////////////////////////////////////////////////////
+////////////////////////// Date Field DEPRECATED APIs ///////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+
 /**
- * Set date format of datefield
+ * @brief Set selected date of the datefield
  *
- * @param obj The datefield object
- * @param fmt The date format, ex) yymmdd. Default value is mmddyy.
+ * @param[in] obj The datefield object
+ * @param[in] year The year to set
+ * @param[in] month The month to set (1-12)
+ * @param[in] day The day to set
+ * @param[in] hour The hours to set (24hour mode - 0~23)
+ * @param[in] min The minutes to set (0~59)
  *
  * @ingroup Datefield
+ * @deprecated, use elm_datefield_item_value_set() instead.
  */
-EAPI void
-elm_datefield_date_format_set(Evas_Object *obj, const char *fmt)
+EINA_DEPRECATED EAPI void
+elm_datefield_date_set(Evas_Object *obj, int year, int month, int day, int hour,
+                       int min)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype);
-   Widget_Data *wd = elm_widget_data_get(obj);
-   char sig[32] = "elm,state,format,";
-   int i = 0, j;
-
-   if (!wd || !fmt) return;
+   elm_datefield_item_value_set(obj, ELM_DATEFIELD_YEAR, year);
+   month -= 1;  // backward compatibility
+   elm_datefield_item_value_set(obj, ELM_DATEFIELD_MONTH, month);
+   elm_datefield_item_value_set(obj, ELM_DATEFIELD_DATE, day);
+   elm_datefield_item_value_set(obj, ELM_DATEFIELD_HOUR, hour);
+   elm_datefield_item_value_set(obj, ELM_DATEFIELD_MINUTE, min);
+}
 
-   j = strlen(sig);
-   while (j < 31 )
+/**
+ * @brief Get selected date of the datefield
+ *
+ * @param[in] obj The datefield object
+ * @param[in] year The pointer to the variable get the selected year
+ * @param[in] month The pointer to the variable get the selected month (1-12)
+ * @param[in] day The pointer to the variable get the selected day
+ * @param[in] hour The pointer to the variable get the selected hour(24hour mode)
+ * @param[in] hour The pointer to the variable get the selected min
+ *
+ * @ingroup Datefield
+ * @deprecated, use elm_datefield_item_value_get() instead.
+ */
+EINA_DEPRECATED EAPI void
+elm_datefield_date_get(const Evas_Object *obj, int *year, int *month, int *day,
+                       int *hour, int *min)
+{
+   if (year)
+     *year = elm_datefield_item_value_get(obj, ELM_DATEFIELD_YEAR);
+   if (month)
      {
-        sig[j++] = tolower(fmt[i++]);
+        *month = elm_datefield_item_value_get(obj, ELM_DATEFIELD_MONTH);
+        (*month)+=1;  // backward compatibility
      }
-   if (j < 32) sig[j] = '\0';
-   edje_object_signal_emit(wd->base, sig, "elm");
-   edje_object_message_signal_process(wd->base);
+   if (day)
+     *day = elm_datefield_item_value_get(obj, ELM_DATEFIELD_DATE);
+   if (hour)
+     *hour = elm_datefield_item_value_get(obj, ELM_DATEFIELD_HOUR);
+   if (min)
+     *min = elm_datefield_item_value_get(obj, ELM_DATEFIELD_MINUTE);
+}
 
-   if (strstr(sig, "yymmdd")) wd->date_format = DATE_FORMAT_YYMMDD;
-   else if (strstr(sig, "yyddmm")) wd->date_format = DATE_FORMAT_YYDDMM;
-   else if (strstr(sig, "mmyydd")) wd->date_format = DATE_FORMAT_MMYYDD;
-   else if (strstr(sig, "mmddyy")) wd->date_format = DATE_FORMAT_MMDDYY;
-   else if (strstr(sig, "ddyymm")) wd->date_format = DATE_FORMAT_DDYYMM;
-   else if (strstr(sig, "ddmmyy")) wd->date_format = DATE_FORMAT_DDMMYY;
-   wd->format_exists = EINA_TRUE;
+/**
+ * @brief Set lower boundary of the datefield
+ *
+ * @param[in] obj The datefield object
+ * @param[in] year The year to set
+ * @param[in] month The month to set (1-12)
+ * @param[in] day The day to set
+ * @return TRUE/FALSE
+ *
+ * @ingroup Datepicker
+ * @deprecated, use elm_datefield_item_min_set() instead.
+ */
+EINA_DEPRECATED EAPI Eina_Bool
+elm_datefield_date_min_set(Evas_Object *obj, int year, int month, int day)
+{
+   elm_datefield_item_min_set(obj, ELM_DATEFIELD_YEAR, year, EINA_FALSE);
+   month -= 1;  // backward compatibility
+   elm_datefield_item_min_set(obj, ELM_DATEFIELD_MONTH, month, EINA_FALSE);
+   elm_datefield_item_min_set(obj, ELM_DATEFIELD_DATE, day, EINA_FALSE);
+   return EINA_TRUE;
 }
 
 /**
- * get date format of the datefield
+ * @brief Get lower boundary of the datefield
  *
- * @param obj The datefield object
- * @return date format string. ex) yymmdd
+ * @param[in] obj The datefield object
+ * @param[in] year The pointer to the variable get the maximum year
+ * @param[in] month The pointer to the variable get the maximum month (1-12)
+ * @param[in] day The pointer to the variable get the maximum day
  *
  * @ingroup Datefield
+ * @deprecated, use elm_datefield_item_min_get() instead.
  */
-EAPI const char *
-elm_datefield_date_format_get(const Evas_Object *obj)
+EINA_DEPRECATED EAPI void
+elm_datefield_date_min_get(const Evas_Object *obj, int *year, int *month,
+                           int *day)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
-   Widget_Data *wd = elm_widget_data_get(obj);
+   if (year)
+     *year = elm_datefield_item_min_get(obj, ELM_DATEFIELD_YEAR);
+   if (month)
+     {
+        *month = elm_datefield_item_min_get(obj, ELM_DATEFIELD_MONTH);
+        (*month)+=1;  // backward compatibility
+     }
+   if (day)
+     *day = elm_datefield_item_min_get(obj, ELM_DATEFIELD_DATE);
+}
 
-   switch (wd->date_format)
+/**
+ * @brief Set upper boundary of the datefield
+ *
+ * @param[in] obj The datefield object
+ * @param[in] year The year to set
+ * @param[in] month The month to set (1-12)
+ * @param[in] day The day to set
+ * @return TRUE/FALSE
+ *
+ * @ingroup Datefield
+ * @deprecated, use elm_datefield_item_max_set() instead.
+ */
+EINA_DEPRECATED EAPI Eina_Bool
+elm_datefield_date_max_set(Evas_Object *obj, int year, int month, int day)
+{
+   elm_datefield_item_max_set(obj, ELM_DATEFIELD_YEAR, year, EINA_FALSE);
+   month -= 1;  // backward compatibility
+   elm_datefield_item_max_set(obj, ELM_DATEFIELD_MONTH, month, EINA_FALSE);
+   elm_datefield_item_max_set(obj, ELM_DATEFIELD_DATE, day, EINA_FALSE);
+   return EINA_TRUE;
+}
+
+/**
+ * @brief Get upper boundary of the datefield
+ *
+ * @param[in] obj The datefield object
+ * @param[in] year The pointer to the variable get the maximum year
+ * @param[in] month The pointer to the variable get the maximum month (1-12)
+ * @param[in] day The pointer to the variable get the maximum day
+ *
+ * @ingroup Datefield
+ * @deprecated, use elm_datefield_item_max_get() instead.
+ */
+EINA_DEPRECATED EAPI void
+elm_datefield_date_max_get(const Evas_Object *obj, int *year, int *month,
+                           int *day)
+{
+   if (year)
+     *year = elm_datefield_item_max_get(obj, ELM_DATEFIELD_YEAR);
+   if (month)
      {
-      case DATE_FORMAT_YYMMDD: return "yymmdd";
-      case DATE_FORMAT_YYDDMM: return "yyddmm";
-      case DATE_FORMAT_MMYYDD: return "mmyydd";
-      case DATE_FORMAT_MMDDYY: return "mmddyy";
-      case DATE_FORMAT_DDYYMM: return "ddyymm";
-      case DATE_FORMAT_DDMMYY: return "ddmmyy";
-      default: return NULL;
+       *month = elm_datefield_item_max_get(obj, ELM_DATEFIELD_MONTH);
+       (*month)+=1;  // backward compatibility
      }
+   if (day)
+     *day = elm_datefield_item_max_get(obj, ELM_DATEFIELD_DATE);
 }
 
 /**
- * Add a callback function for input panel state
+ * @brief Add a callback function for input panel state
  *
- * @param obj The datefield object
- * @param func The function to be called when the event is triggered
+ * @param[in] obj The datefield object
+ * @param[in] func The function to be called when the event is triggered
  * (value will be the Ecore_IMF_Input_Panel_State)
- * @param data The data pointer to be passed to @p func
+ * @param[in] data The data pointer to be passed to @p func
  *
  * @ingroup Datefield
+ * @deprecated and will no longer be in use.
  */
-EAPI void
+EINA_DEPRECATED EAPI void
 elm_datefield_input_panel_state_callback_add(Evas_Object *obj,
           void (*pEventCallbackFunc) (void *data, Evas_Object *obj, int value),
           void *data)
 {
-   // This API will be no more in use after the redesigning of datefield widget
-   //with ctxpopup & diskselector instead of using entry objects edited by Vkpd.
-   // API will be deprecated soon.
-   printf( "#####\nWARNING: API elm_datefield_input_panel_state_callback_add "
-            "will be deprecated soon \n#####\n");
+   //Empty implementation
 }
 
 /**
- * Delete a callback function for input panel state
+ * @brief Delete a callback function for input panel state
  *
- * @param obj The datefield object
- * @param func The function to be called when the event is triggered
+ * @param[in] obj The datefield object
+ * @param[in] func The function to be called when the event is triggered
  *
  * @ingroup Datefield
+ * @deprecated and will no longer be in use.
  */
-EAPI void
+EINA_DEPRECATED EAPI void
 elm_datefield_input_panel_state_callback_del(Evas_Object *obj,
           void (*pEventCallbackFunc) (void *data, Evas_Object *obj, int value))
 {
-   // This API will be no more in use after the redesigning of datefield widget
-   //with ctxpopup & diskselector instead of using entry objects edited by Vkpd.
-   // API will be deprecated soon.
-   printf( "#####\nWARNING: API elm_datefield_input_panel_state_callback_del"
-            "will be deprecated soon \n#####\n");
+   //Empty implementation
 }
+/////////////////////////////////////////////////////////////////////////////////
+//////////////////////////Date Field DEPRECATED APIs  END////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
index 3fa5787..f1aa695 100644 (file)
@@ -129,16 +129,16 @@ _eval(Evas_Object *obj)
                   if (evas_object_smart_data_get(wd->content))
                      evas_object_smart_calculate(wd->content);
                }
-             wd->last_calc_count =
-                evas_smart_objects_calculate_count_get(evas_object_evas_get(obj));
+             //wd->last_calc_count =
+             //evas_smart_objects_calculate_count_get(evas_object_evas_get(obj));
           }
      }
    else
      {
         if (wd->content)
           {
-             if (wd->last_calc_count !=
-                evas_smart_objects_calculate_count_get(evas_object_evas_get(obj)))
+             //if (wd->last_calc_count !=
+             //evas_smart_objects_calculate_count_get(evas_object_evas_get(obj)))
                 evas_object_smart_callback_call(obj, SIG_UNREALIZE, NULL);
           }
      }
index 669a093..e309668 100644 (file)
@@ -3551,3 +3551,9 @@ elm_object_item_text_part_get(const Elm_Object_Item *it, const char *part)
 {
    return elm_widget_item_text_part_get(it, part);
 }
+
+EAPI void
+elm_object_item_signal_emit(Elm_Object_Item *it, const char *emission, const char *source)
+{
+   elm_widget_item_signal_emit(it, emission, source);
+}
\ No newline at end of file
index c34c522..ebc2903 100644 (file)
@@ -168,10 +168,10 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
              ecore_imf_context_input_panel_show(imf_context);
              evas_object_focus_set(obj, EINA_TRUE);
           }
-        else if ((imf_context) && (!wd->current))
+        else if ((imf_context) && ((!wd->current) || (!eina_list_count(wd->items))))
           {
+             _view_update(obj);
              ecore_imf_context_input_panel_show(imf_context);
-             elm_object_focus(wd->entry);
           }
      }
    else
@@ -737,10 +737,13 @@ _resize_button(Evas_Object *btn, Evas_Coord *realw, Evas_Coord *vieww)
    Evas_Coord w_text, h_btn, padding_outer, padding_inner;
    Evas_Coord w_btn = 0, button_max_width = 0;
    const char *size_str;
+   const char *ellipsis = "<ellipsis=1.0>";
 
    size_str = edje_object_data_get(btn, "button_max_size");
    if (size_str) button_max_width = (Evas_Coord)atoi(size_str);
 
+   const char *button_text = edje_object_part_text_get(btn, "elm.btn.text");
+
    // decide the size of button
    edje_object_part_geometry_get(btn, "elm.base", NULL, NULL, NULL, &h_btn);
    edje_object_part_geometry_get(btn, "elm.btn.text", NULL, NULL, &w_text, NULL);
@@ -749,7 +752,15 @@ _resize_button(Evas_Object *btn, Evas_Coord *realw, Evas_Coord *vieww)
    w_btn = w_text + 2*padding_outer + 2*padding_inner;
 
    rw = w_btn;
-   vw = (button_max_width < w_btn) ? button_max_width : w_btn;
+
+   if (button_max_width < w_btn)
+     {
+        vw = button_max_width;
+        edje_object_part_text_set(btn, "elm.btn.text", ellipsis);
+        edje_object_part_text_append(btn, "elm.btn.text", button_text);
+     }
+   else
+     vw = w_btn;
 
    //resize btn
    evas_object_resize(btn, vw, h_btn);
@@ -1281,12 +1292,9 @@ elm_multibuttonentry_add(Evas_Object *parent)
    Evas_Object *obj;
    Evas *e;
    Widget_Data *wd;
-   if (!parent) return NULL;
 
-   wd = ELM_NEW(Widget_Data);
-   e = evas_object_evas_get(parent);
-   if (!e) return NULL;
-   obj = elm_widget_add(e);
+   ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
+
    ELM_SET_WIDTYPE(widtype, "multibuttonentry");
    elm_widget_type_set(obj, "multibuttonentry");
    elm_widget_sub_object_add(parent, obj);
index 2f56835..25eb265 100644 (file)
@@ -28,7 +28,7 @@
 #define ELM_STORE_FILESYSTEM_MAGIC 0x3f89ea57
 #define ELM_STORE_DBSYSTEM_MAGIC   0x3f89ea58
 #define ELM_STORE_ITEM_MAGIC       0x5afe8c1d
-#define CACHE_COUNT                128
+#define CACHE_COUNT                1024
 
 struct _Elm_Store
 {
@@ -879,12 +879,18 @@ _item_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part)
                   switch (m->type)
                     {
                      case ELM_STORE_ITEM_MAPPING_LABEL:
+                        LKU(sti->lock);
                         s = *(char **)(((unsigned char *)sti->data) + m->offset);
+                        LKL(sti->lock);
                         break;
 
                      case ELM_STORE_ITEM_MAPPING_CUSTOM:
                         if (m->details.custom.func)
-                          s = m->details.custom.func(sti->data, sti, part);
+                          {
+                             LKU(sti->lock);
+                             s = m->details.custom.func(sti->data, sti, part);
+                             LKL(sti->lock);
+                          }
                         break;
 
                      default:
@@ -909,7 +915,11 @@ _item_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part)
              if (m->type == ELM_STORE_ITEM_MAPPING_CUSTOM)
                {
                   if (m->details.custom.func)
-                    s = m->details.custom.func(NULL, sti, part);
+                    {
+                       LKU(sti->lock);
+                       s = m->details.custom.func(sti->item_info, sti, part);
+                       LKL(sti->lock);
+                    }
 
                   if (s)
                     {
index 0a61b9c..6c362de 100644 (file)
@@ -102,7 +102,6 @@ struct _Smart_Data
    Eina_Bool    can_focus : 1;
    Eina_Bool    child_can_focus : 1;
    Eina_Bool    focused : 1;
-   Eina_Bool    top_win_focused : 1;
    Eina_Bool    tree_unfocusable : 1;
    Eina_Bool    highlight_ignore : 1;
    Eina_Bool    highlight_in_theme : 1;
@@ -330,13 +329,12 @@ _parent_focus(Evas_Object *obj)
 
    focus_order++;
    sd->focus_order = focus_order;
-   if (sd->top_win_focused)
-     {
-        sd->focused = EINA_TRUE;
-        if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
-        if (sd->focus_func) sd->focus_func(obj);
-        _elm_widget_focus_region_show(obj);
-     }
+   sd->focused = EINA_TRUE;
+   if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
+   if (sd->focus_func) sd->focus_func(obj);
+
+   _elm_widget_focus_region_show(obj);
+
    sd->focus_order_on_calc = EINA_FALSE;
 }
 
@@ -871,7 +869,6 @@ elm_widget_sub_object_add(Evas_Object *obj,
              if (sd2->parent_obj)
                elm_widget_sub_object_del(sd2->parent_obj, sobj);
              sd2->parent_obj = obj;
-             sd2->top_win_focused = sd->top_win_focused;
              if (!sd->child_can_focus && (_is_focusable(sobj)))
                sd->child_can_focus = EINA_TRUE;
           }
@@ -1016,11 +1013,7 @@ elm_widget_resize_object_set(Evas_Object *obj,
         if (_elm_widget_is(sd->resize_obj))
           {
              Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj);
-             if (sd2)
-               {
-                  sd2->parent_obj = obj;
-                  sd2->top_win_focused = sd->top_win_focused;
-               }
+             if (sd2) sd2->parent_obj = obj;
              evas_object_event_callback_add(sobj, EVAS_CALLBACK_HIDE,
                                             _sub_obj_hide, sd);
           }
@@ -1890,30 +1883,6 @@ elm_widget_focus_restore(Evas_Object *obj)
      }
 }
 
-void
-_elm_widget_top_win_focused_set(Evas_Object *obj, Eina_Bool top_win_focused)
-{
-   const Eina_List *l;
-   Evas_Object *child;
-   API_ENTRY return;
-
-   if (sd->top_win_focused == top_win_focused) return;
-   if (sd->resize_obj)
-     _elm_widget_top_win_focused_set(sd->resize_obj, top_win_focused);
-   EINA_LIST_FOREACH(sd->subobjs, l, child)
-     {
-        _elm_widget_top_win_focused_set(child, top_win_focused);
-     }
-   sd->top_win_focused = top_win_focused;
-}
-
-Eina_Bool
-_elm_widget_top_win_focused_get(const Evas_Object *obj)
-{
-   API_ENTRY return EINA_FALSE;
-   return sd->top_win_focused;
-}
-
 EAPI void
 elm_widget_activate(Evas_Object *obj)
 {
@@ -2968,6 +2937,16 @@ _elm_widget_item_text_part_set(Elm_Widget_Item *item,
    item->on_text_set_func((Elm_Object_Item *) item, part, label);
 }
 
+EAPI void
+_elm_widget_item_signal_emit(Elm_Widget_Item *item,
+                             const char *emission,
+                             const char *source)
+{
+   ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+   if (item->on_signal_emit_func)
+     item->on_signal_emit_func((Elm_Object_Item *) item, emission, source);
+}
+
 EAPI const char *
 _elm_widget_item_text_part_get(const Elm_Widget_Item *item,
                                const char *part)
@@ -3017,6 +2996,14 @@ _elm_widget_item_text_get_hook_set(Elm_Widget_Item *item,
    item->on_text_get_func = func;
 }
 
+EAPI void
+_elm_widget_item_signal_emit_hook_set(Elm_Widget_Item *item,
+                                      Elm_Widget_On_Signal_Emit_Cb func)
+{
+   ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+   item->on_signal_emit_func = func;
+}
+
 static void
 _smart_add(Evas_Object *obj)
 {
index 3f19026..3e5e8b9 100644 (file)
@@ -197,6 +197,7 @@ typedef void (*Elm_Widget_On_Content_Set_Cb)(void *data, const char *part, Evas_
 typedef const char *(*Elm_Widget_On_Text_Get_Cb)(const void *data, const char *part);
 typedef Evas_Object *(*Elm_Widget_On_Content_Get_Cb)(const void *data, const char *part);
 typedef Evas_Object *(*Elm_Widget_On_Content_Unset_Cb)(const void *data, const char *part);
+typedef void (*Elm_Widget_On_Signal_Emit_Cb)(void *data, const char *emission, const char *source);
 
 struct _Elm_Widget_Item
 {
@@ -213,6 +214,7 @@ struct _Elm_Widget_Item
    Elm_Widget_On_Content_Unset_Cb on_content_unset_func;
    Elm_Widget_On_Text_Set_Cb on_text_set_func;
    Elm_Widget_On_Text_Get_Cb on_text_get_func;
+   Elm_Widget_On_Signal_Emit_Cb on_signal_emit_func;
    /* widget variations should have data from here and on */
    /* @todo: TODO check if this is enough for 1.0 release, maybe add padding! */
 };
@@ -389,11 +391,13 @@ EAPI Evas_Object     *_elm_widget_item_content_part_get(const Elm_Widget_Item *i
 EAPI Evas_Object     *_elm_widget_item_content_part_unset(Elm_Widget_Item *item, const char *part);
 EAPI void             _elm_widget_item_text_part_set(Elm_Widget_Item *item, const char *part, const char *label);
 EAPI const char      *_elm_widget_item_text_part_get(const Elm_Widget_Item *item, const char *part);
+EAPI void             _elm_widget_item_signal_emit(Elm_Widget_Item *item, const char *emission, const char *source);
 EAPI void             _elm_widget_item_content_set_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Content_Set_Cb func);
 EAPI void             _elm_widget_item_content_get_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Content_Get_Cb func);
 EAPI void             _elm_widget_item_content_unset_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Content_Unset_Cb func);
 EAPI void             _elm_widget_item_text_set_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Text_Set_Cb func);
 EAPI void             _elm_widget_item_text_get_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Text_Get_Cb func);
+EAPI void             _elm_widget_item_signal_emit_hook_set(Elm_Widget_Item *it, Elm_Widget_On_Signal_Emit_Cb func);
 
 /* debug function. don't use it unless you are tracking parenting issues */
 EAPI void             elm_widget_tree_dump(const Evas_Object *top);
@@ -544,6 +548,12 @@ EAPI void             elm_widget_tree_dot_dump(const Evas_Object *top, FILE *out
 #define elm_widget_item_text_part_get(item, part) \
   _elm_widget_item_text_part_get((const Elm_Widget_Item *)item, part)
 /**
+ * Convenience function to query item's signal emit.
+ * @see _elm_widget_item_signal_emit()
+ */
+#define elm_widget_item_signal_emit(item, emission, source) \
+  _elm_widget_item_signal_emit((Elm_Widget_Item *)item, emission, source)
+/**
  * Convenience function to query item's content set hook.
  * @see _elm_widget_item_content_set_hook_set()
  */
@@ -573,6 +583,12 @@ EAPI void             elm_widget_tree_dot_dump(const Evas_Object *top, FILE *out
  */
 #define elm_widget_item_text_get_hook_set(item, func) \
   _elm_widget_item_text_get_hook_set((Elm_Widget_Item *)item, (Elm_Widget_On_Text_Get_Cb)func)
+/**
+ * Convenience function to query item's signal emit hook.
+ * @see _elm_widget_item_signal_emit_hook_set()
+ */
+#define elm_widget_item_signal_emit_hook_set(item, func) \
+  _elm_widget_item_signal_emit_hook_set((Elm_Widget_Item *)item, (Elm_Widget_On_Signal_Emit_Cb)func)
 
 /**
  * Cast and ensure the given pointer is an Elm_Widget_Item or return NULL.
index 1d25f96..051c182 100644 (file)
@@ -1842,6 +1842,7 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *ev
    Evas_Event_Mouse_Down *ev;
    Smart_Data *sd;
    Evas_Coord x = 0, y = 0, ox = 0, oy = 0;
+   Evas_Coord vw, vh, aw, ah;
 
    sd = data;
    ev = event_info;
@@ -1935,6 +1936,19 @@ _smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj __UNUSED__, void *ev
                                    }
                                  else
                                    sd->down.extra_time = 0.0;
+                                 elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &vw, &vh);
+                                 aw = abs(sd->down.dx);
+                                 if (aw  > vw*3)
+                                   {
+                                      if (sd->down.dx > 0) sd->down.dx = vw*3;
+                                      else sd->down.dx = -(vw*3);
+                                   }
+                                 ah = abs(sd->down.dy);
+                                 if (ah  > vh*3)
+                                   {
+                                      if (sd->down.dy > 0) sd->down.dy = vh*3;
+                                      else sd->down.dy = -(vh*3);
+                                   }
                                  sd->down.pdx = sd->down.dx;
                                  sd->down.pdy = sd->down.dy;
                                  ox = -sd->down.dx;