Fixed GetHeightForWidth for text label
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / text / segmentation.h
index 85198c5..1c0c489 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // INTERNAL INCLUDES
+#include <dali/public-api/common/dali-vector.h>
 #include <dali-toolkit/public-api/text/text-definitions.h>
 
 namespace Dali
@@ -35,24 +36,65 @@ class LogicalModel;
 /**
  * Sets line break info.
  *
- * Any line break info previously set is removed.
+ * Possible values for LineBreakInfo are:
+ *
+ *  - 0 is a LINE_MUST_BREAK.  Text must be broken into a new line.
+ *  - 1 is a LINE_ALLOW_BREAK. Is possible to break the text into a new line.
+ *  - 2 is a LINE_NO_BREAK.    Text can't be broken into a new line.
+ *
+ * @param[in] text Vector of UTF-32 characters.
+ * @param[out] lineBreakInfo The line break info
+ */
+void SetLineBreakInfo( const Vector<Character>& text,
+                       Vector<LineBreakInfo>& lineBreakInfo );
+
+/**
+ * Replaces line break info.
  *
  * @pre The @p model needs to have a text 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 SetLineBreakInfo( LogicalModel& model );
+void ReplaceLineBreakInfo( LogicalModel& model,
+                           CharacterIndex characterIndex,
+                           Length numberOfCharactersToRemove,
+                           Length numberOfCharactersToInsert );
 
 /**
  * Sets word break info.
  *
- * Any word break info previously set is removed.
+ * - 0 is a WORD_BREAK.    Text can be broken into a new word.
+ * - 1 is a WORD_NO_BREAK. Text can't be broken into a new word.
+ *
+ * @param[in] text Vector of UTF-32 characters.
+ * @param[out] wordBreakInfo The word break info.
+ */
+void SetWordBreakInfo( const Vector<Character>& text,
+                       Vector<WordBreakInfo>& wordBreakInfo );
+
+/**
+ * Replaces word break info.
  *
  * @pre The @p model needs to have a text 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 SetWordBreakInfo( LogicalModel& model );
+void ReplaceWordBreakInfo( LogicalModel& model,
+                           CharacterIndex characterIndex,
+                           Length numberOfCharactersToRemove,
+                           Length numberOfCharactersToInsert );
 
 } // namespace Text