From 0ca5c025aa17c800a99cdacd54ce1243645b5080 Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Sun, 28 Apr 2013 10:23:15 +0300 Subject: [PATCH] Elementary: header split for DateTime, DaySelector, DiskSelector, Entry, Flip, Flip Selector, Frame, Gesture Layer, GLView, Hover, Icon, Inwin, Label. --- legacy/elementary/src/lib/Makefile.am | 36 + legacy/elementary/src/lib/elm_datetime.h | 586 +--- .../elementary/src/lib/elm_datetime_common.h | 15 + legacy/elementary/src/lib/elm_datetime_eo.h | 205 ++ .../elementary/src/lib/elm_datetime_legacy.h | 382 +++ legacy/elementary/src/lib/elm_dayselector.h | 261 +- .../src/lib/elm_dayselector_common.h | 19 + .../elementary/src/lib/elm_dayselector_eo.h | 135 + .../src/lib/elm_dayselector_legacy.h | 114 + legacy/elementary/src/lib/elm_diskselector.h | 501 +-- .../src/lib/elm_diskselector_common.h | 80 + .../elementary/src/lib/elm_diskselector_eo.h | 194 ++ .../src/lib/elm_diskselector_legacy.h | 240 ++ legacy/elementary/src/lib/elm_entry.h | 2710 +---------------- legacy/elementary/src/lib/elm_entry_common.h | 381 +++ legacy/elementary/src/lib/elm_entry_eo.h | 1321 ++++++++ legacy/elementary/src/lib/elm_entry_legacy.h | 1172 +++++++ legacy/elementary/src/lib/elm_flip.h | 418 +-- legacy/elementary/src/lib/elm_flip_common.h | 32 + legacy/elementary/src/lib/elm_flip_eo.h | 154 + legacy/elementary/src/lib/elm_flip_legacy.h | 242 ++ legacy/elementary/src/lib/elm_flipselector.h | 415 +-- .../elementary/src/lib/elm_flipselector_eo.h | 171 ++ .../src/lib/elm_flipselector_legacy.h | 196 ++ legacy/elementary/src/lib/elm_frame.h | 154 +- legacy/elementary/src/lib/elm_frame_eo.h | 86 + legacy/elementary/src/lib/elm_frame_legacy.h | 68 + legacy/elementary/src/lib/elm_gesture_layer.h | 622 +--- .../src/lib/elm_gesture_layer_common.h | 379 +++ .../elementary/src/lib/elm_gesture_layer_eo.h | 139 + .../src/lib/elm_gesture_layer_legacy.h | 111 + legacy/elementary/src/lib/elm_glview.h | 382 +-- legacy/elementary/src/lib/elm_glview_common.h | 52 + legacy/elementary/src/lib/elm_glview_eo.h | 182 ++ legacy/elementary/src/lib/elm_glview_legacy.h | 162 + legacy/elementary/src/lib/elm_hover.h | 186 +- legacy/elementary/src/lib/elm_hover_common.h | 13 + legacy/elementary/src/lib/elm_hover_eo.h | 71 + legacy/elementary/src/lib/elm_hover_legacy.h | 99 + legacy/elementary/src/lib/elm_icon.h | 221 +- legacy/elementary/src/lib/elm_icon_common.h | 29 + legacy/elementary/src/lib/elm_icon_eo.h | 90 + legacy/elementary/src/lib/elm_icon_legacy.h | 102 + legacy/elementary/src/lib/elm_inwin.h | 112 +- legacy/elementary/src/lib/elm_inwin_eo.h | 23 + legacy/elementary/src/lib/elm_inwin_legacy.h | 82 + legacy/elementary/src/lib/elm_label.h | 348 +-- legacy/elementary/src/lib/elm_label_common.h | 7 + legacy/elementary/src/lib/elm_label_eo.h | 176 ++ legacy/elementary/src/lib/elm_label_legacy.h | 175 ++ 50 files changed, 7223 insertions(+), 6828 deletions(-) create mode 100644 legacy/elementary/src/lib/elm_datetime_common.h create mode 100644 legacy/elementary/src/lib/elm_datetime_eo.h create mode 100644 legacy/elementary/src/lib/elm_datetime_legacy.h create mode 100644 legacy/elementary/src/lib/elm_dayselector_common.h create mode 100644 legacy/elementary/src/lib/elm_dayselector_eo.h create mode 100644 legacy/elementary/src/lib/elm_dayselector_legacy.h create mode 100644 legacy/elementary/src/lib/elm_diskselector_common.h create mode 100644 legacy/elementary/src/lib/elm_diskselector_eo.h create mode 100644 legacy/elementary/src/lib/elm_diskselector_legacy.h create mode 100644 legacy/elementary/src/lib/elm_entry_common.h create mode 100644 legacy/elementary/src/lib/elm_entry_eo.h create mode 100644 legacy/elementary/src/lib/elm_entry_legacy.h create mode 100644 legacy/elementary/src/lib/elm_flip_common.h create mode 100644 legacy/elementary/src/lib/elm_flip_eo.h create mode 100644 legacy/elementary/src/lib/elm_flip_legacy.h create mode 100644 legacy/elementary/src/lib/elm_flipselector_eo.h create mode 100644 legacy/elementary/src/lib/elm_flipselector_legacy.h create mode 100644 legacy/elementary/src/lib/elm_frame_eo.h create mode 100644 legacy/elementary/src/lib/elm_frame_legacy.h create mode 100644 legacy/elementary/src/lib/elm_gesture_layer_common.h create mode 100644 legacy/elementary/src/lib/elm_gesture_layer_eo.h create mode 100644 legacy/elementary/src/lib/elm_gesture_layer_legacy.h create mode 100644 legacy/elementary/src/lib/elm_glview_common.h create mode 100644 legacy/elementary/src/lib/elm_glview_eo.h create mode 100644 legacy/elementary/src/lib/elm_glview_legacy.h create mode 100644 legacy/elementary/src/lib/elm_hover_common.h create mode 100644 legacy/elementary/src/lib/elm_hover_eo.h create mode 100644 legacy/elementary/src/lib/elm_hover_legacy.h create mode 100644 legacy/elementary/src/lib/elm_icon_common.h create mode 100644 legacy/elementary/src/lib/elm_icon_eo.h create mode 100644 legacy/elementary/src/lib/elm_icon_legacy.h create mode 100644 legacy/elementary/src/lib/elm_inwin_eo.h create mode 100644 legacy/elementary/src/lib/elm_inwin_legacy.h create mode 100644 legacy/elementary/src/lib/elm_label_common.h create mode 100644 legacy/elementary/src/lib/elm_label_eo.h create mode 100644 legacy/elementary/src/lib/elm_label_legacy.h diff --git a/legacy/elementary/src/lib/Makefile.am b/legacy/elementary/src/lib/Makefile.am index 490b4b95db..e96600a758 100644 --- a/legacy/elementary/src/lib/Makefile.am +++ b/legacy/elementary/src/lib/Makefile.am @@ -187,32 +187,68 @@ elm_conform_eo.h \ elm_conform_legacy.h \ elm_cursor.h \ elm_datetime.h \ +elm_datetime_common.h \ +elm_datetime_eo.h \ +elm_datetime_legacy.h \ elm_dayselector.h \ +elm_dayselector_common.h \ +elm_dayselector_eo.h \ +elm_dayselector_legacy.h \ elm_debug.h \ elm_deprecated.h \ elm_diskselector.h \ +elm_diskselector_common.h \ +elm_diskselector_eo.h \ +elm_diskselector_legacy.h \ elm_entry.h \ +elm_entry_common.h \ +elm_entry_eo.h \ +elm_entry_legacy.h \ elm_finger.h \ elm_flip.h \ +elm_flip_common.h \ +elm_flip_eo.h \ +elm_flip_legacy.h \ elm_flipselector.h \ +elm_flipselector_eo.h \ +elm_flipselector_legacy.h \ elm_focus.h \ elm_font.h \ elm_frame.h \ +elm_frame_eo.h \ +elm_frame_legacy.h \ elm_gen.h \ elm_general.h \ elm_gengrid.h \ elm_genlist.h \ elm_gesture_layer.h \ +elm_gesture_layer_common.h \ +elm_gesture_layer_eo.h \ +elm_gesture_layer_legacy.h \ elm_getting_started.h \ elm_glview.h \ +elm_glview_common.h \ +elm_glview_eo.h \ +elm_glview_legacy.h \ elm_grid.h \ elm_hover.h \ +elm_hover_common.h \ +elm_hover_eo.h \ +elm_hover_legacy.h \ elm_icon.h \ +elm_icon_common.h \ +elm_icon_eo.h \ +elm_icon_legacy.h \ elm_image.h \ elm_index.h \ elm_intro.h \ elm_inwin.h \ +elm_inwin_eo.h \ +elm_inwin_legacy.h \ elm_label.h \ +elm_label_common.h \ +elm_label_eo.h \ +elm_label_legacy.h \ elm_layout.h \ elm_list.h \ elm_macros.h \ diff --git a/legacy/elementary/src/lib/elm_datetime.h b/legacy/elementary/src/lib/elm_datetime.h index 16a14c46fe..5d8958bcae 100644 --- a/legacy/elementary/src/lib/elm_datetime.h +++ b/legacy/elementary/src/lib/elm_datetime.h @@ -190,590 +190,18 @@ * */ -#define ELM_OBJ_DATETIME_CLASS elm_obj_datetime_class_get() - -const Eo_Class *elm_obj_datetime_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_DATETIME_BASE_ID; - -enum -{ - ELM_OBJ_DATETIME_SUB_ID_FORMAT_GET, - ELM_OBJ_DATETIME_SUB_ID_FORMAT_SET, - ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_GET, - ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_SET, - ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_GET, - ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_SET, - ELM_OBJ_DATETIME_SUB_ID_VALUE_GET, - ELM_OBJ_DATETIME_SUB_ID_VALUE_SET, - ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_GET, - ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_SET, - ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_GET, - ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_SET, - ELM_OBJ_DATETIME_SUB_ID_LAST -}; - -#define ELM_OBJ_DATETIME_ID(sub_id) (ELM_OBJ_DATETIME_BASE_ID + sub_id) - - -/** - * @def elm_obj_datetime_format_get - * @since 1.8 - * - * Get the datetime format. - * - * @param[out] ret - * - * @see elm_datetime_format_get - */ -#define elm_obj_datetime_format_get(ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FORMAT_GET), EO_TYPECHECK(const char **, ret) - -/** - * @def elm_obj_datetime_format_set - * @since 1.8 - * - * Set the datetime format. - * - * @param[in] fmt - * - * @see elm_datetime_format_set - */ -#define elm_obj_datetime_format_set(fmt) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FORMAT_SET), EO_TYPECHECK(const char *, fmt) - -/** - * @def elm_obj_datetime_field_visible_get - * @since 1.8 - * - * @brief Get whether a field can be visible/not - * - * @param[in] fieldtype - * @param[out] ret - * - * @see elm_datetime_field_visible_get - */ -#define elm_obj_datetime_field_visible_get(fieldtype, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_GET), EO_TYPECHECK(Elm_Datetime_Field_Type, fieldtype), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_datetime_field_visible_set - * @since 1.8 - * - * @brief Set a field to be visible or not. - * - * @param[in] fieldtype - * @param[in] visible - * - * @see elm_datetime_field_visible_set - */ -#define elm_obj_datetime_field_visible_set(fieldtype, visible) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_SET), EO_TYPECHECK(Elm_Datetime_Field_Type, fieldtype), EO_TYPECHECK(Eina_Bool, visible) - -/** - * @def elm_obj_datetime_field_limit_get - * @since 1.8 - * - * @brief Get the field limits of a field. - * - * @param[in] fieldtype - * @param[out] min - * @param[out] max - * - * @see elm_datetime_field_limit_get - */ -#define elm_obj_datetime_field_limit_get(fieldtype, min, max) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_GET), EO_TYPECHECK(Elm_Datetime_Field_Type, fieldtype), EO_TYPECHECK(int *, min), EO_TYPECHECK(int *, max) - -/** - * @def elm_obj_datetime_field_limit_set - * @since 1.8 - * - * @brief Set the field limits of a field. - * - * @param[in] fieldtype - * @param[in] min - * @param[in] max - * - * @see elm_datetime_field_limit_set - */ -#define elm_obj_datetime_field_limit_set(fieldtype, min, max) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_SET), EO_TYPECHECK(Elm_Datetime_Field_Type, fieldtype), EO_TYPECHECK(int, min), EO_TYPECHECK(int, max) - -/** - * @def elm_obj_datetime_value_get - * @since 1.8 - * - * @brief Get the current value of a field. - * - * @param[out] currtime - * @param[out] ret - * - * @see elm_datetime_value_get - */ -#define elm_obj_datetime_value_get(currtime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_GET), EO_TYPECHECK(struct tm *, currtime), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_datetime_value_set - * @since 1.8 - * - * @brief Set the current value of a Datetime object. - * - * @param[in] newtime - * @param[out] ret - * - * @see elm_datetime_value_set - */ -#define elm_obj_datetime_value_set(newtime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_SET), EO_TYPECHECK(const struct tm *, newtime), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_datetime_value_min_get - * @since 1.8 - * - * @brief Get the lower boundary of a field. - * - * @param[out] mintime - * @param[out] ret - * - * @see elm_datetime_value_min_get - */ -#define elm_obj_datetime_value_min_get(mintime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_GET), EO_TYPECHECK(struct tm *, mintime), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_datetime_value_min_set - * @since 1.8 - * - * @brief Set the lower boundary of a field. - * - * @param[in] mintime - * @param[out] ret - * - * @see elm_datetime_value_min_set - */ -#define elm_obj_datetime_value_min_set(mintime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_SET), EO_TYPECHECK(const struct tm *, mintime), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_datetime_value_max_get - * @since 1.8 - * - * @brief Get the upper boundary of a field. - * - * @param[out] maxtime - * @param[out] ret - * - * @see elm_datetime_value_max_get - */ -#define elm_obj_datetime_value_max_get(maxtime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_GET), EO_TYPECHECK(struct tm *, maxtime), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_datetime_value_max_set - * @since 1.8 - * - * @brief Set the upper boundary of a field. - * - * @param[in] maxtime - * @param[out] ret - * - * @see elm_datetime_value_max_set - */ -#define elm_obj_datetime_value_max_set(maxtime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_SET), EO_TYPECHECK(const struct tm *, maxtime), EO_TYPECHECK(Eina_Bool *, ret) /** * @addtogroup Datetime * @{ */ -/** - * Identifies a Datetime field, The widget supports 6 fields : Year, month, - * Date, Hour, Minute, AM/PM - * - */ -typedef enum _Elm_Datetime_Field_Type -{ - ELM_DATETIME_YEAR = 0, /**< Indicates Year field */ - ELM_DATETIME_MONTH = 1, /**< Indicates Month field */ - ELM_DATETIME_DATE = 2, /**< Indicates Date field */ - ELM_DATETIME_HOUR = 3, /**< Indicates Hour field */ - ELM_DATETIME_MINUTE = 4, /**< Indicates Minute field */ - ELM_DATETIME_AMPM = 5, /**< Indicates AM/PM field */ -} Elm_Datetime_Field_Type; - -/** - * @brief Adds a new datetime Widget - * - * The default datetime format and corresponding strings are based on current locale. - * - * @param parent The parent object - * @return The new object or NULL if it cannot be created - * - * This function inserts a new datetime widget on the canvas. - * - * @ingroup Datetime - */ -EAPI Evas_Object *elm_datetime_add(Evas_Object *parent); - -/** - * Get the datetime format. Format is a combination of allowed Libc date format - * specifiers like: "%b %d, %Y %I : %M %p". - * - * Maximum allowed format length is 64 chars. - * - * Format can include separators for each individual datetime field except - * for AM/PM field. - * - * Each separator can be a maximum of 6 UTF-8 bytes. - * Space is also taken as a separator. - * - * Following are the allowed set of format specifiers for each datetime field. - * - * @b %%Y : The year as a decimal number including the century. - * - * @b %%y : The year as a decimal number without a century (range 00 to 99). - * - * @b %%m : The month as a decimal number (range 01 to 12). - * - * @b %%b : The abbreviated month name according to the current locale. - * - * @b %%B : The full month name according to the current locale. - * - * @b %%h : The abbreviated month name according to the current locale(same as %%b). - * - * @b %%d : The day of the month as a decimal number (range 01 to 31). - * - * @b %%e : The day of the month as a decimal number (range 1 to 31). single - * digits are preceded by a blank. - * - * @b %%I : The hour as a decimal number using a 12-hour clock (range 01 to 12). - * - * @b %%H : The hour as a decimal number using a 24-hour clock (range 00 to 23). - * - * @b %%k : The hour (24-hour clock) as a decimal number (range 0 to 23). single - * digits are preceded by a blank. - * - * @b %%l : The hour (12-hour clock) as a decimal number (range 1 to 12); single - * digits are preceded by a blank. - * - * @b %%M : The minute as a decimal number (range 00 to 59). - * - * @b %%p : Either 'AM' or 'PM' according to the given time value, or the - * corresponding strings for the current locale. Noon is treated as 'PM' - * and midnight as 'AM'. - * - * @b %%P : Like %p but in lower case: 'am' or 'pm' or a corresponding string for - * the current locale. - * - * @b %%c : The preferred date and time representation for the current locale. - * - * @b %%x : The preferred date representation for the current locale without the time. - * - * @b %%X : The preferred time representation for the current locale without the date. - * - * @b %%r : The complete calendar time using the AM/PM format of the current locale. - * - * @b %%R : The hour and minute in decimal numbers using the format %H:%M. - * - * @b %%T : The time of day in decimal numbers using the format %H:%M:%S. - * - * @b %%D : The date using the format %%m/%%d/%%y. - * - * @b %%F : The date using the format %%Y-%%m-%%d. - * - * These specifiers can be arranged in any order and the widget will display the - * fields accordingly. - * - * Default format is taken as per the system locale settings. - * - * @param obj The datetime object - * @return The datetime format string. Example: "%b %d, %Y %I : %M %p" - * - * @see elm_datetime_format_set() - * @ingroup Datetime - */ - EAPI const char *elm_datetime_format_get(const Evas_Object *obj); - -/** - * Set the datetime format. Format is a combination of allowed Libc date format - * specifiers like: "%b %d, %Y %I : %M %p". - * - * Maximum allowed format length is 64 chars. - * - * Format can include separators for each individual datetime field except - * for AM/PM field. - * - * Each separator can be a maximum of 6 UTF-8 bytes. - * Space is also taken as a separator. - * - * Following are the allowed set of format specifiers for each datetime field. - * - * @b %%Y : The year as a decimal number including the century. - * - * @b %%y : The year as a decimal number without a century (range 00 to 99). - * - * @b %%m : The month as a decimal number (range 01 to 12). - * - * @b %%b : The abbreviated month name according to the current locale. - * - * @b %%B : The full month name according to the current locale. - * - * @b %%h : The abbreviated month name according to the current locale(same as %%b). - * - * @b %%d : The day of the month as a decimal number (range 01 to 31). - * - * @b %%e : The day of the month as a decimal number (range 1 to 31). single - * digits are preceded by a blank. - * - * @b %%I : The hour as a decimal number using a 12-hour clock (range 01 to 12). - * - * @b %%H : The hour as a decimal number using a 24-hour clock (range 00 to 23). - * - * @b %%k : The hour (24-hour clock) as a decimal number (range 0 to 23). single - * digits are preceded by a blank. - * - * @b %%l : The hour (12-hour clock) as a decimal number (range 1 to 12); single - * digits are preceded by a blank. - * - * @b %%M : The minute as a decimal number (range 00 to 59). - * - * @b %%p : Either 'AM' or 'PM' according to the given time value, or the - * corresponding strings for the current locale. Noon is treated as 'PM' - * and midnight as 'AM'. - * - * @b %%P : Like %p but in lower case: 'am' or 'pm' or a corresponding string for - * the current locale. - * - * @b %%c : The preferred date and time representation for the current locale. - * - * @b %%x : The preferred date representation for the current locale without the time. - * - * @b %%X : The preferred time representation for the current locale without the date. - * - * @b %%r : The complete calendar time using the AM/PM format of the current locale. - * - * @b %%R : The hour and minute in decimal numbers using the format %H:%M. - * - * @b %%T : The time of day in decimal numbers using the format %H:%M:%S. - * - * @b %%D : The date using the format %%m/%%d/%%y. - * - * @b %%F : The date using the format %%Y-%%m-%%d. - * - * These specifiers can be arranged in any order and the widget will display the - * fields accordingly. - * - * Default format is taken as per the system locale settings. - * - * @param obj The datetime object - * @param fmt The datetime format - * - * @see elm_datetime_format_get() - * @ingroup Datetime - */ -EAPI void elm_datetime_format_set(Evas_Object *obj, const char *fmt); - -/** - * @brief Get the upper boundary of a field. - * - * Year: years since 1900. Negative value represents year below 1900 (year - * value -30 represents 1870). Year default range is from 70 to 137. - * - * 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 is from 0 to 59. - * - * @param obj The datetime object - * @param maxtime Time structure containing the maximum time value. - * @return EINA_TRUE if maximum value is returned successfully. - * - * @see elm_datetime_value_max_set() - * @ingroup Datetime - */ -EAPI Eina_Bool elm_datetime_value_max_get(const Evas_Object *obj, struct tm *maxtime); - -/** - * @brief Set the upper boundary of a field. - * - * Year: years since 1900. Negative value represents year below 1900 (year - * value -30 represents 1870). Year default range is from 70 to 137. - * - * 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 is from 0 to 59. - * - * @param obj The datetime object - * @param maxtime Time structure containing the maximum time value. - * @return EINA_TRUE if maximum value is accepted. - * - * @see elm_datetime_value_max_get() - * @ingroup Datetime - */ -EAPI Eina_Bool elm_datetime_value_max_set(Evas_Object *obj, const struct tm *maxtime); - -/** - * @brief Get the lower boundary of a field. - * - * Year: years since 1900. Negative value represents year below 1900 (year - * value -30 represents 1870). Year default range is from 70 to 137. - * - * 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 is from 0 to 59. - * - * @param obj The datetime object - * @param mintime Time structure. - * @return EINA_TRUE if minimum value is successfully returned. - * - * @see elm_datetime_value_min_set() - * @ingroup Datepicker - */ -EAPI Eina_Bool elm_datetime_value_min_get(const Evas_Object *obj, struct tm *mintime); - -/** - * @brief Set the lower boundary of a field. - * - * Year: years since 1900. Negative value represents year below 1900 (year - * value -30 represents 1870). Year default range is from 70 to 137. - * - * 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 is from 0 to 59. - * - * @param obj The datetime object. - * @param mintime Time structure containing the minimum time value. - * @return EINA_TRUE if minimum value is accepted. - * - * @see elm_datetime_value_min_get() - * @ingroup Datetime - */ -EAPI Eina_Bool elm_datetime_value_min_set(Evas_Object *obj, const struct tm *mintime); - -/** - * @brief Get the field limits of a field. - * - * Limits can be set to individual fields, independently, except for AM/PM field. - * Any field can display the values only in between these Minimum and Maximum limits unless - * the corresponding time value is restricted from MinTime to MaxTime. - * That is, Min/ Max field limits always works under the limitations of MinTime/ MaxTime. - * - * There is no provision to set the limits of AM/PM field. - * - * @param obj The datetime object - * @param fieldtype Type of the field. ELM_DATETIME_YEAR etc. - * @param min Reference to field's minimum value - * @param max Reference to field's maximum value - * - * @see elm_datetime_field_limit_set() - * @ingroup Datetime - */ -EAPI void elm_datetime_field_limit_get(const Evas_Object *obj, Elm_Datetime_Field_Type fieldtype, int *min, int *max); - -/** - * @brief Set the field limits of a field. - * - * Limits can be set to individual fields, independently, except for AM/PM field. - * Any field can display the values only in between these Minimum and Maximum limits unless - * the corresponding time value is restricted from MinTime to MaxTime. - * That is, Min/ Max field limits always works under the limitations of MinTime/ MaxTime. - * - * There is no provision to set the limits of AM/PM field. - * - * @param obj The datetime object - * @param fieldtype Type of the field. ELM_DATETIME_YEAR etc. - * @param min Reference to field's minimum value - * @param max Reference to field's maximum value - * - * @see elm_datetime_field_limit_set() - * @ingroup Datetime - */ -EAPI void elm_datetime_field_limit_set(Evas_Object *obj, Elm_Datetime_Field_Type fieldtype, int min, int max); - -/** - * @brief Get the current value of a field. - * - * Year: years since 1900. Negative value represents year below 1900 (year - * value -30 represents 1870). Year default range is from 70 to 137. - * - * 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 is from 0 to 59. - * - * @param obj The datetime object. - * @param currtime Time structure. - * @return EINA_TRUE if current time is returned successfully. - * - * @see elm_datetime_field_value_set() - * @ingroup Datetime - */ -EAPI Eina_Bool elm_datetime_value_get(const Evas_Object *obj, struct tm *currtime); - -/** - * @brief Set the current value of a Datetime object. - * - * Year: years since 1900. Negative value represents year below 1900 (year - * value -30 represents 1870). Year default range is from 70 to 137. - * - * 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 is from 0 to 59. - * - * - * @param obj The datetime object. - * @param newtime Time structure filled with values to be set. - * @return EINA_TRUE if current time is set successfully. - * - * @see elm_datetime_value_set() - * @ingroup Datetime - */ -EAPI Eina_Bool elm_datetime_value_set(Evas_Object *obj, const struct tm *newtime); - -/** - * @brief Get whether a field can be visible/not - * - * @param obj The datetime object - * @param fieldtype Type of the field. ELM_DATETIME_YEAR etc - * @return bool @c EINA_TRUE, if field can be visible. @c EINA_FALSE otherwise. - * - * @see elm_datetime_field_visible_set() - * @ingroup Datetime - */ -EAPI Eina_Bool elm_datetime_field_visible_get(const Evas_Object *obj, Elm_Datetime_Field_Type fieldtype); - -/** - * @brief Set a field to be visible or not. - * Setting this API True does not ensure that the field is visible, apart from - * this, the field's format must be present in Datetime overall format. - * If a field's visibility is set to False then it won't appear even though - * its format is present in overall format. - * So if and only if this API is set true and the corresponding field's format - * is present in Datetime format, the field is visible. - * - * By default the field visibility is set to True. - * - * @param obj The datetime object - * @param fieldtype Type of the field. ELM_DATETIME_YEAR etc. - * @param visible @c EINA_TRUE field can be visible, @c EINA_FALSE otherwise. - * - * @see elm_datetime_field_visible_get() - * @ingroup Datetime - */ -EAPI void elm_datetime_field_visible_set(Evas_Object *obj, Elm_Datetime_Field_Type fieldtype, Eina_Bool visible); - +#include "elm_datetime_common.h" +#ifdef EFL_EO_API_SUPPORT +#include "elm_datetime_eo.h" +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include "elm_datetime_legacy.h" +#endif /** * @} */ diff --git a/legacy/elementary/src/lib/elm_datetime_common.h b/legacy/elementary/src/lib/elm_datetime_common.h new file mode 100644 index 0000000000..7dfd7eeb81 --- /dev/null +++ b/legacy/elementary/src/lib/elm_datetime_common.h @@ -0,0 +1,15 @@ +/** + * Identifies a Datetime field, The widget supports 6 fields : Year, month, + * Date, Hour, Minute, AM/PM + * + */ +typedef enum _Elm_Datetime_Field_Type +{ + ELM_DATETIME_YEAR = 0, /**< Indicates Year field */ + ELM_DATETIME_MONTH = 1, /**< Indicates Month field */ + ELM_DATETIME_DATE = 2, /**< Indicates Date field */ + ELM_DATETIME_HOUR = 3, /**< Indicates Hour field */ + ELM_DATETIME_MINUTE = 4, /**< Indicates Minute field */ + ELM_DATETIME_AMPM = 5, /**< Indicates AM/PM field */ +} Elm_Datetime_Field_Type; + diff --git a/legacy/elementary/src/lib/elm_datetime_eo.h b/legacy/elementary/src/lib/elm_datetime_eo.h new file mode 100644 index 0000000000..93168b4371 --- /dev/null +++ b/legacy/elementary/src/lib/elm_datetime_eo.h @@ -0,0 +1,205 @@ +#define ELM_OBJ_DATETIME_CLASS elm_obj_datetime_class_get() + +const Eo_Class *elm_obj_datetime_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_DATETIME_BASE_ID; + +enum +{ + ELM_OBJ_DATETIME_SUB_ID_FORMAT_GET, + ELM_OBJ_DATETIME_SUB_ID_FORMAT_SET, + ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_GET, + ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_SET, + ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_GET, + ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_SET, + ELM_OBJ_DATETIME_SUB_ID_VALUE_GET, + ELM_OBJ_DATETIME_SUB_ID_VALUE_SET, + ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_GET, + ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_SET, + ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_GET, + ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_SET, + ELM_OBJ_DATETIME_SUB_ID_LAST +}; + +#define ELM_OBJ_DATETIME_ID(sub_id) (ELM_OBJ_DATETIME_BASE_ID + sub_id) + + +/** + * @def elm_obj_datetime_format_get + * @since 1.8 + * + * Get the datetime format. + * + * @param[out] ret + * + * @see elm_datetime_format_get + * + * @ingroup Datetime + */ +#define elm_obj_datetime_format_get(ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FORMAT_GET), EO_TYPECHECK(const char **, ret) + +/** + * @def elm_obj_datetime_format_set + * @since 1.8 + * + * Set the datetime format. + * + * @param[in] fmt + * + * @see elm_datetime_format_set + * + * @ingroup Datetime + */ +#define elm_obj_datetime_format_set(fmt) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FORMAT_SET), EO_TYPECHECK(const char *, fmt) + +/** + * @def elm_obj_datetime_field_visible_get + * @since 1.8 + * + * @brief Get whether a field can be visible/not + * + * @param[in] fieldtype + * @param[out] ret + * + * @see elm_datetime_field_visible_get + * + * @ingroup Datetime + */ +#define elm_obj_datetime_field_visible_get(fieldtype, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_GET), EO_TYPECHECK(Elm_Datetime_Field_Type, fieldtype), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_datetime_field_visible_set + * @since 1.8 + * + * @brief Set a field to be visible or not. + * + * @param[in] fieldtype + * @param[in] visible + * + * @see elm_datetime_field_visible_set + * + * @ingroup Datetime + */ +#define elm_obj_datetime_field_visible_set(fieldtype, visible) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_SET), EO_TYPECHECK(Elm_Datetime_Field_Type, fieldtype), EO_TYPECHECK(Eina_Bool, visible) + +/** + * @def elm_obj_datetime_field_limit_get + * @since 1.8 + * + * @brief Get the field limits of a field. + * + * @param[in] fieldtype + * @param[out] min + * @param[out] max + * + * @see elm_datetime_field_limit_get + * + * @ingroup Datetime + */ +#define elm_obj_datetime_field_limit_get(fieldtype, min, max) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_GET), EO_TYPECHECK(Elm_Datetime_Field_Type, fieldtype), EO_TYPECHECK(int *, min), EO_TYPECHECK(int *, max) + +/** + * @def elm_obj_datetime_field_limit_set + * @since 1.8 + * + * @brief Set the field limits of a field. + * + * @param[in] fieldtype + * @param[in] min + * @param[in] max + * + * @see elm_datetime_field_limit_set + * + * @ingroup Datetime + */ +#define elm_obj_datetime_field_limit_set(fieldtype, min, max) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_SET), EO_TYPECHECK(Elm_Datetime_Field_Type, fieldtype), EO_TYPECHECK(int, min), EO_TYPECHECK(int, max) + +/** + * @def elm_obj_datetime_value_get + * @since 1.8 + * + * @brief Get the current value of a field. + * + * @param[out] currtime + * @param[out] ret + * + * @see elm_datetime_value_get + * + * @ingroup Datetime + */ +#define elm_obj_datetime_value_get(currtime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_GET), EO_TYPECHECK(struct tm *, currtime), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_datetime_value_set + * @since 1.8 + * + * @brief Set the current value of a Datetime object. + * + * @param[in] newtime + * @param[out] ret + * + * @see elm_datetime_value_set + * + * @ingroup Datetime + */ +#define elm_obj_datetime_value_set(newtime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_SET), EO_TYPECHECK(const struct tm *, newtime), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_datetime_value_min_get + * @since 1.8 + * + * @brief Get the lower boundary of a field. + * + * @param[out] mintime + * @param[out] ret + * + * @see elm_datetime_value_min_get + * + * @ingroup Datetime + */ +#define elm_obj_datetime_value_min_get(mintime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_GET), EO_TYPECHECK(struct tm *, mintime), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_datetime_value_min_set + * @since 1.8 + * + * @brief Set the lower boundary of a field. + * + * @param[in] mintime + * @param[out] ret + * + * @see elm_datetime_value_min_set + * + * @ingroup Datetime + */ +#define elm_obj_datetime_value_min_set(mintime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_SET), EO_TYPECHECK(const struct tm *, mintime), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_datetime_value_max_get + * @since 1.8 + * + * @brief Get the upper boundary of a field. + * + * @param[out] maxtime + * @param[out] ret + * + * @see elm_datetime_value_max_get + * + * @ingroup Datetime + */ +#define elm_obj_datetime_value_max_get(maxtime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_GET), EO_TYPECHECK(struct tm *, maxtime), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_datetime_value_max_set + * @since 1.8 + * + * @brief Set the upper boundary of a field. + * + * @param[in] maxtime + * @param[out] ret + * + * @see elm_datetime_value_max_set + * + * @ingroup Datetime + */ +#define elm_obj_datetime_value_max_set(maxtime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_SET), EO_TYPECHECK(const struct tm *, maxtime), EO_TYPECHECK(Eina_Bool *, ret) diff --git a/legacy/elementary/src/lib/elm_datetime_legacy.h b/legacy/elementary/src/lib/elm_datetime_legacy.h new file mode 100644 index 0000000000..70f39f2a83 --- /dev/null +++ b/legacy/elementary/src/lib/elm_datetime_legacy.h @@ -0,0 +1,382 @@ +/** + * @brief Adds a new datetime Widget + * + * The default datetime format and corresponding strings are based on current locale. + * + * @param parent The parent object + * @return The new object or NULL if it cannot be created + * + * This function inserts a new datetime widget on the canvas. + * + * @ingroup Datetime + */ +EAPI Evas_Object *elm_datetime_add(Evas_Object *parent); + +/** + * Get the datetime format. Format is a combination of allowed Libc date format + * specifiers like: "%b %d, %Y %I : %M %p". + * + * Maximum allowed format length is 64 chars. + * + * Format can include separators for each individual datetime field except + * for AM/PM field. + * + * Each separator can be a maximum of 6 UTF-8 bytes. + * Space is also taken as a separator. + * + * Following are the allowed set of format specifiers for each datetime field. + * + * @b %%Y : The year as a decimal number including the century. + * + * @b %%y : The year as a decimal number without a century (range 00 to 99). + * + * @b %%m : The month as a decimal number (range 01 to 12). + * + * @b %%b : The abbreviated month name according to the current locale. + * + * @b %%B : The full month name according to the current locale. + * + * @b %%h : The abbreviated month name according to the current locale(same as %%b). + * + * @b %%d : The day of the month as a decimal number (range 01 to 31). + * + * @b %%e : The day of the month as a decimal number (range 1 to 31). single + * digits are preceded by a blank. + * + * @b %%I : The hour as a decimal number using a 12-hour clock (range 01 to 12). + * + * @b %%H : The hour as a decimal number using a 24-hour clock (range 00 to 23). + * + * @b %%k : The hour (24-hour clock) as a decimal number (range 0 to 23). single + * digits are preceded by a blank. + * + * @b %%l : The hour (12-hour clock) as a decimal number (range 1 to 12); single + * digits are preceded by a blank. + * + * @b %%M : The minute as a decimal number (range 00 to 59). + * + * @b %%p : Either 'AM' or 'PM' according to the given time value, or the + * corresponding strings for the current locale. Noon is treated as 'PM' + * and midnight as 'AM'. + * + * @b %%P : Like %p but in lower case: 'am' or 'pm' or a corresponding string for + * the current locale. + * + * @b %%c : The preferred date and time representation for the current locale. + * + * @b %%x : The preferred date representation for the current locale without the time. + * + * @b %%X : The preferred time representation for the current locale without the date. + * + * @b %%r : The complete calendar time using the AM/PM format of the current locale. + * + * @b %%R : The hour and minute in decimal numbers using the format %H:%M. + * + * @b %%T : The time of day in decimal numbers using the format %H:%M:%S. + * + * @b %%D : The date using the format %%m/%%d/%%y. + * + * @b %%F : The date using the format %%Y-%%m-%%d. + * + * These specifiers can be arranged in any order and the widget will display the + * fields accordingly. + * + * Default format is taken as per the system locale settings. + * + * @param obj The datetime object + * @return The datetime format string. Example: "%b %d, %Y %I : %M %p" + * + * @see elm_datetime_format_set() + * @ingroup Datetime + */ + EAPI const char *elm_datetime_format_get(const Evas_Object *obj); + +/** + * Set the datetime format. Format is a combination of allowed Libc date format + * specifiers like: "%b %d, %Y %I : %M %p". + * + * Maximum allowed format length is 64 chars. + * + * Format can include separators for each individual datetime field except + * for AM/PM field. + * + * Each separator can be a maximum of 6 UTF-8 bytes. + * Space is also taken as a separator. + * + * Following are the allowed set of format specifiers for each datetime field. + * + * @b %%Y : The year as a decimal number including the century. + * + * @b %%y : The year as a decimal number without a century (range 00 to 99). + * + * @b %%m : The month as a decimal number (range 01 to 12). + * + * @b %%b : The abbreviated month name according to the current locale. + * + * @b %%B : The full month name according to the current locale. + * + * @b %%h : The abbreviated month name according to the current locale(same as %%b). + * + * @b %%d : The day of the month as a decimal number (range 01 to 31). + * + * @b %%e : The day of the month as a decimal number (range 1 to 31). single + * digits are preceded by a blank. + * + * @b %%I : The hour as a decimal number using a 12-hour clock (range 01 to 12). + * + * @b %%H : The hour as a decimal number using a 24-hour clock (range 00 to 23). + * + * @b %%k : The hour (24-hour clock) as a decimal number (range 0 to 23). single + * digits are preceded by a blank. + * + * @b %%l : The hour (12-hour clock) as a decimal number (range 1 to 12); single + * digits are preceded by a blank. + * + * @b %%M : The minute as a decimal number (range 00 to 59). + * + * @b %%p : Either 'AM' or 'PM' according to the given time value, or the + * corresponding strings for the current locale. Noon is treated as 'PM' + * and midnight as 'AM'. + * + * @b %%P : Like %p but in lower case: 'am' or 'pm' or a corresponding string for + * the current locale. + * + * @b %%c : The preferred date and time representation for the current locale. + * + * @b %%x : The preferred date representation for the current locale without the time. + * + * @b %%X : The preferred time representation for the current locale without the date. + * + * @b %%r : The complete calendar time using the AM/PM format of the current locale. + * + * @b %%R : The hour and minute in decimal numbers using the format %H:%M. + * + * @b %%T : The time of day in decimal numbers using the format %H:%M:%S. + * + * @b %%D : The date using the format %%m/%%d/%%y. + * + * @b %%F : The date using the format %%Y-%%m-%%d. + * + * These specifiers can be arranged in any order and the widget will display the + * fields accordingly. + * + * Default format is taken as per the system locale settings. + * + * @param obj The datetime object + * @param fmt The datetime format + * + * @see elm_datetime_format_get() + * @ingroup Datetime + */ +EAPI void elm_datetime_format_set(Evas_Object *obj, const char *fmt); + +/** + * @brief Get whether a field can be visible/not + * + * @param obj The datetime object + * @param fieldtype Type of the field. ELM_DATETIME_YEAR etc + * @return bool @c EINA_TRUE, if field can be visible. @c EINA_FALSE otherwise. + * + * @see elm_datetime_field_visible_set() + * @ingroup Datetime + */ +EAPI Eina_Bool elm_datetime_field_visible_get(const Evas_Object *obj, Elm_Datetime_Field_Type fieldtype); + +/** + * @brief Set a field to be visible or not. + * Setting this API True does not ensure that the field is visible, apart from + * this, the field's format must be present in Datetime overall format. + * If a field's visibility is set to False then it won't appear even though + * its format is present in overall format. + * So if and only if this API is set true and the corresponding field's format + * is present in Datetime format, the field is visible. + * + * By default the field visibility is set to True. + * + * @param obj The datetime object + * @param fieldtype Type of the field. ELM_DATETIME_YEAR etc. + * @param visible @c EINA_TRUE field can be visible, @c EINA_FALSE otherwise. + * + * @see elm_datetime_field_visible_get() + * @ingroup Datetime + */ +EAPI void elm_datetime_field_visible_set(Evas_Object *obj, Elm_Datetime_Field_Type fieldtype, Eina_Bool visible); + +/** + * @brief Get the field limits of a field. + * + * Limits can be set to individual fields, independently, except for AM/PM field. + * Any field can display the values only in between these Minimum and Maximum limits unless + * the corresponding time value is restricted from MinTime to MaxTime. + * That is, Min/ Max field limits always works under the limitations of MinTime/ MaxTime. + * + * There is no provision to set the limits of AM/PM field. + * + * @param obj The datetime object + * @param fieldtype Type of the field. ELM_DATETIME_YEAR etc. + * @param min Reference to field's minimum value + * @param max Reference to field's maximum value + * + * @see elm_datetime_field_limit_set() + * @ingroup Datetime + */ +EAPI void elm_datetime_field_limit_get(const Evas_Object *obj, Elm_Datetime_Field_Type fieldtype, int *min, int *max); + +/** + * @brief Set the field limits of a field. + * + * Limits can be set to individual fields, independently, except for AM/PM field. + * Any field can display the values only in between these Minimum and Maximum limits unless + * the corresponding time value is restricted from MinTime to MaxTime. + * That is, Min/ Max field limits always works under the limitations of MinTime/ MaxTime. + * + * There is no provision to set the limits of AM/PM field. + * + * @param obj The datetime object + * @param fieldtype Type of the field. ELM_DATETIME_YEAR etc. + * @param min Reference to field's minimum value + * @param max Reference to field's maximum value + * + * @see elm_datetime_field_limit_set() + * @ingroup Datetime + */ +EAPI void elm_datetime_field_limit_set(Evas_Object *obj, Elm_Datetime_Field_Type fieldtype, int min, int max); + +/** + * @brief Get the current value of a field. + * + * Year: years since 1900. Negative value represents year below 1900 (year + * value -30 represents 1870). Year default range is from 70 to 137. + * + * 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 is from 0 to 59. + * + * @param obj The datetime object. + * @param currtime Time structure. + * @return EINA_TRUE if current time is returned successfully. + * + * @see elm_datetime_field_value_set() + * @ingroup Datetime + */ +EAPI Eina_Bool elm_datetime_value_get(const Evas_Object *obj, struct tm *currtime); + +/** + * @brief Set the current value of a Datetime object. + * + * Year: years since 1900. Negative value represents year below 1900 (year + * value -30 represents 1870). Year default range is from 70 to 137. + * + * 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 is from 0 to 59. + * + * + * @param obj The datetime object. + * @param newtime Time structure filled with values to be set. + * @return EINA_TRUE if current time is set successfully. + * + * @see elm_datetime_value_set() + * @ingroup Datetime + */ +EAPI Eina_Bool elm_datetime_value_set(Evas_Object *obj, const struct tm *newtime); + +/** + * @brief Get the lower boundary of a field. + * + * Year: years since 1900. Negative value represents year below 1900 (year + * value -30 represents 1870). Year default range is from 70 to 137. + * + * 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 is from 0 to 59. + * + * @param obj The datetime object + * @param mintime Time structure. + * @return EINA_TRUE if minimum value is successfully returned. + * + * @see elm_datetime_value_min_set() + * @ingroup Datepicker + */ +EAPI Eina_Bool elm_datetime_value_min_get(const Evas_Object *obj, struct tm *mintime); + +/** + * @brief Set the lower boundary of a field. + * + * Year: years since 1900. Negative value represents year below 1900 (year + * value -30 represents 1870). Year default range is from 70 to 137. + * + * 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 is from 0 to 59. + * + * @param obj The datetime object. + * @param mintime Time structure containing the minimum time value. + * @return EINA_TRUE if minimum value is accepted. + * + * @see elm_datetime_value_min_get() + * @ingroup Datetime + */ +EAPI Eina_Bool elm_datetime_value_min_set(Evas_Object *obj, const struct tm *mintime); + +/** + * @brief Get the upper boundary of a field. + * + * Year: years since 1900. Negative value represents year below 1900 (year + * value -30 represents 1870). Year default range is from 70 to 137. + * + * 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 is from 0 to 59. + * + * @param obj The datetime object + * @param maxtime Time structure containing the maximum time value. + * @return EINA_TRUE if maximum value is returned successfully. + * + * @see elm_datetime_value_max_set() + * @ingroup Datetime + */ +EAPI Eina_Bool elm_datetime_value_max_get(const Evas_Object *obj, struct tm *maxtime); + +/** + * @brief Set the upper boundary of a field. + * + * Year: years since 1900. Negative value represents year below 1900 (year + * value -30 represents 1870). Year default range is from 70 to 137. + * + * 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 is from 0 to 59. + * + * @param obj The datetime object + * @param maxtime Time structure containing the maximum time value. + * @return EINA_TRUE if maximum value is accepted. + * + * @see elm_datetime_value_max_get() + * @ingroup Datetime + */ +EAPI Eina_Bool elm_datetime_value_max_set(Evas_Object *obj, const struct tm *maxtime); diff --git a/legacy/elementary/src/lib/elm_dayselector.h b/legacy/elementary/src/lib/elm_dayselector.h index 3cd6f63c0d..9000997d1f 100644 --- a/legacy/elementary/src/lib/elm_dayselector.h +++ b/legacy/elementary/src/lib/elm_dayselector.h @@ -75,260 +75,13 @@ * @{ */ -#define ELM_OBJ_DAYSELECTOR_CLASS elm_obj_dayselector_class_get() - -const Eo_Class *elm_obj_dayselector_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_DAYSELECTOR_BASE_ID; - -enum -{ - ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_SET, - ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_GET, - ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_SET, - ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_GET, - ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_SET, - ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_GET, - ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_SET, - ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_GET, - ELM_OBJ_DAYSELECTOR_SUB_ID_LAST -}; - -#define ELM_OBJ_DAYSELECTOR_ID(sub_id) (ELM_OBJ_DAYSELECTOR_BASE_ID + sub_id) - - -/** - * @def elm_obj_dayselector_day_selected_set - * @since 1.8 - * - * Set the state of given Dayselector_Day. - * - * @param[in] day - * @param[in] selected - * - * @see elm_dayselector_day_selected_set - */ -#define elm_obj_dayselector_day_selected_set(day, selected) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_SET), EO_TYPECHECK(Elm_Dayselector_Day, day), EO_TYPECHECK(Eina_Bool, selected) - -/** - * @def elm_obj_dayselector_day_selected_get - * @since 1.8 - * - * Get the state of given Dayselector_Day. - * - * @param[in] day - * @param[out] ret - * - * @see elm_dayselector_day_selected_get - */ -#define elm_obj_dayselector_day_selected_get(day, ret) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_GET), EO_TYPECHECK(Elm_Dayselector_Day, day), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_dayselector_week_start_set - * @since 1.8 - * - * Set the starting day of Dayselector. - * - * @param[in] day - * - * @see elm_dayselector_week_start_set - */ -#define elm_obj_dayselector_week_start_set(day) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_SET), EO_TYPECHECK(Elm_Dayselector_Day, day) - -/** - * @def elm_obj_dayselector_week_start_get - * @since 1.8 - * - * Get the starting day of Dayselector. - * - * @param[out] ret - * - * @see elm_dayselector_week_start_get - */ -#define elm_obj_dayselector_week_start_get(ret) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_GET), EO_TYPECHECK(Elm_Dayselector_Day *, ret) - -/** - * @def elm_obj_dayselector_weekend_start_set - * @since 1.8 - * - * Set the weekend starting day of Dayselector. - * - * @param[in] day - * - * @see elm_dayselector_weekend_start_set - */ -#define elm_obj_dayselector_weekend_start_set(day) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_SET), EO_TYPECHECK(Elm_Dayselector_Day, day) - -/** - * @def elm_obj_dayselector_weekend_start_get - * @since 1.8 - * - * Get the weekend starting day of Dayselector. - * - * @param[out] ret - * - * @see elm_dayselector_weekend_start_get - */ -#define elm_obj_dayselector_weekend_start_get(ret) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_GET), EO_TYPECHECK(Elm_Dayselector_Day *, ret) - -/** - * @def elm_obj_dayselector_weekend_length_set - * @since 1.8 - * - * Set the weekend length of Dayselector. - * - * @param[in] length - * - * @see elm_dayselector_weekend_length_set - */ -#define elm_obj_dayselector_weekend_length_set(length) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_SET), EO_TYPECHECK(unsigned int, length) - -/** - * @def elm_obj_dayselector_weekend_length_get - * @since 1.8 - * - * Get the weekend length of Dayselector. - * - * @param[out] ret - * - * @see elm_dayselector_weekend_length_get - */ -#define elm_obj_dayselector_weekend_length_get(ret) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_GET), EO_TYPECHECK(unsigned int *, ret) - -/** - * Identifies the day of the week. - * API can call the selection/unselection of day with this as a parameter. - * - * @see elm_dayselector_day_selected_set() - * @see elm_dayselector_day_selected_get() - */ -typedef enum -{ - ELM_DAYSELECTOR_SUN = 0,/**< indicates Sunday */ - ELM_DAYSELECTOR_MON, /**< indicates Monday */ - ELM_DAYSELECTOR_TUE, /**< indicates Tuesday */ - ELM_DAYSELECTOR_WED, /**< indicates Wednesday */ - ELM_DAYSELECTOR_THU, /**< indicates Thursday */ - ELM_DAYSELECTOR_FRI, /**< indicates Friday */ - ELM_DAYSELECTOR_SAT, /**< indicates Saturday */ - ELM_DAYSELECTOR_MAX /**< Sentinel value, @b don't use */ -} Elm_Dayselector_Day; - -/** - * Add the dayselector. - * - * @param parent Parent object - * @return New dayselector object or @c NULL, if it cannot be created - * - * @ingroup Dayselector - */ -EAPI Evas_Object *elm_dayselector_add(Evas_Object *parent); - -/** - * Set the state of given Dayselector_Day. - * - * @param obj Dayselector object - * @param day Dayselector_Day that the user want to set state. - * @param selected state of the day. @c EINA_TRUE is selected. - * - * @see Elm_Dayselector_Day - * @see elm_dayselector_day_selected_get() - * - * @ingroup Dayselector - */ -EAPI void elm_dayselector_day_selected_set(Evas_Object *obj, Elm_Dayselector_Day day, Eina_Bool selected); - -/** - * Get the state of given Dayselector_Day. - * - * @param obj Dayselector object - * @param day Dayselector_Day that the user want to know state. - * @return @c EINA_TRUE, if the Day is selected - * - * @see Elm_Dayselector_Day - * @see elm_dayselector_day_selected_set() - * - * @ingroup Dayselector - */ -EAPI Eina_Bool elm_dayselector_day_selected_get(const Evas_Object *obj, Elm_Dayselector_Day day); - -/** - * Set the starting day of Dayselector. - * - * @param obj Dayselector object - * @param day Dayselector_Day the first day that the user wants to display. - * - * @see Elm_Dayselector_Day - * @see elm_dayselector_week_start_get() - * - * @ingroup Dayselector - */ -EAPI void elm_dayselector_week_start_set(Evas_Object *obj, Elm_Dayselector_Day day); - -/** - * Get the starting day of Dayselector. - * - * @param obj Dayselector object - * @return Day from where Dayselector displays all the weekdays in order. - * - * @see Elm_Dayselector_Day - * @see elm_dayselector_week_start_set() - * - * @ingroup Dayselector - */ -EAPI Elm_Dayselector_Day elm_dayselector_week_start_get(const Evas_Object *obj); - -/** - * Set the weekend starting day of Dayselector. - * - * @param obj Dayselector object - * @param day Dayselector_Day the first day from where weekend starts. - * - * @see Elm_Dayselector_Day - * @see elm_dayselector_weekend_start_get() - * - * @ingroup Dayselector - */ -EAPI void elm_dayselector_weekend_start_set(Evas_Object *obj, Elm_Dayselector_Day day); - -/** - * Get the weekend starting day of Dayselector. - * - * @param obj Dayselector object - * @return Elm_Dayselector_Day Day from where weekend starts. - * - * @see Elm_Dayselector_Day - * @see elm_dayselector_weekend_start_set() - * - * @ingroup Dayselector - */ -EAPI Elm_Dayselector_Day elm_dayselector_weekend_start_get(const Evas_Object *obj); - -/** - * Set the weekend length of Dayselector. - * - * @param obj Dayselector object - * @param length Weekend length, number of days as an integer. - * - * @see elm_dayselector_weekend_length_get() - * - * @ingroup Dayselector - */ -EAPI void elm_dayselector_weekend_length_set(Evas_Object *obj, unsigned int length); - -/** - * Get the weekend length of Dayselector. - * - * @param obj Dayselector object - * @return Number of days marked as a weekend. - * - * @see Elm_Dayselector_Day - * @see elm_dayselector_weekend_length_set() - * - * @ingroup Dayselector - */ -EAPI unsigned int elm_dayselector_weekend_length_get(const Evas_Object *obj); - +#include "elm_dayselector_common.h" +#ifdef EFL_EO_API_SUPPORT +#include "elm_dayselector_eo.h" +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include "elm_dayselector_legacy.h" +#endif /** * @} */ diff --git a/legacy/elementary/src/lib/elm_dayselector_common.h b/legacy/elementary/src/lib/elm_dayselector_common.h new file mode 100644 index 0000000000..f68554b883 --- /dev/null +++ b/legacy/elementary/src/lib/elm_dayselector_common.h @@ -0,0 +1,19 @@ +/** + * Identifies the day of the week. + * API can call the selection/unselection of day with this as a parameter. + * + * @see elm_dayselector_day_selected_set() + * @see elm_dayselector_day_selected_get() + */ +typedef enum +{ + ELM_DAYSELECTOR_SUN = 0,/**< indicates Sunday */ + ELM_DAYSELECTOR_MON, /**< indicates Monday */ + ELM_DAYSELECTOR_TUE, /**< indicates Tuesday */ + ELM_DAYSELECTOR_WED, /**< indicates Wednesday */ + ELM_DAYSELECTOR_THU, /**< indicates Thursday */ + ELM_DAYSELECTOR_FRI, /**< indicates Friday */ + ELM_DAYSELECTOR_SAT, /**< indicates Saturday */ + ELM_DAYSELECTOR_MAX /**< Sentinel value, @b don't use */ +} Elm_Dayselector_Day; + diff --git a/legacy/elementary/src/lib/elm_dayselector_eo.h b/legacy/elementary/src/lib/elm_dayselector_eo.h new file mode 100644 index 0000000000..5165a1933a --- /dev/null +++ b/legacy/elementary/src/lib/elm_dayselector_eo.h @@ -0,0 +1,135 @@ +#define ELM_OBJ_DAYSELECTOR_CLASS elm_obj_dayselector_class_get() + +const Eo_Class *elm_obj_dayselector_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_DAYSELECTOR_BASE_ID; + +enum +{ + ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_SET, + ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_GET, + ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_SET, + ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_GET, + ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_SET, + ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_GET, + ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_SET, + ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_GET, + ELM_OBJ_DAYSELECTOR_SUB_ID_LAST +}; + +#define ELM_OBJ_DAYSELECTOR_ID(sub_id) (ELM_OBJ_DAYSELECTOR_BASE_ID + sub_id) + + +/** + * @def elm_obj_dayselector_day_selected_set + * @since 1.8 + * + * Set the state of given Dayselector_Day. + * + * @param[in] day + * @param[in] selected + * + * @see elm_dayselector_day_selected_set + * + * @ingroup Dayselector + */ +#define elm_obj_dayselector_day_selected_set(day, selected) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_SET), EO_TYPECHECK(Elm_Dayselector_Day, day), EO_TYPECHECK(Eina_Bool, selected) + +/** + * @def elm_obj_dayselector_day_selected_get + * @since 1.8 + * + * Get the state of given Dayselector_Day. + * + * @param[in] day + * @param[out] ret + * + * @see elm_dayselector_day_selected_get + * + * @ingroup Dayselector + */ +#define elm_obj_dayselector_day_selected_get(day, ret) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_GET), EO_TYPECHECK(Elm_Dayselector_Day, day), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_dayselector_week_start_set + * @since 1.8 + * + * Set the starting day of Dayselector. + * + * @param[in] day + * + * @see elm_dayselector_week_start_set + * + * @ingroup Dayselector + */ +#define elm_obj_dayselector_week_start_set(day) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_SET), EO_TYPECHECK(Elm_Dayselector_Day, day) + +/** + * @def elm_obj_dayselector_week_start_get + * @since 1.8 + * + * Get the starting day of Dayselector. + * + * @param[out] ret + * + * @see elm_dayselector_week_start_get + * + * @ingroup Dayselector + */ +#define elm_obj_dayselector_week_start_get(ret) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_GET), EO_TYPECHECK(Elm_Dayselector_Day *, ret) + +/** + * @def elm_obj_dayselector_weekend_start_set + * @since 1.8 + * + * Set the weekend starting day of Dayselector. + * + * @param[in] day + * + * @see elm_dayselector_weekend_start_set + * + * @ingroup Dayselector + */ +#define elm_obj_dayselector_weekend_start_set(day) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_SET), EO_TYPECHECK(Elm_Dayselector_Day, day) + +/** + * @def elm_obj_dayselector_weekend_start_get + * @since 1.8 + * + * Get the weekend starting day of Dayselector. + * + * @param[out] ret + * + * @see elm_dayselector_weekend_start_get + * + * @ingroup Dayselector + */ +#define elm_obj_dayselector_weekend_start_get(ret) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_GET), EO_TYPECHECK(Elm_Dayselector_Day *, ret) + +/** + * @def elm_obj_dayselector_weekend_length_set + * @since 1.8 + * + * Set the weekend length of Dayselector. + * + * @param[in] length + * + * @see elm_dayselector_weekend_length_set + * + * @ingroup Dayselector + */ +#define elm_obj_dayselector_weekend_length_set(length) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_SET), EO_TYPECHECK(unsigned int, length) + +/** + * @def elm_obj_dayselector_weekend_length_get + * @since 1.8 + * + * Get the weekend length of Dayselector. + * + * @param[out] ret + * + * @see elm_dayselector_weekend_length_get + * + * @ingroup Dayselector + */ +#define elm_obj_dayselector_weekend_length_get(ret) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_GET), EO_TYPECHECK(unsigned int *, ret) diff --git a/legacy/elementary/src/lib/elm_dayselector_legacy.h b/legacy/elementary/src/lib/elm_dayselector_legacy.h new file mode 100644 index 0000000000..b9b8fac635 --- /dev/null +++ b/legacy/elementary/src/lib/elm_dayselector_legacy.h @@ -0,0 +1,114 @@ +/** + * Add the dayselector. + * + * @param parent Parent object + * @return New dayselector object or @c NULL, if it cannot be created + * + * @ingroup Dayselector + */ +EAPI Evas_Object *elm_dayselector_add(Evas_Object *parent); + +/** + * Set the state of given Dayselector_Day. + * + * @param obj Dayselector object + * @param day Dayselector_Day that the user want to set state. + * @param selected state of the day. @c EINA_TRUE is selected. + * + * @see Elm_Dayselector_Day + * @see elm_dayselector_day_selected_get() + * + * @ingroup Dayselector + */ +EAPI void elm_dayselector_day_selected_set(Evas_Object *obj, Elm_Dayselector_Day day, Eina_Bool selected); + +/** + * Get the state of given Dayselector_Day. + * + * @param obj Dayselector object + * @param day Dayselector_Day that the user want to know state. + * @return @c EINA_TRUE, if the Day is selected + * + * @see Elm_Dayselector_Day + * @see elm_dayselector_day_selected_set() + * + * @ingroup Dayselector + */ +EAPI Eina_Bool elm_dayselector_day_selected_get(const Evas_Object *obj, Elm_Dayselector_Day day); + +/** + * Set the starting day of Dayselector. + * + * @param obj Dayselector object + * @param day Dayselector_Day the first day that the user wants to display. + * + * @see Elm_Dayselector_Day + * @see elm_dayselector_week_start_get() + * + * @ingroup Dayselector + */ +EAPI void elm_dayselector_week_start_set(Evas_Object *obj, Elm_Dayselector_Day day); + +/** + * Get the starting day of Dayselector. + * + * @param obj Dayselector object + * @return Day from where Dayselector displays all the weekdays in order. + * + * @see Elm_Dayselector_Day + * @see elm_dayselector_week_start_set() + * + * @ingroup Dayselector + */ +EAPI Elm_Dayselector_Day elm_dayselector_week_start_get(const Evas_Object *obj); + +/** + * Set the weekend starting day of Dayselector. + * + * @param obj Dayselector object + * @param day Dayselector_Day the first day from where weekend starts. + * + * @see Elm_Dayselector_Day + * @see elm_dayselector_weekend_start_get() + * + * @ingroup Dayselector + */ +EAPI void elm_dayselector_weekend_start_set(Evas_Object *obj, Elm_Dayselector_Day day); + +/** + * Get the weekend starting day of Dayselector. + * + * @param obj Dayselector object + * @return Elm_Dayselector_Day Day from where weekend starts. + * + * @see Elm_Dayselector_Day + * @see elm_dayselector_weekend_start_set() + * + * @ingroup Dayselector + */ +EAPI Elm_Dayselector_Day elm_dayselector_weekend_start_get(const Evas_Object *obj); + +/** + * Set the weekend length of Dayselector. + * + * @param obj Dayselector object + * @param length Weekend length, number of days as an integer. + * + * @see elm_dayselector_weekend_length_get() + * + * @ingroup Dayselector + */ +EAPI void elm_dayselector_weekend_length_set(Evas_Object *obj, unsigned int length); + +/** + * Get the weekend length of Dayselector. + * + * @param obj Dayselector object + * @return Number of days marked as a weekend. + * + * @see Elm_Dayselector_Day + * @see elm_dayselector_weekend_length_set() + * + * @ingroup Dayselector + */ +EAPI unsigned int elm_dayselector_weekend_length_get(const Evas_Object *obj); diff --git a/legacy/elementary/src/lib/elm_diskselector.h b/legacy/elementary/src/lib/elm_diskselector.h index 078f22d589..f4b0a1cb68 100644 --- a/legacy/elementary/src/lib/elm_diskselector.h +++ b/legacy/elementary/src/lib/elm_diskselector.h @@ -61,500 +61,13 @@ * @{ */ -#define ELM_OBJ_DISKSELECTOR_CLASS elm_obj_diskselector_class_get() - -const Eo_Class *elm_obj_diskselector_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_DISKSELECTOR_BASE_ID; - -enum -{ - ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_GET, - ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_SET, - ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_GET, - ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_SET, - ELM_OBJ_DISKSELECTOR_SUB_ID_CLEAR, - ELM_OBJ_DISKSELECTOR_SUB_ID_ITEMS_GET, - ELM_OBJ_DISKSELECTOR_SUB_ID_ITEM_APPEND, - ELM_OBJ_DISKSELECTOR_SUB_ID_SELECTED_ITEM_GET, - ELM_OBJ_DISKSELECTOR_SUB_ID_FIRST_ITEM_GET, - ELM_OBJ_DISKSELECTOR_SUB_ID_LAST_ITEM_GET, - ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_SET, - ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_GET, - ELM_OBJ_DISKSELECTOR_SUB_ID_LAST -}; - -#define ELM_OBJ_DISKSELECTOR_ID(sub_id) (ELM_OBJ_DISKSELECTOR_BASE_ID + sub_id) - - -/** - * @def elm_obj_diskselector_round_enabled_get - * @since 1.8 - * - * Get a value whether round mode is enabled or not. - * - * @param[out] ret - * - * @see elm_diskselector_round_enabled_get - */ -#define elm_obj_diskselector_round_enabled_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_diskselector_round_enabled_set - * @since 1.8 - * - * Enable or disable round mode. - * - * @param[in] enabled - * - * @see elm_diskselector_round_enabled_set - */ -#define elm_obj_diskselector_round_enabled_set(enabled) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled) - -/** - * @def elm_obj_diskselector_side_text_max_length_get - * @since 1.8 - * - * Get the side labels max length. - * - * @param[out] ret - * - * @see elm_diskselector_side_text_max_length_get - */ -#define elm_obj_diskselector_side_text_max_length_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_GET), EO_TYPECHECK(int *, ret) - -/** - * @def elm_obj_diskselector_side_text_max_length_set - * @since 1.8 - * - * Set the side labels max length. - * - * @param[in] len - * - * @see elm_diskselector_side_text_max_length_set - */ -#define elm_obj_diskselector_side_text_max_length_set(len) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_SET), EO_TYPECHECK(int, len) - -/** - * @def elm_obj_diskselector_clear - * @since 1.8 - * - * Remove all diskselector's items. - * - * - * @see elm_diskselector_clear - */ -#define elm_obj_diskselector_clear() ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_CLEAR) - -/** - * @def elm_obj_diskselector_items_get - * @since 1.8 - * - * Get a list of all the diskselector items. - * - * @param[out] ret - * - * @see elm_diskselector_items_get - */ -#define elm_obj_diskselector_items_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret) - -/** - * @def elm_obj_diskselector_item_append - * @since 1.8 - * - * Appends a new item to the diskselector object. - * - * @param[in] label - * @param[in] icon - * @param[in] func - * @param[in] data - * @param[out] ret - * - * @see elm_diskselector_item_append - */ -#define elm_obj_diskselector_item_append(label, icon, func, data, ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_diskselector_selected_item_get - * @since 1.8 - * - * Get the selected item. - * - * @param[out] ret - * - * @see elm_diskselector_selected_item_get - */ -#define elm_obj_diskselector_selected_item_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_diskselector_first_item_get - * @since 1.8 - * - * Get the first item of the diskselector. - * - * @param[out] ret - * - * @see elm_diskselector_first_item_get - */ -#define elm_obj_diskselector_first_item_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_diskselector_last_item_get - * @since 1.8 - * - * Get the last item of the diskselector. - * - * @param[out] ret - * - * @see elm_diskselector_last_item_get - */ -#define elm_obj_diskselector_last_item_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_diskselector_display_item_num_set - * @since 1.8 - * - * Set the number of items to be displayed. - * - * @param[in] num - * - * @see elm_diskselector_display_item_num_set - */ -#define elm_obj_diskselector_display_item_num_set(num) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_SET), EO_TYPECHECK(int, num) - -/** - * @def elm_obj_diskselector_display_item_num_get - * @since 1.8 - * - * Get the number of items in the diskselector object. - * - * @param[out] ret - * - * @see elm_diskselector_display_item_num_get - */ -#define elm_obj_diskselector_display_item_num_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_GET), EO_TYPECHECK(int *, ret) - -/** - * Add a new diskselector widget to the given parent Elementary - * (container) object. - * - * @param parent The parent object. - * @return a new diskselector widget handle or @c NULL, on errors. - * - * This function inserts a new diskselector widget on the canvas. - * - * @ingroup Diskselector - */ -EAPI Evas_Object *elm_diskselector_add(Evas_Object *parent); - -/** - * Enable or disable round mode. - * - * @param obj The diskselector object. - * @param enabled @c EINA_TRUE to enable round mode or @c EINA_FALSE to - * disable it. - * - * Disabled by default. If round mode is enabled the items list will - * work like a circular list, so when the user reaches the last item, - * the first one will popup. - * - * @see elm_diskselector_round_enabled_get() - * - * @ingroup Diskselector - */ -EAPI void elm_diskselector_round_enabled_set(Evas_Object *obj, Eina_Bool enabled); - -/** - * Get a value whether round mode is enabled or not. - * - * @see elm_diskselector_round_enabled_set() for details. - * - * @param obj The diskselector object. - * @return @c EINA_TRUE means round mode is enabled. @c EINA_FALSE indicates - * it's disabled. If @p obj is @c NULL, @c EINA_FALSE is returned. - * - * @ingroup Diskselector - */ -EAPI Eina_Bool elm_diskselector_round_enabled_get(const Evas_Object *obj); - -/** - * Get the side labels max length. - * - * @see elm_diskselector_side_text_max_length_set() for details. - * - * @param obj The diskselector object. - * @return The max length defined for side labels, or 0 if not a valid - * diskselector. - * - * @ingroup Diskselector - */ -EAPI int elm_diskselector_side_text_max_length_get(const Evas_Object *obj); - -/** - * Set the side labels max length. - * - * @param obj The diskselector object. - * @param len The max length defined for side labels. - * - * Length is the number of characters of items' label that will be - * visible when it's set on side positions. It will just crop - * the string after defined size. E.g.: - * - * An item with label "January" would be displayed on side position as - * "Jan" if max length is set to 3, or "Janu", if this property - * is set to 4. - * - * When it's selected, the entire label will be displayed, except for - * width restrictions. In this case label will be cropped and "..." - * will be concatenated. - * - * Default side label max length is 3. - * - * This property will be applied over all items, included before or - * later this function call. - * - * @ingroup Diskselector - */ -EAPI void elm_diskselector_side_text_max_length_set(Evas_Object *obj, int len); - -/** - * Set the number of items to be displayed. - * - * @param obj The diskselector object. - * @param num The number of items the diskselector will display. - * - * Default value is 3, and also it's the minimum. If @p num is less - * than 3, it will be set to 3. - * - * Also, it can be set on theme, using data item @c display_item_num - * on group "elm/diskselector/item/X", where X is style set. - * E.g.: - * - * group { name: "elm/diskselector/item/X"; - * data { - * item: "display_item_num" "5"; - * } - * - * @ingroup Diskselector - */ -EAPI void elm_diskselector_display_item_num_set(Evas_Object *obj, int num); - -/** - * Get the number of items in the diskselector object. - * - * @param obj The diskselector object. - * - * @ingroup Diskselector - */ -EAPI int elm_diskselector_display_item_num_get(const Evas_Object *obj); - -/** - * Remove all diskselector's items. - * - * @param obj The diskselector object. - * - * @see elm_object_item_del() - * @see elm_diskselector_item_append() - * - * @ingroup Diskselector - */ -EAPI void elm_diskselector_clear(Evas_Object *obj); - -/** - * Get a list of all the diskselector items. - * - * @param obj The diskselector object. - * @return An @c Eina_List of diskselector items, #Elm_Object_Item, - * or @c NULL on failure. - * - * @see elm_diskselector_item_append() - * @see elm_object_item_del() - * @see elm_diskselector_clear() - * - * @ingroup Diskselector - */ -EAPI const Eina_List *elm_diskselector_items_get(const Evas_Object *obj); - -/** - * Appends a new item to the diskselector object. - * - * @param obj The diskselector object. - * @param label The label of the diskselector item. - * @param icon The icon object to use at left side of the item. An - * icon can be any Evas object, but usually it is an icon created - * with elm_icon_add(). - * @param func The function to call when the item is selected. - * @param data The data to associate with the item for related callbacks. - * - * @return The created item or @c NULL upon failure. - * - * A new item will be created and appended to the diskselector, i.e., will - * be set as last item. Also, if there is no selected item, it will - * be selected. This will always happens for the first appended item. - * - * If no icon is set, label will be centered on item position, otherwise - * the icon will be placed at left of the label, that will be shifted - * to the right. - * - * Items created with this method can be deleted with - * elm_object_item_del(). - * - * Associated @p data can be properly freed when item is deleted if a - * callback function is set with elm_object_item_del_cb_set(). - * - * If a function is passed as argument, it will be called every time this item - * is selected, i.e., the user stops the diskselector with this - * item on center position. If such function isn't needed, just passing - * @c NULL as @p func is enough. The same should be done for @p data. - * - * Simple example (with no function callback or data associated): - * @code - * disk = elm_diskselector_add(win); - * ic = elm_icon_add(win); - * elm_image_file_set(ic, "path/to/image", NULL); - * elm_icon_resizable_set(ic, EINA_TRUE, EINA_TRUE); - * elm_diskselector_item_append(disk, "label", ic, NULL, NULL); - * @endcode - * - * @see elm_object_item_del() - * @see elm_diskselector_clear() - * @see elm_icon_add() - * - * @ingroup Diskselector - */ -EAPI Elm_Object_Item *elm_diskselector_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data); - -/** - * Get the selected item. - * - * @param obj The diskselector object. - * @return The selected diskselector item. - * - * The selected item can be unselected with function - * elm_diskselector_item_selected_set(), and the first item of - * diskselector will be selected. - * - * The selected item always will be centered on diskselector, with - * full label displayed, i.e., max length set to side labels won't - * apply on the selected item. More details on - * elm_diskselector_side_text_max_length_set(). - * - * @ingroup Diskselector - */ -EAPI Elm_Object_Item *elm_diskselector_selected_item_get(const Evas_Object *obj); - -/** - * Set the selected state of an item. - * - * @param it The diskselector item - * @param selected The selected state - * - * This sets the selected state of the given item @p it. - * @c EINA_TRUE for selected, @c EINA_FALSE for not selected. - * - * If a new item is selected the previously selected will be unselected. - * Previously selected item can be get with function - * elm_diskselector_selected_item_get(). - * - * If the item @p it is unselected, the first item of diskselector will - * be selected. - * - * Selected items will be visible on center position of diskselector. - * So if it was on another position before selected, or was invisible, - * diskselector will animate items until the selected item reaches center - * position. - * - * @see elm_diskselector_item_selected_get() - * @see elm_diskselector_selected_item_get() - * - * @ingroup Diskselector - */ -EAPI void elm_diskselector_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); - -/* - * Get whether the @p item is selected or not. - * - * @param it The diskselector item. - * @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates - * it's not. If @p obj is @c NULL, @c EINA_FALSE is returned. - * - * @see elm_diskselector_selected_item_set() for details. - * @see elm_diskselector_item_selected_get() - * - * @ingroup Diskselector - */ -EAPI Eina_Bool elm_diskselector_item_selected_get(const Elm_Object_Item *it); - -/** - * Get the first item of the diskselector. - * - * @param obj The diskselector object. - * @return The first item, or @c NULL if none. - * - * The list of items follows append order. So it will return the first - * item appended to the widget that wasn't deleted. - * - * @see elm_diskselector_item_append() - * @see elm_diskselector_items_get() - * - * @ingroup Diskselector - */ -EAPI Elm_Object_Item *elm_diskselector_first_item_get(const Evas_Object *obj); - -/** - * Get the last item of the diskselector. - * - * @param obj The diskselector object. - * @return The last item, or @c NULL if none. - * - * The list of items follows append order. So it will return last first - * item appended to the widget that wasn't deleted. - * - * @see elm_diskselector_item_append() - * @see elm_diskselector_items_get() - * - * @ingroup Diskselector - */ -EAPI Elm_Object_Item *elm_diskselector_last_item_get(const Evas_Object *obj); - -/** - * Get the item before @p item in diskselector. - * - * @param it The diskselector item. - * @return The item before @p item, or @c NULL if none or on failure. - * - * The list of items follows append order. So it will return item appended - * just before @p item and that wasn't deleted. - * - * If it is the first item, @c NULL will be returned. - * First item can be get by elm_diskselector_first_item_get(). - * - * @see elm_diskselector_item_append() - * @see elm_diskselector_items_get() - * - * @ingroup Diskselector - */ -EAPI Elm_Object_Item *elm_diskselector_item_prev_get(const Elm_Object_Item *it); - -/** - * Get the item after @p item in diskselector. - * - * @param it The diskselector item. - * @return The item after @p item, or @c NULL if none or on failure. - * - * The list of items follows append order. So it will return item appended - * just after @p item and that wasn't deleted. - * - * If it is the last item, @c NULL will be returned. - * Last item can be get by elm_diskselector_last_item_get(). - * - * @see elm_diskselector_item_append() - * @see elm_diskselector_items_get() - * - * @ingroup Diskselector - */ -EAPI Elm_Object_Item *elm_diskselector_item_next_get(const Elm_Object_Item *it); - +#include "elm_diskselector_common.h" +#ifdef EFL_EO_API_SUPPORT +#include "elm_diskselector_eo.h" +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include "elm_diskselector_legacy.h" +#endif /** * @} */ diff --git a/legacy/elementary/src/lib/elm_diskselector_common.h b/legacy/elementary/src/lib/elm_diskselector_common.h new file mode 100644 index 0000000000..9467d012db --- /dev/null +++ b/legacy/elementary/src/lib/elm_diskselector_common.h @@ -0,0 +1,80 @@ +/** + * Set the selected state of an item. + * + * @param it The diskselector item + * @param selected The selected state + * + * This sets the selected state of the given item @p it. + * @c EINA_TRUE for selected, @c EINA_FALSE for not selected. + * + * If a new item is selected the previously selected will be unselected. + * Previously selected item can be get with function + * elm_diskselector_selected_item_get(). + * + * If the item @p it is unselected, the first item of diskselector will + * be selected. + * + * Selected items will be visible on center position of diskselector. + * So if it was on another position before selected, or was invisible, + * diskselector will animate items until the selected item reaches center + * position. + * + * @see elm_diskselector_item_selected_get() + * @see elm_diskselector_selected_item_get() + * + * @ingroup Diskselector + */ +EAPI void elm_diskselector_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); + +/* + * Get whether the @p item is selected or not. + * + * @param it The diskselector item. + * @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates + * it's not. If @p obj is @c NULL, @c EINA_FALSE is returned. + * + * @see elm_diskselector_selected_item_set() for details. + * @see elm_diskselector_item_selected_get() + * + * @ingroup Diskselector + */ +EAPI Eina_Bool elm_diskselector_item_selected_get(const Elm_Object_Item *it); + +/** + * Get the item before @p item in diskselector. + * + * @param it The diskselector item. + * @return The item before @p item, or @c NULL if none or on failure. + * + * The list of items follows append order. So it will return item appended + * just before @p item and that wasn't deleted. + * + * If it is the first item, @c NULL will be returned. + * First item can be get by elm_diskselector_first_item_get(). + * + * @see elm_diskselector_item_append() + * @see elm_diskselector_items_get() + * + * @ingroup Diskselector + */ +EAPI Elm_Object_Item *elm_diskselector_item_prev_get(const Elm_Object_Item *it); + +/** + * Get the item after @p item in diskselector. + * + * @param it The diskselector item. + * @return The item after @p item, or @c NULL if none or on failure. + * + * The list of items follows append order. So it will return item appended + * just after @p item and that wasn't deleted. + * + * If it is the last item, @c NULL will be returned. + * Last item can be get by elm_diskselector_last_item_get(). + * + * @see elm_diskselector_item_append() + * @see elm_diskselector_items_get() + * + * @ingroup Diskselector + */ +EAPI Elm_Object_Item *elm_diskselector_item_next_get(const Elm_Object_Item *it); + diff --git a/legacy/elementary/src/lib/elm_diskselector_eo.h b/legacy/elementary/src/lib/elm_diskselector_eo.h new file mode 100644 index 0000000000..7cfacd46b2 --- /dev/null +++ b/legacy/elementary/src/lib/elm_diskselector_eo.h @@ -0,0 +1,194 @@ +#define ELM_OBJ_DISKSELECTOR_CLASS elm_obj_diskselector_class_get() + +const Eo_Class *elm_obj_diskselector_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_DISKSELECTOR_BASE_ID; + +enum +{ + ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_GET, + ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_SET, + ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_GET, + ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_SET, + ELM_OBJ_DISKSELECTOR_SUB_ID_CLEAR, + ELM_OBJ_DISKSELECTOR_SUB_ID_ITEMS_GET, + ELM_OBJ_DISKSELECTOR_SUB_ID_ITEM_APPEND, + ELM_OBJ_DISKSELECTOR_SUB_ID_SELECTED_ITEM_GET, + ELM_OBJ_DISKSELECTOR_SUB_ID_FIRST_ITEM_GET, + ELM_OBJ_DISKSELECTOR_SUB_ID_LAST_ITEM_GET, + ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_SET, + ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_GET, + ELM_OBJ_DISKSELECTOR_SUB_ID_LAST +}; + +#define ELM_OBJ_DISKSELECTOR_ID(sub_id) (ELM_OBJ_DISKSELECTOR_BASE_ID + sub_id) + + +/** + * @def elm_obj_diskselector_round_enabled_get + * @since 1.8 + * + * Get a value whether round mode is enabled or not. + * + * @param[out] ret + * + * @see elm_diskselector_round_enabled_get + */ +#define elm_obj_diskselector_round_enabled_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_diskselector_round_enabled_set + * @since 1.8 + * + * Enable or disable round mode. + * + * @param[in] enabled + * + * @see elm_diskselector_round_enabled_set + * + * @ingroup Diskselector + */ +#define elm_obj_diskselector_round_enabled_set(enabled) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled) + +/** + * @def elm_obj_diskselector_side_text_max_length_get + * @since 1.8 + * + * Get the side labels max length. + * + * @param[out] ret + * + * @see elm_diskselector_side_text_max_length_get + * + * @ingroup Diskselector + */ +#define elm_obj_diskselector_side_text_max_length_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_GET), EO_TYPECHECK(int *, ret) + +/** + * @def elm_obj_diskselector_side_text_max_length_set + * @since 1.8 + * + * Set the side labels max length. + * + * @param[in] len + * + * @see elm_diskselector_side_text_max_length_set + * + * @ingroup Diskselector + */ +#define elm_obj_diskselector_side_text_max_length_set(len) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_SET), EO_TYPECHECK(int, len) + +/** + * @def elm_obj_diskselector_clear + * @since 1.8 + * + * Remove all diskselector's items. + * + * + * @see elm_diskselector_clear + * + * @ingroup Diskselector + */ +#define elm_obj_diskselector_clear() ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_CLEAR) + +/** + * @def elm_obj_diskselector_items_get + * @since 1.8 + * + * Get a list of all the diskselector items. + * + * @param[out] ret + * + * @see elm_diskselector_items_get + * + * @ingroup Diskselector + */ +#define elm_obj_diskselector_items_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret) + +/** + * @def elm_obj_diskselector_item_append + * @since 1.8 + * + * Appends a new item to the diskselector object. + * + * @param[in] label + * @param[in] icon + * @param[in] func + * @param[in] data + * @param[out] ret + * + * @see elm_diskselector_item_append + * + * @ingroup Diskselector + */ +#define elm_obj_diskselector_item_append(label, icon, func, data, ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_diskselector_selected_item_get + * @since 1.8 + * + * Get the selected item. + * + * @param[out] ret + * + * @see elm_diskselector_selected_item_get + * + * @ingroup Diskselector + */ +#define elm_obj_diskselector_selected_item_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_diskselector_first_item_get + * @since 1.8 + * + * Get the first item of the diskselector. + * + * @param[out] ret + * + * @see elm_diskselector_first_item_get + * + * @ingroup Diskselector + */ +#define elm_obj_diskselector_first_item_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_diskselector_last_item_get + * @since 1.8 + * + * Get the last item of the diskselector. + * + * @param[out] ret + * + * @see elm_diskselector_last_item_get + * + * @ingroup Diskselector + */ +#define elm_obj_diskselector_last_item_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_diskselector_display_item_num_set + * @since 1.8 + * + * Set the number of items to be displayed. + * + * @param[in] num + * + * @see elm_diskselector_display_item_num_set + * + * @ingroup Diskselector + */ +#define elm_obj_diskselector_display_item_num_set(num) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_SET), EO_TYPECHECK(int, num) + +/** + * @def elm_obj_diskselector_display_item_num_get + * @since 1.8 + * + * Get the number of items in the diskselector object. + * + * @param[out] ret + * + * @see elm_diskselector_display_item_num_get + * + * @ingroup Diskselector + */ +#define elm_obj_diskselector_display_item_num_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_GET), EO_TYPECHECK(int *, ret) diff --git a/legacy/elementary/src/lib/elm_diskselector_legacy.h b/legacy/elementary/src/lib/elm_diskselector_legacy.h new file mode 100644 index 0000000000..73f3425566 --- /dev/null +++ b/legacy/elementary/src/lib/elm_diskselector_legacy.h @@ -0,0 +1,240 @@ +/** + * Add a new diskselector widget to the given parent Elementary + * (container) object. + * + * @param parent The parent object. + * @return a new diskselector widget handle or @c NULL, on errors. + * + * This function inserts a new diskselector widget on the canvas. + * + * @ingroup Diskselector + */ +EAPI Evas_Object *elm_diskselector_add(Evas_Object *parent); + +/** + * Get a value whether round mode is enabled or not. + * + * @see elm_diskselector_round_enabled_set() for details. + * + * @param obj The diskselector object. + * @return @c EINA_TRUE means round mode is enabled. @c EINA_FALSE indicates + * it's disabled. If @p obj is @c NULL, @c EINA_FALSE is returned. + * + * @ingroup Diskselector + */ +EAPI Eina_Bool elm_diskselector_round_enabled_get(const Evas_Object *obj); + +/** + * Enable or disable round mode. + * + * @param obj The diskselector object. + * @param enabled @c EINA_TRUE to enable round mode or @c EINA_FALSE to + * disable it. + * + * Disabled by default. If round mode is enabled the items list will + * work like a circular list, so when the user reaches the last item, + * the first one will popup. + * + * @see elm_diskselector_round_enabled_get() + * + * @ingroup Diskselector + */ +EAPI void elm_diskselector_round_enabled_set(Evas_Object *obj, Eina_Bool enabled); + +/** + * Get the side labels max length. + * + * @see elm_diskselector_side_text_max_length_set() for details. + * + * @param obj The diskselector object. + * @return The max length defined for side labels, or 0 if not a valid + * diskselector. + * + * @ingroup Diskselector + */ +EAPI int elm_diskselector_side_text_max_length_get(const Evas_Object *obj); + +/** + * Set the side labels max length. + * + * @param obj The diskselector object. + * @param len The max length defined for side labels. + * + * Length is the number of characters of items' label that will be + * visible when it's set on side positions. It will just crop + * the string after defined size. E.g.: + * + * An item with label "January" would be displayed on side position as + * "Jan" if max length is set to 3, or "Janu", if this property + * is set to 4. + * + * When it's selected, the entire label will be displayed, except for + * width restrictions. In this case label will be cropped and "..." + * will be concatenated. + * + * Default side label max length is 3. + * + * This property will be applied over all items, included before or + * later this function call. + * + * @ingroup Diskselector + */ +EAPI void elm_diskselector_side_text_max_length_set(Evas_Object *obj, int len); + +/** + * Remove all diskselector's items. + * + * @param obj The diskselector object. + * + * @see elm_object_item_del() + * @see elm_diskselector_item_append() + * + * @ingroup Diskselector + */ +EAPI void elm_diskselector_clear(Evas_Object *obj); + +/** + * Get a list of all the diskselector items. + * + * @param obj The diskselector object. + * @return An @c Eina_List of diskselector items, #Elm_Object_Item, + * or @c NULL on failure. + * + * @see elm_diskselector_item_append() + * @see elm_object_item_del() + * @see elm_diskselector_clear() + * + * @ingroup Diskselector + */ +EAPI const Eina_List *elm_diskselector_items_get(const Evas_Object *obj); + +/** + * Appends a new item to the diskselector object. + * + * @param obj The diskselector object. + * @param label The label of the diskselector item. + * @param icon The icon object to use at left side of the item. An + * icon can be any Evas object, but usually it is an icon created + * with elm_icon_add(). + * @param func The function to call when the item is selected. + * @param data The data to associate with the item for related callbacks. + * + * @return The created item or @c NULL upon failure. + * + * A new item will be created and appended to the diskselector, i.e., will + * be set as last item. Also, if there is no selected item, it will + * be selected. This will always happens for the first appended item. + * + * If no icon is set, label will be centered on item position, otherwise + * the icon will be placed at left of the label, that will be shifted + * to the right. + * + * Items created with this method can be deleted with + * elm_object_item_del(). + * + * Associated @p data can be properly freed when item is deleted if a + * callback function is set with elm_object_item_del_cb_set(). + * + * If a function is passed as argument, it will be called every time this item + * is selected, i.e., the user stops the diskselector with this + * item on center position. If such function isn't needed, just passing + * @c NULL as @p func is enough. The same should be done for @p data. + * + * Simple example (with no function callback or data associated): + * @code + * disk = elm_diskselector_add(win); + * ic = elm_icon_add(win); + * elm_image_file_set(ic, "path/to/image", NULL); + * elm_icon_resizable_set(ic, EINA_TRUE, EINA_TRUE); + * elm_diskselector_item_append(disk, "label", ic, NULL, NULL); + * @endcode + * + * @see elm_object_item_del() + * @see elm_diskselector_clear() + * @see elm_icon_add() + * + * @ingroup Diskselector + */ +EAPI Elm_Object_Item *elm_diskselector_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data); + +/** + * Get the selected item. + * + * @param obj The diskselector object. + * @return The selected diskselector item. + * + * The selected item can be unselected with function + * elm_diskselector_item_selected_set(), and the first item of + * diskselector will be selected. + * + * The selected item always will be centered on diskselector, with + * full label displayed, i.e., max length set to side labels won't + * apply on the selected item. More details on + * elm_diskselector_side_text_max_length_set(). + * + * @ingroup Diskselector + */ +EAPI Elm_Object_Item *elm_diskselector_selected_item_get(const Evas_Object *obj); + +/** + * Get the first item of the diskselector. + * + * @param obj The diskselector object. + * @return The first item, or @c NULL if none. + * + * The list of items follows append order. So it will return the first + * item appended to the widget that wasn't deleted. + * + * @see elm_diskselector_item_append() + * @see elm_diskselector_items_get() + * + * @ingroup Diskselector + */ +EAPI Elm_Object_Item *elm_diskselector_first_item_get(const Evas_Object *obj); + +/** + * Get the last item of the diskselector. + * + * @param obj The diskselector object. + * @return The last item, or @c NULL if none. + * + * The list of items follows append order. So it will return last first + * item appended to the widget that wasn't deleted. + * + * @see elm_diskselector_item_append() + * @see elm_diskselector_items_get() + * + * @ingroup Diskselector + */ +EAPI Elm_Object_Item *elm_diskselector_last_item_get(const Evas_Object *obj); + +/** + * Set the number of items to be displayed. + * + * @param obj The diskselector object. + * @param num The number of items the diskselector will display. + * + * Default value is 3, and also it's the minimum. If @p num is less + * than 3, it will be set to 3. + * + * Also, it can be set on theme, using data item @c display_item_num + * on group "elm/diskselector/item/X", where X is style set. + * E.g.: + * + * group { name: "elm/diskselector/item/X"; + * data { + * item: "display_item_num" "5"; + * } + * + * @ingroup Diskselector + */ +EAPI void elm_diskselector_display_item_num_set(Evas_Object *obj, int num); + +/** + * Get the number of items in the diskselector object. + * + * @param obj The diskselector object. + * + * @ingroup Diskselector + */ +EAPI int elm_diskselector_display_item_num_get(const Evas_Object *obj); diff --git a/legacy/elementary/src/lib/elm_entry.h b/legacy/elementary/src/lib/elm_entry.h index eae1fb757c..2f3f7d4351 100644 --- a/legacy/elementary/src/lib/elm_entry.h +++ b/legacy/elementary/src/lib/elm_entry.h @@ -268,2709 +268,13 @@ * @{ */ -/** - * @typedef Elm_Text_Format - * - * Text Format types. - * - * @see elm_entry_file_set() - */ -typedef enum -{ - ELM_TEXT_FORMAT_PLAIN_UTF8, /**< Plain UTF8 type */ - ELM_TEXT_FORMAT_MARKUP_UTF8 /**< Markup UTF8 type */ -} Elm_Text_Format; - -/** - * @typedef Elm_Wrap_Type - * - * Line wrapping types. - * - * @see elm_entry_line_wrap_set() - */ -typedef enum -{ - ELM_WRAP_NONE = 0, /**< No wrap - value is zero */ - ELM_WRAP_CHAR, /**< Char wrap - wrap between characters */ - ELM_WRAP_WORD, /**< Word wrap - wrap in allowed wrapping points (as defined in the unicode standard) */ - ELM_WRAP_MIXED, /**< Mixed wrap - Word wrap, and if that fails, char wrap. */ - ELM_WRAP_LAST -} Elm_Wrap_Type; /**< Type of word or character wrapping to use */ - -/** - * @typedef Elm_Input_Panel_Layout - * - * Input panel (virtual keyboard) layout types. - * - * @see elm_entry_input_panel_layout_set() - */ -typedef enum -{ - ELM_INPUT_PANEL_LAYOUT_NORMAL, /**< Default layout */ - ELM_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */ - ELM_INPUT_PANEL_LAYOUT_EMAIL, /**< Email layout */ - ELM_INPUT_PANEL_LAYOUT_URL, /**< URL layout */ - ELM_INPUT_PANEL_LAYOUT_PHONENUMBER, /**< Phone Number layout */ - ELM_INPUT_PANEL_LAYOUT_IP, /**< IP layout */ - ELM_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */ - ELM_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */ - ELM_INPUT_PANEL_LAYOUT_INVALID, /**< Never use this */ - ELM_INPUT_PANEL_LAYOUT_HEX, /**< Hexadecimal layout */ - ELM_INPUT_PANEL_LAYOUT_TERMINAL, /**< Command-line terminal layout including esc, alt, ctrl key, so on (no auto-correct, no auto-capitalization) */ - ELM_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. */ -} Elm_Input_Panel_Layout; /**< Type of input panel (virtual keyboard) to use - this is a hint and may not provide exactly what is desired. */ - -enum -{ - ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL, - ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED, - ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_DECIMAL, - ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED_AND_DECIMAL -}; - -/** - * @typedef Elm_Input_Panel_Lang - * - * Input panel (virtual keyboard) language modes. - * - * @see elm_entry_input_panel_language_set() - */ -typedef enum -{ - ELM_INPUT_PANEL_LANG_AUTOMATIC, /**< Automatic */ - ELM_INPUT_PANEL_LANG_ALPHABET /**< Alphabet */ -} Elm_Input_Panel_Lang; - -/** - * @typedef Elm_Autocapital_Type - * - * Autocapitalization Types. - * - * @see elm_entry_autocapital_type_set() - */ -typedef enum -{ - ELM_AUTOCAPITAL_TYPE_NONE, /**< No auto-capitalization when typing */ - ELM_AUTOCAPITAL_TYPE_WORD, /**< Autocapitalize each word typed */ - ELM_AUTOCAPITAL_TYPE_SENTENCE, /**< Autocapitalize the start of each sentence */ - ELM_AUTOCAPITAL_TYPE_ALLCHARACTER, /**< Autocapitalize all letters */ -} Elm_Autocapital_Type; /**< Choose method of auto-capitalization */ - -/** - * @typedef Elm_Input_Panel_Return_Key_Type - * - * "Return" Key types on the input panel (virtual keyboard). - * - * @see elm_entry_input_panel_return_key_type_set() - */ -typedef enum -{ - ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT, /**< Default */ - ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE, /**< Done */ - ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO, /**< Go */ - ELM_INPUT_PANEL_RETURN_KEY_TYPE_JOIN, /**< Join */ - ELM_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN, /**< Login */ - ELM_INPUT_PANEL_RETURN_KEY_TYPE_NEXT, /**< Next */ - ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH, /**< Search string or magnifier icon */ - ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEND, /**< Send */ - ELM_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN /**< Sign-in @since 1.8 */ -} Elm_Input_Panel_Return_Key_Type; - -/** - * @typedef Elm_Entry_Anchor_Info - * - * The info sent in the callback for the "anchor,clicked" signals emitted - * by entries. - */ -typedef struct _Elm_Entry_Anchor_Info Elm_Entry_Anchor_Info; - -/** - * @struct _Elm_Entry_Anchor_Info - * - * The info sent in the callback for the "anchor,clicked" signals emitted - * by entries. - */ -struct _Elm_Entry_Anchor_Info -{ - const char *name; /**< The name of the anchor, as stated in its href */ - int button; /**< The mouse button used to click on it */ - Evas_Coord x, /**< Anchor geometry, relative to canvas */ - y, /**< Anchor geometry, relative to canvas */ - w, /**< Anchor geometry, relative to canvas */ - h; /**< Anchor geometry, relative to canvas */ -}; - -/** - * @typedef Elm_Entry_Anchor_Hover_Info - * - * The info sent in the callback for "anchor,clicked" signals emitted by - * the Anchor_Hover widget. - */ -typedef struct _Elm_Entry_Anchor_Hover_Info Elm_Entry_Anchor_Hover_Info; - -/** - * @typedef Elm_Entry_Context_Menu_Item - * - * Type of contextual item that can be added in to long press menu. - * @since 1.8 - */ -typedef struct _Elm_Entry_Context_Menu_Item Elm_Entry_Context_Menu_Item; - -/** - * @struct _Elm_Entry_Anchor_Hover_Info - * - * The info sent in the callback for "anchor,clicked" signals emitted by - * the Anchor_Hover widget. - */ -struct _Elm_Entry_Anchor_Hover_Info -{ - const Elm_Entry_Anchor_Info *anchor_info; /**< The actual anchor info. */ - Evas_Object *hover; /**< The hover object to use for the popup */ - struct - { - Evas_Coord x, y, w, h; - } hover_parent; /**< Geometry of the object used as parent by the - hover */ - Eina_Bool hover_left : 1; /**< Hint indicating if there's space - for content on the left side of - the hover. Before calling the - callback, the widget will make the - necessary calculations to check - which sides are fit to be set with - content, based on the position the - hover is activated and its distance - to the edges of its parent object - */ - Eina_Bool hover_right : 1; /**< Hint indicating content fits on - the right side of the hover. - See @ref hover_left */ - Eina_Bool hover_top : 1; /**< Hint indicating content fits on top - of the hover. See @ref hover_left */ - Eina_Bool hover_bottom : 1; /**< Hint indicating content fits - below the hover. See @ref - hover_left */ -}; - -/** - * @typedef Elm_Entry_Item_Provider_Cb - * This callback type is used to provide items. - * If it returns an object handle other than NULL (it should create an - * object to do this), then this object is used to replace the current item. - * If not the next provider is called until one provides an item object, or the - * default provider in entry does. - * @param data The data specified as the last param when adding the provider - * @param entry The entry object - * @param text A pointer to the item href string in the text - * @return The object to be placed in the entry like an icon, or other element - * @see elm_entry_item_provider_append - * @see elm_entry_item_provider_prepend - * @see elm_entry_item_provider_remove - */ -typedef Evas_Object * (*Elm_Entry_Item_Provider_Cb)(void *data, Evas_Object * entry, const char *item); - -/** - * @typedef Elm_Entry_Filter_Cb - * This callback type is used by entry filters to modify text. - * @param data The data specified as the last param when adding the filter - * @param entry The entry object - * @param text A pointer to the location of the text being filtered. The type of text is always markup. This data can be modified, but any additional allocations must be managed by the user. - * @see elm_entry_markup_filter_append - * @see elm_entry_markup_filter_prepend - * @see elm_entry_markup_filter_remove - */ -typedef void (*Elm_Entry_Filter_Cb)(void *data, Evas_Object *entry, char **text); - -/** - * @typedef Elm_Entry_Change_Info - * This corresponds to Edje_Entry_Change_Info. Includes information about - * a change in the entry. - */ -typedef Edje_Entry_Change_Info Elm_Entry_Change_Info; - -/** - * This adds an entry to @p parent object. - * - * By default, entries are: - * @li not scrolled - * @li multi-line - * @li word wrapped - * @li autosave is enabled - * - * @param parent The parent object - * @return The new object or NULL if it cannot be created - * - * @ingroup Entry - */ -EAPI Evas_Object *elm_entry_add(Evas_Object *parent); - -/** - * Push the style to the top of user style stack. - * If there is styles in the user style stack, the properties in the top style - * of user style stack will replace the properties in current theme. - * The input style is specified in format tag='property=value' (i.e. DEFAULT='font=Sans font_size=60'hilight=' + font_weight=Bold'). - * - * @param obj The entry object - * @param style The style user to push - * - * @since 1.7 - */ -EAPI void elm_entry_text_style_user_push(Evas_Object *obj, const char *style); - -/** - * Remove the style in the top of user style stack. - * - * @param obj The entry object - * - * @see elm_entry_text_style_user_push() - * - * @since 1.7 - */ -EAPI void elm_entry_text_style_user_pop(Evas_Object *obj); - -/** - * Retrieve the style on the top of user style stack. - * - * @param obj The entry object - * @return style on the top of user style stack if exist, otherwise NULL. - * - * @see elm_entry_text_style_user_push() - * - * @since 1.7 - */ -EAPI const char* elm_entry_text_style_user_peek(const Evas_Object *obj); - -/** - * Sets the entry to single line mode. - * - * In single line mode, entries don't ever wrap when the text reaches the - * edge, and instead they keep growing horizontally. Pressing the @c Enter - * key will generate an @c "activate" event instead of adding a new line. - * - * When @p single_line is @c EINA_FALSE, line wrapping takes effect again - * and pressing enter will break the text into a different line - * without generating any events. - * - * @param obj The entry object - * @param single_line If true, the text in the entry - * will be on a single line. - * - * @ingroup Entry - */ -EAPI void elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line); - -/** - * Gets whether the entry is set to be single line. - * - * @param obj The entry object - * @return single_line If true, the text in the entry is set to display - * on a single line. - * - * @see elm_entry_single_line_set() - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_single_line_get(const Evas_Object *obj); - -/** - * Sets the entry to password mode. - * - * In password mode, entries are implicitly single line and the display of - * any text in them is replaced with asterisks (*). - * - * @param obj The entry object - * @param password If true, password mode is enabled. - * - * @ingroup Entry - */ -EAPI void elm_entry_password_set(Evas_Object *obj, Eina_Bool password); - -/** - * Gets whether the entry is set to password mode. - * - * @param obj The entry object - * @return If true, the entry is set to display all characters - * as asterisks (*). - * - * @see elm_entry_password_set() - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_password_get(const Evas_Object *obj); - -/** - * This sets the text displayed within the entry to @p entry. - * - * @param obj The entry object - * @param entry The text to be displayed - * - * @note Using this function bypasses text filters - * - * @ingroup Entry - */ -EAPI void elm_entry_entry_set(Evas_Object *obj, const char *entry); - -/** - * This returns the text currently shown in object @p entry. - * See also elm_entry_entry_set(). - * - * @param obj The entry object - * @return The currently displayed text or NULL on failure - * - * @ingroup Entry - */ -EAPI const char *elm_entry_entry_get(const Evas_Object *obj); - -/** - * Appends @p entry to the text of the entry. - * - * Adds the text in @p entry to the end of any text already present in the - * widget. - * - * The appended text is subject to any filters set for the widget. - * - * @param obj The entry object - * @param entry The text to be displayed - * - * @see elm_entry_markup_filter_append() - * - * @ingroup Entry - */ -EAPI void elm_entry_entry_append(Evas_Object *obj, const char *entry); - -/** - * Gets whether the entry is empty. - * - * Empty means no text at all. If there are any markup tags, like an item - * tag for which no provider finds anything, and no text is displayed, this - * function still returns EINA_FALSE. - * - * @param obj The entry object - * @return EINA_TRUE if the entry is empty, EINA_FALSE otherwise. - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_is_empty(const Evas_Object *obj); - -/** - * Gets any selected text within the entry. - * - * If there's any selected text in the entry, this function returns it as - * a string in markup format. NULL is returned if no selection exists or - * if an error occurred. - * - * The returned value points to an internal string and should not be freed - * or modified in any way. If the @p entry object is deleted or its - * contents are changed, the returned pointer should be considered invalid. - * - * @param obj The entry object - * @return The selected text within the entry or NULL on failure - * - * @ingroup Entry - */ -EAPI const char *elm_entry_selection_get(const Evas_Object *obj); - -/** - * Returns the actual textblock object of the entry. - * - * This function exposes the internal textblock object that actually - * contains and draws the text. This should be used for low-level - * manipulations that are otherwise not possible. - * - * Changing the textblock directly from here will not notify edje/elm to - * recalculate the textblock size automatically, so any modifications - * done to the textblock returned by this function should be followed by - * a call to elm_entry_calc_force(). - * - * The return value is marked as const as an additional warning. - * One should not use the returned object with any of the generic evas - * functions (geometry_get/resize/move and etc), but only with the textblock - * functions; The former will either not work at all, or break the correct - * functionality. - * - * IMPORTANT: Many functions may change (i.e delete and create a new one) - * the internal textblock object. Do NOT cache the returned object, and try - * not to mix calls on this object with regular elm_entry calls (which may - * change the internal textblock object). This applies to all cursors - * returned from textblock calls, and all the other derivative values. - * - * @param obj The entry object - * @return The textblock object. - * - * @ingroup Entry - */ -EAPI Evas_Object * elm_entry_textblock_get(Evas_Object *obj); - -/** - * Forces calculation of the entry size and text layouting. - * - * This should be used after modifying the textblock object directly. See - * elm_entry_textblock_get() for more information. - * - * @param obj The entry object - * - * @see elm_entry_textblock_get() - * - * @ingroup Entry - */ -EAPI void elm_entry_calc_force(Evas_Object *obj); - -/** - * Inserts the given text into the entry at the current cursor position. - * - * This inserts text at the cursor position as if it was typed - * by the user (note that this also allows markup which a user - * can't just "type" as it would be converted to escaped text, so this - * call can be used to insert things like emoticon items or bold push/pop - * tags, other font and color change tags etc.) - * - * If any selection exists, it will be replaced by the inserted text. - * - * The inserted text is subject to any filters set for the widget. - * - * @param obj The entry object - * @param entry The text to insert - * - * @see elm_entry_markup_filter_append() - * - * @ingroup Entry - */ -EAPI void elm_entry_entry_insert(Evas_Object *obj, const char *entry); - -/** - * Set the line wrap type to use on multi-line entries. - * - * Sets the wrap type used by the entry to any of the specified in - * Elm_Wrap_Type. This tells how the text will be implicitly cut into a new - * line (without inserting a line break or paragraph separator) when it - * reaches the far edge of the widget. - * - * Note that this only makes sense for multi-line entries. A widget set - * to be single line will never wrap. - * - * @param obj The entry object - * @param wrap The wrap mode to use. See Elm_Wrap_Type for details on them - */ -EAPI void elm_entry_line_wrap_set(Evas_Object *obj, Elm_Wrap_Type wrap); - -/** - * Gets the wrap mode the entry was set to use. - * - * @param obj The entry object - * @return Wrap type - * - * @see also elm_entry_line_wrap_set() - * - * @ingroup Entry - */ -EAPI Elm_Wrap_Type elm_entry_line_wrap_get(const Evas_Object *obj); - -/** - * Sets if the entry is to be editable or not. - * - * By default, entries are editable and when focused, any text input by the - * user will be inserted at the current cursor position. But calling this - * function with @p editable as EINA_FALSE will prevent the user from - * inputting text into the entry. - * - * The only way to change the text of a non-editable entry is to use - * elm_object_text_set(), elm_entry_entry_insert() and other related - * functions. - * - * @param obj The entry object - * @param editable If EINA_TRUE, user input will be inserted in the entry, - * if not, the entry is read-only and no user input is allowed. - * - * @ingroup Entry - */ -EAPI void elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable); - -/** - * Gets whether the entry is editable or not. - * - * @param obj The entry object - * @return If true, the entry is editable by the user. - * If false, it is not editable by the user - * - * @see elm_entry_editable_set() - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_editable_get(const Evas_Object *obj); - -/** - * This drops any existing text selection within the entry. - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_select_none(Evas_Object *obj); - -/** - * This selects all text within the entry. - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_select_all(Evas_Object *obj); - -/** - * This moves the cursor one place to the right within the entry. - * - * @param obj The entry object - * @return EINA_TRUE upon success, EINA_FALSE upon failure - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_cursor_next(Evas_Object *obj); - -/** - * This moves the cursor one place to the left within the entry. - * - * @param obj The entry object - * @return EINA_TRUE upon success, EINA_FALSE upon failure - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_cursor_prev(Evas_Object *obj); - -/** - * This moves the cursor one line up within the entry. - * - * @param obj The entry object - * @return EINA_TRUE upon success, EINA_FALSE upon failure - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_cursor_up(Evas_Object *obj); - -/** - * This moves the cursor one line down within the entry. - * - * @param obj The entry object - * @return EINA_TRUE upon success, EINA_FALSE upon failure - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_cursor_down(Evas_Object *obj); - -/** - * This moves the cursor to the beginning of the entry. - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_cursor_begin_set(Evas_Object *obj); - -/** - * This moves the cursor to the end of the entry. - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_cursor_end_set(Evas_Object *obj); - -/** - * This moves the cursor to the beginning of the current line. - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_cursor_line_begin_set(Evas_Object *obj); - -/** - * This moves the cursor to the end of the current line. - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_cursor_line_end_set(Evas_Object *obj); - -/** - * This begins a selection within the entry as though - * the user were holding down the mouse button to make a selection. - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_cursor_selection_begin(Evas_Object *obj); - -/** - * This ends a selection within the entry as though - * the user had just released the mouse button while making a selection. - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_cursor_selection_end(Evas_Object *obj); - -/** - * Gets whether a format node exists at the current cursor position. - * - * A format node is anything that defines how the text is rendered. It can - * be a visible format node, such as a line break or a paragraph separator, - * or an invisible one, such as bold begin or end tag. - * This function returns whether any format node exists at the current - * cursor position. - * - * @param obj The entry object - * @return EINA_TRUE if the current cursor position contains a format node, - * EINA_FALSE otherwise. - * - * @see elm_entry_cursor_is_visible_format_get() - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_cursor_is_format_get(const Evas_Object *obj); - -/** - * Gets if the current cursor position holds a visible format node. - * - * @param obj The entry object - * @return EINA_TRUE if the current cursor is a visible format, EINA_FALSE - * if it's an invisible one or no format exists. - * - * @see elm_entry_cursor_is_format_get() - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_cursor_is_visible_format_get(const Evas_Object *obj); - -/** - * Gets the character pointed by the cursor at its current position. - * - * This function returns a string with the utf8 character stored at the - * current cursor position. - * Only the text is returned, any format that may exist will not be part - * of the return value. You must free the string when done with free(). - * - * @param obj The entry object - * @return The text pointed by the cursors. - * - * @ingroup Entry - */ -EAPI char *elm_entry_cursor_content_get(const Evas_Object *obj); - -/** - * This function returns the geometry of the cursor. - * - * It's useful if you want to draw something on the cursor (or where it is), - * or for example in the case of scrolled entry where you want to show the - * cursor. - * - * @param obj The entry object - * @param x returned geometry - * @param y returned geometry - * @param w returned geometry - * @param h returned geometry - * @return EINA_TRUE upon success, EINA_FALSE upon failure - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_cursor_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); - -/** - * Sets the cursor position in the entry to the given value - * - * The value in @p pos is the index of the character position within the - * contents of the string as returned by elm_entry_cursor_pos_get(). - * - * @param obj The entry object - * @param pos The position of the cursor - * - * @ingroup Entry - */ -EAPI void elm_entry_cursor_pos_set(Evas_Object *obj, int pos); - -/** - * Retrieves the current position of the cursor in the entry - * - * @param obj The entry object - * @return The cursor position - * - * @ingroup Entry - */ -EAPI int elm_entry_cursor_pos_get(const Evas_Object *obj); - -/** - * This executes a "cut" action on the selected text in the entry. - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_selection_cut(Evas_Object *obj); - -/** - * This executes a "copy" action on the selected text in the entry. - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_selection_copy(Evas_Object *obj); - -/** - * This executes a "paste" action in the entry. - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_selection_paste(Evas_Object *obj); - -/** - * This clears and frees the items in a entry's contextual (longpress) - * menu. - * - * @param obj The entry object - * - * @see elm_entry_context_menu_item_add() - * - * @ingroup Entry - */ -EAPI void elm_entry_context_menu_clear(Evas_Object *obj); - -/** - * This adds an item to the entry's contextual menu. - * - * A longpress on an entry will make the contextual menu show up, if this - * hasn't been disabled with elm_entry_context_menu_disabled_set(). - * By default, this menu provides a few options like enabling selection mode, - * which is useful on embedded devices that need to be explicit about it, - * and when a selection exists it also shows the copy and cut actions. - * - * With this function, developers can add other options to this menu to - * perform any action they deem necessary. - * - * @param obj The entry object - * @param label The item's text label - * @param icon_file The item's icon file - * @param icon_type The item's icon type - * @param func The callback to execute when the item is clicked - * @param data The data to associate with the item for related functions - * - * @ingroup Entry - */ -EAPI void elm_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data); - -/** - * This disables the entry's contextual (longpress) menu. - * - * @param obj The entry object - * @param disabled If true, the menu is disabled - * - * @ingroup Entry - */ -EAPI void elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled); - -/** - * This returns whether the entry's contextual (longpress) menu is - * disabled. - * - * @param obj The entry object - * @return If true, the menu is disabled - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_context_menu_disabled_get(const Evas_Object *obj); - -/** - * This appends a custom item provider to the list for that entry - * - * This appends the given callback. The list is walked from beginning to end - * with each function called given the item href string in the text. If the - * function returns an object handle other than NULL (it should create an - * object to do this), then this object is used to replace that item. If - * not the next provider is called until one provides an item object, or the - * default provider in entry does. - * - * @param obj The entry object - * @param func The function called to provide the item object - * @param data The data passed to @p func - * - * @see @ref entry-items - * - * @ingroup Entry - */ -EAPI void elm_entry_item_provider_append(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data); - -/** - * This prepends a custom item provider to the list for that entry - * - * This prepends the given callback. See elm_entry_item_provider_append() for - * more information - * - * @param obj The entry object - * @param func The function called to provide the item object - * @param data The data passed to @p func - * - * @ingroup Entry - */ -EAPI void elm_entry_item_provider_prepend(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data); - -/** - * This removes a custom item provider to the list for that entry - * - * This removes the given callback. See elm_entry_item_provider_append() for - * more information - * - * @param obj The entry object - * @param func The function called to provide the item object - * @param data The data passed to @p func - * - * @ingroup Entry - */ -EAPI void elm_entry_item_provider_remove(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data); - -/** - * Append a markup filter function for text inserted in the entry - * - * Append the given callback to the list. This functions will be called - * whenever any text is inserted into the entry, with the text to be inserted - * as a parameter. The type of given text is always markup. - * The callback function is free to alter the text in any way it wants, but - * it must remember to free the given pointer and update it. - * If the new text is to be discarded, the function can free it and set its - * text parameter to NULL. This will also prevent any following filters from - * being called. - * - * @param obj The entry object - * @param func The function to use as text filter - * @param data User data to pass to @p func - * - * @ingroup Entry - */ -EAPI void elm_entry_markup_filter_append(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data); - -/** - * Prepend a markup filter function for text inserted in the entry - * - * Prepend the given callback to the list. See elm_entry_markup_filter_append() - * for more information - * - * @param obj The entry object - * @param func The function to use as text filter - * @param data User data to pass to @p func - * - * @ingroup Entry - */ -EAPI void elm_entry_markup_filter_prepend(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data); - -/** - * Remove a markup filter from the list - * - * Removes the given callback from the filter list. See - * elm_entry_markup_filter_append() for more information. - * - * @param obj The entry object - * @param func The filter function to remove - * @param data The user data passed when adding the function - * - * @ingroup Entry - */ -EAPI void elm_entry_markup_filter_remove(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data); - -/** - * This converts a markup (HTML-like) string into UTF-8. - * - * The returned string is a malloc'ed buffer and it should be freed when - * not needed anymore. - * - * @param s The string (in markup) to be converted - * @return The converted string (in UTF-8). It should be freed. - * - * @ingroup Entry - */ -EAPI char *elm_entry_markup_to_utf8(const char *s); - -/** - * This converts a UTF-8 string into markup (HTML-like). - * - * The returned string is a malloc'ed buffer and it should be freed when - * not needed anymore. - * - * @param s The string (in UTF-8) to be converted - * @return The converted string (in markup). It should be freed. - * - * @ingroup Entry - */ -EAPI char *elm_entry_utf8_to_markup(const char *s); - -/** - * This sets the file (and implicitly loads it) for the text to display and - * then edit. All changes are written back to the file after a short delay if - * the entry object is set to autosave (which is the default). - * - * If the entry had any other file set previously, any changes made to it - * will be saved if the autosave feature is enabled, otherwise, the file - * will be silently discarded and any non-saved changes will be lost. - * - * @param obj The entry object - * @param file The path to the file to load and save - * @param format The file format - * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format); - -/** - * Gets the file being edited by the entry. - * - * This function can be used to retrieve any file set on the entry for - * edition, along with the format used to load and save it. - * - * @param obj The entry object - * @param file The path to the file to load and save - * @param format The file format - * - * @ingroup Entry - */ -EAPI void elm_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format); - -/** - * This function writes any changes made to the file set with - * elm_entry_file_set() - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_file_save(Evas_Object *obj); - -/** - * This sets the entry object to 'autosave' the loaded text file or not. - * - * @param obj The entry object - * @param autosave Autosave the loaded file or not - * - * @see elm_entry_file_set() - * - * @ingroup Entry - */ -EAPI void elm_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave); - -/** - * This gets the entry object's 'autosave' status. - * - * @param obj The entry object - * @return Autosave the loaded file or not - * - * @see elm_entry_file_set() - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_autosave_get(const Evas_Object *obj); - -/** - * Enable or disable scrolling in entry - * - * Normally the entry is not scrollable unless you enable it with this call. - * - * @param obj The entry object - * @param scroll EINA_TRUE if it is to be scrollable, EINA_FALSE otherwise - * - * @ingroup Entry - */ -EAPI void elm_entry_scrollable_set(Evas_Object *obj, Eina_Bool scroll); - -/** - * Get the scrollable state of the entry - * - * Normally the entry is not scrollable. This gets the scrollable state - * of the entry. See elm_entry_scrollable_set() for more information. - * - * @param obj The entry object - * @return The scrollable state - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_scrollable_get(const Evas_Object *obj); - -/** - * Sets the visibility of the left-side widget of the entry, - * set by elm_object_part_content_set(). - * - * @param obj The entry object - * @param setting EINA_TRUE if the object should be displayed, - * EINA_FALSE if not. - * - * @ingroup Entry - */ -EAPI void elm_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting); - -/** - * Sets the visibility of the end widget of the entry, set by - * elm_object_part_content_set(ent, "end", content). - * - * @param obj The entry object - * @param setting EINA_TRUE if the object should be displayed, - * EINA_FALSE if not. - * - * @ingroup Entry - */ -EAPI void elm_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting); - -/** - * Set the input panel layout of the entry - * - * @param obj The entry object - * @param layout layout type - * - * @ingroup Entry - */ -EAPI void elm_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout); - -/** - * Get the input panel layout of the entry - * - * @param obj The entry object - * @return layout type - * - * @see elm_entry_input_panel_layout_set - * - * @ingroup Entry - */ -EAPI Elm_Input_Panel_Layout elm_entry_input_panel_layout_get(const Evas_Object *obj); - -/** - * Set the input panel layout variation of the entry - * - * @param obj The entry object - * @param variation layout variation type - * - * @ingroup Entry - * @since 1.8 - */ -EAPI void elm_entry_input_panel_layout_variation_set(Evas_Object *obj, int variation); - -/** - * Get the input panel layout variation of the entry - * - * @param obj The entry object - * @return layout variation type - * - * @see elm_entry_input_panel_layout_variation_set - * - * @ingroup Entry - * @since 1.8 - */ -EAPI int elm_entry_input_panel_layout_variation_get(const Evas_Object *obj); - - -/** - * Set the autocapitalization type on the immodule. - * - * @param obj The entry object - * @param autocapital_type The type of autocapitalization - * - * @ingroup Entry - */ -EAPI void elm_entry_autocapital_type_set(Evas_Object *obj, Elm_Autocapital_Type autocapital_type); - -/** - * Retrieve the autocapitalization type on the immodule. - * - * @param obj The entry object - * @return autocapitalization type - * - * @ingroup Entry - */ -EAPI Elm_Autocapital_Type elm_entry_autocapital_type_get(const Evas_Object *obj); - -/** - * Sets the attribute to show the input panel automatically. - * - * @param obj The entry object - * @param enabled If true, the input panel is appeared when entry is clicked or has a focus - * - * @ingroup Entry - */ -EAPI void elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled); - -/** - * Retrieve the attribute to show the input panel automatically. - * - * @param obj The entry object - * @return EINA_TRUE if input panel will be appeared when the entry is clicked or has a focus, EINA_FALSE otherwise - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_input_panel_enabled_get(const Evas_Object *obj); - -/** - * Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types, and so on. - * - * Note that input panel is shown or hidden automatically according to the focus state of entry widget. - * This API can be used in the case of manually controlling by using elm_entry_input_panel_enabled_set(en, EINA_FALSE). - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_input_panel_show(Evas_Object *obj); - -/** - * Hide the input panel (virtual keyboard). - * - * Note that input panel is shown or hidden automatically according to the focus state of entry widget. - * This API can be used in the case of manually controlling by using elm_entry_input_panel_enabled_set(en, EINA_FALSE) - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_input_panel_hide(Evas_Object *obj); - -/** - * Set the language mode of the input panel. - * - * This API can be used if you want to show the alphabet keyboard mode. - * - * @param obj The entry object - * @param lang language to be set to the input panel. - * - * @ingroup Entry - */ -EAPI void elm_entry_input_panel_language_set(Evas_Object *obj, Elm_Input_Panel_Lang lang); - -/** - * Get the language mode of the input panel. - * - * See @ref elm_entry_input_panel_language_set for more details. - * - * @param obj The entry object - * @return input panel language type - * - * @ingroup Entry - */ -EAPI Elm_Input_Panel_Lang elm_entry_input_panel_language_get(const Evas_Object *obj); - -/** - * Set the input panel-specific data to deliver to the input panel. - * - * This API is used by applications to deliver specific data to the input panel. - * The data format MUST be negotiated by both application and the input panel. - * The size and format of data are defined by the input panel. - * - * @param obj The entry object - * @param data The specific data to be set to the input panel. - * @param len the length of data, in bytes, to send to the input panel - * - * @ingroup Entry - */ -EAPI void elm_entry_input_panel_imdata_set(Evas_Object *obj, const void *data, int len); - -/** - * Get the specific data of the current input panel. - * - * See @ref elm_entry_input_panel_imdata_set for more details. - * - * @param obj The entry object - * @param data The specific data to be got from the input panel - * @param len The length of data - * - * @ingroup Entry - */ -EAPI void elm_entry_input_panel_imdata_get(const Evas_Object *obj, void *data, int *len); - -/** - * Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel. - * - * An input panel displays the string or icon associated with this type - * - * @param obj The entry object - * @param return_key_type The type of "return" key on the input panel - * - * @ingroup Entry - */ -EAPI void elm_entry_input_panel_return_key_type_set(Evas_Object *obj, Elm_Input_Panel_Return_Key_Type return_key_type); - -/** - * Get the "return" key type. - * - * @see elm_entry_input_panel_return_key_type_set() for more details - * - * @param obj The entry object - * @return The type of "return" key on the input panel - * - * @ingroup Entry - */ -EAPI Elm_Input_Panel_Return_Key_Type elm_entry_input_panel_return_key_type_get(const Evas_Object *obj); - -/** - * Set the return key on the input panel to be disabled. - * - * @param obj The entry object - * @param disabled The state to put in in: @c EINA_TRUE for - * disabled, @c EINA_FALSE for enabled - * - * @ingroup Entry - */ -EAPI void elm_entry_input_panel_return_key_disabled_set(Evas_Object *obj, Eina_Bool disabled); - -/** - * Get whether the return key on the input panel should be disabled or not. - * - * @param obj The entry object - * @return EINA_TRUE if it should be disabled - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_input_panel_return_key_disabled_get(const Evas_Object *obj); - -/** - * Set whether the return key on the input panel is disabled automatically when entry has no text. - * - * If @p enabled is EINA_TRUE, The return key on input panel is disabled when the entry has no text. - * The return key on the input panel is automatically enabled when the entry has text. - * The default value is EINA_FALSE. - * - * @param obj The entry object - * @param enabled If @p enabled is EINA_TRUE, the return key is automatically disabled when the entry has no text. - * - * @ingroup Entry - */ -EAPI void elm_entry_input_panel_return_key_autoenabled_set(Evas_Object *obj, Eina_Bool enabled); - -/** - * Reset the input method context of the entry if needed. - * - * This can be necessary in the case where modifying the buffer would confuse on-going input method behavior. - * This will typically cause the Input Method Context to clear the preedit state. - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_imf_context_reset(Evas_Object *obj); - -/** - * Set whether the entry should allow to use the text prediction. - * - * @param obj The entry object - * @param prediction Whether the entry should allow to use the text prediction. - * - * @ingroup Entry - */ -EAPI void elm_entry_prediction_allow_set(Evas_Object *obj, Eina_Bool prediction); - -/** - * Get whether the entry should allow to use the text prediction. - * - * @param obj The entry object - * @return EINA_TRUE if it allows to use the text prediction, otherwise EINA_FALSE. - * - * @ingroup Entry - */ -EAPI Eina_Bool elm_entry_prediction_allow_get(const Evas_Object *obj); - -/* pre-made filters for entries */ - -/** - * @typedef Elm_Entry_Filter_Limit_Size - * - * Data for the elm_entry_filter_limit_size() entry filter. - */ -typedef struct _Elm_Entry_Filter_Limit_Size Elm_Entry_Filter_Limit_Size; - -/** - * @struct _Elm_Entry_Filter_Limit_Size - * - * Data for the elm_entry_filter_limit_size() entry filter. - */ -struct _Elm_Entry_Filter_Limit_Size -{ - int max_char_count; /**< The maximum number of characters allowed. */ - int max_byte_count; /**< The maximum number of bytes allowed*/ -}; - -/** - * Filter inserted text based on user defined character and byte limits - * - * Add this filter to an entry to limit the characters that it will accept - * based the contents of the provided #Elm_Entry_Filter_Limit_Size. - * The function works on the UTF-8 representation of the string, converting - * it from the set markup, thus not accounting for any format in it. - * - * The user must create an #Elm_Entry_Filter_Limit_Size structure and pass - * it as data when setting the filter. In it, it's possible to set limits - * by character count or bytes (any of them is disabled if 0), and both can - * be set at the same time. In that case, it first checks for characters, - * then bytes. The #Elm_Entry_Filter_Limit_Size structure must be alive and - * valid for as long as the entry is alive AND the elm_entry_filter_limit_size - * filter is set. - * - * The function will cut the inserted text in order to allow only the first - * number of characters that are still allowed. The cut is made in - * characters, even when limiting by bytes, in order to always contain - * valid ones and avoid half unicode characters making it in. - * - * This filter, like any others, does not apply when setting the entry text - * directly with elm_object_text_set(). - * - * @ingroup Entry - */ -EAPI void elm_entry_filter_limit_size(void *data, Evas_Object *entry, char **text); - -/** - * @typedef Elm_Entry_Filter_Accept_Set - * - * Data for the elm_entry_filter_accept_set() entry filter. - */ -typedef struct _Elm_Entry_Filter_Accept_Set Elm_Entry_Filter_Accept_Set; - -/** - * @struct _Elm_Entry_Filter_Accept_Set - * - * Data for the elm_entry_filter_accept_set() entry filter. - */ -struct _Elm_Entry_Filter_Accept_Set -{ - const char *accepted; /**< Set of characters accepted in the entry. */ - const char *rejected; /**< Set of characters rejected from the entry. */ -}; - -/** - * Filter inserted text based on accepted or rejected sets of characters - * - * Add this filter to an entry to restrict the set of accepted characters - * based on the sets in the provided #Elm_Entry_Filter_Accept_Set. - * This structure contains both accepted and rejected sets, but they are - * mutually exclusive. This structure must be available for as long as - * the entry is alive AND the elm_entry_filter_accept_set is being used. - * - * The @c accepted set takes preference, so if it is set, the filter will - * only work based on the accepted characters, ignoring anything in the - * @c rejected value. If @c accepted is @c NULL, then @c rejected is used. - * - * In both cases, the function filters by matching utf8 characters to the - * raw markup text, so it can be used to remove formatting tags. - * - * This filter, like any others, does not apply when setting the entry text - * directly with elm_object_text_set() - * - * @ingroup Entry - */ -EAPI void elm_entry_filter_accept_set(void *data, Evas_Object *entry, char **text); - -/** - * Returns the input method context of the entry. - * - * This function exposes the internal input method context. - * - * IMPORTANT: Many functions may change (i.e delete and create a new one) - * the internal input method context. Do NOT cache the returned object. - * - * @param obj The entry object - * @return The input method context (Ecore_IMF_Context *) in entry. - * - * @ingroup Entry - */ -EAPI void *elm_entry_imf_context_get(Evas_Object *obj); - -/** - * @typedef Elm_Cnp_Mode - * Enum of entry's copy & paste policy. - * - * @see elm_entry_cnp_mode_set() - * @see elm_entry_cnp_mode_get() - */ -typedef enum { - ELM_CNP_MODE_MARKUP, /**< copy & paste text with markup tag */ - ELM_CNP_MODE_NO_IMAGE, /**< copy & paste text without item(image) tag */ - ELM_CNP_MODE_PLAINTEXT /**< copy & paste text without markup tag */ -} Elm_Cnp_Mode; - -/** - * Control pasting of text and images for the widget. - * - * Normally the entry allows both text and images to be pasted. - * By setting cnp_mode to be #ELM_CNP_MODE_NO_IMAGE, this prevents images from being copy or past. - * By setting cnp_mode to be #ELM_CNP_MODE_PLAINTEXT, this remove all tags in text . - * - * @note this only changes the behaviour of text. - * - * @param obj The entry object - * @param cnp_mode One of #Elm_Cnp_Mode: #ELM_CNP_MODE_MARKUP, #ELM_CNP_MODE_NO_IMAGE, #ELM_CNP_MODE_PLAINTEXT. - * - * @ingroup Entry - */ -EAPI void elm_entry_cnp_mode_set(Evas_Object *obj, Elm_Cnp_Mode cnp_mode); - -/** - * Getting elm_entry text paste/drop mode. - * - * Normally the entry allows both text and images to be pasted. - * This gets the copy & paste mode of the entry. - * - * @param obj The entry object - * @return mode One of #Elm_Cnp_Mode: #ELM_CNP_MODE_MARKUP, #ELM_CNP_MODE_NO_IMAGE, #ELM_CNP_MODE_PLAINTEXT. - * - * @ingroup Entry - */ -EAPI Elm_Cnp_Mode elm_entry_cnp_mode_get(const Evas_Object *obj); - -/** - * Set the parent of the hover popup - * - * Sets the parent object to use by the hover created by the entry - * when an anchor is clicked. See @ref Hover for more details on this. - * - * @param obj The entry object - * @param parent The object to use as parent for the hover - * - * @ingroup Entry - */ -EAPI void elm_entry_anchor_hover_parent_set(Evas_Object *obj, Evas_Object *parent); - -/** - * Get the parent of the hover popup - * - * Get the object used as parent for the hover created by the entry - * widget. See @ref Hover for more details on this. - * If no parent is set, the same entry object will be used. - * - * @param obj The entry object - * @return The object used as parent for the hover, NULL if none is set. - * - * @ingroup Entry - */ -EAPI Evas_Object *elm_entry_anchor_hover_parent_get(const Evas_Object *obj); - -/** - * Set the style that the hover should use - * - * When creating the popup hover, entry will request that it's - * themed according to @p style. - * - * Setting style no @c NULL means disabling automatic hover. - * - * @param obj The entry object - * @param style The style to use for the underlying hover - * - * @see elm_object_style_set() - * - * @ingroup Entry - */ -EAPI void elm_entry_anchor_hover_style_set(Evas_Object *obj, const char *style); - -/** - * Get the style that the hover should use - * - * Get the style, the hover created by entry will use. - * - * @param obj The entry object - * @return The style to use by the hover. @c NULL means the default is used. - * - * @see elm_object_style_set() - * - * @ingroup Entry - */ -EAPI const char *elm_entry_anchor_hover_style_get(const Evas_Object *obj); - -/** - * Ends the hover popup in the entry - * - * When an anchor is clicked, the entry widget will create a hover - * object to use as a popup with user provided content. This function - * terminates this popup, returning the entry to its normal state. - * - * @param obj The entry object - * - * @ingroup Entry - */ -EAPI void elm_entry_anchor_hover_end(Evas_Object *obj); - -/** - * Get the text of the contextual menu item. - * - * Gets the text of the contextual menu item of entry. - * - * @param item The item to get the label - * @return The text of contextual menu item - * - * @see elm_entry_context_menu_item_add() - * @ingroup Entry - * @since 1.8 - */ -EAPI const char *elm_entry_context_menu_item_label_get(const Elm_Entry_Context_Menu_Item *item); - -/** - * Get the icon object of the contextual menu item. - * - * Gets the icon object packed in the contextual menu item of entry. - * - * @param item The item to get the icon from - * @param icon_file The image file path on disk used for the icon or standard - * icon name - * @param icon_group The edje group used if @p icon_file is an edje file. NULL - * if the icon is not an edje file - * @param icon_type The icon type - * - * @see elm_entry_context_menu_item_add() - * @ingroup Entry - * @since 1.8 - */ -EAPI void elm_entry_context_menu_item_icon_get(const Elm_Entry_Context_Menu_Item *item, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type); - -#define ELM_OBJ_ENTRY_CLASS elm_obj_entry_class_get() - -const Eo_Class *elm_obj_entry_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_ENTRY_BASE_ID; - -enum -{ - ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PUSH, - ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_POP, - ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PEEK, - ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_SET, - ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_GET, - ELM_OBJ_ENTRY_SUB_ID_PASSWORD_SET, - ELM_OBJ_ENTRY_SUB_ID_PASSWORD_GET, - ELM_OBJ_ENTRY_SUB_ID_ENTRY_APPEND, - ELM_OBJ_ENTRY_SUB_ID_IS_EMPTY, - ELM_OBJ_ENTRY_SUB_ID_TEXTBLOCK_GET, - ELM_OBJ_ENTRY_SUB_ID_CALC_FORCE, - ELM_OBJ_ENTRY_SUB_ID_SELECTION_GET, - ELM_OBJ_ENTRY_SUB_ID_ENTRY_INSERT, - ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_SET, - ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_GET, - ELM_OBJ_ENTRY_SUB_ID_EDITABLE_SET, - ELM_OBJ_ENTRY_SUB_ID_EDITABLE_GET, - ELM_OBJ_ENTRY_SUB_ID_SELECT_NONE, - ELM_OBJ_ENTRY_SUB_ID_SELECT_ALL, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_GEOMETRY_GET, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_NEXT, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_PREV, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_UP, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_DOWN, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_BEGIN_SET, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_END_SET, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_BEGIN_SET, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_END_SET, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_BEGIN, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_END, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_FORMAT_GET, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_VISIBLE_FORMAT_GET, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_CONTENT_GET, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_SET, - ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_GET, - ELM_OBJ_ENTRY_SUB_ID_SELECTION_CUT, - ELM_OBJ_ENTRY_SUB_ID_SELECTION_COPY, - ELM_OBJ_ENTRY_SUB_ID_SELECTION_PASTE, - ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_CLEAR, - ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_ITEM_ADD, - ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_SET, - ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_GET, - ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_APPEND, - ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_PREPEND, - ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_REMOVE, - ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_APPEND, - ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_PREPEND, - ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_REMOVE, - ELM_OBJ_ENTRY_SUB_ID_FILE_SET, - ELM_OBJ_ENTRY_SUB_ID_FILE_GET, - ELM_OBJ_ENTRY_SUB_ID_FILE_SAVE, - ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_SET, - ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_GET, - ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_SET, - ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_GET, - ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_SET, - ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_GET, - ELM_OBJ_ENTRY_SUB_ID_ICON_VISIBLE_SET, - ELM_OBJ_ENTRY_SUB_ID_END_VISIBLE_SET, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_SET, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_GET, - ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_SET, - ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_GET, - ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_SET, - ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_GET, - ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_RESET, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_SET, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_GET, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_SHOW, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_HIDE, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_SET, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_GET, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_SET, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_GET, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_SET, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_GET, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_SET, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_GET, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_AUTOENABLED_SET, - ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_GET, - ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_SET, - ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_GET, - ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_SET, - ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_GET, - ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_END, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_SET, - ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_GET, - ELM_OBJ_ENTRY_SUB_ID_LAST -}; - -#define ELM_OBJ_ENTRY_ID(sub_id) (ELM_OBJ_ENTRY_BASE_ID + sub_id) - - -/** - * @def elm_obj_entry_text_style_user_push - * @since 1.8 - * - * Push the style to the top of user style stack. - * - * @param[in] style - * - * @see elm_entry_text_style_user_push - */ -#define elm_obj_entry_text_style_user_push(style) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PUSH), EO_TYPECHECK(const char *, style) - -/** - * @def elm_obj_entry_text_style_user_pop - * @since 1.8 - * - * Remove the style in the top of user style stack. - * - * - * @see elm_entry_text_style_user_pop - */ -#define elm_obj_entry_text_style_user_pop() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_POP) - -/** - * @def elm_obj_entry_text_style_user_peek - * @since 1.8 - * - * Retrieve the style on the top of user style stack. - * - * @param[out] ret - * - * @see elm_entry_text_style_user_peek - */ -#define elm_obj_entry_text_style_user_peek(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PEEK), EO_TYPECHECK(const char **, ret) - -/** - * @def elm_obj_entry_single_line_set - * @since 1.8 - * - * Sets the entry to single line mode. - * - * @param[in] single_line - * - * @see elm_entry_single_line_set - */ -#define elm_obj_entry_single_line_set(single_line) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_SET), EO_TYPECHECK(Eina_Bool, single_line) - -/** - * @def elm_obj_entry_single_line_get - * @since 1.8 - * - * Gets whether the entry is set to be single line. - * - * @param[out] ret - * - * @see elm_entry_single_line_get - */ -#define elm_obj_entry_single_line_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_password_set - * @since 1.8 - * - * Sets the entry to password mode. - * - * @param[in] password - * - * @see elm_entry_password_set - */ -#define elm_obj_entry_password_set(password) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PASSWORD_SET), EO_TYPECHECK(Eina_Bool, password) - -/** - * @def elm_obj_entry_password_get - * @since 1.8 - * - * Gets whether the entry is set to password mode. - * - * @param[out] ret - * - * @see elm_entry_password_get - */ -#define elm_obj_entry_password_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PASSWORD_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_entry_append - * @since 1.8 - * - * Appends entry to the text of the entry. - * - * @param[in] entry - * - * @see elm_entry_entry_append - */ -#define elm_obj_entry_entry_append(entry) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ENTRY_APPEND), EO_TYPECHECK(const char *, entry) - -/** - * @def elm_obj_entry_is_empty - * @since 1.8 - * - * Gets whether the entry is empty. - * - * @param[out] ret - * - * @see elm_entry_is_empty - */ -#define elm_obj_entry_is_empty(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_IS_EMPTY), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_textblock_get - * @since 1.8 - * - * Returns the actual textblock object of the entry. - * - * @param[out] ret - * - * @see elm_entry_textblock_get - */ -#define elm_obj_entry_textblock_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXTBLOCK_GET), EO_TYPECHECK(Evas_Object **, ret) - -/** - * @def elm_obj_entry_calc_force - * @since 1.8 - * - * Forces calculation of the entry size and text layouting. - * - * - * @see elm_entry_calc_force - */ -#define elm_obj_entry_calc_force() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CALC_FORCE) - -/** - * @def elm_obj_entry_selection_get - * @since 1.8 - * - * Gets any selected text within the entry. - * - * @param[out] ret - * - * @see elm_entry_selection_get - */ -#define elm_obj_entry_selection_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_GET), EO_TYPECHECK(const char **, ret) - -/** - * @def elm_obj_entry_entry_insert - * @since 1.8 - * - * Inserts the given text into the entry at the current cursor position. - * - * @param[in] entry - * - * @see elm_entry_entry_insert - */ -#define elm_obj_entry_entry_insert(entry) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ENTRY_INSERT), EO_TYPECHECK(const char *, entry) - -/** - * @def elm_obj_entry_line_wrap_set - * @since 1.8 - * - * Set the line wrap type to use on multi-line entries. - * - * @param[in] wrap - * - * @see elm_entry_line_wrap_set - */ -#define elm_obj_entry_line_wrap_set(wrap) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_SET), EO_TYPECHECK(Elm_Wrap_Type, wrap) - -/** - * @def elm_obj_entry_line_wrap_get - * @since 1.8 - * - * Gets the wrap mode the entry was set to use. - * - * @param[out] ret - * - * @see elm_entry_line_wrap_get - */ -#define elm_obj_entry_line_wrap_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_GET), EO_TYPECHECK(Elm_Wrap_Type *, ret) - -/** - * @def elm_obj_entry_editable_set - * @since 1.8 - * - * Sets if the entry is to be editable or not. - * - * @param[in] editable - * - * @see elm_entry_editable_set - */ -#define elm_obj_entry_editable_set(editable) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_EDITABLE_SET), EO_TYPECHECK(Eina_Bool, editable) - -/** - * @def elm_obj_entry_editable_get - * @since 1.8 - * - * Gets whether the entry is editable or not. - * - * @param[out] ret - * - * @see elm_entry_editable_get - */ -#define elm_obj_entry_editable_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_EDITABLE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_select_none - * @since 1.8 - * - * This drops any existing text selection within the entry. - * - * - * @see elm_entry_select_none - */ -#define elm_obj_entry_select_none() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECT_NONE) - -/** - * @def elm_obj_entry_select_all - * @since 1.8 - * - * This selects all text within the entry. - * - * - * @see elm_entry_select_all - */ -#define elm_obj_entry_select_all() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECT_ALL) - -/** - * @def elm_obj_entry_cursor_geometry_get - * @since 1.8 - * - * This function returns the geometry of the cursor. - * - * @param[out] x - * @param[out] y - * @param[out] w - * @param[out] h - * @param[out] ret - * - * @see elm_entry_cursor_geometry_get - */ -#define elm_obj_entry_cursor_geometry_get(x, y, w, h, ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_GEOMETRY_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_cursor_next - * @since 1.8 - * - * This moves the cursor one place to the right within the entry. - * - * @param[out] ret - * - * @see elm_entry_cursor_next - */ -#define elm_obj_entry_cursor_next(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_NEXT), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_cursor_prev - * @since 1.8 - * - * This moves the cursor one place to the left within the entry. - * - * @param[out] ret - * - * @see elm_entry_cursor_prev - */ -#define elm_obj_entry_cursor_prev(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_PREV), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_cursor_up - * @since 1.8 - * - * This moves the cursor one line up within the entry. - * - * @param[out] ret - * - * @see elm_entry_cursor_up - */ -#define elm_obj_entry_cursor_up(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_UP), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_cursor_down - * @since 1.8 - * - * This moves the cursor one line down within the entry. - * - * @param[out] ret - * - * @see elm_entry_cursor_down - */ -#define elm_obj_entry_cursor_down(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_DOWN), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_cursor_begin_set - * @since 1.8 - * - * This moves the cursor to the beginning of the entry. - * - * - * @see elm_entry_cursor_begin_set - */ -#define elm_obj_entry_cursor_begin_set() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_BEGIN_SET) - -/** - * @def elm_obj_entry_cursor_end_set - * @since 1.8 - * - * This moves the cursor to the end of the entry. - * - * - * @see elm_entry_cursor_end_set - */ -#define elm_obj_entry_cursor_end_set() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_END_SET) - -/** - * @def elm_obj_entry_cursor_line_begin_set - * @since 1.8 - * - * This moves the cursor to the beginning of the current line. - * - * - * @see elm_entry_cursor_line_begin_set - */ -#define elm_obj_entry_cursor_line_begin_set() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_BEGIN_SET) - -/** - * @def elm_obj_entry_cursor_line_end_set - * @since 1.8 - * - * This moves the cursor to the end of the current line. - * - * - * @see elm_entry_cursor_line_end_set - */ -#define elm_obj_entry_cursor_line_end_set() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_END_SET) - -/** - * @def elm_obj_entry_cursor_selection_begin - * @since 1.8 - * - * This begins a selection within the entry as though - * - * - * @see elm_entry_cursor_selection_begin - */ -#define elm_obj_entry_cursor_selection_begin() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_BEGIN) - -/** - * @def elm_obj_entry_cursor_selection_end - * @since 1.8 - * - * This ends a selection within the entry as though - * - * - * @see elm_entry_cursor_selection_end - */ -#define elm_obj_entry_cursor_selection_end() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_END) - -/** - * @def elm_obj_entry_cursor_is_format_get - * @since 1.8 - * - * Gets whether a format node exists at the current cursor position. - * - * @param[out] ret - * - * @see elm_entry_cursor_is_format_get - */ -#define elm_obj_entry_cursor_is_format_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_FORMAT_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_cursor_is_visible_format_get - * @since 1.8 - * - * Gets if the current cursor position holds a visible format node. - * - * @param[out] ret - * - * @see elm_entry_cursor_is_visible_format_get - */ -#define elm_obj_entry_cursor_is_visible_format_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_VISIBLE_FORMAT_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_cursor_content_get - * @since 1.8 - * - * Gets the character pointed by the cursor at its current position. - * - * @param[out] ret - * - * @see elm_entry_cursor_content_get - */ -#define elm_obj_entry_cursor_content_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_CONTENT_GET), EO_TYPECHECK(char **, ret) - -/** - * @def elm_obj_entry_cursor_pos_set - * @since 1.8 - * - * Sets the cursor position in the entry to the given value - * - * @param[in] pos - * - * @see elm_entry_cursor_pos_set - */ -#define elm_obj_entry_cursor_pos_set(pos) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_SET), EO_TYPECHECK(int, pos) - -/** - * @def elm_obj_entry_cursor_pos_get - * @since 1.8 - * - * Retrieves the current position of the cursor in the entry - * - * @param[out] ret - * - * @see elm_entry_cursor_pos_get - */ -#define elm_obj_entry_cursor_pos_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_GET), EO_TYPECHECK(int *, ret) - -/** - * @def elm_obj_entry_selection_cut - * @since 1.8 - * - * This executes a "cut" action on the selected text in the entry. - * - * - * @see elm_entry_selection_cut - */ -#define elm_obj_entry_selection_cut() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_CUT) - -/** - * @def elm_obj_entry_selection_copy - * @since 1.8 - * - * This executes a "copy" action on the selected text in the entry. - * - * - * @see elm_entry_selection_copy - */ -#define elm_obj_entry_selection_copy() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_COPY) - -/** - * @def elm_obj_entry_selection_paste - * @since 1.8 - * - * This executes a "paste" action in the entry. - * - * - * @see elm_entry_selection_paste - */ -#define elm_obj_entry_selection_paste() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_PASTE) - -/** - * @def elm_obj_entry_context_menu_clear - * @since 1.8 - * - * This clears and frees the items in a entry's contextual (longpress) - * - * - * @see elm_entry_context_menu_clear - */ -#define elm_obj_entry_context_menu_clear() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_CLEAR) - -/** - * @def elm_obj_entry_context_menu_item_add - * @since 1.8 - * - * This adds an item to the entry's contextual menu. - * - * @param[in] label - * @param[in] icon_file - * @param[in] icon_type - * @param[in] func - * @param[in] data - * - * @see elm_entry_context_menu_item_add - */ -#define elm_obj_entry_context_menu_item_add(label, icon_file, icon_type, func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_ITEM_ADD), EO_TYPECHECK(const char *, label), EO_TYPECHECK(const char *, icon_file), EO_TYPECHECK(Elm_Icon_Type, icon_type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data) - -/** - * @def elm_obj_entry_context_menu_disabled_set - * @since 1.8 - * - * This disables the entry's contextual (longpress) menu. - * - * @param[in] disabled - * - * @see elm_entry_context_menu_disabled_set - */ -#define elm_obj_entry_context_menu_disabled_set(disabled) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled) - -/** - * @def elm_obj_entry_context_menu_disabled_get - * @since 1.8 - * - * This returns whether the entry's contextual (longpress) menu is - * disabled. - * - * @param[out] ret - * - * @see elm_entry_context_menu_disabled_get - */ -#define elm_obj_entry_context_menu_disabled_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_item_provider_append - * @since 1.8 - * - * This appends a custom item provider to the list for that entry - * - * @param[in] func - * @param[in] data - * - * @see elm_entry_item_provider_append - */ -#define elm_obj_entry_item_provider_append(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_APPEND), EO_TYPECHECK(Elm_Entry_Item_Provider_Cb, func), EO_TYPECHECK(void *, data) - -/** - * @def elm_obj_entry_item_provider_prepend - * @since 1.8 - * - * This prepends a custom item provider to the list for that entry - * - * @param[in] func - * @param[in] data - * - * @see elm_entry_item_provider_prepend - */ -#define elm_obj_entry_item_provider_prepend(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_PREPEND), EO_TYPECHECK(Elm_Entry_Item_Provider_Cb, func), EO_TYPECHECK(void *, data) - -/** - * @def elm_obj_entry_item_provider_remove - * @since 1.8 - * - * This removes a custom item provider to the list for that entry - * - * @param[in] func - * @param[in] data - * - * @see elm_entry_item_provider_remove - */ -#define elm_obj_entry_item_provider_remove(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_REMOVE), EO_TYPECHECK(Elm_Entry_Item_Provider_Cb, func), EO_TYPECHECK(void *, data) - -/** - * @def elm_obj_entry_markup_filter_append - * @since 1.8 - * - * Append a markup filter function for text inserted in the entry - * - * @param[in] func - * @param[in] data - * - * @see elm_entry_markup_filter_append - */ -#define elm_obj_entry_markup_filter_append(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_APPEND), EO_TYPECHECK(Elm_Entry_Filter_Cb, func), EO_TYPECHECK(void *, data) - -/** - * @def elm_obj_entry_markup_filter_prepend - * @since 1.8 - * - * Prepend a markup filter function for text inserted in the entry - * - * @param[in] func - * @param[in] data - * - * @see elm_entry_markup_filter_prepend - */ -#define elm_obj_entry_markup_filter_prepend(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_PREPEND), EO_TYPECHECK(Elm_Entry_Filter_Cb, func), EO_TYPECHECK(void *, data) - -/** - * @def elm_obj_entry_markup_filter_remove - * @since 1.8 - * - * Remove a markup filter from the list - * - * @param[in] func - * @param[in] data - * - * @see elm_entry_markup_filter_remove - */ -#define elm_obj_entry_markup_filter_remove(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_REMOVE), EO_TYPECHECK(Elm_Entry_Filter_Cb, func), EO_TYPECHECK(void *, data) - -/** - * @def elm_obj_entry_file_set - * @since 1.8 - * - * This sets the file (and implicitly loads it) for the text to display and - * then edit. All changes are written back to the file after a short delay if - * the entry object is set to autosave (which is the default). - * - * @param[in] file - * @param[in] format - * @param[out] ret - * - * @see elm_entry_file_set - */ -#define elm_obj_entry_file_set(file, format, ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_FILE_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(Elm_Text_Format, format), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_file_get - * @since 1.8 - * - * Gets the file being edited by the entry. - * - * @param[out] file - * @param[out] format - * - * @see elm_entry_file_get - */ -#define elm_obj_entry_file_get(file, format) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_FILE_GET), EO_TYPECHECK(const char **, file), EO_TYPECHECK(Elm_Text_Format *, format) - -/** - * @def elm_obj_entry_file_save - * @since 1.8 - * - * This function writes any changes made to the file set with - * elm_entry_file_set() - * - * - * @see elm_entry_file_save - */ -#define elm_obj_entry_file_save() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_FILE_SAVE) - -/** - * @def elm_obj_entry_autosave_set - * @since 1.8 - * - * This sets the entry object to 'autosave' the loaded text file or not. - * - * @param[in] auto_save - * - * @see elm_entry_autosave_set - */ -#define elm_obj_entry_autosave_set(auto_save) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_SET), EO_TYPECHECK(Eina_Bool, auto_save) - -/** - * @def elm_obj_entry_autosave_get - * @since 1.8 - * - * This gets the entry object's 'autosave' status. - * - * @param[out] ret - * - * @see elm_entry_autosave_get - */ -#define elm_obj_entry_autosave_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_cnp_mode_set - * @since 1.8 - * - * Control pasting of text and images for the widget. - * - * @param[in] cnp_mode - * - * @see elm_entry_cnp_mode_set - */ -#define elm_obj_entry_cnp_mode_set(cnp_mode) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_SET), EO_TYPECHECK(Elm_Cnp_Mode, cnp_mode) - -/** - * @def elm_obj_entry_cnp_mode_get - * @since 1.8 - * - * Getting elm_entry text paste/drop mode. - * - * @param[out] ret - * - * @see elm_entry_cnp_mode_get - */ -#define elm_obj_entry_cnp_mode_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_GET), EO_TYPECHECK(Elm_Cnp_Mode *, ret) - -/** - * @def elm_obj_entry_scrollable_set - * @since 1.8 - * - * Enable or disable scrolling in entry - * - * @param[in] scroll - * - * @see elm_entry_scrollable_set - */ -#define elm_obj_entry_scrollable_set(scroll) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_SET), EO_TYPECHECK(Eina_Bool, scroll) - -/** - * @def elm_obj_entry_scrollable_get - * @since 1.8 - * - * Get the scrollable state of the entry - * - * @param[out] ret - * - * @see elm_entry_scrollable_get - */ -#define elm_obj_entry_scrollable_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_icon_visible_set - * @since 1.8 - * - * Sets the visibility of the left-side widget of the entry, - * set by elm_object_part_content_set(). - * - * @param[in] setting - * - * @see elm_entry_icon_visible_set - */ -#define elm_obj_entry_icon_visible_set(setting) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ICON_VISIBLE_SET), EO_TYPECHECK(Eina_Bool, setting) - -/** - * @def elm_obj_entry_end_visible_set - * @since 1.8 - * - * Sets the visibility of the end widget of the entry, set by - * - * @param[in] setting - * - * @see elm_entry_end_visible_set - */ -#define elm_obj_entry_end_visible_set(setting) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_END_VISIBLE_SET), EO_TYPECHECK(Eina_Bool, setting) - -/** - * @def elm_obj_entry_input_panel_layout_set - * @since 1.8 - * - * Set the input panel layout of the entry - * - * @param[in] layout - * - * @see elm_entry_input_panel_layout_set - */ -#define elm_obj_entry_input_panel_layout_set(layout) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_SET), EO_TYPECHECK(Elm_Input_Panel_Layout, layout) - -/** - * @def elm_obj_entry_input_panel_layout_get - * @since 1.8 - * - * Get the input panel layout of the entry - * - * @param[out] ret - * - * @see elm_entry_input_panel_layout_get - */ -#define elm_obj_entry_input_panel_layout_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_GET), EO_TYPECHECK(Elm_Input_Panel_Layout *, ret) - -/** - * @def elm_obj_entry_input_panel_layout_variation_set - * @since 1.8 - * - * Set the input panel layout variation of the entry - * - * @param[in] layout variation - * - * @see elm_entry_input_panel_layout_variation_set - */ -#define elm_obj_entry_input_panel_layout_variation_set(variation) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_SET), EO_TYPECHECK(int, variation) - -/** - * @def elm_obj_entry_input_panel_layout_variation_get - * @since 1.8 - * - * Get the input panel layout variation of the entry - * - * @param[out] ret - * - * @see elm_entry_input_panel_layout_variation_get - */ -#define elm_obj_entry_input_panel_layout_variation_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_GET), EO_TYPECHECK(int *, ret) - -/** - * @def elm_obj_entry_autocapital_type_set - * @since 1.8 - * - * Set the autocapitalization type on the immodule. - * - * @param[in] autocapital_type - * - * @see elm_entry_autocapital_type_set - */ -#define elm_obj_entry_autocapital_type_set(autocapital_type) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_SET), EO_TYPECHECK(Elm_Autocapital_Type, autocapital_type) - -/** - * @def elm_obj_entry_autocapital_type_get - * @since 1.8 - * - * Retrieve the autocapitalization type on the immodule. - * - * @param[out] ret - * - * @see elm_entry_autocapital_type_get - */ -#define elm_obj_entry_autocapital_type_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_GET), EO_TYPECHECK(Elm_Autocapital_Type *, ret) - -/** - * @def elm_obj_entry_prediction_allow_set - * @since 1.8 - * - * Set whether the entry should allow to use the text prediction. - * - * @param[in] prediction - * - * @see elm_entry_prediction_allow_set - */ -#define elm_obj_entry_prediction_allow_set(prediction) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_SET), EO_TYPECHECK(Eina_Bool, prediction) - -/** - * @def elm_obj_entry_prediction_allow_get - * @since 1.8 - * - * Get whether the entry should allow to use the text prediction. - * - * @param[out] ret - * - * @see elm_entry_prediction_allow_get - */ -#define elm_obj_entry_prediction_allow_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_imf_context_reset - * @since 1.8 - * - * Reset the input method context of the entry if needed. - * - * - * @see elm_entry_imf_context_reset - */ -#define elm_obj_entry_imf_context_reset() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_RESET) - -/** - * @def elm_obj_entry_input_panel_enabled_set - * @since 1.8 - * - * Sets the attribute to show the input panel automatically. - * - * @param[in] enabled - * - * @see elm_entry_input_panel_enabled_set - */ -#define elm_obj_entry_input_panel_enabled_set(enabled) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled) - -/** - * @def elm_obj_entry_input_panel_enabled_get - * @since 1.8 - * - * Retrieve the attribute to show the input panel automatically. - * - * @param[out] ret - * - * @see elm_entry_input_panel_enabled_get - */ -#define elm_obj_entry_input_panel_enabled_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_input_panel_show - * @since 1.8 - * - * Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types, and so on. - * - * - * @see elm_entry_input_panel_show - */ -#define elm_obj_entry_input_panel_show() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_SHOW) - -/** - * @def elm_obj_entry_input_panel_hide - * @since 1.8 - * - * Hide the input panel (virtual keyboard). - * - * - * @see elm_entry_input_panel_hide - */ -#define elm_obj_entry_input_panel_hide() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_HIDE) - -/** - * @def elm_obj_entry_input_panel_language_set - * @since 1.8 - * - * Set the language mode of the input panel. - * - * @param[in] lang - * - * @see elm_entry_input_panel_language_set - */ -#define elm_obj_entry_input_panel_language_set(lang) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_SET), EO_TYPECHECK(Elm_Input_Panel_Lang, lang) - -/** - * @def elm_obj_entry_input_panel_language_get - * @since 1.8 - * - * Get the language mode of the input panel. - * - * @param[out] ret - * - * @see elm_entry_input_panel_language_get - */ -#define elm_obj_entry_input_panel_language_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_GET), EO_TYPECHECK(Elm_Input_Panel_Lang *, ret) - -/** - * @def elm_obj_entry_input_panel_imdata_set - * @since 1.8 - * - * Set the input panel-specific data to deliver to the input panel. - * - * @param[in] data - * @param[in] len - * - * @see elm_entry_input_panel_imdata_set - */ -#define elm_obj_entry_input_panel_imdata_set(data, len) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_SET), EO_TYPECHECK(const void *, data), EO_TYPECHECK(int, len) - -/** - * @def elm_obj_entry_input_panel_imdata_get - * @since 1.8 - * - * Get the specific data of the current input panel. - * - * @param[out] data - * @param[out] len - * - * @see elm_entry_input_panel_imdata_get - */ -#define elm_obj_entry_input_panel_imdata_get(data, len) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_GET), EO_TYPECHECK(void *, data), EO_TYPECHECK(int *, len) - -/** - * @def elm_obj_entry_input_panel_return_key_type_set - * @since 1.8 - * - * Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel. - * - * @param[in] return_key_type - * - * @see elm_entry_input_panel_return_key_type_set - */ -#define elm_obj_entry_input_panel_return_key_type_set(return_key_type) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_SET), EO_TYPECHECK(Elm_Input_Panel_Return_Key_Type, return_key_type) - -/** - * @def elm_obj_entry_input_panel_return_key_type_get - * @since 1.8 - * - * Get the "return" key type. - * - * @param[out] ret - * - * @see elm_entry_input_panel_return_key_type_get - */ -#define elm_obj_entry_input_panel_return_key_type_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_GET), EO_TYPECHECK(Elm_Input_Panel_Return_Key_Type *, ret) - -/** - * @def elm_obj_entry_input_panel_return_key_disabled_set - * @since 1.8 - * - * Set the return key on the input panel to be disabled. - * - * @param[in] disabled - * - * @see elm_entry_input_panel_return_key_disabled_set - */ -#define elm_obj_entry_input_panel_return_key_disabled_set(disabled) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled) - -/** - * @def elm_obj_entry_input_panel_return_key_disabled_get - * @since 1.8 - * - * Get whether the return key on the input panel should be disabled or not. - * - * @param[out] ret - * - * @see elm_entry_input_panel_return_key_disabled_get - */ -#define elm_obj_entry_input_panel_return_key_disabled_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_entry_input_panel_return_key_autoenabled_set - * @since 1.8 - * - * Set whether the return key on the input panel is disabled automatically when entry has no text. - * - * @param[in] enabled - * - * @see elm_entry_input_panel_return_key_autoenabled_set - */ -#define elm_obj_entry_input_panel_return_key_autoenabled_set(enabled) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_AUTOENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled) - -/** - * @def elm_obj_entry_imf_context_get - * @since 1.8 - * - * Returns the input method context of the entry. - * - * @param[out] ret - * - * @see elm_entry_imf_context_get - */ -#define elm_obj_entry_imf_context_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_GET), EO_TYPECHECK(void **, ret) - -/** - * @def elm_obj_entry_anchor_hover_parent_set - * @since 1.8 - * - * Set the parent of the hover popup - * - * @param[in] parent - * - * @see elm_entry_anchor_hover_parent_set - */ -#define elm_obj_entry_anchor_hover_parent_set(parent) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_SET), EO_TYPECHECK(Evas_Object *, parent) - -/** - * @def elm_obj_entry_anchor_hover_parent_get - * @since 1.8 - * - * Get the parent of the hover popup - * - * @param[out] ret - * - * @see elm_entry_anchor_hover_parent_get - */ -#define elm_obj_entry_anchor_hover_parent_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_GET), EO_TYPECHECK(Evas_Object **, ret) - -/** - * @def elm_obj_entry_anchor_hover_style_set - * @since 1.8 - * - * Set the style that the hover should use - * - * @param[in] style - * - * @see elm_entry_anchor_hover_style_set - */ -#define elm_obj_entry_anchor_hover_style_set(style) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_SET), EO_TYPECHECK(const char *, style) - -/** - * @def elm_obj_entry_anchor_hover_style_get - * @since 1.8 - * - * Get the style that the hover should use - * - * @param[out] ret - * - * @see elm_entry_anchor_hover_style_get - */ -#define elm_obj_entry_anchor_hover_style_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_GET), EO_TYPECHECK(const char **, ret) - -/** - * @def elm_obj_entry_anchor_hover_end - * @since 1.8 - * - * Ends the hover popup in the entry - * - * - * @see elm_entry_anchor_hover_end - */ -#define elm_obj_entry_anchor_hover_end() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_END) - +#include "elm_entry_common.h" +#ifdef EFL_EO_API_SUPPORT +#include "elm_entry_eo.h" +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include "elm_entry_legacy.h" +#endif /** * @} */ diff --git a/legacy/elementary/src/lib/elm_entry_common.h b/legacy/elementary/src/lib/elm_entry_common.h new file mode 100644 index 0000000000..b146000e29 --- /dev/null +++ b/legacy/elementary/src/lib/elm_entry_common.h @@ -0,0 +1,381 @@ +/** + * @typedef Elm_Text_Format + * + * Text Format types. + * + * @see elm_entry_file_set() + */ +typedef enum +{ + ELM_TEXT_FORMAT_PLAIN_UTF8, /**< Plain UTF8 type */ + ELM_TEXT_FORMAT_MARKUP_UTF8 /**< Markup UTF8 type */ +} Elm_Text_Format; + +/** + * @typedef Elm_Wrap_Type + * + * Line wrapping types. + * + * @see elm_entry_line_wrap_set() + */ +typedef enum +{ + ELM_WRAP_NONE = 0, /**< No wrap - value is zero */ + ELM_WRAP_CHAR, /**< Char wrap - wrap between characters */ + ELM_WRAP_WORD, /**< Word wrap - wrap in allowed wrapping points (as defined in the unicode standard) */ + ELM_WRAP_MIXED, /**< Mixed wrap - Word wrap, and if that fails, char wrap. */ + ELM_WRAP_LAST +} Elm_Wrap_Type; /**< Type of word or character wrapping to use */ + +/** + * @typedef Elm_Input_Panel_Layout + * + * Input panel (virtual keyboard) layout types. + * + * @see elm_entry_input_panel_layout_set() + */ +typedef enum +{ + ELM_INPUT_PANEL_LAYOUT_NORMAL, /**< Default layout */ + ELM_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */ + ELM_INPUT_PANEL_LAYOUT_EMAIL, /**< Email layout */ + ELM_INPUT_PANEL_LAYOUT_URL, /**< URL layout */ + ELM_INPUT_PANEL_LAYOUT_PHONENUMBER, /**< Phone Number layout */ + ELM_INPUT_PANEL_LAYOUT_IP, /**< IP layout */ + ELM_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */ + ELM_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */ + ELM_INPUT_PANEL_LAYOUT_INVALID, /**< Never use this */ + ELM_INPUT_PANEL_LAYOUT_HEX, /**< Hexadecimal layout */ + ELM_INPUT_PANEL_LAYOUT_TERMINAL, /**< Command-line terminal layout including esc, alt, ctrl key, so on (no auto-correct, no auto-capitalization) */ + ELM_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. */ +} Elm_Input_Panel_Layout; /**< Type of input panel (virtual keyboard) to use - this is a hint and may not provide exactly what is desired. */ + +enum +{ + ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL, + ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED, + ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_DECIMAL, + ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED_AND_DECIMAL +}; + +/** + * @typedef Elm_Input_Panel_Lang + * + * Input panel (virtual keyboard) language modes. + * + * @see elm_entry_input_panel_language_set() + */ +typedef enum +{ + ELM_INPUT_PANEL_LANG_AUTOMATIC, /**< Automatic */ + ELM_INPUT_PANEL_LANG_ALPHABET /**< Alphabet */ +} Elm_Input_Panel_Lang; + +/** + * @typedef Elm_Autocapital_Type + * + * Autocapitalization Types. + * + * @see elm_entry_autocapital_type_set() + */ +typedef enum +{ + ELM_AUTOCAPITAL_TYPE_NONE, /**< No auto-capitalization when typing */ + ELM_AUTOCAPITAL_TYPE_WORD, /**< Autocapitalize each word typed */ + ELM_AUTOCAPITAL_TYPE_SENTENCE, /**< Autocapitalize the start of each sentence */ + ELM_AUTOCAPITAL_TYPE_ALLCHARACTER, /**< Autocapitalize all letters */ +} Elm_Autocapital_Type; /**< Choose method of auto-capitalization */ + +/** + * @typedef Elm_Input_Panel_Return_Key_Type + * + * "Return" Key types on the input panel (virtual keyboard). + * + * @see elm_entry_input_panel_return_key_type_set() + */ +typedef enum +{ + ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT, /**< Default */ + ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE, /**< Done */ + ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO, /**< Go */ + ELM_INPUT_PANEL_RETURN_KEY_TYPE_JOIN, /**< Join */ + ELM_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN, /**< Login */ + ELM_INPUT_PANEL_RETURN_KEY_TYPE_NEXT, /**< Next */ + ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH, /**< Search string or magnifier icon */ + ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEND, /**< Send */ + ELM_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN /**< Sign-in @since 1.8 */ +} Elm_Input_Panel_Return_Key_Type; + +/** + * @typedef Elm_Entry_Anchor_Info + * + * The info sent in the callback for the "anchor,clicked" signals emitted + * by entries. + */ +typedef struct _Elm_Entry_Anchor_Info Elm_Entry_Anchor_Info; + +/** + * @struct _Elm_Entry_Anchor_Info + * + * The info sent in the callback for the "anchor,clicked" signals emitted + * by entries. + */ +struct _Elm_Entry_Anchor_Info +{ + const char *name; /**< The name of the anchor, as stated in its href */ + int button; /**< The mouse button used to click on it */ + Evas_Coord x, /**< Anchor geometry, relative to canvas */ + y, /**< Anchor geometry, relative to canvas */ + w, /**< Anchor geometry, relative to canvas */ + h; /**< Anchor geometry, relative to canvas */ +}; + +/** + * @typedef Elm_Entry_Anchor_Hover_Info + * + * The info sent in the callback for "anchor,clicked" signals emitted by + * the Anchor_Hover widget. + */ +typedef struct _Elm_Entry_Anchor_Hover_Info Elm_Entry_Anchor_Hover_Info; + +/** + * @typedef Elm_Entry_Context_Menu_Item + * + * Type of contextual item that can be added in to long press menu. + * @since 1.8 + */ +typedef struct _Elm_Entry_Context_Menu_Item Elm_Entry_Context_Menu_Item; + +/** + * @struct _Elm_Entry_Anchor_Hover_Info + * + * The info sent in the callback for "anchor,clicked" signals emitted by + * the Anchor_Hover widget. + */ +struct _Elm_Entry_Anchor_Hover_Info +{ + const Elm_Entry_Anchor_Info *anchor_info; /**< The actual anchor info. */ + Evas_Object *hover; /**< The hover object to use for the popup */ + struct + { + Evas_Coord x, y, w, h; + } hover_parent; /**< Geometry of the object used as parent by the + hover */ + Eina_Bool hover_left : 1; /**< Hint indicating if there's space + for content on the left side of + the hover. Before calling the + callback, the widget will make the + necessary calculations to check + which sides are fit to be set with + content, based on the position the + hover is activated and its distance + to the edges of its parent object + */ + Eina_Bool hover_right : 1; /**< Hint indicating content fits on + the right side of the hover. + See @ref hover_left */ + Eina_Bool hover_top : 1; /**< Hint indicating content fits on top + of the hover. See @ref hover_left */ + Eina_Bool hover_bottom : 1; /**< Hint indicating content fits + below the hover. See @ref + hover_left */ +}; + +/** + * @typedef Elm_Entry_Item_Provider_Cb + * This callback type is used to provide items. + * If it returns an object handle other than NULL (it should create an + * object to do this), then this object is used to replace the current item. + * If not the next provider is called until one provides an item object, or the + * default provider in entry does. + * @param data The data specified as the last param when adding the provider + * @param entry The entry object + * @param text A pointer to the item href string in the text + * @return The object to be placed in the entry like an icon, or other element + * @see elm_entry_item_provider_append + * @see elm_entry_item_provider_prepend + * @see elm_entry_item_provider_remove + */ +typedef Evas_Object * (*Elm_Entry_Item_Provider_Cb)(void *data, Evas_Object * entry, const char *item); + +/** + * @typedef Elm_Entry_Filter_Cb + * This callback type is used by entry filters to modify text. + * @param data The data specified as the last param when adding the filter + * @param entry The entry object + * @param text A pointer to the location of the text being filtered. The type of text is always markup. This data can be modified, but any additional allocations must be managed by the user. + * @see elm_entry_markup_filter_append + * @see elm_entry_markup_filter_prepend + * @see elm_entry_markup_filter_remove + */ +typedef void (*Elm_Entry_Filter_Cb)(void *data, Evas_Object *entry, char **text); + +/** + * @typedef Elm_Entry_Change_Info + * This corresponds to Edje_Entry_Change_Info. Includes information about + * a change in the entry. + */ +typedef Edje_Entry_Change_Info Elm_Entry_Change_Info; + +/** + * This converts a markup (HTML-like) string into UTF-8. + * + * The returned string is a malloc'ed buffer and it should be freed when + * not needed anymore. + * + * @param s The string (in markup) to be converted + * @return The converted string (in UTF-8). It should be freed. + * + * @ingroup Entry + */ +EAPI char *elm_entry_markup_to_utf8(const char *s); + +/** + * This converts a UTF-8 string into markup (HTML-like). + * + * The returned string is a malloc'ed buffer and it should be freed when + * not needed anymore. + * + * @param s The string (in UTF-8) to be converted + * @return The converted string (in markup). It should be freed. + * + * @ingroup Entry + */ +EAPI char *elm_entry_utf8_to_markup(const char *s); + + + +/* pre-made filters for entries */ + +/** + * @typedef Elm_Entry_Filter_Limit_Size + * + * Data for the elm_entry_filter_limit_size() entry filter. + */ +typedef struct _Elm_Entry_Filter_Limit_Size Elm_Entry_Filter_Limit_Size; + +/** + * @struct _Elm_Entry_Filter_Limit_Size + * + * Data for the elm_entry_filter_limit_size() entry filter. + */ +struct _Elm_Entry_Filter_Limit_Size +{ + int max_char_count; /**< The maximum number of characters allowed. */ + int max_byte_count; /**< The maximum number of bytes allowed*/ +}; + +/** + * Filter inserted text based on user defined character and byte limits + * + * Add this filter to an entry to limit the characters that it will accept + * based the contents of the provided #Elm_Entry_Filter_Limit_Size. + * The function works on the UTF-8 representation of the string, converting + * it from the set markup, thus not accounting for any format in it. + * + * The user must create an #Elm_Entry_Filter_Limit_Size structure and pass + * it as data when setting the filter. In it, it's possible to set limits + * by character count or bytes (any of them is disabled if 0), and both can + * be set at the same time. In that case, it first checks for characters, + * then bytes. The #Elm_Entry_Filter_Limit_Size structure must be alive and + * valid for as long as the entry is alive AND the elm_entry_filter_limit_size + * filter is set. + * + * The function will cut the inserted text in order to allow only the first + * number of characters that are still allowed. The cut is made in + * characters, even when limiting by bytes, in order to always contain + * valid ones and avoid half unicode characters making it in. + * + * This filter, like any others, does not apply when setting the entry text + * directly with elm_object_text_set(). + * + * @ingroup Entry + */ +EAPI void elm_entry_filter_limit_size(void *data, Evas_Object *entry, char **text); + +/** + * @typedef Elm_Entry_Filter_Accept_Set + * + * Data for the elm_entry_filter_accept_set() entry filter. + */ +typedef struct _Elm_Entry_Filter_Accept_Set Elm_Entry_Filter_Accept_Set; + +/** + * @struct _Elm_Entry_Filter_Accept_Set + * + * Data for the elm_entry_filter_accept_set() entry filter. + */ +struct _Elm_Entry_Filter_Accept_Set +{ + const char *accepted; /**< Set of characters accepted in the entry. */ + const char *rejected; /**< Set of characters rejected from the entry. */ +}; + +/** + * Filter inserted text based on accepted or rejected sets of characters + * + * Add this filter to an entry to restrict the set of accepted characters + * based on the sets in the provided #Elm_Entry_Filter_Accept_Set. + * This structure contains both accepted and rejected sets, but they are + * mutually exclusive. This structure must be available for as long as + * the entry is alive AND the elm_entry_filter_accept_set is being used. + * + * The @c accepted set takes preference, so if it is set, the filter will + * only work based on the accepted characters, ignoring anything in the + * @c rejected value. If @c accepted is @c NULL, then @c rejected is used. + * + * In both cases, the function filters by matching utf8 characters to the + * raw markup text, so it can be used to remove formatting tags. + * + * This filter, like any others, does not apply when setting the entry text + * directly with elm_object_text_set() + * + * @ingroup Entry + */ +EAPI void elm_entry_filter_accept_set(void *data, Evas_Object *entry, char **text); + +/** + * @typedef Elm_Cnp_Mode + * Enum of entry's copy & paste policy. + * + * @see elm_entry_cnp_mode_set() + * @see elm_entry_cnp_mode_get() + */ +typedef enum { + ELM_CNP_MODE_MARKUP, /**< copy & paste text with markup tag */ + ELM_CNP_MODE_NO_IMAGE, /**< copy & paste text without item(image) tag */ + ELM_CNP_MODE_PLAINTEXT /**< copy & paste text without markup tag */ +} Elm_Cnp_Mode; + +/** + * Get the text of the contextual menu item. + * + * Gets the text of the contextual menu item of entry. + * + * @param item The item to get the label + * @return The text of contextual menu item + * + * @see elm_entry_context_menu_item_add() + * @ingroup Entry + * @since 1.8 + */ +EAPI const char *elm_entry_context_menu_item_label_get(const Elm_Entry_Context_Menu_Item *item); + +/** + * Get the icon object of the contextual menu item. + * + * Gets the icon object packed in the contextual menu item of entry. + * + * @param item The item to get the icon from + * @param icon_file The image file path on disk used for the icon or standard + * icon name + * @param icon_group The edje group used if @p icon_file is an edje file. NULL + * if the icon is not an edje file + * @param icon_type The icon type + * + * @see elm_entry_context_menu_item_add() + * @ingroup Entry + * @since 1.8 + */ +EAPI void elm_entry_context_menu_item_icon_get(const Elm_Entry_Context_Menu_Item *item, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type); + diff --git a/legacy/elementary/src/lib/elm_entry_eo.h b/legacy/elementary/src/lib/elm_entry_eo.h new file mode 100644 index 0000000000..47fdbd62cd --- /dev/null +++ b/legacy/elementary/src/lib/elm_entry_eo.h @@ -0,0 +1,1321 @@ +#define ELM_OBJ_ENTRY_CLASS elm_obj_entry_class_get() + +const Eo_Class *elm_obj_entry_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_ENTRY_BASE_ID; + +enum +{ + ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PUSH, + ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_POP, + ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PEEK, + ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_SET, + ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_GET, + ELM_OBJ_ENTRY_SUB_ID_PASSWORD_SET, + ELM_OBJ_ENTRY_SUB_ID_PASSWORD_GET, + ELM_OBJ_ENTRY_SUB_ID_ENTRY_APPEND, + ELM_OBJ_ENTRY_SUB_ID_IS_EMPTY, + ELM_OBJ_ENTRY_SUB_ID_TEXTBLOCK_GET, + ELM_OBJ_ENTRY_SUB_ID_CALC_FORCE, + ELM_OBJ_ENTRY_SUB_ID_SELECTION_GET, + ELM_OBJ_ENTRY_SUB_ID_ENTRY_INSERT, + ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_SET, + ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_GET, + ELM_OBJ_ENTRY_SUB_ID_EDITABLE_SET, + ELM_OBJ_ENTRY_SUB_ID_EDITABLE_GET, + ELM_OBJ_ENTRY_SUB_ID_SELECT_NONE, + ELM_OBJ_ENTRY_SUB_ID_SELECT_ALL, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_GEOMETRY_GET, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_NEXT, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_PREV, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_UP, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_DOWN, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_BEGIN_SET, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_END_SET, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_BEGIN_SET, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_END_SET, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_BEGIN, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_END, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_FORMAT_GET, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_VISIBLE_FORMAT_GET, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_CONTENT_GET, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_SET, + ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_GET, + ELM_OBJ_ENTRY_SUB_ID_SELECTION_CUT, + ELM_OBJ_ENTRY_SUB_ID_SELECTION_COPY, + ELM_OBJ_ENTRY_SUB_ID_SELECTION_PASTE, + ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_CLEAR, + ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_ITEM_ADD, + ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_SET, + ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_GET, + ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_APPEND, + ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_PREPEND, + ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_REMOVE, + ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_APPEND, + ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_PREPEND, + ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_REMOVE, + ELM_OBJ_ENTRY_SUB_ID_FILE_SET, + ELM_OBJ_ENTRY_SUB_ID_FILE_GET, + ELM_OBJ_ENTRY_SUB_ID_FILE_SAVE, + ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_SET, + ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_GET, + ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_SET, + ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_GET, + ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_SET, + ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_GET, + ELM_OBJ_ENTRY_SUB_ID_ICON_VISIBLE_SET, + ELM_OBJ_ENTRY_SUB_ID_END_VISIBLE_SET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_SET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_GET, + ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_SET, + ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_GET, + ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_SET, + ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_GET, + ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_RESET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_SET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_GET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_SHOW, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_HIDE, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_SET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_GET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_SET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_GET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_SET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_GET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_SET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_GET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_AUTOENABLED_SET, + ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_GET, + ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_SET, + ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_GET, + ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_SET, + ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_GET, + ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_END, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_SET, + ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_GET, + ELM_OBJ_ENTRY_SUB_ID_LAST +}; + +#define ELM_OBJ_ENTRY_ID(sub_id) (ELM_OBJ_ENTRY_BASE_ID + sub_id) + + +/** + * @def elm_obj_entry_text_style_user_push + * @since 1.8 + * + * Push the style to the top of user style stack. + * + * @param[in] style + * + * @see elm_entry_text_style_user_push + * + * @ingroup Entry + */ +#define elm_obj_entry_text_style_user_push(style) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PUSH), EO_TYPECHECK(const char *, style) + +/** + * @def elm_obj_entry_text_style_user_pop + * @since 1.8 + * + * Remove the style in the top of user style stack. + * + * + * @see elm_entry_text_style_user_pop + * + * @ingroup Entry + */ +#define elm_obj_entry_text_style_user_pop() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_POP) + +/** + * @def elm_obj_entry_text_style_user_peek + * @since 1.8 + * + * Retrieve the style on the top of user style stack. + * + * @param[out] ret + * + * @see elm_entry_text_style_user_peek + * + * @ingroup Entry + */ +#define elm_obj_entry_text_style_user_peek(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PEEK), EO_TYPECHECK(const char **, ret) + +/** + * @def elm_obj_entry_single_line_set + * @since 1.8 + * + * Sets the entry to single line mode. + * + * @param[in] single_line + * + * @see elm_entry_single_line_set + * + * @ingroup Entry + */ +#define elm_obj_entry_single_line_set(single_line) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_SET), EO_TYPECHECK(Eina_Bool, single_line) + +/** + * @def elm_obj_entry_single_line_get + * @since 1.8 + * + * Gets whether the entry is set to be single line. + * + * @param[out] ret + * + * @see elm_entry_single_line_get + * + * @ingroup Entry + */ +#define elm_obj_entry_single_line_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_password_set + * @since 1.8 + * + * Sets the entry to password mode. + * + * @param[in] password + * + * @see elm_entry_password_set + * + * @ingroup Entry + */ +#define elm_obj_entry_password_set(password) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PASSWORD_SET), EO_TYPECHECK(Eina_Bool, password) + +/** + * @def elm_obj_entry_password_get + * @since 1.8 + * + * Gets whether the entry is set to password mode. + * + * @param[out] ret + * + * @see elm_entry_password_get + * + * @ingroup Entry + */ +#define elm_obj_entry_password_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PASSWORD_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_entry_append + * @since 1.8 + * + * Appends entry to the text of the entry. + * + * @param[in] entry + * + * @see elm_entry_entry_append + * + * @ingroup Entry + */ +#define elm_obj_entry_entry_append(entry) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ENTRY_APPEND), EO_TYPECHECK(const char *, entry) + +/** + * @def elm_obj_entry_is_empty + * @since 1.8 + * + * Gets whether the entry is empty. + * + * @param[out] ret + * + * @see elm_entry_is_empty + * + * @ingroup Entry + */ +#define elm_obj_entry_is_empty(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_IS_EMPTY), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_textblock_get + * @since 1.8 + * + * Returns the actual textblock object of the entry. + * + * @param[out] ret + * + * @see elm_entry_textblock_get + * + * @ingroup Entry + */ +#define elm_obj_entry_textblock_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXTBLOCK_GET), EO_TYPECHECK(Evas_Object **, ret) + +/** + * @def elm_obj_entry_calc_force + * @since 1.8 + * + * Forces calculation of the entry size and text layouting. + * + * + * @see elm_entry_calc_force + * + * @ingroup Entry + */ +#define elm_obj_entry_calc_force() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CALC_FORCE) + +/** + * @def elm_obj_entry_selection_get + * @since 1.8 + * + * Gets any selected text within the entry. + * + * @param[out] ret + * + * @see elm_entry_selection_get + * + * @ingroup Entry + */ +#define elm_obj_entry_selection_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_GET), EO_TYPECHECK(const char **, ret) + +/** + * @def elm_obj_entry_entry_insert + * @since 1.8 + * + * Inserts the given text into the entry at the current cursor position. + * + * @param[in] entry + * + * @see elm_entry_entry_insert + * + * @ingroup Entry + */ +#define elm_obj_entry_entry_insert(entry) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ENTRY_INSERT), EO_TYPECHECK(const char *, entry) + +/** + * @def elm_obj_entry_line_wrap_set + * @since 1.8 + * + * Set the line wrap type to use on multi-line entries. + * + * @param[in] wrap + * + * @see elm_entry_line_wrap_set + * + * @ingroup Entry + */ +#define elm_obj_entry_line_wrap_set(wrap) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_SET), EO_TYPECHECK(Elm_Wrap_Type, wrap) + +/** + * @def elm_obj_entry_line_wrap_get + * @since 1.8 + * + * Gets the wrap mode the entry was set to use. + * + * @param[out] ret + * + * @see elm_entry_line_wrap_get + * + * @ingroup Entry + */ +#define elm_obj_entry_line_wrap_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_GET), EO_TYPECHECK(Elm_Wrap_Type *, ret) + +/** + * @def elm_obj_entry_editable_set + * @since 1.8 + * + * Sets if the entry is to be editable or not. + * + * @param[in] editable + * + * @see elm_entry_editable_set + * + * @ingroup Entry + */ +#define elm_obj_entry_editable_set(editable) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_EDITABLE_SET), EO_TYPECHECK(Eina_Bool, editable) + +/** + * @def elm_obj_entry_editable_get + * @since 1.8 + * + * Gets whether the entry is editable or not. + * + * @param[out] ret + * + * @see elm_entry_editable_get + * + * @ingroup Entry + */ +#define elm_obj_entry_editable_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_EDITABLE_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_select_none + * @since 1.8 + * + * This drops any existing text selection within the entry. + * + * + * @see elm_entry_select_none + * + * @ingroup Entry + */ +#define elm_obj_entry_select_none() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECT_NONE) + +/** + * @def elm_obj_entry_select_all + * @since 1.8 + * + * This selects all text within the entry. + * + * + * @see elm_entry_select_all + * + * @ingroup Entry + */ +#define elm_obj_entry_select_all() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECT_ALL) + +/** + * @def elm_obj_entry_cursor_geometry_get + * @since 1.8 + * + * This function returns the geometry of the cursor. + * + * @param[out] x + * @param[out] y + * @param[out] w + * @param[out] h + * @param[out] ret + * + * @see elm_entry_cursor_geometry_get + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_geometry_get(x, y, w, h, ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_GEOMETRY_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_cursor_next + * @since 1.8 + * + * This moves the cursor one place to the right within the entry. + * + * @param[out] ret + * + * @see elm_entry_cursor_next + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_next(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_NEXT), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_cursor_prev + * @since 1.8 + * + * This moves the cursor one place to the left within the entry. + * + * @param[out] ret + * + * @see elm_entry_cursor_prev + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_prev(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_PREV), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_cursor_up + * @since 1.8 + * + * This moves the cursor one line up within the entry. + * + * @param[out] ret + * + * @see elm_entry_cursor_up + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_up(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_UP), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_cursor_down + * @since 1.8 + * + * This moves the cursor one line down within the entry. + * + * @param[out] ret + * + * @see elm_entry_cursor_down + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_down(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_DOWN), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_cursor_begin_set + * @since 1.8 + * + * This moves the cursor to the beginning of the entry. + * + * + * @see elm_entry_cursor_begin_set + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_begin_set() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_BEGIN_SET) + +/** + * @def elm_obj_entry_cursor_end_set + * @since 1.8 + * + * This moves the cursor to the end of the entry. + * + * + * @see elm_entry_cursor_end_set + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_end_set() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_END_SET) + +/** + * @def elm_obj_entry_cursor_line_begin_set + * @since 1.8 + * + * This moves the cursor to the beginning of the current line. + * + * + * @see elm_entry_cursor_line_begin_set + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_line_begin_set() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_BEGIN_SET) + +/** + * @def elm_obj_entry_cursor_line_end_set + * @since 1.8 + * + * This moves the cursor to the end of the current line. + * + * + * @see elm_entry_cursor_line_end_set + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_line_end_set() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_END_SET) + +/** + * @def elm_obj_entry_cursor_selection_begin + * @since 1.8 + * + * This begins a selection within the entry as though + * + * + * @see elm_entry_cursor_selection_begin + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_selection_begin() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_BEGIN) + +/** + * @def elm_obj_entry_cursor_selection_end + * @since 1.8 + * + * This ends a selection within the entry as though + * + * + * @see elm_entry_cursor_selection_end + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_selection_end() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_END) + +/** + * @def elm_obj_entry_cursor_is_format_get + * @since 1.8 + * + * Gets whether a format node exists at the current cursor position. + * + * @param[out] ret + * + * @see elm_entry_cursor_is_format_get + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_is_format_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_FORMAT_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_cursor_is_visible_format_get + * @since 1.8 + * + * Gets if the current cursor position holds a visible format node. + * + * @param[out] ret + * + * @see elm_entry_cursor_is_visible_format_get + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_is_visible_format_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_VISIBLE_FORMAT_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_cursor_content_get + * @since 1.8 + * + * Gets the character pointed by the cursor at its current position. + * + * @param[out] ret + * + * @see elm_entry_cursor_content_get + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_content_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_CONTENT_GET), EO_TYPECHECK(char **, ret) + +/** + * @def elm_obj_entry_cursor_pos_set + * @since 1.8 + * + * Sets the cursor position in the entry to the given value + * + * @param[in] pos + * + * @see elm_entry_cursor_pos_set + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_pos_set(pos) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_SET), EO_TYPECHECK(int, pos) + +/** + * @def elm_obj_entry_cursor_pos_get + * @since 1.8 + * + * Retrieves the current position of the cursor in the entry + * + * @param[out] ret + * + * @see elm_entry_cursor_pos_get + * + * @ingroup Entry + */ +#define elm_obj_entry_cursor_pos_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_GET), EO_TYPECHECK(int *, ret) + +/** + * @def elm_obj_entry_selection_cut + * @since 1.8 + * + * This executes a "cut" action on the selected text in the entry. + * + * + * @see elm_entry_selection_cut + * + * @ingroup Entry + */ +#define elm_obj_entry_selection_cut() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_CUT) + +/** + * @def elm_obj_entry_selection_copy + * @since 1.8 + * + * This executes a "copy" action on the selected text in the entry. + * + * + * @see elm_entry_selection_copy + * + * @ingroup Entry + */ +#define elm_obj_entry_selection_copy() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_COPY) + +/** + * @def elm_obj_entry_selection_paste + * @since 1.8 + * + * This executes a "paste" action in the entry. + * + * + * @see elm_entry_selection_paste + * + * @ingroup Entry + */ +#define elm_obj_entry_selection_paste() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_PASTE) + +/** + * @def elm_obj_entry_context_menu_clear + * @since 1.8 + * + * This clears and frees the items in a entry's contextual (longpress) + * + * + * @see elm_entry_context_menu_clear + * + * @ingroup Entry + */ +#define elm_obj_entry_context_menu_clear() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_CLEAR) + +/** + * @def elm_obj_entry_context_menu_item_add + * @since 1.8 + * + * This adds an item to the entry's contextual menu. + * + * @param[in] label + * @param[in] icon_file + * @param[in] icon_type + * @param[in] func + * @param[in] data + * + * @see elm_entry_context_menu_item_add + * + * @ingroup Entry + */ +#define elm_obj_entry_context_menu_item_add(label, icon_file, icon_type, func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_ITEM_ADD), EO_TYPECHECK(const char *, label), EO_TYPECHECK(const char *, icon_file), EO_TYPECHECK(Elm_Icon_Type, icon_type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data) + +/** + * @def elm_obj_entry_context_menu_disabled_set + * @since 1.8 + * + * This disables the entry's contextual (longpress) menu. + * + * @param[in] disabled + * + * @see elm_entry_context_menu_disabled_set + * + * @ingroup Entry + */ +#define elm_obj_entry_context_menu_disabled_set(disabled) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled) + +/** + * @def elm_obj_entry_context_menu_disabled_get + * @since 1.8 + * + * This returns whether the entry's contextual (longpress) menu is + * disabled. + * + * @param[out] ret + * + * @see elm_entry_context_menu_disabled_get + * + * @ingroup Entry + */ +#define elm_obj_entry_context_menu_disabled_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_item_provider_append + * @since 1.8 + * + * This appends a custom item provider to the list for that entry + * + * @param[in] func + * @param[in] data + * + * @see elm_entry_item_provider_append + * + * @ingroup Entry + */ +#define elm_obj_entry_item_provider_append(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_APPEND), EO_TYPECHECK(Elm_Entry_Item_Provider_Cb, func), EO_TYPECHECK(void *, data) + +/** + * @def elm_obj_entry_item_provider_prepend + * @since 1.8 + * + * This prepends a custom item provider to the list for that entry + * + * @param[in] func + * @param[in] data + * + * @see elm_entry_item_provider_prepend + * + * @ingroup Entry + */ +#define elm_obj_entry_item_provider_prepend(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_PREPEND), EO_TYPECHECK(Elm_Entry_Item_Provider_Cb, func), EO_TYPECHECK(void *, data) + +/** + * @def elm_obj_entry_item_provider_remove + * @since 1.8 + * + * This removes a custom item provider to the list for that entry + * + * @param[in] func + * @param[in] data + * + * @see elm_entry_item_provider_remove + * + * @ingroup Entry + */ +#define elm_obj_entry_item_provider_remove(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_REMOVE), EO_TYPECHECK(Elm_Entry_Item_Provider_Cb, func), EO_TYPECHECK(void *, data) + +/** + * @def elm_obj_entry_markup_filter_append + * @since 1.8 + * + * Append a markup filter function for text inserted in the entry + * + * @param[in] func + * @param[in] data + * + * @see elm_entry_markup_filter_append + * + * @ingroup Entry + */ +#define elm_obj_entry_markup_filter_append(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_APPEND), EO_TYPECHECK(Elm_Entry_Filter_Cb, func), EO_TYPECHECK(void *, data) + +/** + * @def elm_obj_entry_markup_filter_prepend + * @since 1.8 + * + * Prepend a markup filter function for text inserted in the entry + * + * @param[in] func + * @param[in] data + * + * @see elm_entry_markup_filter_prepend + * + * @ingroup Entry + */ +#define elm_obj_entry_markup_filter_prepend(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_PREPEND), EO_TYPECHECK(Elm_Entry_Filter_Cb, func), EO_TYPECHECK(void *, data) + +/** + * @def elm_obj_entry_markup_filter_remove + * @since 1.8 + * + * Remove a markup filter from the list + * + * @param[in] func + * @param[in] data + * + * @see elm_entry_markup_filter_remove + * + * @ingroup Entry + */ +#define elm_obj_entry_markup_filter_remove(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_REMOVE), EO_TYPECHECK(Elm_Entry_Filter_Cb, func), EO_TYPECHECK(void *, data) + +/** + * @def elm_obj_entry_file_set + * @since 1.8 + * + * This sets the file (and implicitly loads it) for the text to display and + * then edit. All changes are written back to the file after a short delay if + * the entry object is set to autosave (which is the default). + * + * @param[in] file + * @param[in] format + * @param[out] ret + * + * @see elm_entry_file_set + * + * @ingroup Entry + */ +#define elm_obj_entry_file_set(file, format, ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_FILE_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(Elm_Text_Format, format), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_file_get + * @since 1.8 + * + * Gets the file being edited by the entry. + * + * @param[out] file + * @param[out] format + * + * @see elm_entry_file_get + * + * @ingroup Entry + */ +#define elm_obj_entry_file_get(file, format) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_FILE_GET), EO_TYPECHECK(const char **, file), EO_TYPECHECK(Elm_Text_Format *, format) + +/** + * @def elm_obj_entry_file_save + * @since 1.8 + * + * This function writes any changes made to the file set with + * elm_entry_file_set() + * + * + * @see elm_entry_file_save + * + * @ingroup Entry + */ +#define elm_obj_entry_file_save() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_FILE_SAVE) + +/** + * @def elm_obj_entry_autosave_set + * @since 1.8 + * + * This sets the entry object to 'autosave' the loaded text file or not. + * + * @param[in] auto_save + * + * @see elm_entry_autosave_set + * + * @ingroup Entry + */ +#define elm_obj_entry_autosave_set(auto_save) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_SET), EO_TYPECHECK(Eina_Bool, auto_save) + +/** + * @def elm_obj_entry_autosave_get + * @since 1.8 + * + * This gets the entry object's 'autosave' status. + * + * @param[out] ret + * + * @see elm_entry_autosave_get + * + * @ingroup Entry + */ +#define elm_obj_entry_autosave_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_cnp_mode_set + * @since 1.8 + * + * Control pasting of text and images for the widget. + * + * @param[in] cnp_mode + * + * @see elm_entry_cnp_mode_set + * + * @ingroup Entry + */ +#define elm_obj_entry_cnp_mode_set(cnp_mode) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_SET), EO_TYPECHECK(Elm_Cnp_Mode, cnp_mode) + +/** + * @def elm_obj_entry_cnp_mode_get + * @since 1.8 + * + * Getting elm_entry text paste/drop mode. + * + * @param[out] ret + * + * @see elm_entry_cnp_mode_get + * + * @ingroup Entry + */ +#define elm_obj_entry_cnp_mode_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_GET), EO_TYPECHECK(Elm_Cnp_Mode *, ret) + +/** + * @def elm_obj_entry_scrollable_set + * @since 1.8 + * + * Enable or disable scrolling in entry + * + * @param[in] scroll + * + * @see elm_entry_scrollable_set + * + * @ingroup Entry + */ +#define elm_obj_entry_scrollable_set(scroll) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_SET), EO_TYPECHECK(Eina_Bool, scroll) + +/** + * @def elm_obj_entry_scrollable_get + * @since 1.8 + * + * Get the scrollable state of the entry + * + * @param[out] ret + * + * @see elm_entry_scrollable_get + * + * @ingroup Entry + */ +#define elm_obj_entry_scrollable_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_icon_visible_set + * @since 1.8 + * + * Sets the visibility of the left-side widget of the entry, + * set by elm_object_part_content_set(). + * + * @param[in] setting + * + * @see elm_entry_icon_visible_set + * + * @ingroup Entry + */ +#define elm_obj_entry_icon_visible_set(setting) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ICON_VISIBLE_SET), EO_TYPECHECK(Eina_Bool, setting) + +/** + * @def elm_obj_entry_end_visible_set + * @since 1.8 + * + * Sets the visibility of the end widget of the entry, set by + * + * @param[in] setting + * + * @see elm_entry_end_visible_set + * + * @ingroup Entry + */ +#define elm_obj_entry_end_visible_set(setting) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_END_VISIBLE_SET), EO_TYPECHECK(Eina_Bool, setting) + +/** + * @def elm_obj_entry_input_panel_layout_set + * @since 1.8 + * + * Set the input panel layout of the entry + * + * @param[in] layout + * + * @see elm_entry_input_panel_layout_set + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_layout_set(layout) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_SET), EO_TYPECHECK(Elm_Input_Panel_Layout, layout) + +/** + * @def elm_obj_entry_input_panel_layout_get + * @since 1.8 + * + * Get the input panel layout of the entry + * + * @param[out] ret + * + * @see elm_entry_input_panel_layout_get + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_layout_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_GET), EO_TYPECHECK(Elm_Input_Panel_Layout *, ret) + +/** + * @def elm_obj_entry_input_panel_layout_variation_set + * @since 1.8 + * + * Set the input panel layout variation of the entry + * + * @param[in] layout variation + * + * @see elm_entry_input_panel_layout_variation_set + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_layout_variation_set(variation) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_SET), EO_TYPECHECK(int, variation) + +/** + * @def elm_obj_entry_input_panel_layout_variation_get + * @since 1.8 + * + * Get the input panel layout variation of the entry + * + * @param[out] ret + * + * @see elm_entry_input_panel_layout_variation_get + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_layout_variation_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_GET), EO_TYPECHECK(int *, ret) + +/** + * @def elm_obj_entry_autocapital_type_set + * @since 1.8 + * + * Set the autocapitalization type on the immodule. + * + * @param[in] autocapital_type + * + * @see elm_entry_autocapital_type_set + * + * @ingroup Entry + */ +#define elm_obj_entry_autocapital_type_set(autocapital_type) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_SET), EO_TYPECHECK(Elm_Autocapital_Type, autocapital_type) + +/** + * @def elm_obj_entry_autocapital_type_get + * @since 1.8 + * + * Retrieve the autocapitalization type on the immodule. + * + * @param[out] ret + * + * @see elm_entry_autocapital_type_get + * + * @ingroup Entry + */ +#define elm_obj_entry_autocapital_type_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_GET), EO_TYPECHECK(Elm_Autocapital_Type *, ret) + +/** + * @def elm_obj_entry_prediction_allow_set + * @since 1.8 + * + * Set whether the entry should allow to use the text prediction. + * + * @param[in] prediction + * + * @see elm_entry_prediction_allow_set + * + * @ingroup Entry + */ +#define elm_obj_entry_prediction_allow_set(prediction) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_SET), EO_TYPECHECK(Eina_Bool, prediction) + +/** + * @def elm_obj_entry_prediction_allow_get + * @since 1.8 + * + * Get whether the entry should allow to use the text prediction. + * + * @param[out] ret + * + * @see elm_entry_prediction_allow_get + * + * @ingroup Entry + */ +#define elm_obj_entry_prediction_allow_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_imf_context_reset + * @since 1.8 + * + * Reset the input method context of the entry if needed. + * + * + * @see elm_entry_imf_context_reset + * + * @ingroup Entry + */ +#define elm_obj_entry_imf_context_reset() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_RESET) + +/** + * @def elm_obj_entry_input_panel_enabled_set + * @since 1.8 + * + * Sets the attribute to show the input panel automatically. + * + * @param[in] enabled + * + * @see elm_entry_input_panel_enabled_set + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_enabled_set(enabled) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled) + +/** + * @def elm_obj_entry_input_panel_enabled_get + * @since 1.8 + * + * Retrieve the attribute to show the input panel automatically. + * + * @param[out] ret + * + * @see elm_entry_input_panel_enabled_get + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_enabled_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_input_panel_show + * @since 1.8 + * + * Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types, and so on. + * + * + * @see elm_entry_input_panel_show + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_show() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_SHOW) + +/** + * @def elm_obj_entry_input_panel_hide + * @since 1.8 + * + * Hide the input panel (virtual keyboard). + * + * + * @see elm_entry_input_panel_hide + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_hide() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_HIDE) + +/** + * @def elm_obj_entry_input_panel_language_set + * @since 1.8 + * + * Set the language mode of the input panel. + * + * @param[in] lang + * + * @see elm_entry_input_panel_language_set + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_language_set(lang) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_SET), EO_TYPECHECK(Elm_Input_Panel_Lang, lang) + +/** + * @def elm_obj_entry_input_panel_language_get + * @since 1.8 + * + * Get the language mode of the input panel. + * + * @param[out] ret + * + * @see elm_entry_input_panel_language_get + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_language_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_GET), EO_TYPECHECK(Elm_Input_Panel_Lang *, ret) + +/** + * @def elm_obj_entry_input_panel_imdata_set + * @since 1.8 + * + * Set the input panel-specific data to deliver to the input panel. + * + * @param[in] data + * @param[in] len + * + * @see elm_entry_input_panel_imdata_set + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_imdata_set(data, len) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_SET), EO_TYPECHECK(const void *, data), EO_TYPECHECK(int, len) + +/** + * @def elm_obj_entry_input_panel_imdata_get + * @since 1.8 + * + * Get the specific data of the current input panel. + * + * @param[out] data + * @param[out] len + * + * @see elm_entry_input_panel_imdata_get + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_imdata_get(data, len) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_GET), EO_TYPECHECK(void *, data), EO_TYPECHECK(int *, len) + +/** + * @def elm_obj_entry_input_panel_return_key_type_set + * @since 1.8 + * + * Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel. + * + * @param[in] return_key_type + * + * @see elm_entry_input_panel_return_key_type_set + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_return_key_type_set(return_key_type) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_SET), EO_TYPECHECK(Elm_Input_Panel_Return_Key_Type, return_key_type) + +/** + * @def elm_obj_entry_input_panel_return_key_type_get + * @since 1.8 + * + * Get the "return" key type. + * + * @param[out] ret + * + * @see elm_entry_input_panel_return_key_type_get + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_return_key_type_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_GET), EO_TYPECHECK(Elm_Input_Panel_Return_Key_Type *, ret) + +/** + * @def elm_obj_entry_input_panel_return_key_disabled_set + * @since 1.8 + * + * Set the return key on the input panel to be disabled. + * + * @param[in] disabled + * + * @see elm_entry_input_panel_return_key_disabled_set + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_return_key_disabled_set(disabled) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled) + +/** + * @def elm_obj_entry_input_panel_return_key_disabled_get + * @since 1.8 + * + * Get whether the return key on the input panel should be disabled or not. + * + * @param[out] ret + * + * @see elm_entry_input_panel_return_key_disabled_get + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_return_key_disabled_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_entry_input_panel_return_key_autoenabled_set + * @since 1.8 + * + * Set whether the return key on the input panel is disabled automatically when entry has no text. + * + * @param[in] enabled + * + * @see elm_entry_input_panel_return_key_autoenabled_set + * + * @ingroup Entry + */ +#define elm_obj_entry_input_panel_return_key_autoenabled_set(enabled) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_AUTOENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled) + +/** + * @def elm_obj_entry_imf_context_get + * @since 1.8 + * + * Returns the input method context of the entry. + * + * @param[out] ret + * + * @see elm_entry_imf_context_get + * + * @ingroup Entry + */ +#define elm_obj_entry_imf_context_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_GET), EO_TYPECHECK(void **, ret) + +/** + * @def elm_obj_entry_anchor_hover_parent_set + * @since 1.8 + * + * Set the parent of the hover popup + * + * @param[in] parent + * + * @see elm_entry_anchor_hover_parent_set + * + * @ingroup Entry + */ +#define elm_obj_entry_anchor_hover_parent_set(parent) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_SET), EO_TYPECHECK(Evas_Object *, parent) + +/** + * @def elm_obj_entry_anchor_hover_parent_get + * @since 1.8 + * + * Get the parent of the hover popup + * + * @param[out] ret + * + * @see elm_entry_anchor_hover_parent_get + * + * @ingroup Entry + */ +#define elm_obj_entry_anchor_hover_parent_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_GET), EO_TYPECHECK(Evas_Object **, ret) + +/** + * @def elm_obj_entry_anchor_hover_style_set + * @since 1.8 + * + * Set the style that the hover should use + * + * @param[in] style + * + * @see elm_entry_anchor_hover_style_set + * + * @ingroup Entry + */ +#define elm_obj_entry_anchor_hover_style_set(style) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_SET), EO_TYPECHECK(const char *, style) + +/** + * @def elm_obj_entry_anchor_hover_style_get + * @since 1.8 + * + * Get the style that the hover should use + * + * @param[out] ret + * + * @see elm_entry_anchor_hover_style_get + */ +#define elm_obj_entry_anchor_hover_style_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_GET), EO_TYPECHECK(const char **, ret) + +/** + * @def elm_obj_entry_anchor_hover_end + * @since 1.8 + * + * Ends the hover popup in the entry + * + * + * @see elm_entry_anchor_hover_end + * + * @ingroup Entry + */ +#define elm_obj_entry_anchor_hover_end() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_END) diff --git a/legacy/elementary/src/lib/elm_entry_legacy.h b/legacy/elementary/src/lib/elm_entry_legacy.h new file mode 100644 index 0000000000..90c6264326 --- /dev/null +++ b/legacy/elementary/src/lib/elm_entry_legacy.h @@ -0,0 +1,1172 @@ +/** + * This adds an entry to @p parent object. + * + * By default, entries are: + * @li not scrolled + * @li multi-line + * @li word wrapped + * @li autosave is enabled + * + * @param parent The parent object + * @return The new object or NULL if it cannot be created + * + * @ingroup Entry + */ +EAPI Evas_Object *elm_entry_add(Evas_Object *parent); + +/** + * This sets the text displayed within the entry to @p entry. + * + * @param obj The entry object + * @param entry The text to be displayed + * + * @note Using this function bypasses text filters + * + * @ingroup Entry + */ +EAPI void elm_entry_entry_set(Evas_Object *obj, const char *entry); + +/** + * This returns the text currently shown in object @p entry. + * See also elm_entry_entry_set(). + * + * @param obj The entry object + * @return The currently displayed text or NULL on failure + * + * @ingroup Entry + */ +EAPI const char *elm_entry_entry_get(const Evas_Object *obj); + +/** + * Push the style to the top of user style stack. + * If there is styles in the user style stack, the properties in the top style + * of user style stack will replace the properties in current theme. + * The input style is specified in format tag='property=value' (i.e. DEFAULT='font=Sans font_size=60'hilight=' + font_weight=Bold'). + * + * @param obj The entry object + * @param style The style user to push + * + * @since 1.7 + */ +EAPI void elm_entry_text_style_user_push(Evas_Object *obj, const char *style); + +/** + * Remove the style in the top of user style stack. + * + * @param obj The entry object + * + * @see elm_entry_text_style_user_push() + * + * @since 1.7 + */ +EAPI void elm_entry_text_style_user_pop(Evas_Object *obj); + +/** + * Retrieve the style on the top of user style stack. + * + * @param obj The entry object + * @return style on the top of user style stack if exist, otherwise NULL. + * + * @see elm_entry_text_style_user_push() + * + * @since 1.7 + */ +EAPI const char* elm_entry_text_style_user_peek(const Evas_Object *obj); + +/** + * Sets the entry to single line mode. + * + * In single line mode, entries don't ever wrap when the text reaches the + * edge, and instead they keep growing horizontally. Pressing the @c Enter + * key will generate an @c "activate" event instead of adding a new line. + * + * When @p single_line is @c EINA_FALSE, line wrapping takes effect again + * and pressing enter will break the text into a different line + * without generating any events. + * + * @param obj The entry object + * @param single_line If true, the text in the entry + * will be on a single line. + * + * @ingroup Entry + */ +EAPI void elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line); + +/** + * Gets whether the entry is set to be single line. + * + * @param obj The entry object + * @return single_line If true, the text in the entry is set to display + * on a single line. + * + * @see elm_entry_single_line_set() + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_single_line_get(const Evas_Object *obj); + +/** + * Sets the entry to password mode. + * + * In password mode, entries are implicitly single line and the display of + * any text in them is replaced with asterisks (*). + * + * @param obj The entry object + * @param password If true, password mode is enabled. + * + * @ingroup Entry + */ +EAPI void elm_entry_password_set(Evas_Object *obj, Eina_Bool password); + +/** + * Gets whether the entry is set to password mode. + * + * @param obj The entry object + * @return If true, the entry is set to display all characters + * as asterisks (*). + * + * @see elm_entry_password_set() + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_password_get(const Evas_Object *obj); + +/** + * Appends @p entry to the text of the entry. + * + * Adds the text in @p entry to the end of any text already present in the + * widget. + * + * The appended text is subject to any filters set for the widget. + * + * @param obj The entry object + * @param entry The text to be displayed + * + * @see elm_entry_markup_filter_append() + * + * @ingroup Entry + */ +EAPI void elm_entry_entry_append(Evas_Object *obj, const char *entry); + +/** + * Gets whether the entry is empty. + * + * Empty means no text at all. If there are any markup tags, like an item + * tag for which no provider finds anything, and no text is displayed, this + * function still returns EINA_FALSE. + * + * @param obj The entry object + * @return EINA_TRUE if the entry is empty, EINA_FALSE otherwise. + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_is_empty(const Evas_Object *obj); + +/** + * Returns the actual textblock object of the entry. + * + * This function exposes the internal textblock object that actually + * contains and draws the text. This should be used for low-level + * manipulations that are otherwise not possible. + * + * Changing the textblock directly from here will not notify edje/elm to + * recalculate the textblock size automatically, so any modifications + * done to the textblock returned by this function should be followed by + * a call to elm_entry_calc_force(). + * + * The return value is marked as const as an additional warning. + * One should not use the returned object with any of the generic evas + * functions (geometry_get/resize/move and etc), but only with the textblock + * functions; The former will either not work at all, or break the correct + * functionality. + * + * IMPORTANT: Many functions may change (i.e delete and create a new one) + * the internal textblock object. Do NOT cache the returned object, and try + * not to mix calls on this object with regular elm_entry calls (which may + * change the internal textblock object). This applies to all cursors + * returned from textblock calls, and all the other derivative values. + * + * @param obj The entry object + * @return The textblock object. + * + * @ingroup Entry + */ +EAPI Evas_Object * elm_entry_textblock_get(Evas_Object *obj); + +/** + * Forces calculation of the entry size and text layouting. + * + * This should be used after modifying the textblock object directly. See + * elm_entry_textblock_get() for more information. + * + * @param obj The entry object + * + * @see elm_entry_textblock_get() + * + * @ingroup Entry + */ +EAPI void elm_entry_calc_force(Evas_Object *obj); + +/** + * Gets any selected text within the entry. + * + * If there's any selected text in the entry, this function returns it as + * a string in markup format. NULL is returned if no selection exists or + * if an error occurred. + * + * The returned value points to an internal string and should not be freed + * or modified in any way. If the @p entry object is deleted or its + * contents are changed, the returned pointer should be considered invalid. + * + * @param obj The entry object + * @return The selected text within the entry or NULL on failure + * + * @ingroup Entry + */ +EAPI const char *elm_entry_selection_get(const Evas_Object *obj); + +/** + * Inserts the given text into the entry at the current cursor position. + * + * This inserts text at the cursor position as if it was typed + * by the user (note that this also allows markup which a user + * can't just "type" as it would be converted to escaped text, so this + * call can be used to insert things like emoticon items or bold push/pop + * tags, other font and color change tags etc.) + * + * If any selection exists, it will be replaced by the inserted text. + * + * The inserted text is subject to any filters set for the widget. + * + * @param obj The entry object + * @param entry The text to insert + * + * @see elm_entry_markup_filter_append() + * + * @ingroup Entry + */ +EAPI void elm_entry_entry_insert(Evas_Object *obj, const char *entry); + +/** + * Set the line wrap type to use on multi-line entries. + * + * Sets the wrap type used by the entry to any of the specified in + * Elm_Wrap_Type. This tells how the text will be implicitly cut into a new + * line (without inserting a line break or paragraph separator) when it + * reaches the far edge of the widget. + * + * Note that this only makes sense for multi-line entries. A widget set + * to be single line will never wrap. + * + * @param obj The entry object + * @param wrap The wrap mode to use. See Elm_Wrap_Type for details on them + */ +EAPI void elm_entry_line_wrap_set(Evas_Object *obj, Elm_Wrap_Type wrap); + +/** + * Gets the wrap mode the entry was set to use. + * + * @param obj The entry object + * @return Wrap type + * + * @see also elm_entry_line_wrap_set() + * + * @ingroup Entry + */ +EAPI Elm_Wrap_Type elm_entry_line_wrap_get(const Evas_Object *obj); + +/** + * Sets if the entry is to be editable or not. + * + * By default, entries are editable and when focused, any text input by the + * user will be inserted at the current cursor position. But calling this + * function with @p editable as EINA_FALSE will prevent the user from + * inputting text into the entry. + * + * The only way to change the text of a non-editable entry is to use + * elm_object_text_set(), elm_entry_entry_insert() and other related + * functions. + * + * @param obj The entry object + * @param editable If EINA_TRUE, user input will be inserted in the entry, + * if not, the entry is read-only and no user input is allowed. + * + * @ingroup Entry + */ +EAPI void elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable); + +/** + * Gets whether the entry is editable or not. + * + * @param obj The entry object + * @return If true, the entry is editable by the user. + * If false, it is not editable by the user + * + * @see elm_entry_editable_set() + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_editable_get(const Evas_Object *obj); + +/** + * This drops any existing text selection within the entry. + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_select_none(Evas_Object *obj); + +/** + * This selects all text within the entry. + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_select_all(Evas_Object *obj); + +/** + * This function returns the geometry of the cursor. + * + * It's useful if you want to draw something on the cursor (or where it is), + * or for example in the case of scrolled entry where you want to show the + * cursor. + * + * @param obj The entry object + * @param x returned geometry + * @param y returned geometry + * @param w returned geometry + * @param h returned geometry + * @return EINA_TRUE upon success, EINA_FALSE upon failure + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_cursor_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); + +/** + * This moves the cursor one place to the right within the entry. + * + * @param obj The entry object + * @return EINA_TRUE upon success, EINA_FALSE upon failure + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_cursor_next(Evas_Object *obj); + +/** + * This moves the cursor one place to the left within the entry. + * + * @param obj The entry object + * @return EINA_TRUE upon success, EINA_FALSE upon failure + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_cursor_prev(Evas_Object *obj); + +/** + * This moves the cursor one line up within the entry. + * + * @param obj The entry object + * @return EINA_TRUE upon success, EINA_FALSE upon failure + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_cursor_up(Evas_Object *obj); + +/** + * This moves the cursor one line down within the entry. + * + * @param obj The entry object + * @return EINA_TRUE upon success, EINA_FALSE upon failure + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_cursor_down(Evas_Object *obj); + +/** + * This moves the cursor to the beginning of the entry. + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_cursor_begin_set(Evas_Object *obj); + +/** + * This moves the cursor to the end of the entry. + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_cursor_end_set(Evas_Object *obj); + +/** + * This moves the cursor to the beginning of the current line. + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_cursor_line_begin_set(Evas_Object *obj); + +/** + * This moves the cursor to the end of the current line. + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_cursor_line_end_set(Evas_Object *obj); + +/** + * This begins a selection within the entry as though + * the user were holding down the mouse button to make a selection. + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_cursor_selection_begin(Evas_Object *obj); + +/** + * This ends a selection within the entry as though + * the user had just released the mouse button while making a selection. + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_cursor_selection_end(Evas_Object *obj); + +/** + * Gets whether a format node exists at the current cursor position. + * + * A format node is anything that defines how the text is rendered. It can + * be a visible format node, such as a line break or a paragraph separator, + * or an invisible one, such as bold begin or end tag. + * This function returns whether any format node exists at the current + * cursor position. + * + * @param obj The entry object + * @return EINA_TRUE if the current cursor position contains a format node, + * EINA_FALSE otherwise. + * + * @see elm_entry_cursor_is_visible_format_get() + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_cursor_is_format_get(const Evas_Object *obj); + +/** + * Gets if the current cursor position holds a visible format node. + * + * @param obj The entry object + * @return EINA_TRUE if the current cursor is a visible format, EINA_FALSE + * if it's an invisible one or no format exists. + * + * @see elm_entry_cursor_is_format_get() + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_cursor_is_visible_format_get(const Evas_Object *obj); + +/** + * Gets the character pointed by the cursor at its current position. + * + * This function returns a string with the utf8 character stored at the + * current cursor position. + * Only the text is returned, any format that may exist will not be part + * of the return value. You must free the string when done with free(). + * + * @param obj The entry object + * @return The text pointed by the cursors. + * + * @ingroup Entry + */ +EAPI char *elm_entry_cursor_content_get(const Evas_Object *obj); + +/** + * Sets the cursor position in the entry to the given value + * + * The value in @p pos is the index of the character position within the + * contents of the string as returned by elm_entry_cursor_pos_get(). + * + * @param obj The entry object + * @param pos The position of the cursor + * + * @ingroup Entry + */ +EAPI void elm_entry_cursor_pos_set(Evas_Object *obj, int pos); + +/** + * Retrieves the current position of the cursor in the entry + * + * @param obj The entry object + * @return The cursor position + * + * @ingroup Entry + */ +EAPI int elm_entry_cursor_pos_get(const Evas_Object *obj); + +/** + * This executes a "cut" action on the selected text in the entry. + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_selection_cut(Evas_Object *obj); + +/** + * This executes a "copy" action on the selected text in the entry. + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_selection_copy(Evas_Object *obj); + +/** + * This executes a "paste" action in the entry. + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_selection_paste(Evas_Object *obj); + +/** + * This clears and frees the items in a entry's contextual (longpress) + * menu. + * + * @param obj The entry object + * + * @see elm_entry_context_menu_item_add() + * + * @ingroup Entry + */ +EAPI void elm_entry_context_menu_clear(Evas_Object *obj); + +/** + * This adds an item to the entry's contextual menu. + * + * A longpress on an entry will make the contextual menu show up, if this + * hasn't been disabled with elm_entry_context_menu_disabled_set(). + * By default, this menu provides a few options like enabling selection mode, + * which is useful on embedded devices that need to be explicit about it, + * and when a selection exists it also shows the copy and cut actions. + * + * With this function, developers can add other options to this menu to + * perform any action they deem necessary. + * + * @param obj The entry object + * @param label The item's text label + * @param icon_file The item's icon file + * @param icon_type The item's icon type + * @param func The callback to execute when the item is clicked + * @param data The data to associate with the item for related functions + * + * @ingroup Entry + */ +EAPI void elm_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data); + +/** + * This disables the entry's contextual (longpress) menu. + * + * @param obj The entry object + * @param disabled If true, the menu is disabled + * + * @ingroup Entry + */ +EAPI void elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled); + +/** + * This returns whether the entry's contextual (longpress) menu is + * disabled. + * + * @param obj The entry object + * @return If true, the menu is disabled + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_context_menu_disabled_get(const Evas_Object *obj); + +/** + * This appends a custom item provider to the list for that entry + * + * This appends the given callback. The list is walked from beginning to end + * with each function called given the item href string in the text. If the + * function returns an object handle other than NULL (it should create an + * object to do this), then this object is used to replace that item. If + * not the next provider is called until one provides an item object, or the + * default provider in entry does. + * + * @param obj The entry object + * @param func The function called to provide the item object + * @param data The data passed to @p func + * + * @see @ref entry-items + * + * @ingroup Entry + */ +EAPI void elm_entry_item_provider_append(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data); + +/** + * This prepends a custom item provider to the list for that entry + * + * This prepends the given callback. See elm_entry_item_provider_append() for + * more information + * + * @param obj The entry object + * @param func The function called to provide the item object + * @param data The data passed to @p func + * + * @ingroup Entry + */ +EAPI void elm_entry_item_provider_prepend(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data); + +/** + * This removes a custom item provider to the list for that entry + * + * This removes the given callback. See elm_entry_item_provider_append() for + * more information + * + * @param obj The entry object + * @param func The function called to provide the item object + * @param data The data passed to @p func + * + * @ingroup Entry + */ +EAPI void elm_entry_item_provider_remove(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data); + +/** + * Append a markup filter function for text inserted in the entry + * + * Append the given callback to the list. This functions will be called + * whenever any text is inserted into the entry, with the text to be inserted + * as a parameter. The type of given text is always markup. + * The callback function is free to alter the text in any way it wants, but + * it must remember to free the given pointer and update it. + * If the new text is to be discarded, the function can free it and set its + * text parameter to NULL. This will also prevent any following filters from + * being called. + * + * @param obj The entry object + * @param func The function to use as text filter + * @param data User data to pass to @p func + * + * @ingroup Entry + */ +EAPI void elm_entry_markup_filter_append(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data); + +/** + * Prepend a markup filter function for text inserted in the entry + * + * Prepend the given callback to the list. See elm_entry_markup_filter_append() + * for more information + * + * @param obj The entry object + * @param func The function to use as text filter + * @param data User data to pass to @p func + * + * @ingroup Entry + */ +EAPI void elm_entry_markup_filter_prepend(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data); + +/** + * Remove a markup filter from the list + * + * Removes the given callback from the filter list. See + * elm_entry_markup_filter_append() for more information. + * + * @param obj The entry object + * @param func The filter function to remove + * @param data The user data passed when adding the function + * + * @ingroup Entry + */ +EAPI void elm_entry_markup_filter_remove(Evas_Object *obj, Elm_Entry_Filter_Cb func, void *data); + +/** + * This sets the file (and implicitly loads it) for the text to display and + * then edit. All changes are written back to the file after a short delay if + * the entry object is set to autosave (which is the default). + * + * If the entry had any other file set previously, any changes made to it + * will be saved if the autosave feature is enabled, otherwise, the file + * will be silently discarded and any non-saved changes will be lost. + * + * @param obj The entry object + * @param file The path to the file to load and save + * @param format The file format + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_file_set(Evas_Object *obj, const char *file, Elm_Text_Format format); + +/** + * Gets the file being edited by the entry. + * + * This function can be used to retrieve any file set on the entry for + * edition, along with the format used to load and save it. + * + * @param obj The entry object + * @param file The path to the file to load and save + * @param format The file format + * + * @ingroup Entry + */ +EAPI void elm_entry_file_get(const Evas_Object *obj, const char **file, Elm_Text_Format *format); + +/** + * This function writes any changes made to the file set with + * elm_entry_file_set() + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_file_save(Evas_Object *obj); + +/** + * This sets the entry object to 'autosave' the loaded text file or not. + * + * @param obj The entry object + * @param autosave Autosave the loaded file or not + * + * @see elm_entry_file_set() + * + * @ingroup Entry + */ +EAPI void elm_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave); + +/** + * This gets the entry object's 'autosave' status. + * + * @param obj The entry object + * @return Autosave the loaded file or not + * + * @see elm_entry_file_set() + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_autosave_get(const Evas_Object *obj); + +/** + * Control pasting of text and images for the widget. + * + * Normally the entry allows both text and images to be pasted. + * By setting cnp_mode to be #ELM_CNP_MODE_NO_IMAGE, this prevents images from being copy or past. + * By setting cnp_mode to be #ELM_CNP_MODE_PLAINTEXT, this remove all tags in text . + * + * @note this only changes the behaviour of text. + * + * @param obj The entry object + * @param cnp_mode One of #Elm_Cnp_Mode: #ELM_CNP_MODE_MARKUP, #ELM_CNP_MODE_NO_IMAGE, #ELM_CNP_MODE_PLAINTEXT. + * + * @ingroup Entry + */ +EAPI void elm_entry_cnp_mode_set(Evas_Object *obj, Elm_Cnp_Mode cnp_mode); + +/** + * Getting elm_entry text paste/drop mode. + * + * Normally the entry allows both text and images to be pasted. + * This gets the copy & paste mode of the entry. + * + * @param obj The entry object + * @return mode One of #Elm_Cnp_Mode: #ELM_CNP_MODE_MARKUP, #ELM_CNP_MODE_NO_IMAGE, #ELM_CNP_MODE_PLAINTEXT. + * + * @ingroup Entry + */ +EAPI Elm_Cnp_Mode elm_entry_cnp_mode_get(const Evas_Object *obj); + +/** + * Enable or disable scrolling in entry + * + * Normally the entry is not scrollable unless you enable it with this call. + * + * @param obj The entry object + * @param scroll EINA_TRUE if it is to be scrollable, EINA_FALSE otherwise + * + * @ingroup Entry + */ +EAPI void elm_entry_scrollable_set(Evas_Object *obj, Eina_Bool scroll); + +/** + * Get the scrollable state of the entry + * + * Normally the entry is not scrollable. This gets the scrollable state + * of the entry. See elm_entry_scrollable_set() for more information. + * + * @param obj The entry object + * @return The scrollable state + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_scrollable_get(const Evas_Object *obj); + +/** + * Sets the visibility of the left-side widget of the entry, + * set by elm_object_part_content_set(). + * + * @param obj The entry object + * @param setting EINA_TRUE if the object should be displayed, + * EINA_FALSE if not. + * + * @ingroup Entry + */ +EAPI void elm_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting); + +/** + * Sets the visibility of the end widget of the entry, set by + * elm_object_part_content_set(ent, "end", content). + * + * @param obj The entry object + * @param setting EINA_TRUE if the object should be displayed, + * EINA_FALSE if not. + * + * @ingroup Entry + */ +EAPI void elm_entry_end_visible_set(Evas_Object *obj, Eina_Bool setting); + +/** + * Set the input panel layout of the entry + * + * @param obj The entry object + * @param layout layout type + * + * @ingroup Entry + */ +EAPI void elm_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout); + +/** + * Get the input panel layout of the entry + * + * @param obj The entry object + * @return layout type + * + * @see elm_entry_input_panel_layout_set + * + * @ingroup Entry + */ +EAPI Elm_Input_Panel_Layout elm_entry_input_panel_layout_get(const Evas_Object *obj); + +/** + * Set the autocapitalization type on the immodule. + * + * @param obj The entry object + * @param autocapital_type The type of autocapitalization + * + * @ingroup Entry + */ +EAPI void elm_entry_autocapital_type_set(Evas_Object *obj, Elm_Autocapital_Type autocapital_type); + +/** + * Retrieve the autocapitalization type on the immodule. + * + * @param obj The entry object + * @return autocapitalization type + * + * @ingroup Entry + */ +EAPI Elm_Autocapital_Type elm_entry_autocapital_type_get(const Evas_Object *obj); + +/** + * Set whether the entry should allow to use the text prediction. + * + * @param obj The entry object + * @param prediction Whether the entry should allow to use the text prediction. + * + * @ingroup Entry + */ +EAPI void elm_entry_prediction_allow_set(Evas_Object *obj, Eina_Bool prediction); + +/** + * Get whether the entry should allow to use the text prediction. + * + * @param obj The entry object + * @return EINA_TRUE if it allows to use the text prediction, otherwise EINA_FALSE. + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_prediction_allow_get(const Evas_Object *obj); + +/** + * Reset the input method context of the entry if needed. + * + * This can be necessary in the case where modifying the buffer would confuse on-going input method behavior. + * This will typically cause the Input Method Context to clear the preedit state. + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_imf_context_reset(Evas_Object *obj); + +/** + * Sets the attribute to show the input panel automatically. + * + * @param obj The entry object + * @param enabled If true, the input panel is appeared when entry is clicked or has a focus + * + * @ingroup Entry + */ +EAPI void elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled); + +/** + * Retrieve the attribute to show the input panel automatically. + * + * @param obj The entry object + * @return EINA_TRUE if input panel will be appeared when the entry is clicked or has a focus, EINA_FALSE otherwise + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_input_panel_enabled_get(const Evas_Object *obj); + +/** + * Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types, and so on. + * + * Note that input panel is shown or hidden automatically according to the focus state of entry widget. + * This API can be used in the case of manually controlling by using elm_entry_input_panel_enabled_set(en, EINA_FALSE). + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_input_panel_show(Evas_Object *obj); + +/** + * Hide the input panel (virtual keyboard). + * + * Note that input panel is shown or hidden automatically according to the focus state of entry widget. + * This API can be used in the case of manually controlling by using elm_entry_input_panel_enabled_set(en, EINA_FALSE) + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_input_panel_hide(Evas_Object *obj); + +/** + * Set the language mode of the input panel. + * + * This API can be used if you want to show the alphabet keyboard mode. + * + * @param obj The entry object + * @param lang language to be set to the input panel. + * + * @ingroup Entry + */ +EAPI void elm_entry_input_panel_language_set(Evas_Object *obj, Elm_Input_Panel_Lang lang); + +/** + * Get the language mode of the input panel. + * + * See @ref elm_entry_input_panel_language_set for more details. + * + * @param obj The entry object + * @return input panel language type + * + * @ingroup Entry + */ +EAPI Elm_Input_Panel_Lang elm_entry_input_panel_language_get(const Evas_Object *obj); + +/** + * Set the input panel-specific data to deliver to the input panel. + * + * This API is used by applications to deliver specific data to the input panel. + * The data format MUST be negotiated by both application and the input panel. + * The size and format of data are defined by the input panel. + * + * @param obj The entry object + * @param data The specific data to be set to the input panel. + * @param len the length of data, in bytes, to send to the input panel + * + * @ingroup Entry + */ +EAPI void elm_entry_input_panel_imdata_set(Evas_Object *obj, const void *data, int len); + +/** + * Get the specific data of the current input panel. + * + * See @ref elm_entry_input_panel_imdata_set for more details. + * + * @param obj The entry object + * @param data The specific data to be got from the input panel + * @param len The length of data + * + * @ingroup Entry + */ +EAPI void elm_entry_input_panel_imdata_get(const Evas_Object *obj, void *data, int *len); + +/** + * Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel. + * + * An input panel displays the string or icon associated with this type + * + * @param obj The entry object + * @param return_key_type The type of "return" key on the input panel + * + * @ingroup Entry + */ +EAPI void elm_entry_input_panel_return_key_type_set(Evas_Object *obj, Elm_Input_Panel_Return_Key_Type return_key_type); + +/** + * Get the "return" key type. + * + * @see elm_entry_input_panel_return_key_type_set() for more details + * + * @param obj The entry object + * @return The type of "return" key on the input panel + * + * @ingroup Entry + */ +EAPI Elm_Input_Panel_Return_Key_Type elm_entry_input_panel_return_key_type_get(const Evas_Object *obj); + +/** + * Set the return key on the input panel to be disabled. + * + * @param obj The entry object + * @param disabled The state to put in in: @c EINA_TRUE for + * disabled, @c EINA_FALSE for enabled + * + * @ingroup Entry + */ +EAPI void elm_entry_input_panel_return_key_disabled_set(Evas_Object *obj, Eina_Bool disabled); + +/** + * Get whether the return key on the input panel should be disabled or not. + * + * @param obj The entry object + * @return EINA_TRUE if it should be disabled + * + * @ingroup Entry + */ +EAPI Eina_Bool elm_entry_input_panel_return_key_disabled_get(const Evas_Object *obj); + +/** + * Set whether the return key on the input panel is disabled automatically when entry has no text. + * + * If @p enabled is EINA_TRUE, The return key on input panel is disabled when the entry has no text. + * The return key on the input panel is automatically enabled when the entry has text. + * The default value is EINA_FALSE. + * + * @param obj The entry object + * @param enabled If @p enabled is EINA_TRUE, the return key is automatically disabled when the entry has no text. + * + * @ingroup Entry + */ +EAPI void elm_entry_input_panel_return_key_autoenabled_set(Evas_Object *obj, Eina_Bool enabled); + +/** + * Returns the input method context of the entry. + * + * This function exposes the internal input method context. + * + * IMPORTANT: Many functions may change (i.e delete and create a new one) + * the internal input method context. Do NOT cache the returned object. + * + * @param obj The entry object + * @return The input method context (Ecore_IMF_Context *) in entry. + * + * @ingroup Entry + */ +EAPI void *elm_entry_imf_context_get(Evas_Object *obj); + +/** + * Set the parent of the hover popup + * + * Sets the parent object to use by the hover created by the entry + * when an anchor is clicked. See @ref Hover for more details on this. + * + * @param obj The entry object + * @param parent The object to use as parent for the hover + * + * @ingroup Entry + */ +EAPI void elm_entry_anchor_hover_parent_set(Evas_Object *obj, Evas_Object *parent); + +/** + * Get the parent of the hover popup + * + * Get the object used as parent for the hover created by the entry + * widget. See @ref Hover for more details on this. + * If no parent is set, the same entry object will be used. + * + * @param obj The entry object + * @return The object used as parent for the hover, NULL if none is set. + * + * @ingroup Entry + */ +EAPI Evas_Object *elm_entry_anchor_hover_parent_get(const Evas_Object *obj); + +/** + * Set the style that the hover should use + * + * When creating the popup hover, entry will request that it's + * themed according to @p style. + * + * Setting style no @c NULL means disabling automatic hover. + * + * @param obj The entry object + * @param style The style to use for the underlying hover + * + * @see elm_object_style_set() + * + * @ingroup Entry + */ +EAPI void elm_entry_anchor_hover_style_set(Evas_Object *obj, const char *style); + +/** + * Get the style that the hover should use + * + * Get the style, the hover created by entry will use. + * + * @param obj The entry object + * @return The style to use by the hover. @c NULL means the default is used. + * + * @see elm_object_style_set() + * + * @ingroup Entry + */ +EAPI const char *elm_entry_anchor_hover_style_get(const Evas_Object *obj); + +/** + * Ends the hover popup in the entry + * + * When an anchor is clicked, the entry widget will create a hover + * object to use as a popup with user provided content. This function + * terminates this popup, returning the entry to its normal state. + * + * @param obj The entry object + * + * @ingroup Entry + */ +EAPI void elm_entry_anchor_hover_end(Evas_Object *obj); + +/** + * Set the input panel layout variation of the entry + * + * @param obj The entry object + * @param variation layout variation type + * + * @ingroup Entry + * @since 1.8 + */ +EAPI void elm_entry_input_panel_layout_variation_set(Evas_Object *obj, int variation); + +/** + * Get the input panel layout variation of the entry + * + * @param obj The entry object + * @return layout variation type + * + * @see elm_entry_input_panel_layout_variation_set + * + * @ingroup Entry + * @since 1.8 + */ +EAPI int elm_entry_input_panel_layout_variation_get(const Evas_Object *obj); diff --git a/legacy/elementary/src/lib/elm_flip.h b/legacy/elementary/src/lib/elm_flip.h index ebae36e4dc..7a38602b39 100644 --- a/legacy/elementary/src/lib/elm_flip.h +++ b/legacy/elementary/src/lib/elm_flip.h @@ -37,418 +37,14 @@ * * @{ */ -typedef enum -{ - ELM_FLIP_ROTATE_Y_CENTER_AXIS, - ELM_FLIP_ROTATE_X_CENTER_AXIS, - ELM_FLIP_ROTATE_XZ_CENTER_AXIS, - ELM_FLIP_ROTATE_YZ_CENTER_AXIS, - ELM_FLIP_CUBE_LEFT, - ELM_FLIP_CUBE_RIGHT, - ELM_FLIP_CUBE_UP, - ELM_FLIP_CUBE_DOWN, - ELM_FLIP_PAGE_LEFT, - ELM_FLIP_PAGE_RIGHT, - ELM_FLIP_PAGE_UP, - ELM_FLIP_PAGE_DOWN -} Elm_Flip_Mode; - -typedef enum -{ - ELM_FLIP_INTERACTION_NONE, - ELM_FLIP_INTERACTION_ROTATE, - ELM_FLIP_INTERACTION_CUBE, - ELM_FLIP_INTERACTION_PAGE -} Elm_Flip_Interaction; - -typedef enum -{ - ELM_FLIP_DIRECTION_UP, /**< Allows interaction with the top of the widget */ - ELM_FLIP_DIRECTION_DOWN, /**< Allows interaction with the bottom of the widget */ - ELM_FLIP_DIRECTION_LEFT, /**< Allows interaction with the left portion of the widget */ - ELM_FLIP_DIRECTION_RIGHT /**< Allows interaction with the right portion of the widget */ -} Elm_Flip_Direction; - -#define ELM_OBJ_FLIP_CLASS elm_obj_flip_class_get() - -const Eo_Class *elm_obj_flip_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_FLIP_BASE_ID; - -enum -{ - ELM_OBJ_FLIP_SUB_ID_FRONT_VISIBLE_GET, - ELM_OBJ_FLIP_SUB_ID_PERSPECTIVE_SET, - ELM_OBJ_FLIP_SUB_ID_GO, - ELM_OBJ_FLIP_SUB_ID_GO_TO, - ELM_OBJ_FLIP_SUB_ID_INTERACTION_SET, - ELM_OBJ_FLIP_SUB_ID_INTERACTION_GET, - ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_SET, - ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_GET, - ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_SET, - ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_GET, - ELM_OBJ_FLIP_SUB_ID_LAST -}; - -#define ELM_OBJ_FLIP_ID(sub_id) (ELM_OBJ_FLIP_BASE_ID + sub_id) - - -/** - * @def elm_obj_flip_front_visible_get - * @since 1.8 - * - * @brief Get flip front visibility state - * - * @param[out] ret - * - * @see elm_flip_front_visible_get - */ -#define elm_obj_flip_front_visible_get(ret) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_FRONT_VISIBLE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_flip_go_to - * @since 1.8 - * - * @brief Runs the flip animation to front or back. - * - * @param[in] front - * @param[in] mode - * - * @see elm_flip_go_to - */ -#define elm_obj_flip_go_to(front, mode) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_GO_TO), EO_TYPECHECK(Eina_Bool, front), EO_TYPECHECK(Elm_Flip_Mode, mode) - -/** - * @def elm_obj_flip_go - * @since 1.8 - * - * @brief Runs the flip animation - * - * @param[in] mode - * - * @see elm_flip_go - */ -#define elm_obj_flip_go(mode) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_GO), EO_TYPECHECK(Elm_Flip_Mode, mode) - -/** - * @def elm_obj_flip_interaction_set - * @since 1.8 - * - * @brief Set the interactive flip mode - * - * @param[in] mode - * - * @see elm_flip_interaction_set - */ -#define elm_obj_flip_interaction_set(mode) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_SET), EO_TYPECHECK(Elm_Flip_Interaction, mode) - -/** - * @def elm_obj_flip_interaction_get - * @since 1.8 - * - * @brief Get the interactive flip mode - * - * @param[out] ret - * - * @see elm_flip_interaction_get - */ -#define elm_obj_flip_interaction_get(ret) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_GET), EO_TYPECHECK(Elm_Flip_Interaction *, ret) - -/** - * @def elm_obj_flip_interaction_direction_enabled_set - * @since 1.8 - * - * @brief Set which directions of the flip respond to interactive flip - * - * @param[in] dir - * @param[in] enabled - * - * @see elm_flip_interaction_direction_enabled_set - */ -#define elm_obj_flip_interaction_direction_enabled_set(dir, enabled) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_SET), EO_TYPECHECK(Elm_Flip_Direction, dir), EO_TYPECHECK(Eina_Bool, enabled) - -/** - * @def elm_obj_flip_interaction_direction_enabled_get - * @since 1.8 - * - * @brief Get the enabled state of that flip direction - * - * @param[in] dir - * @param[out] ret - * - * @see elm_flip_interaction_direction_enabled_get - */ -#define elm_obj_flip_interaction_direction_enabled_get(dir, ret) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_GET), EO_TYPECHECK(Elm_Flip_Direction, dir), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_flip_interaction_direction_hitsize_set - * @since 1.8 - * - * @brief Set the amount of the flip that is sensitive to interactive flip - * - * @param[in] dir - * @param[in] hitsize - * - * @see elm_flip_interaction_direction_hitsize_set - */ -#define elm_obj_flip_interaction_direction_hitsize_set(dir, hitsize) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_SET), EO_TYPECHECK(Elm_Flip_Direction, dir), EO_TYPECHECK(double, hitsize) - -/** - * @def elm_obj_flip_interaction_direction_hitsize_get - * @since 1.8 - * - * @brief Get the amount of the flip that is sensitive to interactive flip - * - * @param[in] dir - * @param[out] ret - * - * @see elm_flip_interaction_direction_hitsize_get - */ -#define elm_obj_flip_interaction_direction_hitsize_get(dir, ret) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_GET), EO_TYPECHECK(Elm_Flip_Direction, dir), EO_TYPECHECK(double *, ret) - -/** - * @brief Add a new flip to the parent - * - * @param parent The parent object - * @return The new object or NULL if it cannot be created - * - * @ingroup Flip - */ -EAPI Evas_Object *elm_flip_add(Evas_Object *parent); - -/** - * @brief Get flip front visibility state - * - * @param obj The flip object - * @return EINA_TRUE if front front is showing, EINA_FALSE if the back is - * showing. - * - * @ingroup Flip - */ -EAPI Eina_Bool elm_flip_front_visible_get(const Evas_Object *obj); - -/** - * @brief Set flip perspective - * - * @param obj The flip object - * @param foc The coordinate to set the focus on - * @param x The X coordinate - * @param y The Y coordinate - * - * @warning This function currently does nothing. - * - * @ingroup Flip - */ -EAPI void elm_flip_perspective_set(Evas_Object *obj, Evas_Coord foc, Evas_Coord x, Evas_Coord y); - -/** - * @brief Runs the flip animation - * - * @param obj The flip object - * @param mode The mode type - * - * Flips the front and back contents using the @p mode animation. This - * effectively hides the currently visible content and shows the hidden one. - * - * There a number of possible animations to use for the flipping: - * @li ELM_FLIP_ROTATE_X_CENTER_AXIS - Rotate the currently visible content - * around a horizontal axis in the middle of its height, the other content - * is shown as the other side of the flip. - * @li ELM_FLIP_ROTATE_Y_CENTER_AXIS - Rotate the currently visible content - * around a vertical axis in the middle of its width, the other content is - * shown as the other side of the flip. - * @li ELM_FLIP_ROTATE_XZ_CENTER_AXIS - Rotate the currently visible content - * around a diagonal axis in the middle of its width, the other content is - * shown as the other side of the flip. - * @li ELM_FLIP_ROTATE_YZ_CENTER_AXIS - Rotate the currently visible content - * around a diagonal axis in the middle of its height, the other content is - * shown as the other side of the flip. - * @li ELM_FLIP_CUBE_LEFT - Rotate the currently visible content to the left - * as if the flip was a cube, the other content is show as the right face of - * the cube. - * @li ELM_FLIP_CUBE_RIGHT - Rotate the currently visible content to the - * right as if the flip was a cube, the other content is show as the left - * face of the cube. - * @li ELM_FLIP_CUBE_UP - Rotate the currently visible content up as if the - * flip was a cube, the other content is show as the bottom face of the cube. - * @li ELM_FLIP_CUBE_DOWN - Rotate the currently visible content down as if - * the flip was a cube, the other content is show as the upper face of the - * cube. - * @li ELM_FLIP_PAGE_LEFT - Move the currently visible content to the left as - * if the flip was a book, the other content is shown as the page below that. - * @li ELM_FLIP_PAGE_RIGHT - Move the currently visible content to the right - * as if the flip was a book, the other content is shown as the page below - * that. - * @li ELM_FLIP_PAGE_UP - Move the currently visible content up as if the - * flip was a book, the other content is shown as the page below that. - * @li ELM_FLIP_PAGE_DOWN - Move the currently visible content down as if the - * flip was a book, the other content is shown as the page below that. - * - * @image html elm_flip.png - * @image latex elm_flip.eps width=\textwidth - * - * @see elm_flip_go_to() - * - * @ingroup Flip - */ -EAPI void elm_flip_go(Evas_Object *obj, Elm_Flip_Mode mode); - -/** - * @brief Runs the flip animation to front or back. - * - * @param obj The flip object - * @param front if @c EINA_TRUE, makes front visible, otherwise makes back. - * @param mode The mode type - * - * Flips the front and back contents using the @p mode animation. This - * effectively hides the currently visible content and shows the hidden one. - * - * There a number of possible animations to use for the flipping: - * @li ELM_FLIP_ROTATE_X_CENTER_AXIS - Rotate the currently visible content - * around a horizontal axis in the middle of its height, the other content - * is shown as the other side of the flip. - * @li ELM_FLIP_ROTATE_Y_CENTER_AXIS - Rotate the currently visible content - * around a vertical axis in the middle of its width, the other content is - * shown as the other side of the flip. - * @li ELM_FLIP_ROTATE_XZ_CENTER_AXIS - Rotate the currently visible content - * around a diagonal axis in the middle of its width, the other content is - * shown as the other side of the flip. - * @li ELM_FLIP_ROTATE_YZ_CENTER_AXIS - Rotate the currently visible content - * around a diagonal axis in the middle of its height, the other content is - * shown as the other side of the flip. - * @li ELM_FLIP_CUBE_LEFT - Rotate the currently visible content to the left - * as if the flip was a cube, the other content is show as the right face of - * the cube. - * @li ELM_FLIP_CUBE_RIGHT - Rotate the currently visible content to the - * right as if the flip was a cube, the other content is show as the left - * face of the cube. - * @li ELM_FLIP_CUBE_UP - Rotate the currently visible content up as if the - * flip was a cube, the other content is show as the bottom face of the cube. - * @li ELM_FLIP_CUBE_DOWN - Rotate the currently visible content down as if - * the flip was a cube, the other content is show as the upper face of the - * cube. - * @li ELM_FLIP_PAGE_LEFT - Move the currently visible content to the left as - * if the flip was a book, the other content is shown as the page below that. - * @li ELM_FLIP_PAGE_RIGHT - Move the currently visible content to the right - * as if the flip was a book, the other content is shown as the page below - * that. - * @li ELM_FLIP_PAGE_UP - Move the currently visible content up as if the - * flip was a book, the other content is shown as the page below that. - * @li ELM_FLIP_PAGE_DOWN - Move the currently visible content down as if the - * flip was a book, the other content is shown as the page below that. - * - * @image html elm_flip.png - * @image latex elm_flip.eps width=\textwidth - * - * @since 1.7 - * - * @ingroup Flip - */ -EAPI void elm_flip_go_to(Evas_Object *obj, Eina_Bool front, Elm_Flip_Mode mode); - -/** - * @brief Set the interactive flip mode - * - * @param obj The flip object - * @param mode The interactive flip mode to use - * - * This sets if the flip should be interactive (allow user to click and - * drag a side of the flip to reveal the back page and cause it to flip). - * By default a flip is not interactive. You may also need to set which - * sides of the flip are "active" for flipping and how much space they use - * (a minimum of a finger size) with elm_flip_interaction_direction_enabled_set() - * and elm_flip_interaction_direction_hitsize_set() - * - * The four available mode of interaction are: - * @li ELM_FLIP_INTERACTION_NONE - No interaction is allowed - * @li ELM_FLIP_INTERACTION_ROTATE - Interaction will cause rotate animation - * @li ELM_FLIP_INTERACTION_CUBE - Interaction will cause cube animation - * @li ELM_FLIP_INTERACTION_PAGE - Interaction will cause page animation - * - * @note ELM_FLIP_INTERACTION_ROTATE won't cause - * ELM_FLIP_ROTATE_XZ_CENTER_AXIS or ELM_FLIP_ROTATE_YZ_CENTER_AXIS to - * happen, those can only be achieved with elm_flip_go(); - * - * @ingroup Flip - */ -EAPI void elm_flip_interaction_set(Evas_Object *obj, Elm_Flip_Interaction mode); - -/** - * @brief Get the interactive flip mode - * - * @param obj The flip object - * @return The interactive flip mode - * - * Returns the interactive flip mode set by elm_flip_interaction_set() - * - * @ingroup Flip - */ -EAPI Elm_Flip_Interaction elm_flip_interaction_get(const Evas_Object *obj); - -/** - * @brief Set which directions of the flip respond to interactive flip - * - * @param obj The flip object - * @param dir The direction to change - * @param enabled If that direction is enabled or not - * - * By default all directions are disabled, so you may want to enable the - * desired directions for flipping if you need interactive flipping. You must - * call this function once for each direction that should be enabled. - * - * @see elm_flip_interaction_set() - * - * @ingroup Flip - */ -EAPI void elm_flip_interaction_direction_enabled_set(Evas_Object *obj, Elm_Flip_Direction dir, Eina_Bool enabled); - -/** - * @brief Get the enabled state of that flip direction - * - * @param obj The flip object - * @param dir The direction to check - * @return If that direction is enabled or not - * - * Gets the enabled state set by elm_flip_interaction_direction_enabled_set() - * - * @see elm_flip_interaction_set() - * - * @ingroup Flip - */ -EAPI Eina_Bool elm_flip_interaction_direction_enabled_get(Evas_Object *obj, Elm_Flip_Direction dir); - -/** - * @brief Set the amount of the flip that is sensitive to interactive flip - * - * @param obj The flip object - * @param dir The direction to modify - * @param hitsize The amount of that dimension (0.0 to 1.0) to use - * - * Set the amount of the flip that is sensitive to interactive flip, with 0 - * representing no area in the flip and 1 representing the entire flip. There - * is however a consideration to be made in that the area will never be - * smaller than the finger size set(as set in your Elementary configuration). - * - * @see elm_flip_interaction_set() - * - * @ingroup Flip - */ -EAPI void elm_flip_interaction_direction_hitsize_set(Evas_Object *obj, Elm_Flip_Direction dir, double hitsize); - -/** - * @brief Get the amount of the flip that is sensitive to interactive flip - * - * @param obj The flip object - * @param dir The direction to check - * @return The size set for that direction - * - * Returns the amount of sensitive area set by - * elm_flip_interaction_direction_hitsize_set(). - * - * @ingroup Flip - */ -EAPI double elm_flip_interaction_direction_hitsize_get(Evas_Object *obj, Elm_Flip_Direction dir); +#include "elm_flip_common.h" +#ifdef EFL_EO_API_SUPPORT +#include "elm_flip_eo.h" +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include "elm_flip_legacy.h" +#endif /** * @} */ diff --git a/legacy/elementary/src/lib/elm_flip_common.h b/legacy/elementary/src/lib/elm_flip_common.h new file mode 100644 index 0000000000..cfd2bd8f3a --- /dev/null +++ b/legacy/elementary/src/lib/elm_flip_common.h @@ -0,0 +1,32 @@ +typedef enum +{ + ELM_FLIP_ROTATE_Y_CENTER_AXIS, + ELM_FLIP_ROTATE_X_CENTER_AXIS, + ELM_FLIP_ROTATE_XZ_CENTER_AXIS, + ELM_FLIP_ROTATE_YZ_CENTER_AXIS, + ELM_FLIP_CUBE_LEFT, + ELM_FLIP_CUBE_RIGHT, + ELM_FLIP_CUBE_UP, + ELM_FLIP_CUBE_DOWN, + ELM_FLIP_PAGE_LEFT, + ELM_FLIP_PAGE_RIGHT, + ELM_FLIP_PAGE_UP, + ELM_FLIP_PAGE_DOWN +} Elm_Flip_Mode; + +typedef enum +{ + ELM_FLIP_INTERACTION_NONE, + ELM_FLIP_INTERACTION_ROTATE, + ELM_FLIP_INTERACTION_CUBE, + ELM_FLIP_INTERACTION_PAGE +} Elm_Flip_Interaction; + +typedef enum +{ + ELM_FLIP_DIRECTION_UP, /**< Allows interaction with the top of the widget */ + ELM_FLIP_DIRECTION_DOWN, /**< Allows interaction with the bottom of the widget */ + ELM_FLIP_DIRECTION_LEFT, /**< Allows interaction with the left portion of the widget */ + ELM_FLIP_DIRECTION_RIGHT /**< Allows interaction with the right portion of the widget */ +} Elm_Flip_Direction; + diff --git a/legacy/elementary/src/lib/elm_flip_eo.h b/legacy/elementary/src/lib/elm_flip_eo.h new file mode 100644 index 0000000000..1e17a62f5b --- /dev/null +++ b/legacy/elementary/src/lib/elm_flip_eo.h @@ -0,0 +1,154 @@ +#define ELM_OBJ_FLIP_CLASS elm_obj_flip_class_get() + +const Eo_Class *elm_obj_flip_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_FLIP_BASE_ID; + +enum +{ + ELM_OBJ_FLIP_SUB_ID_FRONT_VISIBLE_GET, + ELM_OBJ_FLIP_SUB_ID_PERSPECTIVE_SET, + ELM_OBJ_FLIP_SUB_ID_GO, + ELM_OBJ_FLIP_SUB_ID_GO_TO, + ELM_OBJ_FLIP_SUB_ID_INTERACTION_SET, + ELM_OBJ_FLIP_SUB_ID_INTERACTION_GET, + ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_SET, + ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_GET, + ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_SET, + ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_GET, + ELM_OBJ_FLIP_SUB_ID_LAST +}; + +#define ELM_OBJ_FLIP_ID(sub_id) (ELM_OBJ_FLIP_BASE_ID + sub_id) + + +/** + * @def elm_obj_flip_front_visible_get + * @since 1.8 + * + * @brief Get flip front visibility state + * + * @param[out] ret + * + * @see elm_flip_front_visible_get + * + * @ingroup Flip + */ +#define elm_obj_flip_front_visible_get(ret) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_FRONT_VISIBLE_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_flip_go_to + * @since 1.8 + * + * @brief Runs the flip animation to front or back. + * + * @param[in] front + * @param[in] mode + * + * @see elm_flip_go_to + * + * @ingroup Flip + */ +#define elm_obj_flip_go_to(front, mode) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_GO_TO), EO_TYPECHECK(Eina_Bool, front), EO_TYPECHECK(Elm_Flip_Mode, mode) + +/** + * @def elm_obj_flip_go + * @since 1.8 + * + * @brief Runs the flip animation + * + * @param[in] mode + * + * @see elm_flip_go + * + * @ingroup Flip + */ +#define elm_obj_flip_go(mode) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_GO), EO_TYPECHECK(Elm_Flip_Mode, mode) + +/** + * @def elm_obj_flip_interaction_set + * @since 1.8 + * + * @brief Set the interactive flip mode + * + * @param[in] mode + * + * @see elm_flip_interaction_set + * + * @ingroup Flip + */ +#define elm_obj_flip_interaction_set(mode) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_SET), EO_TYPECHECK(Elm_Flip_Interaction, mode) + +/** + * @def elm_obj_flip_interaction_get + * @since 1.8 + * + * @brief Get the interactive flip mode + * + * @param[out] ret + * + * @see elm_flip_interaction_get + * + * @ingroup Flip + */ +#define elm_obj_flip_interaction_get(ret) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_GET), EO_TYPECHECK(Elm_Flip_Interaction *, ret) + +/** + * @def elm_obj_flip_interaction_direction_enabled_set + * @since 1.8 + * + * @brief Set which directions of the flip respond to interactive flip + * + * @param[in] dir + * @param[in] enabled + * + * @see elm_flip_interaction_direction_enabled_set + * + * @ingroup Flip + */ +#define elm_obj_flip_interaction_direction_enabled_set(dir, enabled) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_SET), EO_TYPECHECK(Elm_Flip_Direction, dir), EO_TYPECHECK(Eina_Bool, enabled) + +/** + * @def elm_obj_flip_interaction_direction_enabled_get + * @since 1.8 + * + * @brief Get the enabled state of that flip direction + * + * @param[in] dir + * @param[out] ret + * + * @see elm_flip_interaction_direction_enabled_get + * + * @ingroup Flip + */ +#define elm_obj_flip_interaction_direction_enabled_get(dir, ret) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_GET), EO_TYPECHECK(Elm_Flip_Direction, dir), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_flip_interaction_direction_hitsize_set + * @since 1.8 + * + * @brief Set the amount of the flip that is sensitive to interactive flip + * + * @param[in] dir + * @param[in] hitsize + * + * @see elm_flip_interaction_direction_hitsize_set + * + * @ingroup Flip + */ +#define elm_obj_flip_interaction_direction_hitsize_set(dir, hitsize) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_SET), EO_TYPECHECK(Elm_Flip_Direction, dir), EO_TYPECHECK(double, hitsize) + +/** + * @def elm_obj_flip_interaction_direction_hitsize_get + * @since 1.8 + * + * @brief Get the amount of the flip that is sensitive to interactive flip + * + * @param[in] dir + * @param[out] ret + * + * @see elm_flip_interaction_direction_hitsize_get + * + * @ingroup Flip + */ +#define elm_obj_flip_interaction_direction_hitsize_get(dir, ret) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_GET), EO_TYPECHECK(Elm_Flip_Direction, dir), EO_TYPECHECK(double *, ret) diff --git a/legacy/elementary/src/lib/elm_flip_legacy.h b/legacy/elementary/src/lib/elm_flip_legacy.h new file mode 100644 index 0000000000..8a8f302733 --- /dev/null +++ b/legacy/elementary/src/lib/elm_flip_legacy.h @@ -0,0 +1,242 @@ +/** + * @brief Add a new flip to the parent + * + * @param parent The parent object + * @return The new object or NULL if it cannot be created + * + * @ingroup Flip + */ +EAPI Evas_Object *elm_flip_add(Evas_Object *parent); + +/** + * @brief Get flip front visibility state + * + * @param obj The flip object + * @return EINA_TRUE if front front is showing, EINA_FALSE if the back is + * showing. + * + * @ingroup Flip + */ +EAPI Eina_Bool elm_flip_front_visible_get(const Evas_Object *obj); + +/** + * @brief Set flip perspective + * + * @param obj The flip object + * @param foc The coordinate to set the focus on + * @param x The X coordinate + * @param y The Y coordinate + * + * @warning This function currently does nothing. + * + * @ingroup Flip + */ +EAPI void elm_flip_perspective_set(Evas_Object *obj, Evas_Coord foc, Evas_Coord x, Evas_Coord y); + +/** + * @brief Runs the flip animation + * + * @param obj The flip object + * @param mode The mode type + * + * Flips the front and back contents using the @p mode animation. This + * effectively hides the currently visible content and shows the hidden one. + * + * There a number of possible animations to use for the flipping: + * @li ELM_FLIP_ROTATE_X_CENTER_AXIS - Rotate the currently visible content + * around a horizontal axis in the middle of its height, the other content + * is shown as the other side of the flip. + * @li ELM_FLIP_ROTATE_Y_CENTER_AXIS - Rotate the currently visible content + * around a vertical axis in the middle of its width, the other content is + * shown as the other side of the flip. + * @li ELM_FLIP_ROTATE_XZ_CENTER_AXIS - Rotate the currently visible content + * around a diagonal axis in the middle of its width, the other content is + * shown as the other side of the flip. + * @li ELM_FLIP_ROTATE_YZ_CENTER_AXIS - Rotate the currently visible content + * around a diagonal axis in the middle of its height, the other content is + * shown as the other side of the flip. + * @li ELM_FLIP_CUBE_LEFT - Rotate the currently visible content to the left + * as if the flip was a cube, the other content is show as the right face of + * the cube. + * @li ELM_FLIP_CUBE_RIGHT - Rotate the currently visible content to the + * right as if the flip was a cube, the other content is show as the left + * face of the cube. + * @li ELM_FLIP_CUBE_UP - Rotate the currently visible content up as if the + * flip was a cube, the other content is show as the bottom face of the cube. + * @li ELM_FLIP_CUBE_DOWN - Rotate the currently visible content down as if + * the flip was a cube, the other content is show as the upper face of the + * cube. + * @li ELM_FLIP_PAGE_LEFT - Move the currently visible content to the left as + * if the flip was a book, the other content is shown as the page below that. + * @li ELM_FLIP_PAGE_RIGHT - Move the currently visible content to the right + * as if the flip was a book, the other content is shown as the page below + * that. + * @li ELM_FLIP_PAGE_UP - Move the currently visible content up as if the + * flip was a book, the other content is shown as the page below that. + * @li ELM_FLIP_PAGE_DOWN - Move the currently visible content down as if the + * flip was a book, the other content is shown as the page below that. + * + * @image html elm_flip.png + * @image latex elm_flip.eps width=\textwidth + * + * @see elm_flip_go_to() + * + * @ingroup Flip + */ +EAPI void elm_flip_go(Evas_Object *obj, Elm_Flip_Mode mode); + +/** + * @brief Runs the flip animation to front or back. + * + * @param obj The flip object + * @param front if @c EINA_TRUE, makes front visible, otherwise makes back. + * @param mode The mode type + * + * Flips the front and back contents using the @p mode animation. This + * effectively hides the currently visible content and shows the hidden one. + * + * There a number of possible animations to use for the flipping: + * @li ELM_FLIP_ROTATE_X_CENTER_AXIS - Rotate the currently visible content + * around a horizontal axis in the middle of its height, the other content + * is shown as the other side of the flip. + * @li ELM_FLIP_ROTATE_Y_CENTER_AXIS - Rotate the currently visible content + * around a vertical axis in the middle of its width, the other content is + * shown as the other side of the flip. + * @li ELM_FLIP_ROTATE_XZ_CENTER_AXIS - Rotate the currently visible content + * around a diagonal axis in the middle of its width, the other content is + * shown as the other side of the flip. + * @li ELM_FLIP_ROTATE_YZ_CENTER_AXIS - Rotate the currently visible content + * around a diagonal axis in the middle of its height, the other content is + * shown as the other side of the flip. + * @li ELM_FLIP_CUBE_LEFT - Rotate the currently visible content to the left + * as if the flip was a cube, the other content is show as the right face of + * the cube. + * @li ELM_FLIP_CUBE_RIGHT - Rotate the currently visible content to the + * right as if the flip was a cube, the other content is show as the left + * face of the cube. + * @li ELM_FLIP_CUBE_UP - Rotate the currently visible content up as if the + * flip was a cube, the other content is show as the bottom face of the cube. + * @li ELM_FLIP_CUBE_DOWN - Rotate the currently visible content down as if + * the flip was a cube, the other content is show as the upper face of the + * cube. + * @li ELM_FLIP_PAGE_LEFT - Move the currently visible content to the left as + * if the flip was a book, the other content is shown as the page below that. + * @li ELM_FLIP_PAGE_RIGHT - Move the currently visible content to the right + * as if the flip was a book, the other content is shown as the page below + * that. + * @li ELM_FLIP_PAGE_UP - Move the currently visible content up as if the + * flip was a book, the other content is shown as the page below that. + * @li ELM_FLIP_PAGE_DOWN - Move the currently visible content down as if the + * flip was a book, the other content is shown as the page below that. + * + * @image html elm_flip.png + * @image latex elm_flip.eps width=\textwidth + * + * @since 1.7 + * + * @ingroup Flip + */ +EAPI void elm_flip_go_to(Evas_Object *obj, Eina_Bool front, Elm_Flip_Mode mode); + +/** + * @brief Set the interactive flip mode + * + * @param obj The flip object + * @param mode The interactive flip mode to use + * + * This sets if the flip should be interactive (allow user to click and + * drag a side of the flip to reveal the back page and cause it to flip). + * By default a flip is not interactive. You may also need to set which + * sides of the flip are "active" for flipping and how much space they use + * (a minimum of a finger size) with elm_flip_interaction_direction_enabled_set() + * and elm_flip_interaction_direction_hitsize_set() + * + * The four available mode of interaction are: + * @li ELM_FLIP_INTERACTION_NONE - No interaction is allowed + * @li ELM_FLIP_INTERACTION_ROTATE - Interaction will cause rotate animation + * @li ELM_FLIP_INTERACTION_CUBE - Interaction will cause cube animation + * @li ELM_FLIP_INTERACTION_PAGE - Interaction will cause page animation + * + * @note ELM_FLIP_INTERACTION_ROTATE won't cause + * ELM_FLIP_ROTATE_XZ_CENTER_AXIS or ELM_FLIP_ROTATE_YZ_CENTER_AXIS to + * happen, those can only be achieved with elm_flip_go(); + * + * @ingroup Flip + */ +EAPI void elm_flip_interaction_set(Evas_Object *obj, Elm_Flip_Interaction mode); + +/** + * @brief Get the interactive flip mode + * + * @param obj The flip object + * @return The interactive flip mode + * + * Returns the interactive flip mode set by elm_flip_interaction_set() + * + * @ingroup Flip + */ +EAPI Elm_Flip_Interaction elm_flip_interaction_get(const Evas_Object *obj); + +/** + * @brief Set which directions of the flip respond to interactive flip + * + * @param obj The flip object + * @param dir The direction to change + * @param enabled If that direction is enabled or not + * + * By default all directions are disabled, so you may want to enable the + * desired directions for flipping if you need interactive flipping. You must + * call this function once for each direction that should be enabled. + * + * @see elm_flip_interaction_set() + * + * @ingroup Flip + */ +EAPI void elm_flip_interaction_direction_enabled_set(Evas_Object *obj, Elm_Flip_Direction dir, Eina_Bool enabled); + +/** + * @brief Get the enabled state of that flip direction + * + * @param obj The flip object + * @param dir The direction to check + * @return If that direction is enabled or not + * + * Gets the enabled state set by elm_flip_interaction_direction_enabled_set() + * + * @see elm_flip_interaction_set() + * + * @ingroup Flip + */ +EAPI Eina_Bool elm_flip_interaction_direction_enabled_get(Evas_Object *obj, Elm_Flip_Direction dir); + +/** + * @brief Set the amount of the flip that is sensitive to interactive flip + * + * @param obj The flip object + * @param dir The direction to modify + * @param hitsize The amount of that dimension (0.0 to 1.0) to use + * + * Set the amount of the flip that is sensitive to interactive flip, with 0 + * representing no area in the flip and 1 representing the entire flip. There + * is however a consideration to be made in that the area will never be + * smaller than the finger size set(as set in your Elementary configuration). + * + * @see elm_flip_interaction_set() + * + * @ingroup Flip + */ +EAPI void elm_flip_interaction_direction_hitsize_set(Evas_Object *obj, Elm_Flip_Direction dir, double hitsize); + +/** + * @brief Get the amount of the flip that is sensitive to interactive flip + * + * @param obj The flip object + * @param dir The direction to check + * @return The size set for that direction + * + * Returns the amount of sensitive area set by + * elm_flip_interaction_direction_hitsize_set(). + * + * @ingroup Flip + */ +EAPI double elm_flip_interaction_direction_hitsize_get(Evas_Object *obj, Elm_Flip_Direction dir); diff --git a/legacy/elementary/src/lib/elm_flipselector.h b/legacy/elementary/src/lib/elm_flipselector.h index fb9832d026..03610b9767 100644 --- a/legacy/elementary/src/lib/elm_flipselector.h +++ b/legacy/elementary/src/lib/elm_flipselector.h @@ -49,420 +49,17 @@ * @li @ref flipselector_example */ -#define ELM_OBJ_FLIPSELECTOR_CLASS elm_obj_flipselector_class_get() - -const Eo_Class *elm_obj_flipselector_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_FLIPSELECTOR_BASE_ID; - -typedef void (*flipselector_func_type)(void *, Evas_Object *, void *); - -enum -{ - ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_NEXT, - ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_PREV, - ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_APPEND, - ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_PREPEND, - ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEMS_GET, - ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_ITEM_GET, - ELM_OBJ_FLIPSELECTOR_SUB_ID_LAST_ITEM_GET, - ELM_OBJ_FLIPSELECTOR_SUB_ID_SELECTED_ITEM_GET, - ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_SET, - ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_GET, - ELM_OBJ_FLIPSELECTOR_SUB_ID_LAST -}; - -#define ELM_OBJ_FLIPSELECTOR_ID(sub_id) (ELM_OBJ_FLIPSELECTOR_BASE_ID + sub_id) - - -/** - * @def elm_obj_flipselector_flip_next - * @since 1.8 - * - * Programmatically select the next item of a flip selector widget - * - * - * @see elm_flipselector_flip_next - */ -#define elm_obj_flipselector_flip_next() ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_NEXT) - -/** - * @def elm_obj_flipselector_flip_prev - * @since 1.8 - * - * Programmatically select the previous item of a flip selector - * - * - * @see elm_flipselector_flip_prev - */ -#define elm_obj_flipselector_flip_prev() ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_PREV) - - -/** - * @def elm_obj_flipselector_item_append - * @since 1.8 - * - * Append a (text) item to a flip selector widget - * - * @param[in] label - * @param[in] func - * @param[in] data - * @param[out] ret - * - * @see elm_flipselector_item_append - */ -#define elm_obj_flipselector_item_append(label, func, data, ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(flipselector_func_type, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Flipselector_Item **, ret) - -/** - * @def elm_obj_flipselector_item_prepend - * @since 1.8 - * - * Prepend a (text) item to a flip selector widget - * - * @param[in] label - * @param[in] func - * @param[in] data - * @param[out] ret - * - * @see elm_flipselector_item_prepend - */ -#define elm_obj_flipselector_item_prepend(label, func, data, ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(flipselector_func_type, func), EO_TYPECHECK(void *, data), EO_TYPECHECK(Elm_Flipselector_Item **, ret) - - -/** - * @def elm_obj_flipselector_items_get - * @since 1.8 - * - * Get the internal list of items in a given flip selector widget. - * - * @param[out] ret - * - * @see elm_flipselector_items_get - */ -#define elm_obj_flipselector_items_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret) - -/** - * @def elm_obj_flipselector_first_item_get - * @since 1.8 - * - * Get the first item in the given flip selector widget's list of - * - * @param[out] ret - * - * @see elm_flipselector_first_item_get - */ -#define elm_obj_flipselector_first_item_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_flipselector_last_item_get - * @since 1.8 - * - * Get the last item in the given flip selector widget's list of - * - * @param[out] ret - * - * @see elm_flipselector_last_item_get - */ -#define elm_obj_flipselector_last_item_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_flipselector_selected_item_get - * @since 1.8 - * - * Get the currently selected item in a flip selector widget. - * - * @param[out] ret - * - * @see elm_flipselector_selected_item_get - */ -#define elm_obj_flipselector_selected_item_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_flipselector_first_interval_set - * @since 1.8 - * - * Set the interval on time updates for a user mouse button hold - * - * @param[in] interval - * - * @see elm_flipselector_first_interval_set - */ -#define elm_obj_flipselector_first_interval_set(interval) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_SET), EO_TYPECHECK(double, interval) - -/** - * @def elm_obj_flipselector_first_interval_get - * @since 1.8 - * - * Get the interval on time updates for an user mouse button hold - * - * @param[out] ret - * - * @see elm_flipselector_first_interval_get - */ -#define elm_obj_flipselector_first_interval_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_GET), EO_TYPECHECK(double *, ret) /** * @addtogroup Flipselector * @{ */ -/** - * Add a new flip selector widget to the given parent Elementary - * (container) widget - * - * @param parent The parent object - * @return a new flip selector widget handle or @c NULL, on errors - * - * This function inserts a new flip selector widget on the canvas. - * - * @ingroup Flipselector - */ -EAPI Evas_Object *elm_flipselector_add(Evas_Object *parent); - -/** - * Programmatically select the next item of a flip selector widget - * - * @param obj The flipselector object - * - * @note The selection will be animated. Also, if it reaches the - * end of its list of member items, it will continue with the first - * one onwards. - * - * @ingroup Flipselector - */ -EAPI void elm_flipselector_flip_next(Evas_Object *obj); - -/** - * Programmatically select the previous item of a flip selector - * widget - * - * @param obj The flipselector object - * - * @note The selection will be animated. Also, if it reaches the - * beginning of its list of member items, it will continue with the - * last one backwards. - * - * @ingroup Flipselector - */ -EAPI void elm_flipselector_flip_prev(Evas_Object *obj); - -/** - * Append a (text) item to a flip selector widget - * - * @param obj The flipselector object - * @param label The (text) label of the new item - * @param func Convenience callback function to take place when - * item is selected - * @param data Data passed to @p func, above - * @return A handle to the item added or @c NULL, on errors - * - * The widget's list of labels to show will be appended with the - * given value. If the user wishes so, a callback function pointer - * can be passed, which will get called when this same item is - * selected. - * - * @note The current selection @b won't be modified by appending an - * element to the list. - * - * @note The maximum length of the text label is going to be - * determined by the widget's theme. Strings larger than - * that value are going to be @b truncated. - * - * @ingroup Flipselector - */ -EAPI Elm_Object_Item *elm_flipselector_item_append(Evas_Object *obj, const char *label, Evas_Smart_Cb func, const void *data); - -/** - * Prepend a (text) item to a flip selector widget - * - * @param obj The flipselector object - * @param label The (text) label of the new item - * @param func Convenience callback function to take place when - * item is selected - * @param data Data passed to @p func, above - * @return A handle to the item added or @c NULL, on errors - * - * The widget's list of labels to show will be prepended with the - * given value. If the user wishes so, a callback function pointer - * can be passed, which will get called when this same item is - * selected. - * - * @note The current selection @b won't be modified by prepending - * an element to the list. - * - * @note The maximum length of the text label is going to be - * determined by the widget's theme. Strings larger than - * that value are going to be @b truncated. - * - * @ingroup Flipselector - */ -EAPI Elm_Object_Item *elm_flipselector_item_prepend(Evas_Object *obj, const char *label, Evas_Smart_Cb func, void *data); - -/** - * Get the internal list of items in a given flip selector widget. - * - * @param obj The flipselector object - * @return The list of items (#Elm_Object_Item as data) or - * @c NULL on errors. - * - * This list is @b not to be modified in any way and must not be - * freed. Use the list members with functions like - * elm_object_item_text_set(), - * elm_object_item_text_get(), - * elm_object_item_del(), - * elm_flipselector_item_selected_get(), - * elm_flipselector_item_selected_set(). - * - * @warning This list is only valid until @p obj object's internal - * items list is changed. It should be fetched again with another - * call to this function when changes happen. - * - * @ingroup Flipselector - */ -EAPI const Eina_List *elm_flipselector_items_get(const Evas_Object *obj); - -/** - * Get the first item in the given flip selector widget's list of - * items. - * - * @param obj The flipselector object - * @return The first item or @c NULL, if it has no items (and on - * errors) - * - * @see elm_flipselector_item_append() - * @see elm_flipselector_last_item_get() - * - * @ingroup Flipselector - */ -EAPI Elm_Object_Item *elm_flipselector_first_item_get(const Evas_Object *obj); - -/** - * Get the last item in the given flip selector widget's list of - * items. - * - * @param obj The flipselector object - * @return The last item or @c NULL, if it has no items (and on - * errors) - * - * @see elm_flipselector_item_prepend() - * @see elm_flipselector_first_item_get() - * - * @ingroup Flipselector - */ -EAPI Elm_Object_Item *elm_flipselector_last_item_get(const Evas_Object *obj); - -/** - * Get the currently selected item in a flip selector widget. - * - * @param obj The flipselector object - * @return The selected item or @c NULL, if the widget has no items - * (and on errors) - * - * @ingroup Flipselector - */ -EAPI Elm_Object_Item *elm_flipselector_selected_item_get(const Evas_Object *obj); - -/** - * Set whether a given flip selector widget's item should be the - * currently selected one. - * - * @param it The flip selector item - * @param selected @c EINA_TRUE to select it, @c EINA_FALSE to unselect. - * - * This sets whether @p item is or not the selected (thus, under - * display) one. If @p item is different than the one under display, - * the latter will be unselected. If the @p item is set to be - * unselected, on the other hand, the @b first item in the widget's - * internal members list will be the new selected one. - * - * @see elm_flipselector_item_selected_get() - * - * @ingroup Flipselector - */ -EAPI void elm_flipselector_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); - -/** - * Get whether a given flip selector widget's item is the currently - * selected one. - * - * @param it The flip selector item - * @return @c EINA_TRUE, if it's selected, @c EINA_FALSE otherwise - * (or on errors). - * - * @see elm_flipselector_item_selected_set() - * - * @ingroup Flipselector - */ -EAPI Eina_Bool elm_flipselector_item_selected_get(const Elm_Object_Item *it); - -/** - * Gets the item before @p item in a flip selector widget's internal list of - * items. - * - * @param it The item to fetch previous from - * @return The item before the @p item, in its parent's list. If there is no - * previous item for @p item or there's an error, @c NULL is returned. - * - * @see elm_flipselector_item_next_get() - * - * @ingroup Flipselector - */ -EAPI Elm_Object_Item *elm_flipselector_item_prev_get(const Elm_Object_Item *it); - -/** - * Gets the item after @p item in a flip selector widget's - * internal list of items. - * - * @param it The item to fetch next from - * @return The item after the @p item, in its parent's list. If there is no next - * item for @p item or there's an error, @c NULL is returned. - * - * @see elm_flipselector_item_prev_get() - * - * @ingroup Flipselector - */ -EAPI Elm_Object_Item *elm_flipselector_item_next_get(const Elm_Object_Item *it); - -/** - * Set the interval on time updates for a user mouse button hold - * on a flip selector widget. - * - * @param obj The flip selector object - * @param interval The (first) interval value in seconds - * - * This interval value is @b decreased while the user holds the - * mouse pointer either flipping up or flipping down a given flip - * selector. - * - * This helps the user to get to a given item distant from the - * current one easier/faster, as it will start to flip quicker and - * quicker on mouse button holds. - * - * The calculation for the next flip interval value, starting from - * the one set with this call, is the previous interval divided by - * 1.05, so it decreases a little bit. - * - * The default starting interval value for automatic flips is - * @b 0.85 seconds. - * - * @see elm_flipselector_first_interval_get() - * - * @ingroup Flipselector - */ -EAPI void elm_flipselector_first_interval_set(Evas_Object *obj, double interval); - -/** - * Get the interval on time updates for an user mouse button hold - * on a flip selector widget. - * - * @param obj The flip selector object - * @return The (first) interval value, in seconds, set on it - * - * @see elm_flipselector_first_interval_set() for more details - * - * @ingroup Flipselector - */ -EAPI double elm_flipselector_first_interval_get(const Evas_Object *obj); - +#ifdef EFL_EO_API_SUPPORT +#include "elm_flipselector_eo.h" +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include "elm_flipselector_legacy.h" +#endif /** * @} */ diff --git a/legacy/elementary/src/lib/elm_flipselector_eo.h b/legacy/elementary/src/lib/elm_flipselector_eo.h new file mode 100644 index 0000000000..d9526c5e71 --- /dev/null +++ b/legacy/elementary/src/lib/elm_flipselector_eo.h @@ -0,0 +1,171 @@ +#define ELM_OBJ_FLIPSELECTOR_CLASS elm_obj_flipselector_class_get() + +const Eo_Class *elm_obj_flipselector_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_FLIPSELECTOR_BASE_ID; + +typedef void (*flipselector_func_type)(void *, Evas_Object *, void *); + +enum +{ + ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_NEXT, + ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_PREV, + ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_APPEND, + ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_PREPEND, + ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEMS_GET, + ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_ITEM_GET, + ELM_OBJ_FLIPSELECTOR_SUB_ID_LAST_ITEM_GET, + ELM_OBJ_FLIPSELECTOR_SUB_ID_SELECTED_ITEM_GET, + ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_SET, + ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_GET, + ELM_OBJ_FLIPSELECTOR_SUB_ID_LAST +}; + +#define ELM_OBJ_FLIPSELECTOR_ID(sub_id) (ELM_OBJ_FLIPSELECTOR_BASE_ID + sub_id) + + +/** + * @def elm_obj_flipselector_flip_next + * @since 1.8 + * + * Programmatically select the next item of a flip selector widget + * + * + * @see elm_flipselector_flip_next + * + * @ingroup Flipselector + */ +#define elm_obj_flipselector_flip_next() ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_NEXT) + +/** + * @def elm_obj_flipselector_flip_prev + * @since 1.8 + * + * Programmatically select the previous item of a flip selector + * + * + * @see elm_flipselector_flip_prev + * + * @ingroup Flipselector + */ +#define elm_obj_flipselector_flip_prev() ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_PREV) + + +/** + * @def elm_obj_flipselector_item_append + * @since 1.8 + * + * Append a (text) item to a flip selector widget + * + * @param[in] label + * @param[in] func + * @param[in] data + * @param[out] ret + * + * @see elm_flipselector_item_append + * + * @ingroup Flipselector + */ +#define elm_obj_flipselector_item_append(label, func, data, ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(flipselector_func_type, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Flipselector_Item **, ret) + +/** + * @def elm_obj_flipselector_item_prepend + * @since 1.8 + * + * Prepend a (text) item to a flip selector widget + * + * @param[in] label + * @param[in] func + * @param[in] data + * @param[out] ret + * + * @see elm_flipselector_item_prepend + * + * @ingroup Flipselector + */ +#define elm_obj_flipselector_item_prepend(label, func, data, ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(flipselector_func_type, func), EO_TYPECHECK(void *, data), EO_TYPECHECK(Elm_Flipselector_Item **, ret) + + +/** + * @def elm_obj_flipselector_items_get + * @since 1.8 + * + * Get the internal list of items in a given flip selector widget. + * + * @param[out] ret + * + * @see elm_flipselector_items_get + * + * @ingroup Flipselector + */ +#define elm_obj_flipselector_items_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret) + +/** + * @def elm_obj_flipselector_first_item_get + * @since 1.8 + * + * Get the first item in the given flip selector widget's list of + * + * @param[out] ret + * + * @see elm_flipselector_first_item_get + * + * @ingroup Flipselector + */ +#define elm_obj_flipselector_first_item_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_flipselector_last_item_get + * @since 1.8 + * + * Get the last item in the given flip selector widget's list of + * + * @param[out] ret + * + * @see elm_flipselector_last_item_get + * + * @ingroup Flipselector + */ +#define elm_obj_flipselector_last_item_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_flipselector_selected_item_get + * @since 1.8 + * + * Get the currently selected item in a flip selector widget. + * + * @param[out] ret + * + * @see elm_flipselector_selected_item_get + * + * @ingroup Flipselector + */ +#define elm_obj_flipselector_selected_item_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_flipselector_first_interval_set + * @since 1.8 + * + * Set the interval on time updates for a user mouse button hold + * + * @param[in] interval + * + * @see elm_flipselector_first_interval_set + * + * @ingroup Flipselector + */ +#define elm_obj_flipselector_first_interval_set(interval) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_SET), EO_TYPECHECK(double, interval) + +/** + * @def elm_obj_flipselector_first_interval_get + * @since 1.8 + * + * Get the interval on time updates for an user mouse button hold + * + * @param[out] ret + * + * @see elm_flipselector_first_interval_get + * + * @ingroup Flipselector + */ +#define elm_obj_flipselector_first_interval_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_GET), EO_TYPECHECK(double *, ret) diff --git a/legacy/elementary/src/lib/elm_flipselector_legacy.h b/legacy/elementary/src/lib/elm_flipselector_legacy.h new file mode 100644 index 0000000000..74b3500c0c --- /dev/null +++ b/legacy/elementary/src/lib/elm_flipselector_legacy.h @@ -0,0 +1,196 @@ +/** + * Add a new flip selector widget to the given parent Elementary + * (container) widget + * + * @param parent The parent object + * @return a new flip selector widget handle or @c NULL, on errors + * + * This function inserts a new flip selector widget on the canvas. + * + * @ingroup Flipselector + */ +EAPI Evas_Object *elm_flipselector_add(Evas_Object *parent); + +/** + * Programmatically select the next item of a flip selector widget + * + * @param obj The flipselector object + * + * @note The selection will be animated. Also, if it reaches the + * end of its list of member items, it will continue with the first + * one onwards. + * + * @ingroup Flipselector + */ +EAPI void elm_flipselector_flip_next(Evas_Object *obj); + +/** + * Programmatically select the previous item of a flip selector + * widget + * + * @param obj The flipselector object + * + * @note The selection will be animated. Also, if it reaches the + * beginning of its list of member items, it will continue with the + * last one backwards. + * + * @ingroup Flipselector + */ +EAPI void elm_flipselector_flip_prev(Evas_Object *obj); + +/** + * Append a (text) item to a flip selector widget + * + * @param obj The flipselector object + * @param label The (text) label of the new item + * @param func Convenience callback function to take place when + * item is selected + * @param data Data passed to @p func, above + * @return A handle to the item added or @c NULL, on errors + * + * The widget's list of labels to show will be appended with the + * given value. If the user wishes so, a callback function pointer + * can be passed, which will get called when this same item is + * selected. + * + * @note The current selection @b won't be modified by appending an + * element to the list. + * + * @note The maximum length of the text label is going to be + * determined by the widget's theme. Strings larger than + * that value are going to be @b truncated. + * + * @ingroup Flipselector + */ +EAPI Elm_Object_Item *elm_flipselector_item_append(Evas_Object *obj, const char *label, Evas_Smart_Cb func, const void *data); + +/** + * Prepend a (text) item to a flip selector widget + * + * @param obj The flipselector object + * @param label The (text) label of the new item + * @param func Convenience callback function to take place when + * item is selected + * @param data Data passed to @p func, above + * @return A handle to the item added or @c NULL, on errors + * + * The widget's list of labels to show will be prepended with the + * given value. If the user wishes so, a callback function pointer + * can be passed, which will get called when this same item is + * selected. + * + * @note The current selection @b won't be modified by prepending + * an element to the list. + * + * @note The maximum length of the text label is going to be + * determined by the widget's theme. Strings larger than + * that value are going to be @b truncated. + * + * @ingroup Flipselector + */ +EAPI Elm_Object_Item *elm_flipselector_item_prepend(Evas_Object *obj, const char *label, Evas_Smart_Cb func, void *data); + +/** + * Get the internal list of items in a given flip selector widget. + * + * @param obj The flipselector object + * @return The list of items (#Elm_Object_Item as data) or + * @c NULL on errors. + * + * This list is @b not to be modified in any way and must not be + * freed. Use the list members with functions like + * elm_object_item_text_set(), + * elm_object_item_text_get(), + * elm_object_item_del(), + * elm_flipselector_item_selected_get(), + * elm_flipselector_item_selected_set(). + * + * @warning This list is only valid until @p obj object's internal + * items list is changed. It should be fetched again with another + * call to this function when changes happen. + * + * @ingroup Flipselector + */ +EAPI const Eina_List *elm_flipselector_items_get(const Evas_Object *obj); + +/** + * Get the first item in the given flip selector widget's list of + * items. + * + * @param obj The flipselector object + * @return The first item or @c NULL, if it has no items (and on + * errors) + * + * @see elm_flipselector_item_append() + * @see elm_flipselector_last_item_get() + * + * @ingroup Flipselector + */ +EAPI Elm_Object_Item *elm_flipselector_first_item_get(const Evas_Object *obj); + +/** + * Get the last item in the given flip selector widget's list of + * items. + * + * @param obj The flipselector object + * @return The last item or @c NULL, if it has no items (and on + * errors) + * + * @see elm_flipselector_item_prepend() + * @see elm_flipselector_first_item_get() + * + * @ingroup Flipselector + */ +EAPI Elm_Object_Item *elm_flipselector_last_item_get(const Evas_Object *obj); + +/** + * Get the currently selected item in a flip selector widget. + * + * @param obj The flipselector object + * @return The selected item or @c NULL, if the widget has no items + * (and on errors) + * + * @ingroup Flipselector + */ +EAPI Elm_Object_Item *elm_flipselector_selected_item_get(const Evas_Object *obj); + +/** + * Set the interval on time updates for a user mouse button hold + * on a flip selector widget. + * + * @param obj The flip selector object + * @param interval The (first) interval value in seconds + * + * This interval value is @b decreased while the user holds the + * mouse pointer either flipping up or flipping down a given flip + * selector. + * + * This helps the user to get to a given item distant from the + * current one easier/faster, as it will start to flip quicker and + * quicker on mouse button holds. + * + * The calculation for the next flip interval value, starting from + * the one set with this call, is the previous interval divided by + * 1.05, so it decreases a little bit. + * + * The default starting interval value for automatic flips is + * @b 0.85 seconds. + * + * @see elm_flipselector_first_interval_get() + * + * @ingroup Flipselector + */ +EAPI void elm_flipselector_first_interval_set(Evas_Object *obj, double interval); + +/** + * Get the interval on time updates for an user mouse button hold + * on a flip selector widget. + * + * @param obj The flip selector object + * @return The (first) interval value, in seconds, set on it + * + * @see elm_flipselector_first_interval_set() for more details + * + * @ingroup Flipselector + */ +EAPI double elm_flipselector_first_interval_get(const Evas_Object *obj); diff --git a/legacy/elementary/src/lib/elm_frame.h b/legacy/elementary/src/lib/elm_frame.h index 8e9e0a39f8..30c5b43762 100644 --- a/legacy/elementary/src/lib/elm_frame.h +++ b/legacy/elementary/src/lib/elm_frame.h @@ -47,154 +47,12 @@ * @{ */ -#define ELM_OBJ_FRAME_CLASS elm_obj_frame_class_get() - -const Eo_Class *elm_obj_frame_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_FRAME_BASE_ID; - -enum -{ - ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_SET, - ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_GET, - ELM_OBJ_FRAME_SUB_ID_COLLAPSE_SET, - ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GO, - ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GET, - ELM_OBJ_FRAME_SUB_ID_LAST -}; - -#define ELM_OBJ_FRAME_ID(sub_id) (ELM_OBJ_FRAME_BASE_ID + sub_id) - - -/** - * @def elm_obj_frame_autocollapse_set - * @since 1.8 - * - * @brief Toggle autocollapsing of a frame - * - * @param[in] autocollapse - * - * @see elm_frame_autocollapse_set - */ -#define elm_obj_frame_autocollapse_set(autocollapse) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_SET), EO_TYPECHECK(Eina_Bool, autocollapse) - -/** - * @def elm_obj_frame_autocollapse_get - * @since 1.8 - * - * @brief Determine autocollapsing of a frame - * - * @param[out] ret - * - * @see elm_frame_autocollapse_get - */ -#define elm_obj_frame_autocollapse_get(ret) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_frame_collapse_set - * @since 1.8 - * - * @brief Manually collapse a frame without animations - * - * @param[in] collapse - * - * @see elm_frame_collapse_set - */ -#define elm_obj_frame_collapse_set(collapse) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_SET), EO_TYPECHECK(Eina_Bool, collapse) - -/** - * @def elm_obj_frame_collapse_go - * @since 1.8 - * - * @brief Manually collapse a frame with animations - * - * @param[in] collapse - * - * @see elm_frame_collapse_go - */ -#define elm_obj_frame_collapse_go(collapse) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GO), EO_TYPECHECK(Eina_Bool, collapse) - -/** - * @def elm_obj_frame_collapse_get - * @since 1.8 - * - * @brief Determine the collapse state of a frame - * - * @param[out] ret - * - * @see elm_frame_collapse_get - */ -#define elm_obj_frame_collapse_get(ret) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @brief Add a new frame to the parent - * - * @param parent The parent object - * @return The new object or NULL if it cannot be created - * - * @ingroup Frame - */ -EAPI Evas_Object *elm_frame_add(Evas_Object *parent); - -/** - * @brief Toggle autocollapsing of a frame - * @param obj The frame - * @param autocollapse Whether to enable autocollapse - * - * When @p enable is EINA_TRUE, clicking a frame's label will collapse the frame - * vertically, shrinking it to the height of the label. - * By default, this is DISABLED. - * - * @ingroup Frame - */ -EAPI void elm_frame_autocollapse_set(Evas_Object *obj, Eina_Bool autocollapse); - -/** - * @brief Determine autocollapsing of a frame - * @param obj The frame - * @return Whether autocollapse is enabled - * - * When this returns EINA_TRUE, clicking a frame's label will collapse the frame - * vertically, shrinking it to the height of the label. - * By default, this is DISABLED. - * - * @ingroup Frame - */ -EAPI Eina_Bool elm_frame_autocollapse_get(const Evas_Object *obj); - -/** - * @brief Manually collapse a frame without animations - * @param obj The frame - * @param collapse true to collapse, false to expand - * - * Use this to toggle the collapsed state of a frame, bypassing animations. - * - * @ingroup Frame - */ -EAPI void elm_frame_collapse_set(Evas_Object *obj, Eina_Bool collapse); - -/** - * @brief Determine the collapse state of a frame - * @param obj The frame - * @return true if collapsed, false otherwise - * - * Use this to determine the collapse state of a frame. - * - * @ingroup Frame - */ -EAPI Eina_Bool elm_frame_collapse_get(const Evas_Object *obj); - -/** - * @brief Manually collapse a frame with animations - * @param obj The frame - * @param collapse true to collapse, false to expand - * - * Use this to toggle the collapsed state of a frame, triggering animations. - * - * @ingroup Frame - */ -EAPI void elm_frame_collapse_go(Evas_Object *obj, Eina_Bool collapse); - +#ifdef EFL_EO_API_SUPPORT +#include "elm_frame_eo.h" +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include "elm_frame_legacy.h" +#endif /** * @} */ diff --git a/legacy/elementary/src/lib/elm_frame_eo.h b/legacy/elementary/src/lib/elm_frame_eo.h new file mode 100644 index 0000000000..24133563d3 --- /dev/null +++ b/legacy/elementary/src/lib/elm_frame_eo.h @@ -0,0 +1,86 @@ +#define ELM_OBJ_FRAME_CLASS elm_obj_frame_class_get() + +const Eo_Class *elm_obj_frame_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_FRAME_BASE_ID; + +enum +{ + ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_SET, + ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_GET, + ELM_OBJ_FRAME_SUB_ID_COLLAPSE_SET, + ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GO, + ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GET, + ELM_OBJ_FRAME_SUB_ID_LAST +}; + +#define ELM_OBJ_FRAME_ID(sub_id) (ELM_OBJ_FRAME_BASE_ID + sub_id) + + +/** + * @def elm_obj_frame_autocollapse_set + * @since 1.8 + * + * @brief Toggle autocollapsing of a frame + * + * @param[in] autocollapse + * + * @see elm_frame_autocollapse_set + * + * @ingroup Frame + */ +#define elm_obj_frame_autocollapse_set(autocollapse) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_SET), EO_TYPECHECK(Eina_Bool, autocollapse) + +/** + * @def elm_obj_frame_autocollapse_get + * @since 1.8 + * + * @brief Determine autocollapsing of a frame + * + * @param[out] ret + * + * @see elm_frame_autocollapse_get + * + * @ingroup Frame + */ +#define elm_obj_frame_autocollapse_get(ret) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_frame_collapse_set + * @since 1.8 + * + * @brief Manually collapse a frame without animations + * + * @param[in] collapse + * + * @see elm_frame_collapse_set + * + * @ingroup Frame + */ +#define elm_obj_frame_collapse_set(collapse) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_SET), EO_TYPECHECK(Eina_Bool, collapse) + +/** + * @def elm_obj_frame_collapse_go + * @since 1.8 + * + * @brief Manually collapse a frame with animations + * + * @param[in] collapse + * + * @see elm_frame_collapse_go + */ +#define elm_obj_frame_collapse_go(collapse) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GO), EO_TYPECHECK(Eina_Bool, collapse) + +/** + * @def elm_obj_frame_collapse_get + * @since 1.8 + * + * @brief Determine the collapse state of a frame + * + * @param[out] ret + * + * @see elm_frame_collapse_get + * + * @ingroup Frame + */ +#define elm_obj_frame_collapse_get(ret) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GET), EO_TYPECHECK(Eina_Bool *, ret) diff --git a/legacy/elementary/src/lib/elm_frame_legacy.h b/legacy/elementary/src/lib/elm_frame_legacy.h new file mode 100644 index 0000000000..c6b10b2f47 --- /dev/null +++ b/legacy/elementary/src/lib/elm_frame_legacy.h @@ -0,0 +1,68 @@ +/** + * @brief Add a new frame to the parent + * + * @param parent The parent object + * @return The new object or NULL if it cannot be created + * + * @ingroup Frame + */ +EAPI Evas_Object *elm_frame_add(Evas_Object *parent); + +/** + * @brief Toggle autocollapsing of a frame + * @param obj The frame + * @param autocollapse Whether to enable autocollapse + * + * When @p enable is EINA_TRUE, clicking a frame's label will collapse the frame + * vertically, shrinking it to the height of the label. + * By default, this is DISABLED. + * + * @ingroup Frame + */ +EAPI void elm_frame_autocollapse_set(Evas_Object *obj, Eina_Bool autocollapse); + +/** + * @brief Determine autocollapsing of a frame + * @param obj The frame + * @return Whether autocollapse is enabled + * + * When this returns EINA_TRUE, clicking a frame's label will collapse the frame + * vertically, shrinking it to the height of the label. + * By default, this is DISABLED. + * + * @ingroup Frame + */ +EAPI Eina_Bool elm_frame_autocollapse_get(const Evas_Object *obj); + +/** + * @brief Manually collapse a frame without animations + * @param obj The frame + * @param collapse true to collapse, false to expand + * + * Use this to toggle the collapsed state of a frame, bypassing animations. + * + * @ingroup Frame + */ +EAPI void elm_frame_collapse_set(Evas_Object *obj, Eina_Bool collapse); + +/** + * @brief Manually collapse a frame with animations + * @param obj The frame + * @param collapse true to collapse, false to expand + * + * Use this to toggle the collapsed state of a frame, triggering animations. + * + * @ingroup Frame + */ +EAPI void elm_frame_collapse_go(Evas_Object *obj, Eina_Bool collapse); + +/** + * @brief Determine the collapse state of a frame + * @param obj The frame + * @return true if collapsed, false otherwise + * + * Use this to determine the collapse state of a frame. + * + * @ingroup Frame + */ +EAPI Eina_Bool elm_frame_collapse_get(const Evas_Object *obj); diff --git a/legacy/elementary/src/lib/elm_gesture_layer.h b/legacy/elementary/src/lib/elm_gesture_layer.h index 746596dd8b..adf7dc09a9 100644 --- a/legacy/elementary/src/lib/elm_gesture_layer.h +++ b/legacy/elementary/src/lib/elm_gesture_layer.h @@ -67,621 +67,13 @@ * */ -#define ELM_OBJ_GESTURE_LAYER_CLASS elm_obj_gesture_layer_class_get() - -const Eo_Class *elm_obj_gesture_layer_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_GESTURE_LAYER_BASE_ID; - -enum -{ - ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_GET, - ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_SET, - ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_GET, - ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_SET, - ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_GET, - ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_SET, - ELM_OBJ_GESTURE_LAYER_SUB_ID_ATTACH, - ELM_OBJ_GESTURE_LAYER_SUB_ID_CB_SET, - ELM_OBJ_GESTURE_LAYER_SUB_ID_LAST -}; - -#define ELM_OBJ_GESTURE_LAYER_ID(sub_id) (ELM_OBJ_GESTURE_LAYER_BASE_ID + sub_id) - - -/** - * @def elm_obj_gesture_layer_hold_events_get - * @since 1.8 - * - * Call this function to get repeat-events settings. - * - * @param[out] ret - * - * @see elm_gesture_layer_hold_events_get - */ -#define elm_obj_gesture_layer_hold_events_get(ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_gesture_layer_hold_events_set - * @since 1.8 - * - * This function is to make gesture-layer repeat events. - * - * @param[in] hold_events - * - * @see elm_gesture_layer_hold_events_set - */ -#define elm_obj_gesture_layer_hold_events_set(hold_events) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_SET), EO_TYPECHECK(Eina_Bool, hold_events) - -/** - * @def elm_obj_gesture_layer_zoom_step_get - * @since 1.8 - * - * This function returns step-value for zoom action. - * - * @param[out] ret - * - * @see elm_gesture_layer_zoom_step_get - */ -#define elm_obj_gesture_layer_zoom_step_get(ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_GET), EO_TYPECHECK(double *, ret) - -/** - * @def elm_obj_gesture_layer_zoom_step_set - * @since 1.8 - * - * This function sets step-value for zoom action. - * - * @param[in] step - * - * @see elm_gesture_layer_zoom_step_set - */ -#define elm_obj_gesture_layer_zoom_step_set(step) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_SET), EO_TYPECHECK(double, step) - -/** - * @def elm_obj_gesture_layer_rotate_step_get - * @since 1.8 - * - * This function returns step-value for rotate action. - * - * @param[out] ret - * - * @see elm_gesture_layer_rotate_step_get - */ -#define elm_obj_gesture_layer_rotate_step_get(ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_GET), EO_TYPECHECK(double *, ret) - -/** - * @def elm_obj_gesture_layer_rotate_step_set - * @since 1.8 - * - * This function sets step-value for rotate action. - * - * @param[in] step - * - * @see elm_gesture_layer_rotate_step_set - */ -#define elm_obj_gesture_layer_rotate_step_set(step) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_SET), EO_TYPECHECK(double, step) - -/** - * @def elm_obj_gesture_layer_attach - * @since 1.8 - * - * Attach a given gesture layer widget to an Evas object, thus setting - * the widget's @b target. - * - * @param[in] target - * @param[out] ret - * - * @see elm_gesture_layer_attach - */ -#define elm_obj_gesture_layer_attach(target, ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ATTACH), EO_TYPECHECK(Evas_Object *, target), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_gesture_layer_cb_set - * @since 1.8 - * - * Use function to set callbacks to be notified about - * change of state of gesture. - * - * @param[in] idx - * @param[in] cb_type - * @param[in] cb - * @param[in] data - * - * @see elm_gesture_layer_cb_set - */ -#define elm_obj_gesture_layer_cb_set(idx, cb_type, cb, data) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_CB_SET), EO_TYPECHECK(Elm_Gesture_Type, idx), EO_TYPECHECK(Elm_Gesture_State, cb_type), EO_TYPECHECK(Elm_Gesture_Event_Cb, cb), EO_TYPECHECK(void *, data) - -/** - * @enum _Elm_Gesture_Type - * Enum of supported gesture types. - */ -enum _Elm_Gesture_Type -{ - ELM_GESTURE_FIRST = 0, - - ELM_GESTURE_N_TAPS, /**< N fingers single taps */ - ELM_GESTURE_N_LONG_TAPS, /**< N fingers single long-taps */ - ELM_GESTURE_N_DOUBLE_TAPS, /**< N fingers double-single taps */ - ELM_GESTURE_N_TRIPLE_TAPS, /**< N fingers triple-single taps */ - - ELM_GESTURE_MOMENTUM, /**< Reports momentum in the direction of move */ - - ELM_GESTURE_N_LINES, /**< N fingers line gesture */ - ELM_GESTURE_N_FLICKS, /**< N fingers flick gesture */ - - ELM_GESTURE_ZOOM, /**< Zoom */ - ELM_GESTURE_ROTATE, /**< Rotate */ - - ELM_GESTURE_LAST -}; - -/** - * @typedef Elm_Gesture_Type - * Convenient macro around #_Elm_Gesture_Type - */ -typedef enum _Elm_Gesture_Type Elm_Gesture_Type; - -/** - * @enum _Elm_Gesture_State - * Enum of gesture states. - */ -enum _Elm_Gesture_State -{ - ELM_GESTURE_STATE_UNDEFINED = -1, /**< Gesture not STARTed */ - ELM_GESTURE_STATE_START, /**< Gesture STARTed */ - ELM_GESTURE_STATE_MOVE, /**< Gesture is ongoing */ - ELM_GESTURE_STATE_END, /**< Gesture completed */ - ELM_GESTURE_STATE_ABORT /**< Ongoing gesture was ABORTed */ -}; - -/** - * @typedef Elm_Gesture_State - * Convenient macro around #_Elm_Gesture_State - */ -typedef enum _Elm_Gesture_State Elm_Gesture_State; - -/** - * @struct _Elm_Gesture_Taps_Info - * Struct holds taps info for user - */ -struct _Elm_Gesture_Taps_Info -{ - Evas_Coord x, y; /**< Holds center point between fingers */ - unsigned int n; /**< Number of fingers tapped */ - unsigned int timestamp; /**< event timestamp */ -}; - -/** - * @typedef Elm_Gesture_Taps_Info - * holds taps info for user - */ -typedef struct _Elm_Gesture_Taps_Info Elm_Gesture_Taps_Info; - -/** - * @struct _Elm_Gesture_Momentum_Info - * Struct holds momentum info for user - * x1 and y1 are not necessarily in sync - * x1 holds x value of x direction starting point - * and same holds for y1. - * This is noticeable when doing V-shape movement - */ -struct _Elm_Gesture_Momentum_Info /* Report line ends, timestamps, and momentum computed */ -{Evas_Coord x1; /**< Final-swipe direction starting point on X */ - Evas_Coord y1; /**< Final-swipe direction starting point on Y */ - Evas_Coord x2; /**< Final-swipe direction ending point on X */ - Evas_Coord y2; /**< Final-swipe direction ending point on Y */ - - unsigned int tx; /**< Timestamp of start of final x-swipe */ - unsigned int ty; /**< Timestamp of start of final y-swipe */ - - Evas_Coord mx; /**< Momentum on X */ - Evas_Coord my; /**< Momentum on Y */ - - unsigned int n; /**< Number of fingers */ -}; - -/** - * @typedef Elm_Gesture_Momentum_Info - * holds momentum info for user - */ -typedef struct _Elm_Gesture_Momentum_Info Elm_Gesture_Momentum_Info; - -/** - * @struct _Elm_Gesture_Line_Info - * Struct holds line info for user - */ -struct _Elm_Gesture_Line_Info /* Report line ends, timestamps, and momentum computed */ -{Elm_Gesture_Momentum_Info momentum; /**< Line momentum info */ - double angle; /**< Angle (direction) of lines */ -}; - -/** - * @typedef Elm_Gesture_Line_Info - * Holds line info for user - */ -typedef struct _Elm_Gesture_Line_Info Elm_Gesture_Line_Info; - -/** - * @struct _Elm_Gesture_Zoom_Info - * Struct holds zoom info for user - */ -struct _Elm_Gesture_Zoom_Info -{ - Evas_Coord x, y; /**< Holds zoom center point reported to user */ - Evas_Coord radius; /**< Holds radius between fingers reported to user */ - double zoom; /**< Zoom value: 1.0 means no zoom */ - double momentum; /**< Zoom momentum: zoom growth per second (NOT YET SUPPORTED) */ -}; - -/** - * @typedef Elm_Gesture_Zoom_Info - * Holds zoom info for user - */ -typedef struct _Elm_Gesture_Zoom_Info Elm_Gesture_Zoom_Info; - -/** - * @struct _Elm_Gesture_Rotate_Info - * Struct holds rotation info for user - */ -struct _Elm_Gesture_Rotate_Info -{ - Evas_Coord x, y; /**< Holds zoom center point reported to user */ - Evas_Coord radius; /**< Holds radius between fingers reported to user */ - double base_angle; /**< Holds start-angle */ - double angle; /**< Rotation value: 0.0 means no rotation */ - double momentum; /**< Rotation momentum: rotation done per second (NOT YET SUPPORTED) */ -}; - -/** - * @typedef Elm_Gesture_Rotate_Info - * Holds rotation info for user - */ -typedef struct _Elm_Gesture_Rotate_Info Elm_Gesture_Rotate_Info; - -/** - * @typedef Elm_Gesture_Event_Cb - * User callback used to stream gesture info from gesture layer - * @param data user data - * @param event_info gesture report info - * Returns a flag field to be applied on the causing event. - * You should probably return EVAS_EVENT_FLAG_ON_HOLD if your widget acted - * upon the event, in an irreversible way. - * - */ -typedef Evas_Event_Flags (*Elm_Gesture_Event_Cb)(void *data, void *event_info); - -/** - * Use function to set callbacks to be notified about - * change of state of gesture. - * When a user registers a callback with this function - * this means this gesture has to be tested. - * - * When ALL callbacks for a gesture are set to NULL - * it means user isn't interested in gesture-state - * and it will not be tested. - * - * @param obj gesture-layer. - * @param idx The gesture you would like to track its state. - * @param cb callback function pointer. - * @param cb_type what event this callback tracks: START, MOVE, END, ABORT. - * @param data user info to be sent to callback (usually, Smart Data) - * - */ -EAPI void elm_gesture_layer_cb_set(Evas_Object *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data); - -/** - * Call this function to get repeat-events settings. - * - * @param obj gesture-layer. - * - * @return repeat events settings. - * @see elm_gesture_layer_hold_events_set() - */ -EAPI Eina_Bool elm_gesture_layer_hold_events_get(const Evas_Object *obj); - -/** - * This function is to make gesture-layer repeat events. - * Set this if you like to get the raw events only if gestures were not - * detected. - * Clear this if you like gesture layer to forward events as testing gestures. - * - * @param obj gesture layer. - * @param hold_events hold events or not. - * - */ -EAPI void elm_gesture_layer_hold_events_set(Evas_Object *obj, Eina_Bool hold_events); - -/** - * This function sets step-value for zoom action. - * Set step to any positive value. - * Cancel step setting by setting to 0 - * - * @param obj gesture-layer. - * @param step new zoom step value. - * - * @see elm_gesture_layer_zoom_step_get() - */ -EAPI void elm_gesture_layer_zoom_step_set(Evas_Object *obj, double step); - -/** - * This function returns step-value for zoom action. - * - * @param obj gesture-layer. - * @return zoom step value. - * - * @see elm_gesture_layer_zoom_step_set() - */ -EAPI double elm_gesture_layer_zoom_step_get(const Evas_Object *obj); - -/** - * This function sets step-value for rotate action. - * Set step to any positive value. - * Cancel step setting by setting to 0 - * - * @param obj gesture-layer. - * @param step new rotate step value. - * - */ -EAPI void elm_gesture_layer_rotate_step_set(Evas_Object *obj, double step); - -/** - * This function returns step-value for rotate action. - * - * @param obj gesture-layer. - * @return rotate step value. - * - */ -EAPI double elm_gesture_layer_rotate_step_get(const Evas_Object *obj); - -/** - * Attach a given gesture layer widget to an Evas object, thus setting - * the widget's @b target. - * - * @param obj A gesture layer to attach an object to. - * @param target Object to attach to @a obj (target) - * - * A gesture layer target may be whichever Evas object one - * chooses. This will be object @a obj will listen all mouse and key - * events from, to report the gestures made upon it back. - * - * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise. - * - */ -EAPI Eina_Bool elm_gesture_layer_attach(Evas_Object *obj, Evas_Object *target); - -/** - * Call this function to construct a new gesture-layer object. - * - * @param parent The gesture layer's parent widget. - * - * @return A new gesture layer object. - * - * This does not activate the gesture layer. You have to - * call elm_gesture_layer_attach() in order to 'activate' gesture-layer. - * - */ -EAPI Evas_Object *elm_gesture_layer_add(Evas_Object *parent); - -/** - * @since 1.8 - * This function sets the gesture layer line min length of an object - * - * @param obj gesture-layer. - * @param line_min_length the length. - * - */ -EAPI void elm_gesture_layer_line_min_length_set(Evas_Object *obj, int line_min_length); - -/** - * @since 1.8 - * This function returns the gesture layer line min length of an object - * - * @param obj gesture-layer. - * @return the length. - * - */ -EAPI int elm_gesture_layer_line_min_length_get(const Evas_Object *obj); - -/** - * @since 1.8 - * This function sets the gesture layer zoom distance tolerance of an object - * - * @param obj gesture-layer. - * @param zoom_distance_tolerance zoom distance tolerance - * - */ -EAPI void elm_gesture_layer_zoom_distance_tolerance_set(Evas_Object *obj, Evas_Coord zoom_distance_tolerance); - -/** - * @since 1.8 - * This function returns the gesture layer zoom distance tolerance of an object - * - * @param obj gesture-layer. - * @return zoom distance tolerance - * - */ -EAPI Evas_Coord elm_gesture_layer_zoom_distance_tolerance_get(const Evas_Object *obj); - -/** - * @since 1.8 - * This function sets the gesture layer line distance tolerance of an object - * - * @param obj gesture-layer. - * @param line_distance_tolerance line distance tolerance - * - */ -EAPI void elm_gesture_layer_line_distance_tolerance_set(Evas_Object *obj, Evas_Coord line_distance_tolerance); - -/** - * @since 1.8 - * This function returns the gesture layer line distance tolerance of an object - * - * @param obj gesture-layer. - * @return line distance tolerance - * - */ -EAPI Evas_Coord elm_gesture_layer_line_distance_tolerance_get(const Evas_Object *obj); - -/** - * @since 1.8 - * This function sets the gesture layer line angular tolerance of an object - * - * @param obj gesture-layer. - * @param line_angular_tolerance line angular tolerance - * - */ -EAPI void elm_gesture_layer_line_angular_tolerance_set(Evas_Object *obj, double line_angular_tolerance); - -/** - * @since 1.8 - * This function returns the gesture layer line angular tolerance of an object - * - * @param obj gesture-layer. - * @return line angular tolerance - * - */ -EAPI double elm_gesture_layer_line_angular_tolerance_get(const Evas_Object *obj); - -/** - * @since 1.8 - * This function sets the gesture layer zoom wheel factor of an object - * - * @param obj gesture-layer. - * @param zoom_wheel_factor zoom wheel factor - * - */ -EAPI void elm_gesture_layer_zoom_wheel_factor_set(Evas_Object *obj, double zoom_wheel_factor); - -/** - * @since 1.8 - * This function returns the gesture layer zoom wheel factor of an object - * - * @param obj gesture-layer. - * @return zoom wheel factor - * - */ -EAPI double elm_gesture_layer_zoom_wheel_factor_get(const Evas_Object *obj); - -/** - * @since 1.8 - * This function sets the gesture layer zoom finger factor of an object - * - * @param obj gesture-layer. - * @param zoom_finger_factor zoom finger factor - * - */ -EAPI void elm_gesture_layer_zoom_finger_factor_set(Evas_Object *obj, double zoom_finger_factor); - -/** - * @since 1.8 - * This function returns the gesture layer zoom finger factor of an object - * - * @param obj gesture-layer. - * @return zoom finger factor - * - */ -EAPI double elm_gesture_layer_zoom_finger_factor_get(const Evas_Object *obj); - -/** - * @since 1.8 - * This function sets the gesture layer rotate angular tolerance of an object - * - * @param obj gesture-layer. - * @param rotate_angular_tolerance rotate angular tolerance - * - */ -EAPI void elm_gesture_layer_rotate_angular_tolerance_set(Evas_Object *obj, double rotate_angular_tolerance); - -/** - * @since 1.8 - * This function returns the gesture layer rotate angular tolerance of an object - * - * @param obj gesture-layer. - * @return rotate angular tolerance - * - */ -EAPI double elm_gesture_layer_rotate_angular_tolerance_get(const Evas_Object *obj); - -/** - * @since 1.8 - * This function sets the gesture layer flick time limit (in ms) of an object - * - * @param obj gesture-layer. - * @param flick_time_limit_ms flick time limit (in ms) - * - */ -EAPI void elm_gesture_layer_flick_time_limit_ms_set(Evas_Object *obj, unsigned int flick_time_limit_ms); - -/** - * @since 1.8 - * This function returns the gesture layer flick time limit (in ms) of an object - * - * @param obj gesture-layer. - * @return flick time limit (in ms) - * - */ -EAPI unsigned int elm_gesture_layer_flick_time_limit_ms_get(const Evas_Object *obj); - -/** - * @since 1.8 - * This function sets the gesture layer long tap start timeout of an object - * - * @param obj gesture-layer. - * @param long_tap_start_timeout long tap start timeout - * - */ -EAPI void elm_gesture_layer_long_tap_start_timeout_set(Evas_Object *obj, double long_tap_start_timeout); - -/** - * @since 1.8 - * this function returns the gesture layer long tap start timeout of an object - * - * @param obj gesture-layer. - * @return long tap start timeout - * - */ -EAPI double elm_gesture_layer_long_tap_start_timeout_get(const Evas_Object *obj); - -/** - * @since 1.8 - * This function sets the gesture layer continues enable of an object - * - * @param obj gesture-layer. - * @param continues_enable continues enable - * - */ -EAPI void elm_gesture_layer_continues_enable_set(Evas_Object *obj, Eina_Bool continues_enable); - -/** - * @since 1.8 - * This function returns the gesture layer continues enable of an object - * - * @param obj gesture-layer. - * @return continues enable - * - */ -EAPI Eina_Bool elm_gesture_layer_continues_enable_get(const Evas_Object *obj); - -/** - * @since 1.8 - * This function sets the gesture layer double tap timeout of an object - * - * @param obj gesture-layer. - * @param double_tap_timeout double tap timeout - * - */ -EAPI void elm_gesture_layer_double_tap_timeout_set(Evas_Object *obj, double double_tap_timeout); - -/** - * @since 1.8 - * this function returns the gesture layer double tap timeout of an object - * - * @param obj gesture-layer. - * @return double tap timeout - * - */ -EAPI double elm_gesture_layer_double_tap_timeout_get(const Evas_Object *obj); - +#include "elm_gesture_layer_common.h" +#ifdef EFL_EO_API_SUPPORT +#include "elm_gesture_layer_eo.h" +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include "elm_gesture_layer_legacy.h" +#endif /** * @} */ diff --git a/legacy/elementary/src/lib/elm_gesture_layer_common.h b/legacy/elementary/src/lib/elm_gesture_layer_common.h new file mode 100644 index 0000000000..dd66a6bf1a --- /dev/null +++ b/legacy/elementary/src/lib/elm_gesture_layer_common.h @@ -0,0 +1,379 @@ +/** + * @enum _Elm_Gesture_Type + * Enum of supported gesture types. + */ +enum _Elm_Gesture_Type +{ + ELM_GESTURE_FIRST = 0, + + ELM_GESTURE_N_TAPS, /**< N fingers single taps */ + ELM_GESTURE_N_LONG_TAPS, /**< N fingers single long-taps */ + ELM_GESTURE_N_DOUBLE_TAPS, /**< N fingers double-single taps */ + ELM_GESTURE_N_TRIPLE_TAPS, /**< N fingers triple-single taps */ + + ELM_GESTURE_MOMENTUM, /**< Reports momentum in the direction of move */ + + ELM_GESTURE_N_LINES, /**< N fingers line gesture */ + ELM_GESTURE_N_FLICKS, /**< N fingers flick gesture */ + + ELM_GESTURE_ZOOM, /**< Zoom */ + ELM_GESTURE_ROTATE, /**< Rotate */ + + ELM_GESTURE_LAST +}; + +/** + * @typedef Elm_Gesture_Type + * Convenient macro around #_Elm_Gesture_Type + */ +typedef enum _Elm_Gesture_Type Elm_Gesture_Type; + +/** + * @enum _Elm_Gesture_State + * Enum of gesture states. + */ +enum _Elm_Gesture_State +{ + ELM_GESTURE_STATE_UNDEFINED = -1, /**< Gesture not STARTed */ + ELM_GESTURE_STATE_START, /**< Gesture STARTed */ + ELM_GESTURE_STATE_MOVE, /**< Gesture is ongoing */ + ELM_GESTURE_STATE_END, /**< Gesture completed */ + ELM_GESTURE_STATE_ABORT /**< Ongoing gesture was ABORTed */ +}; + +/** + * @typedef Elm_Gesture_State + * Convenient macro around #_Elm_Gesture_State + */ +typedef enum _Elm_Gesture_State Elm_Gesture_State; + +/** + * @struct _Elm_Gesture_Taps_Info + * Struct holds taps info for user + */ +struct _Elm_Gesture_Taps_Info +{ + Evas_Coord x, y; /**< Holds center point between fingers */ + unsigned int n; /**< Number of fingers tapped */ + unsigned int timestamp; /**< event timestamp */ +}; + +/** + * @typedef Elm_Gesture_Taps_Info + * holds taps info for user + */ +typedef struct _Elm_Gesture_Taps_Info Elm_Gesture_Taps_Info; + +/** + * @struct _Elm_Gesture_Momentum_Info + * Struct holds momentum info for user + * x1 and y1 are not necessarily in sync + * x1 holds x value of x direction starting point + * and same holds for y1. + * This is noticeable when doing V-shape movement + */ +struct _Elm_Gesture_Momentum_Info /* Report line ends, timestamps, and momentum computed */ +{Evas_Coord x1; /**< Final-swipe direction starting point on X */ + Evas_Coord y1; /**< Final-swipe direction starting point on Y */ + Evas_Coord x2; /**< Final-swipe direction ending point on X */ + Evas_Coord y2; /**< Final-swipe direction ending point on Y */ + + unsigned int tx; /**< Timestamp of start of final x-swipe */ + unsigned int ty; /**< Timestamp of start of final y-swipe */ + + Evas_Coord mx; /**< Momentum on X */ + Evas_Coord my; /**< Momentum on Y */ + + unsigned int n; /**< Number of fingers */ +}; + +/** + * @typedef Elm_Gesture_Momentum_Info + * holds momentum info for user + */ +typedef struct _Elm_Gesture_Momentum_Info Elm_Gesture_Momentum_Info; + +/** + * @struct _Elm_Gesture_Line_Info + * Struct holds line info for user + */ +struct _Elm_Gesture_Line_Info /* Report line ends, timestamps, and momentum computed */ +{Elm_Gesture_Momentum_Info momentum; /**< Line momentum info */ + double angle; /**< Angle (direction) of lines */ +}; + +/** + * @typedef Elm_Gesture_Line_Info + * Holds line info for user + */ +typedef struct _Elm_Gesture_Line_Info Elm_Gesture_Line_Info; + +/** + * @struct _Elm_Gesture_Zoom_Info + * Struct holds zoom info for user + */ +struct _Elm_Gesture_Zoom_Info +{ + Evas_Coord x, y; /**< Holds zoom center point reported to user */ + Evas_Coord radius; /**< Holds radius between fingers reported to user */ + double zoom; /**< Zoom value: 1.0 means no zoom */ + double momentum; /**< Zoom momentum: zoom growth per second (NOT YET SUPPORTED) */ +}; + +/** + * @typedef Elm_Gesture_Zoom_Info + * Holds zoom info for user + */ +typedef struct _Elm_Gesture_Zoom_Info Elm_Gesture_Zoom_Info; + +/** + * @struct _Elm_Gesture_Rotate_Info + * Struct holds rotation info for user + */ +struct _Elm_Gesture_Rotate_Info +{ + Evas_Coord x, y; /**< Holds zoom center point reported to user */ + Evas_Coord radius; /**< Holds radius between fingers reported to user */ + double base_angle; /**< Holds start-angle */ + double angle; /**< Rotation value: 0.0 means no rotation */ + double momentum; /**< Rotation momentum: rotation done per second (NOT YET SUPPORTED) */ +}; + +/** + * @typedef Elm_Gesture_Rotate_Info + * Holds rotation info for user + */ +typedef struct _Elm_Gesture_Rotate_Info Elm_Gesture_Rotate_Info; + +/** + * @typedef Elm_Gesture_Event_Cb + * User callback used to stream gesture info from gesture layer + * @param data user data + * @param event_info gesture report info + * Returns a flag field to be applied on the causing event. + * You should probably return EVAS_EVENT_FLAG_ON_HOLD if your widget acted + * upon the event, in an irreversible way. + * + */ +typedef Evas_Event_Flags (*Elm_Gesture_Event_Cb)(void *data, void *event_info); + +/** + * @since 1.8 + * This function sets the gesture layer line min length of an object + * + * @param obj gesture-layer. + * @param line_min_length the length. + * + */ +EAPI void elm_gesture_layer_line_min_length_set(Evas_Object *obj, int line_min_length); + +/** + * @since 1.8 + * This function returns the gesture layer line min length of an object + * + * @param obj gesture-layer. + * @return the length. + * + */ +EAPI int elm_gesture_layer_line_min_length_get(const Evas_Object *obj); + +/** + * @since 1.8 + * This function sets the gesture layer zoom distance tolerance of an object + * + * @param obj gesture-layer. + * @param zoom_distance_tolerance zoom distance tolerance + * + */ +EAPI void elm_gesture_layer_zoom_distance_tolerance_set(Evas_Object *obj, Evas_Coord zoom_distance_tolerance); + +/** + * @since 1.8 + * This function returns the gesture layer zoom distance tolerance of an object + * + * @param obj gesture-layer. + * @return zoom distance tolerance + * + */ +EAPI Evas_Coord elm_gesture_layer_zoom_distance_tolerance_get(const Evas_Object *obj); + +/** + * @since 1.8 + * This function sets the gesture layer line distance tolerance of an object + * + * @param obj gesture-layer. + * @param line_distance_tolerance line distance tolerance + * + */ +EAPI void elm_gesture_layer_line_distance_tolerance_set(Evas_Object *obj, Evas_Coord line_distance_tolerance); + +/** + * @since 1.8 + * This function returns the gesture layer line distance tolerance of an object + * + * @param obj gesture-layer. + * @return line distance tolerance + * + */ +EAPI Evas_Coord elm_gesture_layer_line_distance_tolerance_get(const Evas_Object *obj); + +/** + * @since 1.8 + * This function sets the gesture layer line angular tolerance of an object + * + * @param obj gesture-layer. + * @param line_angular_tolerance line angular tolerance + * + */ +EAPI void elm_gesture_layer_line_angular_tolerance_set(Evas_Object *obj, double line_angular_tolerance); + +/** + * @since 1.8 + * This function returns the gesture layer line angular tolerance of an object + * + * @param obj gesture-layer. + * @return line angular tolerance + * + */ +EAPI double elm_gesture_layer_line_angular_tolerance_get(const Evas_Object *obj); + +/** + * @since 1.8 + * This function sets the gesture layer zoom wheel factor of an object + * + * @param obj gesture-layer. + * @param zoom_wheel_factor zoom wheel factor + * + */ +EAPI void elm_gesture_layer_zoom_wheel_factor_set(Evas_Object *obj, double zoom_wheel_factor); + +/** + * @since 1.8 + * This function returns the gesture layer zoom wheel factor of an object + * + * @param obj gesture-layer. + * @return zoom wheel factor + * + */ +EAPI double elm_gesture_layer_zoom_wheel_factor_get(const Evas_Object *obj); + +/** + * @since 1.8 + * This function sets the gesture layer zoom finger factor of an object + * + * @param obj gesture-layer. + * @param zoom_finger_factor zoom finger factor + * + */ +EAPI void elm_gesture_layer_zoom_finger_factor_set(Evas_Object *obj, double zoom_finger_factor); + +/** + * @since 1.8 + * This function returns the gesture layer zoom finger factor of an object + * + * @param obj gesture-layer. + * @return zoom finger factor + * + */ +EAPI double elm_gesture_layer_zoom_finger_factor_get(const Evas_Object *obj); + +/** + * @since 1.8 + * This function sets the gesture layer rotate angular tolerance of an object + * + * @param obj gesture-layer. + * @param rotate_angular_tolerance rotate angular tolerance + * + */ +EAPI void elm_gesture_layer_rotate_angular_tolerance_set(Evas_Object *obj, double rotate_angular_tolerance); + +/** + * @since 1.8 + * This function returns the gesture layer rotate angular tolerance of an object + * + * @param obj gesture-layer. + * @return rotate angular tolerance + * + */ +EAPI double elm_gesture_layer_rotate_angular_tolerance_get(const Evas_Object *obj); + +/** + * @since 1.8 + * This function sets the gesture layer flick time limit (in ms) of an object + * + * @param obj gesture-layer. + * @param flick_time_limit_ms flick time limit (in ms) + * + */ +EAPI void elm_gesture_layer_flick_time_limit_ms_set(Evas_Object *obj, unsigned int flick_time_limit_ms); + +/** + * @since 1.8 + * This function returns the gesture layer flick time limit (in ms) of an object + * + * @param obj gesture-layer. + * @return flick time limit (in ms) + * + */ +EAPI unsigned int elm_gesture_layer_flick_time_limit_ms_get(const Evas_Object *obj); + +/** + * @since 1.8 + * This function sets the gesture layer long tap start timeout of an object + * + * @param obj gesture-layer. + * @param long_tap_start_timeout long tap start timeout + * + */ +EAPI void elm_gesture_layer_long_tap_start_timeout_set(Evas_Object *obj, double long_tap_start_timeout); + +/** + * @since 1.8 + * this function returns the gesture layer long tap start timeout of an object + * + * @param obj gesture-layer. + * @return long tap start timeout + * + */ +EAPI double elm_gesture_layer_long_tap_start_timeout_get(const Evas_Object *obj); + +/** + * @since 1.8 + * This function sets the gesture layer continues enable of an object + * + * @param obj gesture-layer. + * @param continues_enable continues enable + * + */ +EAPI void elm_gesture_layer_continues_enable_set(Evas_Object *obj, Eina_Bool continues_enable); + +/** + * @since 1.8 + * This function returns the gesture layer continues enable of an object + * + * @param obj gesture-layer. + * @return continues enable + * + */ +EAPI Eina_Bool elm_gesture_layer_continues_enable_get(const Evas_Object *obj); + +/** + * @since 1.8 + * This function sets the gesture layer double tap timeout of an object + * + * @param obj gesture-layer. + * @param double_tap_timeout double tap timeout + * + */ +EAPI void elm_gesture_layer_double_tap_timeout_set(Evas_Object *obj, double double_tap_timeout); + +/** + * @since 1.8 + * this function returns the gesture layer double tap timeout of an object + * + * @param obj gesture-layer. + * @return double tap timeout + * + */ +EAPI double elm_gesture_layer_double_tap_timeout_get(const Evas_Object *obj); + diff --git a/legacy/elementary/src/lib/elm_gesture_layer_eo.h b/legacy/elementary/src/lib/elm_gesture_layer_eo.h new file mode 100644 index 0000000000..516f6a6799 --- /dev/null +++ b/legacy/elementary/src/lib/elm_gesture_layer_eo.h @@ -0,0 +1,139 @@ +#define ELM_OBJ_GESTURE_LAYER_CLASS elm_obj_gesture_layer_class_get() + +const Eo_Class *elm_obj_gesture_layer_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_GESTURE_LAYER_BASE_ID; + +enum +{ + ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_GET, + ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_SET, + ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_GET, + ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_SET, + ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_GET, + ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_SET, + ELM_OBJ_GESTURE_LAYER_SUB_ID_ATTACH, + ELM_OBJ_GESTURE_LAYER_SUB_ID_CB_SET, + ELM_OBJ_GESTURE_LAYER_SUB_ID_LAST +}; + +#define ELM_OBJ_GESTURE_LAYER_ID(sub_id) (ELM_OBJ_GESTURE_LAYER_BASE_ID + sub_id) + + +/** + * @def elm_obj_gesture_layer_hold_events_get + * @since 1.8 + * + * Call this function to get repeat-events settings. + * + * @param[out] ret + * + * @see elm_gesture_layer_hold_events_get + * + * @ingroup Elm_Gesture_Layer + */ +#define elm_obj_gesture_layer_hold_events_get(ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_gesture_layer_hold_events_set + * @since 1.8 + * + * This function is to make gesture-layer repeat events. + * + * @param[in] hold_events + * + * @see elm_gesture_layer_hold_events_set + * + * @ingroup Elm_Gesture_Layer + */ +#define elm_obj_gesture_layer_hold_events_set(hold_events) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_SET), EO_TYPECHECK(Eina_Bool, hold_events) + +/** + * @def elm_obj_gesture_layer_zoom_step_get + * @since 1.8 + * + * This function returns step-value for zoom action. + * + * @param[out] ret + * + * @see elm_gesture_layer_zoom_step_get + * + * @ingroup Elm_Gesture_Layer + */ +#define elm_obj_gesture_layer_zoom_step_get(ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_GET), EO_TYPECHECK(double *, ret) + +/** + * @def elm_obj_gesture_layer_zoom_step_set + * @since 1.8 + * + * This function sets step-value for zoom action. + * + * @param[in] step + * + * @see elm_gesture_layer_zoom_step_set + * + * @ingroup Elm_Gesture_Layer + */ +#define elm_obj_gesture_layer_zoom_step_set(step) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_SET), EO_TYPECHECK(double, step) + +/** + * @def elm_obj_gesture_layer_rotate_step_get + * @since 1.8 + * + * This function returns step-value for rotate action. + * + * @param[out] ret + * + * @see elm_gesture_layer_rotate_step_get + * + * @ingroup Elm_Gesture_Layer + */ +#define elm_obj_gesture_layer_rotate_step_get(ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_GET), EO_TYPECHECK(double *, ret) + +/** + * @def elm_obj_gesture_layer_rotate_step_set + * @since 1.8 + * + * This function sets step-value for rotate action. + * + * @param[in] step + * + * @see elm_gesture_layer_rotate_step_set + * + * @ingroup Elm_Gesture_Layer + */ +#define elm_obj_gesture_layer_rotate_step_set(step) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_SET), EO_TYPECHECK(double, step) + +/** + * @def elm_obj_gesture_layer_attach + * @since 1.8 + * + * Attach a given gesture layer widget to an Evas object, thus setting + * the widget's @b target. + * + * @param[in] target + * @param[out] ret + * + * @see elm_gesture_layer_attach + * + * @ingroup Elm_Gesture_Layer + */ +#define elm_obj_gesture_layer_attach(target, ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ATTACH), EO_TYPECHECK(Evas_Object *, target), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_gesture_layer_cb_set + * @since 1.8 + * + * Use function to set callbacks to be notified about + * change of state of gesture. + * + * @param[in] idx + * @param[in] cb_type + * @param[in] cb + * @param[in] data + * + * @see elm_gesture_layer_cb_set + * + * @ingroup Elm_Gesture_Layer + */ +#define elm_obj_gesture_layer_cb_set(idx, cb_type, cb, data) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_CB_SET), EO_TYPECHECK(Elm_Gesture_Type, idx), EO_TYPECHECK(Elm_Gesture_State, cb_type), EO_TYPECHECK(Elm_Gesture_Event_Cb, cb), EO_TYPECHECK(void *, data) diff --git a/legacy/elementary/src/lib/elm_gesture_layer_legacy.h b/legacy/elementary/src/lib/elm_gesture_layer_legacy.h new file mode 100644 index 0000000000..c0d0ef4fc6 --- /dev/null +++ b/legacy/elementary/src/lib/elm_gesture_layer_legacy.h @@ -0,0 +1,111 @@ +/** + * Call this function to construct a new gesture-layer object. + * + * @param parent The gesture layer's parent widget. + * + * @return A new gesture layer object. + * + * This does not activate the gesture layer. You have to + * call elm_gesture_layer_attach() in order to 'activate' gesture-layer. + * + */ +EAPI Evas_Object *elm_gesture_layer_add(Evas_Object *parent); + +/** + * Call this function to get repeat-events settings. + * + * @param obj gesture-layer. + * + * @return repeat events settings. + * @see elm_gesture_layer_hold_events_set() + */ +EAPI Eina_Bool elm_gesture_layer_hold_events_get(const Evas_Object *obj); + +/** + * This function is to make gesture-layer repeat events. + * Set this if you like to get the raw events only if gestures were not + * detected. + * Clear this if you like gesture layer to forward events as testing gestures. + * + * @param obj gesture layer. + * @param hold_events hold events or not. + * + */ +EAPI void elm_gesture_layer_hold_events_set(Evas_Object *obj, Eina_Bool hold_events); + +/** + * This function returns step-value for zoom action. + * + * @param obj gesture-layer. + * @return zoom step value. + * + * @see elm_gesture_layer_zoom_step_set() + */ +EAPI double elm_gesture_layer_zoom_step_get(const Evas_Object *obj); + +/** + * This function sets step-value for zoom action. + * Set step to any positive value. + * Cancel step setting by setting to 0 + * + * @param obj gesture-layer. + * @param step new zoom step value. + * + * @see elm_gesture_layer_zoom_step_get() + */ +EAPI void elm_gesture_layer_zoom_step_set(Evas_Object *obj, double step); +/** + * This function returns step-value for rotate action. + * + * @param obj gesture-layer. + * @return rotate step value. + * + */ +EAPI double elm_gesture_layer_rotate_step_get(const Evas_Object *obj); + + +/** + * This function sets step-value for rotate action. + * Set step to any positive value. + * Cancel step setting by setting to 0 + * + * @param obj gesture-layer. + * @param step new rotate step value. + * + */ +EAPI void elm_gesture_layer_rotate_step_set(Evas_Object *obj, double step); + +/** + * Attach a given gesture layer widget to an Evas object, thus setting + * the widget's @b target. + * + * @param obj A gesture layer to attach an object to. + * @param target Object to attach to @a obj (target) + * + * A gesture layer target may be whichever Evas object one + * chooses. This will be object @a obj will listen all mouse and key + * events from, to report the gestures made upon it back. + * + * @return @c EINA_TRUE, on success, @c EINA_FALSE otherwise. + * + */ +EAPI Eina_Bool elm_gesture_layer_attach(Evas_Object *obj, Evas_Object *target); + +/** + * Use function to set callbacks to be notified about + * change of state of gesture. + * When a user registers a callback with this function + * this means this gesture has to be tested. + * + * When ALL callbacks for a gesture are set to NULL + * it means user isn't interested in gesture-state + * and it will not be tested. + * + * @param obj gesture-layer. + * @param idx The gesture you would like to track its state. + * @param cb callback function pointer. + * @param cb_type what event this callback tracks: START, MOVE, END, ABORT. + * @param data user info to be sent to callback (usually, Smart Data) + * + */ +EAPI void elm_gesture_layer_cb_set(Evas_Object *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data); diff --git a/legacy/elementary/src/lib/elm_glview.h b/legacy/elementary/src/lib/elm_glview.h index e7b2a4d464..7a99d55a70 100644 --- a/legacy/elementary/src/lib/elm_glview.h +++ b/legacy/elementary/src/lib/elm_glview.h @@ -25,382 +25,14 @@ /** * @ingroup GLView */ -#define ELM_OBJ_GLVIEW_CLASS elm_obj_glview_class_get() - -const Eo_Class *elm_obj_glview_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_GLVIEW_BASE_ID; - -enum -{ - ELM_OBJ_GLVIEW_SUB_ID_GL_API_GET, - ELM_OBJ_GLVIEW_SUB_ID_MODE_SET, - ELM_OBJ_GLVIEW_SUB_ID_RESIZE_POLICY_SET, - ELM_OBJ_GLVIEW_SUB_ID_RENDER_POLICY_SET, - ELM_OBJ_GLVIEW_SUB_ID_SIZE_SET, - ELM_OBJ_GLVIEW_SUB_ID_SIZE_GET, - ELM_OBJ_GLVIEW_SUB_ID_INIT_FUNC_SET, - ELM_OBJ_GLVIEW_SUB_ID_DEL_FUNC_SET, - ELM_OBJ_GLVIEW_SUB_ID_RESIZE_FUNC_SET, - ELM_OBJ_GLVIEW_SUB_ID_RENDER_FUNC_SET, - ELM_OBJ_GLVIEW_SUB_ID_CHANGED_SET, - ELM_OBJ_GLVIEW_SUB_ID_LAST -}; - -#define ELM_OBJ_GLVIEW_ID(sub_id) (ELM_OBJ_GLVIEW_BASE_ID + sub_id) - - -/** - * @def elm_obj_glview_gl_api_get - * @since 1.8 - * - * Gets the gl api struct for gl rendering - * - * @param[out] ret - * - * @see elm_glview_gl_api_get - */ -#define elm_obj_glview_gl_api_get(ret) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_GL_API_GET), EO_TYPECHECK(Evas_GL_API **, ret) - -/** - * @def elm_obj_glview_mode_set - * @since 1.8 - * - * Set the mode of the GLView. Supports alpha, depth, stencil. - * - * @param[in] mode - * @param[out] ret - * - * @see elm_glview_mode_set - */ -#define elm_obj_glview_mode_set(mode, ret) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_MODE_SET), EO_TYPECHECK(Elm_GLView_Mode, mode), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_glview_resize_policy_set - * @since 1.8 - * - * Set the resize policy for the glview object. - * - * @param[in] policy - * @param[out] ret - * - * @see elm_glview_resize_policy_set - */ -#define elm_obj_glview_resize_policy_set(policy, ret) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RESIZE_POLICY_SET), EO_TYPECHECK(Elm_GLView_Resize_Policy, policy), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_glview_render_policy_set - * @since 1.8 - * - * Set the render policy for the glview object. - * - * @param[in] policy - * @param[out] ret - * - * @see elm_glview_render_policy_set - */ -#define elm_obj_glview_render_policy_set(policy, ret) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RENDER_POLICY_SET), EO_TYPECHECK(Elm_GLView_Render_Policy, policy), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_glview_size_set - * @since 1.8 - * - * Sets the size of the glview - * - * @param[in] w - * @param[in] h - * - * @see elm_glview_size_set - */ -#define elm_obj_glview_size_set(w, h) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_SIZE_SET), EO_TYPECHECK(int, w), EO_TYPECHECK(int, h) - -/** - * @def elm_obj_glview_size_get - * @since 1.8 - * - * Gets the size of the glview. - * - * @param[out] w - * @param[out] h - * - * @see elm_glview_size_get - */ -#define elm_obj_glview_size_get(w, h) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_SIZE_GET), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h) - -/** - * @def elm_obj_glview_init_func_set - * @since 1.8 - * - * Set the init function that runs once in the main loop. - * - * @param[in] func - * - * @see elm_glview_init_func_set - */ -#define elm_obj_glview_init_func_set(func) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_INIT_FUNC_SET), EO_TYPECHECK(Elm_GLView_Func_Cb, func) - -/** - * @def elm_obj_glview_del_func_set - * @since 1.8 - * - * Set the render function that runs in the main loop. - * - * @param[in] func - * - * @see elm_glview_del_func_set - */ -#define elm_obj_glview_del_func_set(func) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_DEL_FUNC_SET), EO_TYPECHECK(Elm_GLView_Func_Cb, func) - -/** - * @def elm_obj_glview_resize_func_set - * @since 1.8 - * - * Set the resize function that gets called when resize happens. - * - * @param[in] func - * - * @see elm_glview_resize_func_set - */ -#define elm_obj_glview_resize_func_set(func) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RESIZE_FUNC_SET), EO_TYPECHECK(Elm_GLView_Func_Cb, func) - -/** - * @def elm_obj_glview_render_func_set - * @since 1.8 - * - * Set the render function that runs in the main loop. - * - * @param[in] func - * - * @see elm_glview_render_func_set - */ -#define elm_obj_glview_render_func_set(func) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RENDER_FUNC_SET), EO_TYPECHECK(Elm_GLView_Func_Cb, func) - -/** - * @def elm_obj_glview_changed_set - * @since 1.8 - * - * Notifies that there has been changes in the GLView. - * - * - * @see elm_glview_changed_set - */ -#define elm_obj_glview_changed_set() ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_CHANGED_SET) - -typedef void (*Elm_GLView_Func_Cb)(Evas_Object *obj); - -/** - * Defines mode of GLView - * - * @ingroup GLView - */ -typedef enum _Elm_GLView_Mode -{ - ELM_GLVIEW_NONE = 0, - ELM_GLVIEW_ALPHA = (1<<1), /**< Alpha channel enabled rendering mode */ - ELM_GLVIEW_DEPTH = (1<<2), /**< Depth buffer enabled rendering mode */ - ELM_GLVIEW_STENCIL = (1<<3), /**< Stencil buffer enabled rendering mode */ - ELM_GLVIEW_DIRECT = (1<<4) /**< Direct rendering optimization hint */ -} Elm_GLView_Mode; - -/** - * Defines a policy for the glview resizing. - * - * The resizing policy tells glview what to do with the underlying - * surface when resize happens. ELM_GLVIEW_RESIZE_POLICY_RECREATE - * will destroy the current surface and recreate the surface to the - * new size. ELM_GLVIEW_RESIZE_POLICY_SCALE will instead keep the - * current surface but only display the result at the desired size - * scaled. - * - * @note Default is ELM_GLVIEW_RESIZE_POLICY_RECREATE - * @ingroup GLView - */ -typedef enum -{ - ELM_GLVIEW_RESIZE_POLICY_RECREATE = 1, /**< Resize the internal surface along with the image */ - ELM_GLVIEW_RESIZE_POLICY_SCALE = 2 /**< Only resize the internal image and not the surface */ -} Elm_GLView_Resize_Policy; - -/** - * Defines a policy for gl rendering. - * - * The rendering policy tells glview where to run the gl rendering code. - * ELM_GLVIEW_RENDER_POLICY_ON_DEMAND tells glview to call the rendering - * calls on demand, which means that the rendering code gets called - * only when it is visible. - * - * @note Default is ELM_GLVIEW_RENDER_POLICY_ON_DEMAND - * @ingroup GLView - */ -typedef enum -{ - ELM_GLVIEW_RENDER_POLICY_ON_DEMAND = 1, /**< Render only when there is a need for redrawing */ - ELM_GLVIEW_RENDER_POLICY_ALWAYS = 2 /**< Render always even when it is not visible */ -} Elm_GLView_Render_Policy; - -/** - * Add a new glview to the parent - * - * @param parent The parent object - * @return The new object or NULL if it cannot be created - * - * @ingroup GLView - */ -EAPI Evas_Object *elm_glview_add(Evas_Object *parent); - -/** - * Sets the size of the glview - * - * @param obj The glview object - * @param w width of the glview object - * @param h height of the glview object - * - * @ingroup GLView - */ -EAPI void elm_glview_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); - -/** - * Gets the size of the glview. - * - * @param obj The glview object - * @param w width of the glview object - * @param h height of the glview object - * - * Note that this function returns the actual image size of the - * glview. This means that when the scale policy is set to - * ELM_GLVIEW_RESIZE_POLICY_SCALE, it'll return the non-scaled - * size. - * - * @ingroup GLView - */ -EAPI void elm_glview_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); - -/** - * Gets the gl api struct for gl rendering - * - * @param obj The glview object - * @return The api object or NULL if it cannot be created - * - * @ingroup GLView - */ -EAPI Evas_GL_API *elm_glview_gl_api_get(const Evas_Object *obj); - -/** - * Set the mode of the GLView. Supports alpha, depth, stencil. - * - * @param obj The glview object - * @param mode The mode Options OR'ed enabling Alpha, Depth, Stencil, Direct. - * @return True if set properly. - * - * Direct is a hint for the elm_glview to render directly to the window - * given that the right conditions are met. Otherwise it falls back - * to rendering to an offscreen buffer before it gets composited to the - * window. - * - * @ingroup GLView - */ -EAPI Eina_Bool elm_glview_mode_set(Evas_Object *obj, Elm_GLView_Mode mode); - -/** - * Set the resize policy for the glview object. - * - * @param obj The glview object. - * @param policy The scaling policy. - * - * By default, the resize policy is set to ELM_GLVIEW_RESIZE_POLICY_RECREATE. - * When resize is called it destroys the previous surface and recreates the - * newly specified size. If the policy is set to - * ELM_GLVIEW_RESIZE_POLICY_SCALE, however, glview only scales the image - * object and not the underlying GL Surface. - * - * @ingroup GLView - */ -EAPI Eina_Bool elm_glview_resize_policy_set(Evas_Object *obj, Elm_GLView_Resize_Policy policy); - -/** - * Set the render policy for the glview object. - * - * @param obj The glview object. - * @param policy The render policy. - * - * By default, the render policy is set to ELM_GLVIEW_RENDER_POLICY_ON_DEMAND. - * This policy is set such that during the render loop, glview is only - * redrawn if it needs to be redrawn. (i.e. when it is visible) If the policy - * is set to ELM_GLVIEWW_RENDER_POLICY_ALWAYS, it redraws regardless of - * whether it is visible or needs redrawing. - * - * @ingroup GLView - */ -EAPI Eina_Bool elm_glview_render_policy_set(Evas_Object *obj, Elm_GLView_Render_Policy policy); - -/** - * Set the init function that runs once in the main loop. - * - * @param obj The glview object. - * @param func The init function to be registered. - * - * The registered init function gets called once during the render loop. - * This function allows glview to hide all the rendering context/surface - * details and have the user just call GL calls that they desire - * for initialization GL calls. - * - * @ingroup GLView - */ -EAPI void elm_glview_init_func_set(Evas_Object *obj, Elm_GLView_Func_Cb func); - -/** - * Set the render function that runs in the main loop. - * - * @param obj The glview object. - * @param func The delete function to be registered. - * - * The registered del function gets called when GLView object is deleted. - * This function allows glview to hide all the rendering context/surface - * details and have the user just call GL calls that they desire - * when delete happens. - * - * @ingroup GLView - */ -EAPI void elm_glview_del_func_set(Evas_Object *obj, Elm_GLView_Func_Cb func); - -/** - * Set the resize function that gets called when resize happens. - * - * @param obj The glview object. - * @param func The resize function to be registered. - * - * The resize function gets called during the render loop. - * This function allows glview to hide all the rendering context/surface - * details and have the user just call GL calls that they desire - * when resize happens. - * - * @ingroup GLView - */ -EAPI void elm_glview_resize_func_set(Evas_Object *obj, Elm_GLView_Func_Cb func); - -/** - * Set the render function that runs in the main loop. - * - * The render function gets called in the main loop but whether it runs - * depends on the rendering policy and whether elm_glview_changed_set() - * gets called. - * - * @param obj The glview object. - * @param func The render function to be registered. - * - * @ingroup GLView - */ -EAPI void elm_glview_render_func_set(Evas_Object *obj, Elm_GLView_Func_Cb func); - -/** - * Notifies that there has been changes in the GLView. - * - * @param obj The glview object. - * - * @ingroup GLView - */ -EAPI void elm_glview_changed_set(Evas_Object *obj); +#include "elm_glview_common.h" +#ifdef EFL_EO_API_SUPPORT +#include "elm_glview_eo.h" +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include "elm_glview_legacy.h" +#endif /** * @} */ diff --git a/legacy/elementary/src/lib/elm_glview_common.h b/legacy/elementary/src/lib/elm_glview_common.h new file mode 100644 index 0000000000..0417b9e5ba --- /dev/null +++ b/legacy/elementary/src/lib/elm_glview_common.h @@ -0,0 +1,52 @@ +typedef void (*Elm_GLView_Func_Cb)(Evas_Object *obj); + +/** + * Defines mode of GLView + * + * @ingroup GLView + */ +typedef enum _Elm_GLView_Mode +{ + ELM_GLVIEW_NONE = 0, + ELM_GLVIEW_ALPHA = (1<<1), /**< Alpha channel enabled rendering mode */ + ELM_GLVIEW_DEPTH = (1<<2), /**< Depth buffer enabled rendering mode */ + ELM_GLVIEW_STENCIL = (1<<3), /**< Stencil buffer enabled rendering mode */ + ELM_GLVIEW_DIRECT = (1<<4) /**< Direct rendering optimization hint */ +} Elm_GLView_Mode; + +/** + * Defines a policy for the glview resizing. + * + * The resizing policy tells glview what to do with the underlying + * surface when resize happens. ELM_GLVIEW_RESIZE_POLICY_RECREATE + * will destroy the current surface and recreate the surface to the + * new size. ELM_GLVIEW_RESIZE_POLICY_SCALE will instead keep the + * current surface but only display the result at the desired size + * scaled. + * + * @note Default is ELM_GLVIEW_RESIZE_POLICY_RECREATE + * @ingroup GLView + */ +typedef enum +{ + ELM_GLVIEW_RESIZE_POLICY_RECREATE = 1, /**< Resize the internal surface along with the image */ + ELM_GLVIEW_RESIZE_POLICY_SCALE = 2 /**< Only resize the internal image and not the surface */ +} Elm_GLView_Resize_Policy; + +/** + * Defines a policy for gl rendering. + * + * The rendering policy tells glview where to run the gl rendering code. + * ELM_GLVIEW_RENDER_POLICY_ON_DEMAND tells glview to call the rendering + * calls on demand, which means that the rendering code gets called + * only when it is visible. + * + * @note Default is ELM_GLVIEW_RENDER_POLICY_ON_DEMAND + * @ingroup GLView + */ +typedef enum +{ + ELM_GLVIEW_RENDER_POLICY_ON_DEMAND = 1, /**< Render only when there is a need for redrawing */ + ELM_GLVIEW_RENDER_POLICY_ALWAYS = 2 /**< Render always even when it is not visible */ +} Elm_GLView_Render_Policy; + diff --git a/legacy/elementary/src/lib/elm_glview_eo.h b/legacy/elementary/src/lib/elm_glview_eo.h new file mode 100644 index 0000000000..1bbf304528 --- /dev/null +++ b/legacy/elementary/src/lib/elm_glview_eo.h @@ -0,0 +1,182 @@ +#define ELM_OBJ_GLVIEW_CLASS elm_obj_glview_class_get() + +const Eo_Class *elm_obj_glview_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_GLVIEW_BASE_ID; + +enum +{ + ELM_OBJ_GLVIEW_SUB_ID_GL_API_GET, + ELM_OBJ_GLVIEW_SUB_ID_MODE_SET, + ELM_OBJ_GLVIEW_SUB_ID_RESIZE_POLICY_SET, + ELM_OBJ_GLVIEW_SUB_ID_RENDER_POLICY_SET, + ELM_OBJ_GLVIEW_SUB_ID_SIZE_SET, + ELM_OBJ_GLVIEW_SUB_ID_SIZE_GET, + ELM_OBJ_GLVIEW_SUB_ID_INIT_FUNC_SET, + ELM_OBJ_GLVIEW_SUB_ID_DEL_FUNC_SET, + ELM_OBJ_GLVIEW_SUB_ID_RESIZE_FUNC_SET, + ELM_OBJ_GLVIEW_SUB_ID_RENDER_FUNC_SET, + ELM_OBJ_GLVIEW_SUB_ID_CHANGED_SET, + ELM_OBJ_GLVIEW_SUB_ID_LAST +}; + +#define ELM_OBJ_GLVIEW_ID(sub_id) (ELM_OBJ_GLVIEW_BASE_ID + sub_id) + + +/** + * @def elm_obj_glview_gl_api_get + * @since 1.8 + * + * Gets the gl api struct for gl rendering + * + * @param[out] ret + * + * @see elm_glview_gl_api_get + * + * @ingroup GLView + */ +#define elm_obj_glview_gl_api_get(ret) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_GL_API_GET), EO_TYPECHECK(Evas_GL_API **, ret) + +/** + * @def elm_obj_glview_mode_set + * @since 1.8 + * + * Set the mode of the GLView. Supports alpha, depth, stencil. + * + * @param[in] mode + * @param[out] ret + * + * @see elm_glview_mode_set + * + * @ingroup GLView + */ +#define elm_obj_glview_mode_set(mode, ret) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_MODE_SET), EO_TYPECHECK(Elm_GLView_Mode, mode), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_glview_resize_policy_set + * @since 1.8 + * + * Set the resize policy for the glview object. + * + * @param[in] policy + * @param[out] ret + * + * @see elm_glview_resize_policy_set + * + * @ingroup GLView + */ +#define elm_obj_glview_resize_policy_set(policy, ret) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RESIZE_POLICY_SET), EO_TYPECHECK(Elm_GLView_Resize_Policy, policy), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_glview_render_policy_set + * @since 1.8 + * + * Set the render policy for the glview object. + * + * @param[in] policy + * @param[out] ret + * + * @see elm_glview_render_policy_set + * + * @ingroup GLView + */ +#define elm_obj_glview_render_policy_set(policy, ret) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RENDER_POLICY_SET), EO_TYPECHECK(Elm_GLView_Render_Policy, policy), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_glview_size_set + * @since 1.8 + * + * Sets the size of the glview + * + * @param[in] w + * @param[in] h + * + * @see elm_glview_size_set + * + * @ingroup GLView + */ +#define elm_obj_glview_size_set(w, h) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_SIZE_SET), EO_TYPECHECK(int, w), EO_TYPECHECK(int, h) + +/** + * @def elm_obj_glview_size_get + * @since 1.8 + * + * Gets the size of the glview. + * + * @param[out] w + * @param[out] h + * + * @see elm_glview_size_get + * + * @ingroup GLView + */ +#define elm_obj_glview_size_get(w, h) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_SIZE_GET), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h) + +/** + * @def elm_obj_glview_init_func_set + * @since 1.8 + * + * Set the init function that runs once in the main loop. + * + * @param[in] func + * + * @see elm_glview_init_func_set + * + * @ingroup GLView + */ +#define elm_obj_glview_init_func_set(func) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_INIT_FUNC_SET), EO_TYPECHECK(Elm_GLView_Func_Cb, func) + +/** + * @def elm_obj_glview_del_func_set + * @since 1.8 + * + * Set the render function that runs in the main loop. + * + * @param[in] func + * + * @see elm_glview_del_func_set + * + * @ingroup GLView + */ +#define elm_obj_glview_del_func_set(func) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_DEL_FUNC_SET), EO_TYPECHECK(Elm_GLView_Func_Cb, func) + +/** + * @def elm_obj_glview_resize_func_set + * @since 1.8 + * + * Set the resize function that gets called when resize happens. + * + * @param[in] func + * + * @see elm_glview_resize_func_set + * + * @ingroup GLView + */ +#define elm_obj_glview_resize_func_set(func) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RESIZE_FUNC_SET), EO_TYPECHECK(Elm_GLView_Func_Cb, func) + +/** + * @def elm_obj_glview_render_func_set + * @since 1.8 + * + * Set the render function that runs in the main loop. + * + * @param[in] func + * + * @see elm_glview_render_func_set + * + * @ingroup GLView + */ +#define elm_obj_glview_render_func_set(func) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RENDER_FUNC_SET), EO_TYPECHECK(Elm_GLView_Func_Cb, func) + +/** + * @def elm_obj_glview_changed_set + * @since 1.8 + * + * Notifies that there has been changes in the GLView. + * + * + * @see elm_glview_changed_set + * + * @ingroup GLView + */ +#define elm_obj_glview_changed_set() ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_CHANGED_SET) diff --git a/legacy/elementary/src/lib/elm_glview_legacy.h b/legacy/elementary/src/lib/elm_glview_legacy.h new file mode 100644 index 0000000000..b2c4956865 --- /dev/null +++ b/legacy/elementary/src/lib/elm_glview_legacy.h @@ -0,0 +1,162 @@ +/** + * Add a new glview to the parent + * + * @param parent The parent object + * @return The new object or NULL if it cannot be created + * + * @ingroup GLView + */ +EAPI Evas_Object *elm_glview_add(Evas_Object *parent); + +/** + * Gets the gl api struct for gl rendering + * + * @param obj The glview object + * @return The api object or NULL if it cannot be created + * + * @ingroup GLView + */ +EAPI Evas_GL_API *elm_glview_gl_api_get(const Evas_Object *obj); + +/** + * Set the mode of the GLView. Supports alpha, depth, stencil. + * + * @param obj The glview object + * @param mode The mode Options OR'ed enabling Alpha, Depth, Stencil, Direct. + * @return True if set properly. + * + * Direct is a hint for the elm_glview to render directly to the window + * given that the right conditions are met. Otherwise it falls back + * to rendering to an offscreen buffer before it gets composited to the + * window. + * + * @ingroup GLView + */ +EAPI Eina_Bool elm_glview_mode_set(Evas_Object *obj, Elm_GLView_Mode mode); + +/** + * Set the resize policy for the glview object. + * + * @param obj The glview object. + * @param policy The scaling policy. + * + * By default, the resize policy is set to ELM_GLVIEW_RESIZE_POLICY_RECREATE. + * When resize is called it destroys the previous surface and recreates the + * newly specified size. If the policy is set to + * ELM_GLVIEW_RESIZE_POLICY_SCALE, however, glview only scales the image + * object and not the underlying GL Surface. + * + * @ingroup GLView + */ +EAPI Eina_Bool elm_glview_resize_policy_set(Evas_Object *obj, Elm_GLView_Resize_Policy policy); + +/** + * Set the render policy for the glview object. + * + * @param obj The glview object. + * @param policy The render policy. + * + * By default, the render policy is set to ELM_GLVIEW_RENDER_POLICY_ON_DEMAND. + * This policy is set such that during the render loop, glview is only + * redrawn if it needs to be redrawn. (i.e. when it is visible) If the policy + * is set to ELM_GLVIEWW_RENDER_POLICY_ALWAYS, it redraws regardless of + * whether it is visible or needs redrawing. + * + * @ingroup GLView + */ +EAPI Eina_Bool elm_glview_render_policy_set(Evas_Object *obj, Elm_GLView_Render_Policy policy); + +/** + * Sets the size of the glview + * + * @param obj The glview object + * @param w width of the glview object + * @param h height of the glview object + * + * @ingroup GLView + */ +EAPI void elm_glview_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); + +/** + * Gets the size of the glview. + * + * @param obj The glview object + * @param w width of the glview object + * @param h height of the glview object + * + * Note that this function returns the actual image size of the + * glview. This means that when the scale policy is set to + * ELM_GLVIEW_RESIZE_POLICY_SCALE, it'll return the non-scaled + * size. + * + * @ingroup GLView + */ +EAPI void elm_glview_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); + +/** + * Set the init function that runs once in the main loop. + * + * @param obj The glview object. + * @param func The init function to be registered. + * + * The registered init function gets called once during the render loop. + * This function allows glview to hide all the rendering context/surface + * details and have the user just call GL calls that they desire + * for initialization GL calls. + * + * @ingroup GLView + */ +EAPI void elm_glview_init_func_set(Evas_Object *obj, Elm_GLView_Func_Cb func); + +/** + * Set the render function that runs in the main loop. + * + * @param obj The glview object. + * @param func The delete function to be registered. + * + * The registered del function gets called when GLView object is deleted. + * This function allows glview to hide all the rendering context/surface + * details and have the user just call GL calls that they desire + * when delete happens. + * + * @ingroup GLView + */ +EAPI void elm_glview_del_func_set(Evas_Object *obj, Elm_GLView_Func_Cb func); + +/** + * Set the resize function that gets called when resize happens. + * + * @param obj The glview object. + * @param func The resize function to be registered. + * + * The resize function gets called during the render loop. + * This function allows glview to hide all the rendering context/surface + * details and have the user just call GL calls that they desire + * when resize happens. + * + * @ingroup GLView + */ +EAPI void elm_glview_resize_func_set(Evas_Object *obj, Elm_GLView_Func_Cb func); + +/** + * Set the render function that runs in the main loop. + * + * The render function gets called in the main loop but whether it runs + * depends on the rendering policy and whether elm_glview_changed_set() + * gets called. + * + * @param obj The glview object. + * @param func The render function to be registered. + * + * @ingroup GLView + */ +EAPI void elm_glview_render_func_set(Evas_Object *obj, Elm_GLView_Func_Cb func); + +/** + * Notifies that there has been changes in the GLView. + * + * @param obj The glview object. + * + * @ingroup GLView + */ +EAPI void elm_glview_changed_set(Evas_Object *obj); diff --git a/legacy/elementary/src/lib/elm_hover.h b/legacy/elementary/src/lib/elm_hover.h index 76fbed7288..e1e684d6bd 100644 --- a/legacy/elementary/src/lib/elm_hover.h +++ b/legacy/elementary/src/lib/elm_hover.h @@ -77,185 +77,13 @@ * @{ */ -#define ELM_OBJ_HOVER_CLASS elm_obj_hover_class_get() - -const Eo_Class *elm_obj_hover_class_get(void) EINA_CONST; - - extern EAPI Eo_Op ELM_OBJ_HOVER_BASE_ID; - - enum - { - ELM_OBJ_HOVER_SUB_ID_TARGET_SET, - ELM_OBJ_HOVER_SUB_ID_TARGET_GET, - ELM_OBJ_HOVER_SUB_ID_BEST_CONTENT_LOCATION_GET, - ELM_OBJ_HOVER_SUB_ID_DISMISS, - ELM_OBJ_HOVER_SUB_ID_LAST - }; - -#define ELM_OBJ_HOVER_ID(sub_id) (ELM_OBJ_HOVER_BASE_ID + sub_id) - - -/** - * @def elm_obj_hover_target_set - * @since 1.8 - * - * @brief Sets the target object for the hover. - * - * @param[in] target - * - * @see elm_hover_target_set - */ -#define elm_obj_hover_target_set(target) ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_TARGET_SET), EO_TYPECHECK(Evas_Object *, target) - -/** - * @def elm_obj_hover_target_get - * @since 1.8 - * - * @brief Gets the target object for the hover. - * - * @param[out] ret - * - * @see elm_hover_target_get - */ -#define elm_obj_hover_target_get(ret) ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_TARGET_GET), EO_TYPECHECK(Evas_Object **, ret) - -/** - * @def elm_obj_hover_best_content_location_get - * @since 1.8 - * - * @brief Returns the best swallow location for content in the hover. - * - * @param[in] pref_axis - * @param[out] ret - * - * @see elm_hover_best_content_location_get - */ -#define elm_obj_hover_best_content_location_get(pref_axis, ret) ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_BEST_CONTENT_LOCATION_GET), EO_TYPECHECK(Elm_Hover_Axis, pref_axis), EO_TYPECHECK(const char **, ret) - -/** - * @def elm_obj_hover_dismiss - * @since 1.8 - * - * @brief Dismiss a hover object - * - * - * @see elm_hover_dismiss - */ -#define elm_obj_hover_dismiss() ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_DISMISS) - - -/** - * @typedef Elm_Hover_Axis - * - * The orientation axis for the hover object - */ -typedef enum -{ - ELM_HOVER_AXIS_NONE, /**< ELM_HOVER_AXIS_NONE -- no preferred orientation */ - ELM_HOVER_AXIS_HORIZONTAL, /**< ELM_HOVER_AXIS_HORIZONTAL -- horizontal */ - ELM_HOVER_AXIS_VERTICAL, /**< ELM_HOVER_AXIS_VERTICAL -- vertical */ - ELM_HOVER_AXIS_BOTH /**< ELM_HOVER_AXIS_BOTH -- both */ -} Elm_Hover_Axis; - -/** - * @brief Adds a hover object to @p parent - * - * @param parent The parent object - * @return The hover object or NULL if one could not be created - * - * @ingroup Hover - */ -EAPI Evas_Object *elm_hover_add(Evas_Object *parent); - -/** - * @brief Sets the target object for the hover. - * - * @param obj The hover object - * @param target The object to center the hover onto. - * - * This function will cause the hover to be centered on the target object. - * - * @ingroup Hover - */ -EAPI void elm_hover_target_set(Evas_Object *obj, Evas_Object *target); - -/** - * @brief Gets the target object for the hover. - * - * @param obj The hover object - * @return The target object for the hover. - * - * @see elm_hover_target_set() - * - * @ingroup Hover - */ -EAPI Evas_Object *elm_hover_target_get(const Evas_Object *obj); - -/** - * @brief Sets the parent object for the hover. - * - * @param obj The hover object - * @param parent The object to locate the hover over. - * - * This function will cause the hover to take up the entire space that the - * parent object fills. - * - * @ingroup Hover - */ -EAPI void elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent); - -/** - * @brief Gets the parent object for the hover. - * - * @param obj The hover object - * @return The parent object to locate the hover over. - * - * @see elm_hover_parent_set() - * - * @ingroup Hover - */ -EAPI Evas_Object *elm_hover_parent_get(const Evas_Object *obj); - -/** - * @brief Returns the best swallow location for content in the hover. - * - * @param obj The hover object - * @param pref_axis The preferred orientation axis for the hover object to use - * @return The edje location to place content into the hover or @c - * NULL, on errors. - * - * Best is defined here as the location at which there is the most available - * space. - * - * @p pref_axis may be one of - * - @c ELM_HOVER_AXIS_NONE -- no preferred orientation - * - @c ELM_HOVER_AXIS_HORIZONTAL -- horizontal - * - @c ELM_HOVER_AXIS_VERTICAL -- vertical - * - @c ELM_HOVER_AXIS_BOTH -- both - * - * If ELM_HOVER_AXIS_HORIZONTAL is chosen the returned position will - * necessarily be along the horizontal axis("left" or "right"). If - * ELM_HOVER_AXIS_VERTICAL is chosen the returned position will necessarily - * be along the vertical axis("top" or "bottom"). Choosing - * ELM_HOVER_AXIS_BOTH or ELM_HOVER_AXIS_NONE has the same effect and the - * returned position may be in either axis. - * - * @see elm_object_part_content_set() - * - * @ingroup Hover - */ -EAPI const char *elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_axis); - -/** - * @brief Dismiss a hover object - * - * @param obj The hover object - * Use this function to simulate clicking outside the hover to dismiss it. - * In this way, the hover will be hidden and the "clicked" signal will be emitted. - * - * @ingroup Hover - */ -EAPI void elm_hover_dismiss(Evas_Object *obj); +#include "elm_hover_common.h" +#ifdef EFL_EO_API_SUPPORT +#include "elm_hover_eo.h" +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include "elm_hover_legacy.h" +#endif /** * @} */ diff --git a/legacy/elementary/src/lib/elm_hover_common.h b/legacy/elementary/src/lib/elm_hover_common.h new file mode 100644 index 0000000000..2645cab806 --- /dev/null +++ b/legacy/elementary/src/lib/elm_hover_common.h @@ -0,0 +1,13 @@ +/** + * @typedef Elm_Hover_Axis + * + * The orientation axis for the hover object + */ +typedef enum +{ + ELM_HOVER_AXIS_NONE, /**< ELM_HOVER_AXIS_NONE -- no preferred orientation */ + ELM_HOVER_AXIS_HORIZONTAL, /**< ELM_HOVER_AXIS_HORIZONTAL -- horizontal */ + ELM_HOVER_AXIS_VERTICAL, /**< ELM_HOVER_AXIS_VERTICAL -- vertical */ + ELM_HOVER_AXIS_BOTH /**< ELM_HOVER_AXIS_BOTH -- both */ +} Elm_Hover_Axis; + diff --git a/legacy/elementary/src/lib/elm_hover_eo.h b/legacy/elementary/src/lib/elm_hover_eo.h new file mode 100644 index 0000000000..3f7a2bb066 --- /dev/null +++ b/legacy/elementary/src/lib/elm_hover_eo.h @@ -0,0 +1,71 @@ +#define ELM_OBJ_HOVER_CLASS elm_obj_hover_class_get() + +const Eo_Class *elm_obj_hover_class_get(void) EINA_CONST; + + extern EAPI Eo_Op ELM_OBJ_HOVER_BASE_ID; + + enum + { + ELM_OBJ_HOVER_SUB_ID_TARGET_SET, + ELM_OBJ_HOVER_SUB_ID_TARGET_GET, + ELM_OBJ_HOVER_SUB_ID_BEST_CONTENT_LOCATION_GET, + ELM_OBJ_HOVER_SUB_ID_DISMISS, + ELM_OBJ_HOVER_SUB_ID_LAST + }; + +#define ELM_OBJ_HOVER_ID(sub_id) (ELM_OBJ_HOVER_BASE_ID + sub_id) + + +/** + * @def elm_obj_hover_target_set + * @since 1.8 + * + * @brief Sets the target object for the hover. + * + * @param[in] target + * + * @see elm_hover_target_set + * + * @ingroup Hover + */ +#define elm_obj_hover_target_set(target) ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_TARGET_SET), EO_TYPECHECK(Evas_Object *, target) + +/** + * @def elm_obj_hover_target_get + * @since 1.8 + * + * @brief Gets the target object for the hover. + * + * @param[out] ret + * + * @see elm_hover_target_get + * + * @ingroup Hover + */ +#define elm_obj_hover_target_get(ret) ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_TARGET_GET), EO_TYPECHECK(Evas_Object **, ret) + +/** + * @def elm_obj_hover_best_content_location_get + * @since 1.8 + * + * @brief Returns the best swallow location for content in the hover. + * + * @param[in] pref_axis + * @param[out] ret + * + * @see elm_hover_best_content_location_get + * + * @ingroup Hover + */ +#define elm_obj_hover_best_content_location_get(pref_axis, ret) ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_BEST_CONTENT_LOCATION_GET), EO_TYPECHECK(Elm_Hover_Axis, pref_axis), EO_TYPECHECK(const char **, ret) + +/** + * @def elm_obj_hover_dismiss + * @since 1.8 + * + * @brief Dismiss a hover object + * + * + * @see elm_hover_dismiss + */ +#define elm_obj_hover_dismiss() ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_DISMISS) diff --git a/legacy/elementary/src/lib/elm_hover_legacy.h b/legacy/elementary/src/lib/elm_hover_legacy.h new file mode 100644 index 0000000000..b559cf6843 --- /dev/null +++ b/legacy/elementary/src/lib/elm_hover_legacy.h @@ -0,0 +1,99 @@ +/** + * @brief Adds a hover object to @p parent + * + * @param parent The parent object + * @return The hover object or NULL if one could not be created + * + * @ingroup Hover + */ +EAPI Evas_Object *elm_hover_add(Evas_Object *parent); + +/** + * @brief Sets the parent object for the hover. + * + * @param obj The hover object + * @param parent The object to locate the hover over. + * + * This function will cause the hover to take up the entire space that the + * parent object fills. + * + * @ingroup Hover + */ +EAPI void elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent); + +/** + * @brief Gets the parent object for the hover. + * + * @param obj The hover object + * @return The parent object to locate the hover over. + * + * @see elm_hover_parent_set() + * + * @ingroup Hover + */ +EAPI Evas_Object *elm_hover_parent_get(const Evas_Object *obj); + +/** + * @brief Sets the target object for the hover. + * + * @param obj The hover object + * @param target The object to center the hover onto. + * + * This function will cause the hover to be centered on the target object. + * + * @ingroup Hover + */ +EAPI void elm_hover_target_set(Evas_Object *obj, Evas_Object *target); + +/** + * @brief Gets the target object for the hover. + * + * @param obj The hover object + * @return The target object for the hover. + * + * @see elm_hover_target_set() + * + * @ingroup Hover + */ +EAPI Evas_Object *elm_hover_target_get(const Evas_Object *obj); + +/** + * @brief Returns the best swallow location for content in the hover. + * + * @param obj The hover object + * @param pref_axis The preferred orientation axis for the hover object to use + * @return The edje location to place content into the hover or @c + * NULL, on errors. + * + * Best is defined here as the location at which there is the most available + * space. + * + * @p pref_axis may be one of + * - @c ELM_HOVER_AXIS_NONE -- no preferred orientation + * - @c ELM_HOVER_AXIS_HORIZONTAL -- horizontal + * - @c ELM_HOVER_AXIS_VERTICAL -- vertical + * - @c ELM_HOVER_AXIS_BOTH -- both + * + * If ELM_HOVER_AXIS_HORIZONTAL is chosen the returned position will + * necessarily be along the horizontal axis("left" or "right"). If + * ELM_HOVER_AXIS_VERTICAL is chosen the returned position will necessarily + * be along the vertical axis("top" or "bottom"). Choosing + * ELM_HOVER_AXIS_BOTH or ELM_HOVER_AXIS_NONE has the same effect and the + * returned position may be in either axis. + * + * @see elm_object_part_content_set() + * + * @ingroup Hover + */ +EAPI const char *elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_axis); + +/** + * @brief Dismiss a hover object + * + * @param obj The hover object + * Use this function to simulate clicking outside the hover to dismiss it. + * In this way, the hover will be hidden and the "clicked" signal will be emitted. + * + * @ingroup Hover + */ +EAPI void elm_hover_dismiss(Evas_Object *obj); diff --git a/legacy/elementary/src/lib/elm_icon.h b/legacy/elementary/src/lib/elm_icon.h index 52cd7d5598..de3ee29bf1 100644 --- a/legacy/elementary/src/lib/elm_icon.h +++ b/legacy/elementary/src/lib/elm_icon.h @@ -97,220 +97,13 @@ * @li @ref tutorial_icon */ -#define ELM_OBJ_ICON_CLASS elm_obj_icon_class_get() - -const Eo_Class *elm_obj_icon_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_ICON_BASE_ID; - -enum -{ - ELM_OBJ_ICON_SUB_ID_THUMB_SET, - ELM_OBJ_ICON_SUB_ID_STANDARD_SET, - ELM_OBJ_ICON_SUB_ID_STANDARD_GET, - ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_SET, - ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_GET, - ELM_OBJ_ICON_SUB_ID_LAST -}; - -#define ELM_OBJ_ICON_ID(sub_id) (ELM_OBJ_ICON_BASE_ID + sub_id) - - -/** - * @def elm_obj_icon_thumb_set - * @since 1.8 - * - * Set the file that will be used, but use a generated thumbnail. - * - * @param[in] file - * @param[in] group - * - * @see elm_icon_thumb_set - */ -#define elm_obj_icon_thumb_set(file, group) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_THUMB_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(const char *, group) - -/** - * @def elm_obj_icon_standard_set - * @since 1.8 - * - * Set the icon by icon standards names. - * - * @param[in] name - * @param[out] ret - * - * @see elm_icon_standard_set - */ -#define elm_obj_icon_standard_set(name, ret) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_STANDARD_SET), EO_TYPECHECK(const char *, name), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_icon_standard_get - * @since 1.8 - * - * Get the icon name set by icon standard names. - * - * @param[out] ret - * - * @see elm_icon_standard_get - */ -#define elm_obj_icon_standard_get(ret) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_STANDARD_GET), EO_TYPECHECK(const char **, ret) - -/** - * @def elm_obj_icon_order_lookup_set - * @since 1.8 - * - * Sets the icon lookup order used by elm_icon_standard_set(). - * - * @param[in] order - * - * @see elm_icon_order_lookup_set - */ -#define elm_obj_icon_order_lookup_set(order) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_SET), EO_TYPECHECK(Elm_Icon_Lookup_Order, order) - -/** - * @def elm_obj_icon_order_lookup_get - * @since 1.8 - * - * Gets the icon lookup order. - * - * @param[out] ret - * - * @see elm_icon_order_lookup_get - */ -#define elm_obj_icon_order_lookup_get(ret) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_GET), EO_TYPECHECK(Elm_Icon_Lookup_Order *, ret) - - -/** - * @addtogroup Icon - * @{ - */ - -typedef enum -{ - ELM_ICON_NONE, - ELM_ICON_FILE, - ELM_ICON_STANDARD -} Elm_Icon_Type; - -/** - * @enum Elm_Icon_Lookup_Order - * @typedef Elm_Icon_Lookup_Order - * - * Lookup order used by elm_icon_standard_set(). Should look for icons in the - * theme, FDO paths, or both? - * - * @ingroup Icon - */ -typedef enum -{ - ELM_ICON_LOOKUP_FDO_THEME, /**< icon look up order: freedesktop, theme */ - ELM_ICON_LOOKUP_THEME_FDO, /**< icon look up order: theme, freedesktop */ - ELM_ICON_LOOKUP_FDO, /**< icon look up order: freedesktop */ - ELM_ICON_LOOKUP_THEME /**< icon look up order: theme */ -} Elm_Icon_Lookup_Order; - -/** - * Add a new icon object to the parent. - * - * @param parent The parent object - * @return The new object or NULL if it cannot be created - * - * @see elm_image_file_set() - * - * @ingroup Icon - */ -EAPI Evas_Object *elm_icon_add(Evas_Object *parent); - -/** - * Set the file that will be used, but use a generated thumbnail. - * - * @param obj The icon object - * @param file The path to file that will be used as icon image - * @param group The group that the icon belongs to an edje file - * - * This functions like elm_image_file_set() but requires the Ethumb library - * support to be enabled successfully with elm_need_ethumb(). When set - * the file indicated has a thumbnail generated and cached on disk for - * future use or will directly use an existing cached thumbnail if it - * is valid. - * - * @see elm_image_file_set() - * - * @ingroup Icon - */ -EAPI void elm_icon_thumb_set(Evas_Object *obj, const char *file, const char *group); - -/** - * Set the icon by icon standards names. - * - * @param obj The icon object - * @param name The icon name - * - * @return (@c EINA_TRUE = success, @c EINA_FALSE = error) - * - * For example, freedesktop.org defines standard icon names such as "home", - * "network", etc. There can be different icon sets to match those icon - * keys. The @p name given as parameter is one of these "keys", and will be - * used to look in the freedesktop.org paths and elementary theme. One can - * change the lookup order with elm_icon_order_lookup_set(). - * - * If name is not found in any of the expected locations and it is the - * absolute path of an image file, this image will be used. - * - * @note The icon image set by this function can be changed by - * elm_image_file_set(). - * - * @note This function does not accept relative icon path. - * - * @see elm_icon_standard_get() - * @see elm_image_file_set() - * - * @ingroup Icon - */ -EAPI Eina_Bool elm_icon_standard_set(Evas_Object *obj, const char *name); - -/** - * Get the icon name set by icon standard names. - * - * @param obj The icon object - * @return The icon name - * - * If the icon image was set using elm_image_file_set() instead of - * elm_icon_standard_set(), then this function will return @c NULL. - * - * @see elm_icon_standard_set() - * - * @ingroup Icon - */ -EAPI const char *elm_icon_standard_get(const Evas_Object *obj); - -/** - * Sets the icon lookup order used by elm_icon_standard_set(). - * - * @param obj The icon object - * @param order The icon lookup order (can be one of - * ELM_ICON_LOOKUP_FDO_THEME, ELM_ICON_LOOKUP_THEME_FDO, ELM_ICON_LOOKUP_FDO - * or ELM_ICON_LOOKUP_THEME) - * - * @see elm_icon_order_lookup_get() - * @see Elm_Icon_Lookup_Order - * - * @ingroup Icon - */ -EAPI void elm_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order); - -/** - * Gets the icon lookup order. - * - * @param obj The icon object - * @return The icon lookup order - * - * @see elm_icon_order_lookup_set() - * @see Elm_Icon_Lookup_Order - * - * @ingroup Icon - */ -EAPI Elm_Icon_Lookup_Order elm_icon_order_lookup_get(const Evas_Object *obj); - +#include "elm_icon_common.h" +#ifdef EFL_EO_API_SUPPORT +#include "elm_icon_eo.h" +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include "elm_icon_legacy.h" +#endif /** * @} */ diff --git a/legacy/elementary/src/lib/elm_icon_common.h b/legacy/elementary/src/lib/elm_icon_common.h new file mode 100644 index 0000000000..a18736a641 --- /dev/null +++ b/legacy/elementary/src/lib/elm_icon_common.h @@ -0,0 +1,29 @@ +/** + * @addtogroup Icon + * @{ + */ + +typedef enum +{ + ELM_ICON_NONE, + ELM_ICON_FILE, + ELM_ICON_STANDARD +} Elm_Icon_Type; + +/** + * @enum Elm_Icon_Lookup_Order + * @typedef Elm_Icon_Lookup_Order + * + * Lookup order used by elm_icon_standard_set(). Should look for icons in the + * theme, FDO paths, or both? + * + * @ingroup Icon + */ +typedef enum +{ + ELM_ICON_LOOKUP_FDO_THEME, /**< icon look up order: freedesktop, theme */ + ELM_ICON_LOOKUP_THEME_FDO, /**< icon look up order: theme, freedesktop */ + ELM_ICON_LOOKUP_FDO, /**< icon look up order: freedesktop */ + ELM_ICON_LOOKUP_THEME /**< icon look up order: theme */ +} Elm_Icon_Lookup_Order; + diff --git a/legacy/elementary/src/lib/elm_icon_eo.h b/legacy/elementary/src/lib/elm_icon_eo.h new file mode 100644 index 0000000000..53cf9b4ae7 --- /dev/null +++ b/legacy/elementary/src/lib/elm_icon_eo.h @@ -0,0 +1,90 @@ +#define ELM_OBJ_ICON_CLASS elm_obj_icon_class_get() + +const Eo_Class *elm_obj_icon_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_ICON_BASE_ID; + +enum +{ + ELM_OBJ_ICON_SUB_ID_THUMB_SET, + ELM_OBJ_ICON_SUB_ID_STANDARD_SET, + ELM_OBJ_ICON_SUB_ID_STANDARD_GET, + ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_SET, + ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_GET, + ELM_OBJ_ICON_SUB_ID_LAST +}; + +#define ELM_OBJ_ICON_ID(sub_id) (ELM_OBJ_ICON_BASE_ID + sub_id) + + +/** + * @def elm_obj_icon_thumb_set + * @since 1.8 + * + * Set the file that will be used, but use a generated thumbnail. + * + * @param[in] file + * @param[in] group + * + * @see elm_icon_thumb_set + * + * @ingroup Icon + */ +#define elm_obj_icon_thumb_set(file, group) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_THUMB_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(const char *, group) + +/** + * @def elm_obj_icon_standard_set + * @since 1.8 + * + * Set the icon by icon standards names. + * + * @param[in] name + * @param[out] ret + * + * @see elm_icon_standard_set + * + * @ingroup Icon + */ +#define elm_obj_icon_standard_set(name, ret) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_STANDARD_SET), EO_TYPECHECK(const char *, name), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_icon_standard_get + * @since 1.8 + * + * Get the icon name set by icon standard names. + * + * @param[out] ret + * + * @see elm_icon_standard_get + * + * @ingroup Icon + */ +#define elm_obj_icon_standard_get(ret) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_STANDARD_GET), EO_TYPECHECK(const char **, ret) + +/** + * @def elm_obj_icon_order_lookup_set + * @since 1.8 + * + * Sets the icon lookup order used by elm_icon_standard_set(). + * + * @param[in] order + * + * @see elm_icon_order_lookup_set + * + * @ingroup Icon + */ +#define elm_obj_icon_order_lookup_set(order) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_SET), EO_TYPECHECK(Elm_Icon_Lookup_Order, order) + +/** + * @def elm_obj_icon_order_lookup_get + * @since 1.8 + * + * Gets the icon lookup order. + * + * @param[out] ret + * + * @see elm_icon_order_lookup_get + * + * @ingroup Icon + */ +#define elm_obj_icon_order_lookup_get(ret) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_GET), EO_TYPECHECK(Elm_Icon_Lookup_Order *, ret) diff --git a/legacy/elementary/src/lib/elm_icon_legacy.h b/legacy/elementary/src/lib/elm_icon_legacy.h new file mode 100644 index 0000000000..7aff8662c0 --- /dev/null +++ b/legacy/elementary/src/lib/elm_icon_legacy.h @@ -0,0 +1,102 @@ +/** + * Add a new icon object to the parent. + * + * @param parent The parent object + * @return The new object or NULL if it cannot be created + * + * @see elm_image_file_set() + * + * @ingroup Icon + */ +EAPI Evas_Object *elm_icon_add(Evas_Object *parent); + +/** + * Set the file that will be used, but use a generated thumbnail. + * + * @param obj The icon object + * @param file The path to file that will be used as icon image + * @param group The group that the icon belongs to an edje file + * + * This functions like elm_image_file_set() but requires the Ethumb library + * support to be enabled successfully with elm_need_ethumb(). When set + * the file indicated has a thumbnail generated and cached on disk for + * future use or will directly use an existing cached thumbnail if it + * is valid. + * + * @see elm_image_file_set() + * + * @ingroup Icon + */ +EAPI void elm_icon_thumb_set(Evas_Object *obj, const char *file, const char *group); + +/** + * Set the icon by icon standards names. + * + * @param obj The icon object + * @param name The icon name + * + * @return (@c EINA_TRUE = success, @c EINA_FALSE = error) + * + * For example, freedesktop.org defines standard icon names such as "home", + * "network", etc. There can be different icon sets to match those icon + * keys. The @p name given as parameter is one of these "keys", and will be + * used to look in the freedesktop.org paths and elementary theme. One can + * change the lookup order with elm_icon_order_lookup_set(). + * + * If name is not found in any of the expected locations and it is the + * absolute path of an image file, this image will be used. + * + * @note The icon image set by this function can be changed by + * elm_image_file_set(). + * + * @note This function does not accept relative icon path. + * + * @see elm_icon_standard_get() + * @see elm_image_file_set() + * + * @ingroup Icon + */ +EAPI Eina_Bool elm_icon_standard_set(Evas_Object *obj, const char *name); + +/** + * Get the icon name set by icon standard names. + * + * @param obj The icon object + * @return The icon name + * + * If the icon image was set using elm_image_file_set() instead of + * elm_icon_standard_set(), then this function will return @c NULL. + * + * @see elm_icon_standard_set() + * + * @ingroup Icon + */ +EAPI const char *elm_icon_standard_get(const Evas_Object *obj); + +/** + * Sets the icon lookup order used by elm_icon_standard_set(). + * + * @param obj The icon object + * @param order The icon lookup order (can be one of + * ELM_ICON_LOOKUP_FDO_THEME, ELM_ICON_LOOKUP_THEME_FDO, ELM_ICON_LOOKUP_FDO + * or ELM_ICON_LOOKUP_THEME) + * + * @see elm_icon_order_lookup_get() + * @see Elm_Icon_Lookup_Order + * + * @ingroup Icon + */ +EAPI void elm_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order); + +/** + * Gets the icon lookup order. + * + * @param obj The icon object + * @return The icon lookup order + * + * @see elm_icon_order_lookup_set() + * @see Elm_Icon_Lookup_Order + * + * @ingroup Icon + */ +EAPI Elm_Icon_Lookup_Order elm_icon_order_lookup_get(const Evas_Object *obj); diff --git a/legacy/elementary/src/lib/elm_inwin.h b/legacy/elementary/src/lib/elm_inwin.h index a18af41f4d..cd77649f90 100644 --- a/legacy/elementary/src/lib/elm_inwin.h +++ b/legacy/elementary/src/lib/elm_inwin.h @@ -41,112 +41,12 @@ * @{ */ -#define ELM_OBJ_WIN_INWIN_CLASS elm_obj_win_inwin_class_get() - -const Eo_Class *elm_obj_win_inwin_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_WIN_INWIN_BASE_ID; - -enum -{ - ELM_OBJ_WIN_INWIN_SUB_ID_ACTIVATE, - ELM_OBJ_WIN_INWIN_SUB_ID_LAST -}; - -#define ELM_OBJ_WIN_INWIN_ID(sub_id) (ELM_OBJ_WIN_INWIN_BASE_ID + sub_id) - -/** - * @def elm_obj_win_inwin_activate - * @since 1.8 - * - * No description supplied by the EAPI. - * - */ -#define elm_obj_win_inwin_activate() ELM_OBJ_WIN_INWIN_ID(ELM_OBJ_WIN_INWIN_SUB_ID_ACTIVATE) - -/** - * Adds an inwin to the current window - * - * The @p obj used as parent @b MUST be an @ref Win "Elementary Window". - * Never call this function with anything other than the top-most window - * as its parameter, unless you are fond of undefined behavior. - * - * After creating the object, the widget will set itself as resize object - * for the window with elm_win_resize_object_add(), so when shown it will - * appear to cover almost the entire window (how much of it depends on its - * content and the style used). It must not be added into other container - * objects and it needs not be moved or resized manually. - * - * @param parent The parent object - * @return The new object or NULL if it cannot be created - * - * @ingroup Inwin - */ -EAPI Evas_Object *elm_win_inwin_add(Evas_Object *parent); - -/** - * Activates an inwin object, ensuring its visibility - * - * This function will make sure that the inwin @p obj is completely visible - * by calling evas_object_show() and evas_object_raise() on it, to bring it - * to the front. It also sets the keyboard focus to it, which will be passed - * onto its content. - * - * The object's theme will also receive the signal "elm,action,show" with - * source "elm". - * - * @param obj The inwin to activate - * - * @ingroup Inwin - */ -EAPI void elm_win_inwin_activate(Evas_Object *obj); - -/** - * Set the content of an inwin object. - * - * Once the content object is set, a previously set one will be deleted. - * If you want to keep that old content object, use the - * elm_win_inwin_content_unset() function. - * - * @param obj The inwin object - * @param content The object to set as content - * - * @ingroup Inwin - */ -EAPI void elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content); - -/** - * Get the content of an inwin object. - * - * Return the content object for this widget. - * - * The returned object is valid as long as the inwin is still alive and no - * other content is set on it. Deleting the object will notify the inwin - * about it and this one will be left empty. - * - * If you need to remove an inwin's content to be reused somewhere else, - * see elm_win_inwin_content_unset(). - * - * @param obj The inwin object - * @return The content that is being used - * - * @ingroup Inwin - */ -EAPI Evas_Object *elm_win_inwin_content_get(const Evas_Object *obj); - -/** - * Unset the content of an inwin object. - * - * Unparent and return the content object which was set for this widget. - * - * @param obj The inwin object - * @return The content that was being used - * - * @ingroup Inwin - */ -EAPI Evas_Object *elm_win_inwin_content_unset(Evas_Object *obj); - +#ifdef EFL_EO_API_SUPPORT +#include "elm_inwin_eo.h" +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include "elm_inwin_legacy.h" +#endif /** * @} */ - diff --git a/legacy/elementary/src/lib/elm_inwin_eo.h b/legacy/elementary/src/lib/elm_inwin_eo.h new file mode 100644 index 0000000000..5ebee8cb72 --- /dev/null +++ b/legacy/elementary/src/lib/elm_inwin_eo.h @@ -0,0 +1,23 @@ +#define ELM_OBJ_WIN_INWIN_CLASS elm_obj_win_inwin_class_get() + +const Eo_Class *elm_obj_win_inwin_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_WIN_INWIN_BASE_ID; + +enum +{ + ELM_OBJ_WIN_INWIN_SUB_ID_ACTIVATE, + ELM_OBJ_WIN_INWIN_SUB_ID_LAST +}; + +#define ELM_OBJ_WIN_INWIN_ID(sub_id) (ELM_OBJ_WIN_INWIN_BASE_ID + sub_id) + +/** + * @def elm_obj_win_inwin_activate + * @since 1.8 + * + * No description supplied by the EAPI. + * + * @ingroup Inwin + */ +#define elm_obj_win_inwin_activate() ELM_OBJ_WIN_INWIN_ID(ELM_OBJ_WIN_INWIN_SUB_ID_ACTIVATE) diff --git a/legacy/elementary/src/lib/elm_inwin_legacy.h b/legacy/elementary/src/lib/elm_inwin_legacy.h new file mode 100644 index 0000000000..abe0f4b182 --- /dev/null +++ b/legacy/elementary/src/lib/elm_inwin_legacy.h @@ -0,0 +1,82 @@ +/** + * Adds an inwin to the current window + * + * The @p obj used as parent @b MUST be an @ref Win "Elementary Window". + * Never call this function with anything other than the top-most window + * as its parameter, unless you are fond of undefined behavior. + * + * After creating the object, the widget will set itself as resize object + * for the window with elm_win_resize_object_add(), so when shown it will + * appear to cover almost the entire window (how much of it depends on its + * content and the style used). It must not be added into other container + * objects and it needs not be moved or resized manually. + * + * @param parent The parent object + * @return The new object or NULL if it cannot be created + * + * @ingroup Inwin + */ +EAPI Evas_Object *elm_win_inwin_add(Evas_Object *parent); + +/** + * Activates an inwin object, ensuring its visibility + * + * This function will make sure that the inwin @p obj is completely visible + * by calling evas_object_show() and evas_object_raise() on it, to bring it + * to the front. It also sets the keyboard focus to it, which will be passed + * onto its content. + * + * The object's theme will also receive the signal "elm,action,show" with + * source "elm". + * + * @param obj The inwin to activate + * + * @ingroup Inwin + */ +EAPI void elm_win_inwin_activate(Evas_Object *obj); + +/** + * Set the content of an inwin object. + * + * Once the content object is set, a previously set one will be deleted. + * If you want to keep that old content object, use the + * elm_win_inwin_content_unset() function. + * + * @param obj The inwin object + * @param content The object to set as content + * + * @ingroup Inwin + */ +EAPI void elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content); + +/** + * Get the content of an inwin object. + * + * Return the content object for this widget. + * + * The returned object is valid as long as the inwin is still alive and no + * other content is set on it. Deleting the object will notify the inwin + * about it and this one will be left empty. + * + * If you need to remove an inwin's content to be reused somewhere else, + * see elm_win_inwin_content_unset(). + * + * @param obj The inwin object + * @return The content that is being used + * + * @ingroup Inwin + */ +EAPI Evas_Object *elm_win_inwin_content_get(const Evas_Object *obj); + +/** + * Unset the content of an inwin object. + * + * Unparent and return the content object which was set for this widget. + * + * @param obj The inwin object + * @return The content that was being used + * + * @ingroup Inwin + */ +EAPI Evas_Object *elm_win_inwin_content_unset(Evas_Object *obj); + diff --git a/legacy/elementary/src/lib/elm_label.h b/legacy/elementary/src/lib/elm_label.h index c62bf03489..3396bf0c24 100644 --- a/legacy/elementary/src/lib/elm_label.h +++ b/legacy/elementary/src/lib/elm_label.h @@ -39,347 +39,13 @@ * See @ref tutorial_label for a demonstration of how to use a label widget. * @{ */ - -#define ELM_OBJ_LABEL_CLASS elm_obj_label_class_get() - -const Eo_Class *elm_obj_label_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_LABEL_BASE_ID; - -enum -{ - ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_SET, - ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_GET, - ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_SET, - ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_GET, - ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_SET, - ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_GET, - ELM_OBJ_LABEL_SUB_ID_SLIDE_MODE_SET, - ELM_OBJ_LABEL_SUB_ID_SLIDE_MODE_GET, - ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_SET, - ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_GET, - ELM_OBJ_LABEL_SUB_ID_SLIDE_GO, - ELM_OBJ_LABEL_SUB_ID_LAST -}; - -#define ELM_OBJ_LABEL_ID(sub_id) (ELM_OBJ_LABEL_BASE_ID + sub_id) - - -/** - * @def elm_obj_label_line_wrap_set - * @since 1.8 - * - * @brief Set the wrapping behavior of the label - * - * @param[in] wrap - * - * @see elm_label_line_wrap_set - */ -#define elm_obj_label_line_wrap_set(wrap) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_SET), EO_TYPECHECK(Elm_Wrap_Type, wrap) - -/** - * @def elm_obj_label_line_wrap_get - * @since 1.8 - * - * @brief Get the wrapping behavior of the label - * - * @param[out] ret - * - * @see elm_label_line_wrap_get - */ -#define elm_obj_label_line_wrap_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_GET), EO_TYPECHECK(Elm_Wrap_Type *, ret) - -/** - * @def elm_obj_label_wrap_width_set - * @since 1.8 - * - * @brief Set wrap width of the label - * - * @param[in] w - * - * @see elm_label_wrap_width_set - */ -#define elm_obj_label_wrap_width_set(w) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_SET), EO_TYPECHECK(Evas_Coord, w) - -/** - * @def elm_obj_label_wrap_width_get - * @since 1.8 - * - * @brief Get wrap width of the label - * - * @param[out] ret - * - * @see elm_label_wrap_width_get - */ -#define elm_obj_label_wrap_width_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_GET), EO_TYPECHECK(Evas_Coord *, ret) - -/** - * @def elm_obj_label_ellipsis_set - * @since 1.8 - * - * @brief Set the ellipsis behavior of the label - * - * @param[in] ellipsis - * - * @see elm_label_ellipsis_set - */ -#define elm_obj_label_ellipsis_set(ellipsis) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_SET), EO_TYPECHECK(Eina_Bool, ellipsis) - -/** - * @def elm_obj_label_ellipsis_get - * @since 1.8 - * - * @brief Get the ellipsis behavior of the label - * - * @param[out] ret - * - * @see elm_label_ellipsis_get - */ -#define elm_obj_label_ellipsis_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_label_slide_mode_set - * @since 1.8 - * - * @brief Set slide effect mode of label widget. - * - * @param[in] mode - * - * @see elm_label_slide_mode_set - */ -#define elm_obj_label_slide_mode_set(mode) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_MODE_SET), EO_TYPECHECK(Elm_Label_Slide_Mode, mode) - -/** - * @def elm_obj_label_slide_mode_get - * @since 1.8 - * - * @brief Get current slide effect mode. - * - * @param[out] ret - * - * @see elm_label_slide_mode_get - */ -#define elm_obj_label_slide_mode_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_MODE_GET), EO_TYPECHECK(Elm_Label_Slide_Mode *, ret) - -/** - * @def elm_obj_label_slide_duration_set - * @since 1.8 - * - * @brief Set the slide duration (speed) of the label - * - * @param[in] duration - * - * @see elm_label_slide_duration_set - */ -#define elm_obj_label_slide_duration_set(duration) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_SET), EO_TYPECHECK(double, duration) - -/** - * @def elm_obj_label_slide_duration_get - * @since 1.8 - * - * @brief Get the slide duration(speed) of the label - * - * @param[out] ret - * - * @see elm_label_slide_duration_get - */ -#define elm_obj_label_slide_duration_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_GET), EO_TYPECHECK(double *, ret) - -/** - * @def elm_obj_label_slide_go - * @since 1.8 - * - * @brief Start slide effect - * - * @see elm_label_slide_mode_set - */ -#define elm_obj_label_slide_go() ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_GO) - - -typedef enum -{ - ELM_LABEL_SLIDE_MODE_NONE = 0, /**< no slide effect */ - ELM_LABEL_SLIDE_MODE_AUTO, /**< slide only if the label area is bigger than the text width length */ - ELM_LABEL_SLIDE_MODE_ALWAYS /**< slide always */ -} Elm_Label_Slide_Mode; - -/** - * @brief Add a new label to the parent - * - * @param parent The parent object - * @return The new object or NULL if it cannot be created - * - * @ingroup Label - */ -EAPI Evas_Object *elm_label_add(Evas_Object *parent); - -/** - * @brief Set the wrapping behavior of the label - * - * @param obj The label object - * @param wrap To wrap text or not - * - * By default no wrapping is done. Possible values for @p wrap are: - * @li ELM_WRAP_NONE - No wrapping - * @li ELM_WRAP_CHAR - wrap between characters - * @li ELM_WRAP_WORD - wrap between words - * @li ELM_WRAP_MIXED - Word wrap, and if that fails, char wrap - * - * @ingroup Label - */ -EAPI void elm_label_line_wrap_set(Evas_Object *obj, Elm_Wrap_Type wrap); - -/** - * @brief Get the wrapping behavior of the label - * - * @param obj The label object - * @return Wrap type - * - * @see elm_label_line_wrap_set() - * - * @ingroup Label - */ -EAPI Elm_Wrap_Type elm_label_line_wrap_get(const Evas_Object *obj); - -/** - * @brief Set wrap width of the label - * - * @param obj The label object - * @param w The wrap width in pixels at a minimum where words need to wrap - * - * This function sets the maximum width size hint of the label. - * - * @warning This is only relevant if the label is inside a container. - * - * @ingroup Label - */ -EAPI void elm_label_wrap_width_set(Evas_Object *obj, Evas_Coord w); - -/** - * @brief Get wrap width of the label - * - * @param obj The label object - * @return The wrap width in pixels at a minimum where words need to wrap - * - * @see elm_label_wrap_width_set() - * - * @ingroup Label - */ -EAPI Evas_Coord elm_label_wrap_width_get(const Evas_Object *obj); - -/** - * @brief Set the ellipsis behavior of the label - * - * @param obj The label object - * @param ellipsis To ellipsis text or not - * - * If set to true and the text doesn't fit in the label an ellipsis("...") - * will be shown at the end of the widget. - * - * @warning This doesn't work with slide(elm_label_slide_set()) or if the - * chosen wrap method was #ELM_WRAP_WORD. - * - * @ingroup Label - */ -EAPI void elm_label_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis); - -/** - * @brief Get the ellipsis behavior of the label - * - * @param obj The label object - * @return If true, an ellipsis will be shown at the end of the label area. - * - * @see elm_label_ellipsis_set() - * - * @ingroup Label - */ -EAPI Eina_Bool elm_label_ellipsis_get(const Evas_Object *obj); - -/** - * @brief Set the slide duration (speed) of the label - * - * @param obj The label object - * @param duration The duration in seconds in moving text from slide begin position - * to slide end position - * - * @ingroup Label - */ -EAPI void elm_label_slide_duration_set(Evas_Object *obj, double duration); - -/** - * @brief Get the slide duration(speed) of the label - * - * @param obj The label object - * @return The duration time in moving text from slide begin position to slide end position - * - * @see elm_label_slide_duration_set() - * - * @ingroup Label - */ -EAPI double elm_label_slide_duration_get(const Evas_Object *obj); - -/** - * @brief Slide only if the - * - * @param obj The label object - * @param duration The duration in seconds in moving text from slide begin position - * to slide end position - * - * @ingroup Label - */ -EAPI void elm_label_slide_area_limit_set(Evas_Object *obj, Eina_Bool limit); - -/** - * @brief Set the slide mode of the label widget. - * - * @param obj The label object - * @param mode The slide mode - * - * elm_label_slide_mode_set() changes label slide mode. - * By default, slide mode is none. Possible values for @p mode are: - * @li ELM_LABEL_SLIDE_MODE_NONE - no slide effect - * @li ELM_LABEL_SLIDE_MODE_AUTO - slide only if the label area is bigger than - * the text width length - * @li ELM_LABEL_SLIDE_MODE_ALWAYS -slide always - * - * @warning ELM_LABEL_SLIDE_MODE_AUTO, ELM_LABEL_SLIDE_MODE_ALWAYS only work - * with the themes "slide_short", "slide_long" and "slide_bounce". - * @warning ELM_LABEL_SLIDE_MODE_AUTO, ELM_LABEL_SLIDE_MODE_ALWAYS don't work - * if the line wrap(elm_label_line_wrap_set()) or - * ellipsis(elm_label_ellipsis_set()) is set. - * - * @see elm_label_slide_mode_get(). - * @since 1.8 - * - * @ingroup Label - */ -EAPI void elm_label_slide_mode_set(Evas_Object *obj, Elm_Label_Slide_Mode mode); - -/** - * @brief Get the slide mode of the label widget. - * - * @param obj The label object - * @return The slide mode - * - * @see elm_label_slide_mode_set() - * @since 1.8 - * - * @ingroup Label - */ -EAPI Elm_Label_Slide_Mode elm_label_slide_mode_get(const Evas_Object *obj); - -/** - * @brief Start slide effect. - * - * @param obj The label object - * - * @see elm_label_slide_mode_set() - * @since 1.8 - * - * @ingroup Label - */ -EAPI void elm_label_slide_go(Evas_Object *obj); - +#include "elm_label_common.h" +#ifdef EFL_EO_API_SUPPORT +#include "elm_label_eo.h" +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include "elm_label_legacy.h" +#endif /** * @} */ diff --git a/legacy/elementary/src/lib/elm_label_common.h b/legacy/elementary/src/lib/elm_label_common.h new file mode 100644 index 0000000000..199609f018 --- /dev/null +++ b/legacy/elementary/src/lib/elm_label_common.h @@ -0,0 +1,7 @@ +typedef enum +{ + ELM_LABEL_SLIDE_MODE_NONE = 0, /**< no slide effect */ + ELM_LABEL_SLIDE_MODE_AUTO, /**< slide only if the label area is bigger than the text width length */ + ELM_LABEL_SLIDE_MODE_ALWAYS /**< slide always */ +} Elm_Label_Slide_Mode; + diff --git a/legacy/elementary/src/lib/elm_label_eo.h b/legacy/elementary/src/lib/elm_label_eo.h new file mode 100644 index 0000000000..0e2dc3ad16 --- /dev/null +++ b/legacy/elementary/src/lib/elm_label_eo.h @@ -0,0 +1,176 @@ +#define ELM_OBJ_LABEL_CLASS elm_obj_label_class_get() + +const Eo_Class *elm_obj_label_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_LABEL_BASE_ID; + +enum +{ + ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_SET, + ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_GET, + ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_SET, + ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_GET, + ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_SET, + ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_GET, + ELM_OBJ_LABEL_SUB_ID_SLIDE_MODE_SET, + ELM_OBJ_LABEL_SUB_ID_SLIDE_MODE_GET, + ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_SET, + ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_GET, + ELM_OBJ_LABEL_SUB_ID_SLIDE_GO, + ELM_OBJ_LABEL_SUB_ID_LAST +}; + +#define ELM_OBJ_LABEL_ID(sub_id) (ELM_OBJ_LABEL_BASE_ID + sub_id) + + +/** + * @def elm_obj_label_line_wrap_set + * @since 1.8 + * + * @brief Set the wrapping behavior of the label + * + * @param[in] wrap + * + * @see elm_label_line_wrap_set + * + * @ingroup Label + */ +#define elm_obj_label_line_wrap_set(wrap) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_SET), EO_TYPECHECK(Elm_Wrap_Type, wrap) + +/** + * @def elm_obj_label_line_wrap_get + * @since 1.8 + * + * @brief Get the wrapping behavior of the label + * + * @param[out] ret + * + * @see elm_label_line_wrap_get + * + * @ingroup Label + */ +#define elm_obj_label_line_wrap_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_GET), EO_TYPECHECK(Elm_Wrap_Type *, ret) + +/** + * @def elm_obj_label_wrap_width_set + * @since 1.8 + * + * @brief Set wrap width of the label + * + * @param[in] w + * + * @see elm_label_wrap_width_set + * + * @ingroup Label + */ +#define elm_obj_label_wrap_width_set(w) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_SET), EO_TYPECHECK(Evas_Coord, w) + +/** + * @def elm_obj_label_wrap_width_get + * @since 1.8 + * + * @brief Get wrap width of the label + * + * @param[out] ret + * + * @see elm_label_wrap_width_get + * + * @ingroup Label + */ +#define elm_obj_label_wrap_width_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_GET), EO_TYPECHECK(Evas_Coord *, ret) + +/** + * @def elm_obj_label_ellipsis_set + * @since 1.8 + * + * @brief Set the ellipsis behavior of the label + * + * @param[in] ellipsis + * + * @see elm_label_ellipsis_set + * + * @ingroup Label + */ +#define elm_obj_label_ellipsis_set(ellipsis) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_SET), EO_TYPECHECK(Eina_Bool, ellipsis) + +/** + * @def elm_obj_label_ellipsis_get + * @since 1.8 + * + * @brief Get the ellipsis behavior of the label + * + * @param[out] ret + * + * @see elm_label_ellipsis_get + * + * @ingroup Label + */ +#define elm_obj_label_ellipsis_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_label_slide_mode_set + * @since 1.8 + * + * @brief Set slide effect mode of label widget. + * + * @param[in] mode + * + * @see elm_label_slide_mode_set + * + * @ingroup Label + */ +#define elm_obj_label_slide_mode_set(mode) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_MODE_SET), EO_TYPECHECK(Elm_Label_Slide_Mode, mode) + +/** + * @def elm_obj_label_slide_mode_get + * @since 1.8 + * + * @brief Get current slide effect mode. + * + * @param[out] ret + * + * @see elm_label_slide_mode_get + * + * @ingroup Label + */ +#define elm_obj_label_slide_mode_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_MODE_GET), EO_TYPECHECK(Elm_Label_Slide_Mode *, ret) + +/** + * @def elm_obj_label_slide_duration_set + * @since 1.8 + * + * @brief Set the slide duration (speed) of the label + * + * @param[in] duration + * + * @see elm_label_slide_duration_set + * + * @ingroup Label + */ +#define elm_obj_label_slide_duration_set(duration) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_SET), EO_TYPECHECK(double, duration) + +/** + * @def elm_obj_label_slide_duration_get + * @since 1.8 + * + * @brief Get the slide duration(speed) of the label + * + * @param[out] ret + * + * @see elm_label_slide_duration_get + * + * @ingroup Label + */ +#define elm_obj_label_slide_duration_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_GET), EO_TYPECHECK(double *, ret) + +/** + * @def elm_obj_label_slide_go + * @since 1.8 + * + * @brief Start slide effect + * + * @see elm_label_slide_mode_set + * + * @ingroup Label + */ +#define elm_obj_label_slide_go() ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_GO) diff --git a/legacy/elementary/src/lib/elm_label_legacy.h b/legacy/elementary/src/lib/elm_label_legacy.h new file mode 100644 index 0000000000..6890a04e56 --- /dev/null +++ b/legacy/elementary/src/lib/elm_label_legacy.h @@ -0,0 +1,175 @@ +/** + * @brief Add a new label to the parent + * + * @param parent The parent object + * @return The new object or NULL if it cannot be created + * + * @ingroup Label + */ +EAPI Evas_Object *elm_label_add(Evas_Object *parent); + +/** + * @brief Slide only if the + * + * @param obj The label object + * @param duration The duration in seconds in moving text from slide begin position + * to slide end position + * + * @ingroup Label + */ +EAPI void elm_label_slide_area_limit_set(Evas_Object *obj, Eina_Bool limit); + +/** + * @brief Set the wrapping behavior of the label + * + * @param obj The label object + * @param wrap To wrap text or not + * + * By default no wrapping is done. Possible values for @p wrap are: + * @li ELM_WRAP_NONE - No wrapping + * @li ELM_WRAP_CHAR - wrap between characters + * @li ELM_WRAP_WORD - wrap between words + * @li ELM_WRAP_MIXED - Word wrap, and if that fails, char wrap + * + * @ingroup Label + */ +EAPI void elm_label_line_wrap_set(Evas_Object *obj, Elm_Wrap_Type wrap); + +/** + * @brief Get the wrapping behavior of the label + * + * @param obj The label object + * @return Wrap type + * + * @see elm_label_line_wrap_set() + * + * @ingroup Label + */ +EAPI Elm_Wrap_Type elm_label_line_wrap_get(const Evas_Object *obj); + +/** + * @brief Set wrap width of the label + * + * @param obj The label object + * @param w The wrap width in pixels at a minimum where words need to wrap + * + * This function sets the maximum width size hint of the label. + * + * @warning This is only relevant if the label is inside a container. + * + * @ingroup Label + */ +EAPI void elm_label_wrap_width_set(Evas_Object *obj, Evas_Coord w); + +/** + * @brief Get wrap width of the label + * + * @param obj The label object + * @return The wrap width in pixels at a minimum where words need to wrap + * + * @see elm_label_wrap_width_set() + * + * @ingroup Label + */ +EAPI Evas_Coord elm_label_wrap_width_get(const Evas_Object *obj); + +/** + * @brief Set the ellipsis behavior of the label + * + * @param obj The label object + * @param ellipsis To ellipsis text or not + * + * If set to true and the text doesn't fit in the label an ellipsis("...") + * will be shown at the end of the widget. + * + * @warning This doesn't work with slide(elm_label_slide_set()) or if the + * chosen wrap method was #ELM_WRAP_WORD. + * + * @ingroup Label + */ +EAPI void elm_label_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis); + +/** + * @brief Get the ellipsis behavior of the label + * + * @param obj The label object + * @return If true, an ellipsis will be shown at the end of the label area. + * + * @see elm_label_ellipsis_set() + * + * @ingroup Label + */ +EAPI Eina_Bool elm_label_ellipsis_get(const Evas_Object *obj); + +/** + * @brief Set the slide mode of the label widget. + * + * @param obj The label object + * @param mode The slide mode + * + * elm_label_slide_mode_set() changes label slide mode. + * By default, slide mode is none. Possible values for @p mode are: + * @li ELM_LABEL_SLIDE_MODE_NONE - no slide effect + * @li ELM_LABEL_SLIDE_MODE_AUTO - slide only if the label area is bigger than + * the text width length + * @li ELM_LABEL_SLIDE_MODE_ALWAYS -slide always + * + * @warning ELM_LABEL_SLIDE_MODE_AUTO, ELM_LABEL_SLIDE_MODE_ALWAYS only work + * with the themes "slide_short", "slide_long" and "slide_bounce". + * @warning ELM_LABEL_SLIDE_MODE_AUTO, ELM_LABEL_SLIDE_MODE_ALWAYS don't work + * if the line wrap(elm_label_line_wrap_set()) or + * ellipsis(elm_label_ellipsis_set()) is set. + * + * @see elm_label_slide_mode_get(). + * @since 1.8 + * + * @ingroup Label + */ +EAPI void elm_label_slide_mode_set(Evas_Object *obj, Elm_Label_Slide_Mode mode); + +/** + * @brief Get the slide mode of the label widget. + * + * @param obj The label object + * @return The slide mode + * + * @see elm_label_slide_mode_set() + * @since 1.8 + * + * @ingroup Label + */ +EAPI Elm_Label_Slide_Mode elm_label_slide_mode_get(const Evas_Object *obj); +/** + * @brief Set the slide duration (speed) of the label + * + * @param obj The label object + * @param duration The duration in seconds in moving text from slide begin position + * to slide end position + * + * @ingroup Label + */ +EAPI void elm_label_slide_duration_set(Evas_Object *obj, double duration); + +/** + * @brief Get the slide duration(speed) of the label + * + * @param obj The label object + * @return The duration time in moving text from slide begin position to slide end position + * + * @see elm_label_slide_duration_set() + * + * @ingroup Label + */ +EAPI double elm_label_slide_duration_get(const Evas_Object *obj); + +/** + * @brief Start slide effect. + * + * @param obj The label object + * + * @see elm_label_slide_mode_set() + * @since 1.8 + * + * @ingroup Label + */ +EAPI void elm_label_slide_go(Evas_Object *obj);