diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h index cd35600178..0c22157bb1 100644 --- a/src/lib/edje/Edje_Edit.h +++ b/src/lib/edje/Edje_Edit.h @@ -3130,6 +3130,7 @@ edje_edit_state_text_text_source_set(Evas_Object *obj, const char *part, const c * @param obj Object being edited. * @param part Part that contain state. * @param state The name of the state to set the the maximum vertical size of + * @param value Value of the state. * the container to be equal (not including the state value). * * @return The name of part or NULL, if text_source param not a setted. @@ -3145,6 +3146,7 @@ edje_edit_state_text_source_get(Evas_Object *obj, const char *part, const char * * @param part Part that contain state. * @param state The name of the state to set the the maximum vertical size of * the container to be equal (not including the state value). + * @param value Value of the state. * @param source The text source part name. * * @return EINA_TRUE if successful, EINA_FALSE - otherwise. @@ -3204,6 +3206,34 @@ edje_edit_state_text_repch_get(Evas_Object *obj, const char *part, const char *s EAPI Eina_Bool edje_edit_state_text_repch_set(Evas_Object *obj, const char *part, const char *state, double value, const char *repch); +/** Get the min and max font size allowed for the text part. + * + * @param obj Object being edited. + * @param part Part that contain state. + * @param state State in which the part is set. + * @param value Value of the state. + * @param min Minimal value of the font size in points (pt). + * @param max Maximum value of the font size in points (pt). + * + * @return EINA_TRUE if successful, EINA_FALSE - otherwise. + */ +EAPI Eina_Bool +edje_edit_state_text_size_range_min_max_get(Evas_Object *obj, const char *part, const char *state, double value, int *min, int *max); + +/** Set the min and max font size allowed for the text part. + * + * @param obj Object being edited. + * @param part Part that contain state. + * @param state State in which the part is set. + * @param value Value of the state. + * @param min Minimal value of the font size in points (pt). + * @param max Maximum value of the font size in points (pt). + * + * @return EINA_TRUE if successful, EINA_FALSE - otherwise. + */ +EAPI Eina_Bool +edje_edit_state_text_size_range_min_max_set(Evas_Object *obj, const char *part, const char *state, double value, int min, int max); + /** Get the list of all the fonts in the given edje. * * Use edje_edit_string_list_free() when you don't need the list anymore. diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 3f6ad76956..49e10454f6 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -5612,6 +5612,39 @@ edje_edit_state_text_repch_set(Evas_Object *obj, const char *part, const char *s return EINA_TRUE; } +EAPI Eina_Bool +edje_edit_state_text_size_range_min_max_get(Evas_Object *obj, const char *part, const char *state, double value, int *min, int *max) +{ + Edje_Part_Description_Text *txt; + GET_PD_OR_RETURN(EINA_FALSE); + if ((rp->part->type != EDJE_PART_TYPE_TEXT) && + (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) + return EINA_FALSE; + + txt = (Edje_Part_Description_Text *) pd; + if (min) *min = txt->text.size_range_min; + if (max) *max = txt->text.size_range_max; + + return EINA_TRUE; +} + +EAPI Eina_Bool +edje_edit_state_text_size_range_min_max_set(Evas_Object *obj, const char *part, const char *state, double value, int min, int max) +{ + Edje_Part_Description_Text *txt; + GET_PD_OR_RETURN(EINA_FALSE); + if ((rp->part->type != EDJE_PART_TYPE_TEXT) && + (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) + return EINA_FALSE; + + txt = (Edje_Part_Description_Text *) pd; + txt->text.size_range_min = min; + txt->text.size_range_max = max; + + edje_object_calc_force(obj); + return EINA_TRUE; +} + /****************/ /* IMAGES API */ /****************/