Merge "Stop setting crazy Z value with controls (at the moment depth is ignored by...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / bidirectional-support.h
index 227133e..f659a9c 100644 (file)
@@ -36,9 +36,6 @@ namespace Toolkit
 namespace Text
 {
 
-class LogicalModel;
-class VisualModel;
-
 /**
  * Sets the bidirectional info into the logical model.
  *
@@ -53,73 +50,48 @@ void SetBidirectionalInfo( const Vector<Character>& text,
                            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 ReplaceBidirectionalInfo( LogicalModel& model,
-                               CharacterIndex characterIndex,
-                               Length numberOfCharactersToRemove,
-                               Length numberOfCharactersToInsert );
-
-/**
- * Sets the visual to logical and logical to visual map tables.
+ * Sets the visual to logical map tables.
  *
  * Any map tables previously set are removed.
+ * It sets the paragraph's direction to each line.
  *
  * @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.
+ * @param[in,out] lineRuns The line runs converted to characters.
+ * @param[out] lineInfoRuns line runs with the visual to logical conversion maps.
  */
 void ReorderLines( const Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo,
-                   const Vector<LineRun>& lineRuns,
+                   Vector<LineRun>& 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.
+ * @brief Replaces any character in the right to left paragraphs which could be mirrored.
  *
- * 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] text The text.
+ * @param[in] mirroredText The mirroredText.
+ * @param[in] bidirectionalInfo Vector with the bidirectional infor for each paragraph.
  *
- * @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.
+ * @return @e true if a character has been replaced.
  */
-void ReorderLines( LogicalModel& logicalModel,
-                   const VisualModel& visualModel,
-                   CharacterIndex characterIndex,
-                   Length numberOfCharactersToRemove,
-                   Length numberOfCharactersToInsert );
+bool GetMirroredText( const Vector<Character>& text,
+                      Vector<Character>& mirroredText,
+                      const Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo );
 
 /**
- * @brief Replaces any character which could be mirrored.
+ * @brief Retrieves the character's directions.
  *
- * @param[in] text The text.
- * @param[in] mirroredText The mirroredText.
+ * @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.
  *
- * @return @e true if a character has been replaced.
+ * @param[in] bidirectionalInfo Vector with the bidirectional infor for each paragraph.
+ * @param[out] directions The direction, @e false is left to right and @e true is right to left, of each character of the paragraph.
  */
-bool GetMirroredText( const Vector<Character>& text,
-                      Vector<Character>& mirroredText );
+void GetCharactersDirection( const Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo,
+                             Vector<CharacterDirection>& directions );
+
 } // namespace Text
 
 } // namespace Toolkit