Rename mbe shrink_mode to expanded. Consistent with genlist naming.
authorsanjeev <sanjeev@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 6 Mar 2012 01:45:25 +0000 (01:45 +0000)
committersanjeev <sanjeev@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 6 Mar 2012 01:45:25 +0000 (01:45 +0000)
Signed-off-by: Sanjeev BA <as2902.b@samsung.com>
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@68760 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/test_multibuttonentry.c
src/lib/elc_multibuttonentry.c
src/lib/elc_multibuttonentry.h
src/lib/elm_deprecated.h

index 52c4e09..6b64e82 100644 (file)
@@ -48,7 +48,7 @@ _mbe_clicked_cb(void *data __UNUSED__,
                 void *event_info __UNUSED__ )
 {
    //Unset the multibuttonentry to contracted mode of single line
-   elm_multibuttonentry_shrink_mode_set(obj, 0);
+   elm_multibuttonentry_expanded_set(obj, EINA_TRUE);
    printf("A multibuttonentry is clicked!\n");
    Evas_Object *entry;
    entry = elm_multibuttonentry_entry_get(obj);
@@ -71,7 +71,7 @@ _mbe_unfocused_cb(void *data __UNUSED__,
                   void *event_info __UNUSED__ )
 {
    //Set the multibuttonentry to contracted mode of single line
-   elm_multibuttonentry_shrink_mode_set(obj, EINA_TRUE);
+   elm_multibuttonentry_expanded_set(obj, EINA_FALSE);
    printf("multibuttonentry unfocused!\n");
 }
 
index 4e8545f..8296e77 100644 (file)
@@ -1467,25 +1467,50 @@ elm_multibuttonentry_guide_text_set(Evas_Object *obj, const char *guidetext)
      _set_guidetext(obj, "");
 }
 
-EAPI int
+EINA_DEPRECATED EAPI int
 elm_multibuttonentry_shrink_mode_get(const Evas_Object *obj)
 {
+   if (elm_multibuttonentry_expanded_get(obj))
+     return 0;
+   else
+     return 1;
+}
+
+EAPI Eina_Bool
+elm_multibuttonentry_expanded_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->view_state == MULTIBUTTONENTRY_VIEW_SHRINK ? 1 : 0;
+     return (wd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK ? EINA_FALSE : EINA_TRUE);
+
 }
 
-EAPI void
+EINA_DEPRECATED EAPI void
 elm_multibuttonentry_shrink_mode_set(Evas_Object *obj, int shrink)
 {
+   if (shrink==0)
+     elm_multibuttonentry_expanded_set(obj, EINA_TRUE);
+
+   if (shrink==1)
+     elm_multibuttonentry_expanded_set(obj, EINA_FALSE);
+}
+
+EAPI void
+elm_multibuttonentry_expanded_set(Evas_Object *obj, Eina_Bool expanded)
+{
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
 
    if (!wd || !wd->box ||
-       ((wd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK) ? 1 : 0) == shrink) return;
-   _shrink_mode_set(obj, shrink);
+       ((wd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK) ? EINA_FALSE : EINA_TRUE) == expanded) return;
+
+   if (expanded)
+     _shrink_mode_set(obj, 0);
+   else
+     _shrink_mode_set(obj, 1);
+
 }
 
 EAPI Elm_Object_Item *
index dcf3f19..1f6ce85 100644 (file)
@@ -1,11 +1,16 @@
 /**
  * @defgroup Multibuttonentry Multibuttonentry
  *
- * A Multibuttonentry is a widget to allow a user enter text and manage it as a number of buttons
- * Each text button is inserted by pressing the "return" key. If there is no space in the current row,
- * a new button is added to the next row. When a text button is pressed, it will become focused.
+ * A Multibuttonentry is a widget to allow a user enter text and manage it as a number 
+ * of buttons. Each text button is inserted by pressing the "return" key. 
+ * If there is no space in the current row, a new button is added to the next row. 
+ * When a text button is pressed, it will become focused.
  * Backspace removes the focus.
- * When the Multibuttonentry loses focus items longer than 1 lines are shrunk to one line.
+ * When the Multibuttonentry loses focus items longer than one line are shrunk 
+ * to one line.
+ *
+ * Typical use case of multibuttonentry is, composing emails/messages to a group
+ * of addresses, each of which is an item that can be clicked for further actions.
  *
  * Smart callbacks one can register:
  * - @c "item,selected" - when item is selected. May be called on backspace key.
@@ -41,7 +46,6 @@
  * 1. docs are lacking.
  * 2. name sucks
  * 3. should use the elm_object_part_text_set to set guide text.
- * 4. shrink_mode is an awful name.
  * 5. bugs: offset bug with the "tap to add recipient" + delete doesn't delete items but backspace does. */
 
 /**
@@ -94,24 +98,30 @@ EAPI const char                *elm_multibuttonentry_guide_text_get(const Evas_O
 EAPI void                       elm_multibuttonentry_guide_text_set(Evas_Object *obj, const char *guidetext);
 
 /**
- * Get the value of shrink_mode state.
+ * Get the value of expanded state.
+ * In expanded state, the complete entry will be displayed.
+ * Otherwise, only single line of the entry will be displayed.
  *
  * @param obj The multibuttonentry object
- * @return the value of shrink mode state.
+ * @return EINA_TRUE if the widget is in expanded state. EINA_FALSE if not.
  *
  * @ingroup Multibuttonentry
  */
-EAPI int                        elm_multibuttonentry_shrink_mode_get(const Evas_Object *obj);
+EAPI Eina_Bool                  elm_multibuttonentry_expanded_get(const Evas_Object *obj);
 
 /**
- * Set/Unset the multibuttonentry to shrink mode state of single line
+ * Set/Unset the multibuttonentry to expanded state.
+ * In expanded state, the complete entry will be displayed.
+ * Otherwise, only single line of the entry will be displayed.
  *
  * @param obj The multibuttonentry object
- * @param shrink the value of shrink_mode state. Set this to 1 to set the multibuttonentry to shrink state of single line. Set this to 0 to unset the contracted state.
+ * @param expanded the value of expanded state.
+ *        Set this to EINA_TRUE for expanded state. 
+ *        Set this to EINA_FALSE for single line state.
  *
  * @ingroup Multibuttonentry
  */
-EAPI void                       elm_multibuttonentry_shrink_mode_set(Evas_Object *obj, int shrink);
+EAPI void                       elm_multibuttonentry_expanded_set(Evas_Object *obj, Eina_Bool expanded);
 
 /**
  * Prepend a new item to the multibuttonentry
index 6aacd17..ec22d35 100644 (file)
@@ -4950,6 +4950,20 @@ EINA_DEPRECATED EAPI void                  elm_icon_scale_get(const Evas_Object
  * @ingroup Index
  */
 EINA_DEPRECATED EAPI Elm_Object_Item      *elm_index_item_selected_get(const Evas_Object *obj, int level);
+
+/**
+ * Get the value of shrink_mode state.
+ *
+ * @deprecated elm_multibuttonentry_expanded_get()
+ */
+EINA_DEPRECATED EAPI int                        elm_multibuttonentry_shrink_mode_get(const Evas_Object *obj);
+
+/**
+ * Set/Unset the multibuttonentry to shrink mode state of single line
+ *
+ * @deprecated elm_multibuttonentry_expanded_set()
+ */
+EINA_DEPRECATED EAPI void                       elm_multibuttonentry_shrink_mode_set(Evas_Object *obj, int shrink_mode);
 /**
  * @}
  */