Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / text / bidirectional-support.h
index 5cb557e..e45fc06 100644 (file)
@@ -19,7 +19,9 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/text/text-definitions.h>
+#include <dali/public-api/common/dali-vector.h>
+#include <dali-toolkit/public-api/text/bidirectional-line-info-run.h>
+#include <dali-toolkit/public-api/text/bidirectional-paragraph-info-run.h>
 
 namespace Dali
 {
@@ -36,14 +38,32 @@ class VisualModel;
 /**
  * Sets the bidirectional info into the logical model.
  *
- * Any bidirectional info previously set is removed.
+ * @param[in] text Vector of UTF-32 characters.
+ * @param[in] lineBreakInfo The line break info.
+ * @param[out] bidirectionalInfo Vector with the bidirectional infor for each paragraph.
+ */
+void SetBidirectionalInfo( const Vector<Character>& text,
+                           const Vector<LineBreakInfo>& lineBreakInfo,
+                           Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo );
+
+/**
+ * Replaces the bidirectional info from the logical model.
  *
  * @pre The @p model needs to have a text set.
  * @pre The @p model needs to have the line break info set.
  *
+ * If the @p numberOfCharactersToRemove is zero, this operation is like an insert.
+ * If the @p numberOfCharactersToInsert is zero, this operation is like a remove.
+ *
  * @param[in,out] model The text's logical model.
+ * @param[in] characterIndex Index to the first character.
+ * @param[in] numberOfCharactersToRemove The number of characters removed from the text.
+ * @param[in] numberOfCharactersToInsert The number of characters inserted in the text.
  */
-void SetBidirectionalInfo( LogicalModel& model );
+void ReplaceBidirectionalInfo( LogicalModel& model,
+                               CharacterIndex characterIndex,
+                               Length numberOfCharactersToRemove,
+                               Length numberOfCharactersToInsert );
 
 /**
  * Sets the visual to logical and logical to visual map tables.
@@ -51,14 +71,38 @@ void SetBidirectionalInfo( LogicalModel& model );
  * Any map tables previously set are removed.
  *
  * @pre The @p logicalModel needs to have a text set.
+ * @pre The @p logicalModel needs to have the bidirectional info indices for each paragraph set.
+ * @pre The @p visualModel needs to have the laid-out lines info set.
+ *
+ * @param[in] bidirectionalInfo Vector with the bidirectional infor for each paragraph.
+ * @param[in] lineRuns The line runs converted to characters.
+ * @param[out] lineInfoRuns line runs with the visual to logical and logical to visual conversion maps.
+ */
+void ReorderLines( const Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo,
+                   const Vector<CharacterRun>& lineRuns,
+                   Vector<BidirectionalLineInfoRun>& lineInfoRuns );
+
+/**
+ * Replaces the visual to logical and logical to visual map tables.
+ *
+ * @pre The @p logicalModel needs to have a text set.
  * @pre The @p logicalModel needs to have the line break info set.
  * @pre The @p visualModel needs to have the laid-out lines info set.
  *
+ * If the @p numberOfCharactersToRemove is zero, this operation is like an insert.
+ * If the @p numberOfCharactersToInsert is zero, this operation is like a remove.
+ *
  * @param[in,out] logicalModel The text's logical model.
  * @param[in] visualModel The text's visual model.
+ * @param[in] characterIndex Index to the first character.
+ * @param[in] numberOfCharactersToRemove The number of characters removed from the text.
+ * @param[in] numberOfCharactersToInsert The number of characters inserted in the text.
  */
 void ReorderLines( LogicalModel& logicalModel,
-                   const VisualModel& visualModel );
+                   const VisualModel& visualModel,
+                   CharacterIndex characterIndex,
+                   Length numberOfCharactersToRemove,
+                   Length numberOfCharactersToInsert );
 
 } // namespace Text