X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Flayouts%2Flayout-engine.h;h=f866f3e0286f490a9ec356cf2c6ac2f6970c32dc;hb=4469fbe38e5ce460187346003a013552a9d393a5;hp=febf48549f9c97f060e7d856d4e2aba30bf5e54e;hpb=451d7a012c895c2578a29ba929dc61a6d959209a;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/layouts/layout-engine.h b/dali-toolkit/internal/text/layouts/layout-engine.h index febf485..f866f3e 100644 --- a/dali-toolkit/internal/text/layouts/layout-engine.h +++ b/dali-toolkit/internal/text/layouts/layout-engine.h @@ -18,18 +18,17 @@ * */ -// INTERNAL INCLUDE -#include - // EXTERNAL INCLUDE #include #include +// INTERNAL INCLUDE +#include +#include + namespace Dali { -struct Vector2; - namespace Toolkit { @@ -51,6 +50,20 @@ public: MULTI_LINE_BOX }; + enum HorizontalAlignment + { + HORIZONTAL_ALIGN_BEGIN, + HORIZONTAL_ALIGN_CENTER, + HORIZONTAL_ALIGN_END + }; + + enum VerticalAlignment + { + VERTICAL_ALIGN_TOP, + VERTICAL_ALIGN_CENTER, + VERTICAL_ALIGN_BOTTOM + }; + /** * @brief Create a new instance of a LayoutEngine. */ @@ -62,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. @@ -76,18 +96,94 @@ public: unsigned int 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 text horizontal alignment. + * + * @param[in] alignment The required alignment. + */ + void SetHorizontalAlignment( HorizontalAlignment alignment ); + + /** + * @brief Query the required text horizontal alignment. + * + * @return The required alignment. + */ + 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. * * @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. * * @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 ); + /** + * @brief Re-lays out those lines with right to left characters. + * + * 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,out] glyphPositions The positions of all the glyphs. + */ + void ReLayoutRightToLeftLines( const LayoutParameters& layoutParameters, + Vector& glyphPositions ); + + /** + * @brief Aligns the laid out lines. + * + * @param[in] layoutSize The size of the laid out the text. + * @param[in,out] lines The laid-out lines. + */ + void Align( const Size& layoutSize, + Vector& lines ); + private: // Undefined