X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller.h;h=5623a117793cf58ea07b7ad6abfa4248e4c5ac34;hp=8857203a4f27205483dbec647d81e79e24c48d9f;hb=35418f7ea9e356d49750cdc0bdff5c31b7d86539;hpb=c6b64a162088c12ef1b69aa40234e6d4dd772763 diff --git a/dali-toolkit/internal/text/text-controller.h b/dali-toolkit/internal/text/text-controller.h index 8857203..5623a11 100644 --- a/dali-toolkit/internal/text/text-controller.h +++ b/dali-toolkit/internal/text/text-controller.h @@ -25,6 +25,7 @@ // EXTERNAL INCLUDES #include +#include #include #include #include @@ -63,19 +64,21 @@ private: */ enum OperationsMask { - NO_OPERATION = 0x0, - CONVERT_TO_UTF32 = 0x1, - GET_SCRIPTS = 0x2, - VALIDATE_FONTS = 0x4, - GET_LINE_BREAKS = 0x8, - GET_WORD_BREAKS = 0x10, - SHAPE_TEXT = 0x20, - GET_GLYPH_METRICS = 0x40, - LAYOUT = 0x80, - REORDER = 0x100, - ALIGNMENT = 0x200, - RENDER = 0x400, - ALL_OPERATIONS = 0xFFF + NO_OPERATION = 0x0000, + CONVERT_TO_UTF32 = 0x0001, + GET_SCRIPTS = 0x0002, + VALIDATE_FONTS = 0x0004, + GET_LINE_BREAKS = 0x0008, + GET_WORD_BREAKS = 0x0010, + SHAPE_TEXT = 0x0020, + GET_GLYPH_METRICS = 0x0040, + LAYOUT = 0x0080, + UPDATE_ACTUAL_SIZE = 0x0100, + UPDATE_POSITIONS = 0x0200, + REORDER = 0x0400, + ALIGNMENT = 0x0800, + RENDER = 0x1000, + ALL_OPERATIONS = 0xFFFF }; public: @@ -101,7 +104,63 @@ public: * * @return A string of UTF-8 characters. */ - void GetText( std::string& text ); + void GetText( std::string& text ) const; + + /** + * @brief Replaces any placeholder text previously set. + * + * @param[in] text A string of UTF-8 characters. + */ + void SetPlaceholderText( const std::string& text ); + + /** + * @brief Retrieve any placeholder text previously set. + * + * @return A string of UTF-8 characters. + */ + void GetPlaceholderText( std::string& text ) const; + + /** + * @brief Set the default font family. + * + * @param[in] defaultFontFamily The default font family. + */ + void SetDefaultFontFamily( const std::string& defaultFontFamily ); + + /** + * @brief Retrieve the default font family. + * + * @return The default font family. + */ + const std::string& GetDefaultFontFamily() const; + + /** + * @brief Set the default font style. + * + * @param[in] defaultFontStyle The default font style. + */ + void SetDefaultFontStyle( const std::string& defaultFontStyle ); + + /** + * @brief Retrieve the default font style. + * + * @return The default font style. + */ + const std::string& GetDefaultFontStyle() const; + + /** + * @brief Set the default point size. + * + * @param[in] defaultFontStyle The default point size. + */ + void SetDefaultPointSize( float pointSize ); + + /** + * @brief Retrieve the default point size. + * + * @return The default point size. + */ + float GetDefaultPointSize() const; /** * @brief Called to enable text input. @@ -121,9 +180,17 @@ public: bool Relayout( const Vector2& size ); /** + * @brief Lays-out the text. * + * GetNaturalSize(), GetHeightForWidth() and Relayout() calls this method. + * + * @param[in] size A the size of a bounding box to layout text within. + * @param[in] operations The layout operations which need to be done. + * @param[out] layoutSize The size of the laid-out text. */ - bool DoRelayout( const Vector2& size, OperationsMask operations ); + bool DoRelayout( const Vector2& size, + OperationsMask operations, + Size& layoutSize ); /** * @copydoc Control::GetNaturalSize() @@ -160,6 +227,13 @@ public: void KeyboardFocusLostEvent(); /** + * @brief Caller by editable UI controls when key events are received. + * + * @param[in] event The key event. + */ + bool KeyEvent( const Dali::KeyEvent& event ); + + /** * @brief Caller by editable UI controls when a tap gesture occurs. * @param[in] tapCount The number of taps. * @param[in] x The x position relative to the top-left of the parent control. @@ -202,6 +276,9 @@ private: struct Impl; Impl* mImpl; + // Avoid allocating this when the user does not specify a font + struct FontDefaults; + // Avoid allocating this for non-editable controls struct TextInput; };