2013-10-03 Daniel Juyung Seo (SeoZ)
- * Genlist/Gengrid: Added multi select mode.
+ * Genlist/Gengrid/List: Added multi select mode.
* Add signals "spinner,drag,start" and "spinner,drag,stop" to the spinner widget.
* Add support for "clicked" callback on Return/space/KP_Enter key press for image.
* Add elm_slider_step_get(), elm_slider_step_set() for slider.
- * Add multi select mode for genlist/gengrid.
+ * Add multi select mode for genlist/gengrid/list.
Improvements:
*ret = sd->multi;
}
+EAPI void
+elm_list_multi_select_mode_set(Evas_Object *obj,
+ Elm_Object_Multi_Select_Mode mode)
+{
+ ELM_LIST_CHECK(obj);
+ eo_do(obj, elm_obj_list_multi_select_mode_set(mode));
+}
+
+static void
+_multi_select_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Multi_Select_Mode mode = va_arg(*list, Elm_Object_Multi_Select_Mode);
+ Elm_List_Smart_Data *sd = _pd;
+
+ if (mode >= ELM_OBJECT_MULTI_SELECT_MODE_MAX)
+ return;
+
+ if (sd->multi_select_mode != mode)
+ sd->multi_select_mode = mode;
+}
+
+EAPI Elm_Object_Multi_Select_Mode
+elm_list_multi_select_mode_get(const Evas_Object *obj)
+{
+ ELM_LIST_CHECK(obj) ELM_OBJECT_MULTI_SELECT_MODE_MAX;
+ Elm_Object_Multi_Select_Mode ret = ELM_OBJECT_MULTI_SELECT_MODE_MAX;
+ eo_do((Eo *)obj, elm_obj_list_multi_select_mode_get(&ret));
+ return ret;
+}
+
+static void
+_multi_select_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Multi_Select_Mode *ret = va_arg(*list, Elm_Object_Multi_Select_Mode *);
+ Elm_List_Smart_Data *sd = _pd;
+
+ *ret = sd->multi_select_mode;
+}
EAPI void
elm_list_mode_set(Evas_Object *obj,
EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_GO), _go),
EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_SET), _multi_select_set),
EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_GET), _multi_select_get),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_MODE_SET), _multi_select_mode_set),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_MODE_GET), _multi_select_mode_get),
EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MODE_SET), _mode_set),
EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MODE_GET), _mode_get),
EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_HORIZONTAL_SET), _horizontal_set),
EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_GO, "Starts the list."),
EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_SET, "Enable or disable multiple items selection on the list object."),
EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_GET, "Get a value whether multiple items selection is enabled or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_MODE_SET, "Set the list multi select mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_MODE_GET, "Get the list multi select mode."),
EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_MODE_SET, "Set which mode to use for the list object."),
EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_MODE_GET, "Get the mode the list is at."),
EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_HORIZONTAL_SET, "Enable or disable horizontal mode on the list object."),
ELM_OBJ_LIST_SUB_ID_GO,
ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_SET,
ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_GET,
+ ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_MODE_SET,
+ ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_MODE_GET,
ELM_OBJ_LIST_SUB_ID_MODE_SET,
ELM_OBJ_LIST_SUB_ID_MODE_GET,
ELM_OBJ_LIST_SUB_ID_HORIZONTAL_SET,
#define elm_obj_list_multi_select_get(ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_GET), EO_TYPECHECK(Eina_Bool *, ret)
/**
+ * @def elm_obj_list_multi_select_mode_set
+ * @since 1.8
+ *
+ * Set the list multi select mode.
+ *
+ * @param[in] mode
+ *
+ * - ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT : select/unselect items whenever each
+ * item is clicked.
+ * - ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL : Only one item will be selected
+ * although multi-selection is enabled, if clicked without pressing control
+ * key. This mode is only available with multi-selection.
+ *
+ * @see elm_list_multi_select_set()
+ * @see elm_list_multi_select_mode_get()
+ */
+#define elm_obj_list_multi_select_mode_set(mode) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_MODE_SET), EO_TYPECHECK(Elm_Object_Multi_Select_Mode, mode)
+
+/**
+ * @def elm_obj_list_multi_select_mode_get
+ * @since 1.8
+ *
+ * Get the list multi select mode.
+ *
+ * @param[out] ret
+ *
+ * (If getting mode is failed, it returns ELM_OBJECT_MULTI_SELECT_MODE_MAX)
+ *
+ * @see elm_list_multi_select_set()
+ * @see elm_list_multi_select_mode_set()
+ */
+#define elm_obj_list_multi_select_mode_get(ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_MODE_GET), EO_TYPECHECK(Elm_Object_Multi_Select_Mode *, ret)
+
+/**
* @def elm_obj_list_mode_set
* @since 1.8
*
EAPI Eina_Bool elm_list_multi_select_get(const Evas_Object *obj);
/**
+ * Set the list multi select mode.
+ *
+ * @param obj The list object
+ * @param mode The multi select mode
+ *
+ * - ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT : select/unselect items whenever each
+ * item is clicked.
+ * - ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL : Only one item will be selected
+ * although multi-selection is enabled, if clicked without pressing control
+ * key. This mode is only available with multi-selection.
+ *
+ * @see elm_list_multi_select_set()
+ * @see elm_list_multi_select_mode_get()
+ *
+ * @ingroup List
+ * @since 1.8
+ */
+EAPI void elm_list_multi_select_mode_set(Evas_Object *obj, Elm_Object_Multi_Select_Mode mode);
+
+/**
+ * Get the list multi select mode.
+ *
+ * @param obj The list object
+ * @return The multi select mode
+ * (If getting mode is failed, it returns ELM_OBJECT_MULTI_SELECT_MODE_MAX)
+ *
+ * @see elm_list_multi_select_set()
+ * @see elm_list_multi_select_mode_set()
+ *
+ * @ingroup List
+ * @since 1.8
+ */
+EAPI Elm_Object_Multi_Select_Mode elm_list_multi_select_mode_get(const Evas_Object *obj);
+
+/**
* Set which mode to use for the list object.
*
* @param obj The list object
Elm_Object_Item *last_selected_item;
Evas_Coord minw[2], minh[2];
Elm_Object_Select_Mode select_mode;
+ Elm_Object_Multi_Select_Mode multi_select_mode; /**< select mode for multiple selection */
int movements;
int walking;
Elm_List_Mode h_mode;