[selectioninfo] Modified for Beat UX
authorjh0506.yun <jh0506.yun@samsung.com>
Sat, 14 Aug 2010 09:16:47 +0000 (18:16 +0900)
committerjh0506.yun <jh0506.yun@samsung.com>
Sat, 14 Aug 2010 09:16:47 +0000 (18:16 +0900)
src/lib/Elementary.h.in
src/lib/elm_selectioninfo.c

index 138bd6d..8bb2bb2 100644 (file)
@@ -696,12 +696,13 @@ extern "C" {
    EAPI void         elm_notify_repeat_events_set(Evas_Object *obj, Eina_Bool repeat);
    /* smart callbacks called:
     */
-  
    EAPI Evas_Object *elm_selectioninfo_add(Evas_Object *parent);
    EAPI void         elm_selectioninfo_content_set(Evas_Object *obj, Evas_Object *content);
    EAPI void         elm_selectioninfo_parent_set(Evas_Object *obj, Evas_Object *parent);
    EAPI void         elm_selectioninfo_check_state_set(Evas_Object *obj, Eina_Bool *state, int count);
-   EAPI void         elm_selectioninfo_show(Evas_Object *obj);
+   EAPI int          elm_selectioninfo_checked_count_get(Evas_Object *obj);
+   EAPI void         elm_selectioninfo_text_set(Evas_Object *obj, char* text);
    /* smart callbacks called:
     */
    
index 8ccd7dd..76019d9 100644 (file)
@@ -4,7 +4,6 @@
 #include <Elementary.h>
 #include "elm_priv.h"
 
-
 /**
  * @defgroup Selectioninfo selectioninfo
  * @ingroup Elementary
@@ -26,7 +25,6 @@ struct _Widget_Data
        Evas_Object* parent;
        Eina_Bool* check_state;
        int check_count;
-       char label_text[128];
 };
 
 static const char *widtype = NULL;
@@ -297,39 +295,46 @@ elm_selectioninfo_check_state_set(Evas_Object *obj, Eina_Bool *state, int count)
 }
 
 /**
- * Show the selectioninfo
+ * Get the checked count
  *
  * @param obj The selectioninfo object
  *
  * @ingroup Selectioninfo
  */
-EAPI void
-elm_selectioninfo_show(Evas_Object *obj)
+
+EAPI int
+elm_selectioninfo_checked_count_get(Evas_Object *obj)
 {
-       ELM_CHECK_WIDTYPE(obj, widtype);
        Widget_Data *wd = elm_widget_data_get(obj);
-       if (!wd) return;
+       if (!wd) return -1;
 
        int i;
-        int state_count = 0;
-        for (i=0; i<wd->check_count; i++)
+       int count = 0;
+       for (i=0; i<wd->check_count; i++)
        {
                if (wd->check_state[i])
-                       state_count++;
-        }
-
-       if (state_count == 0)
-       {
-               evas_object_hide(wd->selectioninfo);
+               count++;
        }
-       else
-       {
-               if (state_count == 1)
-                       sprintf(wd->label_text, "%d File Selected", state_count);
-               else
-                       sprintf(wd->label_text, "%d Files Selected", state_count);
-               edje_object_part_text_set(_EDJ(wd->content), "elm.text", strdup(wd->label_text));
-               evas_object_show(wd->selectioninfo);    
-       }          
+
+       return count;
+}
+
+/**
+ * Set the text to the selectioninfo
+ *
+ * @param obj The selectioninfo object
+ * @param text The text
+ *
+ * @ingroup Selectioninfo
+ */
+
+EAPI void
+elm_selectioninfo_text_set(Evas_Object *obj, char* text)
+{
+       ELM_CHECK_WIDTYPE(obj, widtype);
+       Widget_Data *wd = elm_widget_data_get(obj);
+       if (!wd) return;
+
+       edje_object_part_text_set(_EDJ(wd->content), "elm.text", strdup(text));
 }