X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Flayouts%2Flayout-engine.h;h=79daa2386349162673a49988497f48c81119807a;hp=093399b523ddd18c2e50aa914b38d8b3b9bf01ca;hb=39fc99671f79f683a834406e24edf485752c600d;hpb=3e17d9f63dedb5d669409301f8d9a3d8c393f979 diff --git a/dali-toolkit/internal/text/layouts/layout-engine.h b/dali-toolkit/internal/text/layouts/layout-engine.h index 093399b..79daa23 100644 --- a/dali-toolkit/internal/text/layouts/layout-engine.h +++ b/dali-toolkit/internal/text/layouts/layout-engine.h @@ -24,12 +24,11 @@ // INTERNAL INCLUDE #include +#include namespace Dali { -struct Vector2; - namespace Toolkit { @@ -51,11 +50,18 @@ public: MULTI_LINE_BOX }; - enum Alignment + enum HorizontalAlignment + { + HORIZONTAL_ALIGN_BEGIN, + HORIZONTAL_ALIGN_CENTER, + HORIZONTAL_ALIGN_END + }; + + enum VerticalAlignment { - ALIGN_BEGIN, - ALIGN_CENTER, - ALIGN_END + VERTICAL_ALIGN_TOP, + VERTICAL_ALIGN_CENTER, + VERTICAL_ALIGN_BOTTOM }; /** @@ -69,6 +75,13 @@ public: ~LayoutEngine(); /** + * @brief Provide the wrapper around FontClient used to get metrics + * + * @param[in] metrics Used to get metrics + */ + void SetMetrics( MetricsPtr& metrics ); + + /** * @brief Choose the required layout. * * @param[in] layout The required layout. @@ -80,21 +93,61 @@ public: * * @return The required layout. */ - unsigned int GetLayout() const; + Layout GetLayout() const; + + /** + * @brief Enable or disable the text ellipsis. + * + * @param[in] enabled Whether to enable the text ellipsis. + */ + void SetTextEllipsisEnabled( bool enabled ); + + /** + * @return Whether the text ellipsis is enabled. + */ + bool GetTextEllipsisEnabled() const; /** - * @brief Choose the required line alignment. + * @brief Choose the required text horizontal alignment. * * @param[in] alignment The required alignment. */ - void SetAlignment( Alignment alignment ); + void SetHorizontalAlignment( HorizontalAlignment alignment ); /** - * @brief Query the required line alignment. + * @brief Query the required text horizontal alignment. * * @return The required alignment. */ - Alignment GetAlignment() const; + HorizontalAlignment GetHorizontalAlignment() const; + + /** + * @brief Choose the required text vertical alignment. + * + * @param[in] alignment The required alignment. + */ + void SetVerticalAlignment( VerticalAlignment alignment ); + + /** + * @brief Query the required text vertical alignment. + * + * @return The required alignment. + */ + VerticalAlignment GetVerticalAlignment() const; + + /** + * @brief Sets the width of the cursor. + * + * @param[in] width The width of the cursor in pixels. + */ + void SetCursorWidth( int width ); + + /** + * @brief Retrieves the width of the cursor. + * + * @return The width of the cursor in pixels. + */ + int GetCursorWidth() const; /** * @brief Store the visual position of glyphs in the VisualModel. @@ -102,14 +155,14 @@ public: * @param[in] layoutParameters The parameters needed to layout the text. * @param[out] glyphPositions The positions of all the glyphs. * @param[out] lines The laid-out lines. - * @param[out] actualSize The size of the text after it has been laid-out. + * @param[out] layoutSize The size of the text after it has been laid-out. * * @return \e true if the text has been re-laid-out. \e false means the given width is too small to layout even a single character. */ bool LayoutText( const LayoutParameters& layoutParameters, Vector& glyphPositions, Vector& lines, - Size& actualSize ); + Size& layoutSize ); /** * @brief Re-lays out those lines with right to left characters. @@ -117,21 +170,41 @@ public: * It doesn't change the phisical position of the glyphs in the model but sets their new position. * * @param[in] layoutParameters The parameters needed to layout the text. + * @param[in] startIndex Character index of the line from where the lines are reordered. + * @param[in] numberOfCharacters The number of characters. * @param[in,out] glyphPositions The positions of all the glyphs. */ void ReLayoutRightToLeftLines( const LayoutParameters& layoutParameters, + CharacterIndex startIndex, + Length numberOfCharacters, Vector& glyphPositions ); /** * @brief Aligns the laid out lines. * - * @param[in] layoutParameters The parameters needed to layout the text. - * @param[in] lines The laid-out lines. - * @param[in,out] glyphPositions The positions of all the glyphs. + * @param[in] size The size of the container where the text is laid-out. + * @param[in] startIndex Character index of the line from where the lines are aligned. + * @param[in] numberOfCharacters The number of characters. + * @param[in,out] lines The laid-out lines. + */ + void Align( const Size& size, + CharacterIndex startIndex, + Length numberOfCharacters, + Vector& lines ); + + /** + * @brief Sets the default line spacing. + * + * @param[in] lineSpacing The line spacing. + */ + void SetDefaultLineSpacing( float lineSpacing ); + + /** + * @brief Retrieves the default line spacing. + * + * @return The line spacing. */ - void Align( const LayoutParameters& layoutParameters, - const Vector& lines, - Vector& glyphPositions ); + float GetDefaultLineSpacing() const; private: