Reviewed elm_label's API and documentation

SVN revision: 68024
This commit is contained in:
WooHyun Jung 2012-02-16 11:39:07 +00:00
parent fb2e56a254
commit 98694d15ec
4 changed files with 85 additions and 61 deletions

View File

@ -211,7 +211,7 @@ EAPI extern Elm_Version *elm_version;
#include <elm_hover.h> // OK
#include <elm_image.h> // OK
#include <elm_index.h> // OK
#include <elm_label.h>
#include <elm_label.h> // OK
#include <elm_layout.h>
#include <elm_macros.h>
#include <elm_mapbuf.h>

View File

@ -4739,6 +4739,59 @@ EINA_DEPRECATED EAPI void elm_pager_item_style_default_set(Evas_Obje
*/
EINA_DEPRECATED EAPI const char *elm_pager_item_style_default_get(const Evas_Object *obj);
/**
* @brief Set the font size on the label object.
*
* @param obj The label object
* @param size font size
*
* @warning NEVER use this. It is for hyper-special cases only. use styles
* instead. e.g. "default", "marker", "slide_long" etc.
* @deprecated Use tag instead
*/
EAPI void elm_label_fontsize_set(Evas_Object *obj, int fontsize);
/**
* @brief Set the text color on the label object
*
* @param obj The label object
* @param r Red property background color of The label object
* @param g Green property background color of The label object
* @param b Blue property background color of The label object
* @param a Alpha property background color of The label object
*
* @warning NEVER use this. It is for hyper-special cases only. use styles
* instead. e.g. "default", "marker", "slide_long" etc.
* @deprecated Use tag instead
*/
EAPI void elm_label_text_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a);
/**
* @brief Set the text align on the label object
*
* @param obj The label object
* @param align align mode ("left", "center", "right")
*
* @warning NEVER use this. It is for hyper-special cases only. use styles
* instead. e.g. "default", "marker", "slide_long" etc.
* @deprecated Use tag instead
*/
EAPI void elm_label_text_align_set(Evas_Object *obj, const char *alignmode);
/**
* @brief Set background color of the label
*
* @param obj The label object
* @param r Red property background color of The label object
* @param g Green property background color of The label object
* @param b Blue property background color of The label object
* @param a Alpha property background alpha of The label object
*
* @warning NEVER use this. It is for hyper-special cases only. use styles
* instead. e.g. "default", "marker", "slide_long" etc.
* @deprecated Just make colored background by yourself.
*/
EAPI void elm_label_background_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a);
/**
* @}

View File

@ -773,6 +773,15 @@ elm_label_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis)
}
EAPI Eina_Bool
elm_label_ellipsis_get(const Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return EINA_FALSE;
return wd->ellipsis;
}
EAPI void
elm_label_slide_set(Evas_Object *obj,
Eina_Bool slide)
@ -789,7 +798,7 @@ elm_label_slide_set(Evas_Object *obj,
}
EAPI Eina_Bool
elm_label_slide_get(Evas_Object *obj)
elm_label_slide_get(const Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
Widget_Data *wd = elm_widget_data_get(obj);
@ -812,7 +821,7 @@ elm_label_slide_duration_set(Evas_Object *obj, double duration)
}
EAPI double
elm_label_slide_duration_get(Evas_Object *obj)
elm_label_slide_duration_get(const Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype) 0.0;
Widget_Data *wd = elm_widget_data_get(obj);

View File

@ -10,7 +10,7 @@
* text doesn't fit the geometry of the label it will be ellipsized or be
* cut. Elementary provides several styles for this widget:
* @li default - No animation
* @li marker - Centers the text in the label and make it bold by default
* @li marker - Centers the text in the label and makes it bold by default
* @li slide_long - The entire text appears from the right of the screen and
* slides until it disappears in the left of the screen(reappearing on the
* right again).
@ -95,6 +95,7 @@ EAPI Evas_Coord elm_label_wrap_width_get(const Evas_Object *obj
*
* @warning This is only relevant if the label is inside a container.
*/
//XXX: Maybe added for supporting multi-line ellpisis. Evas textlock supports multi-line ellipsis by itself, no more needs for this API.
EAPI void elm_label_wrap_height_set(Evas_Object *obj, Evas_Coord h);
/**
@ -103,58 +104,9 @@ EAPI void elm_label_wrap_height_set(Evas_Object *obj, Eva
* @param obj The label object
* @return The wrap height in pixels at a minimum where words need to wrap
*/
//XXX: Maybe added for supporting multi-line ellpisis. Evas textlock supports multi-line ellipsis by itself, no more needs for this API.
EAPI Evas_Coord elm_label_wrap_height_get(const Evas_Object *obj);
/**
* @brief Set the font size on the label object.
*
* @param obj The label object
* @param size font size
*
* @warning NEVER use this. It is for hyper-special cases only. use styles
* instead. e.g. "default", "marker", "slide_long" etc.
*/
EAPI void elm_label_fontsize_set(Evas_Object *obj, int fontsize);
/**
* @brief Set the text color on the label object
*
* @param obj The label object
* @param r Red property background color of The label object
* @param g Green property background color of The label object
* @param b Blue property background color of The label object
* @param a Alpha property background color of The label object
*
* @warning NEVER use this. It is for hyper-special cases only. use styles
* instead. e.g. "default", "marker", "slide_long" etc.
*/
EAPI void elm_label_text_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a);
/**
* @brief Set the text align on the label object
*
* @param obj The label object
* @param align align mode ("left", "center", "right")
*
* @warning NEVER use this. It is for hyper-special cases only. use styles
* instead. e.g. "default", "marker", "slide_long" etc.
*/
EAPI void elm_label_text_align_set(Evas_Object *obj, const char *alignmode);
/**
* @brief Set background color of the label
*
* @param obj The label object
* @param r Red property background color of The label object
* @param g Green property background color of The label object
* @param b Blue property background color of The label object
* @param a Alpha property background alpha of The label object
*
* @warning NEVER use this. It is for hyper-special cases only. use styles
* instead. e.g. "default", "marker", "slide_long" etc.
*/
EAPI void elm_label_background_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a);
/**
* @brief Set the ellipsis behavior of the label
*
@ -170,10 +122,20 @@ EAPI void elm_label_background_color_set(Evas_Object *obj
EAPI void elm_label_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis);
/**
* @brief Set the text slide of the label
* @brief Get the ellipsis behavior of the label
*
* @param obj The label object
* @param slide To start slide or stop
* @return If true, an ellipsis will be shown at the end of the label area.
*
* @see elm_label_ellipsis_set()
*/
EAPI Eina_Bool elm_label_ellipsis_get(const Evas_Object *obj);
/**
* @brief Set sliding effect of label widget.
*
* @param obj The label object
* @param slide If true, sliding effect will be shown
*
* If set to true, the text of the label will slide/scroll through the length of
* label.
@ -184,20 +146,20 @@ EAPI void elm_label_ellipsis_set(Evas_Object *obj, Eina_B
EAPI void elm_label_slide_set(Evas_Object *obj, Eina_Bool slide);
/**
* @brief Get the text slide mode of the label
* @brief Get whether sliding effect is shown or not.
*
* @param obj The label object
* @return slide slide mode value
* @return If true, sliding effect is shown.
*
* @see elm_label_slide_set()
*/
EAPI Eina_Bool elm_label_slide_get(Evas_Object *obj);
EAPI Eina_Bool elm_label_slide_get(const Evas_Object *obj);
/**
* @brief Set the slide duration(speed) of the label
*
* @param obj The label object
* @return The duration in seconds in moving text from slide begin position
* @param duration The duration in seconds in moving text from slide begin position
* to slide end position
*/
EAPI void elm_label_slide_duration_set(Evas_Object *obj, double duration);
@ -210,7 +172,7 @@ EAPI void elm_label_slide_duration_set(Evas_Object *obj,
*
* @see elm_label_slide_duration_set()
*/
EAPI double elm_label_slide_duration_get(Evas_Object *obj);
EAPI double elm_label_slide_duration_get(const Evas_Object *obj);
/**
* @}