genlist : refactoring filter feature and remove deprecated hide_set/get 91/93191/5
authorSangHyeon Lee <sh10233.lee@samsung.com>
Fri, 21 Oct 2016 02:10:36 +0000 (11:10 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Fri, 21 Oct 2016 05:40:09 +0000 (22:40 -0700)
APIs

Change-Id: I783f5eeb411bb079c50a082cc7ce849d6c2e75e9

src/lib/elm_deprecated.h
src/lib/elm_gen_common.h
src/mobile_lib/elm_genlist.c

index 1178832555dd4b8c439e97c2b9c1d62bf67cb2cf..305ae5ef84cd5188e4da30fbf94cb05e307674e3 100644 (file)
@@ -635,6 +635,74 @@ EINA_DEPRECATED EAPI void      elm_naviframe_item_title_visible_set(Elm_Object_I
  */
 EINA_DEPRECATED EAPI Eina_Bool elm_naviframe_item_title_visible_get(const Elm_Object_Item *it);
 
+/**
+ * @internal
+ * @remarks Tizen only feature
+ *
+ * @brief Sets the genlist fx mode.
+ *
+ * @remarks This API can be changed or deleted later.
+ *
+ * @remarks This sets the genlist special effects.
+ *          Use this only when the genlist effects have to be disabled.
+ *
+ * @remarks In normal cases, don't use this API.
+ *          The fx mode is enabled by default.
+ *
+ * @deprecated Tizen Only API.
+ *
+ * @param obj The genlist object
+ * @param fx_mode The fx status
+ *                 (@c EINA_TRUE = fx mode, @c EINA_FALSE = normal mode)
+ */
+EINA_DEPRECATED EAPI void elm_genlist_fx_mode_set(Evas_Object *obj, Eina_Bool fx_mode);
+
+/**
+ * @internal
+ * @remarks Tizen only feature
+ *
+ * @brief Gets the genlist fx mode.
+ *
+ * @remarks This API can be changed or deleted later.
+ *
+ * @deprecated Tizen Only API.
+ *
+ * @param obj The genlist object
+ * @return The fx mode
+ *         (@c EINA_TRUE = on, @c EINA_FALSE = off)
+ */
+EINA_DEPRECATED EAPI Eina_Bool elm_genlist_fx_mode_get(const Evas_Object *obj);
+
+/**
+ * @internal
+ * @remarks Tizen only feature
+ *
+ * @brief Sets whether a given genlist item is hidden.
+ *
+ * @details This sets the hidden state of an item.
+ *
+ * @deprecated Tizen Only API.
+ *
+ * @param it The genlist item
+ * @param hide If @c EINA_TRUE it hides the item,
+ *             otherwise @c EINA_FALSE to show it
+ */
+EINA_DEPRECATED EAPI void elm_genlist_item_hide_set(const Elm_Object_Item *it, Eina_Bool hide);
+
+/**
+ * @internal
+ * @remarks Tizen only feature
+ *
+ * @brief Gets the genlist item's hidden mode
+ *
+ * @deprecated Tizen Only API.
+ *
+ * @param it The genlist item object
+ * @return The hidden mode
+ *         (EINA_TRUE = on, EINA_FALSE = off)
+ */
+EINA_DEPRECATED EAPI Eina_Bool elm_genlist_item_hide_get(const Elm_Object_Item *it);
+
 /**
  * @internal
  *
@@ -719,6 +787,8 @@ EINA_DEPRECATED EAPI void          elm_genlist_scroller_policy_set(Evas_Object *
  */
 EINA_DEPRECATED EAPI void          elm_genlist_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v);
 
+
+
 /**
  * @internal
  *
index c980819e241275f38b16698e5b07ceb5413a34ce..013d2b07adfd0341bd9cf9b3c360242383541a66 100644 (file)
@@ -67,7 +67,7 @@ struct Elm_Gen_Item
    Eina_Bool                 flipped : 1; /**< a flag that shows the flip status of the item. */
    Eina_Bool                 has_contents : 1; /**< content objs have or previously did exist (size calcs) */
    Eina_Bool                 cursor_engine_only : 1;
-   Eina_Bool                 hide : 1; /**< flag used for hiding the items which do not match filter text */
+   Eina_Bool                 want_hidden : 1; /**< flag used for hiding the items which do not match filter text */
    Eina_Bool                 filtered: 1; /**<flag used to indicate whether or not item has been filtered */
 };
 
index 3e0c8e6f70b8f05599eda2f676596a9d00fa1e95..b4240420139ed994c0dc06390a7f915914f965d9 100644 (file)
@@ -283,7 +283,7 @@ _banded_item_bg_index_color_set(Elm_Gen_Item *it_top, Evas_Coord ox, Evas_Coord
 
    while ((i < item_count) && (next))
      {
-        if (!next->realized || next->hide)
+        if (!next->realized || next->want_hidden)
           {
              prev = next;
              next = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(next)->next);
@@ -1980,7 +1980,7 @@ _item_block_realize(Item_Block *itb, Eina_Bool force)
      {
         if (sd->reorder.it == it) continue;
         if (!it->filtered) _item_filtered_get(it);
-        if (it->hide)
+        if (it->want_hidden)
           {
              if (it->realized) evas_object_hide(VIEW(it));
              continue;
@@ -2199,7 +2199,7 @@ _elm_genlist_pan_evas_object_smart_calculate(Eo *obj, Elm_Genlist_Pan_Data *psd)
 
         while(tmp)
           {
-             if (tmp->hide || !tmp->realized )
+             if (tmp->want_hidden || !tmp->realized )
                tmp = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(tmp)->prev);
              else
                break;
@@ -2209,7 +2209,7 @@ _elm_genlist_pan_evas_object_smart_calculate(Eo *obj, Elm_Genlist_Pan_Data *psd)
 
         while(prev)
           {
-             if(prev->hide)
+             if(prev->want_hidden)
                prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
              else
                break;
@@ -2246,7 +2246,7 @@ _elm_genlist_pan_evas_object_smart_calculate(Eo *obj, Elm_Genlist_Pan_Data *psd)
 
                             while(prev)
                               {
-                                 if(prev->hide)
+                                 if(prev->want_hidden)
                                     prev = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(prev)->prev);
                                  else
                                     break;
@@ -2870,7 +2870,7 @@ static Eina_Bool _item_focusable_search(Elm_Gen_Item **it, int dir)
    while (tmp)
      {
         if (!elm_object_item_disabled_get(EO_OBJ(tmp)) &&
-           (!tmp->hide))
+           (!tmp->want_hidden))
           {
              if ((tmp->select_mode == ELM_OBJECT_SELECT_MODE_DEFAULT) ||
                  (tmp->select_mode == ELM_OBJECT_SELECT_MODE_ALWAYS))
@@ -3896,7 +3896,7 @@ _item_mouse_move_cb(void *data,
 
    if (((sd->reorder_force) || (sd->reorder_mode)) &&
        (sd->reorder.it == it) &&
-       (!it->hide))
+       (!it->want_hidden))
      {
         Evas_Coord ox;
         evas_object_geometry_get(sd->pan_obj, &ox, NULL, NULL, NULL);
@@ -3933,7 +3933,7 @@ _item_mouse_move_cb(void *data,
    else
      {
         if (((sd->reorder_force) || (sd->reorder_mode)) &&
-            (sd->reorder.it == it) && (!it->hide))
+            (sd->reorder.it == it) && (!it->want_hidden))
           return;
         Evas_Coord x, y, w, h;
         evas_object_geometry_get(obj, &x, &y, &w, &h);
@@ -4963,7 +4963,7 @@ _item_block_calc(Item_Block *itb)
 
    EINA_LIST_FOREACH(itb->items, l, it)
      {
-        if (it->hide) continue;
+        if (it->want_hidden) continue;
         if (GL_IT(it)->updateme)
           {
              if (it->realized)
@@ -5595,7 +5595,7 @@ _elm_genlist_elm_widget_atspi(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, Eina_Bo
              done = EINA_TRUE;
              EINA_LIST_FOREACH(itb->items, l, it)
                {
-                  if (!it->realized || it->hide) continue;
+                  if (!it->realized || it->want_hidden) continue;
                   if (is_atspi)
                     {
                        elm_interface_atspi_accessible_added(EO_OBJ(it));
@@ -6788,6 +6788,12 @@ _elm_genlist_item_show(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it, Elm_Genlist_It
 {
    ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
 
+   if (it->want_hidden)
+     {
+        WRN("Filter hided item cannot move to show");
+        return;
+     }
+
    Elm_Genlist_Data *sd = GL_IT(it)->wsd;
    sd->show_item = it;
    sd->bring_in = EINA_FALSE;
@@ -6800,6 +6806,12 @@ _elm_genlist_item_bring_in(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it, Elm_Genlis
 {
    ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
 
+   if (it->want_hidden)
+     {
+        WRN("Filter hided item cannot move to bring in");
+        return;
+     }
+
    Elm_Genlist_Data *sd = GL_IT(it)->wsd;
    sd->show_item = it;
    sd->bring_in = EINA_TRUE;
@@ -7299,7 +7311,7 @@ _filter_item_internal(Elm_Gen_Item *it)
                (void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)),
                 WIDGET(it), sd->filter_data))
           {
-             it->hide = EINA_TRUE;
+             it->want_hidden = EINA_TRUE;
              GL_IT(it)->block->calc_done = EINA_FALSE;
              sd->calc_done = EINA_FALSE;
           }
@@ -7335,7 +7347,7 @@ _item_filtered_get(Elm_Gen_Item *it)
         sd->calc_done = EINA_FALSE;
         _changed(sd->pan_obj);
    }
-   if (!it->hide) return EINA_TRUE;
+   if (!it->want_hidden) return EINA_TRUE;
    return EINA_FALSE;
 }
 
@@ -7439,7 +7451,7 @@ elm_genlist_filter_set(Evas_Object *obj, void *filter_data)
              EINA_LIST_FOREACH(itb->items, l, it)
                {
                   it->filtered = EINA_FALSE;
-                  it->hide = EINA_FALSE;
+                  it->want_hidden = EINA_FALSE;
                   if (it->realized)
                     _filter_item_internal(it);
                   else
@@ -7453,7 +7465,7 @@ elm_genlist_filter_set(Evas_Object *obj, void *filter_data)
             EINA_LIST_FOREACH(itb->items, l, it)
               {
                  it->filtered = EINA_FALSE;
-                 it->hide = EINA_FALSE;
+                 it->want_hidden = EINA_FALSE;
                  sd->filter_queue = eina_list_append(sd->filter_queue, it);
               }
          }
@@ -8202,27 +8214,14 @@ elm_genlist_fx_mode_get(const Evas_Object *obj)
 EAPI void
 elm_genlist_item_hide_set(const Elm_Object_Item *eo_item, Eina_Bool hide)
 {
-   ELM_GENLIST_ITEM_DATA_GET(eo_item, it);
-   ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
-   Elm_Genlist_Data *sd = GL_IT(it)->wsd;
-
-   if (it->hide == !!hide) return;
-   it->hide = !!hide;
-
-   if (GL_IT(it)->block)
-     GL_IT(it)->block->calc_done = EINA_FALSE;
-   sd->calc_done = EINA_FALSE;
-
-   _changed(sd->pan_obj);
+   WRN("This API is deprecated, please use filter_set instead of this");
 }
 
 EAPI Eina_Bool
 elm_genlist_item_hide_get(const Elm_Object_Item *eo_item)
 {
-   ELM_GENLIST_ITEM_DATA_GET(eo_item, it);
-   ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, EINA_FALSE)
-
-   return it->hide;
+   WRN("This API is deprecated, please use filter_set instead of this");
+   return EINA_FALSE;
 }
 
 ///////////////////////////////////////////////////////////////////////////////