There is a problem that ellipsis does not work properly when MIN_LINE_SIZE is set.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / layouts / layout-engine.h
old mode 100644 (file)
new mode 100755 (executable)
index 0d1f7d4..5641c47
 // EXTERNAL INCLUDE
 #include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/math/vector2.h>
+#include <dali/public-api/actors/actor-enumerations.h>
 
 // INTERNAL INCLUDE
-#include <dali-toolkit/internal/text/layouts/layout-alignment.h>
+#include <dali-toolkit/public-api/text/text-enumerations.h>
 #include <dali-toolkit/internal/text/line-run.h>
 #include <dali-toolkit/internal/text/metrics.h>
 
@@ -102,34 +103,19 @@ public:
   /**
    * @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.
+   * Builds the bidirectional info and reorders RTL lines.
+   *
+   * @param[in,out] layoutParameters The parameters needed to layout the text.
    * @param[out] layoutSize The size of the text after it has been laid-out.
    * @param[in] elideTextEnabled Whether the text elide is enabled.
+   * @param[in,out] isAutoScrollEnabled If the isAutoScrollEnabled is true and the height of the text exceeds the boundaries of the control the text is elided and the isAutoScrollEnabled is set to false to disable the autoscroll
    *
    * @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 Parameters& layoutParameters,
-                   Vector<Vector2>& glyphPositions,
-                   Vector<LineRun>& lines,
+  bool LayoutText( Parameters& layoutParameters,
                    Size& layoutSize,
-                   bool elideTextEnabled );
-
-  /**
-   * @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] 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 Parameters& layoutParameters,
-                                 CharacterIndex startIndex,
-                                 Length numberOfCharacters,
-                                 Vector<Vector2>& glyphPositions );
+                   bool elideTextEnabled,
+                   bool& isAutoScrollEnabled );
 
   /**
    * @brief Aligns the laid out lines.
@@ -140,13 +126,17 @@ public:
    * @param[in] horizontalAlignment The horizontal alignment.
    * @param[in,out] lines The laid-out lines.
    * @param[out] alignmentOffset The alignment offset.
+   * @param[in] layoutDirection The direction of the system language.
+   * @param[in] matchSystemLanguageDirection Whether match align for system language direction or not.
    */
   void Align( const Size& size,
               CharacterIndex startIndex,
               Length numberOfCharacters,
-              Layout::HorizontalAlignment horizontalAlignment,
+              Text::HorizontalAlignment::Type horizontalAlignment,
               Vector<LineRun>& lines,
-              float& alignmentOffset );
+              float& alignmentOffset,
+              Dali::LayoutDirection::Type layoutDirection,
+              bool matchSystemLanguageDirection );
 
   /**
    * @brief Sets the default line spacing.
@@ -162,6 +152,20 @@ public:
    */
   float GetDefaultLineSpacing() const;
 
+  /**
+   * @brief Sets the default line size.
+   *
+   * @param[in] lineSize The line size.
+   */
+  void SetDefaultLineSize( float lineSize );
+
+  /**
+   * @brief Retrieves the default line size.
+   *
+   * @return The line size.
+   */
+  float GetDefaultLineSize() const;
+
 private:
 
   // Undefined