X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fmarkup-processor-helper-functions.h;h=62be6c858c2f351db985d011b607a46dec9d1e92;hb=c5651d9850075a3d2d96444883ee8e23844a5f3e;hp=cf494d22297816a2f45d68bd20649740a4a43b6c;hpb=69669144df0027a66725f167fd1b99e12b8860ad;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/markup-processor-helper-functions.h b/dali-toolkit/internal/text/markup-processor-helper-functions.h index cf494d2..62be6c8 100644 --- a/dali-toolkit/internal/text/markup-processor-helper-functions.h +++ b/dali-toolkit/internal/text/markup-processor-helper-functions.h @@ -28,6 +28,8 @@ namespace Dali { +struct Vector4; + namespace Toolkit { @@ -82,6 +84,44 @@ bool TokenComparison( const std::string& string1, const char* const stringBuffer void SkipWhiteSpace( const char*& markupStringBuffer, const char* const markupStringEndBuffer ); +/** + * @brief Converts a string into an hexadecimal unsigned int. + * + * @param[in] uintStr An hexadecimal unsigned int packed inside a string. + * + * @return The hexadecimal value. + */ +unsigned int StringToHex( const char* const uintStr ); + +/** + * @brief Converts a string into a float value. + * + * @param[in] floatStr A float packed inside a string. + * + * @return The float value. + */ +float StringToFloat( const char* const floatStr ); + +/** + * @brief Converts an ARGB color packed in 4 byte unsigned int into a Vector4 color used in Dali. + * + * @param[in] color An ARGB color packed in an unsigned int. + * @param[out] retColor A Vector4 with the converted color. + */ +void UintColorToVector4( unsigned int color, Vector4& retColor ); + +/** + * @brief Converts a color packed inside a string into an ARGB Vector4 color. + * + * The string color could be in hexadecimal ( 0xFF0000FF ), webcolor ( #0000FF or #00F ) or some constant values: + * black, white, red, green, blue, yellow, magenta, cyan, transparent. + * + * @param[in] colorStr A color packed inside a string. + * @param[in] length The length of the color string. + * @param[out] retColor A color packed inside a Vector4. + */ +void ColorStringToVector4( const char* const colorStr, Length length, Vector4& retColor ); + } // namespace Text } // namespace Toolkit