edje: Edje_Edit - edje_edit_state_text_repch_xet()

Summary:
There are new 'get and set' API for block 'text.repch'.
Those functions return or set replacement character for a given text part.
This string is used to replace every character to hide the details of the entry.
Normally you would use a "*", but you can use anything you like.
@feature

Reviewers: seoz, Hermet, cedric, raster

CC: reutskiy.v.v, cedric

Differential Revision: https://phab.enlightenment.org/D1001

Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
This commit is contained in:
Igor Gala 2014-06-12 02:15:21 +02:00 committed by Cedric BAIL
parent 9c79b7f0f8
commit 6f7233b473
2 changed files with 63 additions and 3 deletions

View File

@ -3170,13 +3170,40 @@ edje_edit_state_text_class_get(Evas_Object *obj, const char *part, const char *s
* @param part Part that contain state.
* @param state The name of the state to set text class (not including the state value).
* @param value The state value.
* @param color_class The text class to assign.
* @param text_class The text class to assign.
*
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
*/
EAPI Eina_Bool
edje_edit_state_text_class_set(Evas_Object *obj, const char *part, const char *state, double value, const char *text_class);
/** Get the replacement character string of the given part state.
*
* @param obj Object being edited.
* @param part Part that contain state.
* @param state The name of the state to get replacement character
* (not including the state value).
* @param value The state value.
*
* @return The current replacement character.
*/
EAPI const char *
edje_edit_state_text_repch_get(Evas_Object *obj, const char *part, const char *state, double value);
/** Set the replacement character string of the given part state.
*
* @param obj Object being edited.
* @param part Part that contain state.
* @param state The name of the state to get replacement character
* (not including the state value).
* @param value The state value.
* @param repch The replacement character string to assign.
*
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
*/
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 list of all the fonts in the given edje.
*
* Use edje_edit_string_list_free() when you don't need the list anymore.
@ -3185,8 +3212,6 @@ edje_edit_state_text_class_set(Evas_Object *obj, const char *part, const char *s
*
* @return A list containing all the fonts names found in the edje file.
*/
EAPI Eina_List * edje_edit_fonts_list_get(Evas_Object *obj);
/** Add a new font to the edje file.

View File

@ -5577,6 +5577,41 @@ edje_edit_state_text_class_set(Evas_Object *obj, const char *part, const char *s
return EINA_TRUE;
}
EAPI const char *
edje_edit_state_text_repch_get(Evas_Object *obj, const char *part, const char *state, double value)
{
Edje_Part_Description_Text *txt;
GET_PD_OR_RETURN(NULL);
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
(rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
return NULL;
txt = (Edje_Part_Description_Text*) pd;
return eina_stringshare_add(edje_string_get(&txt->text.repch));
}
EAPI Eina_Bool
edje_edit_state_text_repch_set(Evas_Object *obj, const char *part, const char *state, double value, const char *repch)
{
Edje_Part_Description_Text *txt;
if (!repch) return EINA_FALSE;
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;
_edje_if_string_free(ed, txt->text.repch.str);
txt->text.repch.str = eina_stringshare_add(repch);
txt->text.repch.id = 0;
edje_object_calc_force(obj);
return EINA_TRUE;
}
/****************/
/* IMAGES API */
/****************/