*
*/
-// INTERNAL INCLUDE
-#include <dali-toolkit/internal/text/text-definitions.h>
-
// EXTERNAL INCLUDE
#include <dali/public-api/common/dali-vector.h>
#include <dali/public-api/math/vector2.h>
+// INTERNAL INCLUDE
+#include <dali-toolkit/internal/text/line-run.h>
+
namespace Dali
{
MULTI_LINE_BOX
};
+ enum Alignment
+ {
+ ALIGN_BEGIN,
+ ALIGN_CENTER,
+ ALIGN_END
+ };
+
/**
* @brief Create a new instance of a LayoutEngine.
*/
unsigned int GetLayout() const;
/**
+ * @brief Choose the required line alignment.
+ *
+ * @param[in] alignment The required alignment.
+ */
+ void SetAlignment( Alignment alignment );
+
+ /**
+ * @brief Query the required line alignment.
+ *
+ * @return The required alignment.
+ */
+ Alignment GetAlignment() 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<Vector2>& glyphPositions,
+ Vector<LineRun>& 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<Vector2>& glyphPositions );
+
+ /**
+ * @brief Aligns the laid out lines.
+ *
+ * @param[in] layoutParameters The parameters needed to layout the text.
+ * @param[in] layoutSize The size of the laid out the text.
+ * @param[in] lines The laid-out lines.
+ * @param[in,out] glyphPositions The positions of all the glyphs.
+ */
+ void Align( const LayoutParameters& layoutParameters,
+ const Size& layoutSize,
+ const Vector<LineRun>& lines,
+ Vector<Vector2>& glyphPositions );
+
private:
// Undefined