[dali_1.0.9] Merge branch 'tizen' 60/27760/1
authorKingsley Stephens <k.stephens@partner.samsung.com>
Thu, 18 Sep 2014 14:08:04 +0000 (15:08 +0100)
committerKingsley Stephens <k.stephens@partner.samsung.com>
Thu, 18 Sep 2014 14:08:09 +0000 (15:08 +0100)
Change-Id: Ifb019788135561ef1448b6ee4ebd89e1cd2bdc47

43 files changed:
automated-tests/coverage.sh
automated-tests/src/dali-toolkit-internal/utc-Dali-TextView-HelperAndDebug.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-TextView-Processor-Types.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-TextView-Processor.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-TextView-Relayout-Utilities.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-TextView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextView.cpp
base/dali-toolkit/internal/builder/builder-animations.cpp
base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
base/dali-toolkit/internal/controls/text-input/text-input-impl.cpp
base/dali-toolkit/internal/controls/text-input/text-input-text-highlight-impl.cpp
base/dali-toolkit/internal/controls/text-view/relayout-utilities.cpp
base/dali-toolkit/internal/controls/text-view/relayout-utilities.h
base/dali-toolkit/internal/controls/text-view/split-by-char-policies.cpp
base/dali-toolkit/internal/controls/text-view/split-by-new-line-char-policies.cpp
base/dali-toolkit/internal/controls/text-view/split-by-word-policies.cpp
base/dali-toolkit/internal/controls/text-view/text-processor.cpp
base/dali-toolkit/internal/controls/text-view/text-processor.h
base/dali-toolkit/internal/controls/text-view/text-view-character-processor.cpp
base/dali-toolkit/internal/controls/text-view/text-view-impl.cpp
base/dali-toolkit/internal/controls/text-view/text-view-impl.h
base/dali-toolkit/internal/controls/text-view/text-view-line-processor.cpp [deleted file]
base/dali-toolkit/internal/controls/text-view/text-view-line-processor.h [deleted file]
base/dali-toolkit/internal/controls/text-view/text-view-paragraph-processor.cpp [new file with mode: 0644]
base/dali-toolkit/internal/controls/text-view/text-view-paragraph-processor.h [new file with mode: 0644]
base/dali-toolkit/internal/controls/text-view/text-view-processor-dbg.cpp
base/dali-toolkit/internal/controls/text-view/text-view-processor-dbg.h
base/dali-toolkit/internal/controls/text-view/text-view-processor-helper-functions.cpp
base/dali-toolkit/internal/controls/text-view/text-view-processor-helper-functions.h
base/dali-toolkit/internal/controls/text-view/text-view-processor-types.h
base/dali-toolkit/internal/controls/text-view/text-view-processor.cpp
base/dali-toolkit/internal/controls/text-view/text-view-processor.h
base/dali-toolkit/internal/controls/text-view/text-view-word-group-processor.cpp [deleted file]
base/dali-toolkit/internal/controls/text-view/text-view-word-group-processor.h [deleted file]
base/dali-toolkit/internal/controls/text-view/text-view-word-processor.cpp
base/dali-toolkit/internal/controls/text-view/text-view-word-processor.h
base/dali-toolkit/internal/file.list
base/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp
base/dali-toolkit/public-api/controls/text-view/text-view.cpp
base/dali-toolkit/public-api/controls/text-view/text-view.h
build/tizen/Makefile.am
optional/dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index e6106ef..678dea7 100755 (executable)
@@ -2,6 +2,8 @@
 
 ( cd ../build/tizen ; make cov_data )
 
+# From lcov version 1.10 onwards, branch coverage is off by default and earlier versions do not support the rc option
+LCOV_OPTS=`if [ \`printf "\\\`lcov --version | cut -d' ' -f4\\\`\n1.10\n" | sort -V | head -n 1\` = 1.10 ] ; then echo "--rc lcov_branch_coverage=1" ; fi`
 
 for i in `find . -name "*.dir"` ; do
     (
@@ -10,15 +12,15 @@ for i in `find . -name "*.dir"` ; do
         covs=( `ls *.gcda 2>/dev/null` )
         if [[ $? -eq 0 ]]
         then
-            lcov --directory . -c -o dali.info
-            lcov --remove dali.info "*boost*" "/usr/include/*" "*/automated-tests/*" -o dali.info
+            lcov $LCOV_OPTS --directory . -c -o dali.info
+            lcov $LCOV_OPTS --remove dali.info "*boost*" "/usr/include/*" "*/automated-tests/*" -o dali.info
         fi
     )
 done
 
 (
     cd .. ;
-    genhtml -o build/tizen/doc/coverage `find . -name dali.info`
+    genhtml $LCOV_OPTS -o build/tizen/doc/coverage `find . -name dali.info`
 )
 
 echo "Coverage output: ../build/tizen/doc/coverage/index.html"
index d178356..f5e39e6 100644 (file)
@@ -55,23 +55,21 @@ struct GetIndicesFromGlobalCharacterIndexTest
   std::string description;
   std::string input;
   std::size_t position;
-  std::size_t lineIndex;
-  std::size_t groupIndex;
+  std::size_t paragraphIndex;
   std::size_t wordIndex;
   std::size_t characterIndex;
 };
 
 /**
- * Gets the line, group, word, and character indices for a given text and a given position and checks the results with the given indices.
+ * Gets the paragraph, word, and character indices for a given text and a given position and checks the results with the given indices.
  *
  * If the test fails it prints a short description and the line where this function was called.
  *
  * @param description Short description of the experiment.
  * @param input The input text.
  * @param position Global position of the character. i.e in a text with with 1000 characters, position could be any value from 0 to 1000.
- * @param resultLineIndex Index to the line where the character is located.
- * @param resultGroupIndex Index to the group within the line where the character is located.
- * @param resultWordIndex Index to the word within the group where the character is located.
+ * @param resultParagraphIndex Index to the paragraph where the character is located.
+ * @param resultWordIndex Index to the word within the paragraph where the character is located.
  * @param resultCharacterIndex Index to the character within the word where the character is located.
  * @param location Where this function has been called.
  *
@@ -80,8 +78,7 @@ struct GetIndicesFromGlobalCharacterIndexTest
 bool TestGetIndicesFromGlobalCharacterIndex( const std::string& description,
                                              const std::string& input,
                                              const std::size_t position,
-                                             const std::size_t resultLineIndex,
-                                             const std::size_t resultGroupIndex,
+                                             const std::size_t resultParagraphIndex,
                                              const std::size_t resultWordIndex,
                                              const std::size_t resultCharacterIndex,
                                              const char* location )
@@ -104,14 +101,9 @@ bool TestGetIndicesFromGlobalCharacterIndex( const std::string& description,
                                                          inputLayout,
                                                          indices );
 
-  if( indices.mLineIndex != resultLineIndex )
+  if( indices.mParagraphIndex != resultParagraphIndex )
   {
-    tet_printf( "Fail. different line index. %s", location );
-    return false;
-  }
-  if( indices.mGroupIndex != resultGroupIndex )
-  {
-    tet_printf( "Fail. different group index. %s", location );
+    tet_printf( "Fail. different paragraph index. %s", location );
     return false;
   }
   if( indices.mWordIndex != resultWordIndex )
@@ -148,7 +140,6 @@ int UtcDaliTextViewGetIndicesFromGlobalCharacterIndex(void)
       0,
       0,
       0,
-      0,
       0
     },
     {
@@ -160,7 +151,6 @@ int UtcDaliTextViewGetIndicesFromGlobalCharacterIndex(void)
       76,
       4,
       0,
-      0,
       0
     },
     {
@@ -172,7 +162,6 @@ int UtcDaliTextViewGetIndicesFromGlobalCharacterIndex(void)
       75,
       3,
       0,
-      0,
       0
     },
     {
@@ -183,8 +172,7 @@ int UtcDaliTextViewGetIndicesFromGlobalCharacterIndex(void)
                    "\n" ),
       35,
       1,
-      1,
-      0,
+      4,
       0
     },
     {
@@ -196,19 +184,16 @@ int UtcDaliTextViewGetIndicesFromGlobalCharacterIndex(void)
       3,
       0,
       0,
-      0,
       3
     },
-    /* TODO Check for mixed RTL and LTR text.
     {
-      std::string( "Test position 33. (end of the second word of the second line)" ),
+      std::string( "Test position 33. (end of the second word of the second paragraph)" ),
       std::string( "text te<font size='30'>xt text text text\n</font>"
                    "text text טק<font size='30'>סט טקסט </font>text\n"
                    "text te<font size='30'>xt text text</font> text\n"
                    "\n" ),
       33,
       1,
-      0,
       2,
       3
     },
@@ -220,19 +205,17 @@ int UtcDaliTextViewGetIndicesFromGlobalCharacterIndex(void)
                    "\n" ),
       43,
       1,
-      1,
-      3,
+      6,
       3
     },
-    */
   };
-  const std::size_t numberOfTests( 5 );
+  const std::size_t numberOfTests( 7 );
 
   for( std::size_t index = 0; index < numberOfTests; ++index )
   {
     const GetIndicesFromGlobalCharacterIndexTest& test = getIndicesFromGlobalCharacterIndexTests[index];
 
-    if( !TestGetIndicesFromGlobalCharacterIndex( test.description, test.input, test.position, test.lineIndex, test.groupIndex, test.wordIndex, test.characterIndex, TEST_LOCATION ) )
+    if( !TestGetIndicesFromGlobalCharacterIndex( test.description, test.input, test.position, test.paragraphIndex, test.wordIndex, test.characterIndex, TEST_LOCATION ) )
     {
       tet_result( TET_FAIL );
     }
index 990aad5..7cb03fe 100644 (file)
@@ -54,27 +54,22 @@ int UtcDaliTextViewDefaultConstructorDestructor_PT(void)
   tet_infoline("UtcDaliTextViewDefaultConstructorDestructor : ");
 
   TextViewProcessor::TextInfoIndices indices;
-  DALI_TEST_EQUALS( indices.mLineIndex, 0u, TEST_LOCATION );
-  DALI_TEST_EQUALS( indices.mGroupIndex, 0u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.mParagraphIndex, 0u, TEST_LOCATION );
   DALI_TEST_EQUALS( indices.mWordIndex, 0u, TEST_LOCATION );
   DALI_TEST_EQUALS( indices.mCharacterIndex, 0u, TEST_LOCATION );
 
   TextViewProcessor::CharacterLayoutInfo characterLayoutInfo;
-  DALI_TEST_EQUALS( characterLayoutInfo.mHeight, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo.mAdvance, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( characterLayoutInfo.mSize, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( characterLayoutInfo.mBearing, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( characterLayoutInfo.mPosition, Vector3::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( characterLayoutInfo.mOffset, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo.mSize, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( characterLayoutInfo.mAscender, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( characterLayoutInfo.mUnderlineThickness, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( characterLayoutInfo.mUnderlinePosition, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_CHECK( !characterLayoutInfo.mGlyphActor );
   DALI_TEST_CHECK( characterLayoutInfo.mStyledText.mText.IsEmpty() );
   DALI_TEST_EQUALS( characterLayoutInfo.mColorAlpha, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo.mGradientColor, Vector4::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo.mStartPoint, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo.mEndPoint, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_CHECK( NULL == characterLayoutInfo.mGradientInfo );
   DALI_TEST_CHECK( characterLayoutInfo.mIsVisible );
   DALI_TEST_CHECK( characterLayoutInfo.mSetText );
   DALI_TEST_CHECK( characterLayoutInfo.mSetStyle );
@@ -85,24 +80,17 @@ int UtcDaliTextViewDefaultConstructorDestructor_PT(void)
   DALI_TEST_EQUALS( wordLayoutInfo.mType, TextViewProcessor::NoSeparator, TEST_LOCATION );
   DALI_TEST_EQUALS( wordLayoutInfo.mCharactersLayoutInfo.size(), 0u, TEST_LOCATION );
 
-  TextViewProcessor::WordGroupLayoutInfo wordGroupLayoutInfo;
-  DALI_TEST_EQUALS( wordGroupLayoutInfo.mSize, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( wordGroupLayoutInfo.mAscender, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( wordGroupLayoutInfo.mDirection, TextViewProcessor::LTR, TEST_LOCATION );
-  DALI_TEST_EQUALS( wordGroupLayoutInfo.mWordsLayoutInfo.size(), 0u, TEST_LOCATION );
-  DALI_TEST_EQUALS( wordGroupLayoutInfo.mNumberOfCharacters, 0u, TEST_LOCATION );
-
-  TextViewProcessor::LineLayoutInfo lineLayoutInfo;
-  DALI_TEST_EQUALS( lineLayoutInfo.mSize, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( lineLayoutInfo.mAscender, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( lineLayoutInfo.mLineHeightOffset, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( lineLayoutInfo.mWordGroupsLayoutInfo.size(), 0u, TEST_LOCATION );
-  DALI_TEST_EQUALS( lineLayoutInfo.mNumberOfCharacters, 0u, TEST_LOCATION );
+  TextViewProcessor::ParagraphLayoutInfo paragraphLayoutInfo;
+  DALI_TEST_EQUALS( paragraphLayoutInfo.mSize, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( paragraphLayoutInfo.mAscender, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( paragraphLayoutInfo.mLineHeightOffset, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( paragraphLayoutInfo.mWordsLayoutInfo.size(), 0u, TEST_LOCATION );
+  DALI_TEST_EQUALS( paragraphLayoutInfo.mNumberOfCharacters, 0u, TEST_LOCATION );
 
   TextViewProcessor::TextLayoutInfo textLayoutInfo;
   DALI_TEST_EQUALS( textLayoutInfo.mWholeTextSize, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( textLayoutInfo.mMaxWordWidth, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( textLayoutInfo.mLinesLayoutInfo.size(), 0u, TEST_LOCATION );
+  DALI_TEST_EQUALS( textLayoutInfo.mParagraphsLayoutInfo.size(), 0u, TEST_LOCATION );
   DALI_TEST_EQUALS( textLayoutInfo.mNumberOfCharacters, 0u, TEST_LOCATION );
   DALI_TEST_EQUALS( textLayoutInfo.mMaxItalicsOffset, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( textLayoutInfo.mEllipsizeLayoutInfo.mSize, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
@@ -119,12 +107,10 @@ int UtcDaliTextViewCopyConstructorOperator(void)
   tet_infoline("UtcDaliTextViewCopyConstructorOperator : ");
 
   TextViewProcessor::CharacterLayoutInfo characterLayoutInfo;
-  characterLayoutInfo.mHeight = 1.f;
-  characterLayoutInfo.mAdvance = 1.f;
+  characterLayoutInfo.mSize = Vector2( 1.f, 1.f );
   characterLayoutInfo.mBearing = 1.f;
   characterLayoutInfo.mPosition = Vector3( 1.f, 1.f, 1.f );
   characterLayoutInfo.mOffset = Vector2( 1.f, 1.f );
-  characterLayoutInfo.mSize = Vector2( 1.f, 1.f );
   characterLayoutInfo.mAscender = 1.f;
   characterLayoutInfo.mUnderlineThickness = 1.f;
   characterLayoutInfo.mUnderlinePosition = 1.f;
@@ -132,10 +118,14 @@ int UtcDaliTextViewCopyConstructorOperator(void)
   characterLayoutInfo.mGlyphActor = TextActor::New( "Hello" );
   characterLayoutInfo.mStyledText.mText = Text( "Hello" );
 
+  TextViewProcessor::GradientInfo* info = new TextViewProcessor::GradientInfo();
+  info->mGradientColor = Vector4( 1.f, 1.f, 1.f, 1.f );
+  info->mStartPoint = Vector2( 1.f, 1.f );
+  info->mEndPoint = Vector2( 1.f, 1.f );
+
   characterLayoutInfo.mColorAlpha = 0.f;
-  characterLayoutInfo.mGradientColor = Vector4( 1.f, 1.f, 1.f, 1.f );
-  characterLayoutInfo.mStartPoint = Vector2( 1.f, 1.f );
-  characterLayoutInfo.mEndPoint = Vector2( 1.f, 1.f );
+  characterLayoutInfo.mGradientInfo = info;
+
   characterLayoutInfo.mIsVisible = false;
   characterLayoutInfo.mSetText = false;
   characterLayoutInfo.mSetStyle = false;
@@ -143,8 +133,6 @@ int UtcDaliTextViewCopyConstructorOperator(void)
   TextViewProcessor::CharacterLayoutInfo characterLayoutInfo1;
   characterLayoutInfo1 = characterLayoutInfo;
 
-  DALI_TEST_EQUALS( characterLayoutInfo1.mHeight, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo1.mAdvance, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( characterLayoutInfo1.mBearing, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( characterLayoutInfo1.mPosition, Vector3( 1.f, 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( characterLayoutInfo1.mOffset, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
@@ -155,16 +143,14 @@ int UtcDaliTextViewCopyConstructorOperator(void)
   DALI_TEST_CHECK( characterLayoutInfo1.mGlyphActor );
   DALI_TEST_EQUALS( characterLayoutInfo1.mStyledText.mText.GetLength(), 5u, TEST_LOCATION );
   DALI_TEST_EQUALS( characterLayoutInfo1.mColorAlpha, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo1.mGradientColor, Vector4( 1.f, 1.f, 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo1.mStartPoint, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo1.mEndPoint, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( characterLayoutInfo1.mGradientInfo->mGradientColor, Vector4( 1.f, 1.f, 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( characterLayoutInfo1.mGradientInfo->mStartPoint, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( characterLayoutInfo1.mGradientInfo->mEndPoint, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_CHECK( !characterLayoutInfo1.mIsVisible );
   DALI_TEST_CHECK( !characterLayoutInfo1.mSetText );
   DALI_TEST_CHECK( !characterLayoutInfo1.mSetStyle );
 
   TextViewProcessor::CharacterLayoutInfo characterLayoutInfo2( characterLayoutInfo );
-  DALI_TEST_EQUALS( characterLayoutInfo2.mHeight, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo2.mAdvance, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( characterLayoutInfo2.mBearing, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( characterLayoutInfo2.mPosition, Vector3( 1.f, 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( characterLayoutInfo2.mOffset, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
@@ -175,9 +161,9 @@ int UtcDaliTextViewCopyConstructorOperator(void)
   DALI_TEST_CHECK( characterLayoutInfo2.mGlyphActor );
   DALI_TEST_EQUALS( characterLayoutInfo2.mStyledText.mText.GetLength(), 5u, TEST_LOCATION );
   DALI_TEST_EQUALS( characterLayoutInfo2.mColorAlpha, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo2.mGradientColor, Vector4( 1.f, 1.f, 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo2.mStartPoint, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo2.mEndPoint, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( characterLayoutInfo2.mGradientInfo->mGradientColor, Vector4( 1.f, 1.f, 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( characterLayoutInfo2.mGradientInfo->mStartPoint, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( characterLayoutInfo2.mGradientInfo->mEndPoint, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_CHECK( !characterLayoutInfo2.mIsVisible );
   DALI_TEST_CHECK( !characterLayoutInfo2.mSetText );
   DALI_TEST_CHECK( !characterLayoutInfo2.mSetStyle );
@@ -190,64 +176,41 @@ int UtcDaliTextViewCopyConstructorOperator(void)
   TextViewProcessor::WordLayoutInfo wordLayoutInfo;
   wordLayoutInfo.mSize = Vector2( 1.f, 1.f );
   wordLayoutInfo.mAscender = 1.f;
-  wordLayoutInfo.mType = TextViewProcessor::LineSeparator;
+  wordLayoutInfo.mType = TextViewProcessor::ParagraphSeparator;
 
   TextViewProcessor::WordLayoutInfo wordLayoutInfo1;
   wordLayoutInfo1 = wordLayoutInfo;
 
   DALI_TEST_EQUALS( wordLayoutInfo1.mSize, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( wordLayoutInfo1.mAscender, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( wordLayoutInfo1.mType, TextViewProcessor::LineSeparator, TEST_LOCATION );
+  DALI_TEST_EQUALS( wordLayoutInfo1.mType, TextViewProcessor::ParagraphSeparator, TEST_LOCATION );
 
   TextViewProcessor::WordLayoutInfo wordLayoutInfo2( wordLayoutInfo );
 
   DALI_TEST_EQUALS( wordLayoutInfo2.mSize, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( wordLayoutInfo2.mAscender, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( wordLayoutInfo2.mType, TextViewProcessor::LineSeparator, TEST_LOCATION );
-
-
-  TextViewProcessor::WordGroupLayoutInfo wordGroupLayoutInfo;
-  wordGroupLayoutInfo.mSize = Vector2( 1.f, 1.f );
-  wordGroupLayoutInfo.mAscender = 1.f;
-  wordGroupLayoutInfo.mDirection = TextViewProcessor::RTL;
-  wordGroupLayoutInfo.mNumberOfCharacters = 1u;
-
-  TextViewProcessor::WordGroupLayoutInfo wordGroupLayoutInfo1;
-  wordGroupLayoutInfo1 = wordGroupLayoutInfo;
-
-  DALI_TEST_EQUALS( wordGroupLayoutInfo.mSize, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( wordGroupLayoutInfo.mAscender, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( wordGroupLayoutInfo.mDirection, TextViewProcessor::RTL, TEST_LOCATION );
-  DALI_TEST_EQUALS( wordGroupLayoutInfo.mNumberOfCharacters, 1u, TEST_LOCATION );
-
-  TextViewProcessor::WordGroupLayoutInfo wordGroupLayoutInfo2( wordGroupLayoutInfo );
-
-  DALI_TEST_EQUALS( wordGroupLayoutInfo.mSize, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( wordGroupLayoutInfo.mAscender, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( wordGroupLayoutInfo.mDirection, TextViewProcessor::RTL, TEST_LOCATION );
-  DALI_TEST_EQUALS( wordGroupLayoutInfo.mNumberOfCharacters, 1u, TEST_LOCATION );
-
+  DALI_TEST_EQUALS( wordLayoutInfo2.mType, TextViewProcessor::ParagraphSeparator, TEST_LOCATION );
 
-  TextViewProcessor::LineLayoutInfo lineLayoutInfo;
-  lineLayoutInfo.mSize = Vector2( 1.f, 1.f );
-  lineLayoutInfo.mAscender = 1.f;
-  lineLayoutInfo.mLineHeightOffset = 1.f;
-  lineLayoutInfo.mNumberOfCharacters = 1u;
+  TextViewProcessor::ParagraphLayoutInfo paragraphLayoutInfo;
+  paragraphLayoutInfo.mSize = Vector2( 1.f, 1.f );
+  paragraphLayoutInfo.mAscender = 1.f;
+  paragraphLayoutInfo.mLineHeightOffset = 1.f;
+  paragraphLayoutInfo.mNumberOfCharacters = 1u;
 
-  TextViewProcessor::LineLayoutInfo lineLayoutInfo1;
-  lineLayoutInfo1 = lineLayoutInfo;
+  TextViewProcessor::ParagraphLayoutInfo paragraphLayoutInfo1;
+  paragraphLayoutInfo1 = paragraphLayoutInfo;
 
-  DALI_TEST_EQUALS( lineLayoutInfo1.mSize, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( lineLayoutInfo1.mAscender, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( lineLayoutInfo1.mLineHeightOffset, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( lineLayoutInfo1.mNumberOfCharacters, 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( paragraphLayoutInfo1.mSize, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( paragraphLayoutInfo1.mAscender, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( paragraphLayoutInfo1.mLineHeightOffset, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( paragraphLayoutInfo1.mNumberOfCharacters, 1u, TEST_LOCATION );
 
-  TextViewProcessor::LineLayoutInfo lineLayoutInfo2( lineLayoutInfo );
+  TextViewProcessor::ParagraphLayoutInfo paragraphLayoutInfo2( paragraphLayoutInfo );
 
-  DALI_TEST_EQUALS( lineLayoutInfo2.mSize, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( lineLayoutInfo2.mAscender, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( lineLayoutInfo2.mLineHeightOffset, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( lineLayoutInfo2.mNumberOfCharacters, 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( paragraphLayoutInfo2.mSize, Vector2( 1.f, 1.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( paragraphLayoutInfo2.mAscender, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( paragraphLayoutInfo2.mLineHeightOffset, 1.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( paragraphLayoutInfo2.mNumberOfCharacters, 1u, TEST_LOCATION );
 
   TextViewProcessor::TextLayoutInfo textLayoutInfo;
   textLayoutInfo.mWholeTextSize = Vector2( 1.f, 1.f );
@@ -279,7 +242,7 @@ int UtcDaliTextViewEqualityOperator(void)
   tet_infoline("UtcDaliTextViewEqualityOperator : ");
 
   TextViewProcessor::TextInfoIndices indices;
-  TextViewProcessor::TextInfoIndices indices1( 1u, 1u, 1u, 1u );
+  TextViewProcessor::TextInfoIndices indices1( 1u, 1u, 1u );
 
   DALI_TEST_CHECK( !( indices == indices1 ) );
 
index 9485689..2fb823f 100644 (file)
@@ -128,28 +128,28 @@ bool TestFindNearestWord( const std::string& description, const std::string& inp
 
 //////////////////////////////////////////////////////////////////
 
-struct SplitInLinesTest
+struct SplitInParagraphsTest
 {
   std::string inputText;
 
-  std::size_t resultNumberOfLines;
+  std::size_t resultNumberOfParagraphs;
 };
 
-bool TestSplitInLines( const SplitInLinesTest& test, const char* location )
+bool TestSplitInParagraphs( const SplitInParagraphsTest& test, const char* location )
 {
   // Creates a styled text with the markup or plain string.
   MarkupProcessor::StyledTextArray styledText;
   MarkupProcessor::GetStyledTextArray( test.inputText, styledText, true );
 
-  std::vector<MarkupProcessor::StyledTextArray> lines;
+  std::vector<MarkupProcessor::StyledTextArray> paragraphs;
 
-  TextProcessor::SplitInLines( styledText,
-                               lines );
+  TextProcessor::SplitInParagraphs( styledText,
+                                    paragraphs );
 
-  if( lines.size() != test.resultNumberOfLines )
+  if( paragraphs.size() != test.resultNumberOfParagraphs )
   {
     tet_printf( "Fail. %s", location );
-    tet_printf( "Different number of lines, result %d, expected result %d", lines.size(), test.resultNumberOfLines );
+    tet_printf( "Different number of paragraphs, result %d, expected result %d", paragraphs.size(), test.resultNumberOfParagraphs );
 
     return false;
   }
@@ -193,13 +193,13 @@ bool TestSplitInWords( const SplitInWordsTest& test, const char* location )
 } // namespace
 
 
-int UtcDaliTextViewSplitInLines(void)
+int UtcDaliTextViewSplitInParagraphs(void)
 {
   ToolkitTestApplication application;
 
-  tet_infoline("UtcDaliTextViewSplitInLines : ");
+  tet_infoline("UtcDaliTextViewSplitInParagraphs : ");
 
-  struct SplitInLinesTest splitInLinesTest[] =
+  struct SplitInParagraphsTest splitInParagraphsTest[] =
   {
     {
       std::string( "Hello world\nhello world." ),
@@ -214,9 +214,9 @@ int UtcDaliTextViewSplitInLines(void)
 
   for( std::size_t index = 0; index < numberOfTests; ++index )
   {
-    const SplitInLinesTest& test = splitInLinesTest[index];
+    const SplitInParagraphsTest& test = splitInParagraphsTest[index];
 
-    if( !TestSplitInLines( test, TEST_LOCATION ) )
+    if( !TestSplitInParagraphs( test, TEST_LOCATION ) )
     {
       tet_result( TET_FAIL );
     }
index 38be7c6..255c96a 100644 (file)
@@ -54,14 +54,14 @@ bool TestEqual( float x, float y )
 
 //////////////////////////////////////////////////////////////////
 
-struct CalculateSubLineLayoutTest
+struct CalculateLineLayoutTest
 {
   std::string description;
-  std::string inputLine;
+  std::string inputParagraph;
   float parentWidth;
-  std::size_t groupIndex;
   std::size_t wordIndex;
   std::size_t characterIndex;
+  std::size_t characterParagraphIndex;
   TextViewRelayout::HorizontalWrapType splitPolicy;
   float shrinkFactor;
 
@@ -70,13 +70,13 @@ struct CalculateSubLineLayoutTest
   float resultMaxAscender;
 };
 
-bool TestCalculateSubLineLayout( const CalculateSubLineLayoutTest& test,  const char* location )
+bool TestCalculateLineLayout( const CalculateLineLayoutTest& test,  const char* location )
 {
   tet_printf( "%s", test.description.c_str() );
 
   // Create styled text.
   MarkupProcessor::StyledTextArray inputStyledText;
-  MarkupProcessor::GetStyledTextArray( test.inputLine, inputStyledText, true );
+  MarkupProcessor::GetStyledTextArray( test.inputParagraph, inputStyledText, true );
 
   // Create styled text layout info.
   Toolkit::Internal::TextView::RelayoutData relayoutData;
@@ -87,25 +87,25 @@ bool TestCalculateSubLineLayout( const CalculateSubLineLayoutTest& test,  const
   // Prepare input parameters and the result structure and call the function to be tested.
 
   // Creaqte indices.
-  TextViewProcessor::TextInfoIndices indices( 0, test.groupIndex, test.wordIndex, test.characterIndex );
+  TextViewProcessor::TextInfoIndices indices( 0u, test.wordIndex, test.characterIndex );
 
-  // Get the input line.
-  TextViewProcessor::LineLayoutInfo inputLineLayout;
+  // Get the input paragraph.
+  TextViewProcessor::ParagraphLayoutInfo inputParagraphLayout;
 
-  if( !relayoutData.mTextLayoutInfo.mLinesLayoutInfo.empty() )
+  if( !relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.empty() )
   {
-    inputLineLayout = *relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin();
+    inputParagraphLayout = *relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin();
   }
 
   // Result struct.
-  TextViewRelayout::SubLineLayoutInfo resultLayoutInfo;
+  TextViewRelayout::LineLayoutInfo resultLayoutInfo;
 
-  CalculateSubLineLayout( test.parentWidth,
-                          indices,
-                          inputLineLayout,
-                          test.splitPolicy,
-                          test.shrinkFactor,
-                          resultLayoutInfo  );
+  CalculateLineLayout( test.parentWidth,
+                       indices,
+                       inputParagraphLayout,
+                       test.splitPolicy,
+                       test.shrinkFactor,
+                       resultLayoutInfo  );
 
   // Check results.
   if( !TestEqual( test.resultLineLength, resultLayoutInfo.mLineLength ) )
@@ -235,18 +235,17 @@ int UtcDaliTextViewDefaultConstructorDestructor_RU(void)
   TextViewRelayout::RelayoutParameters relayoutParameters;
 
   DALI_TEST_EQUALS( relayoutParameters.mPositionOffset, Vector3::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( relayoutParameters.mLineSize, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( relayoutParameters.mParagraphSize, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( relayoutParameters.mWordSize, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   DALI_TEST_EQUALS( relayoutParameters.mCharacterSize, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( relayoutParameters.mIndices.mLineIndex, 0u, TEST_LOCATION );
-  DALI_TEST_EQUALS( relayoutParameters.mIndices.mGroupIndex, 0u, TEST_LOCATION );
+  DALI_TEST_EQUALS( relayoutParameters.mIndices.mParagraphIndex, 0u, TEST_LOCATION );
   DALI_TEST_EQUALS( relayoutParameters.mIndices.mWordIndex, 0u, TEST_LOCATION );
   DALI_TEST_EQUALS( relayoutParameters.mIndices.mCharacterIndex, 0u, TEST_LOCATION );
   DALI_TEST_EQUALS( relayoutParameters.mCharacterGlobalIndex, 0u, TEST_LOCATION );
   DALI_TEST_CHECK( !relayoutParameters.mIsFirstCharacter );
   DALI_TEST_CHECK( !relayoutParameters.mIsFirstCharacterOfWord );
   DALI_TEST_CHECK( !relayoutParameters.mIsNewLine );
-  DALI_TEST_CHECK( !relayoutParameters.mIsNewLineCharacter );
+  DALI_TEST_CHECK( !relayoutParameters.mIsNewParagraphCharacter );
   DALI_TEST_CHECK( !relayoutParameters.mIsWhiteSpace );
   DALI_TEST_CHECK( !relayoutParameters.mIsVisible );
 
@@ -307,30 +306,30 @@ int UtcDaliTextViewDefaultConstructorDestructor_RU(void)
   DALI_TEST_EQUALS( textUnderlineStatus.mLineGlobalIndex, 0u, TEST_LOCATION );
   DALI_TEST_CHECK( !textUnderlineStatus.mCurrentUnderlineStatus );
 
-  // Test SubLineLayoutInfo defaults
-  TextViewRelayout::SubLineLayoutInfo subLineLayoutInfo;
+  // Test LineLayoutInfo defaults
+  TextViewRelayout::LineLayoutInfo lineLayoutInfo;
 
-  DALI_TEST_EQUALS( subLineLayoutInfo.mLineLength, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( subLineLayoutInfo.mMaxCharHeight, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( subLineLayoutInfo.mMaxAscender, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( lineLayoutInfo.mLineLength, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( lineLayoutInfo.mMaxCharHeight, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( lineLayoutInfo.mMaxAscender, 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   END_TEST;
 }
 
-int UtcDaliTextViewCalculateSubLineLayout(void)
+int UtcDaliTextViewCalculateLineLayout(void)
 {
   ToolkitTestApplication application;
 
-  tet_infoline("UtcDaliTextViewCalculateSubLineLayout : ");
+  tet_infoline("UtcDaliTextViewCalculateLineLayout : ");
 
-  struct CalculateSubLineLayoutTest calculateSubLineLayoutTest[] =
+  struct CalculateLineLayoutTest calculateLineLayoutTest[] =
   {
     //WrapByCharacter
     {
-      "The line is wraped by character. All characters have the same size.",
-      "Hello world", // input line
+      "The paragraph is wraped by character. All characters have the same size.",
+      "Hello world", // input paragraph
       100.f,         // parent width
+      0,             // indices
       0,
-      0,              // indices
       0,
       TextViewRelayout::WrapByCharacter, // split policy
       1.f,
@@ -340,12 +339,12 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
       10.242188f  // max ascender
     },
     {
-      "The line is wraped by character. There are characters with different sizes.",
-      "Hello <font size='14'>world</font>", // input line
+      "The paragraph is wraped by character. There are characters with different sizes.",
+      "Hello <font size='14'>world</font>", // input paragraph
       100.f,         // parent width
-      0,
       0,              // indices
       0,
+      0,
       TextViewRelayout::WrapByCharacter, // split policy
       1.f,
       // results
@@ -354,12 +353,12 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
       11.949220f  // max ascender
     },
     {
-      "The line is wraped by character. There are characters with different sizes. It calculates the layout for the second line.",
-      "Hello <font size='14'>wo</font>rld hell<font size='14'>o world</font>", // input line
+      "The paragraph is wraped by character. There are characters with different sizes. It calculates the layout for the second line.",
+      "Hello <font size='14'>wo</font>rld hell<font size='14'>o world</font>", // input paragraph
       100.f,         // parent width
-      0,
       2,              // indices. The third character of the third word starts in a new line.
       2,
+      8,
       TextViewRelayout::WrapByCharacter, // split policy
       1.f,
       // results
@@ -368,12 +367,12 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
       10.242188f  // max ascender
     },
     {
-      "The line is wraped by character. There are characters with different sizes. It calculates the layout for the third line.",
-      "Hello <font size='14'>wo</font>rld hell<font size='14'>o world</font>", // input line
+      "The paragraph is wraped by character. There are characters with different sizes. It calculates the layout for the third line.",
+      "Hello <font size='14'>wo</font>rld hell<font size='14'>o world</font>", // input paragraph
       100.f,         // parent width
-      0,
       4,              // indices. The fifth character of the fifth word starts in a new line.
       4,
+      16,
       TextViewRelayout::WrapByCharacter, // split policy
       1.f,
       // results
@@ -384,12 +383,12 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
 
     //WrapByWord
     {
-      "The line is wraped by word. All characters have the same size.",
-      "Hello world", // input line
+      "The paragraph is wraped by word. All characters have the same size.",
+      "Hello world", // input paragraph
       100.f,         // parent width
-      0,
       0,              // indices. It shouldn't use the index character so 9999999 shouldn't make it crash.
       9999999,
+      9999999,
       TextViewRelayout::WrapByWord, // split policy
       1.f,
       // results
@@ -398,12 +397,12 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
       10.242188f  // max ascender
     },
     {
-      "The line is wraped by word. There are characters with different sizes.",
-      "Hell<font size='14'>o</font> world", // input line
+      "The paragraph is wraped by word. There are characters with different sizes.",
+      "Hell<font size='14'>o</font> world", // input paragraph
       100.f,         // parent width
-      0,
       0,              // indices.
       0,
+      0,
       TextViewRelayout::WrapByWord, // split policy
       1.f,
       // results
@@ -412,12 +411,12 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
       11.949220f  // max ascender
     },
     {
-      "The line is wraped by word. There are characters with different sizes. It calculates the layout for the second line.",
-      "Hello <font size='14'>wo</font>rld <font size='16'>hello world</font>", // input line
+      "The paragraph is wraped by word. There are characters with different sizes. It calculates the layout for the second line.",
+      "Hello <font size='14'>wo</font>rld <font size='16'>hello world</font>", // input paragraph
       100.f,         // parent width
-      0,
       2,              // indices. The third word starts in a new line.
       0,
+      6,
       TextViewRelayout::WrapByWord, // split policy
       1.f,
       // results
@@ -426,12 +425,12 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
       11.949220f  // max ascender
     },
     {
-      "The line is wraped by word. The word doen't fit.",
-      "Hello world", // input line
+      "The paragraph is wraped by word. The word doen't fit.",
+      "Hello world", // input paragraph
       40.f,          // parent width
-      0,
       0,              // indices. The third word starts in a new line.
       0,
+      0,
       TextViewRelayout::WrapByWord, // split policy
       1.f,
       // results
@@ -442,12 +441,12 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
 
     //WrapByWordAndSplit
     {
-      "The line is wraped by word and by character. All characters have the same size. There is not a long word.",
-      "Hello world hello world", // input line
+      "The paragraph is wraped by word and by character. All characters have the same size. There is not a long word.",
+      "Hello world hello world", // input paragraph
       100.f,         // parent width
-      0,
       0,              // indices.
       0,
+      0,
       TextViewRelayout::WrapByWordAndSplit, // split policy
       1.f,
       // results
@@ -456,12 +455,12 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
       10.242188f  // max ascender
     },
     {
-      "The line is wraped by word and by character. All characters have the same size. There is a long word.",
-      "Helloooooooo world", // input line
+      "The paragraph is wraped by word and by character. All characters have the same size. There is a long word.",
+      "Helloooooooo world", // input paragraph
       100.f,         // parent width
-      0,
       0,              // indices.
       0,
+      0,
       TextViewRelayout::WrapByWordAndSplit, // split policy
       1.f,
       // results
@@ -470,12 +469,12 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
       10.242188f  // max ascender
     },
     {
-      "The line is wraped by word and by character. There are characters with different sizes. There is a long word. It calculates the layout for the second line.",
-      "Helloooooooo <font size='14'>world</font>", // input line
+      "The paragraph is wraped by word and by character. There are characters with different sizes. There is a long word. It calculates the layout for the second line.",
+      "Helloooooooo <font size='14'>world</font>", // input paragraph
       100.f,         // parent width
-      0,
       0,              // indices.
       8,
+      8,
       TextViewRelayout::WrapByWordAndSplit, // split policy
       1.f,
       // results
@@ -484,12 +483,12 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
       10.242188f  // max ascender
     },
     {
-      "The line is wraped by word and by character. There are characters with different sizes. There is a shrink factor.",
-      "Helloooooooo<font size='14'> world</font>", // input line
+      "The paragraph is wraped by word and by character. There are characters with different sizes. There is a shrink factor.",
+      "Helloooooooo<font size='14'> world</font>", // input paragraph
       100.f,         // parent width
-      0,
       0,              // indices.
       8,
+      8,
       TextViewRelayout::WrapByWordAndSplit, // split policy
       0.7f,
       // results
@@ -498,15 +497,15 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
       7.169531f  // max ascender
     },
 
-    //WrapByLineAndSplit
+    //WrapByParagraphCharacterAndSplit
     {
-      "The line is wraped by end of line and by character. All characters have the same size.",
-      "Hello world", // input line
+      "The paragraph is wraped by end of paragraph and by character. All characters have the same size.",
+      "Hello world", // input paragraph
       100.f,         // parent width
-      0,
       0,              // indices
       0,
-      TextViewRelayout::WrapByLineAndSplit, // split policy
+      0,
+      TextViewRelayout::WrapByParagraphCharacterAndSplit, // split policy
       1.f,
       // results
       91.041672f, // line length. (only fits 8 characters 8x11.38)
@@ -514,13 +513,13 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
       10.242188f  // max ascender
     },
     {
-      "The line fits in the width.",
-      "Hello", // input line
+      "The paragraph fits in the width.",
+      "Hello", // input paragraph
       100.f,         // parent width
-      0,
       0,             // indices
       0,
-      TextViewRelayout::WrapByLineAndSplit, // split policy
+      0,
+      TextViewRelayout::WrapByParagraphCharacterAndSplit, // split policy
       1.f,
       // results
       56.901047f, // line length. (only fits 5 characters 5x11.38)
@@ -528,13 +527,13 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
       10.242188f  // max ascender
     },
     {
-      "The line is wraped by end of line and by character. All characters have the same size. It calculates the layout for the second line.",
-      "Hello world, hello world", // input line
+      "The paragraph is wraped by end of paragraph and by character. All characters have the same size. It calculates the layout for the second line.",
+      "Hello world, hello world", // input paragraph
       100.f,         // parent width
-      0,
       2,             // indices
       2,
-      TextViewRelayout::WrapByLineAndSplit, // split policy
+      8,
+      TextViewRelayout::WrapByParagraphCharacterAndSplit, // split policy
       1.f,
       // results
       91.041672f, // line length. (only fits 8 characters 8x11.38)
@@ -546,9 +545,9 @@ int UtcDaliTextViewCalculateSubLineLayout(void)
 
   for( std::size_t index = 0; index < numberOfTests; ++index )
   {
-    const CalculateSubLineLayoutTest& test = calculateSubLineLayoutTest[index];
+    const CalculateLineLayoutTest& test = calculateLineLayoutTest[index];
 
-    if( !TestCalculateSubLineLayout( test, TEST_LOCATION ) )
+    if( !TestCalculateLineLayout( test, TEST_LOCATION ) )
     {
       tet_result( TET_FAIL );
     }
index 7d39047..ee43cbd 100644 (file)
@@ -23,8 +23,8 @@
 
 // Internal headers are allowed here
 #include <dali-toolkit/internal/controls/text-view/text-view-processor.h>
-#include <dali-toolkit/internal/controls/text-view/text-view-line-processor.h>
-#include <dali-toolkit/internal/controls/text-view/text-view-word-group-processor.h>
+#include <dali-toolkit/internal/controls/text-view/text-view-processor-dbg.h>
+#include <dali-toolkit/internal/controls/text-view/text-view-paragraph-processor.h>
 #include <dali-toolkit/internal/controls/text-view/text-view-word-processor.h>
 #include <dali-toolkit/internal/controls/text-view/relayout-utilities.h>
 
@@ -60,23 +60,12 @@ struct SplitWordTest
   std::string lastResult;
 };
 
-struct SplitWordGroupTest
+struct SplitParagraphTest
 {
   std::string description;
   std::string input;
-  std::size_t wordPosition;
-  std::size_t position;
-  std::string firstResult;
-  std::string lastResult;
-};
-
-struct SplitLineTest
-{
-  std::string description;
-  std::string input;
-  std::size_t groupPosition;
-  std::size_t wordPosition;
-  std::size_t position;
+  std::size_t wordIndex;
+  std::size_t characterIndex;
   float       lineHeightOffset;
   std::string firstResult;
   std::string lastResult;
@@ -90,15 +79,7 @@ struct MergeWordsTest
   std::string result;
 };
 
-struct MergeWordGroupsTest
-{
-  std::string description;
-  std::string inputFirst;
-  std::string inputLast;
-  std::string result;
-};
-
-struct MergeLinesTest
+struct MergeParagraphsTest
 {
   std::string description;
   std::string inputFirst;
@@ -116,21 +97,12 @@ struct RemoveCharactersFromWordTest
   std::string result;
 };
 
-struct RemoveWordsFromGroupTest
+struct RemoveWordsFromParagraphTest
 {
   std::string description;
   std::string input;
   std::size_t wordIndex;
   std::size_t numberOfWords;
-  std::string result;
-};
-
-struct RemoveGroupsFromLineTest
-{
-  std::string description;
-  std::string input;
-  std::size_t groupIndex;
-  std::size_t numberOfGroups;
   float       lineHeightOffset;
   std::string result;
 };
@@ -158,12 +130,11 @@ struct UpdateTextInfoTest
 
 void Print( const TextViewProcessor::CharacterLayoutInfo& character )
 {
-  std::cout << "             height : " << character.mHeight << std::endl;
-  std::cout << "            advance : " << character.mAdvance << std::endl;
+  std::cout << "             height : " << character.mSize.height << std::endl;
+  std::cout << "            advance : " << character.mSize.width << std::endl;
   std::cout << "            bearing : " << character.mBearing << std::endl;
-  std::cout << "          mPosition : " << character.mPosition << std::endl;
-  std::cout << "              mSize : " << character.mSize << std::endl;
-  std::cout << "          mAscender : " << character.mAscender << std::endl;
+  std::cout << "           ascender : " << character.mAscender << std::endl;
+  std::cout << "           position : " << character.mPosition << std::endl;
 
   TextActor textActor = TextActor::DownCast( character.mGlyphActor );
   if( textActor )
@@ -192,27 +163,13 @@ void Print( const TextViewProcessor::WordLayoutInfo& word )
   std::cout << "]"; std::cout << std::endl;
 }
 
-void Print( const TextViewProcessor::WordGroupLayoutInfo& wordGroup )
-{
-  std::cout << "(";
-  std::cout << "              mSize : " << wordGroup.mSize << std::endl;
-  std::cout << "          mAscender : " << wordGroup.mAscender << std::endl;
-  std::cout << "         mDirection : " << wordGroup.mDirection << std::endl;
-  std::cout << "mNumberOfCharacters : " << wordGroup.mNumberOfCharacters << std::endl;
-  for( TextViewProcessor::WordLayoutInfoContainer::const_iterator it = wordGroup.mWordsLayoutInfo.begin(), endIt = wordGroup.mWordsLayoutInfo.end(); it != endIt; ++it )
-  {
-    Print( *it );
-  }
-  std::cout << ")"; std::cout << std::endl;
-}
-
-void Print( const TextViewProcessor::LineLayoutInfo& line )
+void Print( const TextViewProcessor::ParagraphLayoutInfo& paragraph )
 {
   std::cout << "<";
-  std::cout << "              mSize : " << line.mSize << std::endl;
-  std::cout << "          mAscender : " << line.mAscender << std::endl;
-  std::cout << "mNumberOfCharacters : " << line.mNumberOfCharacters << std::endl;
-  for( TextViewProcessor::WordGroupLayoutInfoContainer::const_iterator it = line.mWordGroupsLayoutInfo.begin(), endIt = line.mWordGroupsLayoutInfo.end(); it != endIt; ++it )
+  std::cout << "              mSize : " << paragraph.mSize << std::endl;
+  std::cout << "          mAscender : " << paragraph.mAscender << std::endl;
+  std::cout << "mNumberOfCharacters : " << paragraph.mNumberOfCharacters << std::endl;
+  for( TextViewProcessor::WordLayoutInfoContainer::const_iterator it = paragraph.mWordsLayoutInfo.begin(), endIt = paragraph.mWordsLayoutInfo.end(); it != endIt; ++it )
   {
     Print( *it );
   }
@@ -222,48 +179,57 @@ void Print( const TextViewProcessor::LineLayoutInfo& line )
 void Print( const TextViewProcessor::TextLayoutInfo& text )
 {
   std::cout << "||";
-  for( TextViewProcessor::LineLayoutInfoContainer::const_iterator it = text.mLinesLayoutInfo.begin(), endIt = text.mLinesLayoutInfo.end(); it != endIt; ++it )
+  for( TextViewProcessor::ParagraphLayoutInfoContainer::const_iterator it = text.mParagraphsLayoutInfo.begin(), endIt = text.mParagraphsLayoutInfo.end(); it != endIt; ++it )
   {
     Print( *it );
   }
   std::cout << "||" << std::endl;
 }
 
-void Print( const TextStyle& style )
+std::string GetText( const TextViewProcessor::CharacterLayoutInfo& character )
 {
-  std::cout << " font name : " << style.GetFontName() << std::endl;
-  std::cout << " : " << style.GetFontStyle() << std::endl;
-  std::cout << " : " << style.GetFontPointSize() << std::endl;
-  std::cout << " : " << style.GetWeight() << std::endl;
-  std::cout << " : " << style.GetTextColor() << std::endl;
-  std::cout << " : " << style.IsItalicsEnabled() << std::endl;
-  std::cout << " : " << style.IsUnderlineEnabled() << std::endl;
-  std::cout << " : " << style.IsShadowEnabled() << std::endl;
-  std::cout << " : " << style.GetShadowColor() << std::endl;
-  std::cout << " : " << style.GetShadowOffset() << std::endl;
-  std::cout << " : " << style.IsGlowEnabled() << std::endl;
-  std::cout << " : " << style.GetGlowColor() << std::endl;
-  std::cout << " : " << style.GetGlowIntensity() << std::endl;
-  std::cout << " : " << style.GetSmoothEdge() << std::endl;
-  std::cout << " : " << style.IsOutlineEnabled() << std::endl;
-  std::cout << " : " << style.GetOutlineThickness() << std::endl;
+  return character.mStyledText.mText.GetText();
+}
+
+std::string GetText( const TextViewProcessor::WordLayoutInfo& word )
+{
+  std::string text;
+
+  for( TextViewProcessor::CharacterLayoutInfoContainer::const_iterator it = word.mCharactersLayoutInfo.begin(), endIt = word.mCharactersLayoutInfo.end(); it != endIt; ++it )
+  {
+    text += GetText( *it );
+  }
+
+  return text;
+}
+
+std::string GetText( const TextViewProcessor::ParagraphLayoutInfo& paragraph )
+{
+  std::string text;
+
+  for( TextViewProcessor::WordLayoutInfoContainer::const_iterator it = paragraph.mWordsLayoutInfo.begin(), endIt = paragraph.mWordsLayoutInfo.end(); it != endIt; ++it )
+  {
+    text += GetText( *it );
+  }
+
+  return text;
 }
 
 // Test functions used to check if two data structures are equal.
 
 bool TestEqual( float x, float y )
 {
-  return ( fabsf( x - y ) < Math::MACHINE_EPSILON_1000 );
+  return ( fabsf( x - y ) < 0.001f );
 }
 
 bool TestEqual( const TextViewProcessor::CharacterLayoutInfo& character1,
                 const TextViewProcessor::CharacterLayoutInfo& character2 )
 {
-  if( !TestEqual( character1.mHeight, character2.mHeight ) )
+  if( !TestEqual( character1.mSize.height, character2.mSize.height ) )
   {
     return false;
   }
-  if( !TestEqual( character1.mAdvance, character2.mAdvance ) )
+  if( !TestEqual( character1.mSize.width, character2.mSize.width ) )
   {
     return false;
   }
@@ -281,15 +247,6 @@ bool TestEqual( const TextViewProcessor::CharacterLayoutInfo& character1,
     return false;
   }
 
-  if( !TestEqual( character1.mSize.x, character2.mSize.x ) )
-  {
-    return false;
-  }
-  if( !TestEqual( character1.mSize.y, character2.mSize.y ) )
-  {
-    return false;
-  }
-
   if( !TestEqual( character1.mAscender, character2.mAscender ) )
   {
     return false;
@@ -344,6 +301,11 @@ bool TestEqual( const TextViewProcessor::CharacterLayoutInfo& character1,
 
   if( style1 != style2 )
   {
+    std::cout << "  style1 : " << std::endl;
+    TextViewProcessor::dbgPrint( style1 );
+
+    std::cout << "  style2 : " << std::endl;
+    TextViewProcessor::dbgPrint( style2 );
     return false;
   }
 
@@ -391,82 +353,35 @@ bool TestEqual( const TextViewProcessor::WordLayoutInfo& word1,
   return true;
 }
 
-bool TestEqual( const TextViewProcessor::WordGroupLayoutInfo& group1,
-                const TextViewProcessor::WordGroupLayoutInfo& group2 )
-{
-
-  if( group1.mNumberOfCharacters != group2.mNumberOfCharacters )
-  {
-    return false;
-  }
-
-  if( group1.mWordsLayoutInfo.size() != group2.mWordsLayoutInfo.size() )
-  {
-    return false;
-  }
-
-  if( !TestEqual( group1.mSize.x, group2.mSize.x ) )
-  {
-    return false;
-  }
-  if( !TestEqual( group1.mSize.y, group2.mSize.y ) )
-  {
-    return false;
-  }
-
-  if( !TestEqual( group1.mAscender, group2.mAscender ) )
-  {
-    return false;
-  }
-
-  if( group1.mDirection != group2.mDirection )
-  {
-    return false;
-  }
-
-  for( TextViewProcessor::WordLayoutInfoContainer::const_iterator it1 = group1.mWordsLayoutInfo.begin(), endIt1 = group1.mWordsLayoutInfo.end(),
-         it2 = group2.mWordsLayoutInfo.begin(), endIt2 = group2.mWordsLayoutInfo.end();
-       ( it1 != endIt1 ) && ( it2 != endIt2 );
-       ++it1, ++it2 )
-  {
-    if( !TestEqual( *it1, *it2 ) )
-    {
-      return false;
-    }
-  }
-
-  return true;
-}
-
-bool TestEqual( const TextViewProcessor::LineLayoutInfo& line1,
-                const TextViewProcessor::LineLayoutInfo& line2 )
+bool TestEqual( const TextViewProcessor::ParagraphLayoutInfo& paragraph1,
+                const TextViewProcessor::ParagraphLayoutInfo& paragraph2 )
 {
-  if( !TestEqual( line1.mSize.x, line2.mSize.x ) )
+  if( !TestEqual( paragraph1.mSize.x, paragraph2.mSize.x ) )
   {
     return false;
   }
-  if( !TestEqual( line1.mSize.y, line2.mSize.y ) )
+  if( !TestEqual( paragraph1.mSize.y, paragraph2.mSize.y ) )
   {
     return false;
   }
 
-  if( !TestEqual( line1.mAscender, line2.mAscender ) )
+  if( !TestEqual( paragraph1.mAscender, paragraph2.mAscender ) )
   {
     return false;
   }
 
-  if( line1.mNumberOfCharacters != line2.mNumberOfCharacters )
+  if( paragraph1.mNumberOfCharacters != paragraph2.mNumberOfCharacters )
   {
     return false;
   }
 
-  if( line1.mWordGroupsLayoutInfo.size() != line2.mWordGroupsLayoutInfo.size() )
+  if( paragraph1.mWordsLayoutInfo.size() != paragraph2.mWordsLayoutInfo.size() )
   {
     return false;
   }
 
-  for( TextViewProcessor::WordGroupLayoutInfoContainer::const_iterator it1 = line1.mWordGroupsLayoutInfo.begin(), endIt1 = line1.mWordGroupsLayoutInfo.end(),
-         it2 = line2.mWordGroupsLayoutInfo.begin(), endIt2 = line2.mWordGroupsLayoutInfo.end();
+  for( TextViewProcessor::WordLayoutInfoContainer::const_iterator it1 = paragraph1.mWordsLayoutInfo.begin(), endIt1 = paragraph1.mWordsLayoutInfo.end(),
+         it2 = paragraph2.mWordsLayoutInfo.begin(), endIt2 = paragraph2.mWordsLayoutInfo.end();
        ( it1 != endIt1 ) && ( it2 != endIt2 );
        ++it1, ++it2 )
   {
@@ -501,13 +416,13 @@ bool TestEqual( const TextViewProcessor::TextLayoutInfo& text1,
     return false;
   }
 
-  if( text1.mLinesLayoutInfo.size() != text2.mLinesLayoutInfo.size() )
+  if( text1.mParagraphsLayoutInfo.size() != text2.mParagraphsLayoutInfo.size() )
   {
     return false;
   }
 
-  for( TextViewProcessor::LineLayoutInfoContainer::const_iterator it1 = text1.mLinesLayoutInfo.begin(), endIt1 = text1.mLinesLayoutInfo.end(),
-         it2 = text2.mLinesLayoutInfo.begin(), endIt2 = text2.mLinesLayoutInfo.end();
+  for( TextViewProcessor::ParagraphLayoutInfoContainer::const_iterator it1 = text1.mParagraphsLayoutInfo.begin(), endIt1 = text1.mParagraphsLayoutInfo.end(),
+         it2 = text2.mParagraphsLayoutInfo.begin(), endIt2 = text2.mParagraphsLayoutInfo.end();
        ( it1 != endIt1 ) && ( it2 != endIt2 );
        ++it1, ++it2 )
   {
@@ -536,7 +451,7 @@ bool TestEqual( const TextViewProcessor::TextLayoutInfo& text1,
  */
 bool TestSplitWord( const std::string& description, const std::string& input, const size_t position, const std::string& firstResult, const std::string& lastResult, const char* location )
 {
-  tet_printf( "%s", description.c_str() );
+  tet_printf( "%s\n", description.c_str() );
 
   // Create layout info for the input word.
   Toolkit::Internal::TextView::RelayoutData relayoutData;
@@ -552,16 +467,12 @@ bool TestSplitWord( const std::string& description, const std::string& input, co
   // Get the input word
   TextViewProcessor::WordLayoutInfo inputWordLayout;
 
-  if( !inputLayout.mLinesLayoutInfo.empty() )
+  if( !inputLayout.mParagraphsLayoutInfo.empty() )
   {
-    const TextViewProcessor::LineLayoutInfo& line( *inputLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
+    const TextViewProcessor::ParagraphLayoutInfo& paragraph( *inputLayout.mParagraphsLayoutInfo.begin() );
+    if( !paragraph.mWordsLayoutInfo.empty() )
     {
-      const TextViewProcessor::WordGroupLayoutInfo& group( *line.mWordGroupsLayoutInfo.begin() );
-      if( !group.mWordsLayoutInfo.empty() )
-      {
-        inputWordLayout = *( *( *inputLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-      }
+      inputWordLayout = *( *inputLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
     }
   }
 
@@ -580,16 +491,12 @@ bool TestSplitWord( const std::string& description, const std::string& input, co
   // Get the first result word
   TextViewProcessor::WordLayoutInfo firstResultWordLayout;
 
-  if( !firstResultLayout.mLinesLayoutInfo.empty() )
+  if( !firstResultLayout.mParagraphsLayoutInfo.empty() )
   {
-    const TextViewProcessor::LineLayoutInfo& line( *firstResultLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
+   const TextViewProcessor::ParagraphLayoutInfo& paragraph( *firstResultLayout.mParagraphsLayoutInfo.begin() );
+    if( !paragraph.mWordsLayoutInfo.empty() )
     {
-      const TextViewProcessor::WordGroupLayoutInfo& group( *line.mWordGroupsLayoutInfo.begin() );
-      if( !group.mWordsLayoutInfo.empty() )
-      {
-        firstResultWordLayout = *( *( *firstResultLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-      }
+      firstResultWordLayout = *( *firstResultLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
     }
   }
 
@@ -608,16 +515,12 @@ bool TestSplitWord( const std::string& description, const std::string& input, co
   // Get the last result word
   TextViewProcessor::WordLayoutInfo lastResultWordLayout;
 
-  if( !lastResultLayout.mLinesLayoutInfo.empty() )
+  if( !lastResultLayout.mParagraphsLayoutInfo.empty() )
   {
-    const TextViewProcessor::LineLayoutInfo& line( *lastResultLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
+    const TextViewProcessor::ParagraphLayoutInfo& paragraph( *lastResultLayout.mParagraphsLayoutInfo.begin() );
+    if( !paragraph.mWordsLayoutInfo.empty() )
     {
-      const TextViewProcessor::WordGroupLayoutInfo& group( *line.mWordGroupsLayoutInfo.begin() );
-      if( !group.mWordsLayoutInfo.empty() )
-      {
-        lastResultWordLayout = *( *( *lastResultLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-      }
+      lastResultWordLayout = *( *lastResultLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
     }
   }
 
@@ -632,13 +535,13 @@ bool TestSplitWord( const std::string& description, const std::string& input, co
   // Test results
   if( !TestEqual( inputWordLayout, firstResultWordLayout ) )
   {
-    tet_printf( "Fail. different layout info. %s", location );
+    tet_printf( "Fail. different layout info. %s\n", location );
     return false;
   }
 
   if( !TestEqual( lastWordLayoutInfo, lastResultWordLayout ) )
   {
-    tet_printf( "Fail. different layout info. %s", location );
+    tet_printf( "Fail. different layout info. %s\n", location );
     return false;
   }
 
@@ -646,156 +549,33 @@ bool TestSplitWord( const std::string& description, const std::string& input, co
 }
 
 /**
- * Splits the \e input group of words in two by the given \e wordPosition and \e position and checks the results with \e firstResult and \e lastResult.
+ * Splits the \e input paragraph in two by the given \e wordIndex and \e characterIndex and checks the results with \e firstResult and \e lastResult.
  *
  * If the test fails it prints a short description and the line where this function was called.
  *
- * @param description Short description of the experiment. i.e. "Split the group of words from the beginning. (wordPosition 0 and position 0)".
+ * @param description Short description of the experiment. i.e. "Split the paragraph from the beginning. (wordIndex 0 and characterIndex 0)".
  * @param input The input word.
- * @param wordPosition Index to the word within the group where to split the group.
- * @param position Where to split the word.
- * @param firstResult First part of the split group of words.
- * @param lastResult Last part of the split group of words.
+ * @param wordIndex Index to the word within the paragraph where to split it.
+ * @param characterIndex Where to split the word.
+ * @param lineHeightOffset Offset between lines.
+ * @param firstResult First part of the split paragraph.
+ * @param lastResult Last part of the split paragraph.
  * @param location Where this function has been called.
  *
  * @return \e true if the experiment is successful. Otherwise returns \e false.
  */
-bool TestSplitWordGroup( const std::string& description,
+bool TestSplitParagraph( const std::string& description,
                          const std::string& input,
-                         const size_t wordPosition,
-                         const size_t position,
+                         size_t wordIndex,
+                         size_t characterIndex,
+                         float lineHeightOffset,
                          const std::string& firstResult,
                          const std::string& lastResult,
                          const char* location )
 {
-  tet_printf( "%s", description.c_str() );
+  tet_printf( "%s\n", description.c_str() );
 
-  // Create layout info for the input group of words.
-  Toolkit::Internal::TextView::RelayoutData relayoutData;
-  TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray inputStyledText;
-  MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( inputStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     relayoutData );
-
-  // Get the input group of words
-  TextViewProcessor::WordGroupLayoutInfo inputWordGroupLayout;
-
-  if( !inputLayout.mLinesLayoutInfo.empty() )
-  {
-    const TextViewProcessor::LineLayoutInfo& line( *inputLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
-    {
-      inputWordGroupLayout = *( *inputLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin();
-    }
-  }
-
-  // Create layout info for the first part of the result (after split the group of words)
-
-  Toolkit::Internal::TextView::RelayoutData firstRelayoutData;
-  TextViewProcessor::TextLayoutInfo& firstResultLayout( firstRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray firstResultStyledText;
-  MarkupProcessor::GetStyledTextArray( firstResult, firstResultStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( firstResultStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     firstRelayoutData );
-
-  // Get the first result group of words
-  TextViewProcessor::WordGroupLayoutInfo firstResultWordGroupLayout;
-
-  if( !firstResultLayout.mLinesLayoutInfo.empty() )
-  {
-    const TextViewProcessor::LineLayoutInfo& line( *firstResultLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
-    {
-      firstResultWordGroupLayout = *( *firstResultLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin();
-    }
-  }
-
-  // Create layout info for the last part of the result (after split the group of words)
-
-  Toolkit::Internal::TextView::RelayoutData lastRelayoutData;
-  TextViewProcessor::TextLayoutInfo& lastResultLayout( lastRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray lastResultStyledText;
-  MarkupProcessor::GetStyledTextArray( lastResult, lastResultStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( lastResultStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     lastRelayoutData );
-
-  // Get the last result group of words
-  TextViewProcessor::WordGroupLayoutInfo lastResultWordGroupLayout;
-
-  if( !lastResultLayout.mLinesLayoutInfo.empty() )
-  {
-    const TextViewProcessor::LineLayoutInfo& line( *lastResultLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
-    {
-      lastResultWordGroupLayout = *( *lastResultLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin();
-    }
-  }
-
-  // Split the group of words.
-
-  TextViewProcessor::WordGroupLayoutInfo lastWordGroupLayoutInfo;
-
-  TextViewProcessor::TextInfoIndices indices( 0, 0, wordPosition, position );
-  SplitWordGroup( indices,
-                  inputWordGroupLayout,
-                  lastWordGroupLayoutInfo );
-
-  // Test results
-  if( !TestEqual( inputWordGroupLayout, firstResultWordGroupLayout ) )
-  {
-    tet_printf( "Fail. different layout info. %s", location );
-    return false;
-  }
-
-  if( !TestEqual( lastWordGroupLayoutInfo, lastResultWordGroupLayout ) )
-  {
-    tet_printf( "Fail. different layout info. %s", location );
-    return false;
-  }
-
-  return true;
-}
-
-/**
- * Splits the \e input line in two by the given \e groupPosition, \e wordPosition and \e position and checks the results with \e firstResult and \e lastResult.
- *
- * If the test fails it prints a short description and the line where this function was called.
- *
- * @param description Short description of the experiment. i.e. "Split the line from the beginning. (groupPosition 0, wordPosition 0 and position 0)".
- * @param input The input word.
- * @param groupPosition Index to the group of words within the line where to split the line.
- * @param wordPosition Index to the word within the group where to split the group.
- * @param position Where to split the word.
- * @param lineHeightOffset Offset between lines.
- * @param firstResult First part of the split line.
- * @param lastResult Last part of the split line.
- * @param location Where this function has been called.
- *
- * @return \e true if the experiment is successful. Otherwise returns \e false.
- */
-bool TestSplitLine( const std::string& description,
-                    const std::string& input,
-                    const size_t groupPosition,
-                    const size_t wordPosition,
-                    const size_t position,
-                    const float lineHeightOffset,
-                    const std::string& firstResult,
-                    const std::string& lastResult,
-                    const char* location )
-{
-  tet_printf( "%s", description.c_str() );
-
-  // Create layout info for the input line.
+  // Create layout info for the input paragraph.
   Toolkit::Internal::TextView::RelayoutData relayoutData;
   TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
 
@@ -813,15 +593,15 @@ bool TestSplitLine( const std::string& description,
                                                                                     true ),
                                      relayoutData );
 
-  // Get the input line
-  TextViewProcessor::LineLayoutInfo inputLineLayout;
+  // Get the input paragraph
+  TextViewProcessor::ParagraphLayoutInfo inputParagraphLayout;
 
-  if( !inputLayout.mLinesLayoutInfo.empty() )
+  if( !inputLayout.mParagraphsLayoutInfo.empty() )
   {
-    inputLineLayout = *inputLayout.mLinesLayoutInfo.begin();
+    inputParagraphLayout = *inputLayout.mParagraphsLayoutInfo.begin();
   }
 
-  // Create layout info for the first part of the result (after split the line)
+  // Create layout info for the first part of the result (after split the paragraph)
 
   Toolkit::Internal::TextView::RelayoutData firstRelayoutData;
   TextViewProcessor::TextLayoutInfo& firstResultLayout( firstRelayoutData.mTextLayoutInfo );
@@ -840,15 +620,15 @@ bool TestSplitLine( const std::string& description,
                                                                                     true ),
                                      firstRelayoutData );
 
-  // Get the first result line
-  TextViewProcessor::LineLayoutInfo firstResultLineLayout;
+  // Get the first result paragraph
+  TextViewProcessor::ParagraphLayoutInfo firstResultParagraphLayout;
 
-  if( !firstResultLayout.mLinesLayoutInfo.empty() )
+  if( !firstResultLayout.mParagraphsLayoutInfo.empty() )
   {
-    firstResultLineLayout = *firstResultLayout.mLinesLayoutInfo.begin();
+    firstResultParagraphLayout = *firstResultLayout.mParagraphsLayoutInfo.begin();
   }
 
-  // Create layout info for the last part of the result (after split the line)
+  // Create layout info for the last part of the result (after split the paragraph)
 
   Toolkit::Internal::TextView::RelayoutData lastRelayoutData;
   TextViewProcessor::TextLayoutInfo& lastResultLayout( lastRelayoutData.mTextLayoutInfo );
@@ -867,34 +647,35 @@ bool TestSplitLine( const std::string& description,
                                                                                     true ),
                                      lastRelayoutData );
 
-  // Get the last result line
-  TextViewProcessor::LineLayoutInfo lastResultLineLayout;
+  // Get the last result paragraph
+  TextViewProcessor::ParagraphLayoutInfo lastResultParagraphLayout;
 
-  if( !lastResultLayout.mLinesLayoutInfo.empty() )
+  if( !lastResultLayout.mParagraphsLayoutInfo.empty() )
   {
-    lastResultLineLayout = *lastResultLayout.mLinesLayoutInfo.begin();
+    lastResultParagraphLayout = *lastResultLayout.mParagraphsLayoutInfo.begin();
   }
 
-  // Split the line.
+  // Split the paragraph.
+
+  TextViewProcessor::ParagraphLayoutInfo lastParagraphLayoutInfo;
 
-  TextViewProcessor::LineLayoutInfo lastLineLayoutInfo;
+  TextViewProcessor::TextInfoIndices indices( 0, wordIndex, characterIndex );
 
-  TextViewProcessor::TextInfoIndices indices( 0, groupPosition, wordPosition, position );
-  SplitLine( indices,
-             PointSize( lineHeightOffset ),
-             inputLineLayout,
-             lastLineLayoutInfo );
+  SplitParagraph( indices,
+                  PointSize( lineHeightOffset ),
+                  inputParagraphLayout,
+                  lastParagraphLayoutInfo );
 
   // Test results
-  if( !TestEqual( inputLineLayout, firstResultLineLayout ) )
+  if( !TestEqual( inputParagraphLayout, firstResultParagraphLayout ) )
   {
-    tet_printf( "Fail. different layout info. %s", location );
+    tet_printf( "Fail. different first layout info. %s\n", location );
     return false;
   }
 
-  if( !TestEqual( lastLineLayoutInfo, lastResultLineLayout ) )
+  if( !TestEqual( lastParagraphLayoutInfo, lastResultParagraphLayout ) )
   {
-    tet_printf( "Fail. different layout info. %s", location );
+    tet_printf( "Fail. different last layout info. %s\n", location );
     return false;
   }
 
@@ -916,7 +697,7 @@ bool TestSplitLine( const std::string& description,
  */
 bool TestMergeWords( const std::string& description, const std::string& inputFirst, const std::string& inputLast, const std::string& result, const char* location )
 {
-  tet_printf( "%s", description.c_str() );
+  tet_printf( "%s\n", description.c_str() );
 
   // Create layout info for the inputFirst word.
   Toolkit::Internal::TextView::RelayoutData firstRelayoutData;
@@ -932,16 +713,12 @@ bool TestMergeWords( const std::string& description, const std::string& inputFir
   // Get the input word
   TextViewProcessor::WordLayoutInfo inputFirstWordLayout;
 
-  if( !inputFirstLayout.mLinesLayoutInfo.empty() )
+  if( !inputFirstLayout.mParagraphsLayoutInfo.empty() )
   {
-    const TextViewProcessor::LineLayoutInfo& line( *inputFirstLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
+    const TextViewProcessor::ParagraphLayoutInfo& paragraph( *inputFirstLayout.mParagraphsLayoutInfo.begin() );
+    if( !paragraph.mWordsLayoutInfo.empty() )
     {
-      const TextViewProcessor::WordGroupLayoutInfo& group( *line.mWordGroupsLayoutInfo.begin() );
-      if( !group.mWordsLayoutInfo.empty() )
-      {
-        inputFirstWordLayout = *( *( *inputFirstLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-      }
+      inputFirstWordLayout = *( *inputFirstLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
     }
   }
 
@@ -959,16 +736,12 @@ bool TestMergeWords( const std::string& description, const std::string& inputFir
   // Get the input word
   TextViewProcessor::WordLayoutInfo inputLastWordLayout;
 
-  if( !inputLastLayout.mLinesLayoutInfo.empty() )
+  if( !inputLastLayout.mParagraphsLayoutInfo.empty() )
   {
-    const TextViewProcessor::LineLayoutInfo& line( *inputLastLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
+    const TextViewProcessor::ParagraphLayoutInfo& paragraph( *inputLastLayout.mParagraphsLayoutInfo.begin() );
+    if( !paragraph.mWordsLayoutInfo.empty() )
     {
-      const TextViewProcessor::WordGroupLayoutInfo& group( *line.mWordGroupsLayoutInfo.begin() );
-      if( !group.mWordsLayoutInfo.empty() )
-      {
-        inputLastWordLayout = *( *( *inputLastLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-      }
+      inputLastWordLayout = *( *inputLastLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
     }
   }
 
@@ -986,16 +759,12 @@ bool TestMergeWords( const std::string& description, const std::string& inputFir
   // Get the result word
   TextViewProcessor::WordLayoutInfo resultWordLayout;
 
-  if( !resultLayout.mLinesLayoutInfo.empty() )
+  if( !resultLayout.mParagraphsLayoutInfo.empty() )
   {
-    const TextViewProcessor::LineLayoutInfo& line( *resultLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
+    const TextViewProcessor::ParagraphLayoutInfo& paragraph( *resultLayout.mParagraphsLayoutInfo.begin() );
+    if( !paragraph.mWordsLayoutInfo.empty() )
     {
-      const TextViewProcessor::WordGroupLayoutInfo& group( *line.mWordGroupsLayoutInfo.begin() );
-      if( !group.mWordsLayoutInfo.empty() )
-      {
-        resultWordLayout = *( *( *resultLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-      }
+      resultWordLayout = *( *resultLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
     }
   }
 
@@ -1004,7 +773,7 @@ bool TestMergeWords( const std::string& description, const std::string& inputFir
 
   if( !TestEqual( inputFirstWordLayout, resultWordLayout ) )
   {
-    tet_printf( "Fail. different layout info. %s", location );
+    tet_printf( "Fail. different layout info. %s\n", location );
     return false;
   }
 
@@ -1012,122 +781,24 @@ bool TestMergeWords( const std::string& description, const std::string& inputFir
 }
 
 /**
- * Merges the \e inputFirst group of words and the \e inputLast group of words, and checks the results with \e result.
+ * Merges the \e inputFirst paragraph and the \e inputLast paragraph, and checks the results with \e result.
  *
  * If the test fails it prints a short description and the line where this function was called.
  *
  * @param description Short description of the experiment.
- * @param inputFirst The first part of the group of words.
- * @param inputLast The last part of the group of words.
- * @param result The merged group of word.
- * @param location Where this function has been called.
- *
- * @return \e true if the experiment is successful. Otherwise returns \e false.
- */
-bool TestMergeGroupsOfWords( const std::string& description, const std::string& inputFirst, const std::string& inputLast, const std::string& result, const char* location )
-{
-  tet_printf( "%s", description.c_str() );
-
-  // Create layout info for the inputFirst group of word.
-  Toolkit::Internal::TextView::RelayoutData firstRelayoutData;
-  TextViewProcessor::TextLayoutInfo& inputFirstLayout( firstRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray inputFirstStyledText;
-  MarkupProcessor::GetStyledTextArray( inputFirst, inputFirstStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( inputFirstStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     firstRelayoutData );
-
-  // Get the input group of words.
-  TextViewProcessor::WordGroupLayoutInfo inputFirstWordGroupLayout;
-
-  if( !inputFirstLayout.mLinesLayoutInfo.empty() )
-  {
-    const TextViewProcessor::LineLayoutInfo& line( *inputFirstLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
-    {
-      inputFirstWordGroupLayout = *( *inputFirstLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin();
-    }
-  }
-
-  // Create layout info for the inputLast group of words.
-  Toolkit::Internal::TextView::RelayoutData lastRelayoutData;
-  TextViewProcessor::TextLayoutInfo& inputLastLayout( lastRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray inputLastStyledText;
-  MarkupProcessor::GetStyledTextArray( inputLast, inputLastStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( inputLastStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     lastRelayoutData );
-
-  // Get the input group of words
-  TextViewProcessor::WordGroupLayoutInfo inputLastWordGroupLayout;
-
-  if( !inputLastLayout.mLinesLayoutInfo.empty() )
-  {
-    const TextViewProcessor::LineLayoutInfo& line( *inputLastLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
-    {
-      inputLastWordGroupLayout = *( *inputLastLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin();
-    }
-  }
-
-  // Create layout info for the result group of words.
-  Toolkit::Internal::TextView::RelayoutData resultRelayoutData;
-  TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray resultStyledText;
-  MarkupProcessor::GetStyledTextArray( result, resultStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( resultStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     resultRelayoutData );
-
-  // Get the result word
-  TextViewProcessor::WordGroupLayoutInfo resultWordGroupLayout;
-
-  if( !resultLayout.mLinesLayoutInfo.empty() )
-  {
-    const TextViewProcessor::LineLayoutInfo& line( *resultLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
-    {
-      resultWordGroupLayout = *( *resultLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin();
-    }
-  }
-
-  MergeWordGroup( inputFirstWordGroupLayout,
-                  inputLastWordGroupLayout );
-
-  if( !TestEqual( inputFirstWordGroupLayout, resultWordGroupLayout ) )
-  {
-    tet_printf( "Fail. different layout info. %s", location );
-    return false;
-  }
-
-  return true;
-}
-
-/**
- * Merges the \e inputFirst line and the \e inputLast line, and checks the results with \e result.
- *
- * If the test fails it prints a short description and the line where this function was called.
- *
- * @param description Short description of the experiment.
- * @param inputFirst The first part of the line.
- * @param inputLast The last part of the line.
+ * @param inputFirst The first part of the paragraph.
+ * @param inputLast The last part of the paragraph.
  * @param lineHeightOffset Offset between lines.
- * @param result The merged line.
+ * @param result The merged paragraph.
  * @param location Where this function has been called.
  *
  * @return \e true if the experiment is successful. Otherwise returns \e false.
  */
-bool TestMergeLines( const std::string& description, const std::string& inputFirst, const std::string& inputLast, const float lineHeightOffset, const std::string& result, const char* location )
+bool TestMergeParagraphs( const std::string& description, const std::string& inputFirst, const std::string& inputLast, const float lineHeightOffset, const std::string& result, const char* location )
 {
-  tet_printf( "%s", description.c_str() );
+  tet_printf( "%s\n", description.c_str() );
 
-  // Create layout info for the inputFirst line.
+  // Create layout info for the inputFirst paragraph.
   Toolkit::Internal::TextView::RelayoutData firstRelayoutData;
   TextViewProcessor::TextLayoutInfo& inputFirstLayout( firstRelayoutData.mTextLayoutInfo );
 
@@ -1146,14 +817,14 @@ bool TestMergeLines( const std::string& description, const std::string& inputFir
                                      firstRelayoutData );
 
   // Get the input word
-  TextViewProcessor::LineLayoutInfo inputFirstLineLayout;
+  TextViewProcessor::ParagraphLayoutInfo inputFirstParagraphLayout;
 
-  if( !inputFirstLayout.mLinesLayoutInfo.empty() )
+  if( !inputFirstLayout.mParagraphsLayoutInfo.empty() )
   {
-    inputFirstLineLayout = *inputFirstLayout.mLinesLayoutInfo.begin();
+    inputFirstParagraphLayout = *inputFirstLayout.mParagraphsLayoutInfo.begin();
   }
 
-  // Create layout info for the inputLast line.
+  // Create layout info for the inputLast paragraph.
   Toolkit::Internal::TextView::RelayoutData lastRelayoutData;
   TextViewProcessor::TextLayoutInfo& inputLastLayout( lastRelayoutData.mTextLayoutInfo );
 
@@ -1172,11 +843,11 @@ bool TestMergeLines( const std::string& description, const std::string& inputFir
                                      lastRelayoutData );
 
   // Get the input word
-  TextViewProcessor::LineLayoutInfo inputLastLineLayout;
+  TextViewProcessor::ParagraphLayoutInfo inputLastParagraphLayout;
 
-  if( !inputLastLayout.mLinesLayoutInfo.empty() )
+  if( !inputLastLayout.mParagraphsLayoutInfo.empty() )
   {
-    inputLastLineLayout = *inputLastLayout.mLinesLayoutInfo.begin();
+    inputLastParagraphLayout = *inputLastLayout.mParagraphsLayoutInfo.begin();
   }
 
   // Create layout info for the result word.
@@ -1198,19 +869,19 @@ bool TestMergeLines( const std::string& description, const std::string& inputFir
                                      resultRelayoutData );
 
   // Get the result word
-  TextViewProcessor::LineLayoutInfo resultLineLayout;
+  TextViewProcessor::ParagraphLayoutInfo resultParagraphLayout;
 
-  if( !resultLayout.mLinesLayoutInfo.empty() )
+  if( !resultLayout.mParagraphsLayoutInfo.empty() )
   {
-    resultLineLayout = *resultLayout.mLinesLayoutInfo.begin();
+    resultParagraphLayout = *resultLayout.mParagraphsLayoutInfo.begin();
   }
 
-  MergeLine( inputFirstLineLayout,
-             inputLastLineLayout );
+  MergeParagraph( inputFirstParagraphLayout,
+                  inputLastParagraphLayout );
 
-  if( !TestEqual( inputFirstLineLayout, resultLineLayout ) )
+  if( !TestEqual( inputFirstParagraphLayout, resultParagraphLayout ) )
   {
-    tet_printf( "Fail. different layout info. %s", location );
+    tet_printf( "Fail. different layout info. %s\n", location );
     return false;
   }
 
@@ -1222,7 +893,7 @@ bool TestMergeLines( const std::string& description, const std::string& inputFir
  *
  * If the test fails it prints a short description and the line where this function was called.
  *
- * @param description Short description of the experiment. i.e. "Remove a whole group of characters. Merge".
+ * @param description Short description of the experiment. i.e. "Remove a whole word. Merge".
  * @param input The input word.
  * @param position Where to start to remove characters
  * @param numberOfCharacters The number of characters to remove.
@@ -1233,7 +904,7 @@ bool TestMergeLines( const std::string& description, const std::string& inputFir
  */
 bool TestRemoveCharactersFromWord( const std::string& description, const std::string& input, const std::size_t position, const std::size_t numberOfCharacters, const std::string& result, const char* location )
 {
-  tet_printf( "%s", description.c_str() );
+  tet_printf( "%s\n", description.c_str() );
 
   // Create layout info for the input word.
   Toolkit::Internal::TextView::RelayoutData relayoutData;
@@ -1249,16 +920,12 @@ bool TestRemoveCharactersFromWord( const std::string& description, const std::st
   // Get the input word
   TextViewProcessor::WordLayoutInfo inputWordLayout;
 
-  if( !inputLayout.mLinesLayoutInfo.empty() )
+  if( !inputLayout.mParagraphsLayoutInfo.empty() )
   {
-    const TextViewProcessor::LineLayoutInfo& line( *inputLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
+    const TextViewProcessor::ParagraphLayoutInfo& paragraph( *inputLayout.mParagraphsLayoutInfo.begin() );
+    if( !paragraph.mWordsLayoutInfo.empty() )
     {
-      const TextViewProcessor::WordGroupLayoutInfo& group( *line.mWordGroupsLayoutInfo.begin() );
-      if( !group.mWordsLayoutInfo.empty() )
-      {
-        inputWordLayout = *( *( *inputLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-      }
+      inputWordLayout = *( *inputLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
     }
   }
 
@@ -1276,16 +943,12 @@ bool TestRemoveCharactersFromWord( const std::string& description, const std::st
   // Get the result word
   TextViewProcessor::WordLayoutInfo resultWordLayout;
 
-  if( !resultLayout.mLinesLayoutInfo.empty() )
+  if( !resultLayout.mParagraphsLayoutInfo.empty() )
   {
-    const TextViewProcessor::LineLayoutInfo& line( *resultLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
+    const TextViewProcessor::ParagraphLayoutInfo& paragraph( *resultLayout.mParagraphsLayoutInfo.begin() );
+    if( !paragraph.mWordsLayoutInfo.empty() )
     {
-      const TextViewProcessor::WordGroupLayoutInfo& group( *line.mWordGroupsLayoutInfo.begin() );
-      if( !group.mWordsLayoutInfo.empty() )
-      {
-        resultWordLayout = *( *( *resultLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-      }
+      resultWordLayout = *( *resultLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
     }
   }
 
@@ -1295,7 +958,7 @@ bool TestRemoveCharactersFromWord( const std::string& description, const std::st
 
   if( !TestEqual( inputWordLayout, resultWordLayout ) )
   {
-    tet_printf( "Fail. different layout info. %s", location );
+    tet_printf( "Fail. different layout info. %s\n", location );
     return false;
   }
 
@@ -1303,103 +966,25 @@ bool TestRemoveCharactersFromWord( const std::string& description, const std::st
 }
 
 /**
- * Removes from the \e input group of words the \e numberOfWords words starting from the given \e wordIndex and checks the results with \e result.
+ * Removes from the \e input paragraph the \e numberOfWords words starting from the given \e wordIndex and checks the results with \e result.
  *
  * If the test fails it prints a short description and the line where this function was called.
  *
  * @param description Short description of the experiment.
- * @param input The input group of words.
- * @param wordIndex Where to start to remove words.
+ * @param input The input paragraph.
+ * @param wordIndex Index within the paragraph where to start to remove words.
  * @param numberOfWords The number of words to remove.
- * @param result The group of words without the removed words.
- * @param location Where this function has been called.
- *
- * @return \e true if the experiment is successful. Otherwise returns \e false.
- */
-bool TestRemoveWordsFromGroup( const std::string& description, const std::string& input, const std::size_t wordIndex, const std::size_t numberOfWords, const std::string& result, const char* location )
-{
-  tet_printf( "%s", description.c_str() );
-
-  // Create layout info for the input group of words.
-  Toolkit::Internal::TextView::RelayoutData relayoutData;
-  TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray inputStyledText;
-  MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( inputStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     relayoutData );
-
-  // Get the input group of words
-  TextViewProcessor::WordGroupLayoutInfo inputWordGroupLayout;
-
-  if( !inputLayout.mLinesLayoutInfo.empty() )
-  {
-    const TextViewProcessor::LineLayoutInfo& line( *inputLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
-    {
-      inputWordGroupLayout = *( *inputLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin();
-    }
-  }
-
-  // Create layout info for the result group of words.
-  Toolkit::Internal::TextView::RelayoutData resultRelayoutData;
-  TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray resultStyledText;
-  MarkupProcessor::GetStyledTextArray( result, resultStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( resultStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     resultRelayoutData );
-
-  // Get the result group of words.
-  TextViewProcessor::WordGroupLayoutInfo resultWordGroupLayout;
-
-  if( !resultLayout.mLinesLayoutInfo.empty() )
-  {
-    const TextViewProcessor::LineLayoutInfo& line( *resultLayout.mLinesLayoutInfo.begin() );
-    if( !line.mWordGroupsLayoutInfo.empty() )
-    {
-      resultWordGroupLayout = *( *resultLayout.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin();
-    }
-  }
-
-  RemoveWordsFromWordGroup( wordIndex,
-                            numberOfWords,
-                            inputWordGroupLayout );
-
-  if( !TestEqual( inputWordGroupLayout, resultWordGroupLayout ) )
-  {
-    tet_printf( "Fail. different layout info. %s", location );
-    return false;
-  }
-
-  return true;
-}
-
-
-/**
- * Removes from the \e input line the \e numberOfGroups groups of words starting from the given \e groupIndex and checks the results with \e result.
- *
- * If the test fails it prints a short description and the line where this function was called.
- *
- * @param description Short description of the experiment.
- * @param input The input line.
- * @param groupIndex Where to start to remove groups of words
- * @param numberOfGroups The number of groups of words to remove.
  * @param lineHeightOffset Offset between lines.
- * @param result The line without the removed groups of words.
+ * @param result The paragraph without the removed words.
  * @param location Where this function has been called.
  *
  * @return \e true if the experiment is successful. Otherwise returns \e false.
  */
-bool TestRemoveGroupsFromLine( const std::string& description, const std::string& input, const std::size_t groupIndex, const std::size_t numberOfGroups, const float lineHeightOffset, const std::string& result, const char* location )
+bool TestRemoveWordsFromParagraph( const std::string& description, const std::string& input, const std::size_t wordIndex, const std::size_t numberOfWords, const float lineHeightOffset, const std::string& result, const char* location )
 {
-  tet_printf( "%s", description.c_str() );
+  tet_printf( "%s\n", description.c_str() );
 
-  // Create layout info for the input line.
+  // Create layout info for the input paragraph.
   Toolkit::Internal::TextView::RelayoutData relayoutData;
   TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
 
@@ -1417,15 +1002,15 @@ bool TestRemoveGroupsFromLine( const std::string& description, const std::string
                                                                                     true ),
                                      relayoutData );
 
-  // Get the input line
-  TextViewProcessor::LineLayoutInfo inputLineLayout;
+  // Get the input paragraph
+  TextViewProcessor::ParagraphLayoutInfo inputParagraphLayout;
 
-  if( !inputLayout.mLinesLayoutInfo.empty() )
+  if( !inputLayout.mParagraphsLayoutInfo.empty() )
   {
-    inputLineLayout = *inputLayout.mLinesLayoutInfo.begin();
+    inputParagraphLayout = *inputLayout.mParagraphsLayoutInfo.begin();
   }
 
-  // Create layout info for the result line.
+  // Create layout info for the result paragraph.
   Toolkit::Internal::TextView::RelayoutData resultRelayoutData;
   TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
 
@@ -1443,22 +1028,28 @@ bool TestRemoveGroupsFromLine( const std::string& description, const std::string
                                                                                     true ),
                                      resultRelayoutData );
 
-  // Get the result line
-  TextViewProcessor::LineLayoutInfo resultLineLayout;
+  // Get the result paragraph
+  TextViewProcessor::ParagraphLayoutInfo resultParagraphLayout;
 
-  if( !resultLayout.mLinesLayoutInfo.empty() )
+  if( !resultLayout.mParagraphsLayoutInfo.empty() )
   {
-    resultLineLayout = *resultLayout.mLinesLayoutInfo.begin();
+    resultParagraphLayout = *resultLayout.mParagraphsLayoutInfo.begin();
   }
 
-  RemoveWordGroupsFromLine( groupIndex,
-                            numberOfGroups,
-                            PointSize( lineHeightOffset ),
-                            inputLineLayout );
+  RemoveWordsFromParagraph( wordIndex,
+                            numberOfWords,
+                            lineHeightOffset,
+                            inputParagraphLayout );
 
-  if( !TestEqual( inputLineLayout, resultLineLayout ) )
+  if( !TestEqual( inputParagraphLayout, resultParagraphLayout ) )
   {
-    tet_printf( "Fail. different layout info. %s", location );
+    tet_printf( "Fail. different layout info. %s\n", location );
+    tet_printf( "            input : [%s]\n", input.c_str() );
+    tet_printf( "           result : [%s]\n", GetText( resultParagraphLayout ).c_str() );
+    tet_printf( "  expected result : [%s]\n\n", result.c_str() );
+
+    Print(inputParagraphLayout); std::cout << std::endl << std::endl;
+    Print(resultParagraphLayout); std::cout << std::endl;
     return false;
   }
 
@@ -1483,16 +1074,16 @@ bool TestRemoveGroupsFromLine( const std::string& description, const std::string
  * @return \e true if the experiment is successful. Otherwise returns \e false.
  */
 bool TestUpdateTextInfo( const std::string& description,
-                         const UpdateTextInfoOperation operation,
+                         UpdateTextInfoOperation operation,
                          const std::string& input,
-                         const std::size_t position,
-                         const std::size_t numberOfCharacters,
+                         std::size_t position,
+                         std::size_t numberOfCharacters,
                          const std::string& inputText,
-                         const float lineHeightOffset,
+                         float lineHeightOffset,
                          const std::string& result,
                          const char* location )
 {
-  tet_printf( "%s", description.c_str() );
+  tet_printf( "%s\n", description.c_str() );
 
   // Create layout info for the input.
   Toolkit::Internal::TextView::RelayoutData relayoutData;
@@ -1576,17 +1167,17 @@ bool TestUpdateTextInfo( const std::string& description,
     }
     default:
     {
-      tet_printf( "TestUpdateTextInfo: unknown update operation. %s", location );
+      tet_printf( "TestUpdateTextInfo: unknown update operation. %s\n", location );
       return false;
     }
   }
 
   if( !TestEqual( inputLayout, resultLayout ) )
   {
-    tet_printf( "Fail. different layout info. %s", location );
+    tet_printf( "Fail. different layout info. %s\n", location );
 
-    std::cout << "          result : "; Print( inputLayout );
-    std::cout << " expected result : "; Print( resultLayout );
+    // std::cout << "          result : "; Print( inputLayout );
+    // std::cout << " expected result : "; Print( resultLayout );
     return false;
   }
 
@@ -1622,13 +1213,11 @@ int UtcDaliTextViewCreateTextInfo(void)
   //  bearing : 11.9492
   // ascender : 11.9492
 
-  const float WIDTH_10( 9.48351f );
   const float HEIGHT_10( 9.48351f );
   const float ADVANCE_10( 9.48351f );
   const float BEARING_10( 8.53516f );
   const float ASCENDER_10( 8.53516f );
 
-  const float WIDTH_12( 11.3802f );
   const float HEIGHT_12( 11.3802f );
   const float ADVANCE_12( 11.3802f );
   const float BEARING_12( 10.2422f );
@@ -1655,22 +1244,21 @@ int UtcDaliTextViewCreateTextInfo(void)
   // Characters
 
   TextViewProcessor::CharacterLayoutInfo layoutInfo10; // ( [lo wo])
-  layoutInfo10.mHeight = HEIGHT_10;
-  layoutInfo10.mAdvance = ADVANCE_10;
+  layoutInfo10.mSize.height = HEIGHT_10;
+  layoutInfo10.mSize.width = ADVANCE_10;
   layoutInfo10.mBearing = BEARING_10;
-  layoutInfo10.mSize = Size( WIDTH_10, HEIGHT_10 );
   layoutInfo10.mAscender = ASCENDER_10;
   TextViewProcessor::CharacterLayoutInfo layoutInfo12; // ( [Hel], [rld!] and [CR])
-  layoutInfo12.mHeight = HEIGHT_12;
-  layoutInfo12.mAdvance = ADVANCE_12;
+  layoutInfo12.mSize.height = HEIGHT_12;
+  layoutInfo12.mSize.width = ADVANCE_12;
   layoutInfo12.mBearing = BEARING_12;
-  layoutInfo12.mSize = Size( WIDTH_12, HEIGHT_12 );
   layoutInfo12.mAscender = ASCENDER_12;
 
   TextStyle style10;
+  style10.SetFontName( "" );
   style10.SetFontPointSize( PointSize( 10.f ) );
   TextStyle style12;
-  style12.SetFontPointSize( PointSize( 0.f ) ); // point size is set to zero because is a default point size.
+  style12.SetFontName( "" );
 
   layoutInfo12.mStyledText.mStyle = style12;
   layoutInfo10.mStyledText.mStyle = style10;
@@ -1680,7 +1268,7 @@ int UtcDaliTextViewCreateTextInfo(void)
   TextViewProcessor::WordLayoutInfo wordLayout1, wordLayout2, wordLayout3, wordLayout4;
 
   // Hello
-  wordLayout1.mSize = Size( 3.f * WIDTH_12 + 2.f * WIDTH_10, HEIGHT_12 );
+  wordLayout1.mSize = Size( 3.f * ADVANCE_12 + 2.f * ADVANCE_10, HEIGHT_12 );
   wordLayout1.mAscender = ASCENDER_12;
   wordLayout1.mType = TextViewProcessor::NoSeparator;
 
@@ -1696,14 +1284,14 @@ int UtcDaliTextViewCreateTextInfo(void)
   wordLayout1.mCharactersLayoutInfo.push_back( layoutInfo10 ); // o
 
   // (white space)
-  wordLayout2.mSize = Size( WIDTH_10, HEIGHT_10 );
+  wordLayout2.mSize = Size( ADVANCE_10, HEIGHT_10 );
   wordLayout2.mAscender = ASCENDER_10;
   wordLayout2.mType = TextViewProcessor::WordSeparator;
   layoutInfo10.mStyledText.mText = Text( " " );
   wordLayout2.mCharactersLayoutInfo.push_back( layoutInfo10 ); // (white space)
 
   // world!
-  wordLayout3.mSize = Size( 2.f * WIDTH_10 + 4.f * WIDTH_12, HEIGHT_12 );
+  wordLayout3.mSize = Size( 2.f * ADVANCE_10 + 4.f * ADVANCE_12, HEIGHT_12 );
   wordLayout3.mAscender = ASCENDER_12;
   wordLayout3.mType = TextViewProcessor::NoSeparator;
   layoutInfo10.mStyledText.mText = Text( "w" );
@@ -1719,58 +1307,42 @@ int UtcDaliTextViewCreateTextInfo(void)
   layoutInfo12.mStyledText.mText = Text( "!" );
   wordLayout3.mCharactersLayoutInfo.push_back( layoutInfo12 ); // !
 
-  // (new line character)
+  // (new paragraph character)
   wordLayout4.mSize = Size( 0.f, HEIGHT_12 );
   wordLayout4.mAscender = ASCENDER_12;
-  wordLayout4.mType = TextViewProcessor::LineSeparator;
+  wordLayout4.mType = TextViewProcessor::ParagraphSeparator;
   layoutInfo12.mStyledText.mText = Text( "\n" );
   layoutInfo12.mSize.width = 0.f;
-  wordLayout4.mCharactersLayoutInfo.push_back( layoutInfo12 ); // (new line char)
-
-  // Groups
-
-  TextViewProcessor::WordGroupLayoutInfo groupLayout1, groupLayout2;
+  wordLayout4.mCharactersLayoutInfo.push_back( layoutInfo12 ); // (new paragraph char)
 
-  groupLayout1.mSize = Size( 5.f * WIDTH_10 + 7.f * WIDTH_12, HEIGHT_12 );
-  groupLayout1.mAscender = ASCENDER_12;
-  groupLayout1.mDirection = TextViewProcessor::LTR;
-  groupLayout1.mNumberOfCharacters = 13;
-  groupLayout1.mWordsLayoutInfo.push_back( wordLayout1 );
-  groupLayout1.mWordsLayoutInfo.push_back( wordLayout2 );
-  groupLayout1.mWordsLayoutInfo.push_back( wordLayout3 );
-  groupLayout1.mWordsLayoutInfo.push_back( wordLayout4 );
+  // Paragraphs
 
-  groupLayout2.mSize = Size( 0.f, HEIGHT_12 );
-  groupLayout2.mAscender = ASCENDER_12;
-  groupLayout2.mDirection = TextViewProcessor::LTR;
-  groupLayout2.mNumberOfCharacters = 1;
-  groupLayout2.mWordsLayoutInfo.push_back( wordLayout4 );
+  TextViewProcessor::ParagraphLayoutInfo paragraphLayout1, paragraphLayout2, paragraphLayout3;
 
-  // Lines
+  paragraphLayout1.mSize = Size( 5.f * ADVANCE_10 + 7.f * ADVANCE_12, HEIGHT_12 );
+  paragraphLayout1.mAscender = ASCENDER_12;
+  paragraphLayout1.mNumberOfCharacters = 13;
+  paragraphLayout1.mWordsLayoutInfo.push_back( wordLayout1 );
+  paragraphLayout1.mWordsLayoutInfo.push_back( wordLayout2 );
+  paragraphLayout1.mWordsLayoutInfo.push_back( wordLayout3 );
+  paragraphLayout1.mWordsLayoutInfo.push_back( wordLayout4 );
 
-  TextViewProcessor::LineLayoutInfo lineLayout1, lineLayout2, lineLayout3;
+  paragraphLayout2.mSize = Size( 0.f, HEIGHT_12 );
+  paragraphLayout2.mAscender = ASCENDER_12;
+  paragraphLayout2.mNumberOfCharacters = 1;
+  paragraphLayout2.mWordsLayoutInfo.push_back( wordLayout4 );
 
-  lineLayout1.mSize = Size( 5.f * WIDTH_10 + 7.f * WIDTH_12, HEIGHT_12 );
-  lineLayout1.mAscender = ASCENDER_12;
-  lineLayout1.mNumberOfCharacters = 13;
-  lineLayout1.mWordGroupsLayoutInfo.push_back( groupLayout1 );
-
-  lineLayout2.mSize = Size( 0.f, HEIGHT_12 );
-  lineLayout2.mAscender = ASCENDER_12;
-  lineLayout2.mNumberOfCharacters = 1;
-  lineLayout2.mWordGroupsLayoutInfo.push_back( groupLayout2 );
-
-  lineLayout3.mSize = Size( 0.f, HEIGHT_12 );
+  paragraphLayout3.mSize = Size( 0.f, HEIGHT_12 );
 
   // Text (layout)
   TextViewProcessor::TextLayoutInfo textLayout;
 
-  textLayout.mWholeTextSize = Size( 5.f * WIDTH_10 + 7.f * WIDTH_12, 3.f * HEIGHT_12 );
-  textLayout.mMaxWordWidth = 2.f * WIDTH_10 + 4.f * WIDTH_12;
+  textLayout.mWholeTextSize = Size( 5.f * ADVANCE_10 + 7.f * ADVANCE_12, 3.f * HEIGHT_12 );
+  textLayout.mMaxWordWidth = 2.f * ADVANCE_10 + 4.f * ADVANCE_12;
   textLayout.mNumberOfCharacters = 14;
-  textLayout.mLinesLayoutInfo.push_back( lineLayout1 );
-  textLayout.mLinesLayoutInfo.push_back( lineLayout2 );
-  textLayout.mLinesLayoutInfo.push_back( lineLayout3 );
+  textLayout.mParagraphsLayoutInfo.push_back( paragraphLayout1 );
+  textLayout.mParagraphsLayoutInfo.push_back( paragraphLayout2 );
+  textLayout.mParagraphsLayoutInfo.push_back( paragraphLayout3 );
 
   if(!TestEqual( textLayout, textLayoutInfo ))
   {
@@ -1827,9 +1399,9 @@ int UtcDaliTextViewSplitWord(void)
       std::string( "<font size='10'>oooo</font>" ),
     },
   };
-  const std::size_t numberOfTests( 5 );
+  const std::size_t numberOfTests( 5u );
 
-  for( std::size_t index = 0; index < numberOfTests; ++index )
+  for( std::size_t index = 0u; index < numberOfTests; ++index )
   {
     const SplitWordTest& test = splitWordTests[index];
 
@@ -1854,7 +1426,7 @@ int UtcDaliTextViewUpdateTextInfo(void)
     // Remove operations
 
     {
-      std::string( "Remove from new line character to first character next line." ),
+      std::string( "Remove from new paragraph character to first character next paragraph." ),
       Remove,
       std::string("Hello world\nhello world."),
       11,
@@ -1864,7 +1436,7 @@ int UtcDaliTextViewUpdateTextInfo(void)
       std::string("Hello worldello world."),
     },
     {
-      std::string( "Replace style from new line character to first character next line." ),
+      std::string( "Replace style from new paragraph character to first character next paragraph." ),
       Replace,
       std::string("Hello world\nhello world."),
       11,
@@ -1894,9 +1466,9 @@ int UtcDaliTextViewUpdateTextInfo(void)
       std::string("hello world."),
     },
     // Remove within the same word:
-    // * within the same group of characters.
+    // * within the same group of characters with same style.
     {
-      std::string( "Remove within the same word, within the same group of characters" ),
+      std::string( "Remove within the same word, within the same group of characters with same style" ),
       Remove,
       std::string("Hello <font size='30'>world\nhello</font> world"),
       7,
@@ -1949,9 +1521,9 @@ int UtcDaliTextViewUpdateTextInfo(void)
       0.f,
       std::string( "Hello <font size='10'>\nhello</font> world" )
     },
-    // * Remove whole word (merge lines)
+    // * Remove whole word (merge paragraphs)
     {
-      std::string( "Remove within the same word, whole word (merge lines)" ),
+      std::string( "Remove within the same word, whole word (merge paragraphs)" ),
       Remove,
       std::string("Hello <font size='30'>w</font>orl<font size='10'>d\nhello</font> world"),
       11,
@@ -1960,10 +1532,10 @@ int UtcDaliTextViewUpdateTextInfo(void)
       0.f,
       std::string( "Hello <font size='30'>w</font>orl<font size='10'>dhello</font> world" )
     },
-    // * Remove whole group of words
+    // * Remove RTL text within LTR
     /* TODO check this when RTL text is working
     {
-      std::string( "Remove within the same line, whole group of words (merge groups)" ),
+      std::string( "Remove within the same paragraph, RTL text within LTR." ),
       Remove,
       std::string("Hello world, שלום עולם, hello world"),
       10,
@@ -1973,9 +1545,9 @@ int UtcDaliTextViewUpdateTextInfo(void)
       std::string( "Hello worlello world" )
     },
     */
-    // * Remove whole line
+    // * Remove whole paragraph
     {
-      std::string( "Remove whole line" ),
+      std::string( "Remove whole paragraph" ),
       Remove,
       std::string("Hello world, hello world\n"
                   "Hello world, hello world\n"
@@ -1990,7 +1562,7 @@ int UtcDaliTextViewUpdateTextInfo(void)
                   "Hello world, hello world\n"),
     },
     {
-      std::string( "Remove whole line" ),
+      std::string( "Remove whole paragraph" ),
       Remove,
       std::string("Hello world, hello world\n"
                   "H"),
@@ -2096,9 +1668,9 @@ int UtcDaliTextViewUpdateTextInfo(void)
       std::string( "Touch <b>me\nhello\n</b>world" )
     },
   };
-  const std::size_t numberOfTests( 21 );
+  const std::size_t numberOfTests( 21u );
 
-  for( std::size_t index = 0; index < numberOfTests; ++index )
+  for( std::size_t index = 0u; index < numberOfTests; ++index )
   {
     const UpdateTextInfoTest& test = updateTextInfoTest[index];
 
@@ -2112,147 +1684,85 @@ int UtcDaliTextViewUpdateTextInfo(void)
   END_TEST;
 }
 
-int UtcDaliTextViewSplitWordGroup(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextViewSplitWordGroup : ");
-
-  struct SplitWordGroupTest splitWordGroupTests[] =
-  {
-    {
-      std::string( "Split word group, wordPosition 0, position 0." ),
-      std::string( "<u><font size='10'>He<font size='12'>ll</font>oooo wooorld</font></u>" ),
-      0,
-      0,
-      std::string( "" ),
-      std::string( "<u><font size='10'>He<font size='12'>ll</font>oooo wooorld</font></u>" ),
-    },
-    {
-      std::string( "Split word group, wordPosition 2, position 8." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font>" ),
-      2,
-      7,
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font>" ),
-      std::string( "" ),
-    },
-    {
-      std::string( "Split word group, wordPosition 0, position 2." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font>" ),
-      0,
-      2,
-      std::string( "<font size='10'>He</font>" ),
-      std::string( "<font size='12'>ll</font><font size='10'>oooo wooorld</font>" ),
-    },
-    {
-      std::string( "Split word group, wordPosition 0, position 3." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font>" ),
-      0,
-      3,
-      std::string( "<font size='10'>He</font><font size='12'>l</font>" ),
-      std::string( "<font size='12'>l</font><font size='10'>oooo wooorld</font>" ),
-    },
-    {
-      std::string( "Split word group, wordPosition 0, position 4." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font>" ),
-      0,
-      4,
-      std::string( "<font size='10'>He</font><font size='12'>ll</font>" ),
-      std::string( "<font size='10'>oooo wooorld</font>" ),
-    },
-    {
-      std::string( "Split word group, wordPosition 1, position 0." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font>" ),
-      1,
-      0,
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo</font>" ),
-      std::string( "<font size='10'> wooorld</font>" ),
-    },
-  };
-  const std::size_t numberOfTests( 6 );
-
-  for( std::size_t index = 0; index < numberOfTests; ++index )
-  {
-    const SplitWordGroupTest& test = splitWordGroupTests[index];
-
-    if( !TestSplitWordGroup( test.description, test.input, test.wordPosition, test.position, test.firstResult, test.lastResult, TEST_LOCATION ) )
-    {
-      tet_result( TET_FAIL );
-    }
-  }
-
-  tet_result( TET_PASS );
-  END_TEST;
-}
-
-int UtcDaliTextViewSplitLine(void)
+int UtcDaliTextViewSplitParagraph(void)
 {
   ToolkitTestApplication application;
 
-  tet_infoline("UtcDaliTextViewSplitLine : ");
+  tet_infoline("UtcDaliTextViewSplitParagraph : ");
 
-  struct SplitLineTest splitLineTests[] =
+  struct SplitParagraphTest splitParagraphTests[] =
   {
     {
-      std::string( "Split line, groupPosition 0, wordPosition 0, position 0." ),
+      std::string( "Split paragraph, wordPosition 0, position 0." ),
       std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
       0,
       0,
-      0,
       3.f,
       std::string( "" ),
       std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
     },
     {
-      std::string( "Split line, groupPosition 2, wordPosition 2, position 4." ),
+      std::string( "Split paragraph, wordPosition 10, position 4." ),
       std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
-      2,
-      2,
+      10,
       4,
       0.f,
       std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
       std::string( "" ),
     },
-    /* TODO check when RTL is working.
     {
-      std::string( "Split line, groupPosition 1, wordPosition 2, position 0." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
-      1,
+     std::string( "Split paragraph, wordPosition 2, position 4." ),
+      std::string("<font size='10'>Hello </font>wor<font size='12'>ld, hello wo</font>rld"),
       2,
+      4,
+      0.f,
+      std::string("<font size='10'>Hello </font>wor<font size='12'>l</font>"),
+      std::string("<font size='12'>d, hello wo</font>rld")
+    }
+    /* TODO RTL
+    {
+      std::string( "Split paragraph, wordPosition 6, position 0." ),
+      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
+      6,
       0,
       0.f,
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום" ),
-      std::string( " עולם text text" ),
+      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום " ),
+      std::string( "עולם text text" ),
     },
     {
-      std::string( "Split line, groupPosition 1, wordPosition 0, position 0." ),
+      std::string( "Split paragraph, wordPosition 4, position 0." ),
       std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
-      1,
-      0,
+      4,
       0,
       0.f,
       std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> " ),
       std::string( "שלום עולם text text" ),
     },
-    */
     {
-      std::string( "Split line, groupPosition 2, wordPosition 0, position 0." ),
+      std::string( "Split paragraph2, wordPosition 8, position 0." ),
       std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
-      2,
-      0,
+      8,
       0,
       6.f,
       std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם " ),
       std::string( "text text" ),
     },
+    */
   };
-  const std::size_t numberOfTests( 3 );
+  const std::size_t numberOfTests( 3u );
 
-  for( std::size_t index = 0; index < numberOfTests; ++index )
+  for( std::size_t index = 0u; index < numberOfTests; ++index )
   {
-    const SplitLineTest& test = splitLineTests[index];
+    const SplitParagraphTest& test = splitParagraphTests[index];
 
-    if( !TestSplitLine( test.description, test.input, test.groupPosition, test.wordPosition, test.position, test.lineHeightOffset, test.firstResult, test.lastResult, TEST_LOCATION ) )
+    if( !TestSplitParagraph( test.description,
+                             test.input,
+                             test.wordIndex,
+                             test.characterIndex,
+                             test.lineHeightOffset,
+                             test.firstResult,
+                             test.lastResult,
+                             TEST_LOCATION ) )
     {
       tet_result( TET_FAIL );
     }
@@ -2283,9 +1793,9 @@ int UtcDaliTextViewMergeWord01(void)
       std::string( "<font size='10'>Hel</font><font size='20'>lo</font>" )
     },
   };
-  const std::size_t numberOfTests( 2 );
+  const std::size_t numberOfTests( 2u );
 
-  for( std::size_t index = 0; index < numberOfTests; ++index )
+  for( std::size_t index = 0u; index < numberOfTests; ++index )
   {
     const MergeWordsTest& test = mergeWordsTests[index];
 
@@ -2302,7 +1812,7 @@ int UtcDaliTextViewMergeWord01(void)
 int UtcDaliTextViewMergeWord02(void)
 {
   // Negative test.
-  // It test white spaces and new line characters can't be merged to other words.
+  // It test white spaces and new paragraph characters can't be merged to other words.
 
   ToolkitTestApplication application;
 
@@ -2333,7 +1843,7 @@ int UtcDaliTextViewMergeWord02(void)
 
   TextViewProcessor::WordLayoutInfo wordLayoutInfo01;
 
-  wordLayoutInfo01 = *( *( *textLayoutInfo01.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
+  wordLayoutInfo01 = *( *textLayoutInfo01.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
 
   TextViewProcessor::CreateTextInfo( styledText02,
                                      DEFAULT_LAYOUT_PARAMETERS,
@@ -2341,7 +1851,7 @@ int UtcDaliTextViewMergeWord02(void)
 
   TextViewProcessor::WordLayoutInfo wordLayoutInfo02;
 
-  wordLayoutInfo02 = *( *( *textLayoutInfo02.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
+  wordLayoutInfo02 = *( *textLayoutInfo02.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
 
   TextViewProcessor::CreateTextInfo( styledText03,
                                      DEFAULT_LAYOUT_PARAMETERS,
@@ -2349,9 +1859,9 @@ int UtcDaliTextViewMergeWord02(void)
 
   TextViewProcessor::WordLayoutInfo wordLayoutInfo03;
 
-  wordLayoutInfo03 = *( *( *textLayoutInfo03.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
+  wordLayoutInfo03 = *( *textLayoutInfo03.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
 
-  // Test MergeWord() asserts if white spaces or new line chars are merged.
+  // Test MergeWord() asserts if white spaces or new paragraph chars are merged.
   bool assert1 = false;
   bool assert2 = false;
   bool assert3 = false;
@@ -2367,7 +1877,7 @@ int UtcDaliTextViewMergeWord02(void)
   catch( Dali::DaliException& e )
   {
     tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
-    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new line characters can't be merged with other words.\"", TEST_LOCATION );
+    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
     assert1 = true;
   }
   try
@@ -2378,7 +1888,7 @@ int UtcDaliTextViewMergeWord02(void)
   catch( Dali::DaliException& e )
   {
     tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
-    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new line characters can't be merged with other words.\"", TEST_LOCATION );
+    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
     assert2 = true;
   }
   try
@@ -2389,7 +1899,7 @@ int UtcDaliTextViewMergeWord02(void)
   catch( Dali::DaliException& e )
   {
     tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
-    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new line characters can't be merged with other words.\"", TEST_LOCATION );
+    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
     assert3 = true;
   }
   try
@@ -2400,7 +1910,7 @@ int UtcDaliTextViewMergeWord02(void)
   catch( Dali::DaliException& e )
   {
     tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
-    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new line characters can't be merged with other words.\"", TEST_LOCATION );
+    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
     assert4 = true;
   }
   try
@@ -2411,7 +1921,7 @@ int UtcDaliTextViewMergeWord02(void)
   catch( Dali::DaliException& e )
   {
     tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
-    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new line characters can't be merged with other words.\"", TEST_LOCATION );
+    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
     assert5 = true;
   }
   try
@@ -2422,7 +1932,7 @@ int UtcDaliTextViewMergeWord02(void)
   catch( Dali::DaliException& e )
   {
     tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
-    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new line characters can't be merged with other words.\"", TEST_LOCATION );
+    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
     assert6 = true;
   }
 
@@ -2437,172 +1947,38 @@ int UtcDaliTextViewMergeWord02(void)
   END_TEST;
 }
 
-int UtcDaliTextViewMergeGroup01(void)
+int UtcDaliTextViewMergeParagraph01(void)
 {
   ToolkitTestApplication application;
 
-  tet_infoline("UtcDaliTextViewMergeGroup01 : ");
+  tet_infoline("UtcDaliTextViewMergeParagraph01 : ");
 
-  struct MergeWordGroupsTest mergeWordGroupssTests[] =
+  struct MergeParagraphsTest mergeParagraphsTests[] =
   {
     {
-      std::string( "Merge a void first group." ),
-      std::string( "" ),
-      std::string( "Hello world" ),
-      std::string( "Hello world" ),
-    },
-    {
-      std::string( "Merge a void last group." ),
-      std::string( "Hello world" ),
+      std::string( "Merge a void first paragraph." ),
       std::string( "" ),
-      std::string( "Hello world" ),
-    },
-    {
-      std::string( "Merge groups and merge last and first words." ),
-      std::string( "Hello wor" ),
-      std::string( "ld, hello world" ),
-      std::string( "Hello world, hello world" ),
-    },
-    {
-      std::string( "Merge groups and don't merge last and first words." ),
-      std::string( "Hello world, " ),
-      std::string( "hello world" ),
-      std::string( "Hello world, hello world" )
-    },
-  };
-  const std::size_t numberOfTests( 4 );
-
-  for( std::size_t index = 0; index < numberOfTests; ++index )
-  {
-    const MergeWordGroupsTest& test = mergeWordGroupssTests[index];
-
-    if( !TestMergeGroupsOfWords( test.description, test.inputFirst, test.inputLast, test.result, TEST_LOCATION ) )
-    {
-      tet_result( TET_FAIL );
-    }
-  }
-
-  tet_result(TET_PASS);
-  END_TEST;
-}
-
-int UtcDaliTextViewMergeGroup02(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextViewMergeGroup02 : ");
-
-  Toolkit::Internal::TextView::RelayoutData relayoutData01;
-  Toolkit::Internal::TextView::RelayoutData relayoutData02;
-  Toolkit::Internal::TextView::RelayoutData relayoutData03;
-  TextViewProcessor::TextLayoutInfo& textLayoutInfo01( relayoutData01.mTextLayoutInfo );
-  TextViewProcessor::TextLayoutInfo& textLayoutInfo02( relayoutData02.mTextLayoutInfo );
-  TextViewProcessor::TextLayoutInfo& textLayoutInfo03( relayoutData03.mTextLayoutInfo );
-
-  std::string text01( "Hello \n" );
-  std::string text02( "world" );
-  std::string text03( "السلام عليكم" );
-  MarkupProcessor::StyledTextArray styledText01;
-  MarkupProcessor::StyledTextArray styledText02;
-  MarkupProcessor::StyledTextArray styledText03;
-  MarkupProcessor::GetStyledTextArray( text01, styledText01, true );
-  MarkupProcessor::GetStyledTextArray( text02, styledText02, true );
-  MarkupProcessor::GetStyledTextArray( text03, styledText03, true );
-
-  TextViewProcessor::CreateTextInfo( styledText01,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     relayoutData01 );
-
-  TextViewProcessor::WordGroupLayoutInfo wordGroupLayoutInfo01;
-
-  wordGroupLayoutInfo01 = *( *textLayoutInfo01.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin();
-
-  TextViewProcessor::CreateTextInfo( styledText02,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     relayoutData02 );
-
-  TextViewProcessor::WordGroupLayoutInfo wordGroupLayoutInfo02;
-
-  wordGroupLayoutInfo02 = *( *textLayoutInfo02.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin();
-
-  TextViewProcessor::CreateTextInfo( styledText03,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     relayoutData03 );
-
-  TextViewProcessor::WordGroupLayoutInfo wordGroupLayoutInfo03;
-
-  wordGroupLayoutInfo03 = *( *textLayoutInfo03.mLinesLayoutInfo.begin() ).mWordGroupsLayoutInfo.begin();
-
-  bool assert1 = false;
-  bool assert2 = false;
-
-  try
-  {
-    MergeWordGroup( wordGroupLayoutInfo01,
-                    wordGroupLayoutInfo02 );
-  }
-  catch( Dali::DaliException& e )
-  {
-    tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
-    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWordGroup(). ERROR: A group of words can't be merged to another group which finishes with a new line character.\"", TEST_LOCATION );
-    assert1 = true;
-  }
-
-  try
-  {
-    MergeWordGroup( wordGroupLayoutInfo03,
-                    wordGroupLayoutInfo02 );
-  }
-  catch( Dali::DaliException& e )
-  {
-    tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
-    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWordGroup(). ERROR: groups with different direction can't be merged.\"", TEST_LOCATION );
-    assert2 = true;
-  }
-
-  if( assert1 && assert2 )
-  {
-    tet_result( TET_PASS );
-  }
-  else
-  {
-    tet_result( TET_FAIL );
-  }
-  END_TEST;
-}
-
-int UtcDaliTextViewMergeLine01(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextViewMergeLine01 : ");
-
-  struct MergeLinesTest mergeLinesTests[] =
-  {
-    {
-      std::string( "Merge a void first line." ),
-      std::string( "" ),
-      std::string( "Hello world, this is a whole line" ),
+      std::string( "Hello world, this is a whole paragraph" ),
       2.f,
-      std::string( "Hello world, this is a whole line" )
+      std::string( "Hello world, this is a whole paragraph" )
     },
     {
-      std::string( "Merge a void last line." ),
-      std::string( "Hello world, this is a whole line" ),
+      std::string( "Merge a void last paragraph." ),
+      std::string( "Hello world, this is a whole paragraph" ),
       std::string( "" ),
       0.f,
-      std::string( "Hello world, this is a whole line" )
+      std::string( "Hello world, this is a whole paragraph" )
     },
-    /* TODO: check when RTL text is working.
+    /* TODO RTL
     {
-      std::string( "Merge lines and merge last and first groups" ),
+      std::string( "Merge paragraphs: last starting with RTL text and first ending with RTL" ),
       std::string( "Hello world, שלום" ),
       std::string( " עולם, hello world." ),
       6.f,
       std::string( "Hello world, שלום עולם, hello world." )
     },
     {
-      std::string( "Merge lines and don't merge last and first words." ),
+      std::string( "Merge paragraphs and don't merge last and first words." ),
       std::string( "Hello world, " ),
       std::string( "שלום עולם, hello world." ),
       3.f,
@@ -2610,27 +1986,27 @@ int UtcDaliTextViewMergeLine01(void)
     },
     */
     {
-      std::string( "Merge lines. Don't merge words" ),
+      std::string( "Merge paragraphs. Don't merge words" ),
       std::string( "Hello world," ),
-      std::string( " this is a whole line" ),
+      std::string( " this is a whole paragraph" ),
       0.f,
-      std::string( "Hello world, this is a whole line" )
+      std::string( "Hello world, this is a whole paragraph" )
     },
     {
-      std::string( "Merge lines. Merge words" ),
+      std::string( "Merge paragraphs. Merge words" ),
       std::string( "Hello world, th" ),
-      std::string( "is is a whole line" ),
+      std::string( "is is a whole paragraph" ),
       0.f,
-      std::string( "Hello world, this is a whole line" )
+      std::string( "Hello world, this is a whole paragraph" )
     },
   };
-  const std::size_t numberOfTests( 4 );
+  const std::size_t numberOfTests( 4u );
 
-  for( std::size_t index = 0; index < numberOfTests; ++index )
+  for( std::size_t index = 0u; index < numberOfTests; ++index )
   {
-    const MergeLinesTest& test = mergeLinesTests[index];
+    const MergeParagraphsTest& test = mergeParagraphsTests[index];
 
-    if( !TestMergeLines( test.description, test.inputFirst, test.inputLast, test.lineHeightOffset, test.result, TEST_LOCATION ) )
+    if( !TestMergeParagraphs( test.description, test.inputFirst, test.inputLast, test.lineHeightOffset, test.result, TEST_LOCATION ) )
     {
       tet_result( TET_FAIL );
     }
@@ -2640,11 +2016,11 @@ int UtcDaliTextViewMergeLine01(void)
   END_TEST;
 }
 
-int UtcDaliTextViewMergeLine02(void)
+int UtcDaliTextViewMergeParagraph02(void)
 {
   ToolkitTestApplication application;
 
-  tet_infoline("UtcDaliTextViewMergeLine02 : ");
+  tet_infoline("UtcDaliTextViewMergeParagraph02 : ");
 
   Toolkit::Internal::TextView::RelayoutData relayoutData01;
   Toolkit::Internal::TextView::RelayoutData relayoutData02;
@@ -2662,29 +2038,29 @@ int UtcDaliTextViewMergeLine02(void)
                                      DEFAULT_LAYOUT_PARAMETERS,
                                      relayoutData01 );
 
-  TextViewProcessor::LineLayoutInfo lineLayoutInfo01;
+  TextViewProcessor::ParagraphLayoutInfo paragraphLayoutInfo01;
 
-  lineLayoutInfo01 = *textLayoutInfo01.mLinesLayoutInfo.begin();
+  paragraphLayoutInfo01 = *textLayoutInfo01.mParagraphsLayoutInfo.begin();
 
   TextViewProcessor::CreateTextInfo( styledText02,
                                      DEFAULT_LAYOUT_PARAMETERS,
                                      relayoutData02 );
 
-  TextViewProcessor::LineLayoutInfo lineLayoutInfo02;
+  TextViewProcessor::ParagraphLayoutInfo paragraphLayoutInfo02;
 
-  lineLayoutInfo02 = *textLayoutInfo02.mLinesLayoutInfo.begin();
+  paragraphLayoutInfo02 = *textLayoutInfo02.mParagraphsLayoutInfo.begin();
 
   bool assert1 = false;
 
   try
   {
-    MergeLine( lineLayoutInfo01,
-               lineLayoutInfo02 );
+    MergeParagraph( paragraphLayoutInfo01,
+                    paragraphLayoutInfo02 );
   }
   catch( Dali::DaliException& e )
   {
     tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
-    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeLine(). ERROR: A line can't be merged to another line which finishes with a new line character.\"", TEST_LOCATION );
+    DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeParagraph(). ERROR: A paragraph can't be merged to another paragraph which finishes with a new paragraph character.\"", TEST_LOCATION );
     assert1 = true;
   }
 
@@ -2785,9 +2161,9 @@ int UtcDaliTextViewRemoveCharactersFromWord(void)
       std::string( "<font size='10'>Held</font>" ),
     },
   };
-  const std::size_t numberOfTests( 11 );
+  const std::size_t numberOfTests( 11u );
 
-  for( std::size_t index = 0; index < numberOfTests; ++index )
+  for( std::size_t index = 0u; index < numberOfTests; ++index )
   {
     const RemoveCharactersFromWordTest& test = removeCharactersFromWordTests[index];
 
@@ -2801,77 +2177,20 @@ int UtcDaliTextViewRemoveCharactersFromWord(void)
   END_TEST;
 }
 
-int UtcDaliTextViewRemoveWordsFromGroup(void)
+int UtcDaliTextViewRemoveWordsFromParagraph(void)
 {
-  // Note: Currently RemoveWordsFromWordGroup() function is only used to remove a number of words from the beginning, or
-  //       from a given index to the end. RemoveWordsFromWordGroup() doesn't merge words (if a white space is removed) so
-  //       tehere isn't any TET case to cover these cases. To be done if needed.
+  // Note: Currently RemoveWordsFromParagraph() function is only used to remove a number of words from the beginning, or
+  //       from a given index to the end.
 
   ToolkitTestApplication application;
 
-  tet_infoline("UtcDaliTextViewRemoveWordsFromGroup : ");
-  struct RemoveWordsFromGroupTest removeWordsFromGroupTests[] =
+  tet_infoline("UtcDaliTextViewRemoveWordsFromParagraph : ");
+  struct RemoveWordsFromParagraphTest removeWordsFromParagraphTest[] =
   {
     {
       std::string( "Delete 0 words." ),
-      std::string( "Hello world, hello world" ),
-      3,
-      0,
-      std::string( "Hello world, hello world" ),
-    },
-    {
-      std::string( "Delete some words in the middle. Don't merge words" ),
-      std::string( "<font size='10'>Hel</font><font size='20'>lo wo</font><font size='30'>rld, hello world</font>" ),
-      1,
-      4,
-      std::string( "<font size='10'>Hel</font><font size='20'>lo</font><font size='30'> world</font>" ),
-    },
-    {
-      std::string( "Delete words up to the end" ),
-      std::string( "<font size='10'>Hel</font><font size='20'>lo wo</font><font size='30'>rld, hello world</font>" ),
-      5,
-      2,
-      std::string( "<font size='10'>Hel</font><font size='20'>lo wo</font><font size='30'>rld, hello</font>" ),
-    },
-    {
-      std::string( "Delete words from the beginning." ),
-      std::string( "Hello world, hello world" ),
-      0,
-      3,
-      std::string( " hello world" ),
-    },
-  };
-  const std::size_t numberOfTests( 4 );
-
-  for( std::size_t index = 0; index < numberOfTests; ++index )
-  {
-    const RemoveWordsFromGroupTest& test = removeWordsFromGroupTests[index];
-
-    if( !TestRemoveWordsFromGroup( test.description, test.input, test.wordIndex, test.numberOfWords, test.result, TEST_LOCATION ) )
-    {
-      tet_result( TET_FAIL );
-    }
-  }
-
-  tet_result( TET_PASS );
-  END_TEST;
-}
-
-int UtcDaliTextViewRemoveGroupsFromLine(void)
-{
-  // Note: Currently RemoveWordGroupsFromLine() function is only used to remove a number of group of words from the beginning, or
-  //       from a given index to the end. RemoveWordGroupsFromLine() doesn't merge groups of words (if a whole group of words is removed) so
-  //       tehere isn't any TET case to cover these cases. To be done if needed.
-
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextViewRemoveGroupsFromLine : ");
-  struct RemoveGroupsFromLineTest removeGroupsFromLineTests[] =
-  {
-    {
-      std::string( "Delete 0 groups of words." ),
       std::string( "Hello hello, שלום עולם hello hello" ),
-      1,
+      0,
       0,
       2.f,
       std::string( "Hello hello, שלום עולם hello hello" ),
@@ -2879,8 +2198,8 @@ int UtcDaliTextViewRemoveGroupsFromLine(void)
     {
       std::string( "Delete from the middle to the end." ),
       std::string( "Hello hello, שלום עולם hello hello" ),
-      1,
-      2,
+      4,
+      7,
       0.f,
       std::string( "Hello hello, " ),
     },
@@ -2888,18 +2207,18 @@ int UtcDaliTextViewRemoveGroupsFromLine(void)
       std::string( "Delete from the beginning to the middle." ),
       std::string( "Hello hello, שלום עולם hello hello" ),
       0,
-      2,
+      8,
       6.f,
       std::string( "hello hello" ),
     },
   };
-  const std::size_t numberOfTests( 3 );
+  const std::size_t numberOfTests( 3u );
 
-  for( std::size_t index = 0; index < numberOfTests; ++index )
+  for( std::size_t index = 0u; index < numberOfTests; ++index )
   {
-    const RemoveGroupsFromLineTest& test = removeGroupsFromLineTests[index];
+    const RemoveWordsFromParagraphTest& test = removeWordsFromParagraphTest[index];
 
-    if( !TestRemoveGroupsFromLine( test.description, test.input, test.groupIndex, test.numberOfGroups, test.lineHeightOffset, test.result, TEST_LOCATION ) )
+    if( !TestRemoveWordsFromParagraph( test.description, test.input, test.wordIndex, test.numberOfWords, test.lineHeightOffset, test.result, TEST_LOCATION ) )
     {
       tet_result( TET_FAIL );
     }
index 08e37d1..5569d96 100644 (file)
@@ -47,10 +47,7 @@ const char* const PROPERTY_MULTILINE_POLICY = "multiline-policy";
 const char* const PROPERTY_WIDTH_EXCEED_POLICY = "width-exceed-policy";
 const char* const PROPERTY_HEIGHT_EXCEED_POLICY = "height-exceed-policy";
 const char* const PROPERTY_LINE_JUSTIFICATION = "line-justification";
-const char* const PROPERTY_FADE_BOUNDARY_LEFT = "fade-boundary-left";
-const char* const PROPERTY_FADE_BOUNDARY_RIGHT = "fade-boundary-right";
-const char* const PROPERTY_FADE_BOUNDARY_TOP = "fade-boundary-top";
-const char* const PROPERTY_FADE_BOUNDARY_BOTTOM = "fade-boundary-bottom";
+const char* const PROPERTY_FADE_BOUNDARY = "fade-boundary";
 const char* const PROPERTY_LINE_HEIGHT_OFFSET = "line-height-offset";
 const char* const PROPERTY_HORIZONTAL_ALIGNMENT = "horizontal-alignment";
 const char* const PROPERTY_VERTICAL_ALIGNMENT = "vertical-alignment";
@@ -236,13 +233,15 @@ int UtcDaliTextViewSetAndGetText(void)
   ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
   DALI_TEST_CHECK( registry );
 
-  gNumberObjectCreated = 0;
+  gNumberObjectCreated = 0u;
   registry.ObjectCreatedSignal().Connect(&TestCallback);
 
   // Following string should create three text-actors ([Hel], [lo wo] and [rld]).
   std::string text( "Hel<font size='10'>lo wo</font>rld!\n"
                     "\n" );
 
+  view.SetMarkupProcessingEnabled( true ); // Enables markup processing.
+
   Stage::GetCurrent().Add( view );
   view.SetText( text );
 
@@ -487,6 +486,7 @@ int UtcDaliTextViewTestLayoutOptions02(void)
 
   TextView textView = TextView::New();
   textView.SetSnapshotModeEnabled( false ); // Disables offscreen rendering.
+  textView.SetMarkupProcessingEnabled( true ); // Enables markup processing.
 
   Stage::GetCurrent().Add( textView );
 
@@ -626,7 +626,9 @@ int UtcDaliTextViewSnapshotEnable(void)
   // Avoids the frame buffer texture to throw an exception.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
 
-  TextView view = TextView::New( "Hel<font color='green'>lo world!</font> This <font color='green'>is</font> a sna<font color='green'>psho</font>t test." );
+  TextView view = TextView::New();
+  view.SetMarkupProcessingEnabled( true ); // Enables markup processing.
+  view.SetText( "Hel<font color='green'>lo world!</font> This <font color='green'>is</font> a sna<font color='green'>psho</font>t test." );
 
   Stage::GetCurrent().Add( view );
 
@@ -746,25 +748,13 @@ int UtcDaliTextViewSetProperty(void)
   DALI_TEST_CHECK( Toolkit::TextView::Justified == view.GetLineJustification() );
 
   //Test fade boundary property
-  unsigned int testValue = 23;
-  PixelSize leftFadeBoundary(testValue);
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY_LEFT), testValue);
-  DALI_TEST_CHECK( leftFadeBoundary == view.GetFadeBoundary().mLeft );
-
-  testValue = 26;
-  PixelSize rightFadeBoundary(testValue);
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY_RIGHT), testValue);
-  DALI_TEST_CHECK( rightFadeBoundary == view.GetFadeBoundary().mRight );
-
-  testValue = 2;
-  PixelSize topFadeBoundary(testValue);
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY_TOP), testValue);
-  DALI_TEST_CHECK( topFadeBoundary == view.GetFadeBoundary().mTop );
-
-  testValue = 11;
-  PixelSize bottomFadeBoundary(testValue);
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY_BOTTOM), testValue);
-  DALI_TEST_CHECK( bottomFadeBoundary == view.GetFadeBoundary().mBottom );
+  const Vector4 testValue( 23.f, 26.f, 2.f, 11.f );
+
+  view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY), testValue);
+  DALI_TEST_CHECK( testValue.x == view.GetFadeBoundary().mLeft );
+  DALI_TEST_CHECK( testValue.y == view.GetFadeBoundary().mRight );
+  DALI_TEST_CHECK( testValue.z == view.GetFadeBoundary().mTop );
+  DALI_TEST_CHECK( testValue.w == view.GetFadeBoundary().mBottom );
 
   //Test Line height offset property
   float testOffsetValue = 14.04f;
@@ -801,8 +791,10 @@ int UtcDaliTextViewUnderlineText(void)
   tet_infoline("UtcDaliTextViewUnderlineText: ");
   ToolkitTestApplication application;
 
-  TextView textView = TextView::New( "<u><font size='10'>gg<font size='14'>gg<font size='18'>gg<font size='22'>gg</font>gg</font>gg</font>gg</font></u>" );
+  TextView textView = TextView::New();
   textView.SetSnapshotModeEnabled( false );
+  textView.SetMarkupProcessingEnabled( true );
+  textView.SetText( "<u><font size='10'>gg<font size='14'>gg<font size='18'>gg<font size='22'>gg</font>gg</font>gg</font>gg</font></u>" );
 
   textView.SetSize( 150.f, 100.f );
 
index b3a4bb4..72911b8 100644 (file)
@@ -109,20 +109,34 @@ AlphaFunction GetAlphaFunction( const std::string& alphaFunction )
   if( 0 == alphaFunctionLut.size() )
   {
     // coding convention is uppercase enums
-    alphaFunctionLut["DEFAULT"]         = Dali::AlphaFunctions::Default;
-    alphaFunctionLut["LINEAR"]          = Dali::AlphaFunctions::Linear;
-    alphaFunctionLut["REVERSE"]         = Dali::AlphaFunctions::Reverse;
-    alphaFunctionLut["EASE_IN"]         = Dali::AlphaFunctions::EaseIn;
-    alphaFunctionLut["EASE_OUT"]        = Dali::AlphaFunctions::EaseOut;
-    alphaFunctionLut["EASE_IN_OUT"]     = Dali::AlphaFunctions::EaseInOut;
-    alphaFunctionLut["EASE_IN_SINE"]    = Dali::AlphaFunctions::EaseInSine;
-    alphaFunctionLut["EASE_OUT_SINE"]   = Dali::AlphaFunctions::EaseOutSine;
-    alphaFunctionLut["EASE_IN_OUT_SINE"]= Dali::AlphaFunctions::EaseInOutSine;
-    alphaFunctionLut["BOUNCE"]          = Dali::AlphaFunctions::Bounce;
-    alphaFunctionLut["BOUNCE_BACK"]     = Dali::AlphaFunctions::BounceBack;
-    alphaFunctionLut["EASE_OUT_BACK"]   = Dali::AlphaFunctions::EaseOutBack;
-    alphaFunctionLut["SIN"]             = Dali::AlphaFunctions::Sin;
-    alphaFunctionLut["SIN2X"]           = Dali::AlphaFunctions::Sin;
+    alphaFunctionLut["DEFAULT"]                    = AlphaFunctions::Default;
+    alphaFunctionLut["LINEAR"]                     = AlphaFunctions::Linear;
+    alphaFunctionLut["SQUARE"]                     = AlphaFunctions::Square;
+    alphaFunctionLut["REVERSE"]                    = AlphaFunctions::Reverse;
+    alphaFunctionLut["EASE_IN"]                    = AlphaFunctions::EaseIn;
+    alphaFunctionLut["EASE_OUT"]                   = AlphaFunctions::EaseOut;
+    alphaFunctionLut["EASE_IN_OUT"]                = AlphaFunctions::EaseInOut;
+    alphaFunctionLut["EASE_IN_SINE"]               = AlphaFunctions::EaseInSine;
+    alphaFunctionLut["EASE_OUT_SINE"]              = AlphaFunctions::EaseOutSine;
+    alphaFunctionLut["EASE_IN_OUT_SINE"]           = AlphaFunctions::EaseInOutSine;
+    alphaFunctionLut["EASE_IN_SINE_33"]            = AlphaFunctions::EaseInSine33;
+    alphaFunctionLut["EASE_OUT_SINE_33"]           = AlphaFunctions::EaseOutSine33;
+    alphaFunctionLut["EASE_IN_OUT_SINE_33"]        = AlphaFunctions::EaseInOutSine33;
+    alphaFunctionLut["EASE_IN_OUT_SINE_50"]        = AlphaFunctions::EaseInOutSine50;
+    alphaFunctionLut["EASE_IN_OUT_SINE_60"]        = AlphaFunctions::EaseInOutSine60;
+    alphaFunctionLut["EASE_IN_OUT_SINE_70"]        = AlphaFunctions::EaseInOutSine70;
+    alphaFunctionLut["EASE_IN_OUT_SINE_80"]        = AlphaFunctions::EaseInOutSine80;
+    alphaFunctionLut["EASE_IN_OUT_SINE_90"]        = AlphaFunctions::EaseInOutSine90;
+    alphaFunctionLut["DOUBLE_EASE_IN_OUT_SINE_60"] = AlphaFunctions::DoubleEaseInOutSine60;
+    alphaFunctionLut["EASE_OUT_QUINT_50"]          = AlphaFunctions::EaseOutQuint50;
+    alphaFunctionLut["EASE_OUT_QUINT_80"]          = AlphaFunctions::EaseOutQuint80;
+    alphaFunctionLut["BOUNCE"]                     = AlphaFunctions::Bounce;
+    alphaFunctionLut["BOUNCE_BACK"]                = AlphaFunctions::BounceBack;
+    alphaFunctionLut["EASE_IN_BACK"]               = AlphaFunctions::EaseInBack;
+    alphaFunctionLut["EASE_OUT_BACK"]              = AlphaFunctions::EaseOutBack;
+    alphaFunctionLut["EASE_IN_OUT_BACK"]           = AlphaFunctions::EaseInOutBack;
+    alphaFunctionLut["SIN"]                        = AlphaFunctions::Sin;
+    alphaFunctionLut["SIN2X"]                      = AlphaFunctions::Sin2x;
   }
 
   const AlphaFunctionLut::const_iterator iter( alphaFunctionLut.find( alphaFunction ) );
index ccf141a..ff6fbb9 100644 (file)
@@ -72,27 +72,6 @@ const Vector2 ANGLE_OUTER_CUBE_SWING(Math::PI * 0.5f, Math::PI * 0.5f);  ///< ou
 
 // Helpers ////////////////////////////////////////////////////////////////////////////////////////
 
-// TODO: GetAngle for Vector2 can be moved.
-// GetAngle for Vector3 needs to be measured against a normal/plane.
-
-/**
- * @param[in] vector The 3D vector to be measured
- * @return angle in radians from 0 to 2PI
- */
-float GetAngle(const Vector3& vector)
-{
-  return atan2(vector.y, vector.x) + Math::PI;
-}
-
-/**
- * @param[in] vector The 2D vector to be measured
- * @return angle in radians from 0 to 2PI
- */
-float GetAngle(const Vector2& vector)
-{
-  return atan2(vector.y, vector.x) + Math::PI;
-}
-
 /**
  * Find the vector (distance) from (a) to (b)
  * in domain (start) to (end)
index 44c5aaf..850431e 100644 (file)
@@ -2635,6 +2635,8 @@ void TextInput::DeleteHighlightedText( bool inheritStyle )
 
     RemoveHighlight();
 
+    EmitTextModified();
+
     if( inheritStyle )
     {
       const TextStyle oldInputStyle( mInputStyle );
@@ -3493,7 +3495,7 @@ TextInput::HighlightInfo TextInput::CalculateHighlightInfo()
           // TODO: TextView should have a table of visual rows, and each character a reference to the row
           // that it resides on. That way this enumeration is not necessary.
           Vector2 min, max;
-          if(lastIt->mIsNewLineChar)
+          if(lastIt->mIsNewParagraphChar)
           {
             // If the last character is a new line, then to get the row rect, we need to scan from the character before the new line.
             lastIt = std::max( mTextLayoutInfo.mCharacterLayoutInfoTable.begin(), lastIt - 1 );
@@ -3540,7 +3542,7 @@ TextInput::HighlightInfo TextInput::CalculateHighlightInfo()
       {
         // finished selection.
         Vector2 min, max;
-        if(lastIt->mIsNewLineChar)
+        if(lastIt->mIsNewParagraphChar)
         {
           lastIt = std::max( mTextLayoutInfo.mCharacterLayoutInfoTable.begin(), lastIt - 1 );
         }
@@ -3906,7 +3908,7 @@ bool TextInput::ReturnClosestIndex(const Vector2& source, std::size_t& closestIn
         if( fabsf( closestYdifference - currentYdifference )  < CHARACTER_THRESHOLD )
         {
           // ignore new line character.
-          if( !info.mIsNewLineChar )
+          if( !info.mIsNewParagraphChar )
           {
             matchedCharacters.push_back( info );
             numberOfMatchedCharacters++;
@@ -3920,7 +3922,7 @@ bool TextInput::ReturnClosestIndex(const Vector2& source, std::size_t& closestIn
     // and check if user is touching below previous line.
     const Toolkit::TextView::CharacterLayoutInfo& lastInfo( mTextLayoutInfo.mCharacterLayoutInfoTable[mTextLayoutInfo.mCharacterLayoutInfoTable.size() - 1] );
 
-    if( ( lastInfo.mIsVisible ) && ( lastInfo.mIsNewLineChar ) && ( sourceScrollOffset.y > lastInfo.mPosition.y ) )
+    if( ( lastInfo.mIsVisible ) && ( lastInfo.mIsNewParagraphChar ) && ( sourceScrollOffset.y > lastInfo.mPosition.y ) )
     {
       closestIndex = mTextLayoutInfo.mCharacterLayoutInfoTable.size();
     }
@@ -4178,7 +4180,7 @@ Vector3 TextInput::GetActualPositionFromCharacterPosition(std::size_t characterP
       }
 
       Toolkit::TextView::CharacterLayoutInfo info = mTextLayoutInfo.mCharacterLayoutInfoTable[ visualCharacterPosition ];
-      if( ( visualCharacterPosition > 0 ) && info.mIsNewLineChar && !IsScrollEnabled() )
+      if( ( visualCharacterPosition > 0 ) && info.mIsNewParagraphChar && !IsScrollEnabled() )
       {
         // Prevents the cursor to exceed the boundary if the last visible character is a 'new line character' and the scroll is not enabled.
         const Vector3& size = GetControlSize();
@@ -4190,7 +4192,7 @@ Vector3 TextInput::GetActualPositionFromCharacterPosition(std::size_t characterP
         info = mTextLayoutInfo.mCharacterLayoutInfoTable[ visualCharacterPosition ];
       }
 
-      if(!info.mIsNewLineChar)
+      if(!info.mIsNewParagraphChar)
       {
         cursorPosition = PositionCursorAfterWordWrap( characterPosition ); // Get position of cursor/handles taking in account auto word wrap.
       }
@@ -4390,7 +4392,7 @@ std::size_t TextInput::GetRowStartFromCharacterPosition(std::size_t logicalPosit
   {
     logicalPosition--;
     std::size_t visualPosition = GetVisualPosition(logicalPosition);
-    if(mTextLayoutInfo.mCharacterLayoutInfoTable[visualPosition].mIsNewLineChar)
+    if(mTextLayoutInfo.mCharacterLayoutInfoTable[visualPosition].mIsNewParagraphChar)
     {
       logicalPosition++;
       break;
@@ -4460,7 +4462,7 @@ Size TextInput::GetRowRectFromCharacterPosition(std::size_t characterPosition, V
     --it;
 
     if( (it->mPosition.y < referenceLine) ||
-        (it->mIsNewLineChar) ||
+        (it->mIsNewParagraphChar) ||
         (!it->mIsVisible) )
     {
       break;
@@ -4477,7 +4479,7 @@ Size TextInput::GetRowRectFromCharacterPosition(std::size_t characterPosition, V
   while(it != end)
   {
     if( (it->mPosition.y > referenceLine) ||
-        (it->mIsNewLineChar) ||
+        (it->mIsNewParagraphChar) ||
         (!it->mIsVisible) )
     {
       break;
@@ -4802,6 +4804,7 @@ void TextInput::PasteText( const Text& text )
   if( update )
   {
     CursorUpdate();
+    EmitTextModified();
   }
 
   if( insertedStringLength < text.GetLength() )
index 64ab2a2..2ea4bd3 100644 (file)
@@ -159,7 +159,7 @@ TextHighlight::HighlightInfo TextHighlight::CalculateHighlightInfo( std::size_t
           // TODO: TextView should have a table of visual rows, and each character a reference to the row
           // that it resides on. That way this enumeration is not necessary.
           Vector2 min, max;
-          if(lastIt->mIsNewLineChar)
+          if(lastIt->mIsNewParagraphChar)
           {
             // If the last character is a new line, then to get the row rect, we need to scan from the character before the new line.
             lastIt = std::max( textLayoutInfo.mCharacterLayoutInfoTable.begin(), lastIt - 1 );
@@ -206,7 +206,7 @@ TextHighlight::HighlightInfo TextHighlight::CalculateHighlightInfo( std::size_t
       {
         // finished selection.
         Vector2 min, max;
-        if(lastIt->mIsNewLineChar)
+        if(lastIt->mIsNewParagraphChar)
         {
           lastIt = std::max( textLayoutInfo.mCharacterLayoutInfoTable.begin(), lastIt - 1 );
         }
index 17c9534..fab32ca 100644 (file)
@@ -40,7 +40,7 @@ const float MINIMUM_FADE_BOUNDARY = 0.05f; // When the fade boundary is the same
 
 RelayoutParameters::RelayoutParameters()
 : mPositionOffset(),
-  mLineSize(),
+  mParagraphSize(),
   mWordSize(),
   mCharacterSize(),
   mIndices(),
@@ -48,7 +48,7 @@ RelayoutParameters::RelayoutParameters()
   mIsFirstCharacter( false ),
   mIsFirstCharacterOfWord( false ),
   mIsNewLine( false ),
-  mIsNewLineCharacter( false ),
+  mIsNewParagraphCharacter( false ),
   mIsWhiteSpace( false ),
   mIsVisible( false )
 {
@@ -131,14 +131,14 @@ TextUnderlineStatus::~TextUnderlineStatus()
 {
 }
 
-SubLineLayoutInfo::SubLineLayoutInfo()
+LineLayoutInfo::LineLayoutInfo()
 : mLineLength( 0.f ),
   mMaxCharHeight( 0.f ),
   mMaxAscender( 0.f )
 {
 }
 
-SubLineLayoutInfo::~SubLineLayoutInfo()
+LineLayoutInfo::~LineLayoutInfo()
 {
 }
 
@@ -184,7 +184,7 @@ bool IsExceedingHeight( const Vector3& position, const Size& size, const Size& p
  * @param[out] lineLength The length of the portion of line which doesn't exceed the parant's width
  * @param[out] endWhiteSpaceLength The length of white spaces which are at the end of the line.
  */
-void CalculateLineLength( const bool isWhiteSpace, const float width, const float parentWidth, bool& found, float& lineLength, float& endWhiteSpaceLength )
+void CalculateLineLength( bool isWhiteSpace, float width, float parentWidth, bool& found, float& lineLength, float& endWhiteSpaceLength )
 {
   if( lineLength + width > parentWidth )
   {
@@ -213,9 +213,7 @@ struct CurrentTextActorInfo
   Vector3 position;
   Size size;
   Vector4 color;
-  Vector4 gradientColor;
-  Vector2 startPoint;
-  Vector2 endPoint;
+  TextViewProcessor::GradientInfo* gradientInfo;
 };
 
 void SetVisualParameters( CurrentTextActorInfo& currentTextActorInfo,
@@ -224,9 +222,12 @@ void SetVisualParameters( CurrentTextActorInfo& currentTextActorInfo,
                           const float lineHeight )
 {
   currentTextActorInfo.textActor.SetTextColor( currentTextActorInfo.color );
-  currentTextActorInfo.textActor.SetGradientColor( currentTextActorInfo.gradientColor );
-  currentTextActorInfo.textActor.SetGradientStartPoint( currentTextActorInfo.startPoint );
-  currentTextActorInfo.textActor.SetGradientEndPoint( currentTextActorInfo.endPoint );
+  if( NULL != currentTextActorInfo.gradientInfo )
+  {
+    currentTextActorInfo.textActor.SetGradientColor( currentTextActorInfo.gradientInfo->mGradientColor );
+    currentTextActorInfo.textActor.SetGradientStartPoint( currentTextActorInfo.gradientInfo->mStartPoint );
+    currentTextActorInfo.textActor.SetGradientEndPoint( currentTextActorInfo.gradientInfo->mEndPoint );
+  }
 
   // The italics offset is used in the offscreen rendering. When text is in italics, it may exceed the text-view's boundary
   // due to the trick used to implement it.
@@ -241,12 +242,12 @@ void SetVisualParameters( CurrentTextActorInfo& currentTextActorInfo,
   currentTextActorInfo.textActor.SetBlendMode( !visualParameters.mSnapshotModeEnabled ? BlendingMode::ON : BlendingMode::OFF );
 }
 
-void CalculateSubLineLayout( const float parentWidth,
-                             const TextViewProcessor::TextInfoIndices& indices,
-                             const TextViewProcessor::LineLayoutInfo& lineLayoutInfo,
-                             const HorizontalWrapType splitPolicy,
-                             const float shrinkFactor,
-                             SubLineLayoutInfo& subLineInfo )
+void CalculateLineLayout( float parentWidth,
+                          const TextViewProcessor::TextInfoIndices& indices,
+                          const TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo,
+                          HorizontalWrapType splitPolicy,
+                          float shrinkFactor,
+                          LineLayoutInfo& subLineInfo )
 {
   subLineInfo.mLineLength = 0.f;
   subLineInfo.mMaxCharHeight = 0.f;
@@ -254,108 +255,95 @@ void CalculateSubLineLayout( const float parentWidth,
 
   float endWhiteSpaceLength = 0.f;
 
-  std::size_t wordIndex = indices.mWordIndex;
   std::size_t characterIndex = indices.mCharacterIndex;
   float lineOffset = 0.f;
   bool found = false;
   bool isFirstCharacter = true;
-  for( TextViewProcessor::WordGroupLayoutInfoContainer::const_iterator wordGroupIt = lineLayoutInfo.mWordGroupsLayoutInfo.begin() + indices.mGroupIndex,
-         wordGroupEndIt = lineLayoutInfo.mWordGroupsLayoutInfo.end();
-       ( wordGroupIt != wordGroupEndIt ) && !found;
-       ++wordGroupIt )
+  for( TextViewProcessor::WordLayoutInfoContainer::const_iterator wordIt = paragraphLayoutInfo.mWordsLayoutInfo.begin() + indices.mWordIndex,
+         wordEndIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
+       ( wordIt != wordEndIt ) && !found;
+       ++wordIt )
   {
-    const TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo( *wordGroupIt );
-
-    for( TextViewProcessor::WordLayoutInfoContainer::const_iterator wordIt = wordGroupLayoutInfo.mWordsLayoutInfo.begin() + wordIndex,
-           wordEndIt = wordGroupLayoutInfo.mWordsLayoutInfo.end();
-         ( wordIt != wordEndIt ) && !found;
-         ++wordIt )
-    {
-      const TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordIt );
+    const TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordIt );
 
-      const float shrunkWordWidth = wordLayoutInfo.mSize.width * shrinkFactor;
-      const bool isWhiteSpace = TextViewProcessor::WordSeparator == wordLayoutInfo.mType;
+    const float shrunkWordWidth = wordLayoutInfo.mSize.width * shrinkFactor;
+    const bool isWhiteSpace = TextViewProcessor::WordSeparator == wordLayoutInfo.mType;
 
-      bool splitByCharacter = false;
+    bool splitByCharacter = false;
 
-      switch( splitPolicy )
+    switch( splitPolicy )
+    {
+      case WrapByCharacter:
+      {
+        splitByCharacter = true;
+        break;
+      }
+      case WrapByWord:
+      case WrapByParagraphCharacter: // Fall through
+      {
+        splitByCharacter = false;
+        break;
+      }
+      case WrapByWordAndSplit:
       {
-        case WrapByCharacter:
+        splitByCharacter = ( shrunkWordWidth > parentWidth );
+        break;
+      }
+      case WrapByParagraphCharacterAndSplit:
+      {
+        if( ( 0u != characterIndex ) ||
+            ( ( 0u == characterIndex ) && ( lineOffset + shrunkWordWidth > parentWidth ) ) )
         {
           splitByCharacter = true;
-          break;
         }
-        case WrapByWord:
-        case WrapByLine: // Fall through
+        else
         {
+          lineOffset += shrunkWordWidth;
           splitByCharacter = false;
-          break;
-        }
-        case WrapByWordAndSplit:
-        {
-          splitByCharacter = ( shrunkWordWidth > parentWidth );
-          break;
-        }
-        case WrapByLineAndSplit:
-        {
-          if( ( 0 != characterIndex ) ||
-              ( ( 0 == characterIndex ) && ( lineOffset + shrunkWordWidth > parentWidth ) ) )
-          {
-            splitByCharacter = true;
-          }
-          else
-          {
-            lineOffset += shrunkWordWidth;
-            splitByCharacter = false;
-          }
         }
       }
+    }
 
-      if( splitByCharacter )
+    if( splitByCharacter )
+    {
+      for( TextViewProcessor::CharacterLayoutInfoContainer::const_iterator charIt = wordLayoutInfo.mCharactersLayoutInfo.begin() + characterIndex,
+             charEndIt = wordLayoutInfo.mCharactersLayoutInfo.end();
+           ( charIt != charEndIt ) && !found;
+           ++charIt )
       {
-        for( TextViewProcessor::CharacterLayoutInfoContainer::const_iterator charIt = wordLayoutInfo.mCharactersLayoutInfo.begin() + characterIndex,
-               charEndIt = wordLayoutInfo.mCharactersLayoutInfo.end();
-             ( charIt != charEndIt ) && !found;
-             ++charIt )
+        const TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *charIt );
+        CalculateLineLength( isWhiteSpace, characterLayoutInfo.mSize.width * shrinkFactor, parentWidth, found, subLineInfo.mLineLength, endWhiteSpaceLength );
+        if( !found || isFirstCharacter )
         {
-          const TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *charIt );
-          CalculateLineLength( isWhiteSpace, characterLayoutInfo.mSize.width * shrinkFactor, parentWidth, found, subLineInfo.mLineLength, endWhiteSpaceLength );
-          if( !found || isFirstCharacter )
-          {
-            subLineInfo.mMaxCharHeight = std::max( subLineInfo.mMaxCharHeight, characterLayoutInfo.mSize.height );
-            subLineInfo.mMaxAscender = std::max( subLineInfo.mMaxAscender, characterLayoutInfo.mAscender );
-          }
-
-          // All characters for word 'wordIndex' have been processed.
-          // Next word need to process all characters, so the characterIndex is reset to 0.
-          characterIndex = 0;
-          isFirstCharacter = false;
+          subLineInfo.mMaxCharHeight = std::max( subLineInfo.mMaxCharHeight, characterLayoutInfo.mSize.height );
+          subLineInfo.mMaxAscender = std::max( subLineInfo.mMaxAscender, characterLayoutInfo.mAscender );
         }
 
-        lineOffset += subLineInfo.mLineLength;
+        // All characters for word 'wordIndex' have been processed.
+        // Next word need to process all characters, so the characterIndex is reset to 0.
+        characterIndex = 0u;
+        isFirstCharacter = false;
       }
-      else
+
+      lineOffset += subLineInfo.mLineLength;
+    }
+    else
+    {
+      CalculateLineLength( isWhiteSpace, shrunkWordWidth, parentWidth, found, subLineInfo.mLineLength, endWhiteSpaceLength );
+      if( !found || isFirstCharacter )
       {
-        CalculateLineLength( isWhiteSpace, shrunkWordWidth, parentWidth, found, subLineInfo.mLineLength, endWhiteSpaceLength );
-        if( !found || isFirstCharacter )
-        {
-          subLineInfo.mMaxCharHeight = std::max( subLineInfo.mMaxCharHeight, wordLayoutInfo.mSize.height );
-          subLineInfo.mMaxAscender = std::max( subLineInfo.mMaxAscender, wordLayoutInfo.mAscender );
-        }
-        isFirstCharacter = false;
+        subLineInfo.mMaxCharHeight = std::max( subLineInfo.mMaxCharHeight, wordLayoutInfo.mSize.height );
+        subLineInfo.mMaxAscender = std::max( subLineInfo.mMaxAscender, wordLayoutInfo.mAscender );
       }
+      isFirstCharacter = false;
     }
-
-    // All words for group 'groupIndex' have been processed.
-    // Next group need to process all words, so the wordIndex is reset to 0.
-    wordIndex = 0;
   }
 
   subLineInfo.mMaxCharHeight *= shrinkFactor;
   subLineInfo.mMaxAscender *= shrinkFactor;
 }
 
-float CalculateXoffset( const Toolkit::Alignment::Type horizontalTextAlignment, const float parentWidth, const float wholeTextWidth )
+float CalculateXoffset( Toolkit::Alignment::Type horizontalTextAlignment, float parentWidth, float wholeTextWidth )
 {
   float xOffset( 0.f );
   switch( horizontalTextAlignment )
@@ -384,7 +372,7 @@ float CalculateXoffset( const Toolkit::Alignment::Type horizontalTextAlignment,
   return xOffset;
 }
 
-float CalculateYoffset( const Toolkit::Alignment::Type verticalTextAlignment, const float parentHeight, const float wholeTextHeight )
+float CalculateYoffset( Toolkit::Alignment::Type verticalTextAlignment, float parentHeight, float wholeTextHeight )
 {
   float yOffset( 0.f );
   switch( verticalTextAlignment )
@@ -413,7 +401,7 @@ float CalculateYoffset( const Toolkit::Alignment::Type verticalTextAlignment, co
   return yOffset;
 }
 
-float CalculateJustificationOffset( const Toolkit::TextView::LineJustification justification, const float wholeTextWidth, const float lineLength )
+float CalculateJustificationOffset( Toolkit::TextView::LineJustification justification, float wholeTextWidth, float lineLength )
 {
   float offset = 0.f;
   switch( justification )
@@ -443,7 +431,7 @@ float CalculateJustificationOffset( const Toolkit::TextView::LineJustification j
   return offset;
 }
 
-bool IsVisible( const Vector3& position, const Size& size, const Size& parentSize, const VisibilityTestType type )
+bool IsVisible( const Vector3& position, const Size& size, const Size& parentSize, VisibilityTestType type )
 {
   bool visible = false;
 
@@ -525,77 +513,68 @@ void UpdateAlignment( const TextView::LayoutParameters& layoutParameters,
   const float textHorizontalOffset = CalculateXoffset( layoutParameters.mHorizontalAlignment, relayoutData.mTextViewSize.width, relayoutData.mTextSizeForRelayoutOption.width );
   const float textVerticalOffset = CalculateYoffset( layoutParameters.mVerticalAlignment, relayoutData.mTextViewSize.height, relayoutData.mTextSizeForRelayoutOption.height );
 
-  std::size_t lineJustificationIndex = 0; // Index to the first position of the vector which stores all line justification info.
-  std::size_t infoTableCharacterIndex = 0;
+  std::size_t lineJustificationIndex = 0u; // Index to the first position of the vector which stores all line justification info.
+  std::size_t infoTableCharacterIndex = 0u;
 
-  relayoutParameters.mIndices.mLineIndex = 0;
+  relayoutParameters.mIndices.mParagraphIndex = 0u;
 
-  for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(),
-         endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
-       lineLayoutIt != endLineLayoutIt;
-       ++lineLayoutIt, ++relayoutParameters.mIndices.mLineIndex )
+  for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(),
+         endParagraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+       paragraphLayoutIt != endParagraphLayoutIt;
+       ++paragraphLayoutIt, ++relayoutParameters.mIndices.mParagraphIndex )
   {
-    TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineLayoutIt );
+    TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphLayoutIt );
 
-    relayoutParameters.mIndices.mGroupIndex = 0;
     float justificationOffset = 0.f;
 
-    for( TextViewProcessor::WordGroupLayoutInfoContainer::iterator groupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.begin(),
-           endGroupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.end();
-         groupLayoutIt != endGroupLayoutIt;
-         ++groupLayoutIt, ++relayoutParameters.mIndices.mGroupIndex )
+    relayoutParameters.mIndices.mWordIndex = 0u;
+
+    for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin(),
+           endWordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
+         wordLayoutIt != endWordLayoutIt;
+         ++wordLayoutIt, ++relayoutParameters.mIndices.mWordIndex )
     {
-      TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo( *groupLayoutIt );
+      TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
 
-      relayoutParameters.mIndices.mWordIndex = 0;
+      relayoutParameters.mIndices.mCharacterIndex = 0u;
 
-      for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.begin(),
-             endWordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.end();
-           wordLayoutIt != endWordLayoutIt;
-           ++wordLayoutIt, ++relayoutParameters.mIndices.mWordIndex )
+      for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
+             endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
+           characterLayoutIt != endCharacterLayoutIt;
+           ++characterLayoutIt, ++relayoutParameters.mIndices.mCharacterIndex, ++infoTableCharacterIndex )
       {
-        TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
+        TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
 
-        relayoutParameters.mIndices.mCharacterIndex = 0;
-
-        for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
-               endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
-             characterLayoutIt != endCharacterLayoutIt;
-             ++characterLayoutIt, ++relayoutParameters.mIndices.mCharacterIndex, ++infoTableCharacterIndex )
+        // Calculate line justification offset.
+        if( lineJustificationIndex < relayoutData.mLineJustificationInfo.size() )
         {
-          TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
+          const TextView::LineJustificationInfo lineJustificationInfo( *( relayoutData.mLineJustificationInfo.begin() + lineJustificationIndex ) );
 
-          // Calculate line justification offset.
-          if( lineJustificationIndex < relayoutData.mLineJustificationInfo.size() )
+          if( relayoutParameters.mIndices == lineJustificationInfo.mIndices )
           {
-            const TextView::LineJustificationInfo lineJustificationInfo( *( relayoutData.mLineJustificationInfo.begin() + lineJustificationIndex ) );
-
-            if( relayoutParameters.mIndices == lineJustificationInfo.mIndices )
-            {
-              justificationOffset = CalculateJustificationOffset( layoutParameters.mLineJustification, relayoutData.mTextSizeForRelayoutOption.width, lineJustificationInfo.mLineLength );
-              ++lineJustificationIndex; // increase the index to point the next position in the vector.
-            }
+            justificationOffset = CalculateJustificationOffset( layoutParameters.mLineJustification, relayoutData.mTextSizeForRelayoutOption.width, lineJustificationInfo.mLineLength );
+            ++lineJustificationIndex; // increase the index to point the next position in the vector.
           }
+        }
 
-          // Deletes the offsets if the exceed policies are EllipsizeEnd.
-          const float horizontalOffset = textHorizontalOffset + justificationOffset;
-          characterLayoutInfo.mOffset.x = ( ellipsizeAlignToLeft && ( horizontalOffset < 0.f ) ) ? 0.f : horizontalOffset;
-          characterLayoutInfo.mOffset.y = ( ellipsizeAlignToTop && ( textVerticalOffset < 0.f ) ) ? 0.f : textVerticalOffset;
+        // Deletes the offsets if the exceed policies are EllipsizeEnd.
+        const float horizontalOffset = textHorizontalOffset + justificationOffset;
+        characterLayoutInfo.mOffset.x = ( ellipsizeAlignToLeft && ( horizontalOffset < 0.f ) ) ? 0.f : horizontalOffset;
+        characterLayoutInfo.mOffset.y = ( ellipsizeAlignToTop && ( textVerticalOffset < 0.f ) ) ? 0.f : textVerticalOffset;
 
-          // Updates the size and position table for text-input with the alignment offset.
-          Vector3 positionOffset( characterLayoutInfo.mPosition );
+        // Updates the size and position table for text-input with the alignment offset.
+        Vector3 positionOffset( characterLayoutInfo.mPosition );
 
-          std::vector<Toolkit::TextView::CharacterLayoutInfo>::iterator infoTableIt = relayoutData.mCharacterLayoutInfoTable.begin() + infoTableCharacterIndex;
-          Toolkit::TextView::CharacterLayoutInfo& characterTableInfo( *infoTableIt );
+        std::vector<Toolkit::TextView::CharacterLayoutInfo>::iterator infoTableIt = relayoutData.mCharacterLayoutInfoTable.begin() + infoTableCharacterIndex;
+        Toolkit::TextView::CharacterLayoutInfo& characterTableInfo( *infoTableIt );
 
-          characterTableInfo.mPosition.x = positionOffset.x + characterLayoutInfo.mOffset.x;
-          characterTableInfo.mPosition.y = positionOffset.y + characterLayoutInfo.mOffset.y;
+        characterTableInfo.mPosition.x = positionOffset.x + characterLayoutInfo.mOffset.x;
+        characterTableInfo.mPosition.y = positionOffset.y + characterLayoutInfo.mOffset.y;
 
-          positionOffset.x += characterLayoutInfo.mAdvance * relayoutData.mShrinkFactor;
-        } // end characters
-      } // end words
-    } // end group of words
-  } // end lines
+        positionOffset.x += characterLayoutInfo.mSize.width * relayoutData.mShrinkFactor;
+      } // end characters
+    } // end words
+  } // end paragraphs
 }
 
 void CalculateBearing( TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo,
@@ -639,14 +618,13 @@ void CalculateBearing( TextViewProcessor::CharacterLayoutInfo& characterLayoutIn
   //            gggggggggg
   //            gggggggggg
 
-  const Toolkit::TextView::LineLayoutInfo& lineInfo( *( relayoutData.mLines.end() - 1 ) );
+  const Toolkit::TextView::LineLayoutInfo& lineInfo( *( relayoutData.mLines.end() - 1u ) );
   const float bearingOffset = ( lineInfo.mSize.height - lineInfo.mAscender ) - ( characterLayoutInfo.mSize.height - characterLayoutInfo.mAscender );
 
   characterLayoutInfo.mPosition.y -= bearingOffset * relayoutData.mShrinkFactor;
 }
 
 void UpdateLayoutInfoTable( Vector4& minMaxXY,
-                            TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo,
                             TextViewProcessor::WordLayoutInfo& wordLayoutInfo,
                             TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo,
                             RelayoutParameters& relayoutParameters,
@@ -664,17 +642,17 @@ void UpdateLayoutInfoTable( Vector4& minMaxXY,
 
   const float descender = characterLayoutInfo.mSize.height - characterLayoutInfo.mAscender;
 
-  const Toolkit::TextView::CharacterLayoutInfo characterLayoutTableInfo( Size( characterLayoutInfo.mAdvance * relayoutData.mShrinkFactor,
-                                                                               characterLayoutInfo.mHeight * relayoutData.mShrinkFactor ),
+  const Toolkit::TextView::CharacterLayoutInfo characterLayoutTableInfo( Size( characterLayoutInfo.mSize.width * relayoutData.mShrinkFactor,
+                                                                               characterLayoutInfo.mSize.height * relayoutData.mShrinkFactor ),
                                                                          positionOffset,
-                                                                         ( TextViewProcessor::LineSeparator == wordLayoutInfo.mType ),
-                                                                         ( TextViewProcessor::RTL == wordGroupLayoutInfo.mDirection ),
+                                                                         ( TextViewProcessor::ParagraphSeparator == wordLayoutInfo.mType ),
+                                                                         false, // VCC set the correct direction if needed.
                                                                          true,
                                                                          descender );
 
   relayoutData.mCharacterLayoutInfoTable.push_back( characterLayoutTableInfo );
 
-  positionOffset.x += characterLayoutInfo.mAdvance * relayoutData.mShrinkFactor;
+  positionOffset.x += characterLayoutInfo.mSize.width * relayoutData.mShrinkFactor;
 }
 
 void CalculateVisibilityForFade( const Internal::TextView::LayoutParameters& layoutParameters,
@@ -835,6 +813,11 @@ void CalculateVisibilityForFade( const Internal::TextView::LayoutParameters& lay
     Vector2 startPoint = Vector2::ZERO;
     Vector2 endPoint = Vector2::ZERO;
 
+    if( NULL == characterLayoutInfo.mGradientInfo )
+    {
+      characterLayoutInfo.mGradientInfo = new TextViewProcessor::GradientInfo();
+    }
+
     if( !( rightFadeOut && leftFadeOut ) )
     {
       // Current implementation can't set gradient parameters for a text-actor exceeding at the same time the left and the right boundaries.
@@ -889,9 +872,9 @@ void CalculateVisibilityForFade( const Internal::TextView::LayoutParameters& lay
       }
     }
 
-    characterLayoutInfo.mGradientColor = gradientColor;
-    characterLayoutInfo.mStartPoint = startPoint;
-    characterLayoutInfo.mEndPoint = endPoint;
+    characterLayoutInfo.mGradientInfo->mGradientColor = gradientColor;
+    characterLayoutInfo.mGradientInfo->mStartPoint = startPoint;
+    characterLayoutInfo.mGradientInfo->mEndPoint = endPoint;
   }
   else
   {
@@ -1091,7 +1074,6 @@ void CreateEllipsizeTextActor( const EllipsizeParameters& ellipsizeParameters,
       ellipsizeText.Append( ellipsizeCharacterLayoutInfo.mStyledText.mText );
       TextViewProcessor::UpdateSize( ellipsizeSize, ellipsizeCharacterLayoutInfo.mSize );
     }
-
   }
 
   if( !ellipsizeText.IsEmpty() )
@@ -1110,16 +1092,16 @@ void EllipsizeLine( const TextView::LayoutParameters& layoutParameters,
                     EllipsizeParameters& ellipsizeParameters,
                     TextView::RelayoutData& relayoutData )
 {
-  // Traverses the text layout info from the first character of the laid out line
+  // Traverses the text layout info from the first character of the line
   // to the last one setting to each character its visibility. If needed, it adds the ellipsize text (...).
 
-  // Indices to the first character of the laid out line.
+  // Indices to the first character of the line.
   TextViewProcessor::TextInfoIndices firstIndices;
   TextViewProcessor::GetIndicesFromGlobalCharacterIndex( ellipsizeParameters.mFirstIndex,
                                                          relayoutData.mTextLayoutInfo,
                                                          firstIndices );
 
-  // Indices to the last character of the laid out line.
+  // Indices to the last character of the line.
   TextViewProcessor::TextInfoIndices lastIndices;
   TextViewProcessor::GetIndicesFromGlobalCharacterIndex( ellipsizeParameters.mLastIndex,
                                                          relayoutData.mTextLayoutInfo,
@@ -1130,12 +1112,12 @@ void EllipsizeLine( const TextView::LayoutParameters& layoutParameters,
   ellipsizeParameters.mEllipsizeBoundary = relayoutData.mTextViewSize;
   ellipsizeParameters.mEllipsizeBoundary.width -= relayoutData.mTextLayoutInfo.mEllipsizeLayoutInfo.mSize.width;
 
-  for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + firstIndices.mLineIndex,
-         endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + lastIndices.mLineIndex + 1;
-       lineLayoutIt != endLineLayoutIt;
-       ++lineLayoutIt )
+  for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + firstIndices.mParagraphIndex,
+         endParagraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + lastIndices.mParagraphIndex + 1u;
+       paragraphLayoutIt != endParagraphLayoutIt;
+       ++paragraphLayoutIt )
   {
-    TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineLayoutIt );
+    TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphLayoutIt );
 
     ellipsizeParameters.mLineFits = ellipsizeParameters.mIsLineWidthFullyVisible && ellipsizeParameters.mIsLineHeightFullyVisible && ellipsizeParameters.mIsNextLineFullyVisibleHeight;
 
@@ -1144,124 +1126,95 @@ void EllipsizeLine( const TextView::LayoutParameters& layoutParameters,
       ellipsizeParameters.mEllipsizeBoundary.width = ellipsizeParameters.mLineWidth;
     }
 
-    bool firstGroup = true;
-    bool lastGroup = false;
-    std::size_t groupCount = 0;
-
     bool firstWord = true;
     bool lastWord = false;
 
-    for( TextViewProcessor::WordGroupLayoutInfoContainer::iterator groupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.begin() + firstIndices.mGroupIndex,
-           endGroupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.begin() + lastIndices.mGroupIndex + 1;
-         groupLayoutIt != endGroupLayoutIt;
-         ++groupLayoutIt, ++groupCount )
+    std::size_t wordCount = 0u;
+
+    for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin() + firstIndices.mWordIndex,
+           endWordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin() + lastIndices.mWordIndex + 1u;
+         wordLayoutIt != endWordLayoutIt;
+         ++wordLayoutIt, ++wordCount )
     {
-      TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo( *groupLayoutIt );
+      TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
 
-      if( groupCount == lastIndices.mGroupIndex - firstIndices.mGroupIndex )
+      if( wordCount == lastIndices.mWordIndex - firstIndices.mWordIndex )
       {
-        lastGroup = true;
+        lastWord = true;
       }
 
-      std::size_t wordCount = 0;
-      const std::size_t firstWordIndex = firstGroup ? firstIndices.mWordIndex : 0u;
-      const std::size_t lastWordIndex = lastGroup ? lastIndices.mWordIndex : wordGroupLayoutInfo.mWordsLayoutInfo.size() - 1;
-
-      for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.begin() + firstWordIndex,
-             endWordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.begin() + lastWordIndex + 1;
-           wordLayoutIt != endWordLayoutIt;
-           ++wordLayoutIt, ++wordCount )
+      const std::size_t firstCharacterIndex = firstWord ? firstIndices.mCharacterIndex : 0u;
+      const std::size_t lastCharacterIndex = lastWord ? lastIndices.mCharacterIndex : wordLayoutInfo.mCharactersLayoutInfo.size() - 1u;
+      for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin() + firstCharacterIndex,
+             endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin() + lastCharacterIndex + 1u;
+           characterLayoutIt != endCharacterLayoutIt;
+           ++characterLayoutIt )
       {
-        TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
+        TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
 
-        if( lastGroup && ( wordCount == lastIndices.mWordIndex - firstWordIndex ) )
+        if( ellipsizeParameters.mEllipsizeLine )
         {
-          lastWord = true;
-        }
+          // Calculates the character visibility and whether it needs to be replace by ellipsized text.
+          CalculateVisibilityForEllipsize( layoutParameters,
+                                           characterLayoutInfo,
+                                           ellipsizeParameters,
+                                           relayoutData );
 
-        const std::size_t firstCharacterIndex = firstWord ? firstIndices.mCharacterIndex : 0u;
-        const std::size_t lastCharacterIndex = lastWord ? lastIndices.mCharacterIndex : wordLayoutInfo.mCharactersLayoutInfo.size() - 1;
-        for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin() + firstCharacterIndex,
-               endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin() + lastCharacterIndex + 1;
-             characterLayoutIt != endCharacterLayoutIt;
-             ++characterLayoutIt )
-        {
-          TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
-
-          if( ellipsizeParameters.mEllipsizeLine )
+          if( ellipsizeParameters.mCreateEllipsizedTextActors )
           {
-            // Calculates the character visibility and whether it needs to be replace by ellipsized text.
-            CalculateVisibilityForEllipsize( layoutParameters,
-                                             characterLayoutInfo,
-                                             ellipsizeParameters,
-                                             relayoutData );
-
-            if( ellipsizeParameters.mCreateEllipsizedTextActors )
-            {
-              // Create ellipsize text-actors if the character needs to be replaced.
-              CreateEllipsizeTextActor( ellipsizeParameters,
-                                        relayoutData );
-            }
+            // Create ellipsize text-actors if the character needs to be replaced.
+            CreateEllipsizeTextActor( ellipsizeParameters,
+                                      relayoutData );
           }
-          else
+        }
+        else
+        {
+          if( ( TextView::EllipsizeEnd == layoutParameters.mExceedPolicy ) ||
+              ( TextView::SplitEllipsizeEnd == layoutParameters.mExceedPolicy ))
           {
-            if( ( TextView::EllipsizeEnd == layoutParameters.mExceedPolicy ) ||
-                ( TextView::SplitEllipsizeEnd == layoutParameters.mExceedPolicy ))
+            if( !ellipsizeParameters.mIsLineHeightFullyVisible )
             {
-              if( !ellipsizeParameters.mIsLineHeightFullyVisible )
-              {
-                // Make characters invisible.
-                characterLayoutInfo.mIsVisible = false;
-              }
+              // Make characters invisible.
+              characterLayoutInfo.mIsVisible = false;
             }
           }
-        } // end characters
-        firstWord = false;
-      } // end words
-      firstGroup = false;
-    } // end groups
-  } // end lines
+        }
+      } // end characters
+      firstWord = false;
+    } // end words
+  } // end paragraphs
 }
 
 void SetTextVisible( TextView::RelayoutData& relayoutData )
 {
-  for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(),
-         endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
-       lineLayoutIt != endLineLayoutIt;
-       ++lineLayoutIt )
+  for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(),
+         endParagraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+       paragraphLayoutIt != endParagraphLayoutIt;
+       ++paragraphLayoutIt )
   {
-    TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineLayoutIt );
+    TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphLayoutIt );
 
-    for( TextViewProcessor::WordGroupLayoutInfoContainer::iterator groupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.begin(),
-           endGroupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.end();
-         groupLayoutIt != endGroupLayoutIt;
-         ++groupLayoutIt )
+    for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin(),
+           endWordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
+         wordLayoutIt != endWordLayoutIt;
+         ++wordLayoutIt )
     {
-      TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo( *groupLayoutIt );
+      TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
 
-      for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.begin(),
-             endWordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.end();
-           wordLayoutIt != endWordLayoutIt;
-           ++wordLayoutIt )
+      for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
+             endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
+           characterLayoutIt != endCharacterLayoutIt;
+           ++characterLayoutIt )
       {
-        TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
+        TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
 
-        for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
-               endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
-             characterLayoutIt != endCharacterLayoutIt;
-             ++characterLayoutIt )
-        {
-          TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
-
-          characterLayoutInfo.mIsVisible = true;
-          characterLayoutInfo.mGradientColor = Vector4::ZERO;
-          characterLayoutInfo.mStartPoint = Vector2::ZERO;
-          characterLayoutInfo.mEndPoint = Vector2::ZERO;
-          characterLayoutInfo.mColorAlpha = characterLayoutInfo.mStyledText.mStyle.GetTextColor().a;
-        } // end characters
-      } // end words
-    } // end group of words
-  } // end lines
+        characterLayoutInfo.mIsVisible = true;
+        delete characterLayoutInfo.mGradientInfo;
+        characterLayoutInfo.mGradientInfo = NULL;
+        characterLayoutInfo.mColorAlpha = characterLayoutInfo.mStyledText.mStyle.GetTextColor().a;
+      } // end characters
+    } // end words
+  } // end paragraphs
 
   // Updates the visibility for text-input..
   for( std::vector<Toolkit::TextView::CharacterLayoutInfo>::iterator it = relayoutData.mCharacterLayoutInfoTable.begin(),
@@ -1284,19 +1237,19 @@ void UpdateVisibilityForFade( const TextView::LayoutParameters& layoutParameters
 
   // Calculates the fade thresholds (from where the text starts to fade out). If any of the fade boundaries is zero, it sets a very small value just to avoid a zero division.
   fadeParameters.mRightFadeBoundary = static_cast<float>( visualParameters.mFadeBoundary.mRight );
-  fadeParameters.mRightFadeBoundaryOffset = ( visualParameters.mFadeBoundary.mRight > 0 ? fadeParameters.mRightFadeBoundary : MINIMUM_FADE_BOUNDARY );
+  fadeParameters.mRightFadeBoundaryOffset = ( visualParameters.mFadeBoundary.mRight > 0u ? fadeParameters.mRightFadeBoundary : MINIMUM_FADE_BOUNDARY );
   fadeParameters.mRightFadeThreshold = relayoutData.mTextViewSize.width - fadeParameters.mRightFadeBoundary;
   fadeParameters.mRightFadeThresholdOffset = relayoutData.mTextViewSize.width - fadeParameters.mRightFadeBoundaryOffset;
   fadeParameters.mLeftFadeBoundary = static_cast<float>( visualParameters.mFadeBoundary.mLeft );
-  fadeParameters.mLeftFadeBoundaryOffset = ( visualParameters.mFadeBoundary.mLeft > 0 ? fadeParameters.mLeftFadeBoundary : MINIMUM_FADE_BOUNDARY );
+  fadeParameters.mLeftFadeBoundaryOffset = ( visualParameters.mFadeBoundary.mLeft > 0u ? fadeParameters.mLeftFadeBoundary : MINIMUM_FADE_BOUNDARY );
   fadeParameters.mLeftFadeThreshold = fadeParameters.mLeftFadeBoundary;
   fadeParameters.mLeftFadeThresholdOffset = fadeParameters.mLeftFadeBoundaryOffset;
   fadeParameters.mTopFadeBoundary = static_cast<float>( visualParameters.mFadeBoundary.mTop );
-  fadeParameters.mTopFadeBoundaryOffset = ( visualParameters.mFadeBoundary.mTop > 0 ? fadeParameters.mTopFadeBoundary : MINIMUM_FADE_BOUNDARY );
+  fadeParameters.mTopFadeBoundaryOffset = ( visualParameters.mFadeBoundary.mTop > 0u ? fadeParameters.mTopFadeBoundary : MINIMUM_FADE_BOUNDARY );
   fadeParameters.mTopFadeThreshold = fadeParameters.mTopFadeBoundary;
   fadeParameters.mTopFadeThresholdOffset = fadeParameters.mTopFadeBoundaryOffset;
   fadeParameters.mBottomFadeBoundary = static_cast<float>( visualParameters.mFadeBoundary.mBottom );
-  fadeParameters.mBottomFadeBoundaryOffset = ( visualParameters.mFadeBoundary.mBottom > 0 ? fadeParameters.mBottomFadeBoundary : MINIMUM_FADE_BOUNDARY );
+  fadeParameters.mBottomFadeBoundaryOffset = ( visualParameters.mFadeBoundary.mBottom > 0u ? fadeParameters.mBottomFadeBoundary : MINIMUM_FADE_BOUNDARY );
   fadeParameters.mBottomFadeThreshold = relayoutData.mTextViewSize.height - fadeParameters.mBottomFadeBoundary;
   fadeParameters.mBottomFadeThresholdOffset = relayoutData.mTextViewSize.height - fadeParameters.mBottomFadeBoundaryOffset;
 
@@ -1306,86 +1259,76 @@ void UpdateVisibilityForFade( const TextView::LayoutParameters& layoutParameters
   fadeParameters.mTopAlphaCoeficients = CalculateRectParameters( Vector2( fadeParameters.mTopFadeThresholdOffset, 1.f ), Vector2( 0.f, 0.f ) );
   fadeParameters.mBottomAlphaCoeficients = CalculateRectParameters( Vector2( fadeParameters.mBottomFadeThresholdOffset, 1.f ), Vector2( relayoutData.mTextViewSize.height, 0.f ) );
 
-  // Traverses all groups of characters and calculates the visibility.
+  // Traverses all characters and calculates the visibility.
 
-  std::size_t infoTableCharacterIndex = 0;
+  std::size_t infoTableCharacterIndex = 0u;
 
-  relayoutParameters.mIndices.mLineIndex = 0;
+  relayoutParameters.mIndices.mParagraphIndex = 0u;
 
-  for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(),
-         endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
-       lineLayoutIt != endLineLayoutIt;
-       ++lineLayoutIt, ++relayoutParameters.mIndices.mLineIndex )
+  for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(),
+         endParagraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+       paragraphLayoutIt != endParagraphLayoutIt;
+       ++paragraphLayoutIt, ++relayoutParameters.mIndices.mParagraphIndex )
   {
-    TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineLayoutIt );
+    TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphLayoutIt );
 
-    relayoutParameters.mIndices.mGroupIndex = 0;
+    relayoutParameters.mIndices.mWordIndex = 0u;
 
-    for( TextViewProcessor::WordGroupLayoutInfoContainer::iterator groupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.begin(),
-           endGroupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.end();
-         groupLayoutIt != endGroupLayoutIt;
-         ++groupLayoutIt, ++relayoutParameters.mIndices.mGroupIndex )
+    for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin(),
+           endWordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
+         wordLayoutIt != endWordLayoutIt;
+         ++wordLayoutIt, ++relayoutParameters.mIndices.mWordIndex )
     {
-      TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo( *groupLayoutIt );
+      TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
 
-      relayoutParameters.mIndices.mWordIndex = 0;
+      relayoutParameters.mIsFirstCharacterOfWord = true;
+      relayoutParameters.mWordSize = wordLayoutInfo.mSize;
+      relayoutParameters.mIndices.mCharacterIndex = 0u;
 
-      for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.begin(),
-             endWordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.end();
-           wordLayoutIt != endWordLayoutIt;
-           ++wordLayoutIt, ++relayoutParameters.mIndices.mWordIndex )
+      for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
+             endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
+           characterLayoutIt != endCharacterLayoutIt;
+           ++characterLayoutIt, ++relayoutParameters.mIndices.mCharacterIndex, ++infoTableCharacterIndex )
       {
-        TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
-
-        relayoutParameters.mIsFirstCharacterOfWord = true;
-        relayoutParameters.mWordSize = wordLayoutInfo.mSize;
-        relayoutParameters.mIndices.mCharacterIndex = 0;
-
-        for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
-               endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
-             characterLayoutIt != endCharacterLayoutIt;
-             ++characterLayoutIt, ++relayoutParameters.mIndices.mCharacterIndex, ++infoTableCharacterIndex )
-        {
-          TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
+        TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
 
-          relayoutParameters.mIsVisible = true;
-          fadeParameters.mIsPartiallyVisible = false;
+        relayoutParameters.mIsVisible = true;
+        fadeParameters.mIsPartiallyVisible = false;
 
-          // Calculates the visibility for the current group of characters.
-          CalculateVisibilityForFade( layoutParameters,
-                                      characterLayoutInfo,
-                                      relayoutParameters,
-                                      fadeParameters,
-                                      relayoutData );
+        // Calculates the visibility for the current character.
+        CalculateVisibilityForFade( layoutParameters,
+                                    characterLayoutInfo,
+                                    relayoutParameters,
+                                    fadeParameters,
+                                    relayoutData );
 
-          // Updates the visibility for text-input..
-          std::vector<Toolkit::TextView::CharacterLayoutInfo>::iterator it = relayoutData.mCharacterLayoutInfoTable.begin() + infoTableCharacterIndex;
+        // Updates the visibility for text-input..
+        std::vector<Toolkit::TextView::CharacterLayoutInfo>::iterator it = relayoutData.mCharacterLayoutInfoTable.begin() + infoTableCharacterIndex;
 
-          Toolkit::TextView::CharacterLayoutInfo& characterLayoutTableInfo( *it );
+        Toolkit::TextView::CharacterLayoutInfo& characterLayoutTableInfo( *it );
 
-          characterLayoutTableInfo.mIsVisible = relayoutParameters.mIsVisible;
+        characterLayoutTableInfo.mIsVisible = relayoutParameters.mIsVisible;
 
-          relayoutParameters.mIsFirstCharacterOfWord = false;
-        } // end group of character
-      } // end words
-    } // end group of words
-  } // end lines
+        relayoutParameters.mIsFirstCharacterOfWord = false;
+      } // end character
+    } // end words
+  } // end paragraphs
 }
 
 void UpdateVisibilityForEllipsize( const TextView::LayoutParameters& layoutParameters,
                                    const TextView::VisualParameters& visualParameters,
                                    TextView::RelayoutData& relayoutData )
 {
-  // Traverses the laid-out lines and checks which ones doesn't fit in the text-view's boundary.
+  // Traverses the lines and checks which ones doesn't fit in the text-view's boundary.
   for( Toolkit::TextView::LineLayoutInfoContainer::const_iterator lineInfoIt = relayoutData.mLines.begin(), endLineInfoIt = relayoutData.mLines.end();
        lineInfoIt != endLineInfoIt;
        ++lineInfoIt )
   {
     const Toolkit::TextView::LineLayoutInfo& lineInfo( *lineInfoIt );
 
-    // To check if a laid-out line fits in the text-view's boundary,
+    // To check if a line fits in the text-view's boundary,
     // get the position of the first character is needed and do the test
-    // with the laid-out line size.
+    // with the line size.
 
     // An bearing offset may have been applied to the first character so it's needed to
     // get the start position of the line.
@@ -1395,15 +1338,15 @@ void UpdateVisibilityForEllipsize( const TextView::LayoutParameters& layoutParam
 
     // Retrieves the first index and the last index of the line.
     ellipsizeParameters.mFirstIndex = lineInfo.mCharacterGlobalIndex;
-    ellipsizeParameters.mLastIndex = 0;
-    if( ( lineInfoIt + 1 ) != endLineInfoIt )
+    ellipsizeParameters.mLastIndex = 0u;
+    if( ( lineInfoIt + 1u ) != endLineInfoIt )
     {
-      const Toolkit::TextView::LineLayoutInfo& nextLineInfo( *( lineInfoIt + 1 ) );
-      ellipsizeParameters.mLastIndex = nextLineInfo.mCharacterGlobalIndex - 1;
+      const Toolkit::TextView::LineLayoutInfo& nextLineInfo( *( lineInfoIt + 1u ) );
+      ellipsizeParameters.mLastIndex = nextLineInfo.mCharacterGlobalIndex - 1u;
     }
     else
     {
-      ellipsizeParameters.mLastIndex = relayoutData.mCharacterLayoutInfoTable.size() - 1;
+      ellipsizeParameters.mLastIndex = relayoutData.mCharacterLayoutInfoTable.size() - 1u;
     }
 
     // Retrieves the first character of the line and build the position of the line with the bearing.
@@ -1447,7 +1390,7 @@ void UpdateVisibilityForEllipsize( const TextView::LayoutParameters& layoutParam
       {
         // Current line is not ellipsized.
         // Need to check if there is a next line and if it's not visible. If there is, current line needs to be ellipsized.
-        Toolkit::TextView::LineLayoutInfoContainer::const_iterator nextLineInfoIt = lineInfoIt + 1;
+        Toolkit::TextView::LineLayoutInfoContainer::const_iterator nextLineInfoIt = lineInfoIt + 1u;
         if( nextLineInfoIt != endLineInfoIt )
         {
           // Retrives the position of the first character of the line and remove
@@ -1521,131 +1464,338 @@ void UpdateVisibility( const TextView::LayoutParameters& layoutParameters,
   }
 }
 
-void UpdateTextActorInfo( const TextView::VisualParameters& visualParameters,
-                          TextView::RelayoutData& relayoutData )
+/**
+ * Creates an image actor for the emoticon.
+ *
+ * @param[in] visualParameters Some visual parameters (fade, sort modifier and blending).
+ * @param[in,out] characterLayout Layout info for the character.
+ * @param[in] character The character.
+ */
+void CreateEmoticon( const TextView::VisualParameters& visualParameters,
+                     TextViewProcessor::CharacterLayoutInfo& characterLayout,
+                     const Character& character )
 {
-  CurrentTextActorInfo currentTextActorInfo;
+  // The character is an emoticon.
+  ImageActor imageActor = ImageActor::DownCast( characterLayout.mGlyphActor );
+  if( !imageActor )
+  {
+    imageActor = ImageActor::New();
 
-  // Traverses the text-actor and layout info data structures.
-  for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(),
-         endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
-       lineLayoutIt != endLineLayoutIt;
-       ++lineLayoutIt )
+    GlyphImage image = GlyphImage::New( character );
+
+    if( image )
+    {
+      imageActor.SetImage( image );
+    }
+  }
+
+  imageActor.SetPosition( Vector3( characterLayout.mPosition.x + characterLayout.mOffset.x,
+                                   characterLayout.mPosition.y + characterLayout.mOffset.y,
+                                   characterLayout.mPosition.z ) );
+  imageActor.SetSize( characterLayout.mSize );
+
+  // Sets the sort modifier value.
+  imageActor.SetSortModifier( visualParameters.mSortModifier );
+
+  characterLayout.mGlyphActor = imageActor;
+}
+
+/**
+ * Creates text-actors for the given text.
+ *
+ * @param[in] visualParameters Some visual parameters (fade, sort modifier and blending).
+ * @param[in,out] relayoutData Natural size (metrics), layout, text-actor info.
+ * @param[in,out] paragraph Layout info for the paragraph.
+ * @param[in,out] characterLayout Layout info for the character.
+ * @param[in] character The character.
+ * @param[in] style The character's style.
+ * @param[in,out] currentTextActorInfo Temporary stores the text-actor's info to be set.
+ * @param[in,out] createGlyphActors Whether to initialize renderable-actor handles.
+ */
+void CreateTextActor( const TextView::VisualParameters& visualParameters,
+                      TextView::RelayoutData& relayoutData,
+                      const TextViewProcessor::ParagraphLayoutInfo& paragraph,
+                      TextViewProcessor::CharacterLayoutInfo& characterLayout,
+                      const Character& character,
+                      const TextStyle& style,
+                      CurrentTextActorInfo& currentTextActorInfo,
+                      bool createGlyphActors )
+{
+  // Set the text-actor for the current traversed text.
+  if( currentTextActorInfo.textActor )
   {
-    TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineLayoutIt );
+    currentTextActorInfo.textActor.SetText( currentTextActorInfo.text );
+    currentTextActorInfo.textActor.SetPosition( currentTextActorInfo.position );
+    currentTextActorInfo.textActor.SetSize( currentTextActorInfo.size );
+
+    SetVisualParameters( currentTextActorInfo,
+                         visualParameters,
+                         relayoutData,
+                         paragraph.mSize.height );
+  }
 
-    for( TextViewProcessor::WordGroupLayoutInfoContainer::iterator groupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.begin(),
-           endGroupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.end();
-         groupLayoutIt != endGroupLayoutIt;
-         ++groupLayoutIt )
+  currentTextActorInfo.text = Text( character );
+  currentTextActorInfo.position = Vector3( characterLayout.mPosition.x + characterLayout.mOffset.x,
+                                           characterLayout.mPosition.y + characterLayout.mOffset.y,
+                                           characterLayout.mPosition.z );
+  currentTextActorInfo.size = characterLayout.mSize * relayoutData.mShrinkFactor;
+
+  currentTextActorInfo.color = style.GetTextColor();
+  currentTextActorInfo.color.a = characterLayout.mColorAlpha;
+
+  currentTextActorInfo.gradientInfo = characterLayout.mGradientInfo;
+
+  TextActor textActor = TextActor::DownCast( characterLayout.mGlyphActor );
+
+  if( createGlyphActors )
+  {
+    if( textActor )
+    {
+      // Try to reuse first the text-actor of this character.
+      textActor.SetTextStyle( style );
+    }
+    else
     {
-      TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo( *groupLayoutIt );
+      // If there is no text-actor, try to retrieve one from the cache.
+      textActor = relayoutData.mTextActorCache.RetrieveTextActor();
 
-      for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.begin(),
-             endWordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.end();
-           wordLayoutIt != endWordLayoutIt;
-           ++wordLayoutIt )
+      // If still there is no text-actor, create one.
+      if( !textActor )
       {
-        TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
+        TextActorParameters parameters( style, TextActorParameters::FONT_DETECTION_OFF );
+        textActor = TextActor::New( Text(), parameters );
+      }
+      else
+      {
+        textActor.SetTextStyle( style );
+      }
+    }
+    characterLayout.mGlyphActor = textActor;
+  }
+
+  // Update the current text-actor.
+  currentTextActorInfo.textActor = textActor;
+}
+
+/**
+ * Traverses the whole paragraph initializating renderable-actor handles and updating them with the new size and position.
+ *
+ * @param[in] visualParameters Some visual parameters (fade, sort modifier and blending).
+ * @param[in,out] relayoutData Natural size (metrics), layout, text-actor info.
+ * @param[in,out] paragraph Layout info for the paragraph.
+ * @param[in,out] characterGlobalIndex Index to the character within the whole text.
+ * @param[in,out] lineLayoutInfoIndex Index to the table of lines.
+ * @param[in,out] createGlyphActors Whether to initialize renderable-actor handles.
+ */
+void UpdateTextActorInfoForParagraph( const TextView::VisualParameters& visualParameters,
+                                      TextView::RelayoutData& relayoutData,
+                                      TextViewProcessor::ParagraphLayoutInfo& paragraph,
+                                      std::size_t& characterGlobalIndex,
+                                      std::size_t& lineLayoutInfoIndex,
+                                      bool createGlyphActors )
+{
+  CurrentTextActorInfo currentTextActorInfo;
+
+  const std::size_t lineLayoutInfoSize = relayoutData.mLines.size(); // Number of lines.
+  bool lineLayoutEnd = false;            // Whether lineLayoutInfoIndex points at the last line.
+  bool glyphActorCreatedForLine = false; // Whether a renderable actor has been created for this line.
+
+  TextStyle currentStyle;                // style for the current text-actor.
+
+  TextViewProcessor::GradientInfo* currentGradientInfo = NULL; // gradient color for the current text-actor.
+                                                               // start point for the current text-actor.
+                                                               // end point for the current text-actor.
+
+  bool currentIsColorGlyph = false;      // Whether current glyph is an emoticon.
+
+  std::vector<TextActor> textActorsToRemove; // Keep a vector of text-actors to be included into the cache.
+
+  std::size_t characterParagraphIndex = 0u;   // Index to the character (within the paragraph).
+  for( TextViewProcessor::WordLayoutInfoContainer::iterator wordIt = paragraph.mWordsLayoutInfo.begin(), wordEndIt = paragraph.mWordsLayoutInfo.end();
+       wordIt != wordEndIt;
+       ++wordIt )
+  {
+    TextViewProcessor::WordLayoutInfo& word( *wordIt );
+
+    for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterIt = word.mCharactersLayoutInfo.begin(), characterEndIt = word.mCharactersLayoutInfo.end();
+         characterIt != characterEndIt;
+         ++characterIt )
+    {
+      TextViewProcessor::CharacterLayoutInfo& characterLayout( *characterIt );
 
-        for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
-               endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
-             characterLayoutIt != endCharacterLayoutIt;
-             ++characterLayoutIt )
+      // Check if there is a new line.
+      const bool newLine = !lineLayoutEnd && ( characterGlobalIndex == relayoutData.mLines[lineLayoutInfoIndex].mCharacterGlobalIndex );
+
+      if( newLine )
+      {
+        // Point to the next line.
+        ++lineLayoutInfoIndex;
+        if( lineLayoutInfoIndex >= lineLayoutInfoSize )
         {
-          TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
+          // Arrived at last line.
+          lineLayoutEnd = true; // Avoids access out of bounds in the relayoutData.mLines vector.
+        }
+        glyphActorCreatedForLine = false;
+      }
 
-          if( characterLayoutInfo.mIsColorGlyph )
-          {
-            ImageActor imageActor = ImageActor::DownCast( characterLayoutInfo.mGlyphActor );
+      // Do not create a glyph-actor if there is no text.
+      const Character character = characterLayout.mStyledText.mText[0u]; // there are only one character per character layout.
+      const TextStyle& style = characterLayout.mStyledText.mStyle;
 
-            if( characterLayoutInfo.mSetText )
-            {
-              GlyphImage image = GlyphImage::New( characterLayoutInfo.mStyledText.mText[0] );
+      bool appendCharacter = false;
 
-              if( image )
-              {
-                imageActor.SetImage( image );
-              }
-              characterLayoutInfo.mSetText = false;
-            }
+      if( characterLayout.mIsColorGlyph ||
+          !character.IsWhiteSpace() || // A new paragraph character is also a white space.
+          ( character.IsWhiteSpace() && style.IsUnderlineEnabled() ) )
+      {
+        // Do not create a glyph-actor if it's a white space (without underline) or a new paragraph character.
+
+        // Check if the character has the same gradient info than the current one.
+        bool differentGradientInfo = false;
+        if( characterLayout.mGradientInfo && currentGradientInfo )
+        {
+          differentGradientInfo = ( characterLayout.mGradientInfo->mGradientColor != currentGradientInfo->mGradientColor ) ||
+            ( characterLayout.mGradientInfo->mStartPoint != currentGradientInfo->mStartPoint ) ||
+            ( characterLayout.mGradientInfo->mEndPoint != currentGradientInfo->mEndPoint );
+        }
+        else if( ( NULL != currentGradientInfo ) || ( NULL != characterLayout.mGradientInfo ) )
+        {
+          differentGradientInfo = true;
+        }
 
-            imageActor.SetPosition( Vector3( characterLayoutInfo.mPosition.x + characterLayoutInfo.mOffset.x,
-                                             characterLayoutInfo.mPosition.y + characterLayoutInfo.mOffset.y,
-                                             characterLayoutInfo.mPosition.z ) );
-            imageActor.SetSize( characterLayoutInfo.mSize );
+        // Creates one glyph-actor for each counsecutive group of characters, with the same style, per line, or if it's an emoticon.
+        if( !glyphActorCreatedForLine ||
+            characterLayout.mIsColorGlyph ||
+            differentGradientInfo ||
+            ( characterLayout.mIsColorGlyph != currentIsColorGlyph ) ||
+            ( style != currentStyle ) )
+        {
+          characterLayout.mSetText = false;
+          characterLayout.mSetStyle = false;
 
-            // Sets the sort modifier value.
-            imageActor.SetSortModifier( visualParameters.mSortModifier );
+          // There is a new style or a new line.
+          glyphActorCreatedForLine = true;
+
+          if( characterLayout.mIsColorGlyph )
+          {
+            CreateEmoticon( visualParameters,
+                            characterLayout,
+                            character );
           }
           else
           {
-            TextActor textActor = TextActor::DownCast( characterLayoutInfo.mGlyphActor );
-            if( textActor )
-            {
-              // There is a new text-actor. Set text and everything to the previous one.
-              if( currentTextActorInfo.textActor )
-              {
-                currentTextActorInfo.textActor.SetText( currentTextActorInfo.text );
-                currentTextActorInfo.textActor.SetPosition( currentTextActorInfo.position );
-                currentTextActorInfo.textActor.SetSize( currentTextActorInfo.size );
+            CreateTextActor( visualParameters,
+                             relayoutData,
+                             paragraph,
+                             characterLayout,
+                             character,
+                             style,
+                             currentTextActorInfo,
+                             createGlyphActors );
+          }
 
-                SetVisualParameters( currentTextActorInfo,
-                                     visualParameters,
-                                     relayoutData,
-                                     lineLayoutInfo.mSize.height );
-              }
+          // Update style to be checked with next characters.
+          currentStyle = style;
+          currentGradientInfo = characterLayout.mGradientInfo;
+          currentIsColorGlyph = characterLayout.mIsColorGlyph;
 
-              currentTextActorInfo.text = characterLayoutInfo.mStyledText.mText;
-              currentTextActorInfo.position = Vector3( characterLayoutInfo.mPosition.x + characterLayoutInfo.mOffset.x,
-                                                       characterLayoutInfo.mPosition.y + characterLayoutInfo.mOffset.y,
-                                                       characterLayoutInfo.mPosition.z );
-              currentTextActorInfo.size = characterLayoutInfo.mSize * relayoutData.mShrinkFactor;
+          characterLayout.mGlyphActor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+          characterLayout.mGlyphActor.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
+        }
+        else
+        {
+          DALI_ASSERT_DEBUG( !characterLayout.mIsColorGlyph && "TextViewProcessor::InitializeTextActorInfo. An image-actor doesn't store more than one emoticon." );
 
-              currentTextActorInfo.color = characterLayoutInfo.mStyledText.mStyle.GetTextColor();
-              currentTextActorInfo.color.a = characterLayoutInfo.mColorAlpha;
+          // Same style than previous one.
 
-              currentTextActorInfo.gradientColor = characterLayoutInfo.mGradientColor;
-              currentTextActorInfo.startPoint = characterLayoutInfo.mStartPoint;
-              currentTextActorInfo.endPoint = characterLayoutInfo.mEndPoint;
+          // Add the character to the current text-actor and update the size.
+          appendCharacter = true;
 
-              // Update the current text-actor.
-              currentTextActorInfo.textActor = textActor;
-            }
-            else
-            {
-              // If this character layout has no text-actor is because this character has the same style than previous one.
-              // Add the character to the current text-actor and update the size.
-              if( characterLayoutInfo.mIsVisible && ( TextViewProcessor::LineSeparator != wordLayoutInfo.mType ) )
-              {
-                currentTextActorInfo.text.Append( characterLayoutInfo.mStyledText.mText );
+          TextActor textActor = TextActor::DownCast( characterLayout.mGlyphActor );
+          if( textActor )
+          {
+            // There is a previously created text-actor for this character.
+            // If this character has another one put it into the cache.
+            textActor.SetText( "" );
+            textActorsToRemove.push_back( textActor );
+          }
 
-                currentTextActorInfo.position.y = std::min( currentTextActorInfo.position.y, ( characterLayoutInfo.mPosition.y + characterLayoutInfo.mOffset.y ) );
-                currentTextActorInfo.size.width += characterLayoutInfo.mSize.width * relayoutData.mShrinkFactor;
-                currentTextActorInfo.size.height = std::max( currentTextActorInfo.size.height, characterLayoutInfo.mSize.height * relayoutData.mShrinkFactor );
-              }
-            }
+          if( characterLayout.mGlyphActor )
+          {
+            characterLayout.mGlyphActor.Reset();
           }
-        } // end characters
-      } // end words
+        }
+      } // no white space / new paragraph char
+      else
+      {
+        appendCharacter = true;
+      }
 
-      if( !currentTextActorInfo.text.IsEmpty() )
+      if( appendCharacter )
       {
-        if( currentTextActorInfo.textActor )
+        // Add the character to the current text-actor and update the size.
+        if( characterLayout.mIsVisible && ( TextViewProcessor::ParagraphSeparator != word.mType ) )
         {
-          currentTextActorInfo.textActor.SetText( currentTextActorInfo.text );
-          currentTextActorInfo.textActor.SetPosition( currentTextActorInfo.position );
-          currentTextActorInfo.textActor.SetSize( currentTextActorInfo.size );
+          currentTextActorInfo.text.Append( character );
 
-          SetVisualParameters( currentTextActorInfo,
-                               visualParameters,
-                               relayoutData,
-                               lineLayoutInfo.mSize.height );
+          currentTextActorInfo.position.y = std::min( currentTextActorInfo.position.y, ( characterLayout.mPosition.y + characterLayout.mOffset.y ) );
+          currentTextActorInfo.size.width += characterLayout.mSize.width * relayoutData.mShrinkFactor;
+          currentTextActorInfo.size.height = std::max( currentTextActorInfo.size.height, characterLayout.mSize.height * relayoutData.mShrinkFactor );
         }
       }
-    } //end groups of words
-  } // end lines
 
+      ++characterGlobalIndex;
+      ++characterParagraphIndex;
+    } // characters
+  } // words
+
+  if( !currentTextActorInfo.text.IsEmpty() )
+  {
+    if( currentTextActorInfo.textActor )
+    {
+      currentTextActorInfo.textActor.SetText( currentTextActorInfo.text );
+      currentTextActorInfo.textActor.SetPosition( currentTextActorInfo.position );
+      currentTextActorInfo.textActor.SetSize( currentTextActorInfo.size );
+
+      SetVisualParameters( currentTextActorInfo,
+                           visualParameters,
+                           relayoutData,
+                           paragraph.mSize.height );
+    }
+  }
+
+  // Insert the spare text-actors into the cache.
+  relayoutData.mTextActorCache.InsertTextActors( textActorsToRemove );
+}
+
+void UpdateTextActorInfo( const TextView::VisualParameters& visualParameters,
+                          TextView::RelayoutData& relayoutData,
+                          bool createGlyphActors )
+{
+  if( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.empty() )
+  {
+    // nothing to do if there is no paragraphs.
+    return;
+  }
+
+  std::size_t characterGlobalIndex = 0u; // Index to the global character (within the whole text).
+  std::size_t lineLayoutInfoIndex = 0u;  // Index to the line info.
+
+  for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(), paragraphEndIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+       paragraphIt != paragraphEndIt;
+       ++paragraphIt )
+  {
+    TextViewProcessor::ParagraphLayoutInfo& paragraph( *paragraphIt );
+
+    UpdateTextActorInfoForParagraph( visualParameters,
+                                     relayoutData,
+                                     paragraph,
+                                     characterGlobalIndex,
+                                     lineLayoutInfoIndex,
+                                     createGlyphActors );
+  } // paragraphs
+
+  // Set visual parameters for ellipsis renderable actors.
   for( std::vector<RenderableActor>::iterator it = relayoutData.mEllipsizedGlyphActors.begin(),
          endIt = relayoutData.mEllipsizedGlyphActors.end();
        it != endIt;
@@ -1666,90 +1816,83 @@ void UpdateTextActorInfo( const TextView::VisualParameters& visualParameters,
 
 void CalculateUnderlineInfo( TextView::RelayoutData& relayoutData, TextViewRelayout::TextUnderlineStatus& textUnderlineStatus )
 {
-  // Traverse the whole text to find all groups of consecutive underlined characters in the same laid-out line.
+  // Traverse the whole text to find all groups of consecutive underlined characters in the same line.
   //
-  // Note that relayoutData.mTextLayoutInfo contains layout info per line but these lines are the result of split the whole text every time a '\n' is found.
-  // According with the layout option, one of this lines could be laid-out in more than one.
+  // Note that relayoutData.mTextLayoutInfo contains layout info per paragraph but these paragraphs are the result of split the whole text every time a '\n' is found.
+  // According with the layout option, one of this paragraphs could be laid-out in more than one line.
 
-  for( TextViewProcessor::LineLayoutInfoContainer::iterator lineIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(), lineEndIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
-       lineIt != lineEndIt;
-       ++lineIt )
+  for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(), paragraphEndIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+       paragraphIt != paragraphEndIt;
+       ++paragraphIt )
   {
-    TextViewProcessor::LineLayoutInfo& line( *lineIt );
+    TextViewProcessor::ParagraphLayoutInfo& paragraph( *paragraphIt );
 
-    for( TextViewProcessor::WordGroupLayoutInfoContainer::iterator groupIt = line.mWordGroupsLayoutInfo.begin(), groupEndIt = line.mWordGroupsLayoutInfo.end();
-         groupIt != groupEndIt;
-         ++groupIt )
+    for( TextViewProcessor::WordLayoutInfoContainer::iterator wordIt = paragraph.mWordsLayoutInfo.begin(), wordEndIt = paragraph.mWordsLayoutInfo.end();
+         wordIt != wordEndIt;
+         ++wordIt )
     {
-      TextViewProcessor::WordGroupLayoutInfo& group( *groupIt );
+      TextViewProcessor::WordLayoutInfo& word( *wordIt );
 
-      for( TextViewProcessor::WordLayoutInfoContainer::iterator wordIt = group.mWordsLayoutInfo.begin(), wordEndIt = group.mWordsLayoutInfo.end();
-           wordIt != wordEndIt;
-           ++wordIt )
+      for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterIt = word.mCharactersLayoutInfo.begin(), characterEndIt = word.mCharactersLayoutInfo.end();
+           characterIt != characterEndIt;
+           ++characterIt )
       {
-        TextViewProcessor::WordLayoutInfo& word( *wordIt );
+        TextViewProcessor::CharacterLayoutInfo& character( *characterIt );
 
-        for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterIt = word.mCharactersLayoutInfo.begin(), characterEndIt = word.mCharactersLayoutInfo.end();
-             characterIt != characterEndIt;
-             ++characterIt )
+        // Check if current character is the first of a new line
+        const bool isNewLine = ( textUnderlineStatus.mLineGlobalIndex < relayoutData.mLines.size() ) &&
+          ( textUnderlineStatus.mCharacterGlobalIndex == ( *( relayoutData.mLines.begin() + textUnderlineStatus.mLineGlobalIndex ) ).mCharacterGlobalIndex );
+        if( isNewLine )
         {
-          TextViewProcessor::CharacterLayoutInfo& characterGroup( *characterIt );
+          ++textUnderlineStatus.mLineGlobalIndex; // If it's a new line, point to the next one.
+        }
 
-          // Check if current character is the first of a new laid-out line
-          const bool isNewLine = ( textUnderlineStatus.mLineGlobalIndex < relayoutData.mLines.size() ) &&
-                                 ( textUnderlineStatus.mCharacterGlobalIndex == ( *( relayoutData.mLines.begin() + textUnderlineStatus.mLineGlobalIndex ) ).mCharacterGlobalIndex );
-          if( isNewLine )
+        if( character.mStyledText.mStyle.IsUnderlineEnabled() )
+        {
+          if( !textUnderlineStatus.mCurrentUnderlineStatus || // Current character is underlined but previous one it wasn't.
+              isNewLine )                                     // Current character is underlined and is the first of current line.
           {
-            ++textUnderlineStatus.mLineGlobalIndex; // If it's a new line, point to the next one.
-          }
+            // Create a new underline info for the current underlined characters.
+            UnderlineInfo underlineInfo;
+            underlineInfo.mMaxHeight = character.mSize.height;
+            underlineInfo.mMaxThickness = character.mUnderlineThickness;
+            underlineInfo.mPosition = character.mUnderlinePosition;
 
-          if( characterGroup.mStyledText.mStyle.IsUnderlineEnabled() )
+            textUnderlineStatus.mUnderlineInfo.push_back( underlineInfo );
+
+            textUnderlineStatus.mCurrentUnderlineStatus = true; // Set the current text is underlined.
+          }
+          else
           {
-            if( !textUnderlineStatus.mCurrentUnderlineStatus || // Current character is underlined but previous one it wasn't.
-                isNewLine )                                     // Current character is underlined and is the first of current laid-out line.
-            {
-              // Create a new underline info for the current underlined characters.
-              UnderlineInfo underlineInfo;
-              underlineInfo.mMaxHeight = characterGroup.mSize.height;
-              underlineInfo.mMaxThickness = characterGroup.mUnderlineThickness;
-              underlineInfo.mPosition = characterGroup.mUnderlinePosition;
+            // Retrieve last underline info and update it if current underline thickness is bigger.
+            UnderlineInfo& underlineInfo( *( textUnderlineStatus.mUnderlineInfo.end() - 1u ) );
 
-              textUnderlineStatus.mUnderlineInfo.push_back( underlineInfo );
+            underlineInfo.mMaxHeight = std::max( underlineInfo.mMaxHeight, character.mSize.height );
 
-              textUnderlineStatus.mCurrentUnderlineStatus = true; // Set the current text is underlined.
-            }
-            else
+            if( character.mUnderlineThickness > underlineInfo.mMaxThickness )
             {
-              // Retrieve last underline info and update it if current underline thickness is bigger.
-              UnderlineInfo& underlineInfo( *( textUnderlineStatus.mUnderlineInfo.end() - 1 ) );
-
-              underlineInfo.mMaxHeight = std::max( underlineInfo.mMaxHeight, characterGroup.mSize.height );
-
-              if( characterGroup.mUnderlineThickness > underlineInfo.mMaxThickness )
-              {
-                underlineInfo.mMaxThickness = characterGroup.mUnderlineThickness;
-                underlineInfo.mPosition = characterGroup.mUnderlinePosition;
-              }
+              underlineInfo.mMaxThickness = character.mUnderlineThickness;
+              underlineInfo.mPosition = character.mUnderlinePosition;
             }
           }
-          else
-          {
-            textUnderlineStatus.mCurrentUnderlineStatus = false;
-          }
+        }
+        else
+        {
+          textUnderlineStatus.mCurrentUnderlineStatus = false;
+        }
 
-          ++textUnderlineStatus.mCharacterGlobalIndex;
-        } // end group of characters.
-      } // end words.
-    } // end group of words.
-  } // end lines.
+        ++textUnderlineStatus.mCharacterGlobalIndex;
+      } // end characters.
+    } // end words.
+  } // end paragraphs.
 }
 
 void SetUnderlineInfo( TextView::RelayoutData& relayoutData )
 {
-  // Stores for each group of consecutive underlined text in each laid-out line its maximum thicknes, its position of that thickness and the maximum character's height.
+  // Stores for each group of consecutive underlined characters in each line its maximum thicknes, its position of that thickness and the maximum character's height.
   TextViewRelayout::TextUnderlineStatus textUnderlineStatus;
 
-  // Traverse the whole text to find all groups of consecutive underlined characters in the same laid-out line.
+  // Traverse the whole text to find all groups of consecutive underlined characters in the same line.
   CalculateUnderlineInfo( relayoutData, textUnderlineStatus );
 
   if( textUnderlineStatus.mUnderlineInfo.empty() )
@@ -1773,106 +1916,99 @@ void SetUnderlineInfo( TextView::RelayoutData& relayoutData )
 
   // Whether current text is underlined.
   textUnderlineStatus.mCurrentUnderlineStatus = false;
-  textUnderlineStatus.mCharacterGlobalIndex = 0;
-  textUnderlineStatus.mLineGlobalIndex = 0;
+  textUnderlineStatus.mCharacterGlobalIndex = 0u;
+  textUnderlineStatus.mLineGlobalIndex = 0u;
 
   float currentLineHeight = 0.f;
   float currentLineAscender = 0.f;
 
-  for( TextViewProcessor::LineLayoutInfoContainer::iterator lineIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(), lineEndIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
-       lineIt != lineEndIt;
-       ++lineIt )
+  for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(), paragraphEndIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+       paragraphIt != paragraphEndIt;
+       ++paragraphIt )
   {
-    TextViewProcessor::LineLayoutInfo& line( *lineIt );
+    TextViewProcessor::ParagraphLayoutInfo& paragraph( *paragraphIt );
 
-    for( TextViewProcessor::WordGroupLayoutInfoContainer::iterator groupIt = line.mWordGroupsLayoutInfo.begin(), groupEndIt = line.mWordGroupsLayoutInfo.end();
-         groupIt != groupEndIt;
-         ++groupIt )
+    for( TextViewProcessor::WordLayoutInfoContainer::iterator wordIt = paragraph.mWordsLayoutInfo.begin(), wordEndIt = paragraph.mWordsLayoutInfo.end();
+         wordIt != wordEndIt;
+         ++wordIt )
     {
-      TextViewProcessor::WordGroupLayoutInfo& group( *groupIt );
+      TextViewProcessor::WordLayoutInfo& word( *wordIt );
 
-      for( TextViewProcessor::WordLayoutInfoContainer::iterator wordIt = group.mWordsLayoutInfo.begin(), wordEndIt = group.mWordsLayoutInfo.end();
-           wordIt != wordEndIt;
-           ++wordIt )
+      for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterIt = word.mCharactersLayoutInfo.begin(), characterEndIt = word.mCharactersLayoutInfo.end();
+           characterIt != characterEndIt;
+           ++characterIt )
       {
-        TextViewProcessor::WordLayoutInfo& word( *wordIt );
+        TextViewProcessor::CharacterLayoutInfo& character( *characterIt );
 
-        for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterIt = word.mCharactersLayoutInfo.begin(), characterEndIt = word.mCharactersLayoutInfo.end();
-             characterIt != characterEndIt;
-             ++characterIt )
-        {
-          TextViewProcessor::CharacterLayoutInfo& characterGroup( *characterIt );
+        // Check if current character is the first of a new line
 
-          // Check if current character is the first of a new laid-out line
+        bool isNewLine = false;
 
-          bool isNewLine = false;
+        if( textUnderlineStatus.mLineGlobalIndex < relayoutData.mLines.size() )
+        {
+          const Toolkit::TextView::LineLayoutInfo& lineLayoutInfo( *( relayoutData.mLines.begin() + textUnderlineStatus.mLineGlobalIndex ) );
+          isNewLine = ( textUnderlineStatus.mCharacterGlobalIndex == lineLayoutInfo.mCharacterGlobalIndex );
 
-          if( textUnderlineStatus.mLineGlobalIndex < relayoutData.mLines.size() )
+          if( isNewLine )
           {
-            const Toolkit::TextView::LineLayoutInfo& lineLayoutInfo( *( relayoutData.mLines.begin() + textUnderlineStatus.mLineGlobalIndex ) );
-            isNewLine = ( textUnderlineStatus.mCharacterGlobalIndex == lineLayoutInfo.mCharacterGlobalIndex );
-
-            if( isNewLine )
-            {
-              currentLineHeight = lineLayoutInfo.mSize.height;
-              currentLineAscender = lineLayoutInfo.mAscender;
-              ++textUnderlineStatus.mLineGlobalIndex; // If it's a new line, point to the next one.
-            }
+            currentLineHeight = lineLayoutInfo.mSize.height;
+            currentLineAscender = lineLayoutInfo.mAscender;
+            ++textUnderlineStatus.mLineGlobalIndex; // If it's a new line, point to the next one.
           }
+        }
 
-          if( characterGroup.mStyledText.mStyle.IsUnderlineEnabled() )
+        if( character.mStyledText.mStyle.IsUnderlineEnabled() )
+        {
+          if( textUnderlineStatus.mCurrentUnderlineStatus )
           {
-            if( textUnderlineStatus.mCurrentUnderlineStatus )
+            if( isNewLine )
             {
-              if( isNewLine )
+              // Retrieves the thickness and position for the next piece of underlined text.
+              if( underlineInfoIt < underlineInfoEndIt )
               {
-                // Retrieves the thickness and position for the next piece of underlined text.
+                ++underlineInfoIt;
                 if( underlineInfoIt < underlineInfoEndIt )
                 {
-                  ++underlineInfoIt;
-                  if( underlineInfoIt < underlineInfoEndIt )
-                  {
-                    underlineInfo = *underlineInfoIt;
-                  }
+                  underlineInfo = *underlineInfoIt;
                 }
               }
             }
+          }
 
-            textUnderlineStatus.mCurrentUnderlineStatus = true;
+          textUnderlineStatus.mCurrentUnderlineStatus = true;
 
-            // Before setting the position it needs to be adjusted to match the base line.
-            const float bearingOffset = ( currentLineHeight - currentLineAscender ) - ( characterGroup.mSize.height - characterGroup.mAscender );
-            const float positionOffset = ( underlineInfo.mMaxHeight - characterGroup.mSize.height ) - bearingOffset;
+          // Before setting the position it needs to be adjusted to match the base line.
+          const float bearingOffset = ( currentLineHeight - currentLineAscender ) - ( character.mSize.height - character.mAscender );
+          const float positionOffset = ( underlineInfo.mMaxHeight - character.mSize.height ) - bearingOffset;
 
-            // Sets the underline's parameters.
-            characterGroup.mStyledText.mStyle.SetUnderline( true, underlineInfo.mMaxThickness, underlineInfo.mPosition - positionOffset );
+          // Sets the underline's parameters.
+          character.mStyledText.mStyle.SetUnderline( true, underlineInfo.mMaxThickness, underlineInfo.mPosition - positionOffset );
 
-            // Mark the group of characters to be set the new style into the text-actor.
-            characterGroup.mSetStyle = true;
-          }
-          else
+          // Mark the character to be set the new style into the text-actor.
+          character.mSetStyle = true;
+        }
+        else
+        {
+          if( textUnderlineStatus.mCurrentUnderlineStatus )
           {
-            if( textUnderlineStatus.mCurrentUnderlineStatus )
-            {
-              textUnderlineStatus.mCurrentUnderlineStatus = false;
+            textUnderlineStatus.mCurrentUnderlineStatus = false;
 
-              // Retrieves the thickness and position for the next piece of underlined text.
+            // Retrieves the thickness and position for the next piece of underlined text.
+            if( underlineInfoIt < underlineInfoEndIt )
+            {
+              ++underlineInfoIt;
               if( underlineInfoIt < underlineInfoEndIt )
               {
-                ++underlineInfoIt;
-                if( underlineInfoIt < underlineInfoEndIt )
-                {
-                  underlineInfo = *underlineInfoIt;
-                }
+                underlineInfo = *underlineInfoIt;
               }
             }
           }
+        }
 
-          ++textUnderlineStatus.mCharacterGlobalIndex;
-        } // end of group of characters.
-      } // end of word.
-    } // end of group of words.
-  } // end of lines.
+        ++textUnderlineStatus.mCharacterGlobalIndex;
+      } // end of characters.
+    } // end of word.
+  } // end of paragraphs.
 }
 
 void RemoveGlyphActors( Actor textView,
@@ -1890,59 +2026,41 @@ void RemoveGlyphActors( Actor textView,
   }
 }
 
-void InsertToTextView( const TextView::RelayoutOperationMask relayoutOperationMask,
-                       Actor textView,
+void InsertToTextView( Actor textView,
                        TextView::RelayoutData& relayoutData )
 {
-  const bool insertToTextView = relayoutOperationMask & TextView::RELAYOUT_INSERT_TO_TEXT_VIEW;
-  const bool insertToTextActorList = relayoutOperationMask & TextView::RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST;
-
   // Add text-actors to the text-view.
 
-  for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(),
-         endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
-       lineLayoutIt != endLineLayoutIt;
-       ++lineLayoutIt )
+  for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(),
+         endParagraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+       paragraphLayoutIt != endParagraphLayoutIt;
+       ++paragraphLayoutIt )
   {
-    TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineLayoutIt );
+    TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphLayoutIt );
 
-    for( TextViewProcessor::WordGroupLayoutInfoContainer::iterator groupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.begin(),
-           endGroupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.end();
-         groupLayoutIt != endGroupLayoutIt;
-         ++groupLayoutIt )
+    for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin(),
+           endWordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
+         wordLayoutIt != endWordLayoutIt;
+         ++wordLayoutIt )
     {
-      TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo( *groupLayoutIt );
+      TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
 
-      for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.begin(),
-             endWordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.end();
-           wordLayoutIt != endWordLayoutIt;
-           ++wordLayoutIt )
+      for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
+             endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
+           characterLayoutIt != endCharacterLayoutIt;
+           ++characterLayoutIt )
       {
-        TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
+        TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
 
-        for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
-               endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
-             characterLayoutIt != endCharacterLayoutIt;
-             ++characterLayoutIt )
+        if( characterLayoutInfo.mIsVisible && characterLayoutInfo.mGlyphActor ) // White spaces and '\n' characters doesn't have a text-actor.
         {
-          TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
-
-          if( characterLayoutInfo.mIsVisible && characterLayoutInfo.mGlyphActor ) // White spaces and '\n' characters doesn't have a text-actor.
-          {
-            //Add to the text-view.
-            if( insertToTextView )
-            {
-              textView.Add( characterLayoutInfo.mGlyphActor );
-            }
-            if( insertToTextActorList )
-            {
-              relayoutData.mGlyphActors.push_back( characterLayoutInfo.mGlyphActor );
-            }
-          }
-        } // end group of character
-      } // end words
-    } // end group of words
-  } // end lines
+          //Add to the text-view.
+          textView.Add( characterLayoutInfo.mGlyphActor );
+          relayoutData.mGlyphActors.push_back( characterLayoutInfo.mGlyphActor );
+        }
+      } // end character
+    } // end words
+  } // end paragraphs
 
   for( std::vector<RenderableActor>::iterator it = relayoutData.mEllipsizedGlyphActors.begin(),
          endIt = relayoutData.mEllipsizedGlyphActors.end();
@@ -1952,14 +2070,8 @@ void InsertToTextView( const TextView::RelayoutOperationMask relayoutOperationMa
     RenderableActor glyphActor = ( *it );
 
     //Add to the text-view.
-    if( insertToTextView )
-    {
-      textView.Add( glyphActor );
-    }
-    if( insertToTextActorList )
-    {
-      relayoutData.mGlyphActors.push_back( glyphActor );
-    }
+    textView.Add( glyphActor );
+    relayoutData.mGlyphActors.push_back( glyphActor );
   }
   relayoutData.mEllipsizedGlyphActors.clear();
 }
index ad288ce..aff3ae3 100644 (file)
@@ -40,15 +40,15 @@ namespace TextViewRelayout
 extern const float MINIMUM_FADE_BOUNDARY; // When the fade boundary is the same as the text-view boundary, this constant reduces it in order to avoid a zero division.
 
 /**
- * Define the type of line wrap.
+ * Define how to wrap a paragraph in lines.
  */
 enum HorizontalWrapType
 {
-  WrapByCharacter,    ///< Wrap a line per character (It may split a word in two).
-  WrapByWord,         ///< Wrap a line by word.
-  WrapByWordAndSplit, ///< Wrap the line by word and split a word if it doesn't fit.
-  WrapByLine,         ///< Wrap the line when a \n is found.
-  WrapByLineAndSplit  ///< Wrap the line when a \n is found and split if it doesn't fit.
+  WrapByCharacter,                  ///< Wrap the paragraph per character (It may split a word in two).
+  WrapByWord,                       ///< Wrap the paragraph by word.
+  WrapByWordAndSplit,               ///< Wrap the paragraph by word and split a word if it doesn't fit.
+  WrapByParagraphCharacter,         ///< Wrap the paragraph when a '\n' is found.
+  WrapByParagraphCharacterAndSplit  ///< Wrap the paragraph when a '\n' is found and split if it doesn't fit.
 };
 
 /**
@@ -83,18 +83,18 @@ struct RelayoutParameters
    */
   ~RelayoutParameters();
 
-  Vector3                            mPositionOffset;           ///< Offset (position.x + size.width, position.y, position.z) of the previous text-actor.
-  Size                               mLineSize;                 ///< Current line's size.
-  Size                               mWordSize;                 ///< Current word's size.
-  Size                               mCharacterSize;            ///< Current character's size.
-  TextViewProcessor::TextInfoIndices mIndices;                  ///< Current indices to line, group of words, word and character.
-  std::size_t                        mCharacterGlobalIndex;     ///< Index to a single character within the whole text.
-  bool                               mIsFirstCharacter:1;       ///< Whether is the first character of the whole text.
-  bool                               mIsFirstCharacterOfWord:1; ///< Whether is the first character of the word.
-  bool                               mIsNewLine:1;              ///< Whether the current character is the first character of a new line.
-  bool                               mIsNewLineCharacter:1;     ///< Whether the current character is a new line character.
-  bool                               mIsWhiteSpace:1;           ///< Whether the current character is a white space.
-  bool                               mIsVisible:1;              ///< Whether the current character is visible.
+  Vector3                            mPositionOffset;            ///< Offset (position.x + size.width, position.y, position.z) of the previous text-actor.
+  Size                               mParagraphSize;             ///< Current paragraphs's size.
+  Size                               mWordSize;                  ///< Current word's size.
+  Size                               mCharacterSize;             ///< Current character's size.
+  TextViewProcessor::TextInfoIndices mIndices;                   ///< Current indices to paragraph, word and character.
+  std::size_t                        mCharacterGlobalIndex;      ///< Index to a single character within the whole text.
+  bool                               mIsFirstCharacter:1;        ///< Whether is the first character of the whole text.
+  bool                               mIsFirstCharacterOfWord:1;  ///< Whether is the first character of the word.
+  bool                               mIsNewLine:1;               ///< Whether the current character is the first character of a new line.
+  bool                               mIsNewParagraphCharacter:1; ///< Whether the current character is a new paragraph character.
+  bool                               mIsWhiteSpace:1;            ///< Whether the current character is a white space.
+  bool                               mIsVisible:1;               ///< Whether the current character is visible.
 };
 
 /**
@@ -160,10 +160,10 @@ struct EllipsizeParameters
 
   Vector3     mPosition;                       ///< Position of the first character of the ellipsize text.
   float       mLineDescender;                  ///< Distance from the base line to the bottom.
-  float       mLineWidth;                      ///< Current laid out line's width.
+  float       mLineWidth;                      ///< Current line's width.
   Size        mEllipsizeBoundary;              ///< Where to start to ellipsize a line.
-  std::size_t mFirstIndex;                     ///< Global index within the whole text of the first character of the laid out line.
-  std::size_t mLastIndex;                      ///< Global index within the whole text of the last character of the laid out line.
+  std::size_t mFirstIndex;                     ///< Global index within the whole text of the first character of the line.
+  std::size_t mLastIndex;                      ///< Global index within the whole text of the last character of the line.
   bool        mEllipsizeLine:1;                ///< Whether current line must be ellipsized.
   bool        mIsLineWidthFullyVisible:1;      ///< Whether current line fits in text-view's width.
   bool        mIsLineHeightFullyVisible:1;     ///< Whether current line fits in text-view's height.
@@ -174,7 +174,7 @@ struct EllipsizeParameters
 };
 
 /**
- * Stores underline info for a group of consecutive characters in the same laid out line.
+ * Stores underline info for a group of consecutive characters in the same line.
  */
 struct UnderlineInfo
 {
@@ -219,50 +219,50 @@ struct TextUnderlineStatus
 
   std::vector<UnderlineInfo> mUnderlineInfo;            ///< Underline info for each group of consecutive underlined characters.
   std::size_t                mCharacterGlobalIndex;     ///< Global index (within the whole text) to current character.
-  std::size_t                mLineGlobalIndex;          ///< Index to current laid out line. It takes into account the current layout configuration (is not the number of \n)
+  std::size_t                mLineGlobalIndex;          ///< Index to current line. It takes into account the current layout configuration (is not the number of \n)
   bool                       mCurrentUnderlineStatus:1; ///< Whether current character is underlined.
 };
 
 /**
- * Stores layout information of the piece of a line.
+ * Stores layout information of a line.
  */
-struct SubLineLayoutInfo
+struct LineLayoutInfo
 {
   /**
    * Default constructor.
    *
    * Initializes each member to its default.
    */
-  SubLineLayoutInfo();
+  LineLayoutInfo();
 
   /**
    * Empty destructor.
    *
    * @note Added to increase coverage.
    */
-  ~SubLineLayoutInfo();
+  ~LineLayoutInfo();
 
-  float mLineLength;    ///< The length of the portion of the line which fits on the text-view width.
-  float mMaxCharHeight; ///< The maximum height of all characters of the portion of line which fits on the text-view width.
-  float mMaxAscender;   ///< The maximum ascender of all characters of the portion of line which fits on the text-view width.
+  float mLineLength;    ///< The length of the portion of the paragraph which fits on the text-view width.
+  float mMaxCharHeight; ///< The maximum height of all characters of the portion of the paragraph which fits on the text-view width.
+  float mMaxAscender;   ///< The maximum ascender of all characters of the portion of the paragraph which fits on the text-view width.
 };
 
 /**
- * Calculates the layout info of the portion of the line which fits on the text-view width.
+ * Calculates the layout info of the portion of the paragraph which fits on the text-view width.
  *
  * @param[in] parentWidth Text-view width
- * @param[in] indices Indices to the word group, word and character.
- * @param[in] lineLayoutInfo Layout info for the line.
- * @param[in] splitPolicy Whether a line is wraped by word, by character or by word and character.
+ * @param[in] indices Indices to the word and character.
+ * @param[in] paragraphLayoutInfo Layout info for the paragraph.
+ * @param[in] splitPolicy Whether a paragraph is wraped by word, by character or by word and character.
  * @param[in] shrinkFactor Shrink factor used.
- * @param[out] layoutInfo Layout information of the part of the line which fits in the text-view width.
+ * @param[out] layoutInfo Layout information of the part of the paragraph which fits in the text-view width.
  */
-void CalculateSubLineLayout( float parentWidth,
-                             const TextViewProcessor::TextInfoIndices& indices,
-                             const TextViewProcessor::LineLayoutInfo& lineLayoutInfo,
-                             HorizontalWrapType splitPolicy,
-                             float shrinkFactor,
-                             SubLineLayoutInfo& layoutInfo );
+void CalculateLineLayout( float parentWidth,
+                          const TextViewProcessor::TextInfoIndices& indices,
+                          const TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo,
+                          HorizontalWrapType splitPolicy,
+                          float shrinkFactor,
+                          LineLayoutInfo& layoutInfo );
 
 /**
  * Calculates the \e x offset position for the whole text.
@@ -342,13 +342,14 @@ void CalculateBearing( TextViewProcessor::CharacterLayoutInfo& characterLayoutIn
  * This table is used to pass the size, the position and other layout info to other controls/actors.
  *
  * @param[in,out] minMaxXY The boundary box of the whole text.
+ * @param[in,out] wordLayoutInfo Word layout info.
  * @param[in,out] characterLayoutInfo Character layout info.
+ * @param[in,out] relayoutParameters Temporary layout parameters.
  * @param[in,out] relayoutData The text-view's data structures.
  */
 void UpdateLayoutInfoTable( Vector4& minMaxXY,
-                            TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo,
                             TextViewProcessor::WordLayoutInfo& wordLayoutInfo,
-                            TextViewProcessor::CharacterLayoutInfo& characterGroupLayoutInfo,
+                            TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo,
                             RelayoutParameters& relayoutParameters,
                             TextView::RelayoutData& relayoutData );
 
@@ -435,13 +436,16 @@ void UpdateVisibility( const TextView::LayoutParameters& layoutParameters,
                        TextView::RelayoutData& relayoutData );
 
 /**
- * Traverse all text updating text-actor handles with new size, position, ...
+ * Traverse all text initializing all non initialized text-actor handles
+ * and updating text-actor handles with new size, position, ...
  *
  * @param[in] visualParameters Some visual parameters (fade, sort modifier and blending).
  * @param[in,out] relayoutData Natural size (metrics), layout, text-actor info.
+ * @param[in] createGlyphActors Whether to create RenderableActor for text-actors or emojis.
  */
 void UpdateTextActorInfo( const TextView::VisualParameters& visualParameters,
-                          TextView::RelayoutData& relayoutData );
+                          TextView::RelayoutData& relayoutData,
+                          bool createGlyphActors );
 
 /**
  * Traverses the whole text and for each piece of underlined text,
@@ -469,14 +473,12 @@ void RemoveGlyphActors( Actor textView,
                         const std::vector<RenderableActor>& glyphActors );
 
 /**
- * Inserts the text-actors into the text-view and/or the text-actor's list.
+ * Inserts the text-actors into the text-view and the text-actor's list.
  *
- * @param[in] relayoutOperationMask Whether the text-actors should be added into the text-view, the list of text-actors or in both.
  * @param[in,out] textView The text-view.
  * @param[in,out] relayoutData The text-view's data structures.
  */
-void InsertToTextView( TextView::RelayoutOperationMask relayoutOperationMask,
-                       Actor textView,
+void InsertToTextView( Actor textView,
                        TextView::RelayoutData& relayoutData );
 
 /**
index 5563ff5..10933a7 100644 (file)
@@ -50,7 +50,7 @@ Vector3 NoShrinkWhenExceedPosition( const TextViewRelayout::RelayoutParameters&
         ( wordOffset + relayoutParameters.mCharacterSize.width > relayoutData.mTextViewSize.width ) ) )
   {
     if( !relayoutParameters.mIsNewLine &&
-        ( relayoutParameters.mIsWhiteSpace || relayoutParameters.mIsNewLineCharacter ) )
+        ( relayoutParameters.mIsWhiteSpace || relayoutParameters.mIsNewParagraphCharacter ) )
     {
       // Current character is a white space. Don't want to move a white space to the next line.
       // These white spaces are placed just in the edge.
@@ -59,18 +59,18 @@ Vector3 NoShrinkWhenExceedPosition( const TextViewRelayout::RelayoutParameters&
     else
     {
       // Calculate the line length and the max character height for the current line.
-      TextViewRelayout::SubLineLayoutInfo subLineInfo;
+      TextViewRelayout::LineLayoutInfo subLineInfo;
       subLineInfo.mLineLength = 0.f;
       subLineInfo.mMaxCharHeight = 0.f;
       subLineInfo.mMaxAscender = 0.f;
-      const TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + relayoutParameters.mIndices.mLineIndex ) );
+      const TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + relayoutParameters.mIndices.mParagraphIndex ) );
 
-      TextViewRelayout::CalculateSubLineLayout( relayoutData.mTextViewSize.width,
-                                                relayoutParameters.mIndices,
-                                                lineLayoutInfo,
-                                                TextViewRelayout::WrapByCharacter,
-                                                1.f, // Shrink factor
-                                                subLineInfo );
+      TextViewRelayout::CalculateLineLayout( relayoutData.mTextViewSize.width,
+                                             relayoutParameters.mIndices,
+                                             paragraphLayoutInfo,
+                                             TextViewRelayout::WrapByCharacter,
+                                             1.f, // Shrink factor
+                                             subLineInfo );
 
       // Stores some info to calculate the line justification in a post-process.
       TextView::LineJustificationInfo justificationInfo;
@@ -82,8 +82,8 @@ Vector3 NoShrinkWhenExceedPosition( const TextViewRelayout::RelayoutParameters&
 
       Toolkit::TextView::LineLayoutInfo lineInfo;
       lineInfo.mCharacterGlobalIndex = relayoutParameters.mCharacterGlobalIndex;    // Index to the first character of the next line.
-      lineInfo.mSize = Size( subLineInfo.mLineLength, subLineInfo.mMaxCharHeight ); // Size of this piece of line.
-      lineInfo.mAscender = subLineInfo.mMaxAscender;                                // Ascender of this piece of line.
+      lineInfo.mSize = Size( subLineInfo.mLineLength, subLineInfo.mMaxCharHeight ); // Size of this piece of paragraph.
+      lineInfo.mAscender = subLineInfo.mMaxAscender;                                // Ascender of this piece of paragraph.
       relayoutData.mLines.push_back( lineInfo );
 
       return Vector3( 0.f, previousPositionY + subLineInfo.mMaxCharHeight + layoutParameters.mLineHeightOffset, 0.f );
@@ -115,103 +115,92 @@ void CalculateSizeAndPosition( const TextView::LayoutParameters& layoutParameter
 
   relayoutParameters.mPositionOffset = Vector3::ZERO;
   relayoutParameters.mIsFirstCharacter = true;
-  relayoutParameters.mIndices.mLineIndex = 0;
-  relayoutParameters.mCharacterGlobalIndex = 0;
+  relayoutParameters.mIndices.mParagraphIndex = 0u;
+  relayoutParameters.mCharacterGlobalIndex = 0u;
 
-  for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(),
-         endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
-       lineLayoutIt != endLineLayoutIt;
-       ++lineLayoutIt, ++relayoutParameters.mIndices.mLineIndex )
+  for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(),
+         endParagraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+       paragraphLayoutIt != endParagraphLayoutIt;
+       ++paragraphLayoutIt, ++relayoutParameters.mIndices.mParagraphIndex )
   {
-    TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineLayoutIt );
+    TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphLayoutIt );
 
     relayoutParameters.mIsNewLine = true;
-    relayoutParameters.mLineSize = lineLayoutInfo.mSize;
-    relayoutParameters.mIndices.mGroupIndex = 0;
+    relayoutParameters.mParagraphSize = paragraphLayoutInfo.mSize;
+    relayoutParameters.mIndices.mWordIndex = 0u;
 
-    for( TextViewProcessor::WordGroupLayoutInfoContainer::iterator groupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.begin(),
-           endGroupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.end();
-         groupLayoutIt != endGroupLayoutIt;
-         ++groupLayoutIt, ++relayoutParameters.mIndices.mGroupIndex )
+    for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin(),
+           endWordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
+         wordLayoutIt != endWordLayoutIt;
+         ++wordLayoutIt, ++relayoutParameters.mIndices.mWordIndex )
     {
-      TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo( *groupLayoutIt );
+      TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
+      relayoutParameters.mIsWhiteSpace = TextViewProcessor::WordSeparator == wordLayoutInfo.mType;
+      relayoutParameters.mIsNewParagraphCharacter = TextViewProcessor::ParagraphSeparator == wordLayoutInfo.mType;
+
+      relayoutParameters.mIsFirstCharacterOfWord = true;
+      relayoutParameters.mWordSize = wordLayoutInfo.mSize;
+      relayoutParameters.mIndices.mCharacterIndex = 0u;
+
+      for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
+             endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
+           characterLayoutIt != endCharacterLayoutIt;
+           ++characterLayoutIt, ++relayoutParameters.mIndices.mCharacterIndex )
+      {
+        TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
 
-      relayoutParameters.mIndices.mWordIndex = 0;
+        relayoutParameters.mCharacterSize = characterLayoutInfo.mSize;
 
-      for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.begin(),
-             endWordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.end();
-           wordLayoutIt != endWordLayoutIt;
-           ++wordLayoutIt, ++relayoutParameters.mIndices.mWordIndex )
-      {
-        TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
-        relayoutParameters.mIsWhiteSpace = TextViewProcessor::WordSeparator == wordLayoutInfo.mType;
-        relayoutParameters.mIsNewLineCharacter = TextViewProcessor::LineSeparator == wordLayoutInfo.mType;
-
-        relayoutParameters.mIsFirstCharacterOfWord = true;
-        relayoutParameters.mWordSize = wordLayoutInfo.mSize;
-        relayoutParameters.mIndices.mCharacterIndex = 0;
-
-        for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
-               endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
-             characterLayoutIt != endCharacterLayoutIt;
-             ++characterLayoutIt, ++relayoutParameters.mIndices.mCharacterIndex )
+        switch( layoutParameters.mExceedPolicy )
         {
-          TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
-
-          relayoutParameters.mCharacterSize = characterLayoutInfo.mSize;
+          case TextView::OriginalShrink:
+          case TextView::SplitOriginal:
+          case TextView::SplitFade:
+          case TextView::SplitEllipsizeEnd:
+          case TextView::SplitShrink:
+          case TextView::ShrinkOriginal:
+          case TextView::ShrinkFade:
+          case TextView::Shrink:
+          case TextView::EllipsizeEndOriginal:
+          case TextView::EllipsizeEnd: // Fall Through
+          {
+            DALI_LOG_WARNING( "SplitByChar::CalculateSizeAndPosition() policy not implemented.\n" );
+            break;
+          }
+          case TextView::OriginalFade:
+          case TextView::FadeOriginal:
+          case TextView::Original:
+          case TextView::Fade: // Fall Through
+          {
+            characterLayoutInfo.mPosition = NoShrinkWhenExceedPosition( relayoutParameters,
+                                                                        layoutParameters,
+                                                                        relayoutData );
 
-          switch( layoutParameters.mExceedPolicy )
+            relayoutParameters.mPositionOffset = characterLayoutInfo.mPosition + Vector3( characterLayoutInfo.mSize.width, 0.f, 0.f );
+            break;
+          }
+          default:
           {
-            case TextView::OriginalShrink:
-            case TextView::SplitOriginal:
-            case TextView::SplitFade:
-            case TextView::SplitEllipsizeEnd:
-            case TextView::SplitShrink:
-            case TextView::ShrinkOriginal:
-            case TextView::ShrinkFade:
-            case TextView::Shrink:
-            case TextView::EllipsizeEndOriginal:
-            case TextView::EllipsizeEnd: // Fall Through
-            {
-              DALI_LOG_WARNING( "SplitByChar::CalculateSizeAndPosition() policy not implemented.\n" );
-              break;
-            }
-            case TextView::OriginalFade:
-            case TextView::FadeOriginal:
-            case TextView::Original:
-            case TextView::Fade: // Fall Through
-            {
-              characterLayoutInfo.mPosition = NoShrinkWhenExceedPosition( relayoutParameters,
-                                                                          layoutParameters,
-                                                                          relayoutData );
-
-              relayoutParameters.mPositionOffset = characterLayoutInfo.mPosition + Vector3( characterLayoutInfo.mSize.width, 0.f, 0.f );
-              break;
-            }
-            default:
-            {
-              DALI_LOG_WARNING( "SplitByChar::CalculateSizeAndPosition() policy combination not possible.\n" );
-            }
+            DALI_LOG_WARNING( "SplitByChar::CalculateSizeAndPosition() policy combination not possible.\n" );
           }
+        }
+
+        // Get last line info and calculate the bearing (used to align glyphs with the baseline).
+        TextViewRelayout::CalculateBearing( characterLayoutInfo, relayoutData );
+
+        // updates min and max position to calculate the text size for split by char.
+        TextViewRelayout::UpdateLayoutInfoTable( minMaxXY,
+                                                 wordLayoutInfo,
+                                                 characterLayoutInfo,
+                                                 relayoutParameters,
+                                                 relayoutData );
 
-          // Get last line info and calculate the bearing (used to align glyphs with the baseline).
-          TextViewRelayout::CalculateBearing( characterLayoutInfo, relayoutData );
-
-          // updates min and max position to calculate the text size for split by char.
-          TextViewRelayout::UpdateLayoutInfoTable( minMaxXY,
-                                                   wordGroupLayoutInfo,
-                                                   wordLayoutInfo,
-                                                   characterLayoutInfo,
-                                                   relayoutParameters,
-                                                   relayoutData );
-
-          ++relayoutParameters.mCharacterGlobalIndex;
-          relayoutParameters.mIsFirstCharacter = false;
-          relayoutParameters.mIsNewLine = false;
-        } // end characters
-      } // end words
-    } // end group of words
-  } // end lines
+        ++relayoutParameters.mCharacterGlobalIndex;
+        relayoutParameters.mIsFirstCharacter = false;
+        relayoutParameters.mIsNewLine = false;
+      } // end characters
+    } // end words
+  } // end paragraphs
 
   if( relayoutData.mCharacterLayoutInfoTable.empty() )
   {
@@ -223,14 +212,14 @@ void CalculateSizeAndPosition( const TextView::LayoutParameters& layoutParameter
     relayoutData.mTextSizeForRelayoutOption.height = minMaxXY.w - minMaxXY.y;
   }
 
-  // Check if the last character is a new line character. In that case the height should be added.
-  if( !relayoutData.mTextLayoutInfo.mLinesLayoutInfo.empty() )
+  // Check if the last character is a new paragraph character. In that case the height should be added.
+  if( !relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.empty() )
   {
-    const TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end() - 1 ) );
+    const TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end() - 1u ) );
 
-    if( lineLayoutInfo.mWordGroupsLayoutInfo.empty() ) // if it's empty, it means the last character is a new line character.
+    if( paragraphLayoutInfo.mWordsLayoutInfo.empty() ) // if it's empty, it means the last character is a new paragraph character.
     {
-      relayoutData.mTextSizeForRelayoutOption.height += lineLayoutInfo.mSize.height;
+      relayoutData.mTextSizeForRelayoutOption.height += paragraphLayoutInfo.mSize.height;
     }
   }
 }
@@ -265,22 +254,18 @@ void Relayout( Actor textView,
                                         relayoutData );
   }
 
-  if( relayoutOperationMask & TextView::RELAYOUT_INITIALIZE_TEXT_ACTORS )
-  {
-    TextViewProcessor::InitializeTextActorInfo( relayoutData );
-  }
-
-  if( relayoutOperationMask & TextView::RELAYOUT_TEXT_ACTOR_UPDATE )
+  const bool initializeTextActors = relayoutOperationMask & TextView::RELAYOUT_INITIALIZE_TEXT_ACTORS;
+  const bool updateTextActors = relayoutOperationMask & TextView::RELAYOUT_TEXT_ACTOR_UPDATE;
+  if( initializeTextActors || updateTextActors )
   {
     TextViewRelayout::UpdateTextActorInfo( visualParameters,
-                                           relayoutData );
+                                           relayoutData,
+                                           initializeTextActors );
   }
 
-  if( ( relayoutOperationMask & TextView::RELAYOUT_INSERT_TO_TEXT_VIEW ) ||
-      ( relayoutOperationMask & TextView::RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST ) )
+  if( relayoutOperationMask & TextView::RELAYOUT_INSERT_TO_TEXT_VIEW )
   {
-    TextViewRelayout::InsertToTextView( relayoutOperationMask,
-                                        textView,
+    TextViewRelayout::InsertToTextView( textView,
                                         relayoutData );
   }
 }
index 7e9020a..98ee6b8 100644 (file)
@@ -50,7 +50,7 @@ Vector3 SplitPosition( const TextViewRelayout::RelayoutParameters& relayoutParam
       ( wordOffset + relayoutParameters.mCharacterSize.width > relayoutData.mTextViewSize.width ) )
   {
     if( !relayoutParameters.mIsNewLine &&
-        ( relayoutParameters.mIsWhiteSpace || relayoutParameters.mIsNewLineCharacter ) )
+        ( relayoutParameters.mIsWhiteSpace || relayoutParameters.mIsNewParagraphCharacter ) )
     {
       // Current character is a white space. Don't want to move a white space to the next line.
       // These white spaces are placed just in the edge.
@@ -58,18 +58,18 @@ Vector3 SplitPosition( const TextViewRelayout::RelayoutParameters& relayoutParam
     }
     else
     {
-      const TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + relayoutParameters.mIndices.mLineIndex ) );
+      const TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + relayoutParameters.mIndices.mParagraphIndex ) );
 
-      TextViewRelayout::SubLineLayoutInfo subLineInfo;
+      TextViewRelayout::LineLayoutInfo subLineInfo;
       subLineInfo.mLineLength = 0.f;
       subLineInfo.mMaxCharHeight = 0.f;
       subLineInfo.mMaxAscender = 0.f;
-      TextViewRelayout::CalculateSubLineLayout( relayoutData.mTextViewSize.width,
-                                                relayoutParameters.mIndices,
-                                                lineLayoutInfo,
-                                                TextViewRelayout::WrapByLineAndSplit,
-                                                1.f, // Shrink factor
-                                                subLineInfo );
+      TextViewRelayout::CalculateLineLayout( relayoutData.mTextViewSize.width,
+                                             relayoutParameters.mIndices,
+                                             paragraphLayoutInfo,
+                                             TextViewRelayout::WrapByParagraphCharacterAndSplit,
+                                             1.f, // Shrink factor
+                                             subLineInfo );
 
       // Stores some info to calculate the line justification in a post-process.
       TextView::LineJustificationInfo justificationInfo;
@@ -81,8 +81,8 @@ Vector3 SplitPosition( const TextViewRelayout::RelayoutParameters& relayoutParam
 
       Toolkit::TextView::LineLayoutInfo lineInfo;
       lineInfo.mCharacterGlobalIndex = relayoutParameters.mCharacterGlobalIndex;    // Index to the first character of the next line.
-      lineInfo.mSize = Size( subLineInfo.mLineLength, subLineInfo.mMaxCharHeight ); // Size of this piece of line.
-      lineInfo.mAscender = subLineInfo.mMaxAscender;                                // Ascender of this piece of line.
+      lineInfo.mSize = Size( subLineInfo.mLineLength, subLineInfo.mMaxCharHeight ); // Size of this piece of paragraph.
+      lineInfo.mAscender = subLineInfo.mMaxAscender;                                // Ascender of this piece of paragraph.
       relayoutData.mLines.push_back( lineInfo );
 
       return Vector3( 0.f, previousPositionY + subLineInfo.mMaxCharHeight + layoutParameters.mLineHeightOffset, 0.f );
@@ -129,145 +129,134 @@ void CalculateSizeAndPosition( const TextView::LayoutParameters& layoutParameter
   }
 
   relayoutParameters.mIsFirstCharacter = true;
-  relayoutParameters.mIndices.mLineIndex = 0;
+  relayoutParameters.mIndices.mParagraphIndex = 0u;
   relayoutParameters.mPositionOffset = Vector3::ZERO;
-  relayoutParameters.mCharacterGlobalIndex = 0;
+  relayoutParameters.mCharacterGlobalIndex = 0u;
 
-  for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(),
-       endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
-       lineLayoutIt != endLineLayoutIt;
-       ++lineLayoutIt, ++relayoutParameters.mIndices.mLineIndex )
+  for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(),
+       endParagraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+       paragraphLayoutIt != endParagraphLayoutIt;
+       ++paragraphLayoutIt, ++relayoutParameters.mIndices.mParagraphIndex )
   {
-    TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineLayoutIt );
+    TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphLayoutIt );
 
-    relayoutParameters.mLineSize = lineLayoutInfo.mSize * relayoutData.mShrinkFactor;
+    relayoutParameters.mParagraphSize = paragraphLayoutInfo.mSize * relayoutData.mShrinkFactor;
 
     relayoutParameters.mIsNewLine = true;
-    relayoutParameters.mIndices.mGroupIndex = 0;
+    relayoutParameters.mIndices.mWordIndex = 0u;
 
-    for( TextViewProcessor::WordGroupLayoutInfoContainer::iterator groupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.begin(),
-         endGroupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.end();
-         groupLayoutIt != endGroupLayoutIt;
-         ++groupLayoutIt, ++relayoutParameters.mIndices.mGroupIndex )
+    for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin(),
+           endWordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
+         wordLayoutIt != endWordLayoutIt;
+         ++wordLayoutIt, ++relayoutParameters.mIndices.mWordIndex )
     {
-      TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo( *groupLayoutIt );
+      TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
+      relayoutParameters.mIsWhiteSpace = TextViewProcessor::WordSeparator == wordLayoutInfo.mType;
+      relayoutParameters.mIsNewParagraphCharacter = TextViewProcessor::ParagraphSeparator == wordLayoutInfo.mType;
 
-      relayoutParameters.mIndices.mWordIndex = 0;
+      relayoutParameters.mIsFirstCharacterOfWord = true;
+      relayoutParameters.mWordSize = wordLayoutInfo.mSize;
+      relayoutParameters.mIndices.mCharacterIndex = 0u;
 
-      for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.begin(),
-           endWordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.end();
-           wordLayoutIt != endWordLayoutIt;
-           ++wordLayoutIt, ++relayoutParameters.mIndices.mWordIndex )
+      if( relayoutParameters.mIsNewLine )
       {
-        TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
-        relayoutParameters.mIsWhiteSpace = TextViewProcessor::WordSeparator == wordLayoutInfo.mType;
-        relayoutParameters.mIsNewLineCharacter = TextViewProcessor::LineSeparator == wordLayoutInfo.mType;
+        // Stores some info to calculate the line justification in a post-process.
+        const bool isSplitOriginal = layoutParameters.mExceedPolicy == TextView::SplitOriginal;
 
-        relayoutParameters.mIsFirstCharacterOfWord = true;
-        relayoutParameters.mWordSize = wordLayoutInfo.mSize;
-        relayoutParameters.mIndices.mCharacterIndex = 0;
-
-        if( relayoutParameters.mIsNewLine )
+        if( !isSplitOriginal )
         {
-          // Stores some info to calculate the line justification in a post-process.
-          const bool isSplitOriginal = layoutParameters.mExceedPolicy == TextView::SplitOriginal;
-
-          if( !isSplitOriginal )
-          {
-            TextView::LineJustificationInfo justificationInfo;
+          TextView::LineJustificationInfo justificationInfo;
 
-            justificationInfo.mIndices = relayoutParameters.mIndices;
-            justificationInfo.mLineLength = relayoutParameters.mLineSize.width;
+          justificationInfo.mIndices = relayoutParameters.mIndices;
+          justificationInfo.mLineLength = relayoutParameters.mParagraphSize.width;
 
-            relayoutData.mLineJustificationInfo.push_back( justificationInfo );
-          }
+          relayoutData.mLineJustificationInfo.push_back( justificationInfo );
         }
+      }
 
-        for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
+      for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
              endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
-             characterLayoutIt != endCharacterLayoutIt;
-             ++characterLayoutIt, ++relayoutParameters.mIndices.mCharacterIndex )
-        {
-          TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
-          relayoutParameters.mCharacterSize = characterLayoutInfo.mSize;
+           characterLayoutIt != endCharacterLayoutIt;
+           ++characterLayoutIt, ++relayoutParameters.mIndices.mCharacterIndex )
+      {
+        TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
+        relayoutParameters.mCharacterSize = characterLayoutInfo.mSize;
 
-          relayoutParameters.mCharacterSize = characterLayoutInfo.mSize;
+        relayoutParameters.mCharacterSize = characterLayoutInfo.mSize;
 
-          switch( layoutParameters.mExceedPolicy )
+        switch( layoutParameters.mExceedPolicy )
+        {
+          case TextView::OriginalShrink:
+          case TextView::SplitShrink:
+          case TextView::ShrinkFade: // Fall Through
           {
-            case TextView::OriginalShrink:
-            case TextView::SplitShrink:
-            case TextView::ShrinkFade: // Fall Through
-            {
-              DALI_LOG_WARNING( "SplitByNewLineChar::CalculateSizeAndPosition() policy not implemented.\n" );
-              break;
-            }
-            case TextView::Original: // Fall Through
-            case TextView::ShrinkOriginal: // Fall Through
-            case TextView::Shrink: // Fall Through
-            case TextView::OriginalFade: // Fall Through
-            case TextView::FadeOriginal: // Fall Through
-            case TextView::Fade: // Fall Through
-            case TextView::EllipsizeEndOriginal: // Fall Through
-            case TextView::EllipsizeEnd: // Fall Through
+            DALI_LOG_WARNING( "SplitByNewLineChar::CalculateSizeAndPosition() policy not implemented.\n" );
+            break;
+          }
+          case TextView::Original: // Fall Through
+          case TextView::ShrinkOriginal: // Fall Through
+          case TextView::Shrink: // Fall Through
+          case TextView::OriginalFade: // Fall Through
+          case TextView::FadeOriginal: // Fall Through
+          case TextView::Fade: // Fall Through
+          case TextView::EllipsizeEndOriginal: // Fall Through
+          case TextView::EllipsizeEnd: // Fall Through
+          {
+            if( relayoutParameters.mIsNewLine )
             {
-              if( relayoutParameters.mIsNewLine )
-              {
-                relayoutParameters.mPositionOffset.x = 0.f;
-                relayoutParameters.mPositionOffset.y += lineLayoutInfo.mSize.height * relayoutData.mShrinkFactor;
-              }
-
-              characterLayoutInfo.mPosition = relayoutParameters.mPositionOffset;
-
-              relayoutParameters.mPositionOffset.x += characterLayoutInfo.mSize.width * relayoutData.mShrinkFactor;
-
-              if( relayoutParameters.mIsNewLine ||
-                  relayoutParameters.mIsFirstCharacter )
-              {
-                Toolkit::TextView::LineLayoutInfo lineInfo;
-                lineInfo.mCharacterGlobalIndex = relayoutParameters.mCharacterGlobalIndex;  // Index to the first character of the next line.
-                lineInfo.mSize = relayoutParameters.mLineSize;                              // Size of this piece of line.
-                lineInfo.mAscender = lineLayoutInfo.mAscender * relayoutData.mShrinkFactor; // Ascender of this piece of line.
-                relayoutData.mLines.push_back( lineInfo );
-              }
-              break;
+              relayoutParameters.mPositionOffset.x = 0.f;
+              relayoutParameters.mPositionOffset.y += paragraphLayoutInfo.mSize.height * relayoutData.mShrinkFactor;
             }
-            case TextView::SplitOriginal:
-            case TextView::SplitFade:
-            case TextView::SplitEllipsizeEnd: // Fall Through
-            {
-              characterLayoutInfo.mPosition = SplitPosition( relayoutParameters,
-                                                             layoutParameters,
-                                                             relayoutData );
 
-              relayoutParameters.mPositionOffset = characterLayoutInfo.mPosition + Vector3( characterLayoutInfo.mSize.width, 0.f, 0.f );
-              break;
-            }
-            default:
+            characterLayoutInfo.mPosition = relayoutParameters.mPositionOffset;
+
+            relayoutParameters.mPositionOffset.x += characterLayoutInfo.mSize.width * relayoutData.mShrinkFactor;
+
+            if( relayoutParameters.mIsNewLine ||
+                relayoutParameters.mIsFirstCharacter )
             {
-              DALI_LOG_WARNING( "SplitByNewLineChar::CalculateSizeAndPosition() Layout configuration not possible.\n" );
-              break;
+              Toolkit::TextView::LineLayoutInfo lineInfo;
+              lineInfo.mCharacterGlobalIndex = relayoutParameters.mCharacterGlobalIndex;       // Index to the first character of the next line.
+              lineInfo.mSize = relayoutParameters.mParagraphSize;                              // Size of this piece of paragraph.
+              lineInfo.mAscender = paragraphLayoutInfo.mAscender * relayoutData.mShrinkFactor; // Ascender of this piece of paragraph.
+              relayoutData.mLines.push_back( lineInfo );
             }
+            break;
           }
+          case TextView::SplitOriginal:
+          case TextView::SplitFade:
+          case TextView::SplitEllipsizeEnd: // Fall Through
+          {
+            characterLayoutInfo.mPosition = SplitPosition( relayoutParameters,
+                                                           layoutParameters,
+                                                           relayoutData );
 
-          // Get last line info and calculate the bearing (used to align glyphs with the baseline).
-          TextViewRelayout::CalculateBearing( characterLayoutInfo, relayoutData );
-
-          // updates min and max position to calculate the text size for split by new line char.
-          TextViewRelayout::UpdateLayoutInfoTable( minMaxXY,
-                                                   wordGroupLayoutInfo,
-                                                   wordLayoutInfo,
-                                                   characterLayoutInfo,
-                                                   relayoutParameters,
-                                                   relayoutData );
-
-          ++relayoutParameters.mCharacterGlobalIndex;
-          relayoutParameters.mIsFirstCharacter = false;
-          relayoutParameters.mIsNewLine = false;
-        } // end characters
-      } // end words
-    } // end group of words
-  } // end lines
+            relayoutParameters.mPositionOffset = characterLayoutInfo.mPosition + Vector3( characterLayoutInfo.mSize.width, 0.f, 0.f );
+            break;
+          }
+          default:
+          {
+            DALI_LOG_WARNING( "SplitByNewLineChar::CalculateSizeAndPosition() Layout configuration not possible.\n" );
+            break;
+          }
+        }
+
+        // Get last line info and calculate the bearing (used to align glyphs with the baseline).
+        TextViewRelayout::CalculateBearing( characterLayoutInfo, relayoutData );
+
+        // updates min and max position to calculate the text size for split by new line char.
+        TextViewRelayout::UpdateLayoutInfoTable( minMaxXY,
+                                                 wordLayoutInfo,
+                                                 characterLayoutInfo,
+                                                 relayoutParameters,
+                                                 relayoutData );
+
+        ++relayoutParameters.mCharacterGlobalIndex;
+        relayoutParameters.mIsFirstCharacter = false;
+        relayoutParameters.mIsNewLine = false;
+      } // end characters
+    } // end words
+  } // end paragraphs
 
   if( relayoutData.mCharacterLayoutInfoTable.empty() )
   {
@@ -279,14 +268,14 @@ void CalculateSizeAndPosition( const TextView::LayoutParameters& layoutParameter
     relayoutData.mTextSizeForRelayoutOption.height = minMaxXY.w - minMaxXY.y;
   }
 
-  // Check if the last character is a new line character. In that case the height should be added.
-  if( !relayoutData.mTextLayoutInfo.mLinesLayoutInfo.empty() )
+  // Check if the last character is a new paragraph character. In that case the height should be added.
+  if( !relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.empty() )
   {
-    const TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end() - 1 ) );
+    const TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end() - 1u ) );
 
-    if( lineLayoutInfo.mWordGroupsLayoutInfo.empty() ) // if it's empty, it means the last character is a new line character.
+    if( paragraphLayoutInfo.mWordsLayoutInfo.empty() ) // if it's empty, it means the last character is a new paragraph character.
     {
-      relayoutData.mTextSizeForRelayoutOption.height += lineLayoutInfo.mSize.height * relayoutData.mShrinkFactor;
+      relayoutData.mTextSizeForRelayoutOption.height += paragraphLayoutInfo.mSize.height * relayoutData.mShrinkFactor;
     }
   }
 }
@@ -321,22 +310,18 @@ void Relayout( Actor textView,
                                         relayoutData );
   }
 
-  if( relayoutOperationMask & TextView::RELAYOUT_INITIALIZE_TEXT_ACTORS )
-  {
-    TextViewProcessor::InitializeTextActorInfo( relayoutData );
-  }
-
-  if( relayoutOperationMask & TextView::RELAYOUT_TEXT_ACTOR_UPDATE )
+  const bool initializeTextActors = relayoutOperationMask & TextView::RELAYOUT_INITIALIZE_TEXT_ACTORS;
+  const bool updateTextActors = relayoutOperationMask & TextView::RELAYOUT_TEXT_ACTOR_UPDATE;
+  if( initializeTextActors || updateTextActors )
   {
     TextViewRelayout::UpdateTextActorInfo( visualParameters,
-                                           relayoutData );
+                                           relayoutData,
+                                           initializeTextActors );
   }
 
-  if( ( relayoutOperationMask & TextView::RELAYOUT_INSERT_TO_TEXT_VIEW ) ||
-      ( relayoutOperationMask & TextView::RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST ) )
+  if( relayoutOperationMask & TextView::RELAYOUT_INSERT_TO_TEXT_VIEW )
   {
-    TextViewRelayout::InsertToTextView( relayoutOperationMask,
-                                        textView,
+    TextViewRelayout::InsertToTextView( textView,
                                         relayoutData );
   }
 }
index 0cfcfa1..4081150 100644 (file)
@@ -50,7 +50,7 @@ Vector3 OriginalPosition( const TextViewRelayout::RelayoutParameters& relayoutPa
       ( relayoutParameters.mIsFirstCharacterOfWord && ( wordOffset + relayoutParameters.mWordSize.width > relayoutData.mTextViewSize.width ) ) )
   {
     if( !relayoutParameters.mIsNewLine &&
-        ( relayoutParameters.mIsWhiteSpace || relayoutParameters.mIsNewLineCharacter ) )
+        ( relayoutParameters.mIsWhiteSpace || relayoutParameters.mIsNewParagraphCharacter ) )
     {
       // Current character is a white space. Don't want to move a white space to the next line.
       // These white spaces are placed just in the edge.
@@ -58,32 +58,28 @@ Vector3 OriginalPosition( const TextViewRelayout::RelayoutParameters& relayoutPa
     }
     else
     {
-      // Calculates the length of the portion of the line which doesn't exceed the text-view's width and the max character height for the current line.
-      TextViewRelayout::SubLineLayoutInfo subLineInfo;
+      // Calculates the length of the portion of the paragraph which doesn't exceed the text-view's width and the max character height for the current line.
+      TextViewRelayout::LineLayoutInfo subLineInfo;
       subLineInfo.mLineLength = 0.f;
       subLineInfo.mMaxCharHeight = 0.f;
       subLineInfo.mMaxAscender = 0.f;
-      const TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + relayoutParameters.mIndices.mLineIndex ) );
+      const TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + relayoutParameters.mIndices.mParagraphIndex ) );
 
-      TextViewRelayout::CalculateSubLineLayout( relayoutData.mTextViewSize.width,
-                                                relayoutParameters.mIndices,
-                                                lineLayoutInfo,
-                                                TextViewRelayout::WrapByWord,
-                                                1.f, // Shrink factor
-                                                subLineInfo );
+      TextViewRelayout::CalculateLineLayout( relayoutData.mTextViewSize.width,
+                                             relayoutParameters.mIndices,
+                                             paragraphLayoutInfo,
+                                             TextViewRelayout::WrapByWord,
+                                             1.f, // Shrink factor
+                                             subLineInfo );
 
       if( subLineInfo.mLineLength < Math::MACHINE_EPSILON_1000 )
       {
         // It may mean there is a word which is actually longer than the width of the text-view.
         // In that case the length of this word is needed.
-        if( !lineLayoutInfo.mWordGroupsLayoutInfo.empty() )
+        if( !paragraphLayoutInfo.mWordsLayoutInfo.empty() )
         {
-          const TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo( *( lineLayoutInfo.mWordGroupsLayoutInfo.begin() + relayoutParameters.mIndices.mGroupIndex ) );
-          if( !wordGroupLayoutInfo.mWordsLayoutInfo.empty() )
-          {
-            const TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *( wordGroupLayoutInfo.mWordsLayoutInfo.begin() + relayoutParameters.mIndices.mWordIndex ) );
-            subLineInfo.mLineLength = wordLayoutInfo.mSize.width;
-          }
+          const TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *( paragraphLayoutInfo.mWordsLayoutInfo.begin() + relayoutParameters.mIndices.mWordIndex ) );
+          subLineInfo.mLineLength = wordLayoutInfo.mSize.width;
         }
       }
 
@@ -97,8 +93,8 @@ Vector3 OriginalPosition( const TextViewRelayout::RelayoutParameters& relayoutPa
 
       Toolkit::TextView::LineLayoutInfo lineInfo;
       lineInfo.mCharacterGlobalIndex = relayoutParameters.mCharacterGlobalIndex;    // Index to the first character of the next line.
-      lineInfo.mSize = Size( subLineInfo.mLineLength, subLineInfo.mMaxCharHeight ); // Size of this piece of line.
-      lineInfo.mAscender = subLineInfo.mMaxAscender;                                // Ascender of this piece of line.
+      lineInfo.mSize = Size( subLineInfo.mLineLength, subLineInfo.mMaxCharHeight ); // Size of this piece of paragraph.
+      lineInfo.mAscender = subLineInfo.mMaxAscender;                                // Ascender of this piece of paragraph.
       relayoutData.mLines.push_back( lineInfo );
 
       return Vector3( 0.f, previousPositionY + subLineInfo.mMaxCharHeight + layoutParameters.mLineHeightOffset, 0.f );
@@ -129,7 +125,7 @@ Vector3 SplitWhenExceedPosition( const TextViewRelayout::RelayoutParameters& rel
       ( wordOffset + relayoutParameters.mCharacterSize.width > relayoutData.mTextViewSize.width ) )
   {
     if( !relayoutParameters.mIsNewLine &&
-        ( relayoutParameters.mIsWhiteSpace || relayoutParameters.mIsNewLineCharacter ) )
+        ( relayoutParameters.mIsWhiteSpace || relayoutParameters.mIsNewParagraphCharacter ) )
     {
       // Current character is a white space. Don't want to move a white space to the next line.
       // These white spaces are placed just in the edge.
@@ -138,18 +134,18 @@ Vector3 SplitWhenExceedPosition( const TextViewRelayout::RelayoutParameters& rel
     else
     {
       // Calculates the line length and the max character height for the current line.
-      TextViewRelayout::SubLineLayoutInfo subLineInfo;
+      TextViewRelayout::LineLayoutInfo subLineInfo;
       subLineInfo.mLineLength = 0.f;
       subLineInfo.mMaxCharHeight = 0.f;
       subLineInfo.mMaxAscender = 0.f;
-      const TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + relayoutParameters.mIndices.mLineIndex ) );
+      const TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + relayoutParameters.mIndices.mParagraphIndex ) );
 
-      TextViewRelayout::CalculateSubLineLayout( relayoutData.mTextViewSize.width,
-                                                relayoutParameters.mIndices,
-                                                lineLayoutInfo,
-                                                TextViewRelayout::WrapByWordAndSplit,
-                                                1.f, // Shrink factor.
-                                                subLineInfo );
+      TextViewRelayout::CalculateLineLayout( relayoutData.mTextViewSize.width,
+                                             relayoutParameters.mIndices,
+                                             paragraphLayoutInfo,
+                                             TextViewRelayout::WrapByWordAndSplit,
+                                             1.f, // Shrink factor.
+                                             subLineInfo );
 
       // Stores some info to calculate the line justification in a post-process.
       TextView::LineJustificationInfo justificationInfo;
@@ -161,8 +157,8 @@ Vector3 SplitWhenExceedPosition( const TextViewRelayout::RelayoutParameters& rel
 
       Toolkit::TextView::LineLayoutInfo lineInfo;
       lineInfo.mCharacterGlobalIndex = relayoutParameters.mCharacterGlobalIndex;    // Index to the first character of the next line.
-      lineInfo.mSize = Size( subLineInfo.mLineLength, subLineInfo.mMaxCharHeight ); // Size of this piece of line.
-      lineInfo.mAscender = subLineInfo.mMaxAscender;                                // Ascender of this piece of line.
+      lineInfo.mSize = Size( subLineInfo.mLineLength, subLineInfo.mMaxCharHeight ); // Size of this piece of paragraph.
+      lineInfo.mAscender = subLineInfo.mMaxAscender;                                // Ascender of this piece of paragraph.
       relayoutData.mLines.push_back( lineInfo );
 
       return Vector3( 0.f, previousPositionY + subLineInfo.mMaxCharHeight + layoutParameters.mLineHeightOffset, 0.f );
@@ -193,7 +189,7 @@ Vector3 ShrinkWidthWhenExceedPosition( const TextViewRelayout::RelayoutParameter
       ( relayoutParameters.mIsFirstCharacterOfWord && ( wordOffset + wordSize.width > relayoutData.mTextViewSize.width ) ) ) // The word doesn't fit in the parent width.
   {
     if( !relayoutParameters.mIsNewLine &&
-        ( relayoutParameters.mIsWhiteSpace || relayoutParameters.mIsNewLineCharacter ) )
+        ( relayoutParameters.mIsWhiteSpace || relayoutParameters.mIsNewParagraphCharacter ) )
     {
       // Current character is a white space. Don't want to move a white space to the next line.
       // These white spaces are placed just in the edge.
@@ -202,18 +198,18 @@ Vector3 ShrinkWidthWhenExceedPosition( const TextViewRelayout::RelayoutParameter
     else
     {
       // Calculates the line length and the max character height for the current line.
-      TextViewRelayout::SubLineLayoutInfo subLineInfo;
+      TextViewRelayout::LineLayoutInfo subLineInfo;
       subLineInfo.mLineLength = 0.f;
       subLineInfo.mMaxCharHeight = 0.f;
       subLineInfo.mMaxAscender = 0.f;
-      const TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + relayoutParameters.mIndices.mLineIndex ) );
+      const TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + relayoutParameters.mIndices.mParagraphIndex ) );
 
-      TextViewRelayout::CalculateSubLineLayout( relayoutData.mTextViewSize.width,
-                                                relayoutParameters.mIndices,
-                                                lineLayoutInfo,
-                                                TextViewRelayout::WrapByWord,
-                                                relayoutData.mShrinkFactor,
-                                                subLineInfo );
+      TextViewRelayout::CalculateLineLayout( relayoutData.mTextViewSize.width,
+                                             relayoutParameters.mIndices,
+                                             paragraphLayoutInfo,
+                                             TextViewRelayout::WrapByWord,
+                                             relayoutData.mShrinkFactor,
+                                             subLineInfo );
 
       // Stores some info to calculate the line justification in a post-process.
       TextView::LineJustificationInfo justificationInfo;
@@ -225,8 +221,8 @@ Vector3 ShrinkWidthWhenExceedPosition( const TextViewRelayout::RelayoutParameter
 
       Toolkit::TextView::LineLayoutInfo lineInfo;
       lineInfo.mCharacterGlobalIndex = relayoutParameters.mCharacterGlobalIndex;    // Index to the first character of the next line.
-      lineInfo.mSize = Size( subLineInfo.mLineLength, subLineInfo.mMaxCharHeight ); // Size of this piece of line.
-      lineInfo.mAscender = subLineInfo.mMaxAscender;                                // Ascender of this piece of line.
+      lineInfo.mSize = Size( subLineInfo.mLineLength, subLineInfo.mMaxCharHeight ); // Size of this piece of paragraph.
+      lineInfo.mAscender = subLineInfo.mMaxAscender;                                // Ascender of this piece of paragraph.
       relayoutData.mLines.push_back( lineInfo );
 
       return Vector3( 0.f, previousPositionY + subLineInfo.mMaxCharHeight + layoutParameters.mLineHeightOffset * relayoutData.mShrinkFactor, 0.f );
@@ -259,124 +255,113 @@ void CalculatePositionsForShrinkWhenExceed( TextView::RelayoutData& relayoutData
   // Stores the position of the previous character.
   Vector3 previousPosition;
 
-  // Reset the index of lines.
+  // Reset the index of paragraphs.
   TextViewProcessor::TextInfoIndices indices;
 
-  // Whether the last character of the whole text is a new line char.
+  // Whether the last character of the whole text is a new paragraph char.
   // This information is used to increase or not the height of the whole text by one line.
   // Increase the whole text's height by one line is useful i.e. in TextInput to place the cursor
-  // after pressing 'Enter' in the last line.
-  bool isLastCharacterNewLineChar = false;
+  // after pressing 'Enter' in the last paragraph.
+  bool isLastCharacterNewParagraphChar = false;
   // Stores the height of the last character. This height used to be added to the whole text height if
-  // isLastCharacterNewLineChar is true.
+  // isLastCharacterNewParagraphChar is true.
   float lastCharHeight = 0.f;
 
   relayoutData.mLines.clear();
-  std::size_t characterGlobalIndex = 0;
+  std::size_t characterGlobalIndex = 0u;
 
-  for( TextViewProcessor::LineLayoutInfoContainer::iterator lineIt = textLayoutInfo.mLinesLayoutInfo.begin(), lineEndIt = textLayoutInfo.mLinesLayoutInfo.end();
-       lineIt != lineEndIt;
-       ++lineIt, ++indices.mLineIndex )
+  for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphIt = textLayoutInfo.mParagraphsLayoutInfo.begin(), paragraphEndIt = textLayoutInfo.mParagraphsLayoutInfo.end();
+       paragraphIt != paragraphEndIt;
+       ++paragraphIt, ++indices.mParagraphIndex )
   {
-    TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineIt );
+    TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphIt );
 
     // The next character is in a new line.
     bool isNewLine = true;
 
-    // Reset the index of groups of words.
-    indices.mGroupIndex = 0;
+    // Reset the index of words.
+    indices.mWordIndex = 0u;
 
-    for( TextViewProcessor::WordGroupLayoutInfoContainer::iterator groupIt = lineLayoutInfo.mWordGroupsLayoutInfo.begin(), groupEndIt = lineLayoutInfo.mWordGroupsLayoutInfo.end();
-         groupIt != groupEndIt;
-         ++groupIt, ++indices.mGroupIndex )
+    for( TextViewProcessor::WordLayoutInfoContainer::iterator wordIt = paragraphLayoutInfo.mWordsLayoutInfo.begin(), wordEndIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
+         wordIt != wordEndIt;
+         ++wordIt, ++indices.mWordIndex )
     {
-      TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo( *groupIt );
+      TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordIt );
 
-      // Reset the index of words.
-      indices.mWordIndex = 0;
+      // Reset the index of the character.
+      indices.mCharacterIndex = 0u;
 
-      for( TextViewProcessor::WordLayoutInfoContainer::iterator wordIt = wordGroupLayoutInfo.mWordsLayoutInfo.begin(), wordEndIt = wordGroupLayoutInfo.mWordsLayoutInfo.end();
-           wordIt != wordEndIt;
-           ++wordIt, ++indices.mWordIndex )
-      {
-        TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordIt );
+      // Whether current character is the first of the word.
+      bool isFirstCharOfWord = true;
+      const float wordOffset = previousPosition.x + previousSize.width;
 
-        // Reset the index of the character.
-        indices.mCharacterIndex = 0;
+      isLastCharacterNewParagraphChar = ( TextViewProcessor::ParagraphSeparator == wordLayoutInfo.mType );
 
-        // Whether current character is the first of the word.
-        bool isFirstCharOfWord = true;
-        const float wordOffset = previousPosition.x + previousSize.width;
+      for( TextViewProcessor::CharacterLayoutInfoContainer::iterator charIt = wordLayoutInfo.mCharactersLayoutInfo.begin(), charEndIt = wordLayoutInfo.mCharactersLayoutInfo.end();
+           charIt != charEndIt;
+           ++charIt, ++indices.mCharacterIndex )
+      {
+        TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *charIt );
+        lastCharHeight = characterLayoutInfo.mSize.height * shrinkFactor;
 
-        isLastCharacterNewLineChar = ( TextViewProcessor::LineSeparator == wordLayoutInfo.mType );
+        const float previousPositionY = isFirstChar ? 0.f : previousPosition.y;
 
-        for( TextViewProcessor::CharacterLayoutInfoContainer::iterator charIt = wordLayoutInfo.mCharactersLayoutInfo.begin(), charEndIt = wordLayoutInfo.mCharactersLayoutInfo.end();
-             charIt != charEndIt;
-             ++charIt, ++indices.mCharacterIndex )
+        if( ( isNewLine || isFirstChar ) ||
+            ( isFirstCharOfWord && ( wordOffset + wordLayoutInfo.mSize.width * shrinkFactor > parentWidth ) ) )
         {
-          TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *charIt );
-          lastCharHeight = characterLayoutInfo.mSize.height * shrinkFactor;
+          isFirstChar = false;
 
-          const float previousPositionY = isFirstChar ? 0.f : previousPosition.y;
+          // Calculates the line length and the max character height for the current line.
+          TextViewRelayout::LineLayoutInfo subLineInfo;
+          subLineInfo.mLineLength = 0.f;
+          subLineInfo.mMaxCharHeight = 0.f;
+          subLineInfo.mMaxAscender = 0.f;
+          TextViewRelayout::CalculateLineLayout( parentWidth,
+                                                 indices,
+                                                 paragraphLayoutInfo,
+                                                 TextViewRelayout::WrapByWord,
+                                                 shrinkFactor,
+                                                 subLineInfo );
 
-          if( ( isNewLine || isFirstChar ) ||
-              ( isFirstCharOfWord && ( wordOffset + wordLayoutInfo.mSize.width * shrinkFactor > parentWidth ) ) )
-          {
-            isFirstChar = false;
+          characterLayoutInfo.mPosition = Vector3( 0.f, previousPositionY + subLineInfo.mMaxCharHeight + layoutParameters.mLineHeightOffset * shrinkFactor, 0.f );
 
-            // Calculates the line length and the max character height for the current line.
-            TextViewRelayout::SubLineLayoutInfo subLineInfo;
-            subLineInfo.mLineLength = 0.f;
-            subLineInfo.mMaxCharHeight = 0.f;
-            subLineInfo.mMaxAscender = 0.f;
-            TextViewRelayout::CalculateSubLineLayout( parentWidth,
-                                                      indices,
-                                                      lineLayoutInfo,
-                                                      TextViewRelayout::WrapByWord,
-                                                      shrinkFactor,
-                                                      subLineInfo );
+          newTextHeight += subLineInfo.mMaxCharHeight + layoutParameters.mLineHeightOffset * shrinkFactor;
 
-            characterLayoutInfo.mPosition = Vector3( 0.f, previousPositionY + subLineInfo.mMaxCharHeight + layoutParameters.mLineHeightOffset * shrinkFactor, 0.f );
+          Toolkit::TextView::LineLayoutInfo lineInfo;
+          lineInfo.mCharacterGlobalIndex = characterGlobalIndex;                        // Index to the first character of the next line.
+          lineInfo.mSize = Size( subLineInfo.mLineLength, subLineInfo.mMaxCharHeight ); // Size of this piece of paragraph.
+          lineInfo.mAscender = subLineInfo.mMaxAscender;                                // Ascender of this piece of paragraph.
+          relayoutData.mLines.push_back( lineInfo );
 
-            newTextHeight += subLineInfo.mMaxCharHeight + layoutParameters.mLineHeightOffset * shrinkFactor;
+          // Stores some info to calculate the line justification in a post-process.
+          TextView::LineJustificationInfo justificationInfo;
 
-            Toolkit::TextView::LineLayoutInfo lineInfo;
-            lineInfo.mCharacterGlobalIndex = characterGlobalIndex;                        // Index to the first character of the next line.
-            lineInfo.mSize = Size( subLineInfo.mLineLength, subLineInfo.mMaxCharHeight ); // Size of this piece of line.
-            lineInfo.mAscender = subLineInfo.mMaxAscender;                                // Ascender of this piece of line.
-            relayoutData.mLines.push_back( lineInfo );
+          justificationInfo.mIndices = indices;
+          justificationInfo.mLineLength = subLineInfo.mLineLength;
 
+          relayoutData.mLineJustificationInfo.push_back( justificationInfo );
+        }
+        else
+        {
+          characterLayoutInfo.mPosition = previousPosition + Vector3( previousSize.width, 0.f, 0.f );
+        }
 
-            // Stores some info to calculate the line justification in a post-process.
-            TextView::LineJustificationInfo justificationInfo;
-
-            justificationInfo.mIndices = indices;
-            justificationInfo.mLineLength = subLineInfo.mLineLength;
-
-            relayoutData.mLineJustificationInfo.push_back( justificationInfo );
-          }
-          else
-          {
-            characterLayoutInfo.mPosition = previousPosition + Vector3( previousSize.width, 0.f, 0.f );
-          }
-
-          // Get last line info and calculate the bearing.
-          const Toolkit::TextView::LineLayoutInfo& lineInfo( *( relayoutData.mLines.end() - 1 ) );
-          const float bearingOffset = ( ( lineInfo.mSize.height - lineInfo.mAscender ) - ( characterLayoutInfo.mSize.height - characterLayoutInfo.mAscender ) ) * shrinkFactor;
+        // Get last line info and calculate the bearing.
+        const Toolkit::TextView::LineLayoutInfo& lineInfo( *( relayoutData.mLines.end() - 1u ) );
+        const float bearingOffset = ( ( lineInfo.mSize.height - lineInfo.mAscender ) - ( characterLayoutInfo.mSize.height - characterLayoutInfo.mAscender ) ) * shrinkFactor;
 
-          previousSize = characterLayoutInfo.mSize * shrinkFactor;
-          previousPosition = characterLayoutInfo.mPosition;
-          characterLayoutInfo.mPosition.y -= bearingOffset;
-          isFirstCharOfWord = false;
-          isNewLine = false;
+        previousSize = characterLayoutInfo.mSize * shrinkFactor;
+        previousPosition = characterLayoutInfo.mPosition;
+        characterLayoutInfo.mPosition.y -= bearingOffset;
+        isFirstCharOfWord = false;
+        isNewLine = false;
 
-          ++characterGlobalIndex;
-        }
+        ++characterGlobalIndex;
       }
     }
   }
 
-  if( isLastCharacterNewLineChar )
+  if( isLastCharacterNewParagraphChar )
   {
     newTextHeight += lastCharHeight + layoutParameters.mLineHeightOffset * shrinkFactor;
   }
@@ -410,14 +395,14 @@ float RelayoutForShrinkToFit( TextView::RelayoutData& relayoutData,
 
     const float MIN_RATIO( 0.90f );         // The algorithm finishes if the ratio
     const float MAX_RATIO( 1.00f );         // new_text_height / text_view_height is between this two values
-    const unsigned int MAX_ITERATIONS( 8 ); // or max_iteration is reached.
+    const unsigned int MAX_ITERATIONS( 8u ); // or max_iteration is reached.
 
     float ratio = newTextHeight / textViewSize.height;
 
     float maxScaleFactor = shrinkFactor;                        // bigger scale factors than maxScaleFactor will produce a too big text.
     float minScaleFactor = shrinkFactor * ( textViewSize.height / newTextHeight ); // smaller scale factors than minScaleFactor will produce a too small text.
 
-    for( unsigned int iterations = 0; ( ( MIN_RATIO > ratio ) || ( ratio > MAX_RATIO )  ) && ( iterations < MAX_ITERATIONS ); ++iterations )
+    for( unsigned int iterations = 0u; ( ( MIN_RATIO > ratio ) || ( ratio > MAX_RATIO )  ) && ( iterations < MAX_ITERATIONS ); ++iterations )
     {
       // Calculates the new scale factor.
       // The new scale factor is always between the min and max scale factors.
@@ -478,7 +463,7 @@ void CalculateSizeAndPosition( const TextView::LayoutParameters& layoutParameter
 
   relayoutData.mShrinkFactor = 1.f; // Shrink factor used when the exceed policy contains ShrinkToFit
 
-  if( TextView::Shrink== layoutParameters.mExceedPolicy )
+  if( TextView::Shrink == layoutParameters.mExceedPolicy )
   {
     // Relays-out the text for the shrink to fit policy.
     relayoutData.mShrinkFactor = RelayoutForShrinkToFit( relayoutData, layoutParameters );
@@ -490,127 +475,116 @@ void CalculateSizeAndPosition( const TextView::LayoutParameters& layoutParameter
 
   relayoutParameters.mPositionOffset = Vector3::ZERO;
   relayoutParameters.mIsFirstCharacter = true;
-  relayoutParameters.mIndices.mLineIndex = 0;
-  relayoutParameters.mCharacterGlobalIndex = 0;
+  relayoutParameters.mIndices.mParagraphIndex = 0u;
+  relayoutParameters.mCharacterGlobalIndex = 0u;
 
-  for( TextViewProcessor::LineLayoutInfoContainer::iterator lineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(),
-       endLineLayoutIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
-       lineLayoutIt != endLineLayoutIt;
-       ++lineLayoutIt, ++relayoutParameters.mIndices.mLineIndex )
+  for( TextViewProcessor::ParagraphLayoutInfoContainer::iterator paragraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(),
+       endParagraphLayoutIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+       paragraphLayoutIt != endParagraphLayoutIt;
+       ++paragraphLayoutIt, ++relayoutParameters.mIndices.mParagraphIndex )
   {
-    TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *lineLayoutIt );
+    TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphLayoutIt );
 
     relayoutParameters.mIsNewLine = true;
-    relayoutParameters.mLineSize = lineLayoutInfo.mSize;
-    relayoutParameters.mIndices.mGroupIndex = 0;
+    relayoutParameters.mParagraphSize = paragraphLayoutInfo.mSize;
+    relayoutParameters.mIndices.mWordIndex = 0u;
 
-    for( TextViewProcessor::WordGroupLayoutInfoContainer::iterator groupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.begin(),
-         endGroupLayoutIt = lineLayoutInfo.mWordGroupsLayoutInfo.end();
-         groupLayoutIt != endGroupLayoutIt;
-         ++groupLayoutIt, ++relayoutParameters.mIndices.mGroupIndex )
+    for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.begin(),
+           endWordLayoutIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
+         wordLayoutIt != endWordLayoutIt;
+         ++wordLayoutIt, ++relayoutParameters.mIndices.mWordIndex )
     {
-      TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo( *groupLayoutIt );
+      TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
+      relayoutParameters.mIsWhiteSpace = TextViewProcessor::WordSeparator == wordLayoutInfo.mType;
+      relayoutParameters.mIsNewParagraphCharacter = TextViewProcessor::ParagraphSeparator == wordLayoutInfo.mType;
 
-      relayoutParameters.mIndices.mWordIndex = 0;
+      relayoutParameters.mIsFirstCharacterOfWord = true;
+      relayoutParameters.mWordSize = wordLayoutInfo.mSize;
+      relayoutParameters.mIndices.mCharacterIndex = 0u;
 
-      for( TextViewProcessor::WordLayoutInfoContainer::iterator wordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.begin(),
-           endWordLayoutIt = wordGroupLayoutInfo.mWordsLayoutInfo.end();
-           wordLayoutIt != endWordLayoutIt;
-           ++wordLayoutIt, ++relayoutParameters.mIndices.mWordIndex )
+      for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
+             endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
+           ( characterLayoutIt != endCharacterLayoutIt );
+           ++characterLayoutIt, ++relayoutParameters.mIndices.mCharacterIndex )
       {
-        TextViewProcessor::WordLayoutInfo& wordLayoutInfo( *wordLayoutIt );
-        relayoutParameters.mIsWhiteSpace = TextViewProcessor::WordSeparator == wordLayoutInfo.mType;
-        relayoutParameters.mIsNewLineCharacter = TextViewProcessor::LineSeparator == wordLayoutInfo.mType;
+        TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
 
-        relayoutParameters.mIsFirstCharacterOfWord = true;
-        relayoutParameters.mWordSize = wordLayoutInfo.mSize;
-        relayoutParameters.mIndices.mCharacterIndex = 0;
+        relayoutParameters.mCharacterSize = characterLayoutInfo.mSize;
 
-        for( TextViewProcessor::CharacterLayoutInfoContainer::iterator characterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.begin(),
-             endCharacterLayoutIt = wordLayoutInfo.mCharactersLayoutInfo.end();
-             ( characterLayoutIt != endCharacterLayoutIt );
-             ++characterLayoutIt, ++relayoutParameters.mIndices.mCharacterIndex )
+        switch( layoutParameters.mExceedPolicy )
         {
-          TextViewProcessor::CharacterLayoutInfo& characterLayoutInfo( *characterLayoutIt );
-
-          relayoutParameters.mCharacterSize = characterLayoutInfo.mSize;
+          case TextView::OriginalShrink:
+          case TextView::SplitShrink:
+          case TextView::ShrinkFade:
+          {
+            DALI_LOG_WARNING( "SplitByWord::CalculateSizeAndPosition() policy not implemented.\n" );
+            break;
+          }
+          case TextView::Original:
+          case TextView::OriginalFade:
+          case TextView::FadeOriginal:
+          case TextView::Fade:
+          case TextView::EllipsizeEndOriginal:
+          case TextView::EllipsizeEnd: // Fall Through
+          {
+            characterLayoutInfo.mPosition = OriginalPosition( relayoutParameters,
+                                                              layoutParameters,
+                                                              relayoutData );
 
-          switch( layoutParameters.mExceedPolicy )
+            relayoutParameters.mPositionOffset = characterLayoutInfo.mPosition + Vector3( characterLayoutInfo.mSize.width, 0.f, 0.f );
+            break;
+          }
+          case TextView::SplitOriginal:
+          case TextView::SplitFade:
+          case TextView::SplitEllipsizeEnd:
           {
-            case TextView::OriginalShrink:
-            case TextView::SplitShrink:
-            case TextView::ShrinkFade:
-            {
-              DALI_LOG_WARNING( "SplitByWord::CalculateSizeAndPosition() policy not implemented.\n" );
-              break;
-            }
-            case TextView::Original:
-            case TextView::OriginalFade:
-            case TextView::FadeOriginal:
-            case TextView::Fade:
-            case TextView::EllipsizeEndOriginal:
-            case TextView::EllipsizeEnd: // Fall Through
-            {
-              characterLayoutInfo.mPosition = OriginalPosition( relayoutParameters,
-                                                                layoutParameters,
-                                                                relayoutData );
-
-              relayoutParameters.mPositionOffset = characterLayoutInfo.mPosition + Vector3( characterLayoutInfo.mSize.width, 0.f, 0.f );
-              break;
-            }
-            case TextView::SplitOriginal:
-            case TextView::SplitFade:
-            case TextView::SplitEllipsizeEnd:
-            {
-              characterLayoutInfo.mPosition = SplitWhenExceedPosition( relayoutParameters,
-                                                                       layoutParameters,
-                                                                       relayoutData );
-
-              relayoutParameters.mPositionOffset = characterLayoutInfo.mPosition + Vector3( characterLayoutInfo.mSize.width, 0.f, 0.f );
-              break;
-            }
-            case TextView::ShrinkOriginal:
-            {
-              characterLayoutInfo.mPosition = ShrinkWidthWhenExceedPosition( relayoutParameters,
-                                                                             layoutParameters,
-                                                                             relayoutData );
-
-              relayoutParameters.mPositionOffset = characterLayoutInfo.mPosition + Vector3( characterLayoutInfo.mSize.width * relayoutData.mShrinkFactor, 0.f, 0.f );
-              break;
-            }
-            case TextView::Shrink:
-            {
-              // Does nothing. All the job has been done in the RelayoutForShrinkToFit() function.
-              break;
-            }
-            default:
-            {
-              DALI_LOG_WARNING( "SplitByWord::CalculateSizeAndPosition() policy combination not possible.\n" );
-            }
+            characterLayoutInfo.mPosition = SplitWhenExceedPosition( relayoutParameters,
+                                                                     layoutParameters,
+                                                                     relayoutData );
+
+            relayoutParameters.mPositionOffset = characterLayoutInfo.mPosition + Vector3( characterLayoutInfo.mSize.width, 0.f, 0.f );
+            break;
           }
+          case TextView::ShrinkOriginal:
+          {
+            characterLayoutInfo.mPosition = ShrinkWidthWhenExceedPosition( relayoutParameters,
+                                                                           layoutParameters,
+                                                                           relayoutData );
 
-          // Get last line info and calculate the bearing (used to align glyphs with the baseline).
-          if( TextView::Shrink != layoutParameters.mExceedPolicy )
+            relayoutParameters.mPositionOffset = characterLayoutInfo.mPosition + Vector3( characterLayoutInfo.mSize.width * relayoutData.mShrinkFactor, 0.f, 0.f );
+            break;
+          }
+          case TextView::Shrink:
+          {
+            // Does nothing. All the job has been done in the RelayoutForShrinkToFit() function.
+            break;
+          }
+          default:
           {
-            TextViewRelayout::CalculateBearing( characterLayoutInfo, relayoutData );
+            DALI_LOG_WARNING( "SplitByWord::CalculateSizeAndPosition() policy combination not possible.\n" );
           }
+        }
+
+        // Get last line info and calculate the bearing (used to align glyphs with the baseline).
+        if( TextView::Shrink != layoutParameters.mExceedPolicy )
+        {
+          TextViewRelayout::CalculateBearing( characterLayoutInfo, relayoutData );
+        }
 
-          // updates min and max position to calculate the text size for split by word.
-          TextViewRelayout::UpdateLayoutInfoTable( minMaxXY,
-                                                   wordGroupLayoutInfo,
-                                                   wordLayoutInfo,
-                                                   characterLayoutInfo,
-                                                   relayoutParameters,
-                                                   relayoutData );
-
-          ++relayoutParameters.mCharacterGlobalIndex;
-          relayoutParameters.mIsFirstCharacter = false;
-          relayoutParameters.mIsFirstCharacterOfWord = false;
-          relayoutParameters.mIsNewLine = false;
-        } // end characters
-      } // end words
-    } // end group of words
-  } // end lines
+        // updates min and max position to calculate the text size for split by word.
+        TextViewRelayout::UpdateLayoutInfoTable( minMaxXY,
+                                                 wordLayoutInfo,
+                                                 characterLayoutInfo,
+                                                 relayoutParameters,
+                                                 relayoutData );
+
+        ++relayoutParameters.mCharacterGlobalIndex;
+        relayoutParameters.mIsFirstCharacter = false;
+        relayoutParameters.mIsFirstCharacterOfWord = false;
+        relayoutParameters.mIsNewLine = false;
+      } // end characters
+    } // end words
+  } // end paragraphs
 
   if( relayoutData.mCharacterLayoutInfoTable.empty() )
   {
@@ -622,14 +596,14 @@ void CalculateSizeAndPosition( const TextView::LayoutParameters& layoutParameter
     relayoutData.mTextSizeForRelayoutOption.height = minMaxXY.w - minMaxXY.y;
   }
 
-  // Check if the last character is a new line character. In that case the height should be added.
-  if( !relayoutData.mTextLayoutInfo.mLinesLayoutInfo.empty() )
+  // Check if the last character is a new paragraph character. In that case the height should be added.
+  if( !relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.empty() )
   {
-    const TextViewProcessor::LineLayoutInfo& lineLayoutInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end() - 1 ) );
+    const TextViewProcessor::ParagraphLayoutInfo& paragraphLayoutInfo( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end() - 1u ) );
 
-    if( lineLayoutInfo.mWordGroupsLayoutInfo.empty() ) // if it's empty, it means the last character is a new line character.
+    if( paragraphLayoutInfo.mWordsLayoutInfo.empty() ) // if it's empty, it means the last character is a new paragraph character.
     {
-      relayoutData.mTextSizeForRelayoutOption.height += lineLayoutInfo.mSize.height * relayoutData.mShrinkFactor;
+      relayoutData.mTextSizeForRelayoutOption.height += paragraphLayoutInfo.mSize.height * relayoutData.mShrinkFactor;
     }
   }
 }
@@ -663,23 +637,18 @@ void Relayout( Actor textView,
                                         visualParameters,
                                         relayoutData );
   }
-
-  if( relayoutOperationMask & TextView::RELAYOUT_INITIALIZE_TEXT_ACTORS )
-  {
-    TextViewProcessor::InitializeTextActorInfo( relayoutData );
-  }
-
-  if( relayoutOperationMask & TextView::RELAYOUT_TEXT_ACTOR_UPDATE )
+  const bool initializeTextActors = relayoutOperationMask & TextView::RELAYOUT_INITIALIZE_TEXT_ACTORS;
+  const bool updateTextActors = relayoutOperationMask & TextView::RELAYOUT_TEXT_ACTOR_UPDATE;
+  if( initializeTextActors || updateTextActors )
   {
     TextViewRelayout::UpdateTextActorInfo( visualParameters,
-                                           relayoutData );
+                                           relayoutData,
+                                           initializeTextActors );
   }
 
-  if( ( relayoutOperationMask & TextView::RELAYOUT_INSERT_TO_TEXT_VIEW ) ||
-      ( relayoutOperationMask & TextView::RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST ) )
+  if( relayoutOperationMask & TextView::RELAYOUT_INSERT_TO_TEXT_VIEW )
   {
-    TextViewRelayout::InsertToTextView( relayoutOperationMask,
-                                        textView,
+    TextViewRelayout::InsertToTextView( textView,
                                         relayoutData );
   }
 }
index 7d36205..f374479 100644 (file)
@@ -33,15 +33,15 @@ namespace Internal
 namespace TextProcessor
 {
 
-void SplitInLines( const MarkupProcessor::StyledTextArray& text,
-                   std::vector<MarkupProcessor::StyledTextArray>& lines )
+void SplitInParagraphs( const MarkupProcessor::StyledTextArray& text,
+                   std::vector<MarkupProcessor::StyledTextArray>& paragraphs )
 {
-  MarkupProcessor::StyledTextArray line;
+  MarkupProcessor::StyledTextArray paragraph;
   for( MarkupProcessor::StyledTextArray::const_iterator it = text.begin(), endIt = text.end(); it != endIt; ++it )
   {
     const MarkupProcessor::StyledText& styledText( *it );
 
-    for( size_t i = 0, length = styledText.mText.GetLength(); i < length; ++i )
+    for( size_t i = 0u, length = styledText.mText.GetLength(); i < length; ++i )
     {
       const Dali::Character character = styledText.mText[i];
 
@@ -49,33 +49,33 @@ void SplitInLines( const MarkupProcessor::StyledTextArray& text,
       {
         Text newText( character );
         MarkupProcessor::StyledText newStyledText( newText, styledText.mStyle );
-        line.push_back( newStyledText );
+        paragraph.push_back( newStyledText );
 
-        lines.push_back( line );
-        line.clear();
+        paragraphs.push_back( paragraph );
+        paragraph.clear();
       }
       else
       {
         Text newText( character );
         MarkupProcessor::StyledText newStyledText( newText, styledText.mStyle );
-        line.push_back( newStyledText );
+        paragraph.push_back( newStyledText );
       }
     }
   }
 
-  // This line could be empty if the last character of the previous line is a 'new line' character
+  // This paragraph could be empty if the last character of the previous paragraph is a 'new paragraph' character
   // and is the last of the text.
-  lines.push_back( line );
+  paragraphs.push_back( paragraph );
 }
 
-void SplitInWords( const MarkupProcessor::StyledTextArray& line,
+void SplitInWords( const MarkupProcessor::StyledTextArray& paragraph,
                    std::vector<MarkupProcessor::StyledTextArray>& words )
 {
   MarkupProcessor::StyledTextArray word;
-  for( MarkupProcessor::StyledTextArray::const_iterator it = line.begin(), endIt = line.end(); it != endIt; ++it )
+  for( MarkupProcessor::StyledTextArray::const_iterator it = paragraph.begin(), endIt = paragraph.end(); it != endIt; ++it )
   {
     const MarkupProcessor::StyledText& styledText( *it );
-    const Dali::Character character = styledText.mText[0];
+    const Dali::Character character = styledText.mText[0u];
 
     if( character.IsWhiteSpace() )
     {
@@ -121,7 +121,7 @@ bool BeginsRightToLeftCharacter( const MarkupProcessor::StyledTextArray& styledT
   {
     const Text& text( (*it).mText );
 
-    for( size_t i = 0, length = text.GetLength(); i < length; ++i )
+    for( size_t i = 0u, length = text.GetLength(); i < length; ++i )
     {
       Character::CharacterDirection direction = text[i].GetCharacterDirection();
       if( direction != Character::Neutral )
@@ -136,7 +136,7 @@ bool BeginsRightToLeftCharacter( const MarkupProcessor::StyledTextArray& styledT
 
 bool BeginsRightToLeftCharacter( const Text& text )
 {
-  for( size_t i = 0, length = text.GetLength(); i < length; ++i )
+  for( size_t i = 0u, length = text.GetLength(); i < length; ++i )
   {
     Character::CharacterDirection direction = text[i].GetCharacterDirection();
     if( direction != Character::Neutral )
@@ -154,7 +154,7 @@ bool ContainsRightToLeftCharacter( const MarkupProcessor::StyledTextArray& style
   {
     const Text& text( (*it).mText );
 
-    for( size_t i = 0, length = text.GetLength(); i < length; ++i )
+    for( size_t i = 0u, length = text.GetLength(); i < length; ++i )
     {
       Character::CharacterDirection direction = text[i].GetCharacterDirection();
       if( ( Character::RightToLeft == direction ) || ( Character::RightToLeftWeak == direction ) )
@@ -169,7 +169,7 @@ bool ContainsRightToLeftCharacter( const MarkupProcessor::StyledTextArray& style
 
 bool ContainsRightToLeftCharacter( const Dali::Text& text )
 {
-  for( size_t i = 0, length = text.GetLength(); i < length; ++i )
+  for( size_t i = 0u, length = text.GetLength(); i < length; ++i )
   {
     Character::CharacterDirection direction = ( text[i] ).GetCharacterDirection();
     if( ( Character::RightToLeft == direction ) || ( Character::RightToLeftWeak == direction ) )
@@ -182,7 +182,7 @@ bool ContainsRightToLeftCharacter( const Dali::Text& text )
 }
 
 void ConvertBidirectionalText( const MarkupProcessor::StyledTextArray& line,
-                               std::vector<MarkupProcessor::StyledTextArray>& convertedText,
+                               MarkupProcessor::StyledTextArray& convertedText,
                                std::vector<int>& logicalToVisualMap,
                                std::vector<int>& visualToLogicalMap )
 {
@@ -209,15 +209,15 @@ void ConvertBidirectionalText( const MarkupProcessor::StyledTextArray& line,
   // pad these buffers with 0's, as it's unclear what fribidi_log2vis does w.r.t.
   // the length of it's output content (appears the same as input content, and does
   // not seem to generate bidi marks i.e. FRIBIDI_CHAR_LRM/FRIBIDI_CHAR_RLM)
-  logicalStrBuffer.resize( stringSize+1, 0 );
-  visualStrBuffer.resize( stringSize+1, 0 );
-  FriBidiChar *logicalStr( &logicalStrBuffer[0] );
-  FriBidiChar *visualStr( &visualStrBuffer[0] );
+  logicalStrBuffer.resize( stringSize+1u, 0u );
+  visualStrBuffer.resize( stringSize+1u, 0u );
+  FriBidiChar *logicalStr( &logicalStrBuffer[0u] );
+  FriBidiChar *visualStr( &visualStrBuffer[0u] );
 
   // Convert UTF-8 string to unicode string
   const std::size_t length = fribidi_charset_to_unicode( FRIBIDI_CHAR_SET_UTF8, textToBeConverted.c_str(), stringSize, logicalStr );
 
-  if( 0 == length )
+  if( 0u == length )
   {
     DALI_ASSERT_DEBUG( !"TextProcessor::ConvertBidirectionalText. Error when calling at fribidi_charset_to_unicode" );
 
@@ -229,78 +229,60 @@ void ConvertBidirectionalText( const MarkupProcessor::StyledTextArray& line,
 
   // Convert and reorder the string as specified by the Unicode Bidirectional Algorithm
   FriBidiCharType baseDirection = FRIBIDI_TYPE_ON;
-  fribidi_boolean log2vis = fribidi_log2vis( logicalStr, length, &baseDirection, visualStr, &logicalToVisualMap[0], &visualToLogicalMap[0], NULL );
+  fribidi_boolean log2vis = fribidi_log2vis( logicalStr, length, &baseDirection, visualStr, &logicalToVisualMap[0u], &visualToLogicalMap[0u], NULL );
 
   if(log2vis)
   {
     // Convert the unicode string back to the UTF-8 string
     std::vector<char> bidiTextConverted;
 
-    bidiTextConverted.resize( length * 4 + 1 ); // Maximum bytes to represent one UTF-8 character is 6.
+    bidiTextConverted.resize( length * 4u + 1u ); // Maximum bytes to represent one UTF-8 character is 6.
                                                 // Currently Dali doesn't support this UTF-8 extension. Dali only supports 'regular' UTF-8 which has a maximum of 4 bytes per character.
 
-    fribidi_unicode_to_charset( FRIBIDI_CHAR_SET_UTF8, visualStr, length, &bidiTextConverted[0] );
+    fribidi_unicode_to_charset( FRIBIDI_CHAR_SET_UTF8, visualStr, length, &bidiTextConverted[0u] );
 
-    textToBeConverted = &bidiTextConverted[0];
+    textToBeConverted = &bidiTextConverted[0u];
 
     // After reorder the text, rebuild the text with the original styles is needed.
     // To assign the original style is needed to use the characterLogicalToVisualMap table.
-    Text text( &bidiTextConverted[0] );
+    Text text( &bidiTextConverted[0u] );
 
-    // Split the line in groups of words.
-    // Words are grouped if they can be displayed left to right or right to left.
+    // Split the line in words.
     // Add the correct styles for the characters after they are reordered.
 
-    MarkupProcessor::StyledTextArray groupOfWords;
-
-    Character::CharacterDirection previousDirection = ( BeginsRightToLeftCharacter( line ) ? Character::RightToLeft : Character::LeftToRight );
-    for( size_t i = 0; i < length; ++i )
+    for( size_t i = 0u; i < length; ++i )
     {
       const Character character( text[i] );
 
-      Character::CharacterDirection currentDirection = character.GetCharacterDirection();
-      if( Character::Neutral == currentDirection )
-      {
-        currentDirection = previousDirection;
-      }
-
       MarkupProcessor::StyledText styledText;
       styledText.mText.Append( character );
       styledText.mStyle = line[visualToLogicalMap[i]].mStyle;
 
-      if( currentDirection != previousDirection )
-      {
-        if( !groupOfWords.empty() )
-        {
-          convertedText.push_back( groupOfWords );
-          groupOfWords.clear();
-        }
-      }
-
-      groupOfWords.push_back( styledText );
-
-      previousDirection = currentDirection;
-    }
-
-    if( !groupOfWords.empty() )
-    {
-      convertedText.push_back( groupOfWords );
+      convertedText.push_back( styledText );
     }
   }
 }
 
+/**
+ * Wheather the character of the text pointed by the given offset is a white space.
+ *
+ * @param[in] text The text.
+ * @param[in] offset Offset pointing the character.
+ *
+ * @return \e true if the character pointed by the offset is a white space.
+ */
 bool IsWhiteSpace( const MarkupProcessor::StyledTextArray& text, size_t offset )
 {
   DALI_ASSERT_DEBUG( offset < text.size() );
 
   // assume 1 Character per StyledText
-  return text[offset].mText[0].IsWhiteSpace();
+  return text[offset].mText[0u].IsWhiteSpace();
 }
 
 void FindNearestWord( const MarkupProcessor::StyledTextArray& text, size_t offset, size_t& start, size_t& end)
 {
   const size_t size(text.size());
-  offset = std::min(offset, size-1);
+  offset = std::min(offset, size-1u);
 
   size_t i(offset);
   size_t j(offset);
@@ -309,7 +291,7 @@ void FindNearestWord( const MarkupProcessor::StyledTextArray& text, size_t offse
   if(IsWhiteSpace(text, offset))
   {
     // scan left until non-white space / beginning of string.
-    while(i > 0 && IsWhiteSpace(text, i))
+    while(i > 0u && IsWhiteSpace(text, i))
     {
       i--;
     }
@@ -335,7 +317,7 @@ void FindNearestWord( const MarkupProcessor::StyledTextArray& text, size_t offse
   }
 
   // expand left and right markers to encompase entire word
-  while(i > 0 && !IsWhiteSpace(text, i-1))
+  while(i > 0u && !IsWhiteSpace(text, i-1u))
   {
     i--;
   }
index cc2fd60..6324805 100644 (file)
@@ -34,27 +34,27 @@ namespace TextProcessor
 {
 
 /**
- * Splits the given text in lines.
+ * Splits the given text in paragraphs.
  *
  * @note Assumes the StyledTextArray has 1 Character per Text element. (which is the case for text in TextInput, but
  * not necessarily the case for text in TextView)
  *
  * @param [in] text The given text.
- * @param [out] lines The text split in lines.
+ * @param [out] paragraphs The text split in paragraphs.
  */
-void SplitInLines( const MarkupProcessor::StyledTextArray& text,
-                   std::vector<MarkupProcessor::StyledTextArray>& lines );
+void SplitInParagraphs( const MarkupProcessor::StyledTextArray& text,
+                        std::vector<MarkupProcessor::StyledTextArray>& paragraphs );
 
 /**
- * Splits the given line in words.
+ * Splits the given paragraph in words.
  *
  * @note Assumes the StyledTextArray has 1 Character per Text element. (which is the case for text in TextInput, but
  * not necessarily the case for text in TextView)
  *
- * @param [in] line The given line.
- * @param [out] words The line split in words.
+ * @param [in] paragraph The given paragraph.
+ * @param [out] words The paragraph split in words.
  */
-void SplitInWords( const MarkupProcessor::StyledTextArray& line,
+void SplitInWords( const MarkupProcessor::StyledTextArray& paragraph,
                    std::vector<MarkupProcessor::StyledTextArray>& words );
 
 /**
@@ -85,12 +85,12 @@ bool ContainsRightToLeftCharacter( const MarkupProcessor::StyledTextArray& text
  * Convert the text as specified by the Unicode Bidirectional Algorithm.
  * The text is converted only if it is bidirectional.
  * @param[in] line The line of text to be converted.
- * @param[out] convertedText The text converted. Text is grouped in chunks which only have one direction.
+ * @param[out] convertedText The text converted.
  * @param[out] logicalToVisualMap The character position map from the logical input text to the visual output text.
  * @param[out] visualToLogicalMap The character position map from the visual output text to the logical input text.
  */
  void ConvertBidirectionalText( const MarkupProcessor::StyledTextArray& line,
-                                std::vector<MarkupProcessor::StyledTextArray>& convertedText,
+                                MarkupProcessor::StyledTextArray& convertedText,
                                 std::vector<int>& logicalToVisualMap,
                                 std::vector<int>& visualToLogicalMap );
 
index c94db79..3373ab7 100644 (file)
@@ -34,22 +34,48 @@ namespace TextViewProcessor
 // Layout info.
 /////////////////////
 
+GradientInfo::GradientInfo()
+: mGradientColor(),
+  mStartPoint(),
+  mEndPoint()
+{
+}
+
+GradientInfo::~GradientInfo()
+{
+}
+
+GradientInfo::GradientInfo( const GradientInfo& info )
+: mGradientColor( info.mGradientColor ),
+  mStartPoint( info.mStartPoint ),
+  mEndPoint( info.mEndPoint )
+{
+}
+
+GradientInfo& GradientInfo::operator=( const GradientInfo& info )
+{
+  if( this != &info )
+  {
+    mGradientColor = info.mGradientColor;
+    mStartPoint = info.mStartPoint;
+    mEndPoint = info.mEndPoint;
+  }
+
+  return *this;
+}
+
 CharacterLayoutInfo::CharacterLayoutInfo()
-: mHeight( 0.f ),
-  mAdvance( 0.f ),
+: mSize(),
   mBearing( 0.f ),
-  mPosition(),
-  mOffset(),
-  mSize(),
   mAscender( 0.f ),
   mUnderlineThickness( 0.f ),
   mUnderlinePosition( 0.f ),
+  mPosition(),
+  mOffset(),
   mGlyphActor(),
   mStyledText(),
   mColorAlpha( 1.f ),
-  mGradientColor(),
-  mStartPoint(),
-  mEndPoint(),
+  mGradientInfo( NULL ),
   mIsVisible( true ),
   mSetText( true ),
   mSetStyle( true ),
@@ -57,22 +83,24 @@ CharacterLayoutInfo::CharacterLayoutInfo()
 {
 }
 
+CharacterLayoutInfo::~CharacterLayoutInfo()
+{
+  // Deletes the gradient info.
+  delete mGradientInfo;
+}
+
 CharacterLayoutInfo::CharacterLayoutInfo( const CharacterLayoutInfo& character )
-: mHeight( character.mHeight ),
-  mAdvance( character.mAdvance ),
+: mSize( character.mSize ),
   mBearing( character.mBearing ),
-  mPosition( character.mPosition ),
-  mOffset( character.mOffset ),
-  mSize( character.mSize ),
   mAscender( character.mAscender ),
   mUnderlineThickness( character.mUnderlineThickness ),
   mUnderlinePosition( character.mUnderlinePosition ),
+  mPosition( character.mPosition ),
+  mOffset( character.mOffset ),
   mGlyphActor( character.mGlyphActor ),
   mStyledText( character.mStyledText ),
   mColorAlpha( character.mColorAlpha ),
-  mGradientColor( character.mGradientColor ),
-  mStartPoint( character.mStartPoint ),
-  mEndPoint( character.mEndPoint ),
+  mGradientInfo( ( NULL == character.mGradientInfo ) ? NULL : new GradientInfo( *character.mGradientInfo ) ), // Copies the gradient info.
   mIsVisible( character.mIsVisible ),
   mSetText( character.mSetText ),
   mSetStyle( character.mSetStyle ),
@@ -82,29 +110,47 @@ CharacterLayoutInfo::CharacterLayoutInfo( const CharacterLayoutInfo& character )
 
 CharacterLayoutInfo& CharacterLayoutInfo::operator=( const CharacterLayoutInfo& character )
 {
-  mHeight = character.mHeight;
-  mAdvance = character.mAdvance;
-  mBearing = character.mBearing;
-
-  mPosition = character.mPosition;
-  mOffset = character.mOffset;
   mSize = character.mSize;
   mAscender = character.mAscender;
+  mBearing = character.mBearing;
   mUnderlineThickness = character.mUnderlineThickness;
   mUnderlinePosition = character.mUnderlinePosition;
 
+  mPosition = character.mPosition;
+  mOffset = character.mOffset;
+
+  mGlyphActor = character.mGlyphActor;
   mStyledText = character.mStyledText;
+
   mColorAlpha = character.mColorAlpha;
-  mGradientColor = character.mGradientColor;
-  mStartPoint = character.mStartPoint;
-  mEndPoint = character.mEndPoint;
+
+  // Copies the gradient info.
+  if( NULL == character.mGradientInfo )
+  {
+    // The source doesn't have. Deletes the current one.
+    delete mGradientInfo;
+    mGradientInfo = NULL;
+  }
+  else
+  {
+    // The source has gradient info.
+    if( NULL != mGradientInfo )
+    {
+      // It it has, copy to it.
+      *mGradientInfo = *character.mGradientInfo;
+    }
+    else
+    {
+      // If it doesn't have, create a new one.
+      mGradientInfo = new GradientInfo( *character.mGradientInfo );
+    }
+  }
+
   mIsVisible = character.mIsVisible;
   mSetText = character.mSetText;
   mSetStyle = character.mSetStyle;
   mIsColorGlyph = character.mIsColorGlyph;
 
-  mGlyphActor = character.mGlyphActor;
-
   return *this;
 }
 
index ddf6cd7..0079170 100644 (file)
@@ -121,8 +121,8 @@ bool IsTextViewProcessorNewStyleOperation( const TextView::TextViewProcessorMeta
 
 TextView::TextViewProcessorMetadata::TextViewProcessorMetadata()
 : mType( TextView::TextSet ),
-  mPosition( 0 ),
-  mNumberOfCharacters( 0 ),
+  mPosition( 0u ),
+  mNumberOfCharacters( 0u ),
   mText()
 {
 }
@@ -311,8 +311,7 @@ void TextView::SetLineHeightOffset( PointSize offset )
                                                                 RELAYOUT_ALIGNMENT |
                                                                 RELAYOUT_VISIBILITY |
                                                                 RELAYOUT_TEXT_ACTOR_UPDATE |
-                                                                RELAYOUT_INSERT_TO_TEXT_VIEW |
-                                                                RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST );
+                                                                RELAYOUT_INSERT_TO_TEXT_VIEW );
     }
   }
 }
@@ -477,8 +476,7 @@ void TextView::SetHeightExceedPolicy( Toolkit::TextView::ExceedPolicy policy )
                                                                 RELAYOUT_ALIGNMENT |
                                                                 RELAYOUT_VISIBILITY |
                                                                 RELAYOUT_TEXT_ACTOR_UPDATE |
-                                                                RELAYOUT_INSERT_TO_TEXT_VIEW |
-                                                                RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST );
+                                                                RELAYOUT_INSERT_TO_TEXT_VIEW );
     }
   }
 }
@@ -505,8 +503,7 @@ void TextView::SetLineJustification( Toolkit::TextView::LineJustification justif
                                                                 RELAYOUT_ALIGNMENT |
                                                                 RELAYOUT_VISIBILITY |
                                                                 RELAYOUT_TEXT_ACTOR_UPDATE |
-                                                                RELAYOUT_INSERT_TO_TEXT_VIEW |
-                                                                RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST );
+                                                                RELAYOUT_INSERT_TO_TEXT_VIEW );
     }
   }
 }
@@ -534,8 +531,7 @@ void TextView::SetFadeBoundary( const Toolkit::TextView::FadeBoundary& fadeBound
                                                                 RELAYOUT_REMOVE_TEXT_ACTORS |
                                                                 RELAYOUT_VISIBILITY |
                                                                 RELAYOUT_TEXT_ACTOR_UPDATE |
-                                                                RELAYOUT_INSERT_TO_TEXT_VIEW |
-                                                                RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST );
+                                                                RELAYOUT_INSERT_TO_TEXT_VIEW );
     }
   }
 }
@@ -635,7 +631,6 @@ void TextView::GetTextLayoutInfo()
       if( hasGlyphActors )
       {
         mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations | RELAYOUT_INSERT_TO_TEXT_VIEW );
-        mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations | RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST );
       }
 
     }
@@ -741,8 +736,7 @@ void TextView::SetSnapshotModeEnabled( bool enable )
       mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations |
                                                                 RELAYOUT_REMOVE_TEXT_ACTORS |
                                                                 RELAYOUT_TEXT_ACTOR_UPDATE |
-                                                                RELAYOUT_INSERT_TO_TEXT_VIEW |
-                                                                RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST );
+                                                                RELAYOUT_INSERT_TO_TEXT_VIEW );
     }
     RelayoutRequest();
   }
@@ -875,6 +869,10 @@ TextView::LayoutParameters::LayoutParameters()
   MarkupProcessor::GetStyledTextArray( std::string( "..." ), mEllipsizeText, false );
 }
 
+TextView::LayoutParameters::~LayoutParameters()
+{
+}
+
 TextView::LayoutParameters::LayoutParameters( Toolkit::TextView::MultilinePolicy   multilinePolicy,
                                               Toolkit::TextView::ExceedPolicy      widthExceedPolicy,
                                               Toolkit::TextView::ExceedPolicy      heightExceedPolicy,
@@ -1066,7 +1064,6 @@ Vector3 TextView::GetNaturalSize()
       mRelayoutData.mGlyphActors.clear();
 
       mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations | RELAYOUT_INSERT_TO_TEXT_VIEW );
-      mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations | RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST );
     }
 
     PerformTextViewProcessorOperations();
@@ -1127,7 +1124,6 @@ float TextView::GetHeightForWidth( float width )
     if( hasGlyphActors )
     {
       mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations | RELAYOUT_INSERT_TO_TEXT_VIEW );
-      mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations | RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST );
     }
 
     if( differentWidth || hasGlyphActors )
@@ -1191,8 +1187,7 @@ void TextView::OnRelaidOut( Vector2 size, ActorSizeContainer& container )
                                                                 RELAYOUT_ALIGNMENT |
                                                                 RELAYOUT_VISIBILITY |
                                                                 RELAYOUT_TEXT_ACTOR_UPDATE |
-                                                                RELAYOUT_INSERT_TO_TEXT_VIEW |
-                                                                RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST );
+                                                                RELAYOUT_INSERT_TO_TEXT_VIEW );
     }
   }
 
@@ -1300,9 +1295,9 @@ void TextView::OptimizeTextViewProcessorOperations()
       {
         bool optimizationDone = false;
 
-        if( it + 1 != endIt )
+        if( it + 1u != endIt )
         {
-          const TextViewProcessorMetadata& nextRelayoutMetadata( *( it + 1 ) );
+          const TextViewProcessorMetadata& nextRelayoutMetadata( *( it + 1u ) );
           if( TextView::TextInserted == nextRelayoutMetadata.mType )
           {
             if( relayoutMetadata.mPosition == nextRelayoutMetadata.mPosition )
@@ -2006,7 +2001,7 @@ void TextView::OnLineJustificationPropertySet( Property::Value propertyValue )
 void TextView::OnFadeBoundaryPropertySet( Property::Value propertyValue )
 {
   Vector4 value( propertyValue.Get<Vector4>() );
-  DALI_ASSERT_ALWAYS( value.x >= 0 && value.y >= 0 && value.z >= 0 && value.w >= 0
+  DALI_ASSERT_ALWAYS( ( value.x >= 0.f ) && ( value.y >= 0.f ) && ( value.z >= 0.f ) && ( value.w >= 0.f )
                       && "TextView::OnFadeBoundaryPropertySet(). Negative value is invalid. "  );
 
   Toolkit::TextView::FadeBoundary fadeBoundary( PixelSize( static_cast<unsigned int>( value.x ) ),
index 85db821..220871b 100644 (file)
@@ -108,7 +108,6 @@ public:
     RELAYOUT_INITIALIZE_TEXT_ACTORS = 0x10,    ///< Initialize text-actors (create handles).
     RELAYOUT_TEXT_ACTOR_UPDATE = 0x20,         ///< Updates text-actors (set size, position, style, ...)
     RELAYOUT_INSERT_TO_TEXT_VIEW = 0x40,       ///< Adds the text-actors to the text-view.
-    RELAYOUT_INSERT_TO_TEXT_ACTOR_LIST = 0x80, ///< Inserts the text-actors to the text-actor list.
     RELAYOUT_ALL = 0xFF                        ///< Does all operations.
   };
 
@@ -423,8 +422,7 @@ private:
   TextView& operator=( const TextView& rhs );
 
   /**
-   * Executes synchronously relayout operations such as set, insert, remove or replace text, or
-   * split groups of characters, etc.
+   * Executes synchronously relayout operations such as set, insert, remove or replace text, etc.
    */
   void PerformTextViewProcessorOperations();
 
@@ -593,6 +591,11 @@ public:
     LayoutParameters();
 
     /**
+     * Default destructor.
+     */
+    ~LayoutParameters();
+
+    /**
      * Constructor
      */
     LayoutParameters( Toolkit::TextView::MultilinePolicy     multilinePolicy,
diff --git a/base/dali-toolkit/internal/controls/text-view/text-view-line-processor.cpp b/base/dali-toolkit/internal/controls/text-view/text-view-line-processor.cpp
deleted file mode 100644 (file)
index 18f670f..0000000
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// FILE HEADER
-#include <dali-toolkit/internal/controls/text-view/text-view-line-processor.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/text-view/text-view-word-processor.h>
-#include <dali-toolkit/internal/controls/text-view/text-view-word-group-processor.h>
-#include <dali-toolkit/internal/controls/text-view/text-view-processor-helper-functions.h>
-#include <dali-toolkit/internal/controls/text-view/text-processor.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace TextViewProcessor
-{
-
-/////////////////////
-// Layout info.
-/////////////////////
-
-LineLayoutInfo::LineLayoutInfo()
-: mSize(),
-  mAscender( 0.f ),
-  mLineHeightOffset( 0.f ),
-  mWordGroupsLayoutInfo(),
-  mNumberOfCharacters( 0 )
-{
-}
-
-LineLayoutInfo::LineLayoutInfo( const LineLayoutInfo& line )
-: mSize( line.mSize ),
-  mAscender( line.mAscender ),
-  mLineHeightOffset( line.mLineHeightOffset ),
-  mWordGroupsLayoutInfo( line.mWordGroupsLayoutInfo ),
-  mNumberOfCharacters( line.mNumberOfCharacters )
-{
-}
-
-LineLayoutInfo& LineLayoutInfo::operator=( const LineLayoutInfo& line )
-{
-  mSize = line.mSize;
-  mAscender = line.mAscender;
-  mLineHeightOffset = line.mLineHeightOffset;
-  mWordGroupsLayoutInfo = line.mWordGroupsLayoutInfo;
-  mNumberOfCharacters = line.mNumberOfCharacters;
-
-  return *this;
-}
-
-void UpdateLineLayoutInfo( TextViewProcessor::LineLayoutInfo& lineLayoutInfo, const float lineHeightOffset )
-{
-  lineLayoutInfo.mSize = Size();
-
-  for( WordGroupLayoutInfoContainer::iterator it = lineLayoutInfo.mWordGroupsLayoutInfo.begin(), endIt = lineLayoutInfo.mWordGroupsLayoutInfo.end();
-       it != endIt;
-       ++it )
-  {
-    WordGroupLayoutInfo& layoutInfo( *it );
-
-    UpdateSize( lineLayoutInfo.mSize, layoutInfo.mSize );
-  }
-  lineLayoutInfo.mSize.height += lineHeightOffset;
-}
-
-void CreateLineInfo( const MarkupProcessor::StyledTextArray& line,
-                     TextView::RelayoutData& relayoutData,
-                     TextViewProcessor::LineLayoutInfo& lineLayoutInfo )
-{
-  // TODO: Split the line in group of words. Each group of words has only left to right characters or right to left characters but not a mix of both.
-  // TODO: set the wordgroup direction (LTR or RTL)
-  std::vector<MarkupProcessor::StyledTextArray> wordGroups;
-  if( TextProcessor::ContainsRightToLeftCharacter( line ) )
-  {
-    // If the text is bidirectional, the characters will be converted and reordered
-    // as specified by the Unicode Bidirectional Algorithm.
-
-    // Reorders the line and converts arabic glyphs (if any).
-    // It also split words in different groups if there are a mix of left to right
-    // and right to left text.
-    // If the whole line is left to right or right to left all words are grouped in the same group.
-    TextProcessor::ConvertBidirectionalText( line,
-                                             wordGroups,
-                                             relayoutData.mCharacterLogicalToVisualMap,
-                                             relayoutData.mCharacterVisualToLogicalMap);
-  }
-  else
-  {
-    // No bidirectional text to process.
-
-    if( !line.empty() )
-    {
-      // Add all words in a group.
-      wordGroups.push_back( line );
-
-      // Create trivial bidirectional map tables.
-      std::size_t index = 0;
-      for( MarkupProcessor::StyledTextArray::const_iterator it = line.begin(), endIt = line.end(); it != endIt; ++it )
-      {
-        const MarkupProcessor::StyledText& styledText( *it );
-
-        for( std::size_t i = 0, length = styledText.mText.GetLength(); i < length; ++i )
-        {
-          relayoutData.mCharacterLogicalToVisualMap.push_back( relayoutData.mTextLayoutInfo.mNumberOfCharacters + index );
-          relayoutData.mCharacterVisualToLogicalMap.push_back( relayoutData.mTextLayoutInfo.mNumberOfCharacters + index );
-          ++index;
-        }
-      }
-    }
-  }
-
-  // Traverse all group of words.
-  for( std::vector<MarkupProcessor::StyledTextArray>::const_iterator groupIt = wordGroups.begin(), groupEndIt = wordGroups.end(); groupIt != groupEndIt; ++groupIt )
-  {
-    const MarkupProcessor::StyledTextArray& wordGroup( *groupIt );
-
-    // Data structures for the new group of words.
-    WordGroupLayoutInfo wordGroupLayoutInfo;
-
-    CreateWordGroupInfo( wordGroup,
-                         relayoutData.mTextLayoutInfo,
-                         wordGroupLayoutInfo );
-
-    // Update layout info for the current line.
-    lineLayoutInfo.mAscender = std::max( lineLayoutInfo.mAscender, wordGroupLayoutInfo.mAscender );
-    lineLayoutInfo.mNumberOfCharacters += wordGroupLayoutInfo.mNumberOfCharacters;
-    UpdateSize( lineLayoutInfo.mSize, wordGroupLayoutInfo.mSize );
-
-    // Add the group of words to the current line.
-    lineLayoutInfo.mWordGroupsLayoutInfo.push_back( wordGroupLayoutInfo );
-  } // end of group of words
-}
-
-void RemoveWordGroupsFromLine( const std::size_t groupIndex,
-                               const std::size_t numberOfGroups,
-                               const PointSize& lineHeightOffset,
-                               LineLayoutInfo& lineLayout )
-{
-  // Removes groups of words from a line.
-
-  // * Check if words or lines can be merged after removing a group of words or a line separator have to be done outside this method.
-
-  // * Note: Currently it's only used to remove a number of groups of words from the beginning, or
-  //         from groupIndex index to the end. This function doesn't merge groups of words (if a whole group is removed)
-  //         TODO: merge groups of words if required.
-
-  const std::size_t groupEndIndex = groupIndex + numberOfGroups;
-
-  // Remove word groups from layout info.
-  lineLayout.mWordGroupsLayoutInfo.erase( lineLayout.mWordGroupsLayoutInfo.begin() + groupIndex,
-                                          lineLayout.mWordGroupsLayoutInfo.begin() + groupEndIndex );
-
-  // Update layout info.
-  lineLayout.mSize = Size();
-  lineLayout.mAscender = 0.f;
-  lineLayout.mNumberOfCharacters = 0;
-  for( WordGroupLayoutInfoContainer::const_iterator it = lineLayout.mWordGroupsLayoutInfo.begin(), endIt = lineLayout.mWordGroupsLayoutInfo.end();
-       it != endIt;
-       ++it )
-  {
-    const WordGroupLayoutInfo& group( *it );
-
-    UpdateSize( lineLayout.mSize, group.mSize );
-    lineLayout.mAscender = std::max( lineLayout.mAscender, group.mAscender );
-    lineLayout.mNumberOfCharacters += group.mNumberOfCharacters;
-  }
-  lineLayout.mSize.height += lineHeightOffset;
-  lineLayout.mLineHeightOffset = lineHeightOffset;
-}
-
-void SplitLine( const TextInfoIndices& indices,
-                const PointSize& lineHeightOffset,
-                LineLayoutInfo& firstLineLayoutInfo,
-                LineLayoutInfo& lastLineLayoutInfo )
-{
-  // Splits a line in two.
-  // A group of words and a word may be split in two as well.
-
-  // * Split the group of words within the line.
-  // * Add last part of the group of words to the new line.
-  // * Add groups of words from groupPosition + 1 to the end.
-  // * Update layout info of the last line.
-  // * Remove groups of words added to the last part of the line from the first line.
-
-  // early returns!!
-  if( ( 0 == indices.mGroupIndex ) && ( 0 == indices.mWordIndex ) && ( 0 == indices.mCharacterIndex ) )
-  {
-    // the whole line goes to the last part.
-    lastLineLayoutInfo = firstLineLayoutInfo;
-
-    firstLineLayoutInfo = LineLayoutInfo();
-
-    return;
-  }
-
-  if( !firstLineLayoutInfo.mWordGroupsLayoutInfo.empty() )
-  {
-    const std::size_t numberOfGroups = firstLineLayoutInfo.mWordGroupsLayoutInfo.size();
-    if( indices.mGroupIndex == numberOfGroups - 1 )
-    {
-      const WordGroupLayoutInfo& group( *( firstLineLayoutInfo.mWordGroupsLayoutInfo.end() - 1 ) );
-
-      const std::size_t numberOfWords = group.mWordsLayoutInfo.size();
-      if( indices.mWordIndex == numberOfWords - 1 )
-      {
-        const WordLayoutInfo& word( *( group.mWordsLayoutInfo.end() - 1 ) );
-        if( indices.mCharacterIndex == word.mCharactersLayoutInfo.size() )
-        {
-          // the whole line goes to the first part.
-
-          // Just delete whatever there is in the last part of the line.
-          lastLineLayoutInfo = LineLayoutInfo();
-
-          return;
-        }
-      }
-    }
-  }
-
-  lastLineLayoutInfo = LineLayoutInfo();
-
-  // 1) Split the group of words whitin the line.
-  WordGroupLayoutInfo& firstWordGroupLayoutInfo( *( firstLineLayoutInfo.mWordGroupsLayoutInfo.begin() + indices.mGroupIndex ) );
-  WordGroupLayoutInfo lastWordGroupLayoutInfo;
-
-  SplitWordGroup( indices,
-                  firstWordGroupLayoutInfo,
-                  lastWordGroupLayoutInfo );
-
-  // 2) Add last part of the group of words to the new line.
-  if( !lastWordGroupLayoutInfo.mWordsLayoutInfo.empty() )
-  {
-    lastLineLayoutInfo.mWordGroupsLayoutInfo.push_back( lastWordGroupLayoutInfo );
-  }
-
-  // 3) Add groups from group-position + 1 to the end.
-  lastLineLayoutInfo.mWordGroupsLayoutInfo.insert( lastLineLayoutInfo.mWordGroupsLayoutInfo.end(),
-                                                   firstLineLayoutInfo.mWordGroupsLayoutInfo.begin() + indices.mGroupIndex + 1, firstLineLayoutInfo.mWordGroupsLayoutInfo.end() );
-
-  // 4) update layout info of the last line.
-  for( WordGroupLayoutInfoContainer::iterator it = lastLineLayoutInfo.mWordGroupsLayoutInfo.begin(), endIt = lastLineLayoutInfo.mWordGroupsLayoutInfo.end();
-       it != endIt;
-       ++it )
-  {
-    WordGroupLayoutInfo& layoutInfo( *it );
-
-    lastLineLayoutInfo.mNumberOfCharacters += layoutInfo.mNumberOfCharacters;
-    UpdateSize( lastLineLayoutInfo.mSize, layoutInfo.mSize );
-    lastLineLayoutInfo.mAscender = std::max( lastLineLayoutInfo.mAscender, layoutInfo.mAscender );
-  }
-  lastLineLayoutInfo.mSize.height += lineHeightOffset;
-  lastLineLayoutInfo.mLineHeightOffset = lineHeightOffset;
-
-  // 5) Remove groups of words added to the last part of the line from the first line.
-
-  // if the number of characters of the last group of words of the first line is zero, it should be removed.
-  const std::size_t index = ( 0 == firstWordGroupLayoutInfo.mNumberOfCharacters ? indices.mGroupIndex : indices.mGroupIndex + 1 );
-
-  firstLineLayoutInfo.mWordGroupsLayoutInfo.erase( firstLineLayoutInfo.mWordGroupsLayoutInfo.begin() + index, firstLineLayoutInfo.mWordGroupsLayoutInfo.end() );
-
-  // 6) update layout info of the first line.
-  firstLineLayoutInfo.mNumberOfCharacters = 0;
-  firstLineLayoutInfo.mSize = Size();
-  firstLineLayoutInfo.mAscender = 0.f;
-  for( WordGroupLayoutInfoContainer::iterator it = firstLineLayoutInfo.mWordGroupsLayoutInfo.begin(), endIt = firstLineLayoutInfo.mWordGroupsLayoutInfo.end();
-       it != endIt;
-       ++it )
-  {
-    WordGroupLayoutInfo& layoutInfo( *it );
-
-    firstLineLayoutInfo.mNumberOfCharacters += layoutInfo.mNumberOfCharacters;
-    UpdateSize( firstLineLayoutInfo.mSize, layoutInfo.mSize );
-    firstLineLayoutInfo.mAscender = std::max( firstLineLayoutInfo.mAscender, layoutInfo.mAscender );
-  }
-  firstLineLayoutInfo.mSize.height += lineHeightOffset;
-  firstLineLayoutInfo.mLineHeightOffset = lineHeightOffset;
-}
-
-void MergeLine( LineLayoutInfo& firstLineLineLayoutInfo,
-                const LineLayoutInfo& lastLineLayoutInfo )
-{
-  // Merges two given lines.
-  //
-  // Can't merge two lines if the last word of the first one is a line separator (new line character)
-
-  // Early returns.
-
-  if( lastLineLayoutInfo.mWordGroupsLayoutInfo.empty() )
-  {
-    // Nothing to merge if last line is empty.
-    return;
-  }
-
-  if( firstLineLineLayoutInfo.mWordGroupsLayoutInfo.empty() )
-  {
-    // If first line is empty, just copy the last line to the first one.
-    firstLineLineLayoutInfo = lastLineLayoutInfo;
-
-    return;
-  }
-
-  if( 1 == firstLineLineLayoutInfo.mWordGroupsLayoutInfo.size() )
-  {
-    WordGroupLayoutInfo& wordGroupLayout( *firstLineLineLayoutInfo.mWordGroupsLayoutInfo.begin() );
-
-    if( wordGroupLayout.mWordsLayoutInfo.empty() )
-    {
-      // If first line is empty, just copy the last line to the first one.
-      firstLineLineLayoutInfo = lastLineLayoutInfo;
-
-      return;
-    }
-  }
-
-  // Check the last word of the last group of the first line doesn't finish with a new line character.
-  WordGroupLayoutInfo& lastWordGroupLayout( *( firstLineLineLayoutInfo.mWordGroupsLayoutInfo.end() - 1 ) );
-  WordLayoutInfo& lastWordLayout( *( lastWordGroupLayout.mWordsLayoutInfo.end() - 1 ) );
-  if( LineSeparator == lastWordLayout.mType )
-  {
-    DALI_ASSERT_ALWAYS( !"TextViewProcessor::MergeLine(). ERROR: A line can't be merged to another line which finishes with a new line character." );
-  }
-
-  // If the last group of the first line has the same direction than the first group of the last line, both lines can be concatenated.
-  // Otherwise, both groups have to be merged first.
-  const WordGroupLayoutInfo& firstWordGroupLayout( *lastLineLayoutInfo.mWordGroupsLayoutInfo.begin() );
-
-  std::size_t index = 0;
-  if( lastWordGroupLayout.mDirection == firstWordGroupLayout.mDirection )
-  {
-    // Both groups of words have the same direction. They need to be merged.
-    MergeWordGroup( lastWordGroupLayout,
-                    firstWordGroupLayout );
-
-    // After merging two groups of words, the rest of groups need to be added.
-    ++index; // By increasing this index the group of words already merged won't be added again.
-  }
-
-  // Merge layout info
-  firstLineLineLayoutInfo.mWordGroupsLayoutInfo.insert( firstLineLineLayoutInfo.mWordGroupsLayoutInfo.end(),
-                                                        lastLineLayoutInfo.mWordGroupsLayoutInfo.begin() + index, lastLineLayoutInfo.mWordGroupsLayoutInfo.end() );
-  UpdateSize( firstLineLineLayoutInfo.mSize, lastLineLayoutInfo.mSize );
-  firstLineLineLayoutInfo.mAscender = std::max( firstLineLineLayoutInfo.mAscender, lastLineLayoutInfo.mAscender );
-  firstLineLineLayoutInfo.mLineHeightOffset = std::max( firstLineLineLayoutInfo.mLineHeightOffset, lastLineLayoutInfo.mLineHeightOffset );
-  firstLineLineLayoutInfo.mNumberOfCharacters += lastLineLayoutInfo.mNumberOfCharacters;
-
-}
-
-WordLayoutInfo GetLastWordLayoutInfo( const LineLayoutInfo& lineLayoutInfo )
-{
-  WordLayoutInfo layoutInfo;
-
-  if( !lineLayoutInfo.mWordGroupsLayoutInfo.empty() )
-  {
-    const WordGroupLayoutInfo& groupInfo( *( lineLayoutInfo.mWordGroupsLayoutInfo.end() - 1 ) );
-
-    if( !groupInfo.mWordsLayoutInfo.empty() )
-    {
-      layoutInfo = *( groupInfo.mWordsLayoutInfo.end() - 1 );
-    }
-  }
-
-  return layoutInfo;
-}
-
-CharacterLayoutInfo GetFirstCharacterLayoutInfo( const LineLayoutInfo& lineLayoutInfo )
-{
-  CharacterLayoutInfo layoutInfo;
-
-  if( !lineLayoutInfo.mWordGroupsLayoutInfo.empty() )
-  {
-    const WordGroupLayoutInfo& groupInfo( *lineLayoutInfo.mWordGroupsLayoutInfo.begin() );
-
-    if( !groupInfo.mWordsLayoutInfo.empty() )
-    {
-      const WordLayoutInfo& wordInfo( *groupInfo.mWordsLayoutInfo.begin() );
-
-      layoutInfo = GetFirstCharacterLayoutInfo( wordInfo );
-    }
-  }
-
-  return layoutInfo;
-}
-
-CharacterLayoutInfo GetLastCharacterLayoutInfo( const LineLayoutInfo& lineLayoutInfo )
-{
-  const WordLayoutInfo wordInfo = GetLastWordLayoutInfo( lineLayoutInfo );
-
-  return GetLastCharacterLayoutInfo( wordInfo );
-}
-
-void CollectTextActorsFromLines( std::vector<TextActor>& textActors, const TextLayoutInfo& textLayoutInfo, const std::size_t lineIndexBegin, const std::size_t lineIndexEnd )
-{
-  for( LineLayoutInfoContainer::const_iterator lineIt = textLayoutInfo.mLinesLayoutInfo.begin() + lineIndexBegin, lineEndIt = textLayoutInfo.mLinesLayoutInfo.begin() + lineIndexEnd;
-       lineIt != lineEndIt;
-       ++lineIt )
-  {
-    const LineLayoutInfo& line( *lineIt );
-
-    CollectTextActorsFromGroups( textActors, line, 0, line.mWordGroupsLayoutInfo.size() );
-  }
-}
-
-} //namespace TextViewProcessor
-
-} //namespace Internal
-
-} //namespace Toolkit
-
-} //namespace Dali
diff --git a/base/dali-toolkit/internal/controls/text-view/text-view-line-processor.h b/base/dali-toolkit/internal/controls/text-view/text-view-line-processor.h
deleted file mode 100644 (file)
index 4fa5185..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_VIEW_LINE_PROCESSOR_H__
-#define __DALI_TOOLKIT_INTERNAL_TEXT_VIEW_LINE_PROCESSOR_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/text-view/text-view-impl.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace TextViewProcessor
-{
-
-/**
- * Updates the line layout size info.
- *
- * @param[in,out] lineLayoutInfo The line layout info.
- * @param[in] lineHeightOffset The line height offset.
- */
-void UpdateLineLayoutInfo( TextViewProcessor::LineLayoutInfo& lineLayoutInfo, float lineHeightOffset );
-
-/**
- * Creates a data structure with info to layout the line, and data structures with useful info to modify the layout data structure if characters are added or removed.
- *
- * @param[in] line The styled line.
- * @param[in,out] relayoutData Natural size (metrics), layout, text-actor info and conversion from visual to logical order and vice versa (for RTL text).
- * @param[out] lineLayoutInfo Layout info for the whole line.
- */
-void CreateLineInfo( const MarkupProcessor::StyledTextArray& line,
-                     TextView::RelayoutData& relayoutData,
-                     TextViewProcessor::LineLayoutInfo& lineLayoutInfo );
-
-/**
- * Removes a given number of groups of words from the given line.
- *
- * @pre \e groupIndex and \e groupIndex + \e numberOfGroups can't exceed the bounds of the line.
- *
- * @param[in] groupIndex Index to the group of words within the line with the starting position to be deleted.
- * @param[in] numberOfGroups The number of group of words to be deleted.
- * @param[in] lineHeightOffset Additional space between lines. Needed to update layout info.
- * @param[in,out] lineLayout The input is the layout info of the line. The output is the layout info of the line without the removed group of words.
- */
-void RemoveWordGroupsFromLine( std::size_t groupIndex,
-                               std::size_t numberOfGroups,
-                               const PointSize& lineHeightOffset,
-                               LineLayoutInfo& lineLayout );
-
-/**
- * Splits a given line in two.
- *
- * @note It deletes whatever there is in the last part of the line.
- *
- * @param[in] indices Index to the group of words within the line, index to the word and index to the character within the word to split the line.
- * @param[in] lineHeightOffset Additional space between lines. Needed to update layout info.
- * @param[in,out] firstLineLayoutInfo The input is the layout info of the given line. The output is the first part of the input line (from the group of words \e 0 to the group of words \e groupPosition).
- * @param[in,out] lastLineLayoutInfo Layout info of the last part of the given line ( from the group of words \e groupPosition + \e 1 to the end of the line).
- */
-void SplitLine( const TextInfoIndices& indices,
-                const PointSize& lineHeightOffset,
-                LineLayoutInfo& firstLineLayoutInfo,
-                LineLayoutInfo& lastLineLayoutInfo );
-
-/**
- * Merges the two given lines by adding groups of words of the last line to the firs one.
- *
- * @note Does nothing if last part of the line is empty.
- * @note If the first part of the line is empty it just copy the last part to it.
- * @note it asserts if the last word of the first group is a line separator (new line character)
- *
- * @param[in,out] firstLineLineLayoutInfo The input is the layout info of the first line. The output is the layout info of the merged line.
- * @param[in] lastLineLayoutInfo Layout info of the last line.
- *
- */
-void MergeLine( LineLayoutInfo& firstLineLineLayoutInfo,
-                const LineLayoutInfo& lastLineLayoutInfo );
-
-/**
- * Retrieves the layout information of the last word of the given line.
- *
- * @param[in] lineLayoutInfo The line layout.
- *
- * @return Layout information of the last word of the line.
- */
-WordLayoutInfo GetLastWordLayoutInfo( const LineLayoutInfo& lineLayoutInfo );
-
-/**
- * Retrieves the layout information of the first character of the given line.
- *
- * @param[in] lineLayoutInfo The line layout.
- *
- * @return Layout information of the first character of the line.
- */
-CharacterLayoutInfo GetFirstCharacterLayoutInfo( const LineLayoutInfo& lineLayoutInfo );
-
-/**
- * Retrieves the layout information of the last character of the given line.
- *
- * @param[in] lineLayoutInfo The line layout.
- *
- * @return Layout information of the last character of the line.
- */
-CharacterLayoutInfo GetLastCharacterLayoutInfo( const LineLayoutInfo& lineLayoutInfo );
-
-/**
- * Collects text-actors from the given lines and stores them into the text-actor vector.
- *
- * @param[out] textActors Stores the text-actors of the given lines.
- * @param[in] textLayoutInfo Whole text with the given lines.
- * @param[in] lineIndexBegin The first line.
- * @param[in] lineIndexEnd The last line.
- */
-void CollectTextActorsFromLines( std::vector<TextActor>& textActors, const TextLayoutInfo& textLayoutInfo, std::size_t lineIndexBegin, std::size_t lineIndexEnd );
-
-} //namespace TextViewProcessor
-
-} //namespace Internal
-
-} //namespace Toolkit
-
-} //namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_TEXT_VIEW_LINE_PROCESSOR_H__
diff --git a/base/dali-toolkit/internal/controls/text-view/text-view-paragraph-processor.cpp b/base/dali-toolkit/internal/controls/text-view/text-view-paragraph-processor.cpp
new file mode 100644 (file)
index 0000000..be29790
--- /dev/null
@@ -0,0 +1,592 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// FILE HEADER
+#include <dali-toolkit/internal/controls/text-view/text-view-paragraph-processor.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/controls/text-view/text-view-word-processor.h>
+#include <dali-toolkit/internal/controls/text-view/text-view-processor-helper-functions.h>
+#include <dali-toolkit/internal/controls/text-view/text-processor.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+namespace TextViewProcessor
+{
+
+/////////////////////
+// Layout info.
+/////////////////////
+
+ParagraphLayoutInfo::ParagraphLayoutInfo()
+: mSize(),
+  mAscender( 0.f ),
+  mLineHeightOffset( 0.f ),
+  mNumberOfCharacters( 0u ),
+  mWordsLayoutInfo()
+{
+}
+
+ParagraphLayoutInfo::~ParagraphLayoutInfo()
+{
+}
+
+ParagraphLayoutInfo::ParagraphLayoutInfo( const ParagraphLayoutInfo& paragraph )
+: mSize( paragraph.mSize ),
+  mAscender( paragraph.mAscender ),
+  mLineHeightOffset( paragraph.mLineHeightOffset ),
+  mNumberOfCharacters( paragraph.mNumberOfCharacters ),
+  mWordsLayoutInfo( paragraph.mWordsLayoutInfo )
+{
+}
+
+ParagraphLayoutInfo& ParagraphLayoutInfo::operator=( const ParagraphLayoutInfo& paragraph )
+{
+  mSize = paragraph.mSize;
+  mAscender = paragraph.mAscender;
+  mLineHeightOffset = paragraph.mLineHeightOffset;
+  mNumberOfCharacters = paragraph.mNumberOfCharacters;
+  mWordsLayoutInfo = paragraph.mWordsLayoutInfo;
+
+  return *this;
+}
+
+void CreateParagraphInfo( const MarkupProcessor::StyledTextArray& paragraph,
+                          TextView::RelayoutData& relayoutData,
+                          ParagraphLayoutInfo& paragraphLayoutInfo )
+{
+  // Split the paragraph in words.
+  // TODO: Proper RTL support.
+  MarkupProcessor::StyledTextArray convertedParagraph;
+  if( TextProcessor::ContainsRightToLeftCharacter( paragraph ) )
+  {
+    // If the text is bidirectional, the characters will be converted and reordered
+    // as specified by the Unicode Bidirectional Algorithm.
+
+    // Reorders the paragraph and converts arabic glyphs (if any).
+    TextProcessor::ConvertBidirectionalText( paragraph,
+                                             convertedParagraph,
+                                             relayoutData.mCharacterLogicalToVisualMap,
+                                             relayoutData.mCharacterVisualToLogicalMap);
+  }
+  else
+  {
+    // No bidirectional text to process.
+    convertedParagraph = paragraph;
+
+    // Create trivial bidirectional map tables.
+    std::size_t index = 0u;
+    for( MarkupProcessor::StyledTextArray::const_iterator it = convertedParagraph.begin(), endIt = convertedParagraph.end(); it != endIt; ++it )
+    {
+      const MarkupProcessor::StyledText& styledText( *it );
+
+      for( std::size_t i = 0u, length = styledText.mText.GetLength(); i < length; ++i )
+      {
+        relayoutData.mCharacterLogicalToVisualMap.push_back( relayoutData.mTextLayoutInfo.mNumberOfCharacters + index );
+        relayoutData.mCharacterVisualToLogicalMap.push_back( relayoutData.mTextLayoutInfo.mNumberOfCharacters + index );
+        ++index;
+      }
+    }
+  }
+
+  // Split the paragraph in words
+  std::vector<MarkupProcessor::StyledTextArray> words;
+  TextProcessor::SplitInWords( convertedParagraph, words );
+
+  // if last word has a new paragraph separator, create a new word.
+  if( !words.empty() )
+  {
+    MarkupProcessor::StyledTextArray& word( *( words.end() - 1u ) );
+    if( word.size() > 1u )
+    {
+      // do nothing if the word has only one character.
+      MarkupProcessor::StyledText& styledText( *( word.end() - 1u ) );
+      if( !styledText.mText.IsEmpty() )
+      {
+        const std::size_t length = styledText.mText.GetLength();
+        if( styledText.mText[length-1u].IsNewLine() )
+        {
+          // Last character of this word is a new paragraph character.
+
+          // Remove paragraph separator character from current word.
+          styledText.mText.Remove( length - 1u, 1u );
+
+          // Create a new word with the paragraph separator character.
+          MarkupProcessor::StyledText newParagraphText( Text( styledText.mText[length-1u] ), styledText.mStyle );
+
+          MarkupProcessor::StyledTextArray newParagraphWord;
+          newParagraphWord.push_back( newParagraphText );
+
+          words.push_back( newParagraphWord );
+        }
+      }
+    }
+  }
+
+  std::string lastCharacterFont; // Keeps the font used by the last character. It's used to set the font to a word separator.
+
+  // Traverse all words.
+  for( std::vector<MarkupProcessor::StyledTextArray>::const_iterator wordIt = words.begin(), wordEndIt = words.end(); wordIt != wordEndIt; ++wordIt )
+  {
+    const MarkupProcessor::StyledTextArray& word( *wordIt );
+
+    // Data structures for the new word.
+    WordLayoutInfo wordLayoutInfo;
+
+    CreateWordTextInfo( word,
+                        wordLayoutInfo );
+
+    // White space's size could be different depending on the type of font. It's important to use the same font than the previous character to
+    // avoid 'jumps' of characters when there is a switch between one text-actor per character and one text-actor per line and/or style.
+    if( WordSeparator == wordLayoutInfo.mType )
+    {
+      // If current word is a word separator (white space) then the font of the last character is set.
+      for( CharacterLayoutInfoContainer::iterator characterIt = wordLayoutInfo.mCharactersLayoutInfo.begin(), characterEndIt = wordLayoutInfo.mCharactersLayoutInfo.end();
+           characterIt != characterEndIt;
+           ++characterIt )
+      {
+        CharacterLayoutInfo& characterLayout( *characterIt );
+
+        characterLayout.mStyledText.mStyle.SetFontName( lastCharacterFont );
+      }
+    }
+    else
+    {
+      // kepps the font of the last character.
+      if( !wordLayoutInfo.mCharactersLayoutInfo.empty() )
+      {
+        lastCharacterFont = ( *( wordLayoutInfo.mCharactersLayoutInfo.end() - 1u ) ).mStyledText.mStyle.GetFontName();
+      }
+    }
+
+    // Update the max word width figure.
+    relayoutData.mTextLayoutInfo.mMaxWordWidth = std::max( relayoutData.mTextLayoutInfo.mMaxWordWidth, wordLayoutInfo.mSize.width );
+
+    // Update layout info for the current paragraph.
+    paragraphLayoutInfo.mAscender = std::max( paragraphLayoutInfo.mAscender, wordLayoutInfo.mAscender );
+    paragraphLayoutInfo.mNumberOfCharacters += wordLayoutInfo.mCharactersLayoutInfo.size();
+    UpdateSize( paragraphLayoutInfo.mSize, wordLayoutInfo.mSize );
+
+    // Add the word to the current paragraph.
+    paragraphLayoutInfo.mWordsLayoutInfo.push_back( wordLayoutInfo );
+  } // end of words
+}
+
+void UpdateLayoutInfo( ParagraphLayoutInfo& paragraphLayoutInfo, float lineHeightOffset )
+{
+  // Update layout info.
+  paragraphLayoutInfo.mSize = Size::ZERO;
+  paragraphLayoutInfo.mAscender = 0.f;
+  paragraphLayoutInfo.mNumberOfCharacters = 0u;
+  for( WordLayoutInfoContainer::iterator it = paragraphLayoutInfo.mWordsLayoutInfo.begin(), endIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
+       it != endIt;
+       ++it )
+  {
+    WordLayoutInfo& word( *it );
+
+    UpdateSize( paragraphLayoutInfo.mSize, word.mSize );
+    paragraphLayoutInfo.mAscender = std::max( paragraphLayoutInfo.mAscender, word.mAscender );
+    paragraphLayoutInfo.mNumberOfCharacters += word.mCharactersLayoutInfo.size();
+  }
+
+  paragraphLayoutInfo.mSize.height += lineHeightOffset;
+  paragraphLayoutInfo.mLineHeightOffset = lineHeightOffset;
+}
+
+void RemoveWordsFromParagraph( std::size_t wordIndex,
+                               std::size_t numberOfWords,
+                               float lineHeightOffset,
+                               ParagraphLayoutInfo& paragraphLayout )
+{
+  // Removes words from a paragraph.
+
+  // * Check if words or paragraphs can be merged after removing a number of words or a paragraph separator needs to be done outside this method.
+
+  // Remove words from layout info.
+  paragraphLayout.mWordsLayoutInfo.erase( paragraphLayout.mWordsLayoutInfo.begin() + wordIndex,
+                                     paragraphLayout.mWordsLayoutInfo.begin() + ( wordIndex + numberOfWords ) );
+
+  UpdateLayoutInfo( paragraphLayout, lineHeightOffset );
+}
+
+void RemoveCharactersFromParagraphInfo( TextView::RelayoutData& relayoutData,
+                                   const std::size_t numberOfCharacters,
+                                   bool& mergeWords,
+                                   bool& mergeParagraphs,
+                                   TextInfoIndices& textInfoIndicesBegin,
+                                   TextInfoIndices& textInfoIndicesEnd,
+                                   TextInfoIndices& textInfoMergeIndicesBegin,
+                                   TextInfoIndices& textInfoMergeIndicesEnd,
+                                   ParagraphLayoutInfo& paragraphLayout,
+                                   std::vector<TextActor>& removedTextActorsFromFirstWord,
+                                   std::vector<TextActor>& removedTextActorsFromLastWord )
+{
+  const TextLayoutInfo& textLayoutInfo = relayoutData.mTextLayoutInfo;
+
+  if( textInfoIndicesBegin.mWordIndex < textInfoIndicesEnd.mWordIndex )
+  {
+    // Deleted text is from different words. The two different words may be merged.
+
+    // Get first word.
+    WordLayoutInfo& firstWordLayout( *( paragraphLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex ) );
+
+    // Get last word.
+    WordLayoutInfo& lastWordLayout( *( paragraphLayout.mWordsLayoutInfo.begin() + textInfoIndicesEnd.mWordIndex ) );
+
+    // whether first or last word need to be split and merged.
+    bool mergeFromBegin = false;
+    bool mergeToEnd = false;
+
+    if( textInfoIndicesBegin.mCharacterIndex > 0u )
+    {
+      // First word is going to be split. It could be merged with the last word.
+      mergeFromBegin = true;
+      textInfoMergeIndicesBegin.mWordIndex = textInfoIndicesBegin.mWordIndex;
+    }
+    else if( ( textInfoIndicesBegin.mCharacterIndex == 0u ) && ( textInfoIndicesBegin.mWordIndex > 0u ) )
+    {
+      // First word is going to be removed completely.
+      // Check if previous word could be merged.
+
+      // Get word before.
+      WordLayoutInfo& previousWordLayout( *( paragraphLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex - 1u ) );
+      if( WordSeparator != previousWordLayout.mType )
+      {
+        // Previous word is not a word separator, so could be merged.
+        mergeFromBegin = true;
+        textInfoMergeIndicesBegin.mWordIndex = textInfoIndicesBegin.mWordIndex - 1u;
+      }
+    }
+
+    if( mergeFromBegin )
+    {
+      // First word (or previous one) could be merged. Check if last one could be merged as well.
+
+      if( textInfoIndicesEnd.mCharacterIndex + 1u < lastWordLayout.mCharactersLayoutInfo.size() )
+      {
+        // Last word is going to be split. It could be merged with the first word.
+        mergeToEnd = true;
+        textInfoMergeIndicesEnd.mWordIndex = textInfoIndicesEnd.mWordIndex;
+      }
+      else if( ( textInfoIndicesEnd.mCharacterIndex + 1u == lastWordLayout.mCharactersLayoutInfo.size() ) && ( textInfoIndicesEnd.mWordIndex + 1u < paragraphLayout.mWordsLayoutInfo.size() ) )
+      {
+        // Last word is going to be removed completely.
+        // Check if the word after could be merged.
+
+        // Get word after.
+        WordLayoutInfo& afterWordLayout( *( paragraphLayout.mWordsLayoutInfo.begin() + textInfoIndicesEnd.mWordIndex + 1u ) );
+        if( WordSeparator != afterWordLayout.mType )
+        {
+          // The word after is not a word separator, so could be merged.
+          mergeToEnd = true;
+          textInfoMergeIndicesEnd.mWordIndex = textInfoIndicesEnd.mWordIndex + 1u;
+        }
+      }
+
+      // Merge words only if both words could be merged.
+      mergeWords = mergeFromBegin && mergeToEnd;
+    }
+
+    if( ( textInfoIndicesEnd.mCharacterIndex + 1u == lastWordLayout.mCharactersLayoutInfo.size() ) && ( textInfoIndicesEnd.mWordIndex + 1u == paragraphLayout.mWordsLayoutInfo.size() ) )
+    {
+      // Last word of the paragraph is going to be removed completely.
+      // Check if it's a paragraph separator.
+
+      if( ParagraphSeparator == lastWordLayout.mType )
+      {
+        // The paragraph separator is going to be removed.
+        if( textInfoIndicesBegin.mParagraphIndex + 1u < textLayoutInfo.mParagraphsLayoutInfo.size() )
+        {
+          //  Paragraph need to be merged.
+          textInfoMergeIndicesBegin.mParagraphIndex = textInfoIndicesBegin.mParagraphIndex;
+          textInfoMergeIndicesEnd.mParagraphIndex = textInfoIndicesBegin.mParagraphIndex + 1u;
+          mergeParagraphs= true;
+
+          ++textInfoIndicesBegin.mParagraphIndex; // increase both indices,
+          textInfoIndicesEnd.mParagraphIndex +=2u; // will delete last paragraph.
+        }
+      }
+    }
+
+    if( textInfoIndicesBegin.mCharacterIndex > 0u )
+    {
+      // First word needs to be split.
+
+      // Store text-actors before removing them.
+      CollectTextActors( removedTextActorsFromFirstWord, firstWordLayout, textInfoIndicesBegin.mCharacterIndex, firstWordLayout.mCharactersLayoutInfo.size() );
+
+      RemoveCharactersFromWord( textInfoIndicesBegin.mCharacterIndex,
+                                firstWordLayout.mCharactersLayoutInfo.size() - textInfoIndicesBegin.mCharacterIndex,
+                                firstWordLayout );
+
+      ++textInfoIndicesBegin.mWordIndex; // will delete from the word after.
+    }
+
+    if( textInfoIndicesEnd.mCharacterIndex + 1u < lastWordLayout.mCharactersLayoutInfo.size() )
+    {
+      // Last word needs to be split.
+
+      // Store text-actors before removing them.
+      CollectTextActors( removedTextActorsFromLastWord, lastWordLayout, 0u, textInfoIndicesEnd.mCharacterIndex + 1u );
+
+      RemoveCharactersFromWord( 0u,
+                                textInfoIndicesEnd.mCharacterIndex + 1u,
+                                lastWordLayout );
+
+      if( mergeWords )
+      {
+        // This word is going to be merged, so is not needed.
+        ++textInfoIndicesEnd.mWordIndex; // will delete the last word.
+      }
+    }
+    else if( textInfoIndicesEnd.mCharacterIndex + 1u == lastWordLayout.mCharactersLayoutInfo.size() )
+    {
+      // The whole last word is going to be removed.
+      ++textInfoIndicesEnd.mWordIndex; // will delete the last word.
+
+      if( ( WordSeparator == lastWordLayout.mType ) && mergeWords )
+      {
+        // The last word is a word separator and the word after is going to be merged so is not needed.
+        ++textInfoIndicesEnd.mWordIndex; // will delete the word after the last one.
+      }
+    }
+  }
+  else
+  {
+    // Chraracters to be removed are from the same word.
+
+    RemoveCharactersFromWordInfo( relayoutData,
+                                  numberOfCharacters,
+                                  mergeWords,
+                                  mergeParagraphs,
+                                  textInfoIndicesBegin,
+                                  textInfoIndicesEnd,
+                                  textInfoMergeIndicesBegin,
+                                  textInfoMergeIndicesEnd,
+                                  paragraphLayout,
+                                  removedTextActorsFromFirstWord );
+  } // word indices
+}
+
+void SplitParagraph( const TextInfoIndices& indices,
+                     float lineHeightOffset,
+                     ParagraphLayoutInfo& firstParagraphLayoutInfo,
+                     ParagraphLayoutInfo& lastParagraphLayoutInfo )
+{
+  // Splits a paragraph in two.
+  // A word may be split in two as well.
+
+  // * Split the word within the paragraph.
+  // * Add last part of the word to the new paragraph.
+  // * Add words from wordPosition + 1 to the end.
+  // * Update layout info of the last paragraph.
+  // * Remove words added to the last part of the paragraph from the first paragraph.
+
+  // early returns!!
+  if( ( 0u == indices.mWordIndex ) && ( 0u == indices.mCharacterIndex ) )
+  {
+    // the whole paragraph goes to the last part.
+    lastParagraphLayoutInfo = firstParagraphLayoutInfo;
+
+    firstParagraphLayoutInfo = ParagraphLayoutInfo();
+
+    return;
+  }
+
+  if( !firstParagraphLayoutInfo.mWordsLayoutInfo.empty() )
+  {
+    const std::size_t numberOfWords = firstParagraphLayoutInfo.mWordsLayoutInfo.size();
+    if( indices.mWordIndex == numberOfWords - 1u )
+    {
+      const WordLayoutInfo& word( *( firstParagraphLayoutInfo.mWordsLayoutInfo.end() - 1u ) );
+      if( indices.mCharacterIndex == word.mCharactersLayoutInfo.size() )
+      {
+        // the whole paragraph goes to the first part.
+
+        // Just delete whatever there is in the last part of the paragraph.
+        lastParagraphLayoutInfo = ParagraphLayoutInfo();
+
+        return;
+      }
+    }
+  }
+
+  lastParagraphLayoutInfo = ParagraphLayoutInfo();
+
+  // 1) Split the word whitin the paragraph.
+  WordLayoutInfo& firstWordLayoutInfo( *( firstParagraphLayoutInfo.mWordsLayoutInfo.begin() + indices.mWordIndex ) );
+  WordLayoutInfo lastWordLayoutInfo;
+
+  SplitWord( indices.mCharacterIndex,
+             firstWordLayoutInfo,
+             lastWordLayoutInfo );
+
+  // 2) Add last part of the word to the new paragraph.
+  if( !lastWordLayoutInfo.mCharactersLayoutInfo.empty() )
+  {
+    lastParagraphLayoutInfo.mWordsLayoutInfo.push_back( lastWordLayoutInfo );
+  }
+
+  // 3) Add words from word-position + 1 to the end.
+  lastParagraphLayoutInfo.mWordsLayoutInfo.insert( lastParagraphLayoutInfo.mWordsLayoutInfo.end(),
+                                                   firstParagraphLayoutInfo.mWordsLayoutInfo.begin() + indices.mWordIndex + 1u,
+                                                   firstParagraphLayoutInfo.mWordsLayoutInfo.end() );
+
+  // 4) update layout info of the last paragraph.
+  for( WordLayoutInfoContainer::iterator it = lastParagraphLayoutInfo.mWordsLayoutInfo.begin(), endIt = lastParagraphLayoutInfo.mWordsLayoutInfo.end();
+       it != endIt;
+       ++it )
+  {
+    WordLayoutInfo& layoutInfo( *it );
+
+    UpdateSize( lastParagraphLayoutInfo.mSize, layoutInfo.mSize );
+    lastParagraphLayoutInfo.mNumberOfCharacters += layoutInfo.mCharactersLayoutInfo.size();
+    lastParagraphLayoutInfo.mAscender = std::max( lastParagraphLayoutInfo.mAscender, layoutInfo.mAscender );
+  }
+  lastParagraphLayoutInfo.mSize.height += lineHeightOffset;
+  lastParagraphLayoutInfo.mLineHeightOffset = lineHeightOffset;
+
+  // 5) Remove words added to the last part of the paragraph from the first paragraph.
+
+  // if the number of characters of the last word of the first paragraph is zero, it should be removed.
+  const std::size_t index = ( firstWordLayoutInfo.mCharactersLayoutInfo.empty() ? indices.mWordIndex : indices.mWordIndex + 1u );
+
+  firstParagraphLayoutInfo.mWordsLayoutInfo.erase( firstParagraphLayoutInfo.mWordsLayoutInfo.begin() + index, firstParagraphLayoutInfo.mWordsLayoutInfo.end() );
+
+  // 6) update layout info of the first paragraph.
+  UpdateLayoutInfo( firstParagraphLayoutInfo, lineHeightOffset );
+}
+
+void MergeParagraph( ParagraphLayoutInfo& firstParagraphLayoutInfo,
+                     const ParagraphLayoutInfo& lastParagraphLayoutInfo )
+{
+  // Merges two given paragraphs.
+  //
+  // Can't merge two paragraphs if the last word of the first one is a paragraph separator (new paragraph character)
+
+  // Early returns.
+
+  if( lastParagraphLayoutInfo.mWordsLayoutInfo.empty() )
+  {
+    // Nothing to merge if last paragraph is empty.
+    return;
+  }
+
+  if( firstParagraphLayoutInfo.mWordsLayoutInfo.empty() )
+  {
+    // If first paragraph is empty, just copy the last paragraph to the first one.
+    firstParagraphLayoutInfo = lastParagraphLayoutInfo;
+
+   return;
+  }
+
+  // Check the last word of the first paragraph doesn't finish with a new paragraph character.
+  WordLayoutInfo& lastWordLayout( *( firstParagraphLayoutInfo.mWordsLayoutInfo.end() - 1u ) );
+  if( ParagraphSeparator == lastWordLayout.mType )
+  {
+    DALI_ASSERT_ALWAYS( !"TextViewProcessor::MergeParagraph(). ERROR: A paragraph can't be merged to another paragraph which finishes with a new paragraph character." );
+  }
+
+  // If the las word of the first paragraph or the first word of the last paragraph is a white space, both paragraphs can be concatenated.
+  // Otherwise both words need to be merged first.
+  const WordLayoutInfo& firstWordLayout( *lastParagraphLayoutInfo.mWordsLayoutInfo.begin() );
+
+  std::size_t index = 0u;
+  if( ( WordSeparator != lastWordLayout.mType ) && ( WordSeparator != firstWordLayout.mType ) && ( ParagraphSeparator != firstWordLayout.mType ) )
+  {
+    // Last word of the first paragraph is not a word separator and first word of the last paragraph is not a word or paragraph separator.
+    // Words need to be merged.
+
+    MergeWord( lastWordLayout,
+               firstWordLayout );
+
+    // After merging two words, the rest of the words need to be added.
+    ++index; // By increasing this index the word already merged won't be added again.
+  }
+
+  // Merge layout info
+
+  // Insert the layout of the words.
+  firstParagraphLayoutInfo.mWordsLayoutInfo.insert( firstParagraphLayoutInfo.mWordsLayoutInfo.end(),
+                                                   lastParagraphLayoutInfo.mWordsLayoutInfo.begin() + index, lastParagraphLayoutInfo.mWordsLayoutInfo.end() );
+
+  // Update the size and other layout parameters.
+  UpdateSize( firstParagraphLayoutInfo.mSize, lastParagraphLayoutInfo.mSize );
+  firstParagraphLayoutInfo.mAscender = std::max( firstParagraphLayoutInfo.mAscender, lastParagraphLayoutInfo.mAscender );
+  firstParagraphLayoutInfo.mLineHeightOffset = std::max( firstParagraphLayoutInfo.mLineHeightOffset, lastParagraphLayoutInfo.mLineHeightOffset );
+  firstParagraphLayoutInfo.mNumberOfCharacters += lastParagraphLayoutInfo.mNumberOfCharacters;
+}
+
+WordLayoutInfo GetLastWordLayoutInfo( const ParagraphLayoutInfo& paragraphLayoutInfo )
+{
+  WordLayoutInfo layoutInfo;
+
+  if( !paragraphLayoutInfo.mWordsLayoutInfo.empty() )
+  {
+    layoutInfo = *( paragraphLayoutInfo.mWordsLayoutInfo.end() - 1u );
+  }
+
+  return layoutInfo;
+}
+
+CharacterLayoutInfo GetFirstCharacterLayoutInfo( const ParagraphLayoutInfo& paragraphLayoutInfo )
+{
+  CharacterLayoutInfo layoutInfo;
+
+  if( !paragraphLayoutInfo.mWordsLayoutInfo.empty() )
+  {
+    const WordLayoutInfo& wordInfo( *paragraphLayoutInfo.mWordsLayoutInfo.begin() );
+
+    layoutInfo = GetFirstCharacterLayoutInfo( wordInfo );
+  }
+
+  return layoutInfo;
+}
+
+CharacterLayoutInfo GetLastCharacterLayoutInfo( const ParagraphLayoutInfo& paragraphLayoutInfo )
+{
+  const WordLayoutInfo wordInfo = GetLastWordLayoutInfo( paragraphLayoutInfo );
+
+  return GetLastCharacterLayoutInfo( wordInfo );
+}
+
+void CollectTextActorsFromParagraphs( std::vector<TextActor>& textActors, const TextLayoutInfo& textLayoutInfo, const std::size_t paragraphIndexBegin, const std::size_t paragraphIndexEnd )
+{
+  for( ParagraphLayoutInfoContainer::const_iterator paragraphIt = textLayoutInfo.mParagraphsLayoutInfo.begin() + paragraphIndexBegin, paragraphEndIt = textLayoutInfo.mParagraphsLayoutInfo.begin() + paragraphIndexEnd;
+       paragraphIt != paragraphEndIt;
+       ++paragraphIt )
+  {
+    const ParagraphLayoutInfo& paragraph( *paragraphIt );
+
+    CollectTextActorsFromWords( textActors, paragraph, 0u, paragraph.mWordsLayoutInfo.size() );
+  }
+}
+
+} //namespace TextViewProcessor
+
+} //namespace Internal
+
+} //namespace Toolkit
+
+} //namespace Dali
diff --git a/base/dali-toolkit/internal/controls/text-view/text-view-paragraph-processor.h b/base/dali-toolkit/internal/controls/text-view/text-view-paragraph-processor.h
new file mode 100644 (file)
index 0000000..b43489c
--- /dev/null
@@ -0,0 +1,169 @@
+#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_VIEW_PARAGRAPH_PROCESSOR_H__
+#define __DALI_TOOLKIT_INTERNAL_TEXT_VIEW_PARAGRAPH_PROCESSOR_H__
+
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/controls/text-view/text-view-impl.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+namespace TextViewProcessor
+{
+
+/**
+ * Creates a data structure with info to layout the paragraph, and data structures with useful info to modify the layout data structure if characters are added or removed.
+ *
+ * @param[in] paragraph The styled paragraph.
+ * @param[in,out] relayoutData Natural size (metrics), layout, text-actor info and conversion from visual to logical order and vice versa (for RTL text).
+ * @param[out] paragraphLayoutInfo Layout info for the whole paragraph.
+ */
+void CreateParagraphInfo( const MarkupProcessor::StyledTextArray& line,
+                          TextView::RelayoutData& relayoutData,
+                          ParagraphLayoutInfo& paragraphLayoutInfo );
+
+/**
+ * Updates the paragraph layout info.
+ *
+ * @param[in,out] paragraphLayoutInfo The paragraph layout info.
+ * @param[in] lineHeightOffset The offset added to the line height.
+ */
+void UpdateLayoutInfo( ParagraphLayoutInfo& paragraphLayoutInfo, float lineHeightOffset );
+
+/**
+ * Removes a given number of words from the given paragraph.
+ *
+ * @pre \e wordIndex and \e wordIndex + \e numberOfWords can't exceed the bounds of the paragraph.
+ *
+ * @param[in] wordIndex Index to the word within the paragraph with the starting position to be deleted.
+ * @param[in] numberOfWords The number of words to be deleted.
+ * @param[in] lineHeightOffset The offset added to the line height. Needed to update the layout info.
+ * @param[in,out] paragraphLayout The input is the layout info of the paragraph. The output is the layout info of the paragraph without the removed words.
+ */
+void RemoveWordsFromParagraph( std::size_t wordIndex,
+                               std::size_t numberOfWords,
+                               float lineHeightOffset,
+                               ParagraphLayoutInfo& paragraphLayout );
+
+/**
+ * @param[in,out] relayoutData Natural size (metrics), layout, text-actor info.
+ * @param[in] numberOfCharacters The number of characters to be deleted.
+ * @param[out] mergeWords Whether words need to be merged after removing characters.
+ * @param[out] mergeParagraphs Whether current paragraph need to be merged with the next one.
+ * @param[in,out] textInfoIndicesBegin Indices to the paragraph, word and characters from where to delete characters. It returns from where words need to be removed.
+ * @param[out] textInfoIndicesEnd If paragraphs or words need to be merged it returns info to delete them (If a word is merged, it has to be removed. Equal for paragraphs).
+ * @param[out] textInfoMergeIndicesBegin The indices to the first part of the paragraph and word to be merged.
+ * @param[out] textInfoMergeIndicesEnd The indices to the last part of the paragraph and word to be merged.
+ * @param[in,out] paragraphLayout Layout info of the paragraph where the word is located.
+ * @param[out] removedTextActorsFromFirstWord Stores removed text-actors of the word pointed by the 'begin' index.
+ * @param[out] removedTextActorsFromLastWord Stores removed text-actors of the word pointed by the 'end' index.
+ */
+void RemoveCharactersFromParagraphInfo( TextView::RelayoutData& relayoutData,
+                                        std::size_t numberOfCharacters,
+                                        bool& mergeWords,
+                                        bool& mergeParagraphs,
+                                        TextInfoIndices& textInfoIndicesBegin,
+                                        TextInfoIndices& textInfoIndicesEnd,
+                                        TextInfoIndices& textInfoMergeIndicesBegin,
+                                        TextInfoIndices& textInfoMergeIndicesEnd,
+                                        ParagraphLayoutInfo& paragraphLayout,
+                                        std::vector<TextActor>& removedTextActorsFromFirstWord,
+                                        std::vector<TextActor>& removedTextActorsFromLastWord );
+
+/**
+ * Splits a given paragraph in two.
+ *
+ * @note It deletes whatever there is in the last part of the paragraph.
+ *
+ * @param[in] indices Index to the word within the paragraph and index to the character within the word to split the paragraph.
+ * @param[in] lineHeightOffset Additional space between lines. Needed to update layout info.
+ * @param[in,out] firstParagraphLayoutInfo The input is the layout info of the given paragraph. The output is the first part of the input paragraph.
+ * @param[in,out] lastParagraphLayoutInfo Layout info of the last part of the given paragraph.
+ */
+void SplitParagraph( const TextInfoIndices& indices,
+                     float lineHeightOffset,
+                     ParagraphLayoutInfo& firstParagraphLayoutInfo,
+                     ParagraphLayoutInfo& lastParagraphLayoutInfo );
+
+/**
+ * Merges the two given paragraphs by adding words of the last paragraph to the firs one.
+ *
+ * @note Does nothing if last part of the paragraph is empty.
+ * @note If the first part of the paragraph is empty it just copy the last part to it.
+ * @note it asserts if the last word of the first paragraph is a paragraph separator (new paragraph character)
+ *
+ * @param[in,out] firstParagraphLayoutInfo The input is the layout info of the first paragraph. The output is the layout info of the merged paragraph.
+ * @param[in] lastParagraphLayoutInfo Layout info of the last paragraph.
+ *
+ */
+void MergeParagraph( ParagraphLayoutInfo& firstParagraphLayoutInfo,
+                     const ParagraphLayoutInfo& lastParagraphLayoutInfo );
+
+/**
+ * Retrieves the layout information of the last word of the given paragraph.
+ *
+ * @param[in] paragraphLayoutInfo The paragraph layout.
+ *
+ * @return Layout information of the last word of the paragraph.
+ */
+WordLayoutInfo GetLastWordLayoutInfo( const ParagraphLayoutInfo& paragraphLayoutInfo );
+
+/**
+ * Retrieves the layout information of the first character of the given paragraph.
+ *
+ * @param[in] paragraphLayoutInfo The paragraph layout.
+ *
+ * @return Layout information of the first character of the paragraph.
+ */
+CharacterLayoutInfo GetFirstCharacterLayoutInfo( const ParagraphLayoutInfo& paragraphLayoutInfo );
+
+/**
+ * Retrieves the layout information of the last character of the given paragraph.
+ *
+ * @param[in] paragraphLayoutInfo The paragraph layout.
+ *
+ * @return Layout information of the last character of the paragraph.
+ */
+CharacterLayoutInfo GetLastCharacterLayoutInfo( const ParagraphLayoutInfo& paragraphLayoutInfo );
+
+/**
+ * Collects text-actors from the given paragraphs and stores them into the text-actor vector.
+ *
+ * @param[out] textActors Stores the text-actors of the given paragraphs.
+ * @param[in] textLayoutInfo Whole text with the given paragraphs.
+ * @param[in] paragraphIndexBegin The first paragraph.
+ * @param[in] paragraphIndexEnd The last paragraph.
+ */
+void CollectTextActorsFromParagraphs( std::vector<TextActor>& textActors, const TextLayoutInfo& textLayoutInfo, std::size_t paragraphIndexBegin, std::size_t paragraphIndexEnd );
+
+} //namespace TextViewProcessor
+
+} //namespace Internal
+
+} //namespace Toolkit
+
+} //namespace Dali
+
+#endif // __DALI_TOOLKIT_INTERNAL_TEXT_VIEW_PARAGRAPH_PROCESSOR_H__
index 8e36603..b3a59c7 100644 (file)
@@ -70,9 +70,9 @@ void dbgPrint( const WordLayoutInfo& word )
       std::cout << "NoSeparator" << std::endl;
       break;
     }
-    case LineSeparator:
+    case ParagraphSeparator:
     {
-      std::cout << "LineSeparator" << std::endl;
+      std::cout << "ParagraphSeparator" << std::endl;
       break;
     }
     case WordSeparator:
@@ -83,30 +83,16 @@ void dbgPrint( const WordLayoutInfo& word )
   }
 }
 
-void dbgPrint( const WordGroupLayoutInfo& group )
+void dbgPrint( const ParagraphLayoutInfo& paragraph )
 {
-  std::cout << "( ";
-  std::cout << group.mSize;
-  std::cout << group.mNumberOfCharacters;
-  for( WordLayoutInfoContainer::const_iterator wordIt = group.mWordsLayoutInfo.begin(), endWordIt = group.mWordsLayoutInfo.end();
+  std::cout << "< ";
+  std::cout << paragraph.mSize;
+  for( WordLayoutInfoContainer::const_iterator wordIt = paragraph.mWordsLayoutInfo.begin(), endWordIt = paragraph.mWordsLayoutInfo.end();
        wordIt != endWordIt;
        ++wordIt )
   {
     dbgPrint( *wordIt );
   }
-  std::cout << " )";
-}
-
-void dbgPrint( const LineLayoutInfo& line )
-{
-  std::cout << "< ";
-  std::cout << line.mSize;
-  for( WordGroupLayoutInfoContainer::const_iterator groupIt = line.mWordGroupsLayoutInfo.begin(), endGroupIt = line.mWordGroupsLayoutInfo.end();
-       groupIt != endGroupIt;
-       ++groupIt )
-  {
-    dbgPrint( *groupIt );
-  }
   std::cout << " >";
   std::cout << std::endl;
 }
@@ -115,7 +101,8 @@ void dbgPrint( const TextLayoutInfo& textInfo )
 {
   std::cout << "||" << std::endl;
   std::cout << textInfo.mWholeTextSize;
-  for( LineLayoutInfoContainer::const_iterator it = textInfo.mLinesLayoutInfo.begin(), endIt = textInfo.mLinesLayoutInfo.end();
+  std::cout << textInfo.mNumberOfCharacters;
+  for( ParagraphLayoutInfoContainer::const_iterator it = textInfo.mParagraphsLayoutInfo.begin(), endIt = textInfo.mParagraphsLayoutInfo.end();
        it != endIt;
        ++it )
   {
@@ -126,36 +113,50 @@ void dbgPrint( const TextLayoutInfo& textInfo )
 
 void dbgPrint( const TextStyle& style )
 {
-  std::cout << "             font name : " << style.GetFontName() << std::endl;
-  std::cout << "            font style : " << style.GetFontStyle() << std::endl;
-  std::cout << "       font point size : " << style.GetFontPointSize() << std::endl;
-  std::cout << "                weight : " << style.GetWeight() << std::endl;
-  std::cout << "            text color : " << style.GetTextColor() << std::endl;
-  std::cout << "               italics : " << style.IsItalicsEnabled() << std::endl;
-  std::cout << "             underline : " << style.IsUnderlineEnabled() << std::endl;
-  std::cout << "                shadow : " << style.IsShadowEnabled() << std::endl;
-  std::cout << "          shadow color : " << style.GetShadowColor() << std::endl;
-  std::cout << "         shadow offset : " << style.GetShadowOffset() << std::endl;
-  std::cout << "                  glow : " << style.IsGlowEnabled() << std::endl;
-  std::cout << "         italics angle : " << style.GetItalicsAngle() << std::endl;
-  std::cout << "            glow color : " << style.GetGlowColor() << std::endl;
-  std::cout << "        glow intensity : " << style.GetGlowIntensity() << std::endl;
-  std::cout << "           smooth edge : " << style.GetSmoothEdge() << std::endl;
-  std::cout << "               outline : " << style.IsOutlineEnabled() << std::endl;
-  std::cout << "         outline color : " << style.GetOutlineColor() << std::endl;
-  std::cout << "     outline thickness : " << style.GetOutlineThickness() << std::endl;
-  std::cout << "              gradient : " << style.IsGradientEnabled() << std::endl;
-  std::cout << "        gradient color : " << style.GetGradientColor() << std::endl;
-  std::cout << "  gradient start point : " << style.GetGradientStartPoint() << std::endl;
-  std::cout << "    gradient end point : " << style.GetGradientEndPoint() << std::endl;
+  std::cout << "               font name : " << style.GetFontName() << std::endl;
+  std::cout << "              font style : " << style.GetFontStyle() << std::endl;
+  std::cout << "         font point size : " << style.GetFontPointSize() << std::endl;
+  std::cout << "                  weight : " << style.GetWeight() << std::endl;
+  std::cout << "              text color : " << style.GetTextColor() << std::endl;
+  std::cout << "                 italics : " << style.IsItalicsEnabled() << std::endl;
+  std::cout << "           italics angle : " << style.GetItalicsAngle() << std::endl;
+  std::cout << "               underline : " << style.IsUnderlineEnabled() << std::endl;
+  std::cout << "     underline thickness : " << style.GetUnderlineThickness() << std::endl;
+  std::cout << "      underline position : " << style.GetUnderlinePosition() << std::endl;
+  std::cout << "                  shadow : " << style.IsShadowEnabled() << std::endl;
+  std::cout << "            shadow color : " << style.GetShadowColor() << std::endl;
+  std::cout << "           shadow offset : " << style.GetShadowOffset() << std::endl;
+  std::cout << "             shadow size : " << style.GetShadowSize() << std::endl;
+  std::cout << "                    glow : " << style.IsGlowEnabled() << std::endl;
+  std::cout << "              glow color : " << style.GetGlowColor() << std::endl;
+  std::cout << "          glow intensity : " << style.GetGlowIntensity() << std::endl;
+  std::cout << "             smooth edge : " << style.GetSmoothEdge() << std::endl;
+  std::cout << "                 outline : " << style.IsOutlineEnabled() << std::endl;
+  std::cout << "           outline color : " << style.GetOutlineColor() << std::endl;
+  std::cout << "       outline thickness : " << style.GetOutlineThickness() << std::endl;
+  std::cout << "                gradient : " << style.IsGradientEnabled() << std::endl;
+  std::cout << "          gradient color : " << style.GetGradientColor() << std::endl;
+  std::cout << "    gradient start point : " << style.GetGradientStartPoint() << std::endl;
+  std::cout << "      gradient end point : " << style.GetGradientEndPoint() << std::endl;
+  std::cout << "    is font name default : " << style.IsFontNameDefault() << std::endl;
+  std::cout << "   is font style default : " << style.IsFontStyleDefault() << std::endl;
+  std::cout << "    is font size default : " << style.IsFontSizeDefault() << std::endl;
+  std::cout << "   is text color default : " << style.IsTextColorDefault() << std::endl;
+  std::cout << "  is font weight default : " << style.IsFontWeightDefault() << std::endl;
+  std::cout << "  is smooth edge default : " << style.IsSmoothEdgeDefault() << std::endl;
+  std::cout << "      is italics default : " << style.IsItalicsDefault() << std::endl;
+  std::cout << "    is underline default : " << style.IsUnderlineDefault() << std::endl;
+  std::cout << "       is shadow default : " << style.IsShadowDefault() << std::endl;
+  std::cout << "         is glow default : " << style.IsGlowDefault() << std::endl;
+  std::cout << "      is outline default : " << style.IsOutlineDefault() << std::endl;
+  std::cout << "     is gradient default : " << style.IsGradientDefault() << std::endl;
 }
 
 void dbgPrint( const TextInfoIndices& indices )
 {
-  std::cout << "   line : " << indices.mLineIndex << std::endl;
-  std::cout << "  group : " << indices.mGroupIndex << std::endl;
-  std::cout << "   word : " << indices.mWordIndex << std::endl;
-  std::cout << "   char : " << indices.mCharacterIndex << std::endl;
+  std::cout << "          paragraph : " << indices.mParagraphIndex << std::endl;
+  std::cout << "               word : " << indices.mWordIndex << std::endl;
+  std::cout << "               char : " << indices.mCharacterIndex << std::endl;
 }
 
 void dbgPrint( const MarkupProcessor::StyledTextArray& textArray )
index c471341..b5131e4 100644 (file)
@@ -40,8 +40,7 @@ extern Debug::Filter* gTextViewProcessorLogFilter;
 #endif
 
 void dbgPrint( const WordLayoutInfo& word );
-void dbgPrint( const WordGroupLayoutInfo& group );
-void dbgPrint( const LineLayoutInfo& line );
+void dbgPrint( const ParagraphLayoutInfo& paragraph );
 void dbgPrint( const TextLayoutInfo& textInfo );
 void dbgPrint( const TextStyle& style );
 void dbgPrint( const TextInfoIndices& indices );
index 0533cb4..1855b6e 100644 (file)
@@ -54,8 +54,8 @@ void UpdateSize( Size& size1, const Size& size2, const SizeGrowType type )
 
 TextSeparatorType GetTextSeparatorType( const Character& character )
 {
-  // returns if the given character is a line separator '\n', a word separator ' ' or if is not a separator (any other character).
-  return ( character.IsNewLine() ? LineSeparator : ( character.IsWhiteSpace() ? WordSeparator : NoSeparator ) );
+  // returns if the given character is a paragraph separator '\n', a word separator ' ' or if is not a separator (any other character).
+  return ( character.IsNewLine() ? ParagraphSeparator : ( character.IsWhiteSpace() ? WordSeparator : NoSeparator ) );
 }
 
 void ChooseFontFamilyName( MarkupProcessor::StyledText& text )
@@ -103,88 +103,65 @@ void GetIndicesFromGlobalCharacterIndex( const std::size_t index,
                                          const TextLayoutInfo& textLayoutInfo,
                                          TextInfoIndices& indices )
 {
-  // TODO : Check for mixed LTR and RTL.
-
   // clear all indices
   indices = TextInfoIndices();
 
   // Early return.
-  if( textLayoutInfo.mLinesLayoutInfo.empty() )
+  if( textLayoutInfo.mParagraphsLayoutInfo.empty() )
   {
     // Text is empty. All indices are 0.
     return;
   }
 
-  std::size_t currentIndex = 0; // stores how many characters have been traversed.
+  std::size_t currentIndex = 0u; // stores how many characters have been traversed (within the whole text).
 
-  // Traverse all lines, groups of words and words until global index is found.
+  // Traverse all paragraphs and words until global index is found.
   bool found = false;
-  for( LineLayoutInfoContainer::const_iterator lineIt = textLayoutInfo.mLinesLayoutInfo.begin(),
-         lineEndIt = textLayoutInfo.mLinesLayoutInfo.end();
-       ( !found ) && ( lineIt != lineEndIt );
-       ++lineIt, ++indices.mLineIndex )
+  for( ParagraphLayoutInfoContainer::const_iterator paragraphIt = textLayoutInfo.mParagraphsLayoutInfo.begin(),
+         paragraphEndIt = textLayoutInfo.mParagraphsLayoutInfo.end();
+       ( !found ) && ( paragraphIt != paragraphEndIt );
+       ++paragraphIt, ++indices.mParagraphIndex )
   {
-    const LineLayoutInfo& lineLayoutInfo( *lineIt );
+    const ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphIt );
 
-    if( currentIndex + lineLayoutInfo.mNumberOfCharacters > index )
+    if( currentIndex + paragraphLayoutInfo.mNumberOfCharacters > index )
     {
-      // The character is in this line
-      for( WordGroupLayoutInfoContainer::const_iterator groupIt = lineLayoutInfo.mWordGroupsLayoutInfo.begin(),
-             groupEndIt = lineLayoutInfo.mWordGroupsLayoutInfo.end();
-           ( !found ) && ( groupIt != groupEndIt );
-           ++groupIt, ++indices.mGroupIndex )
+      // The character is in this paragraph
+      for( WordLayoutInfoContainer::const_iterator wordIt = paragraphLayoutInfo.mWordsLayoutInfo.begin(),
+             wordEndIt = paragraphLayoutInfo.mWordsLayoutInfo.end();
+           ( !found ) && ( wordIt != wordEndIt );
+           ++wordIt, ++indices.mWordIndex )
       {
-        const WordGroupLayoutInfo& wordGroupLayoutInfo( *groupIt );
+        const WordLayoutInfo& wordLayoutInfo( *wordIt );
 
-        if( currentIndex + wordGroupLayoutInfo.mNumberOfCharacters > index )
+        if( currentIndex + wordLayoutInfo.mCharactersLayoutInfo.size() > index )
         {
-          // The character is in this group of words.
-          for( WordLayoutInfoContainer::const_iterator wordIt = wordGroupLayoutInfo.mWordsLayoutInfo.begin(),
-                 wordEndIt = wordGroupLayoutInfo.mWordsLayoutInfo.end();
-               ( !found ) && ( wordIt != wordEndIt );
-               ++wordIt, ++indices.mWordIndex )
-          {
-            const WordLayoutInfo& wordLayoutInfo( *wordIt );
-
-            if( currentIndex + wordLayoutInfo.mCharactersLayoutInfo.size() > index )
-            {
-              // The character is in this word
-              indices.mCharacterIndex = index - currentIndex;
-              found = true;
-            }
-            else
-            {
-              // check in the next word.
-              currentIndex += wordLayoutInfo.mCharactersLayoutInfo.size();
-            }
-          } // end words.
-          if( !wordGroupLayoutInfo.mWordsLayoutInfo.empty() )
-          {
-            --indices.mWordIndex;
-          }
+          // The character is in this word
+          indices.mCharacterIndex = index - currentIndex;
+          found = true;
         }
         else
         {
-          // check in the next group of words
-          currentIndex += wordGroupLayoutInfo.mNumberOfCharacters;
+          // check in the next word.
+          currentIndex += wordLayoutInfo.mCharactersLayoutInfo.size();
         }
-      } // end groups of words.
-      if( !lineLayoutInfo.mWordGroupsLayoutInfo.empty() )
+      } // end words.
+      if( !paragraphLayoutInfo.mWordsLayoutInfo.empty() )
       {
-        --indices.mGroupIndex;
+        --indices.mWordIndex;
       }
     }
     else
     {
-      // check in the next line
-      currentIndex += lineLayoutInfo.mNumberOfCharacters;
+      // check in the next paragraph
+      currentIndex += paragraphLayoutInfo.mNumberOfCharacters;
     }
-  } // end lines.
+  } // end paragraphs.
 
   // Need to decrease indices as they have been increased in the last loop.
-  if( !textLayoutInfo.mLinesLayoutInfo.empty() )
+  if( !textLayoutInfo.mParagraphsLayoutInfo.empty() )
   {
-    --indices.mLineIndex;
+    --indices.mParagraphIndex;
   }
 }
 
index 3affae1..ef9fb2a 100644 (file)
@@ -46,9 +46,9 @@ enum SizeGrowType
 };
 
 /**
- * Updates the size of a group of characters, word, group of words, line or the whole text with a given size.
+ * Updates the size of a character, word, line or the whole text with a given size.
  *
- * For group of characters, words, groups of words and lines the new height will be the maximum of both sizes
+ * For characters, words, and lines the new height will be the maximum of both sizes
  * and the new width will be the sum of both.
  *
  * For the whole text, the new height will be the sum of both and the new width the max of both.
@@ -56,7 +56,7 @@ enum SizeGrowType
  * The \e type parameter speficies which type of update is required.
  *
  * @param[in,out] size1 The current size to be updated.
- * @param[in] size2 The size of a group of characters, word, group of words or a line.
+ * @param[in] size2 The size of a character, word, or a line.
  * @param[in] type Type of update.
  */
 void UpdateSize( Size& size1, const Size& size2, SizeGrowType type = GrowWidth );
@@ -80,7 +80,7 @@ TextSeparatorType GetTextSeparatorType( const Character& character );
 void ChooseFontFamilyName( MarkupProcessor::StyledText& text );
 
 /**
- * Retrieves the line, word group, word and character indices for the given global character's index.
+ * Retrieves the line, word and character indices for the given global character's index.
  *
  * i.e. The retrieved indices for the character 18 (j) for the following text would be: 2, 0, 2, 0
  *
@@ -90,8 +90,8 @@ void ChooseFontFamilyName( MarkupProcessor::StyledText& text );
  *  m n o p
  *
  * @param[in] index The global character index.
- * @param[in] textLayoutInfo Contains info about the number of characters per word, group and line.
- * @param[out] indices Index to the line, group of words, word and character within the word where the given character is located.
+ * @param[in] textLayoutInfo Contains info about the number of characters per word, and line.
+ * @param[out] indices Index to the line, word and character within the word where the given character is located.
  */
 void GetIndicesFromGlobalCharacterIndex( std::size_t index,
                                          const TextLayoutInfo& textLayoutInfo,
index 55be5a8..a4d1873 100644 (file)
@@ -35,20 +35,11 @@ namespace TextViewProcessor
 {
 
 /**
- * Whether the direction is Right To Left or Left To Right.
- */
-enum Direction
-{
-  LTR, ///< Left To Right direction.
-  RTL  ///< Right To Left direction.
-};
-
-/**
- * Whether the text is a new line character, a white space or normal text.
+ * Whether the text is a new paragraph character '\n', a white space or normal text.
  */
 enum TextSeparatorType
 {
-  LineSeparator,
+  ParagraphSeparator,
   WordSeparator,
   NoSeparator
 };
@@ -70,14 +61,15 @@ struct TextInfoIndices
 {
   /**
    * Default constructor.
+   *
+   * Initializes all members to their default values.
    */
   TextInfoIndices();
 
   /**
    * Constructor.
    */
-  TextInfoIndices( std::size_t lineIndex,
-                   std::size_t groupIndex,
+  TextInfoIndices( std::size_t paragraphIndex,
                    std::size_t wordIndex,
                    std::size_t characterIndex );
 
@@ -89,10 +81,43 @@ struct TextInfoIndices
    */
   bool operator==( const TextInfoIndices& indices ) const;
 
-  std::size_t mLineIndex;
-  std::size_t mGroupIndex;
-  std::size_t mWordIndex;
-  std::size_t mCharacterIndex;
+  std::size_t mParagraphIndex;          ///< The paragraph index within the text.
+  std::size_t mWordIndex;               ///< The word index within the paragraph.
+  std::size_t mCharacterIndex;          ///< The character index within the word.
+};
+
+/**
+ * Stores gradient info.
+ *
+ * Used to fade in/out text-actors.
+ */
+struct GradientInfo
+{
+  /**
+   * Default constructor.
+   *
+   * Initializes all members to their default values.
+   */
+  GradientInfo();
+
+  /**
+   * Default destructor.
+   */
+  ~GradientInfo();
+
+  /**
+   * Copy constructor
+   */
+  GradientInfo( const GradientInfo& info );
+
+  /**
+   * Assignment operator.
+   */
+  GradientInfo& operator=( const GradientInfo& info );
+
+  Vector4                     mGradientColor;  ///< Gradient color.
+  Vector2                     mStartPoint;     ///< Gradient start point.
+  Vector2                     mEndPoint;       ///< Gradient end point.
 };
 
 /**
@@ -109,6 +134,13 @@ struct CharacterLayoutInfo
   CharacterLayoutInfo();
 
   /**
+   * Default destructor.
+   *
+   * Deletes the gradient info.
+   */
+  ~CharacterLayoutInfo();
+
+  /**
    * Copy constructor.
    */
   CharacterLayoutInfo( const CharacterLayoutInfo& character );
@@ -118,30 +150,26 @@ struct CharacterLayoutInfo
    */
   CharacterLayoutInfo& operator=( const CharacterLayoutInfo& character );
 
-  // Natural size (metrics) of the glyph.
-  float       mHeight;             ///< Natural height of the character.
-  float       mAdvance;            ///< Natural horizontal distance from origin of current character and the next one.
-  float       mBearing;            ///< Natural vertical distance from the baseline to the top of the glyph's bbox.
-
-  // Size of the text-actor (may be modified by a scale factor).
-  Vector3     mPosition;           ///< Position within the text-view
-  Vector2     mOffset;             ///< Alignment and justification offset.
-  Size        mSize;               ///< Size of this character.
+  // Metrics of the glyph.
+  Size        mSize;               ///< Height of the font and advance (the horizontal distance from the origin of the current character and the next one).
+  float       mBearing;            ///< Vertical distance from the baseline to the top of the glyph's boundary box.
   float       mAscender;           ///< Distance from the base line to the top of the line.
   float       mUnderlineThickness; ///< The underline's thickness.
   float       mUnderlinePosition;  ///< The underline's position.
 
-  RenderableActor             mGlyphActor;     ///< Handle to a text-actor.
-  MarkupProcessor::StyledText mStyledText;     ///< Stores the text and its style.
-  float                       mColorAlpha;     ///< Alpha component for the initial text color when text is faded.
-  Vector4                     mGradientColor;  ///< Gradient color.
-  Vector2                     mStartPoint;     ///< Gradient start point.
-  Vector2                     mEndPoint;       ///< Gradient end point.
+  // Position and alignment offset. It depends on the lay-out.
+  Vector3     mPosition;           ///< Position within the text-view
+  Vector2     mOffset;             ///< Alignment and justification offset.
 
-  bool                        mIsVisible:1;    ///< Whether the text-actor is visible.
-  bool                        mSetText:1;      ///< Whether a new text needs to be set in the text-actor.
-  bool                        mSetStyle:1;     ///< Whether a new style needs to be set in the text-actor.
-  bool                        mIsColorGlyph:1; ///< Whether this character is an emoticon.
+  RenderableActor             mGlyphActor;   ///< Handle to a text-actor.
+  MarkupProcessor::StyledText mStyledText;   ///< Stores the text and its style.
+  float                       mColorAlpha;   ///< Alpha component for the initial text color when text is faded.
+  GradientInfo*               mGradientInfo; ///< Stores gradient info.
+
+  bool            mIsVisible:1;    ///< Whether the text-actor is visible.
+  bool            mSetText:1;      ///< Whether a new text needs to be set in the text-actor.
+  bool            mSetStyle:1;     ///< Whether a new style needs to be set in the text-actor.
+  bool            mIsColorGlyph:1; ///< Whether this character is an emoticon.
 };
 typedef std::vector<CharacterLayoutInfo> CharacterLayoutInfoContainer;
 
@@ -158,6 +186,13 @@ struct WordLayoutInfo
   WordLayoutInfo();
 
   /**
+   * Default destructor.
+   *
+   * Clears all characters.
+   */
+  ~WordLayoutInfo();
+
+  /**
    * Copy constructor.
    */
   WordLayoutInfo( const WordLayoutInfo& word );
@@ -175,64 +210,41 @@ struct WordLayoutInfo
 typedef std::vector<WordLayoutInfo> WordLayoutInfoContainer;
 
 /**
- * Layout information for a group of words.
+ * Layout information for a paragraph.
  */
-struct WordGroupLayoutInfo
+struct ParagraphLayoutInfo
 {
   /**
    * Default constructor.
    *
    * Initializes all members to their default values.
    */
-  WordGroupLayoutInfo();
+  ParagraphLayoutInfo();
 
   /**
-   * Copy constructor.
-   */
-  WordGroupLayoutInfo( const WordGroupLayoutInfo& group );
-
-  /**
-   * Assignment operator.
-   */
-  WordGroupLayoutInfo& operator=( const WordGroupLayoutInfo& group );
-
-  Size                    mSize;               ///< Size of the group of words.
-  float                   mAscender;           ///< Max of all ascenders of all words.
-  Direction               mDirection;          ///< Whether this group of words is Right To Left or Left To Right.
-  WordLayoutInfoContainer mWordsLayoutInfo;    ///< Layout info for all words.
-  std::size_t             mNumberOfCharacters; ///< Stores the number of characters.
-};
-typedef std::vector<WordGroupLayoutInfo> WordGroupLayoutInfoContainer;
-
-/**
- * Layout information for a line.
- */
-struct LineLayoutInfo
-{
-  /**
-   * Default constructor.
+   * Default destructor.
    *
-   * Initializes all members to their default values.
+   * Clears all words.
    */
-  LineLayoutInfo();
+  ~ParagraphLayoutInfo();
 
   /**
    * Copy constructor.
    */
-  LineLayoutInfo( const LineLayoutInfo& line );
+  ParagraphLayoutInfo( const ParagraphLayoutInfo& paragraph );
 
   /**
    * Assignment operator.
    */
-  LineLayoutInfo& operator=( const LineLayoutInfo& line );
+  ParagraphLayoutInfo& operator=( const ParagraphLayoutInfo& paragraph );
 
-  Size                         mSize;                 ///< Size of the line.
-  float                        mAscender;             ///< Max of all ascenders of all groups of words.
-  float                        mLineHeightOffset;     ///< Line height offset.
-  WordGroupLayoutInfoContainer mWordGroupsLayoutInfo; ///< Layout info for all groups of words.
-  std::size_t                  mNumberOfCharacters;   ///< Stores the number of characters.
+  Size                                          mSize;                       ///< Size of the paragraph.
+  float                                         mAscender;                   ///< Max of all ascenders of all words.
+  float                                         mLineHeightOffset;           ///< Line height offset.
+  std::size_t                                   mNumberOfCharacters;         ///< Stores the number of characters.
+  WordLayoutInfoContainer                       mWordsLayoutInfo;            ///< Layout info for all words.
 };
-typedef std::vector<LineLayoutInfo> LineLayoutInfoContainer;
+typedef std::vector<ParagraphLayoutInfo> ParagraphLayoutInfoContainer;
 
 /**
  * Layout information for the whole text.
@@ -256,12 +268,12 @@ struct TextLayoutInfo
    */
   TextLayoutInfo& operator=( const TextLayoutInfo& text );
 
-  Size                    mWholeTextSize;                 ///< width and height of the whole text.
-  float                   mMaxWordWidth;                  ///< maximum width between all words.
-  LineLayoutInfoContainer mLinesLayoutInfo;               ///< Layout information for all lines.
-  std::size_t             mNumberOfCharacters;            ///< Stores the number of characters.
-  float                   mMaxItalicsOffset;              ///< When rendering text-view in offscreen an extra width offset is needed to prevent italic characters to be cut if they are in the right edge.
-  WordLayoutInfo          mEllipsizeLayoutInfo;           ///< Layout information for the ellipsize text.
+  Size                         mWholeTextSize;        ///< width and height of the whole text.
+  float                        mMaxWordWidth;         ///< maximum width between all words.
+  float                        mMaxItalicsOffset;     ///< When rendering text-view in offscreen an extra width offset is needed to prevent italic characters to be cut if they are in the right edge.
+  std::size_t                  mNumberOfCharacters;   ///< Stores the number of characters.
+  ParagraphLayoutInfoContainer mParagraphsLayoutInfo; ///< Layout information for all paragraphs.
+  WordLayoutInfo               mEllipsizeLayoutInfo;  ///< Layout information for the ellipsize text.
 };
 
 } // namespace TextViewProcessor
index 0c3f074..a485a6e 100644 (file)
@@ -20,8 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/text-view/text-view-word-processor.h>
-#include <dali-toolkit/internal/controls/text-view/text-view-word-group-processor.h>
-#include <dali-toolkit/internal/controls/text-view/text-view-line-processor.h>
+#include <dali-toolkit/internal/controls/text-view/text-view-paragraph-processor.h>
 #include <dali-toolkit/internal/controls/text-view/text-view-processor-helper-functions.h>
 #include <dali-toolkit/internal/controls/text-view/text-processor.h>
 
@@ -46,40 +45,34 @@ namespace
  *
  * @param[in,out] textLayoutInfo
  */
-void UpdateTextLayoutInfo( TextLayoutInfo& textLayoutInfo )
+void UpdateLayoutInfo( TextLayoutInfo& textLayoutInfo )
 {
   // Initialize members to be updated.
-  textLayoutInfo.mWholeTextSize = Size();
+  textLayoutInfo.mWholeTextSize = Size::ZERO;
   textLayoutInfo.mMaxWordWidth = 0.f;
-  textLayoutInfo.mNumberOfCharacters = 0;
+  textLayoutInfo.mNumberOfCharacters = 0u;
 
   // Traverse all text updating values.
-  for( LineLayoutInfoContainer::const_iterator lineIt = textLayoutInfo.mLinesLayoutInfo.begin(), lineEndIt = textLayoutInfo.mLinesLayoutInfo.end();
-       lineIt != lineEndIt;
-       ++lineIt )
+  for( ParagraphLayoutInfoContainer::const_iterator paragraphIt = textLayoutInfo.mParagraphsLayoutInfo.begin(), paragraphEndIt = textLayoutInfo.mParagraphsLayoutInfo.end();
+       paragraphIt != paragraphEndIt;
+       ++paragraphIt )
   {
-    const LineLayoutInfo& line( *lineIt );
+    const ParagraphLayoutInfo& paragraph( *paragraphIt );
 
-    // Updates text size with the size of all lines.
-    UpdateSize( textLayoutInfo.mWholeTextSize, line.mSize, GrowHeight );
+    // Updates text size with the size of all paragraphs.
+    UpdateSize( textLayoutInfo.mWholeTextSize, paragraph.mSize, GrowHeight );
 
     // Updates number of characters.
-    textLayoutInfo.mNumberOfCharacters += line.mNumberOfCharacters;
+    textLayoutInfo.mNumberOfCharacters += paragraph.mNumberOfCharacters;
 
     // Updates the max word's width.
-    for( WordGroupLayoutInfoContainer::const_iterator groupIt = line.mWordGroupsLayoutInfo.begin(), groupEndIt = line.mWordGroupsLayoutInfo.end();
-         groupIt != groupEndIt;
-         ++groupIt )
+    for( WordLayoutInfoContainer::const_iterator wordIt = paragraph.mWordsLayoutInfo.begin(), wordEndIt = paragraph.mWordsLayoutInfo.end();
+         wordIt != wordEndIt;
+         ++wordIt )
     {
-      const WordGroupLayoutInfo& group( *groupIt );
-      for( WordLayoutInfoContainer::const_iterator wordIt = group.mWordsLayoutInfo.begin(), wordEndIt = group.mWordsLayoutInfo.end();
-           wordIt != wordEndIt;
-           ++wordIt )
-      {
-        const WordLayoutInfo& word( *wordIt );
+      const WordLayoutInfo& word( *wordIt );
 
-        textLayoutInfo.mMaxWordWidth = std::max( textLayoutInfo.mMaxWordWidth, word.mSize.width );
-      }
+      textLayoutInfo.mMaxWordWidth = std::max( textLayoutInfo.mMaxWordWidth, word.mSize.width );
     }
   }
 }
@@ -89,19 +82,16 @@ void UpdateTextLayoutInfo( TextLayoutInfo& textLayoutInfo )
 // Constructors and assignment operators
 
 TextInfoIndices::TextInfoIndices()
-: mLineIndex( 0 ),
-  mGroupIndex( 0 ),
-  mWordIndex( 0 ),
-  mCharacterIndex( 0 )
+: mParagraphIndex( 0u ),
+  mWordIndex( 0u ),
+  mCharacterIndex( 0u )
 {
 }
 
-TextInfoIndices::TextInfoIndices( const std::size_t lineIndex,
-                                  const std::size_t groupIndex,
+TextInfoIndices::TextInfoIndices( const std::size_t paragraphIndex,
                                   const std::size_t wordIndex,
                                   const std::size_t characterIndex )
-: mLineIndex( lineIndex ),
-  mGroupIndex( groupIndex ),
+: mParagraphIndex( paragraphIndex ),
   mWordIndex( wordIndex ),
   mCharacterIndex( characterIndex )
 {
@@ -109,8 +99,7 @@ TextInfoIndices::TextInfoIndices( const std::size_t lineIndex,
 
 bool TextInfoIndices::operator==( const TextInfoIndices& indices ) const
 {
-  return ( ( mLineIndex == indices.mLineIndex ) &&
-           ( mGroupIndex == indices.mGroupIndex ) &&
+  return ( ( mParagraphIndex == indices.mParagraphIndex ) &&
            ( mWordIndex == indices.mWordIndex ) &&
            ( mCharacterIndex == indices.mCharacterIndex ) );
 }
@@ -122,9 +111,9 @@ bool TextInfoIndices::operator==( const TextInfoIndices& indices ) const
 TextLayoutInfo::TextLayoutInfo()
 : mWholeTextSize(),
   mMaxWordWidth( 0.f ),
-  mLinesLayoutInfo(),
-  mNumberOfCharacters( 0 ),
   mMaxItalicsOffset( 0.f ),
+  mNumberOfCharacters( 0u ),
+  mParagraphsLayoutInfo(),
   mEllipsizeLayoutInfo()
 {
 }
@@ -132,21 +121,24 @@ TextLayoutInfo::TextLayoutInfo()
 TextLayoutInfo::TextLayoutInfo( const TextLayoutInfo& text )
 : mWholeTextSize( text.mWholeTextSize ),
   mMaxWordWidth( text.mMaxWordWidth ),
-  mLinesLayoutInfo( text.mLinesLayoutInfo ),
-  mNumberOfCharacters( text.mNumberOfCharacters ),
   mMaxItalicsOffset( text.mMaxItalicsOffset ),
+  mNumberOfCharacters( text.mNumberOfCharacters ),
+  mParagraphsLayoutInfo( text.mParagraphsLayoutInfo ),
   mEllipsizeLayoutInfo( text.mEllipsizeLayoutInfo )
 {
 }
 
 TextLayoutInfo& TextLayoutInfo::operator=( const TextLayoutInfo& text )
 {
-  mWholeTextSize = text.mWholeTextSize;
-  mMaxWordWidth = text.mMaxWordWidth;
-  mLinesLayoutInfo = text.mLinesLayoutInfo;
-  mNumberOfCharacters = text.mNumberOfCharacters;
-  mMaxItalicsOffset = text.mMaxItalicsOffset;
-  mEllipsizeLayoutInfo = text.mEllipsizeLayoutInfo;
+  if( this != &text )
+  {
+    mWholeTextSize = text.mWholeTextSize;
+    mMaxWordWidth = text.mMaxWordWidth;
+    mMaxItalicsOffset = text.mMaxItalicsOffset;
+    mNumberOfCharacters = text.mNumberOfCharacters;
+    mParagraphsLayoutInfo = text.mParagraphsLayoutInfo;
+    mEllipsizeLayoutInfo = text.mEllipsizeLayoutInfo;
+  }
 
   return *this;
 }
@@ -157,18 +149,16 @@ void CreateTextInfo( const MarkupProcessor::StyledTextArray& text,
                      const TextView::LayoutParameters& layoutParameters,
                      TextView::RelayoutData& relayoutData )
 {
-  // * Traverse the given text spliting it in lines, each line in groups of words and each group of words in words.
-  // * If possible, it joins characters with same style in one text-actor.
-  // * White spaces and new line characters are alone in one word.
-  // * Bidirectional text is processed in each line.
-  // * A group of words contains text in only one direction (Left to Right or Right to Left but not a mix of both).
+  // * Traverse the given text spliting it in paragraphs and each paragraph in words.
+  // * White spaces and new paragraph characters are alone in one word.
+  // * Bidirectional text is processed in each paragraph.
   // * Generates a layout data structure to store layout information (size, position, ascender, text direction, etc) and metrics of all characters.
   // * Generates a text-actor data structure to store text, style and text-actors.
   // TODO: finish and test the bidirectional implementation.
 
   // Collect previously created text-actors.
   std::vector<TextActor> textActors;
-  CollectTextActorsFromLines( textActors, relayoutData.mTextLayoutInfo, 0, relayoutData.mTextLayoutInfo.mLinesLayoutInfo.size() );
+  CollectTextActorsFromParagraphs( textActors, relayoutData.mTextLayoutInfo, 0u, relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.size() );
 
   if( !textActors.empty() )
   {
@@ -188,55 +178,55 @@ void CreateTextInfo( const MarkupProcessor::StyledTextArray& text,
   // Sets the ellipsize layout info.
   relayoutData.mTextLayoutInfo.mEllipsizeLayoutInfo = ellipsizeInfo;
 
-  // Split the whole text in lines.
-  std::vector<MarkupProcessor::StyledTextArray> lines;
-  TextProcessor::SplitInLines( text,
-                               lines );
+  // Split the whole text in paragraphs.
+  std::vector<MarkupProcessor::StyledTextArray> paragraphs;
+  TextProcessor::SplitInParagraphs( text,
+                                    paragraphs );
 
-  // Traverse all lines
-  for( std::vector<MarkupProcessor::StyledTextArray>::const_iterator lineIt = lines.begin(), lineEndIt = lines.end(); lineIt != lineEndIt; ++lineIt )
+  // Traverse all paragraphs
+  for( std::vector<MarkupProcessor::StyledTextArray>::const_iterator paragraphIt = paragraphs.begin(), paragraphEndIt = paragraphs.end(); paragraphIt != paragraphEndIt; ++paragraphIt )
   {
-    const MarkupProcessor::StyledTextArray& line( *lineIt );
+    const MarkupProcessor::StyledTextArray& paragraph( *paragraphIt );
 
-    // Data structures for the new line
-    LineLayoutInfo lineLayoutInfo;
+    // Data structures for the new paragraph
+    ParagraphLayoutInfo paragraphLayoutInfo;
 
-    // Fills the line data structures with the layout info.
-    CreateLineInfo( line,
-                    relayoutData,
-                    lineLayoutInfo );
+    // Fills the paragraph data structures with the layout info.
+    CreateParagraphInfo( paragraph,
+                         relayoutData,
+                         paragraphLayoutInfo );
 
-    if( 0 < lineLayoutInfo.mNumberOfCharacters )
+    if( 0u < paragraphLayoutInfo.mNumberOfCharacters )
     {
-      // do not add the line offset if the line has no characters.
-      lineLayoutInfo.mSize.height += layoutParameters.mLineHeightOffset;
-      lineLayoutInfo.mLineHeightOffset = layoutParameters.mLineHeightOffset;
+      // do not add the line offset if the paragraph has no characters.
+      paragraphLayoutInfo.mSize.height += layoutParameters.mLineHeightOffset;
+      paragraphLayoutInfo.mLineHeightOffset = layoutParameters.mLineHeightOffset;
     }
     else
     {
-      // line height needs to be added for the last line.
+      // line height needs to be added for the last paragraph.
 
       float lineHeight = 0.f;
-      // Get the last character of the last line.
-      if( !relayoutData.mTextLayoutInfo.mLinesLayoutInfo.empty() )
+      // Get the last character of the last paragraph.
+      if( !relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.empty() )
       {
-        const LineLayoutInfo& lineInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end() - 1 ) );
+        const ParagraphLayoutInfo& paragraphInfo( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end() - 1u ) );
 
-        const CharacterLayoutInfo characterInfo = GetLastCharacterLayoutInfo( lineInfo );
+        const CharacterLayoutInfo characterInfo = GetLastCharacterLayoutInfo( paragraphInfo );
 
         lineHeight = characterInfo.mSize.height;
       }
 
-      lineLayoutInfo.mSize.height = lineHeight;
+      paragraphLayoutInfo.mSize.height = lineHeight;
     }
 
     // Update layout info for the whole text.
-    UpdateSize( relayoutData.mTextLayoutInfo.mWholeTextSize, lineLayoutInfo.mSize, GrowHeight );
-    relayoutData.mTextLayoutInfo.mNumberOfCharacters += lineLayoutInfo.mNumberOfCharacters;
+    UpdateSize( relayoutData.mTextLayoutInfo.mWholeTextSize, paragraphLayoutInfo.mSize, GrowHeight );
+    relayoutData.mTextLayoutInfo.mNumberOfCharacters += paragraphLayoutInfo.mNumberOfCharacters;
 
-    // Add the line to the current text.
-    relayoutData.mTextLayoutInfo.mLinesLayoutInfo.push_back( lineLayoutInfo );
-  } // end of lines
+    // Add the paragraph to the current text.
+    relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.push_back( paragraphLayoutInfo );
+  } // end of paragraphs
 }
 
 void UpdateTextInfo( const std::size_t position,
@@ -248,10 +238,10 @@ void UpdateTextInfo( const std::size_t position,
 
   // * Creates layout info for the given text.
   // * With the given position, find where to add the text.
-  // * If the new text is not added at the end of current text, a line need to be split.
-  // * Merge the last line of the new text to the last part or the split line.
-  // * Add lines between first and last of the new text.
-  // * Merge the first part of the split line with the first line of the new text.
+  // * If the new text is not added at the end of current text, a paragraph need to be split.
+  // * Merge the last paragraph of the new text to the last part or the split paragraph.
+  // * Add paragraphs between first and last of the new text.
+  // * Merge the first part of the split paragraph with the first paragraph of the new text.
   // * Update layout info and create new text actors if needed.
 
   // Early returns:
@@ -262,7 +252,7 @@ void UpdateTextInfo( const std::size_t position,
     return;
   }
 
-  if( 0 == relayoutData.mTextLayoutInfo.mNumberOfCharacters )
+  if( 0u == relayoutData.mTextLayoutInfo.mNumberOfCharacters )
   {
     // Current text is empty. There is no need to update current data structure,
     // just create a new one with the new input text.
@@ -289,113 +279,107 @@ void UpdateTextInfo( const std::size_t position,
 
   // Update logical-to-visual and visual-to-logical tables.
   // TODO: check that for mixed RTL/LTR text.
-  std::size_t index = 0;
-  for( std::size_t i = 0; i < relayoutDataForNewText.mTextLayoutInfo.mNumberOfCharacters; ++i )
+  std::size_t index = 0u;
+  for( std::size_t i = 0u; i < relayoutDataForNewText.mTextLayoutInfo.mNumberOfCharacters; ++i )
   {
     relayoutData.mCharacterLogicalToVisualMap.push_back( relayoutData.mTextLayoutInfo.mNumberOfCharacters + index );
     relayoutData.mCharacterVisualToLogicalMap.push_back( relayoutData.mTextLayoutInfo.mNumberOfCharacters + index );
     ++index;
   }
 
-  // If a line is split, it stores the last part of the line.
-  LineLayoutInfo lastLineLayoutInfo;
+  // If a paragraph is split, it stores the last part of the paragraph.
+  ParagraphLayoutInfo lastParagraphLayoutInfo;
 
-  // Stores indices to the line, group of words, word and character of the given position.
+  // Stores indices to the paragraph, word and character of the given position.
   TextInfoIndices textInfoIndices;
 
   if( position < relayoutData.mTextLayoutInfo.mNumberOfCharacters )
   {
-    // Get line, group, word and character indices for given position.
+    // Get paragraph, word and character indices for given position.
     GetIndicesFromGlobalCharacterIndex( position,
                                         relayoutData.mTextLayoutInfo,
                                         textInfoIndices );
 
-    // 1) Split the line
+    // 1) Split the paragraph
 
-    // Split a line in two is needed, then merge the first part of the split line
-    // with the first line of the new text, add subsequent lines and merge the last line
-    // of the new text with the last part of the split line.
+    // Split a paragraph in two is needed, then merge the first part of the split paragraph
+    // with the first paragraph of the new text, add subsequent paragraphs and merge the last paragraph
+    // of the new text with the last part of the split paragraph.
 
     // Implementation notes!
     //
-    // These references to the first line are declared in this scope because if new lines are inserted in step 2,
+    // These references to the first paragraph are declared in this scope because if new paragraphs are inserted in step 2,
     // they become invalid, making the algorithm to crash if used again.
-    // In the step 3, references to the first line are needed and declared again.
+    // In the step 3, references to the first paragraph are needed and declared again.
 
-    // Stores the first part of the split line.
-    LineLayoutInfo& firstLineLayoutInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + textInfoIndices.mLineIndex ) );
+    // Stores the first part of the split paragraph.
+    ParagraphLayoutInfo& firstParagraphLayoutInfo( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + textInfoIndices.mParagraphIndex ) );
 
-    SplitLine( textInfoIndices,
-               PointSize( layoutParameters.mLineHeightOffset ),
-               firstLineLayoutInfo,
-               lastLineLayoutInfo );
+    SplitParagraph( textInfoIndices,
+                    PointSize( layoutParameters.mLineHeightOffset ),
+                    firstParagraphLayoutInfo,
+                    lastParagraphLayoutInfo );
   }
   else
   {
     // Position is just after the last character.
     // Calculates indices for that position.
-    if( !relayoutData.mTextLayoutInfo.mLinesLayoutInfo.empty() )
+    if( !relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.empty() )
     {
-      textInfoIndices.mLineIndex = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.size() - 1;
-      const LineLayoutInfo& lineLayoutInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end() - 1 ) );
+      textInfoIndices.mParagraphIndex = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.size() - 1u;
+      const ParagraphLayoutInfo& paragraphLayoutInfo( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end() - 1u ) );
 
-      if( !lineLayoutInfo.mWordGroupsLayoutInfo.empty() )
+      if( !paragraphLayoutInfo.mWordsLayoutInfo.empty() )
       {
-        textInfoIndices.mGroupIndex = lineLayoutInfo.mWordGroupsLayoutInfo.size() - 1;
-        const WordGroupLayoutInfo& groupLayoutInfo( *( lineLayoutInfo.mWordGroupsLayoutInfo.end() - 1 ) );
+        textInfoIndices.mWordIndex = paragraphLayoutInfo.mWordsLayoutInfo.size() - 1u;
 
-        if( !groupLayoutInfo.mWordsLayoutInfo.empty() )
-        {
-          textInfoIndices.mWordIndex = groupLayoutInfo.mWordsLayoutInfo.size() - 1;
-
-          const WordLayoutInfo& wordLayoutInfo( *( groupLayoutInfo.mWordsLayoutInfo.end() - 1 ) );
-          textInfoIndices.mCharacterIndex = wordLayoutInfo.mCharactersLayoutInfo.size();
-        }
+        const WordLayoutInfo& wordLayoutInfo( *( paragraphLayoutInfo.mWordsLayoutInfo.end() - 1u ) );
+        textInfoIndices.mCharacterIndex = wordLayoutInfo.mCharactersLayoutInfo.size();
       }
     }
   }
 
-  // 2) If the new text has more than 1 line, merge the last line of the input text with the last part of the split line.
-  //TODO check this cases ( num lines ==1, >1, >2 ) if it could be simplified.
-  if( relayoutDataForNewText.mTextLayoutInfo.mLinesLayoutInfo.size() > 1 )
+  // 2) If the new text has more than 1 paragraph, merge the last paragraph of the input text with the last part of the split paragraph.
+  //TODO check this cases ( num paragraphs ==1, >1, >2 ) if it could be simplified.
+  if( relayoutDataForNewText.mTextLayoutInfo.mParagraphsLayoutInfo.size() > 1u )
   {
-    LineLayoutInfo& lastInputLineLayoutInfo( *( relayoutDataForNewText.mTextLayoutInfo.mLinesLayoutInfo.end() - 1 ) );
+    ParagraphLayoutInfo& lastInputParagraphLayoutInfo( *( relayoutDataForNewText.mTextLayoutInfo.mParagraphsLayoutInfo.end() - 1u ) );
 
-    MergeLine( lastInputLineLayoutInfo,
-               lastLineLayoutInfo );
+    MergeParagraph( lastInputParagraphLayoutInfo,
+                    lastParagraphLayoutInfo );
 
-    if( relayoutDataForNewText.mTextLayoutInfo.mLinesLayoutInfo.size() > 2 )
+    if( relayoutDataForNewText.mTextLayoutInfo.mParagraphsLayoutInfo.size() > 2u )
     {
-      // Insert all lines except first and last in the text.
-      relayoutData.mTextLayoutInfo.mLinesLayoutInfo.insert( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + textInfoIndices.mLineIndex + 1,
-                                                            relayoutDataForNewText.mTextLayoutInfo.mLinesLayoutInfo.begin() + 1,
-                                                            relayoutDataForNewText.mTextLayoutInfo.mLinesLayoutInfo.end() - 1 );
+      // Insert all paragraphs except first and last in the text.
+      relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.insert( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + textInfoIndices.mParagraphIndex + 1u,
+                                                            relayoutDataForNewText.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + 1u,
+                                                            relayoutDataForNewText.mTextLayoutInfo.mParagraphsLayoutInfo.end() - 1u );
     }
 
-    // Insert the last line to the text
-    relayoutData.mTextLayoutInfo.mLinesLayoutInfo.insert( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + textInfoIndices.mLineIndex + relayoutDataForNewText.mTextLayoutInfo.mLinesLayoutInfo.size() - 1,
-                                                          lastInputLineLayoutInfo );
+    // Insert the last paragraph to the text
+    relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.insert( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + textInfoIndices.mParagraphIndex + relayoutDataForNewText.mTextLayoutInfo.mParagraphsLayoutInfo.size() - 1u,
+                                                          lastInputParagraphLayoutInfo );
   }
   else
   {
-    // Merge the new line to the last part of the split line.
-    LineLayoutInfo& inputLineLayoutInfo( *relayoutDataForNewText.mTextLayoutInfo.mLinesLayoutInfo.begin() );
+    // Merge the new paragraph to the last part of the split paragraph.
+    ParagraphLayoutInfo& inputParagraphLayoutInfo( *relayoutDataForNewText.mTextLayoutInfo.mParagraphsLayoutInfo.begin() );
 
-    MergeLine( inputLineLayoutInfo,
-               lastLineLayoutInfo );
+    MergeParagraph( inputParagraphLayoutInfo,
+                    lastParagraphLayoutInfo );
   }
 
-  // 3) Merge the first line of the split text with the first line of the input text.
-  LineLayoutInfo& firstLineLayoutInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + textInfoIndices.mLineIndex ) );
-  LineLayoutInfo& firstInputLineLayoutInfo( *relayoutDataForNewText.mTextLayoutInfo.mLinesLayoutInfo.begin() );
+  // 3) Merge the first paragraph of the split text with the first paragraph of the input text.
+  ParagraphLayoutInfo& firstParagraphLayoutInfo( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + textInfoIndices.mParagraphIndex ) );
+  ParagraphLayoutInfo& firstInputParagraphLayoutInfo( *relayoutDataForNewText.mTextLayoutInfo.mParagraphsLayoutInfo.begin() );
 
-  MergeLine( firstLineLayoutInfo,
-             firstInputLineLayoutInfo );
+  MergeParagraph( firstParagraphLayoutInfo,
+                  firstInputParagraphLayoutInfo );
 
   // 4) Update text info.
 
   // Updates the whole text size, maximum word size, etc.
-  UpdateTextLayoutInfo( relayoutData.mTextLayoutInfo );
+  UpdateLayoutInfo( relayoutData.mTextLayoutInfo );
 }
 
 void UpdateTextInfo( const std::size_t position,
@@ -406,25 +390,22 @@ void UpdateTextInfo( const std::size_t position,
 {
   // Removes 'numberOfCharacters' starting from 'position'.
 
-  // * It checks if text to be deleted is in the same line or not:
-  // *   If it is not, check which lines need to be split/merged or deleted.
-  // *   If it is but all characters of the line are going to be deleted, just delete the line (nothing needs to be split/merged)
-  // *   If only some characters of the same line are going to be deleted, proceed similarly: check if text to be deleted is in the same group of words.
-  // *     If it is not, check which groups of words need to be split/merged or deleted. Two groups of words can't be merged if they contain text with different direction (Left to Right / Right to Left)
-  // *     If it is but all characters of the group are going to be deleted, delete the group. TODO: Check if previous and following group need to be merged.
-  // *     If only some characters of the same group of words need to be deleted, proceed similarly: check if text to be deleted is in the same word.
-  // *       If it is not, split/merge words.
-  // *       Check if the whole word needs to be deleted.
-  // *       Check if only some characters of the word need to be deleted.
+  // * It checks if text to be deleted is in the same paragraph or not:
+  // *   If it is not, check which paragraphs need to be split/merged or deleted.
+  // *   If it is but all characters of the paragraph are going to be deleted, just delete the paragraph (nothing needs to be split/merged)
+  // *   If only some characters of the same paragraph are going to be deleted, proceed similarly: check if text to be deleted is in the same word.
+  // *     If it is not, split/merge words.
+  // *     Check if the whole word needs to be deleted.
+  // *     Check if only some characters of the word need to be deleted.
   // * Updates layout info.
 
-  // * The algorithm checks if a word separator is deleted (in that case, different words need to be merged) and if a new line separator is deleted (two lines need to be merged).
+  // * The algorithm checks if a word separator is deleted (in that case, different words need to be merged) and if a new paragraph separator is deleted (two paragraphs need to be merged).
 
   // Early return
 
-  if( 0 == numberOfCharacters )
+  if( 0u == numberOfCharacters )
   {
-    DALI_ASSERT_DEBUG( !"TextViewProcessor::UpdateTextInfo. WARNING: trying to delete 0 characters!" )
+    DALI_ASSERT_DEBUG( !"TextViewProcessor::UpdateTextInfo. WARNING: trying to delete 0 characters!" );
 
     // nothing to do if no characters are deleted.
     return;
@@ -437,15 +418,15 @@ void UpdateTextInfo( const std::size_t position,
   relayoutData.mCharacterLogicalToVisualMap.erase( relayoutData.mCharacterLogicalToVisualMap.end() - numberOfCharacters, relayoutData.mCharacterLogicalToVisualMap.end() );
   relayoutData.mCharacterVisualToLogicalMap.erase( relayoutData.mCharacterVisualToLogicalMap.end() - numberOfCharacters, relayoutData.mCharacterVisualToLogicalMap.end() );
 
-  // Get line, group of words, word and character indices for the given start position.
+  // Get paragraph, word and character indices for the given start position.
   TextInfoIndices textInfoIndicesBegin;
   GetIndicesFromGlobalCharacterIndex( position,
                                       relayoutData.mTextLayoutInfo,
                                       textInfoIndicesBegin );
 
-  // Get line, group of words, word and character indices for the given end position (start position + number of characters to be deleted).
+  // Get paragraph, word and character indices for the given end position (start position + number of characters to be deleted).
   TextInfoIndices textInfoIndicesEnd;
-  GetIndicesFromGlobalCharacterIndex( position + numberOfCharacters - 1,
+  GetIndicesFromGlobalCharacterIndex( position + numberOfCharacters - 1u,
                                       relayoutData.mTextLayoutInfo,
                                       textInfoIndicesEnd );
 
@@ -456,133 +437,109 @@ void UpdateTextInfo( const std::size_t position,
   std::vector<TextActor> removedTextActorsFromMid;
   std::vector<TextActor> removedTextActorsFromEnd;
 
-  // Whether lines, group of words and words need to be merged.
-  bool mergeLines = false;
-  bool mergeGroups = false;
+  // Whether paragraphs and words need to be merged.
+  bool mergeParagraphs = false;
   bool mergeWords = false;
 
-  // Indices of the lines, group of words and words to be merged.
+  // Indices of the paragraphs and words to be merged.
   TextInfoIndices textInfoMergeIndicesBegin;
   TextInfoIndices textInfoMergeIndicesEnd;
 
-  const LineLayoutInfo& lineLayout( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + textInfoIndicesBegin.mLineIndex ) ); // used to check the number of characters of the line
-                                                                                                                                    // if all characters to be deleted are in the same line.
-  if( textInfoIndicesBegin.mLineIndex < textInfoIndicesEnd.mLineIndex )
+  const ParagraphLayoutInfo& paragraphLayout( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + textInfoIndicesBegin.mParagraphIndex ) ); // used to check the number of characters of the paragraph
+                                                                                                                                    // if all characters to be deleted are in the same paragraph.
+  if( textInfoIndicesBegin.mParagraphIndex < textInfoIndicesEnd.mParagraphIndex )
   {
-    // Deleted text is from different lines. It may need to split two lines, and merge first part of the first one with last part of the last one.
+    // Deleted text is from different paragraphs. It may need to split two paragraphs, and merge first part of the first one with last part of the last one.
 
-    // whether first or last line need to be split and merged with the last part.
-    bool mergeFirstLine = false;
-    bool mergeLastLine = true;
+    // whether first or last paragraph need to be split and merged with the last part.
+    bool mergeFirstParagraph = false;
+    bool mergeLastParagraph = true;
 
-    textInfoMergeIndicesBegin.mLineIndex = textInfoIndicesBegin.mLineIndex;
-    textInfoMergeIndicesEnd.mLineIndex = textInfoIndicesEnd.mLineIndex;
+    textInfoMergeIndicesBegin.mParagraphIndex = textInfoIndicesBegin.mParagraphIndex;
+    textInfoMergeIndicesEnd.mParagraphIndex = textInfoIndicesEnd.mParagraphIndex;
 
-    if( ( textInfoIndicesBegin.mGroupIndex > 0 ) || ( textInfoIndicesBegin.mWordIndex > 0 ) || ( textInfoIndicesBegin.mCharacterIndex > 0 ) )
+    if( ( textInfoIndicesBegin.mWordIndex > 0u ) || ( textInfoIndicesBegin.mCharacterIndex > 0u ) )
     {
-      // first character to be deleted is not the first one of the current line.
-      ++textInfoIndicesBegin.mLineIndex; // won't delete current line
+      // first character to be deleted is not the first one of the current paragraph.
+      ++textInfoIndicesBegin.mParagraphIndex; // won't delete current paragraph
 
-      // As some characters remain, this line could be merged with the last one.
-      mergeFirstLine = true;
+      // As some characters remain, this paragraph could be merged with the last one.
+      mergeFirstParagraph = true;
     }
 
-    // Check if all characters of the last line are going to be deleted.
-    bool wholeLinedeleted = false;
-    const LineLayoutInfo& lastLineLayout( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + textInfoIndicesEnd.mLineIndex ) );
-    if( textInfoIndicesEnd.mGroupIndex + 1 == lastLineLayout.mWordGroupsLayoutInfo.size() )
+    // Check if all characters of the last paragraph are going to be deleted.
+    bool wholeParagraphDeleted = false;
+    const ParagraphLayoutInfo& lastParagraphLayout( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + textInfoIndicesEnd.mParagraphIndex ) );
+    if( textInfoIndicesEnd.mWordIndex + 1u == lastParagraphLayout.mWordsLayoutInfo.size() )
     {
-      const WordGroupLayoutInfo& lastGroupLayout( *( lastLineLayout.mWordGroupsLayoutInfo.begin() + textInfoIndicesEnd.mGroupIndex ) );
-      if( textInfoIndicesEnd.mWordIndex + 1 == lastGroupLayout.mWordsLayoutInfo.size() )
+      const WordLayoutInfo& lastWordLayout( *( lastParagraphLayout.mWordsLayoutInfo.begin() + textInfoIndicesEnd.mWordIndex ) );
+      if( textInfoIndicesEnd.mCharacterIndex + 1u == lastWordLayout.mCharactersLayoutInfo.size() )
       {
-        const WordLayoutInfo& lastWordLayout( *( lastGroupLayout.mWordsLayoutInfo.begin() + textInfoIndicesEnd.mWordIndex ) );
-        if( textInfoIndicesEnd.mCharacterIndex + 1 == lastWordLayout.mCharactersLayoutInfo.size() )
-        {
-          // All characters of the last line are going to be deleted.
-          ++textInfoIndicesEnd.mLineIndex; // will delete the last line.
-
-          // the whole last line is deleted. Need to check if the next line could be merged.
-          mergeLastLine = false;
-          wholeLinedeleted = true;
-        }
+        // All characters of the last paragraph are going to be deleted.
+        ++textInfoIndicesEnd.mParagraphIndex; // will delete the last paragraph.
+
+        // the whole last paragraph is deleted. Need to check if the next paragraph could be merged.
+        mergeLastParagraph = false;
+        wholeParagraphDeleted = true;
       }
     }
 
-    if( wholeLinedeleted )
+    if( wholeParagraphDeleted )
     {
-      // It means the whole last line is deleted completely.
-      // It's needed to check if there is another line after that could be merged.
-      if( textInfoIndicesEnd.mLineIndex < relayoutData.mTextLayoutInfo.mLinesLayoutInfo.size() )
+      // It means the whole last paragraph is deleted completely.
+      // It's needed to check if there is another paragraph after that could be merged.
+      if( textInfoIndicesEnd.mParagraphIndex < relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.size() )
       {
-          mergeLastLine = true;
+        mergeLastParagraph = true;
 
-          // Point the first characters of the next line.
-          textInfoIndicesEnd.mGroupIndex = 0;
-          textInfoIndicesEnd.mWordIndex = 0;
-          textInfoIndicesEnd.mCharacterIndex = 0;
-          textInfoMergeIndicesEnd.mLineIndex = textInfoIndicesEnd.mLineIndex;
+        // Point the first characters of the next paragraph.
+        textInfoIndicesEnd.mWordIndex = 0u;
+        textInfoIndicesEnd.mCharacterIndex = 0u;
+        textInfoMergeIndicesEnd.mParagraphIndex = textInfoIndicesEnd.mParagraphIndex;
       }
     }
 
-    // If some characters remain in the first and last line, they need to be merged.
-    mergeLines = mergeFirstLine && mergeLastLine;
+    // If some characters remain in the first and last paragraph, they need to be merged.
+    mergeParagraphs = mergeFirstParagraph && mergeLastParagraph;
 
-    if( mergeLines )
+    if( mergeParagraphs )
     {
-      // last line is going to be merged with the first one, so is not needed.
-      ++textInfoIndicesEnd.mLineIndex; // will delete the last line.
+      // last paragraph is going to be merged with the first one, so is not needed.
+      ++textInfoIndicesEnd.mParagraphIndex; // will delete the last paragraph.
     }
 
-    if( mergeFirstLine )
+    if( mergeFirstParagraph )
     {
-      // Remove characters from the first line.
+      // Remove characters from the first paragraph.
 
-      // Vectors used to temporary store text-actors removed from the line.
+      // Vectors used to temporary store text-actors removed from the paragraph.
       // Three vectors are needed because text-actors are not removed in order
       // but insert them in order is required to reuse them later.
       std::vector<TextActor> removedTextActorsFromFirstWord;
-      std::vector<TextActor> removedTextActorsFromFirstGroup;
-      std::vector<TextActor> removedTextActorsFromGroups;
-
-      // As lineIndexBegin has been increased just to not to remove the line, decrease now is needed to access it.
-      LineLayoutInfo& lineLayout( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + textInfoIndicesBegin.mLineIndex - 1 ) );
-
-      if( textInfoIndicesBegin.mGroupIndex + 1 < lineLayout.mWordGroupsLayoutInfo.size() )
-      {
-        // Store text-actors before removing them.
-        CollectTextActorsFromGroups( removedTextActorsFromGroups, lineLayout, textInfoIndicesBegin.mGroupIndex + 1, lineLayout.mWordGroupsLayoutInfo.size() );
+      std::vector<TextActor> removedTextActorsFromFirstParagraph;
 
-        // Remove extra groups. If a line has left to right and right to left text, groups after current one could be removed.
-        RemoveWordGroupsFromLine( textInfoIndicesBegin.mGroupIndex + 1,
-                                  lineLayout.mWordGroupsLayoutInfo.size() - ( textInfoIndicesBegin.mGroupIndex + 1 ),
-                                  PointSize( layoutParameters.mLineHeightOffset ),
-                                  lineLayout );
-      }
-
-      WordGroupLayoutInfo& groupLayout( *( lineLayout.mWordGroupsLayoutInfo.begin() + textInfoIndicesBegin.mGroupIndex ) );
+      // As paragraphIndexBegin has been increased just to not to remove the paragraph, decrease now is needed to access it.
+      ParagraphLayoutInfo& paragraphLayout( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + textInfoIndicesBegin.mParagraphIndex - 1u ) );
 
-      if( ( textInfoIndicesBegin.mWordIndex + 1 < groupLayout.mWordsLayoutInfo.size() ) || ( 0 == textInfoIndicesBegin.mCharacterIndex ) )
+      if( ( textInfoIndicesBegin.mWordIndex + 1u < paragraphLayout.mWordsLayoutInfo.size() ) || ( 0u == textInfoIndicesBegin.mCharacterIndex ) )
       {
-        // Remove extra words within current group of words. (and current word if whole characters are removed)
+        // Remove extra words within current paragraph. (and current word if whole characters are removed)
         // 0 == characterIndexBegin means the whole word is deleted.
-        const std::size_t wordIndex = ( ( 0 == textInfoIndicesBegin.mCharacterIndex ) ? textInfoIndicesBegin.mWordIndex : textInfoIndicesBegin.mWordIndex + 1 );
+        const std::size_t wordIndex = ( ( 0u == textInfoIndicesBegin.mCharacterIndex ) ? textInfoIndicesBegin.mWordIndex : textInfoIndicesBegin.mWordIndex + 1u );
 
         // Store text-actors before removing them.
-        CollectTextActorsFromWords( removedTextActorsFromFirstGroup, groupLayout, wordIndex, groupLayout.mWordsLayoutInfo.size() );
-
-        const std::size_t groupNumberCharacters = groupLayout.mNumberOfCharacters;
-        RemoveWordsFromWordGroup( wordIndex,
-                                  groupLayout.mWordsLayoutInfo.size() - wordIndex,
-                                  groupLayout );
+        CollectTextActorsFromWords( removedTextActorsFromFirstParagraph, paragraphLayout, wordIndex, paragraphLayout.mWordsLayoutInfo.size() );
 
-        // discount the removed number of characters.
-        lineLayout.mNumberOfCharacters -= ( groupNumberCharacters - groupLayout.mNumberOfCharacters );
+        RemoveWordsFromParagraph( wordIndex,
+                                  paragraphLayout.mWordsLayoutInfo.size() - wordIndex,
+                                  layoutParameters.mLineHeightOffset,
+                                  paragraphLayout );
       }
 
-      if( ( textInfoIndicesBegin.mWordIndex < groupLayout.mWordsLayoutInfo.size() ) && ( textInfoIndicesBegin.mCharacterIndex > 0 ) )
+      if( ( textInfoIndicesBegin.mWordIndex < paragraphLayout.mWordsLayoutInfo.size() ) && ( textInfoIndicesBegin.mCharacterIndex > 0u ) )
       {
         // Only some characters of the word need to be removed.
-        WordLayoutInfo& wordLayout( *( groupLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex ) );
+        WordLayoutInfo& wordLayout( *( paragraphLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex ) );
 
         // Store text-actors before removing them.
         CollectTextActors( removedTextActorsFromFirstWord, wordLayout, textInfoIndicesBegin.mCharacterIndex, wordLayout.mCharactersLayoutInfo.size() );
@@ -594,67 +551,49 @@ void UpdateTextInfo( const std::size_t position,
 
         // discount the removed number of characters.
         const std::size_t removedNumberOfCharacters = ( wordNumberCharacters - wordLayout.mCharactersLayoutInfo.size() );
-        groupLayout.mNumberOfCharacters -= removedNumberOfCharacters;
-        lineLayout.mNumberOfCharacters -= removedNumberOfCharacters;
+        paragraphLayout.mNumberOfCharacters -= removedNumberOfCharacters;
       }
-      UpdateLineLayoutInfo( lineLayout, layoutParameters.mLineHeightOffset );
+      UpdateLayoutInfo( paragraphLayout, layoutParameters.mLineHeightOffset );
 
       // Insert the text-actors in order.
       removedTextActorsFromBegin.insert( removedTextActorsFromBegin.end(), removedTextActorsFromFirstWord.begin(), removedTextActorsFromFirstWord.end() );
-      removedTextActorsFromBegin.insert( removedTextActorsFromBegin.end(), removedTextActorsFromFirstGroup.begin(), removedTextActorsFromFirstGroup.end() );
-      removedTextActorsFromBegin.insert( removedTextActorsFromBegin.end(), removedTextActorsFromGroups.begin(), removedTextActorsFromGroups.end() );
+      removedTextActorsFromBegin.insert( removedTextActorsFromBegin.end(), removedTextActorsFromFirstParagraph.begin(), removedTextActorsFromFirstParagraph.end() );
     }
 
-    if( mergeLastLine && !wholeLinedeleted )
+    if( mergeLastParagraph && !wholeParagraphDeleted )
     {
-      // Some characters from the last line need to be removed.
+      // Some characters from the last paragraph need to be removed.
 
-      // Vectors used to temporary store text-actors removed from the group.
+      // Vectors used to temporary store text-actors removed from the paragraph.
       // Three vectors are needed because text-actors are not removed in order
       // but insert them in order is required to reuse them later.
       std::vector<TextActor> removedTextActorsFromFirstWord;
-      std::vector<TextActor> removedTextActorsFromFirstGroup;
-      std::vector<TextActor> removedTextActorsFromGroups;
-
-      // lineIndexEnd was increased to delete the last line if lines need to be merged.
-      // To access now the last line we need to decrease the index.
-      const std::size_t lineIndex = ( mergeLines ? textInfoIndicesEnd.mLineIndex - 1 : textInfoIndicesEnd.mLineIndex );
-
-      // Get the last line.
-      LineLayoutInfo& lineLayout( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + lineIndex ) );
+      std::vector<TextActor> removedTextActorsFromFirstParagraph;
 
-      if( textInfoIndicesEnd.mGroupIndex > 0 )
-      {
-        // Store text-actors before removing them.
-        CollectTextActorsFromGroups( removedTextActorsFromGroups, lineLayout, 0, textInfoIndicesEnd.mGroupIndex );
-
-        // Remove extra groups from the beginning of the line to the current group of words.
-        RemoveWordGroupsFromLine( 0,
-                                  textInfoIndicesEnd.mGroupIndex,
-                                  PointSize( layoutParameters.mLineHeightOffset ),
-                                  lineLayout );
-      }
+      // paragraphIndexEnd was increased to delete the last paragraph if paragraphs need to be merged.
+      // To access now the last paragraph we need to decrease the index.
+      const std::size_t paragraphIndex = ( mergeParagraphs ? textInfoIndicesEnd.mParagraphIndex - 1u : textInfoIndicesEnd.mParagraphIndex );
 
-      // The group of characters which contains the characters to be removed is now the first one.
-      WordGroupLayoutInfo& groupLayout( *lineLayout.mWordGroupsLayoutInfo.begin() );
+      // Get the last paragraph.
+      ParagraphLayoutInfo& paragraphLayout( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + paragraphIndex ) );
 
       // Check if is needed remove the whole word. (If the character index is pointing just after the end of the word)
-      const WordLayoutInfo& wordLayout( *( groupLayout.mWordsLayoutInfo.begin() + textInfoIndicesEnd.mWordIndex ) );
-      bool removeWholeWord = wordLayout.mCharactersLayoutInfo.size() == textInfoIndicesEnd.mCharacterIndex + 1;
+      const WordLayoutInfo& wordLayout( *( paragraphLayout.mWordsLayoutInfo.begin() + textInfoIndicesEnd.mWordIndex ) );
+      bool removeWholeWord = wordLayout.mCharactersLayoutInfo.size() == textInfoIndicesEnd.mCharacterIndex + 1u;
 
-      if( ( textInfoIndicesEnd.mWordIndex > 0 ) || ( removeWholeWord ) )
+      if( ( textInfoIndicesEnd.mWordIndex > 0u ) || ( removeWholeWord ) )
       {
         // Store text-actors before removing them.
-        CollectTextActorsFromWords( removedTextActorsFromFirstGroup, groupLayout, 0, ( removeWholeWord ) ? textInfoIndicesEnd.mWordIndex + 1 : textInfoIndicesEnd.mWordIndex );
+        CollectTextActorsFromWords( removedTextActorsFromFirstParagraph,
+                                    paragraphLayout,
+                                    0u,
+                                    ( removeWholeWord ) ? textInfoIndicesEnd.mWordIndex + 1u : textInfoIndicesEnd.mWordIndex );
 
         // Remove extra words. (and current word if whole characters are removed)
-        const std::size_t groupNumberCharacters = groupLayout.mNumberOfCharacters;
-        RemoveWordsFromWordGroup( 0,
-                                  ( removeWholeWord ) ? textInfoIndicesEnd.mWordIndex + 1 : textInfoIndicesEnd.mWordIndex,
-                                  groupLayout );
-
-        // discount the removed number of characters.
-        lineLayout.mNumberOfCharacters -= ( groupNumberCharacters - groupLayout.mNumberOfCharacters );
+        RemoveWordsFromParagraph( 0u,
+                                  ( removeWholeWord ) ? textInfoIndicesEnd.mWordIndex + 1u : textInfoIndicesEnd.mWordIndex,
+                                  layoutParameters.mLineHeightOffset,
+                                  paragraphLayout );
       }
 
       if( !removeWholeWord )
@@ -662,294 +601,115 @@ void UpdateTextInfo( const std::size_t position,
         // Only some characters of the word need to be deleted.
 
         // After removing all extra words. The word with the characters to be removed is the first one.
-        WordLayoutInfo& wordLayout( *groupLayout.mWordsLayoutInfo.begin() );
+        WordLayoutInfo& wordLayout( *paragraphLayout.mWordsLayoutInfo.begin() );
 
         // Store text-actors before removing them.
-        CollectTextActors( removedTextActorsFromFirstWord, wordLayout, 0, textInfoIndicesEnd.mCharacterIndex + 1 );
+        CollectTextActors( removedTextActorsFromFirstWord, wordLayout, 0u, textInfoIndicesEnd.mCharacterIndex + 1u );
 
         const std::size_t wordNumberCharacters = wordLayout.mCharactersLayoutInfo.size();
-        RemoveCharactersFromWord( 0,
-                                  textInfoIndicesEnd.mCharacterIndex + 1,
+        RemoveCharactersFromWord( 0u,
+                                  textInfoIndicesEnd.mCharacterIndex + 1u,
                                   wordLayout );
 
         // discount the removed number of characters.
         const std::size_t removedNumberOfCharacters = ( wordNumberCharacters - wordLayout.mCharactersLayoutInfo.size() );
-        groupLayout.mNumberOfCharacters -= removedNumberOfCharacters;
-        lineLayout.mNumberOfCharacters -= removedNumberOfCharacters;
-        UpdateGroupLayoutInfo( groupLayout );
+        paragraphLayout.mNumberOfCharacters -= removedNumberOfCharacters;
       }
-      UpdateLineLayoutInfo( lineLayout, layoutParameters.mLineHeightOffset );
+      UpdateLayoutInfo( paragraphLayout, layoutParameters.mLineHeightOffset );
 
       // Insert the text-actors in order.
       removedTextActorsFromEnd.insert( removedTextActorsFromEnd.end(), removedTextActorsFromFirstWord.begin(), removedTextActorsFromFirstWord.end() );
-      removedTextActorsFromEnd.insert( removedTextActorsFromEnd.end(), removedTextActorsFromFirstGroup.begin(), removedTextActorsFromFirstGroup.end() );
-      removedTextActorsFromEnd.insert( removedTextActorsFromEnd.end(), removedTextActorsFromGroups.begin(), removedTextActorsFromGroups.end() );
+      removedTextActorsFromEnd.insert( removedTextActorsFromEnd.end(), removedTextActorsFromFirstParagraph.begin(), removedTextActorsFromFirstParagraph.end() );
     }
-  } // end delete text from different lines
-  else if( ( textInfoIndicesBegin.mLineIndex == textInfoIndicesEnd.mLineIndex ) && ( lineLayout.mNumberOfCharacters == numberOfCharacters ) )
+  } // end delete text from different paragraphs
+  else if( ( textInfoIndicesBegin.mParagraphIndex == textInfoIndicesEnd.mParagraphIndex ) && ( paragraphLayout.mNumberOfCharacters == numberOfCharacters ) )
   {
-    // the whole line needs to be deleted.
-    ++textInfoIndicesEnd.mLineIndex; // will delete current line.
+    // the whole paragraph needs to be deleted.
+    ++textInfoIndicesEnd.mParagraphIndex; // will delete current paragraph.
   }
   else
   {
-    // deleted text is within the same line. (merge lines could be needed if the line separator character is deleted)
-
-    // Line which contains the characters to be deleted.
-    LineLayoutInfo& lineLayout( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + textInfoIndicesBegin.mLineIndex ) );
-
-    const WordGroupLayoutInfo& groupLayout( *( lineLayout.mWordGroupsLayoutInfo.begin() + textInfoIndicesBegin.mGroupIndex ) ); // used to check the number of characters of the group of words
-                                                                                                                                // if all characters to be deleted are in the same group of words.
-    if( textInfoIndicesBegin.mGroupIndex < textInfoIndicesEnd.mGroupIndex )
+    // deleted text is within the same paragraph. (merge paragraphs could be needed if the paragraph separator character is deleted)
+
+    // Paragraph which contains the characters to be deleted.
+    ParagraphLayoutInfo& paragraphLayout( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + textInfoIndicesBegin.mParagraphIndex ) );
+
+    // Remove the characters from the paragraph layout info. It returns whether the current paragraph can be merged with the next one.
+    RemoveCharactersFromParagraphInfo( relayoutData,
+                                       numberOfCharacters,
+                                       mergeWords,
+                                       mergeParagraphs,
+                                       textInfoIndicesBegin,
+                                       textInfoIndicesEnd,
+                                       textInfoMergeIndicesBegin,
+                                       textInfoMergeIndicesEnd,
+                                       paragraphLayout,
+                                       removedTextActorsFromBegin,
+                                       removedTextActorsFromEnd );
+
+    if( mergeWords )
     {
-      // Deleted text is from different group of words. The two different group of words may be merged if they have text with same direction.
-
-      // whether first or last group of words need to be split and merged with the last part.
-      bool splitFirstGroup = false;
-      bool splitLastGroup = true;
-
-      textInfoMergeIndicesBegin.mGroupIndex = textInfoIndicesBegin.mGroupIndex;
-      textInfoMergeIndicesEnd.mGroupIndex = textInfoIndicesEnd.mGroupIndex;
-
-      if( ( textInfoIndicesBegin.mWordIndex > 0 ) || ( textInfoIndicesBegin.mCharacterIndex > 0 ) )
-      {
-        // first character to be deleted is not the first one of the current group.
-        ++textInfoIndicesBegin.mGroupIndex; // won't delete current group
-
-        // As some characters remain, this group needs to be split and could be merged with the last one.
-        splitFirstGroup = true;
-      }
-
-      // Check if all characters of the last group are going to be deleted.
-      const WordGroupLayoutInfo& lastGroupLayout( *( lineLayout.mWordGroupsLayoutInfo.begin() + textInfoIndicesEnd.mGroupIndex ) );
-      if( textInfoIndicesEnd.mWordIndex + 1 == lastGroupLayout.mWordsLayoutInfo.size() )
-      {
-        const WordLayoutInfo& lastWordLayout( *( lastGroupLayout.mWordsLayoutInfo.begin() + textInfoIndicesEnd.mWordIndex ) );
-        if( textInfoIndicesEnd.mCharacterIndex + 1 == lastWordLayout.mCharactersLayoutInfo.size() )
-        {
-          // All characters of the last group are going to be deleted.
-          ++textInfoIndicesEnd.mGroupIndex; // will delete the last group.
-
-          // The whole last group is deleted. No need to merge groups.
-          splitLastGroup = false;
-        }
-      }
-
-      // Only merge two groups if they are not deleted completely and they have same direction.
-      mergeGroups = ( splitFirstGroup && splitLastGroup ) && ( groupLayout.mDirection == lastGroupLayout.mDirection );
-
-      if( mergeGroups )
-      {
-        // last group is going to be merged.
-        ++textInfoIndicesEnd.mGroupIndex; // will delete the last group.
-      }
-
-      if( splitFirstGroup )
-      {
-        // Remove characters from the first group.
-
-        // As wordGroupIndexBegin has been increased just to not to remove the group of words, decrease now is needed to access it.
-        WordGroupLayoutInfo& groupLayout( *( lineLayout.mWordGroupsLayoutInfo.begin() + textInfoIndicesBegin.mGroupIndex - 1 ) );
-
-        if( ( textInfoIndicesBegin.mWordIndex + 1 < groupLayout.mWordsLayoutInfo.size() ) || ( 0 == textInfoIndicesBegin.mCharacterIndex ) )
-        {
-          // Remove extra words within current group of words. (and current word if whole characters are removed)
-          // 0 == characterIndexBegin means the whole word is deleted.
-          const std::size_t wordIndex = ( ( 0 == textInfoIndicesBegin.mCharacterIndex ) ? textInfoIndicesBegin.mWordIndex : textInfoIndicesBegin.mWordIndex + 1 );
-
-          // Store text-actors before removing them.
-          CollectTextActorsFromWords( removedTextActorsFromBegin, groupLayout, wordIndex, groupLayout.mWordsLayoutInfo.size() );
-
-          RemoveWordsFromWordGroup( wordIndex,
-                                    groupLayout.mWordsLayoutInfo.size() - wordIndex,
-                                    groupLayout );
-        }
-
-        if( ( textInfoIndicesBegin.mWordIndex < groupLayout.mWordsLayoutInfo.size() ) && ( textInfoIndicesBegin.mCharacterIndex > 0 ) )
-        {
-          // Only some characters of the word need to be removed.
-          WordLayoutInfo& wordLayout( *( groupLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex ) );
-
-          // Store text-actors before removing them.
-          CollectTextActors( removedTextActorsFromBegin, wordLayout, textInfoIndicesBegin.mCharacterIndex, wordLayout.mCharactersLayoutInfo.size() );
+      // Merges words pointed by textInfoMergeIndicesBegin.mWordIndex and textInfoMergeIndicesEnd.mWordIndex calculated previously.
+      DALI_ASSERT_DEBUG( ( textInfoMergeIndicesBegin.mWordIndex < paragraphLayout.mWordsLayoutInfo.size() ) && "TextViewProcessor::UpdateTextInfo (delete). Word index (begin) out of bounds." );
+      DALI_ASSERT_DEBUG( ( textInfoMergeIndicesEnd.mWordIndex < paragraphLayout.mWordsLayoutInfo.size() ) && "TextViewProcessor::UpdateTextInfo (delete). Word index (end) out of bounds." );
 
-          RemoveCharactersFromWord( textInfoIndicesBegin.mCharacterIndex,
-                                    wordLayout.mCharactersLayoutInfo.size() - textInfoIndicesBegin.mCharacterIndex,
-                                    wordLayout );
-        }
-      }
-
-      if( splitLastGroup )
-      {
-        // Some characters from the last group of words need to be removed.
-
-        // textInfoIndicesEnd.mGroupIndex was increased to delete the last group of words if groups need to be merged.
-        // To access now the last group of words we need to decrease the index.
-        std::size_t index = mergeGroups ? textInfoIndicesEnd.mGroupIndex - 1 : textInfoIndicesEnd.mGroupIndex;
-
-        // Get the last group of words.
-        WordGroupLayoutInfo& groupLayout( *( lineLayout.mWordGroupsLayoutInfo.begin() + index ) );
-
-        // Check if is needed remove the whole word. (If the character index is pointing just after the end of the word)
-        const WordLayoutInfo& wordLayout( *( groupLayout.mWordsLayoutInfo.begin() + textInfoIndicesEnd.mWordIndex ) );
-        bool removeWholeWord = wordLayout.mCharactersLayoutInfo.size() == textInfoIndicesEnd.mCharacterIndex + 1;
+      WordLayoutInfo& firstWordLayout( *( paragraphLayout.mWordsLayoutInfo.begin() + textInfoMergeIndicesBegin.mWordIndex ) );
+      WordLayoutInfo& lastWordLayout( *( paragraphLayout.mWordsLayoutInfo.begin() + textInfoMergeIndicesEnd.mWordIndex ) );
 
-        if( ( textInfoIndicesEnd.mWordIndex > 0 ) || ( removeWholeWord ) )
-        {
-          // Store text-actors before removing them.
-          CollectTextActorsFromWords( removedTextActorsFromBegin, groupLayout, 0, ( removeWholeWord ) ? textInfoIndicesEnd.mWordIndex + 1 : textInfoIndicesEnd.mWordIndex );
-
-          // Remove extra words. (and current word if whole characters are removed)
-          RemoveWordsFromWordGroup( 0,
-                                    ( removeWholeWord ) ? textInfoIndicesEnd.mWordIndex + 1 : textInfoIndicesEnd.mWordIndex,
-                                    groupLayout );
-        }
-
-        if( !removeWholeWord )
-        {
-          // Only some characters of the word need to be deleted.
-
-          // After removing all extra words. The word with the characters to be removed is the first one.
-          WordLayoutInfo& wordLayout( *groupLayout.mWordsLayoutInfo.begin() );
-
-          // Store text-actors before removing them.
-          CollectTextActors( removedTextActorsFromBegin, wordLayout, 0, textInfoIndicesEnd.mCharacterIndex + 1 );
-
-          RemoveCharactersFromWord( 0,
-                                    textInfoIndicesEnd.mCharacterIndex + 1,
-                                    wordLayout );
-        }
-      }
-    } // end of remove from different groups
-    else if( ( textInfoIndicesBegin.mGroupIndex == textInfoIndicesEnd.mGroupIndex ) && ( groupLayout.mNumberOfCharacters == numberOfCharacters ) )
-    {
-      // The whole group is deleted.
-      ++textInfoIndicesEnd.mGroupIndex; // will delete current group.
-      // TODO group before and group after need to be merged!!!
+      MergeWord( firstWordLayout,
+                 lastWordLayout );
     }
-    else
-    {
-      // characters to be deleted are on the same group of words. (words may need to be merged)
-
-      // Group of words which contains the characters to be deleted.
-      WordGroupLayoutInfo& groupLayout( *( lineLayout.mWordGroupsLayoutInfo.begin() + textInfoIndicesBegin.mGroupIndex ) );
-
-      RemoveCharactersFromWordGroupInfo( relayoutData,
-                                         numberOfCharacters,
-                                         mergeWords,
-                                         mergeLines,
-                                         textInfoIndicesBegin,
-                                         textInfoIndicesEnd,
-                                         textInfoMergeIndicesBegin,
-                                         textInfoMergeIndicesEnd,
-                                         groupLayout,
-                                         removedTextActorsFromBegin,
-                                         removedTextActorsFromEnd );
-
-      if( mergeWords )
-      {
-        // Merges words pointed by textInfoMergeIndicesBegin.mWordIndex and textInfoMergeIndicesEnd.mWordIndex calculated previously.
-        DALI_ASSERT_DEBUG( ( textInfoMergeIndicesBegin.mWordIndex < groupLayout.mWordsLayoutInfo.size() ) && "TextViewProcessor::UpdateTextInfo (delete). Word index (begin) out of bounds." );
-        DALI_ASSERT_DEBUG( ( textInfoMergeIndicesEnd.mWordIndex < groupLayout.mWordsLayoutInfo.size() ) && "TextViewProcessor::UpdateTextInfo (delete). Word index (end) out of bounds." );
-
-        WordLayoutInfo& firstWordLayout( *( groupLayout.mWordsLayoutInfo.begin() + textInfoMergeIndicesBegin.mWordIndex ) );
-        WordLayoutInfo& lastWordLayout( *( groupLayout.mWordsLayoutInfo.begin() + textInfoMergeIndicesEnd.mWordIndex ) );
-
-        MergeWord( firstWordLayout,
-                   lastWordLayout );
-      }
-
-      // Store text-actors before removing them.
-      const std::size_t endIndex = ( mergeWords && ( textInfoIndicesEnd.mWordIndex > 0 ) ) ? textInfoIndicesEnd.mWordIndex - 1 : textInfoIndicesEnd.mWordIndex; // text-actors from the last word may have been added in the merge above.
-      CollectTextActorsFromWords( removedTextActorsFromMid, groupLayout, textInfoIndicesBegin.mWordIndex, endIndex );
-
-      // Remove unwanted words using previously calculated indices. (including the last part of the merged word)
-      groupLayout.mWordsLayoutInfo.erase( groupLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex, groupLayout.mWordsLayoutInfo.begin() + textInfoIndicesEnd.mWordIndex );
 
-      // Update group of words info
-      groupLayout.mNumberOfCharacters -= numberOfCharacters;
-      groupLayout.mSize = Size();
-      groupLayout.mAscender = 0;
-      for( WordLayoutInfoContainer::const_iterator it = groupLayout.mWordsLayoutInfo.begin(), endIt = groupLayout.mWordsLayoutInfo.end();
-           it != endIt;
-           ++it )
-      {
-        const WordLayoutInfo& layoutInfo( *it );
-        UpdateSize( groupLayout.mSize, layoutInfo.mSize );
-        groupLayout.mAscender = std::max( groupLayout.mAscender, layoutInfo.mAscender );
-      }
-    } // end of remove from same group
+    // Store text-actors before removing them.
+    const std::size_t endIndex = ( mergeWords && ( textInfoIndicesEnd.mWordIndex > 0u ) ) ? textInfoIndicesEnd.mWordIndex - 1u : textInfoIndicesEnd.mWordIndex; // text-actors from the last word may have been added in the merge above.
+    CollectTextActorsFromWords( removedTextActorsFromMid, paragraphLayout, textInfoIndicesBegin.mWordIndex, endIndex );
 
-    if( mergeGroups )
-    {
-      // Merges group of words pointed by textInfoMergeIndicesBegin.mGroupIndex and textInfoMergeIndicesEnd.mGroupIndex calculated previously.
+    // Remove unwanted words using previously calculated indices. (including the last part of the merged word)
+    paragraphLayout.mWordsLayoutInfo.erase( paragraphLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex, paragraphLayout.mWordsLayoutInfo.begin() + textInfoIndicesEnd.mWordIndex );
 
-      WordGroupLayoutInfo& firstGroupLayout( *( lineLayout.mWordGroupsLayoutInfo.begin() + textInfoMergeIndicesBegin.mGroupIndex ) );
+    // Update paragraph info.
+    UpdateLayoutInfo( paragraphLayout, layoutParameters.mLineHeightOffset );
+  }// end delete text from same paragraph.
 
-      const WordGroupLayoutInfo& lastGroupLayout( *( lineLayout.mWordGroupsLayoutInfo.begin() + textInfoMergeIndicesEnd.mGroupIndex ) );
-
-      MergeWordGroup( firstGroupLayout,
-                      lastGroupLayout );
-    }
-
-    // Remove unwanted groups of words using previously calculated indices. (including the last part of the merged group of words)
-    lineLayout.mWordGroupsLayoutInfo.erase( lineLayout.mWordGroupsLayoutInfo.begin() + textInfoIndicesBegin.mGroupIndex, lineLayout.mWordGroupsLayoutInfo.begin() + textInfoIndicesEnd.mGroupIndex );
-
-    // Update line info.
-    lineLayout.mNumberOfCharacters -= numberOfCharacters;
-    lineLayout.mSize = Size();
-    lineLayout.mAscender = 0;
-    for( WordGroupLayoutInfoContainer::const_iterator it = lineLayout.mWordGroupsLayoutInfo.begin(), endIt = lineLayout.mWordGroupsLayoutInfo.end();
-         it != endIt;
-         ++it )
-    {
-      const WordGroupLayoutInfo& layoutInfo( *it );
-      UpdateSize( lineLayout.mSize, layoutInfo.mSize );
-      lineLayout.mAscender = std::max( lineLayout.mAscender, layoutInfo.mAscender );
-    }
-    lineLayout.mSize.height += layoutParameters.mLineHeightOffset;
-    lineLayout.mLineHeightOffset = layoutParameters.mLineHeightOffset;
-  }// end delete text from same line.
-
-  if( mergeLines )
+  if( mergeParagraphs )
   {
-    // Merges lines pointed by textInfoMergeIndicesBegin.mLineIndex and textInfoMergeIndicesEnd.mLineIndex calculated previously.
+    // Merges paragraphs pointed by textInfoMergeIndicesBegin.mParagraphIndex and textInfoMergeIndicesEnd.mParagraphIndex calculated previously.
 
-    LineLayoutInfo& firstLineLayout( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + textInfoMergeIndicesBegin.mLineIndex ) );
+    ParagraphLayoutInfo& firstParagraphLayout( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + textInfoMergeIndicesBegin.mParagraphIndex ) );
 
-    const LineLayoutInfo& lastLineLayout( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + textInfoMergeIndicesEnd.mLineIndex ) );
+    const ParagraphLayoutInfo& lastParagraphLayout( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + textInfoMergeIndicesEnd.mParagraphIndex ) );
 
-    MergeLine( firstLineLayout,
-               lastLineLayout );
+    MergeParagraph( firstParagraphLayout,
+               lastParagraphLayout );
   }
 
   // Store text-actors before removing them.
-  const std::size_t endIndex = ( mergeLines && ( textInfoIndicesEnd.mLineIndex > 0 ) ) ? textInfoIndicesEnd.mLineIndex - 1 : textInfoIndicesEnd.mLineIndex; // text-actors from the last line may have been added in the merge above.
-  CollectTextActorsFromLines( removedTextActorsFromMid,
+  const std::size_t endIndex = ( mergeParagraphs && ( textInfoIndicesEnd.mParagraphIndex > 0u ) ) ? textInfoIndicesEnd.mParagraphIndex - 1u : textInfoIndicesEnd.mParagraphIndex; // text-actors from the last paragraph may have been added in the merge above.
+  CollectTextActorsFromParagraphs( removedTextActorsFromMid,
                               relayoutData.mTextLayoutInfo,
-                              textInfoIndicesBegin.mLineIndex,
+                              textInfoIndicesBegin.mParagraphIndex,
                               endIndex );
 
-  // Remove unwanted lines using previously calculated indices. (including the last part of the merged line)
-  relayoutData.mTextLayoutInfo.mLinesLayoutInfo.erase( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + textInfoIndicesBegin.mLineIndex,
-                                                       relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin() + textInfoIndicesEnd.mLineIndex );
+  // Remove unwanted paragraphs using previously calculated indices. (including the last part of the merged paragraph)
+  relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.erase( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + textInfoIndicesBegin.mParagraphIndex,
+                                                       relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin() + textInfoIndicesEnd.mParagraphIndex );
 
   // Update text info.
-  UpdateTextLayoutInfo( relayoutData.mTextLayoutInfo );
+  UpdateLayoutInfo( relayoutData.mTextLayoutInfo );
 
-  // If the last character of the last line is a new line character, an empty line need to be added.
-  if( !relayoutData.mTextLayoutInfo.mLinesLayoutInfo.empty() )
+  // If the last character of the last paragraph is a new paragraph character, an empty paragraph need to be added.
+  if( !relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.empty() )
   {
-    const WordLayoutInfo lastWordLayout = GetLastWordLayoutInfo( *( relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end() - 1 ) );
+    const WordLayoutInfo lastWordLayout = GetLastWordLayoutInfo( *( relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end() - 1u ) );
 
-    if( LineSeparator == lastWordLayout.mType )
+    if( ParagraphSeparator == lastWordLayout.mType )
     {
-      LineLayoutInfo lastLineLayout;
+      ParagraphLayoutInfo lastParagraphLayout;
 
       const CharacterLayoutInfo layoutInfo = GetLastCharacterLayoutInfo( lastWordLayout );
-      lastLineLayout.mSize.height = layoutInfo.mSize.height;
+      lastParagraphLayout.mSize.height = layoutInfo.mSize.height;
 
-      relayoutData.mTextLayoutInfo.mLinesLayoutInfo.push_back( lastLineLayout );
+      relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.push_back( lastParagraphLayout );
 
       relayoutData.mTextLayoutInfo.mWholeTextSize.height += layoutInfo.mSize.height;
     }
@@ -994,23 +754,23 @@ void UpdateTextInfo( const std::size_t position,
                   relayoutData );
 }
 
-void UpdateTextInfo( const float lineHeightOffset,
+void UpdateTextInfo( float lineHeightOffset,
                      TextLayoutInfo& textLayoutInfo )
 {
   // Updates the space between lines with the new offset value.
 
   float newTextHeight = 0.f;
 
-  for( LineLayoutInfoContainer::iterator lineIt = textLayoutInfo.mLinesLayoutInfo.begin(), lineEndIt = textLayoutInfo.mLinesLayoutInfo.end();
-       lineIt != lineEndIt;
-       ++lineIt )
+  for( ParagraphLayoutInfoContainer::iterator paragraphIt = textLayoutInfo.mParagraphsLayoutInfo.begin(), paragraphEndIt = textLayoutInfo.mParagraphsLayoutInfo.end();
+       paragraphIt != paragraphEndIt;
+       ++paragraphIt )
   {
-    LineLayoutInfo& lineLayoutInfo( *lineIt );
+    ParagraphLayoutInfo& paragraphLayoutInfo( *paragraphIt );
 
-    lineLayoutInfo.mSize.height += ( lineHeightOffset - lineLayoutInfo.mLineHeightOffset );
-    newTextHeight += lineLayoutInfo.mSize.height;
+    paragraphLayoutInfo.mSize.height += ( lineHeightOffset - paragraphLayoutInfo.mLineHeightOffset );
+    newTextHeight += paragraphLayoutInfo.mSize.height;
 
-    lineLayoutInfo.mLineHeightOffset = lineHeightOffset;
+    paragraphLayoutInfo.mLineHeightOffset = lineHeightOffset;
   }
 
   textLayoutInfo.mWholeTextSize.height = newTextHeight;
@@ -1022,213 +782,34 @@ void UpdateTextInfo( const TextStyle& style,
 {
   // Change text style for all text-actors.
 
-  for( LineLayoutInfoContainer::iterator lineIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.begin(), lineEndIt = relayoutData.mTextLayoutInfo.mLinesLayoutInfo.end();
-       lineIt != lineEndIt;
-       ++lineIt )
+  for( ParagraphLayoutInfoContainer::iterator paragraphIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.begin(), paragraphEndIt = relayoutData.mTextLayoutInfo.mParagraphsLayoutInfo.end();
+       paragraphIt != paragraphEndIt;
+       ++paragraphIt )
   {
-    LineLayoutInfo& line( *lineIt );
+    ParagraphLayoutInfo& paragraph( *paragraphIt );
 
-    for( WordGroupLayoutInfoContainer::iterator groupIt = line.mWordGroupsLayoutInfo.begin(), groupEndIt = line.mWordGroupsLayoutInfo.end();
-         groupIt != groupEndIt;
-         ++groupIt )
+    for( WordLayoutInfoContainer::iterator wordIt = paragraph.mWordsLayoutInfo.begin(), wordEndIt = paragraph.mWordsLayoutInfo.end();
+         wordIt != wordEndIt;
+         ++wordIt )
     {
-      WordGroupLayoutInfo& group( *groupIt );
+      WordLayoutInfo& word( *wordIt );
 
-      for( WordLayoutInfoContainer::iterator wordIt = group.mWordsLayoutInfo.begin(), wordEndIt = group.mWordsLayoutInfo.end();
-           wordIt != wordEndIt;
-           ++wordIt )
+      for( CharacterLayoutInfoContainer::iterator characterIt = word.mCharactersLayoutInfo.begin(), characterEndIt = word.mCharactersLayoutInfo.end();
+           characterIt != characterEndIt;
+           ++characterIt )
       {
-        WordLayoutInfo& word( *wordIt );
-
-        for( CharacterLayoutInfoContainer::iterator characterIt = word.mCharactersLayoutInfo.begin(), characterEndIt = word.mCharactersLayoutInfo.end();
-             characterIt != characterEndIt;
-             ++characterIt )
-        {
-          CharacterLayoutInfo& characterLayout( *characterIt );
-
-          characterLayout.mStyledText.mStyle.Copy( style, mask );
+        CharacterLayoutInfo& characterLayout( *characterIt );
 
-          // Checks if the font family supports all glyphs. If not, chooses a most suitable one.
-          ChooseFontFamilyName( characterLayout.mStyledText );
+        characterLayout.mStyledText.mStyle.Copy( style, mask );
 
-          // Mark the character to be set the new style into the text-actor.
-          characterLayout.mSetStyle = true;
-        } // end characters
-      } // end words
-    } // end group of words
-  } // end lines
-}
+        // Checks if the font family supports all glyphs. If not, chooses a most suitable one.
+        ChooseFontFamilyName( characterLayout.mStyledText );
 
-void InitializeTextActorInfo( TextView::RelayoutData& relayoutData )
-{
-  TextLayoutInfo& textLayoutInfo = relayoutData.mTextLayoutInfo;
-  if( textLayoutInfo.mLinesLayoutInfo.empty() )
-  {
-    // nothing to do if there is no lines.
-    return;
-  }
-
-  std::size_t characterGlobalIndex = 0;  // Index to the global character (within the whole text).
-  std::size_t lineLayoutInfoIndex = 0;   // Index to the laid out line info.
-  const std::size_t lineLayoutInfoSize = relayoutData.mLines.size(); // Number or laid out lines.
-  bool lineLayoutEnd = false;            // Whether lineLayoutInfoIndex points at the last laid out line.
-  bool glyphActorCreatedForLine = false; // Whether a renderable actor has been created for this line.
-
-  RenderableActor currentGlyphActor;      // text-actor used when the edit mode is disabled.
-  TextStyle currentStyle;                // style for the current text-actor.
-  Vector4 currentGradientColor;          // gradient color for the current text-actor.
-  Vector2 currentStartPoint;             // start point for the current text-actor.
-  Vector2 currentEndPoint;               // end point for the current text-actor.
-  bool currentIsColorGlyph = false;      // Whether current glyph is an emoticon.
-
-  std::vector<TextActor> textActorsToRemove; // Keep a vector of text-actors to be included into the cache.
-
-  for( LineLayoutInfoContainer::iterator lineIt = textLayoutInfo.mLinesLayoutInfo.begin(), lineEndIt = textLayoutInfo.mLinesLayoutInfo.end();
-       lineIt != lineEndIt;
-       ++lineIt )
-  {
-    LineLayoutInfo& line( *lineIt );
-
-    for( WordGroupLayoutInfoContainer::iterator groupIt = line.mWordGroupsLayoutInfo.begin(), groupEndIt = line.mWordGroupsLayoutInfo.end();
-         groupIt != groupEndIt;
-         ++groupIt )
-    {
-      WordGroupLayoutInfo& group( *groupIt );
-
-      for( WordLayoutInfoContainer::iterator wordIt = group.mWordsLayoutInfo.begin(), wordEndIt = group.mWordsLayoutInfo.end();
-           wordIt != wordEndIt;
-           ++wordIt )
-      {
-        WordLayoutInfo& word( *wordIt );
-
-        for( CharacterLayoutInfoContainer::iterator characterIt = word.mCharactersLayoutInfo.begin(), characterEndIt = word.mCharactersLayoutInfo.end();
-             characterIt != characterEndIt;
-             ++characterIt )
-        {
-          CharacterLayoutInfo& characterLayout( *characterIt );
-
-          // Check if there is a new line.
-          const bool newLine = !lineLayoutEnd && ( characterGlobalIndex == relayoutData.mLines[lineLayoutInfoIndex].mCharacterGlobalIndex );
-
-          if( newLine )
-          {
-            // Point to the next line.
-            ++lineLayoutInfoIndex;
-            if( lineLayoutInfoIndex >= lineLayoutInfoSize )
-            {
-              // Arrived at last line.
-              lineLayoutEnd = true; // Avoids access out of bounds in the relayoutData.mLines vector.
-            }
-            glyphActorCreatedForLine = false;
-          }
-
-          if( !characterLayout.mStyledText.mText.IsEmpty() )
-          {
-            // Do not create a glyph-actor if there is no text.
-            const Character character = characterLayout.mStyledText.mText[0]; // there are only one character per character layout.
-
-            if( characterLayout.mIsColorGlyph ||
-                !character.IsWhiteSpace() || // A new line character is also a white space.
-                ( character.IsWhiteSpace() && characterLayout.mStyledText.mStyle.IsUnderlineEnabled() ) )
-            {
-              // Do not create a glyph-actor if it's a white space (without underline) or a new line character.
-
-              // Creates one glyph-actor per each counsecutive group of characters, with the same style, per line, or if it's an emoticon.
-
-              if( !glyphActorCreatedForLine ||
-                  characterLayout.mIsColorGlyph ||
-                  ( characterLayout.mStyledText.mStyle != currentStyle ) ||
-                  ( characterLayout.mGradientColor != currentGradientColor ) ||
-                  ( characterLayout.mStartPoint != currentStartPoint ) ||
-                  ( characterLayout.mEndPoint != currentEndPoint ) ||
-                  ( characterLayout.mIsColorGlyph != currentIsColorGlyph ) )
-              {
-                characterLayout.mSetText = false;
-                characterLayout.mSetStyle = false;
-
-                // There is a new style or a new line.
-                glyphActorCreatedForLine = true;
-
-                if( characterLayout.mIsColorGlyph )
-                {
-                  ImageActor imageActor = ImageActor::DownCast( characterLayout.mGlyphActor );
-                  if( !imageActor )
-                  {
-                    characterLayout.mGlyphActor = ImageActor::New();
-                    characterLayout.mSetText = true;
-                  }
-                }
-                else
-                {
-                  TextActor textActor = TextActor::DownCast( characterLayout.mGlyphActor );
-
-                  if( textActor )
-                  {
-                    // Try to reuse first the text-actor of this character.
-                    textActor.SetTextStyle( characterLayout.mStyledText.mStyle );
-                    currentGlyphActor = textActor;
-                  }
-                  else
-                  {
-                    // If there is no text-actor, try to retrieve one from the cache.
-                    textActor = relayoutData.mTextActorCache.RetrieveTextActor();
-
-                    // If still there is no text-actor, create one.
-                    if( !textActor )
-                    {
-                      TextActorParameters parameters( characterLayout.mStyledText.mStyle, TextActorParameters::FONT_DETECTION_OFF );
-                      textActor = TextActor::New( NULL, parameters );
-                    }
-                    else
-                    {
-                      textActor.SetTextStyle( characterLayout.mStyledText.mStyle );
-                    }
-
-                    currentGlyphActor = textActor;
-                  }
-                  characterLayout.mGlyphActor = currentGlyphActor;
-                }
-
-                // Update style to be checked with next characters.
-                currentStyle = characterLayout.mStyledText.mStyle;
-                currentGradientColor = characterLayout.mGradientColor;
-                currentStartPoint = characterLayout.mStartPoint;
-                currentEndPoint = characterLayout.mEndPoint;
-                currentIsColorGlyph = characterLayout.mIsColorGlyph;
-
-                characterLayout.mGlyphActor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-                characterLayout.mGlyphActor.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
-              }
-              else
-              {
-                DALI_ASSERT_DEBUG( !characterLayout.mIsColorGlyph && "TextViewProcessor::InitializeTextActorInfo. An image-actor doesn't store more than one emoticon." );
-
-                // Same style than previous one.
-                TextActor textActor = TextActor::DownCast( characterLayout.mGlyphActor );
-                if( textActor )
-                {
-                  // There is a previously created text-actor for this character.
-                  // If this character has another one put it into the cache.
-                  textActor.SetText( "" );
-                  textActorsToRemove.push_back( textActor );
-                }
-
-                if( characterLayout.mGlyphActor )
-                {
-                  characterLayout.mGlyphActor.Reset();
-                }
-              }
-            } // no white space / new line char
-          } // text not empty
-
-          ++characterGlobalIndex;
-        } // characters
-      } // words
-    } // groups
-  } // lines
-
-  // Insert the spare text-actors into the cache.
-  relayoutData.mTextActorCache.InsertTextActors( textActorsToRemove );
+        // Mark the character to be set the new style into the text-actor.
+        characterLayout.mSetStyle = true;
+      } // end characters
+    } // end words
+  } // end paragraphs
 }
 
 } // namespace TextViewProcessor
index bd31fd1..a38eaa7 100644 (file)
@@ -97,7 +97,7 @@ void UpdateTextInfo( std::size_t position,
  * Updates the layout data structure by modifying the space between lines.
  *
  * @param[in] lineHeightOffset The new space between lines.
- * @param[in,out] textLayoutInfo Layout info for all groups of characters, words, groups of words, lines and the whole text.
+ * @param[in,out] textLayoutInfo Layout info for all characters, words, lines and the whole text.
  */
 void UpdateTextInfo( float lineHeightOffset,
                      TextLayoutInfo& textLayoutInfo );
@@ -115,13 +115,6 @@ void UpdateTextInfo( const TextStyle& style,
                      TextStyle::Mask mask,
                      TextView::RelayoutData& relayoutData );
 
-/**
- * Traverse all text initializing all non initialized text-actor handles.
- *
- * @param[in,out] relayoutData Natural size (metrics), layout, text-actor info.
- */
-void InitializeTextActorInfo( TextView::RelayoutData& relayoutData );
-
 } // namespace TextViewProcessor
 
 } // namespace Internal
diff --git a/base/dali-toolkit/internal/controls/text-view/text-view-word-group-processor.cpp b/base/dali-toolkit/internal/controls/text-view/text-view-word-group-processor.cpp
deleted file mode 100644 (file)
index e5c2804..0000000
+++ /dev/null
@@ -1,553 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// FILE HEADER
-#include <dali-toolkit/internal/controls/text-view/text-view-word-group-processor.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/text-view/text-view-word-processor.h>
-#include <dali-toolkit/internal/controls/text-view/text-view-processor-helper-functions.h>
-#include <dali-toolkit/internal/controls/text-view/text-processor.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace TextViewProcessor
-{
-
-/////////////////////
-// Layout info.
-/////////////////////
-
-WordGroupLayoutInfo::WordGroupLayoutInfo()
-: mSize(),
-  mAscender( 0.f ),
-  mDirection( LTR ),
-  mWordsLayoutInfo(),
-  mNumberOfCharacters( 0 )
-{
-}
-
-WordGroupLayoutInfo::WordGroupLayoutInfo( const WordGroupLayoutInfo& group )
-: mSize( group.mSize ),
-  mAscender( group.mAscender ),
-  mDirection( group.mDirection ),
-  mWordsLayoutInfo( group.mWordsLayoutInfo ),
-  mNumberOfCharacters( group.mNumberOfCharacters )
-{
-}
-
-WordGroupLayoutInfo& WordGroupLayoutInfo::operator=( const WordGroupLayoutInfo& group )
-{
-  mSize = group.mSize;
-  mAscender = group.mAscender;
-  mDirection = group.mDirection;
-  mWordsLayoutInfo = group.mWordsLayoutInfo;
-  mNumberOfCharacters = group.mNumberOfCharacters;
-
-  return *this;
-}
-
-void UpdateGroupLayoutInfo( TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo )
-{
-  wordGroupLayoutInfo.mSize = Size();
-
-  for( WordLayoutInfoContainer::iterator it = wordGroupLayoutInfo.mWordsLayoutInfo.begin(), endIt = wordGroupLayoutInfo.mWordsLayoutInfo.end();
-       it != endIt;
-       ++it )
-  {
-    WordLayoutInfo& layoutInfo( *it );
-
-    UpdateSize( wordGroupLayoutInfo.mSize, layoutInfo.mSize );
-  }
-}
-
-void CreateWordGroupInfo( const MarkupProcessor::StyledTextArray& wordGroup,
-                          TextViewProcessor::TextLayoutInfo& textLayoutInfo,
-                          TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo )
-{
-  // Set the direction of the group.
-  wordGroupLayoutInfo.mDirection = ( TextProcessor::BeginsRightToLeftCharacter( wordGroup ) ? TextViewProcessor::RTL : TextViewProcessor::LTR );
-
-  // Split the group of words in words
-  std::vector<MarkupProcessor::StyledTextArray> words;
-  TextProcessor::SplitInWords( wordGroup, words );
-
-  // if last word has a new line separator, create a new word.
-  if( !words.empty() )
-  {
-    MarkupProcessor::StyledTextArray& word( *( words.end() - 1 ) );
-    if( word.size() > 1 )
-    {
-      // do nothing if the word has only one character.
-      MarkupProcessor::StyledText& styledText( *( word.end() - 1 ) );
-      if( !styledText.mText.IsEmpty() )
-      {
-        const std::size_t length = styledText.mText.GetLength();
-        if( styledText.mText[length-1].IsNewLine() )
-        {
-          // Last character of this word is a new line character.
-
-          // Remove line separator character from current word.
-          styledText.mText.Remove( length - 1, 1 );
-
-          // Create a new word with the line separator character.
-          MarkupProcessor::StyledText newLineText( Text( styledText.mText[length-1] ), styledText.mStyle );
-
-          MarkupProcessor::StyledTextArray newLineWord;
-          newLineWord.push_back( newLineText );
-
-          words.push_back( newLineWord );
-        }
-      }
-    }
-  }
-
-  // Reverse if right to left.
-  if( TextViewProcessor::RTL == wordGroupLayoutInfo.mDirection )
-  {
-    std::reverse( words.begin(), words.end() );
-  }
-
-  std::string lastCharacterFont; // Keeps the font used by the last character. It's used to set the font to a word separator.
-
-  // Traverse all words.
-  for( std::vector<MarkupProcessor::StyledTextArray>::const_iterator wordIt = words.begin(), wordEndIt = words.end(); wordIt != wordEndIt; ++wordIt )
-  {
-    const MarkupProcessor::StyledTextArray& word( *wordIt );
-
-    // Data structures for the new word.
-    WordLayoutInfo wordLayoutInfo;
-
-    CreateWordTextInfo( word,
-                        wordLayoutInfo );
-
-    // White space's size could be different depending on the type of font. It's important to use the same font than the previous character to
-    // avoid 'jumps' of characters when there is a switch between one text-actor per character and one text-actor per line and/or style.
-    if( WordSeparator == wordLayoutInfo.mType )
-    {
-      // If current word is a word separator (white space) then the font of the last character is set.
-      for( CharacterLayoutInfoContainer::iterator characterIt = wordLayoutInfo.mCharactersLayoutInfo.begin(), characterEndIt = wordLayoutInfo.mCharactersLayoutInfo.end();
-           characterIt != characterEndIt;
-           ++characterIt )
-      {
-        CharacterLayoutInfo& characterLayout( *characterIt );
-
-        characterLayout.mStyledText.mStyle.SetFontName( lastCharacterFont );
-      }
-    }
-    else
-    {
-      // kepps the font of the last character.
-      if( !wordLayoutInfo.mCharactersLayoutInfo.empty() )
-      {
-        lastCharacterFont = ( *( wordLayoutInfo.mCharactersLayoutInfo.end() - 1 ) ).mStyledText.mStyle.GetFontName();
-      }
-    }
-
-    // Update layout info for the current group of words.
-    wordGroupLayoutInfo.mNumberOfCharacters += wordLayoutInfo.mCharactersLayoutInfo.size();
-    UpdateSize( wordGroupLayoutInfo.mSize, wordLayoutInfo.mSize );
-    wordGroupLayoutInfo.mAscender = std::max( wordGroupLayoutInfo.mAscender, wordLayoutInfo.mAscender );
-
-    // Add current word to the group of words.
-    wordGroupLayoutInfo.mWordsLayoutInfo.push_back( wordLayoutInfo );
-
-    // Update the max word width figure.
-    textLayoutInfo.mMaxWordWidth = std::max( textLayoutInfo.mMaxWordWidth, wordLayoutInfo.mSize.width );
-  } // end of words
-}
-
-void RemoveCharactersFromWordGroupInfo( TextView::RelayoutData& relayoutData,
-                                        const std::size_t numberOfCharacters,
-                                        bool& mergeWords,
-                                        bool& mergeLines,
-                                        TextViewProcessor::TextInfoIndices& textInfoIndicesBegin,
-                                        TextViewProcessor::TextInfoIndices& textInfoIndicesEnd,
-                                        TextViewProcessor::TextInfoIndices& textInfoMergeIndicesBegin,
-                                        TextViewProcessor::TextInfoIndices& textInfoMergeIndicesEnd,
-                                        TextViewProcessor::WordGroupLayoutInfo& groupLayout,
-                                        std::vector<TextActor>& removedTextActorsFromFirstWord,
-                                        std::vector<TextActor>& removedTextActorsFromLastWord )
-{
-  const TextViewProcessor::TextLayoutInfo& textLayoutInfo = relayoutData.mTextLayoutInfo;
-
-  if( textInfoIndicesBegin.mWordIndex < textInfoIndicesEnd.mWordIndex )
-  {
-    // Deleted text is from different words. The two different words may be merged.
-
-    // Get first word.
-    WordLayoutInfo& firstWordLayout( *( groupLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex ) );
-
-    // Get last word.
-    WordLayoutInfo& lastWordLayout( *( groupLayout.mWordsLayoutInfo.begin() + textInfoIndicesEnd.mWordIndex ) );
-
-    // whether first or last word need to be split and merged.
-    bool mergeFromBegin = false;
-    bool mergeToEnd = false;
-
-    if( textInfoIndicesBegin.mCharacterIndex > 0 )
-    {
-      // First word is going to be split. It could be merged with the last word.
-      mergeFromBegin = true;
-      textInfoMergeIndicesBegin.mWordIndex = textInfoIndicesBegin.mWordIndex;
-    }
-    else if( ( textInfoIndicesBegin.mCharacterIndex == 0 ) && ( textInfoIndicesBegin.mWordIndex > 0 ) )
-    {
-      // First word is going to be removed completely.
-      // Check if previous word could be merged.
-
-      // Get word before.
-      WordLayoutInfo& previousWordLayout( *( groupLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex - 1 ) );
-      if( WordSeparator != previousWordLayout.mType )
-      {
-        // Previous word is not a word separator, so could be merged.
-        mergeFromBegin = true;
-        textInfoMergeIndicesBegin.mWordIndex = textInfoIndicesBegin.mWordIndex - 1;
-      }
-    }
-
-    if( mergeFromBegin )
-    {
-      // First word (or previous one) could be merged. Check if last one could be merged as well.
-
-      if( textInfoIndicesEnd.mCharacterIndex + 1 < lastWordLayout.mCharactersLayoutInfo.size() )
-      {
-        // Last word is going to be split. It could be merged with the first word.
-        mergeToEnd = true;
-        textInfoMergeIndicesEnd.mWordIndex = textInfoIndicesEnd.mWordIndex;
-      }
-      else if( ( textInfoIndicesEnd.mCharacterIndex + 1 == lastWordLayout.mCharactersLayoutInfo.size() ) && ( textInfoIndicesEnd.mWordIndex + 1 < groupLayout.mWordsLayoutInfo.size() ) )
-      {
-        // Last word is going to be removed completely.
-        // Check if the word after could be merged.
-
-        // Get word after.
-        WordLayoutInfo& afterWordLayout( *( groupLayout.mWordsLayoutInfo.begin() + textInfoIndicesEnd.mWordIndex + 1 ) );
-        if( WordSeparator != afterWordLayout.mType )
-        {
-          // The word after is not a word separator, so could be merged.
-          mergeToEnd = true;
-          textInfoMergeIndicesEnd.mWordIndex = textInfoIndicesEnd.mWordIndex + 1;
-        }
-      }
-
-      // Merge words only if both words could be merged.
-      mergeWords = mergeFromBegin && mergeToEnd;
-    }
-
-    if( ( textInfoIndicesEnd.mCharacterIndex + 1 == lastWordLayout.mCharactersLayoutInfo.size() ) && ( textInfoIndicesEnd.mWordIndex + 1 == groupLayout.mWordsLayoutInfo.size() ) )
-    {
-      // Last word of the line is going to be removed completely.
-      // Check if it's a line separator.
-
-      if( LineSeparator == lastWordLayout.mType )
-      {
-        // The line separator is going to be removed.
-        if( textInfoIndicesBegin.mLineIndex + 1 < textLayoutInfo.mLinesLayoutInfo.size() )
-        {
-          //  Line need to be merged.
-          textInfoMergeIndicesBegin.mLineIndex = textInfoIndicesBegin.mLineIndex;
-          textInfoMergeIndicesEnd.mLineIndex = textInfoIndicesBegin.mLineIndex + 1;
-          mergeLines= true;
-
-          ++textInfoIndicesBegin.mLineIndex; // increase both indices,
-          textInfoIndicesEnd.mLineIndex +=2; // will delete last line.
-        }
-      }
-    }
-
-    if( textInfoIndicesBegin.mCharacterIndex > 0 )
-    {
-      // First word needs to be split.
-
-      // Store text-actors before removing them.
-      CollectTextActors( removedTextActorsFromFirstWord, firstWordLayout, textInfoIndicesBegin.mCharacterIndex, firstWordLayout.mCharactersLayoutInfo.size() );
-
-      RemoveCharactersFromWord( textInfoIndicesBegin.mCharacterIndex,
-                                firstWordLayout.mCharactersLayoutInfo.size() - textInfoIndicesBegin.mCharacterIndex,
-                                firstWordLayout );
-
-      ++textInfoIndicesBegin.mWordIndex; // will delete from the word after.
-    }
-
-    if( textInfoIndicesEnd.mCharacterIndex + 1 < lastWordLayout.mCharactersLayoutInfo.size() )
-    {
-      // Last word needs to be split.
-
-      // Store text-actors before removing them.
-      CollectTextActors( removedTextActorsFromLastWord, lastWordLayout, 0, textInfoIndicesEnd.mCharacterIndex + 1 );
-
-      RemoveCharactersFromWord( 0,
-                                textInfoIndicesEnd.mCharacterIndex + 1,
-                                lastWordLayout );
-
-      if( mergeWords )
-      {
-        // This word is going to be merged, so is not needed.
-        ++textInfoIndicesEnd.mWordIndex; // will delete the last word.
-      }
-    }
-    else if( textInfoIndicesEnd.mCharacterIndex + 1 == lastWordLayout.mCharactersLayoutInfo.size() )
-    {
-      // The whole last word is going to be removed.
-      ++textInfoIndicesEnd.mWordIndex; // will delete the last word.
-
-      if( ( WordSeparator == lastWordLayout.mType ) && mergeWords )
-      {
-        // The last word is a word separator and the word after is going to be merged so is not needed.
-        ++textInfoIndicesEnd.mWordIndex; // will delete the word after the last one.
-      }
-    }
-  }
-  else
-  {
-    // Chraracters to be removed are from the same word.
-
-    RemoveCharactersFromWordInfo( relayoutData,
-                                  numberOfCharacters,
-                                  mergeWords,
-                                  mergeLines,
-                                  textInfoIndicesBegin,
-                                  textInfoIndicesEnd,
-                                  textInfoMergeIndicesBegin,
-                                  textInfoMergeIndicesEnd,
-                                  groupLayout,
-                                  removedTextActorsFromFirstWord );
-  } // word indices
-}
-
-void RemoveWordsFromWordGroup( const std::size_t wordIndex,
-                               const std::size_t numberOfWords,
-                               WordGroupLayoutInfo& wordGroupLayoutInfo )
-{
-  // Removes words from a group of words.
-
-  // * Check if words or lines can be merged after removing a word or line separator have to be done outside this method.
-
-  // * Note: Currently it's only used to remove a number of words from the beginning, or
-  //         from wordIndex index to the end. This function doesn't merge words (if a white space is removed)
-  //         TODO: merge words if required.
-
-  const std::size_t wordEndIndex = wordIndex + numberOfWords;
-
-  // Remove words from layout info.
-  wordGroupLayoutInfo.mWordsLayoutInfo.erase( wordGroupLayoutInfo.mWordsLayoutInfo.begin() + wordIndex,
-                                              wordGroupLayoutInfo.mWordsLayoutInfo.begin() + wordEndIndex );
-
-  // update layout info
-  wordGroupLayoutInfo.mSize = Size();
-  wordGroupLayoutInfo.mAscender = 0.f;
-  wordGroupLayoutInfo.mNumberOfCharacters = 0;
-  for( WordLayoutInfoContainer::const_iterator it = wordGroupLayoutInfo.mWordsLayoutInfo.begin(), endIt = wordGroupLayoutInfo.mWordsLayoutInfo.end();
-       it != endIt;
-       ++it )
-  {
-    const WordLayoutInfo& info( *it );
-
-    UpdateSize( wordGroupLayoutInfo.mSize, info.mSize );
-    wordGroupLayoutInfo.mAscender = std::max( wordGroupLayoutInfo.mAscender, info.mAscender );
-    wordGroupLayoutInfo.mNumberOfCharacters += info.mCharactersLayoutInfo.size();
-  }
-}
-
-void SplitWordGroup( const TextInfoIndices& indices,
-                     WordGroupLayoutInfo& firstWordGroupLayoutInfo,
-                     WordGroupLayoutInfo& lastWordGroupLayoutInfo )
-{
-  // Splits a group of words in two.
-  // A word may be split in two as well.
-
-  // * Split the word pointed by indices.mWordIndex using the indices.mCharacterIndex index.
-  // * Add the last part of the word as first word of the last part of the group of words.
-  // * Add folliwing words to the last part of the new group of words.
-  // * Remove from the first part of the group of words all words added to the last part of the group of words.
-  // * Update layout info.
-
-  //early returns
-  if( ( 0 == indices.mWordIndex ) && ( 0 == indices.mCharacterIndex ) )
-  {
-    // the whole group of words goes to the last part of the group.
-    lastWordGroupLayoutInfo = firstWordGroupLayoutInfo;
-
-    firstWordGroupLayoutInfo = WordGroupLayoutInfo();
-
-    return;
-  }
-
-  if( !firstWordGroupLayoutInfo.mWordsLayoutInfo.empty() )
-  {
-    const std::size_t numberOfWords = firstWordGroupLayoutInfo.mWordsLayoutInfo.size();
-    if( indices.mWordIndex == numberOfWords - 1 )
-    {
-      const WordLayoutInfo& word( *( firstWordGroupLayoutInfo.mWordsLayoutInfo.end() - 1 ) );
-      if( indices.mCharacterIndex == word.mCharactersLayoutInfo.size() )
-      {
-        // the whole group of words goes to the first part.
-
-        // Just delete whatever there is in the last part of the group of words.
-        lastWordGroupLayoutInfo = WordGroupLayoutInfo();
-
-        return;
-      }
-    }
-  }
-
-  lastWordGroupLayoutInfo = WordGroupLayoutInfo();
-
-  // 1) Split the word within the group of words to be split.
-  WordLayoutInfo& firstWordLayoutInfo( *( firstWordGroupLayoutInfo.mWordsLayoutInfo.begin() + indices.mWordIndex ) );
-  WordLayoutInfo lastWordLayoutInfo;
-
-  SplitWord( indices.mCharacterIndex,
-             firstWordLayoutInfo,
-             lastWordLayoutInfo );
-
-  // 2) Add last part of the word to the new group of words.
-  if( !lastWordLayoutInfo.mCharactersLayoutInfo.empty() )
-  {
-    lastWordGroupLayoutInfo.mWordsLayoutInfo.push_back( lastWordLayoutInfo );
-  }
-
-  // 3) Add words from word-position + 1 to the end.
-  lastWordGroupLayoutInfo.mWordsLayoutInfo.insert( lastWordGroupLayoutInfo.mWordsLayoutInfo.end(),
-                                                   firstWordGroupLayoutInfo.mWordsLayoutInfo.begin() + indices.mWordIndex + 1, firstWordGroupLayoutInfo.mWordsLayoutInfo.end() );
-
-  // 4) update layout info of the last group of words.
-  lastWordGroupLayoutInfo.mDirection = firstWordGroupLayoutInfo.mDirection;
-
-  for( WordLayoutInfoContainer::iterator it = lastWordGroupLayoutInfo.mWordsLayoutInfo.begin(), endIt = lastWordGroupLayoutInfo.mWordsLayoutInfo.end();
-       it != endIt;
-       ++it )
-  {
-    WordLayoutInfo& layoutInfo( *it );
-
-    UpdateSize( lastWordGroupLayoutInfo.mSize, layoutInfo.mSize );
-    lastWordGroupLayoutInfo.mNumberOfCharacters += layoutInfo.mCharactersLayoutInfo.size();
-    lastWordGroupLayoutInfo.mAscender = std::max( lastWordGroupLayoutInfo.mAscender, layoutInfo.mAscender );
-  }
-
-  // 5) Remove words added to the last part of the group of words from the first group of words.
-
-  // if the number of characters of the last word of the first group is zero, it should be removed.
-  const std::size_t index = ( firstWordLayoutInfo.mCharactersLayoutInfo.empty() ? indices.mWordIndex : indices.mWordIndex + 1 );
-
-  firstWordGroupLayoutInfo.mWordsLayoutInfo.erase( firstWordGroupLayoutInfo.mWordsLayoutInfo.begin() + index, firstWordGroupLayoutInfo.mWordsLayoutInfo.end() );
-
-  // 6) update layout info of the first group of words.
-  firstWordGroupLayoutInfo.mSize = Size();
-  firstWordGroupLayoutInfo.mAscender = 0.f;
-  firstWordGroupLayoutInfo.mNumberOfCharacters = 0;
-  for( WordLayoutInfoContainer::iterator it = firstWordGroupLayoutInfo.mWordsLayoutInfo.begin(), endIt = firstWordGroupLayoutInfo.mWordsLayoutInfo.end();
-       it != endIt;
-       ++it )
-  {
-    WordLayoutInfo& layoutInfo( *it );
-
-    UpdateSize( firstWordGroupLayoutInfo.mSize, layoutInfo.mSize );
-    firstWordGroupLayoutInfo.mNumberOfCharacters += layoutInfo.mCharactersLayoutInfo.size();
-    firstWordGroupLayoutInfo.mAscender = std::max( firstWordGroupLayoutInfo.mAscender, layoutInfo.mAscender );
-  }
-}
-
-void MergeWordGroup( WordGroupLayoutInfo& firstWordGroupLayoutInfo,
-                     const WordGroupLayoutInfo& lastWordGroupLayoutInfo )
-{
-  // Merges two given groups of words.
-  //
-  // Can't merge two groups if they have text with different directions (RTL , LTR )
-  // or if the last word of the first one is a line separator (new line character)
-
-  // Early returns
-
-  if( lastWordGroupLayoutInfo.mWordsLayoutInfo.empty() )
-  {
-    // Nothing to merge if last group is empty.
-    return;
-  }
-
-  if( firstWordGroupLayoutInfo.mWordsLayoutInfo.empty() )
-  {
-    // If first group is empty, just copy the last group to the first one.
-    firstWordGroupLayoutInfo = lastWordGroupLayoutInfo;
-
-    return;
-  }
-
-  // Check both groups have the same direction.
-  if( firstWordGroupLayoutInfo.mDirection != lastWordGroupLayoutInfo.mDirection )
-  {
-    DALI_ASSERT_ALWAYS( !"TextViewProcessor::MergeWordGroup(). ERROR: groups with different direction can't be merged." );
-  }
-
-  // Check first group doesn't finish with a new line character.
-  WordLayoutInfo& lastWordLayout( *( firstWordGroupLayoutInfo.mWordsLayoutInfo.end() - 1 ) );
-  if( LineSeparator == lastWordLayout.mType )
-  {
-    DALI_ASSERT_ALWAYS( !"TextViewProcessor::MergeWordGroup(). ERROR: A group of words can't be merged to another group which finishes with a new line character." );
-  }
-
-  // If the las word of the first group or the first word of the last group is a white space, both groups can be concatenated.
-  // Otherwise both words need to be merged first.
-  const WordLayoutInfo& firstWordLayout( *lastWordGroupLayoutInfo.mWordsLayoutInfo.begin() );
-
-  std::size_t index = 0;
-  if( ( WordSeparator != lastWordLayout.mType ) && ( WordSeparator != firstWordLayout.mType ) && ( LineSeparator != firstWordLayout.mType ) )
-  {
-    // Last word of the first group is not a word separator and first word of the last group is not a word or line separator.
-    // Words need to be merged.
-
-    MergeWord( lastWordLayout,
-               firstWordLayout );
-
-    // After merging two words, the rest of the words need to be added.
-    ++index; // By increasing this index the word already merged won't be added again.
-  }
-
-  // Merge layout info
-  firstWordGroupLayoutInfo.mWordsLayoutInfo.insert( firstWordGroupLayoutInfo.mWordsLayoutInfo.end(),
-                                                    lastWordGroupLayoutInfo.mWordsLayoutInfo.begin() + index, lastWordGroupLayoutInfo.mWordsLayoutInfo.end() );
-  UpdateSize( firstWordGroupLayoutInfo.mSize, lastWordGroupLayoutInfo.mSize );
-  firstWordGroupLayoutInfo.mAscender = std::max( firstWordGroupLayoutInfo.mAscender, lastWordGroupLayoutInfo.mAscender );
-  firstWordGroupLayoutInfo.mNumberOfCharacters += lastWordGroupLayoutInfo.mNumberOfCharacters;
-}
-
-void CollectTextActorsFromGroups( std::vector<TextActor>& textActors, const LineLayoutInfo& line, const std::size_t groupIndexBegin, const std::size_t groupIndexEnd )
-{
-  for( WordGroupLayoutInfoContainer::const_iterator groupIt = line.mWordGroupsLayoutInfo.begin() + groupIndexBegin, groupEndIt = line.mWordGroupsLayoutInfo.begin() + groupIndexEnd;
-       groupIt != groupEndIt;
-       ++groupIt )
-  {
-    const WordGroupLayoutInfo& group( *groupIt );
-
-    CollectTextActorsFromWords( textActors, group, 0, group.mWordsLayoutInfo.size() );
-  }
-}
-
-} //namespace TextViewProcessor
-
-} //namespace Internal
-
-} //namespace Toolkit
-
-} //namespace Dali
diff --git a/base/dali-toolkit/internal/controls/text-view/text-view-word-group-processor.h b/base/dali-toolkit/internal/controls/text-view/text-view-word-group-processor.h
deleted file mode 100644 (file)
index f790d3d..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_TEXT_VIEW_WORD_GROUP_PROCESSOR_H__
-#define __DALI_TOOLKIT_INTERNAL_TEXT_VIEW_WORD_GROUP_PROCESSOR_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/text-view/text-view-impl.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace TextViewProcessor
-{
-
-/**
- * Updates the word group layout size info.
- *
- * @param[in,out] wordGroupLayoutInfo The word group layout info.
- */
-void UpdateGroupLayoutInfo( TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo );
-
-/**
- * Creates a data structure with info to layout the group of words, and data structures with useful info to modify the layout data structure if characters are added or removed.
- *
- * @param[in] wordGroup The styled group of words.
- * @param[in,out] textLayoutInfo Layout info for the whole text. This function uses it to check if the words should be split into individual characters. It also modifies which is the maximum word width.
- * @param[out] wordGroupLayoutInfo Layout info for the whole group of words.
- */
-void CreateWordGroupInfo( const MarkupProcessor::StyledTextArray& wordGroup,
-                          TextViewProcessor::TextLayoutInfo& textLayoutInfo,
-                          TextViewProcessor::WordGroupLayoutInfo& wordGroupLayoutInfo );
-
-/**
- * Removes a given number of words from the given group of words.
- *
- * @pre \e wordIndex and \e wordIndex + \e numberOfWords can't exceed the bounds of the group.
- *
- * @param[in] wordIndex Index to the word within the group of words with the starting position to be deleted.
- * @param[in] numberOfWords The number of words to be deleted.
- * @param[in,out] wordGroupLayoutInfo The input is the layout info of the group of words. The output is the layout info of the group of words without the removed words.
- */
-void RemoveWordsFromWordGroup( std::size_t wordIndex,
-                               std::size_t numberOfWords,
-                               WordGroupLayoutInfo& wordGroupLayoutInfo );
-
-/**
- * @param[in,out] relayoutData Natural size (metrics), layout, text-actor info.
- * @param[in] numberOfCharacters The number of characters to be deleted.
- * @param[out] mergeWords Whether words need to be merged after removing characters.
- * @param[out] mergeLines Whether current line need to be merged with the next one.
- * @param[in,out] textInfoIndicesBegin Indices to the line, word and characters from where to delete characters. It returns from where words need to be removed.
- * @param[out] textInfoIndicesEnd If lines or words need to be merged it returns info to delete them (If a word is merged, it has to be removed. Equal for lines).
- * @param[out] textInfoMergeIndicesBegin The indices to the first part of the line, group and word to be merged.
- * @param[out] textInfoMergeIndicesEnd The indices to the last part of the line, group and word to be merged.
- * @param[in,out] groupLayout Layout info of the group of words where the word is located.
- * @param[out] removedTextActorsFromFirstWord Stores removed text-actors of the word pointed by the 'begin' index.
- * @param[out] removedTextActorsFromLastWord Stores removed text-actors of the word pointed by the 'end' index.
- */
-void RemoveCharactersFromWordGroupInfo( TextView::RelayoutData& relayoutData,
-                                        std::size_t numberOfCharacters,
-                                        bool& mergeWords,
-                                        bool& mergeLines,
-                                        TextViewProcessor::TextInfoIndices& textInfoIndicesBegin,
-                                        TextViewProcessor::TextInfoIndices& textInfoIndicesEnd,
-                                        TextViewProcessor::TextInfoIndices& textInfoMergeIndicesBegin,
-                                        TextViewProcessor::TextInfoIndices& textInfoMergeIndicesEnd,
-                                        TextViewProcessor::WordGroupLayoutInfo& groupLayout,
-                                        std::vector<TextActor>& removedTextActorsFromFirstWord,
-                                        std::vector<TextActor>& removedTextActorsFromLastWord );
-
-/**
- * Splits a group of words in two.
- *
- * @note It deletes whatever there is in the last part of the group of words.
- *
- * @param[in] indices Index to the word within the group of words and index to the character within the word where to split the word.
- * @param[in,out] firstWordGroupLayoutInfo The input is the layout info of the given group of words. The output is the first part of the input group of words (from the word \e 0 to the word \e wordPosition).
- * @param[in,out] lastWordGroupLayoutInfo Layout info of the last part of the given group of words ( from the word \e wordPosition + \e 1 to the end of the group of words).
- */
-void SplitWordGroup( const TextInfoIndices& indices,
-                     WordGroupLayoutInfo& firstWordGroupLayoutInfo,
-                     WordGroupLayoutInfo& lastWordGroupLayoutInfo );
-
-/**
- * Merges the two given groups of words by adding words of the last group of words to the firs one.
- *
- * @note Does nothing if last part of the group of words is empty.
- * @note If the first part of the group of words is empty it just copy the last part to it.
- * @note It assets if groups of words contain text with different direction. (Left to Right and Right to Left text)
- * @note it asserts if the last word of the first group is a line separator (new line character)
- *
- * @param[in,out] firstWordGroupLayoutInfo The input is the layout info of the first group of words. The output is the layout info of the merged group of words.
- * @param[in] lastWordGroupLayoutInfo Layout info of the last group of words.
- *
- */
-void MergeWordGroup( WordGroupLayoutInfo& firstWordGroupLayoutInfo,
-                     const WordGroupLayoutInfo& lastWordGroupLayoutInfo );
-
-/**
- * Collects text-actors from the given line, within the given indices, and stores them into the text-actor vector.
- *
- * @param[out] textActors Stores the text-actors of the given line.
- * @param[in] line The line with groups of words.
- * @param[in] groupIndexBegin Index to the first group of words.
- * @param[in] groupIndexEnd Index to the last group of words.
- */
-void CollectTextActorsFromGroups( std::vector<TextActor>& textActors, const LineLayoutInfo& line, std::size_t groupIndexBegin, std::size_t groupIndexEnd );
-
-} //namespace TextViewProcessor
-
-} //namespace Internal
-
-} //namespace Toolkit
-
-} //namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_TEXT_VIEW_WORD_GROUP_PROCESSOR_H__
index 6e3f8cc..b1426c9 100644 (file)
@@ -49,7 +49,7 @@ const std::string EMOJI_FONT_NAME( "SamsungEmoji" ); // Emoticons font family na
 void UpdateLayoutInfo( WordLayoutInfo& wordLayout )
 {
   // Initialize layout info for the whole word.
-  wordLayout.mSize = Size();
+  wordLayout.mSize = Size::ZERO;
   wordLayout.mAscender = 0.f;
 
   // Traverse the character layout info to update the word layout.
@@ -80,6 +80,10 @@ WordLayoutInfo::WordLayoutInfo()
 {
 }
 
+WordLayoutInfo::~WordLayoutInfo()
+{
+}
+
 WordLayoutInfo::WordLayoutInfo( const WordLayoutInfo& word )
 : mSize( word.mSize ),
   mAscender( word.mAscender ),
@@ -99,7 +103,7 @@ WordLayoutInfo& WordLayoutInfo::operator=( const WordLayoutInfo& word )
 }
 
 void CreateWordTextInfo( const MarkupProcessor::StyledTextArray& word,
-                         TextViewProcessor::WordLayoutInfo& wordLayoutInfo )
+                         WordLayoutInfo& wordLayoutInfo )
 {
   DALI_LOG_INFO( gTextViewProcessorLogFilter, Debug::General, "-->TextViewProcessor::CreateWordTextInfo\n" );
   // Split in characters.
@@ -110,7 +114,7 @@ void CreateWordTextInfo( const MarkupProcessor::StyledTextArray& word,
     const std::size_t length = styledText.mText.GetLength();
 
     // It could be a group of characters.
-    for( std::size_t index = 0; index < length; ++index )
+    for( std::size_t index = 0u; index < length; ++index )
     {
       MarkupProcessor::StyledText styledCharacter;
       styledCharacter.mStyle = styledText.mStyle;
@@ -133,32 +137,33 @@ void CreateWordTextInfo( const MarkupProcessor::StyledTextArray& word,
         ChooseFontFamilyName( styledCharacter );
       }
 
+      // Gets the metrics of the font.
       const Font font = Font::New( FontParameters( styledCharacter.mStyle.GetFontName(), styledCharacter.mStyle.GetFontStyle(), styledCharacter.mStyle.GetFontPointSize() ) );
       const Font::Metrics metrics = font.GetMetrics( character );
       const float ascender = font.GetAscender();
 
-      // Fill Natural size info for current character.
-      characterLayoutInfo.mHeight = font.GetLineHeight();
-      characterLayoutInfo.mAdvance = metrics.GetAdvance();
+      // The font line's height is used as character's height.
+      characterLayoutInfo.mSize.height = font.GetLineHeight();
+
+      // The character's advance is used as charcter's width.
+      characterLayoutInfo.mSize.width = metrics.GetAdvance();
+
+      // The ascender and bearing are used to position correctly glyphs of different font sizes.
+      characterLayoutInfo.mAscender = ascender;
       characterLayoutInfo.mBearing = metrics.GetBearing();
 
       if( character.IsNewLine() && !characterLayoutInfo.mIsColorGlyph )
       {
-        // A new line character doesn't have any width.
+        // A new paragraph character doesn't have any width.
         characterLayoutInfo.mSize.width = 0.f;
       }
-      else
-      {
-        // Uses advance as width.
-        characterLayoutInfo.mSize.width = characterLayoutInfo.mAdvance;
-      }
-      characterLayoutInfo.mSize.height = characterLayoutInfo.mHeight;
-      characterLayoutInfo.mAscender = ascender;
 
+      // Set's the underline thickness and position.
+      // Both thickness and position includes the vertical pad adjust used in effects like glow or shadow.
       if( styledCharacter.mStyle.IsUnderlineEnabled() )
       {
-        characterLayoutInfo.mUnderlineThickness = font.GetUnderlineThickness(); // Both thickness and position includes the
-        characterLayoutInfo.mUnderlinePosition = font.GetUnderlinePosition();   // vertical pad adjust used in effects like glow or shadow.
+        characterLayoutInfo.mUnderlineThickness = font.GetUnderlineThickness();
+        characterLayoutInfo.mUnderlinePosition = font.GetUnderlinePosition();
       }
 
       // stores the styled text.
@@ -178,57 +183,57 @@ void CreateWordTextInfo( const MarkupProcessor::StyledTextArray& word,
 void RemoveCharactersFromWordInfo( TextView::RelayoutData& relayoutData,
                                    const std::size_t numberOfCharacters,
                                    bool& mergeWords,
-                                   bool& mergeLines,
-                                   TextViewProcessor::TextInfoIndices& textInfoIndicesBegin,
-                                   TextViewProcessor::TextInfoIndices& textInfoIndicesEnd,
-                                   TextViewProcessor::TextInfoIndices& textInfoMergeIndicesBegin,
-                                   TextViewProcessor::TextInfoIndices& textInfoMergeIndicesEnd,
-                                   TextViewProcessor::WordGroupLayoutInfo& groupLayout,
+                                   bool& mergeParagraphs,
+                                   TextInfoIndices& textInfoIndicesBegin,
+                                   TextInfoIndices& textInfoIndicesEnd,
+                                   TextInfoIndices& textInfoMergeIndicesBegin,
+                                   TextInfoIndices& textInfoMergeIndicesEnd,
+                                   ParagraphLayoutInfo& paragraphLayout,
                                    std::vector<TextActor>& removedTextActors )
 {
-  const TextViewProcessor::TextLayoutInfo& textLayoutInfo = relayoutData.mTextLayoutInfo;
+  const TextLayoutInfo& textLayoutInfo = relayoutData.mTextLayoutInfo;
 
   // Get the word.
-  WordLayoutInfo& wordLayout( *( groupLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex ) );
+  WordLayoutInfo& wordLayout( *( paragraphLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex ) );
 
-  if( TextViewProcessor::LineSeparator == wordLayout.mType )
+  if( ParagraphSeparator == wordLayout.mType )
   {
-    // If the word is a line separator and there is more lines, then current line and the line after need to be merged.
-    if( textInfoIndicesBegin.mLineIndex + 1 < textLayoutInfo.mLinesLayoutInfo.size() )
+    // If the word is a paragraph separator and there is more paragraphs, then current paragraph and the paragraph after need to be merged.
+    if( textInfoIndicesBegin.mParagraphIndex + 1u < textLayoutInfo.mParagraphsLayoutInfo.size() )
     {
-      // current line is not the last one.
+      // current paragraph is not the last one.
 
-      // Update indices to merge lines.
-      textInfoMergeIndicesBegin.mLineIndex = textInfoIndicesBegin.mLineIndex;
-      textInfoMergeIndicesEnd.mLineIndex = textInfoIndicesBegin.mLineIndex + 1;
+      // Update indices to merge paragraphs.
+      textInfoMergeIndicesBegin.mParagraphIndex = textInfoIndicesBegin.mParagraphIndex;
+      textInfoMergeIndicesEnd.mParagraphIndex = textInfoIndicesBegin.mParagraphIndex + 1u;
 
-      mergeLines = true;
+      mergeParagraphs = true;
 
-      ++textInfoIndicesBegin.mLineIndex; // increase both indices,
-      textInfoIndicesEnd.mLineIndex +=2; // will delete last line.
+      ++textInfoIndicesBegin.mParagraphIndex; // increase both indices,
+      textInfoIndicesEnd.mParagraphIndex += 2u; // will delete last paragraph.
     }
 
-    ++textInfoIndicesEnd.mWordIndex; //will delete the line separator;
+    ++textInfoIndicesEnd.mWordIndex; //will delete the paragraph separator;
   }
   else if( WordSeparator == wordLayout.mType )
   {
     // If the word is a word separator. Check if the word before and the word after can be merged.
 
-    if( ( 0 < textInfoIndicesBegin.mWordIndex ) && ( groupLayout.mWordsLayoutInfo.size() > textInfoIndicesBegin.mWordIndex + 1 ) )
+    if( ( 0u < textInfoIndicesBegin.mWordIndex ) && ( paragraphLayout.mWordsLayoutInfo.size() > textInfoIndicesBegin.mWordIndex + 1u ) )
     {
-      const WordLayoutInfo& wordLayoutBefore( *( groupLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex - 1 ) );
-      const WordLayoutInfo& wordLayoutAfter( *( groupLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex + 1 ) );
+      const WordLayoutInfo& wordLayoutBefore( *( paragraphLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex - 1u ) );
+      const WordLayoutInfo& wordLayoutAfter( *( paragraphLayout.mWordsLayoutInfo.begin() + textInfoIndicesBegin.mWordIndex + 1u ) );
 
       if( ( NoSeparator == wordLayoutBefore.mType ) && ( NoSeparator == wordLayoutAfter.mType ) )
       {
-        // This word is a word separator (white space) and is not the first word of the group nor the last one.
+        // This word is a word separator (white space) and is not the first word of the paragraph nor the last one.
         mergeWords = true;
 
         // Set indices to merge the words.
-        textInfoMergeIndicesBegin.mWordIndex = textInfoIndicesBegin.mWordIndex - 1; // word before word separator.
-        textInfoMergeIndicesEnd.mWordIndex = textInfoIndicesBegin.mWordIndex + 1; // word after word separator.
+        textInfoMergeIndicesBegin.mWordIndex = textInfoIndicesBegin.mWordIndex - 1u; // word before word separator.
+        textInfoMergeIndicesEnd.mWordIndex = textInfoIndicesBegin.mWordIndex + 1u; // word after word separator.
 
-        textInfoIndicesEnd.mWordIndex += 2; // will delete the word separator and the merged word.
+        textInfoIndicesEnd.mWordIndex += 2u; // will delete the word separator and the merged word.
       }
       else
       {
@@ -264,7 +269,7 @@ void RemoveCharactersFromWord( const std::size_t position,
   // Removes a given number of characters from the given word starting from the 'position' index.
 
   // Early return.
-  if( 0 == numberOfCharacters )
+  if( 0u == numberOfCharacters )
   {
     // nothing to do if the number of characters is zero.
 
@@ -286,7 +291,7 @@ void SplitWord( const std::size_t position,
   // It moves characters from the first part of the word to the last one.
 
   // early returns
-  if( 0 == position )
+  if( 0u == position )
   {
     // the whole word goes to the last part of the word.
     lastWordLayoutInfo = firstWordLayoutInfo;
@@ -348,8 +353,8 @@ void MergeWord( WordLayoutInfo& firstWordLayoutInfo,
 
   if( ( NoSeparator != firstWordLayoutInfo.mType ) || ( NoSeparator != lastWordLayoutInfo.mType ) )
   {
-    // Do not merge white spaces or new line characters.
-    DALI_ASSERT_ALWAYS( !"TextViewProcessor::MergeWord(). ERROR: White spaces or new line characters can't be merged with other words." );
+    // Do not merge white spaces or new paragraph characters.
+    DALI_ASSERT_ALWAYS( !"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words." );
   }
 
   // Merge layout info
@@ -380,7 +385,7 @@ CharacterLayoutInfo GetLastCharacterLayoutInfo( const WordLayoutInfo& wordLayout
 
   if( !wordLayoutInfo.mCharactersLayoutInfo.empty() )
   {
-    layoutInfo = *( wordLayoutInfo.mCharactersLayoutInfo.end() - 1 );
+    layoutInfo = *( wordLayoutInfo.mCharactersLayoutInfo.end() - 1u );
   }
 
   return layoutInfo;
@@ -406,9 +411,9 @@ void CollectTextActors( std::vector<TextActor>& textActors, const WordLayoutInfo
   }
 }
 
-void CollectTextActorsFromWords( std::vector<TextActor>& textActors, const WordGroupLayoutInfo& group, const std::size_t wordIndexBegin, const std::size_t wordIndexEnd )
+void CollectTextActorsFromWords( std::vector<TextActor>& textActors, const ParagraphLayoutInfo& paragraph, const std::size_t wordIndexBegin, const std::size_t wordIndexEnd )
 {
-  for( WordLayoutInfoContainer::const_iterator wordIt = group.mWordsLayoutInfo.begin() + wordIndexBegin, wordEndIt = group.mWordsLayoutInfo.begin() + wordIndexEnd;
+  for( WordLayoutInfoContainer::const_iterator wordIt = paragraph.mWordsLayoutInfo.begin() + wordIndexBegin, wordEndIt = paragraph.mWordsLayoutInfo.begin() + wordIndexEnd;
        wordIt != wordEndIt;
        ++wordIt )
   {
index a9ef345..7b2845c 100644 (file)
@@ -40,7 +40,7 @@ namespace TextViewProcessor
  * @param[out] wordLayoutInfo Layout info for all characters of the word.
  */
 void CreateWordTextInfo( const MarkupProcessor::StyledTextArray& word,
-                         TextViewProcessor::WordLayoutInfo& wordLayoutInfo );
+                         WordLayoutInfo& wordLayoutInfo );
 
 /**
  * Removes a given number of characters from the given word.
@@ -48,28 +48,28 @@ void CreateWordTextInfo( const MarkupProcessor::StyledTextArray& word,
  * It calls the RemoveCharactersFromWord() function to remove characters from the word.
  *
  * If the word is a white space \e mergeWords will return \e true and \e textInfoMergeIndicesBegin and \e textInfoMergeIndicesEnd will be set to merge the two adjacent words.
- * If the word is a new line character \e mergeLines will return \e true and \e textInfoMergeIndicesBegin and \e textInfoMergeIndicesEnd will be set to merge the two lines.
+ * If the word is a new paragraph character \e mergeParagraphs will return \e true and \e textInfoMergeIndicesBegin and \e textInfoMergeIndicesEnd will be set to merge the two paragraphs.
  *
  * @param[in,out] relayoutData Natural size (metrics), layout, text-actor info.
  * @param[in] numberOfCharacters The number of characters to be deleted.
  * @param[out] mergeWords Whether adjacent words need to be merged.
- * @param[out] mergeLines Whether current line need to be merged with the next one.
- * @param[in,out] textInfoIndicesBegin Indices to the line, word and characters from where to delete characters. It returns from where words need to be removed.
- * @param[out] textInfoIndicesEnd If lines or words need to be merged it returns info to delete them (If a word is merged, it has to be removed. Equal for lines).
- * @param[out] textInfoMergeIndicesBegin The indices to the first part of the line, group and word to be merged.
- * @param[out] textInfoMergeIndicesEnd The indices to the last part of the line, group and word to be merged.
- * @param[in,out] groupLayout Layout info of the group of words where the word is located.
+ * @param[out] mergeParagraphs Whether current paragraph need to be merged with the next one.
+ * @param[in,out] textInfoIndicesBegin Indices to the paragraph, word and characters from where to delete characters. It returns from where words need to be removed.
+ * @param[out] textInfoIndicesEnd If paragraphs or words need to be merged it returns info to delete them (If a word is merged, it has to be removed. Equal for paragraphs).
+ * @param[out] textInfoMergeIndicesBegin The indices to the first part of the paragraph and word to be merged.
+ * @param[out] textInfoMergeIndicesEnd The indices to the last part of the paragraph and word to be merged.
+ * @param[in,out] paragraphLayout Layout info of the paragraph where the word is located.
  * @param[out] removedTextActors Stores handles of temoved text-actors.
  */
 void RemoveCharactersFromWordInfo( TextView::RelayoutData& relayoutData,
                                    std::size_t numberOfCharacters,
                                    bool& mergeWords,
-                                   bool& mergeLines,
-                                   TextViewProcessor::TextInfoIndices& textInfoIndicesBegin,
-                                   TextViewProcessor::TextInfoIndices& textInfoIndicesEnd,
-                                   TextViewProcessor::TextInfoIndices& textInfoMergeIndicesBegin,
-                                   TextViewProcessor::TextInfoIndices& textInfoMergeIndicesEnd,
-                                   TextViewProcessor::WordGroupLayoutInfo& groupLayout,
+                                   bool& mergeParagraphs,
+                                   TextInfoIndices& textInfoIndicesBegin,
+                                   TextInfoIndices& textInfoIndicesEnd,
+                                   TextInfoIndices& textInfoMergeIndicesBegin,
+                                   TextInfoIndices& textInfoMergeIndicesEnd,
+                                   ParagraphLayoutInfo& paragraphLayout,
                                    std::vector<TextActor>& removedTextActors );
 /**
  * Removes a given number of characters from the given word.
@@ -106,7 +106,7 @@ void SplitWord( std::size_t position,
  *
  * @note Does nothing if last part of the word is empty.
  * @note If the first part of the word is empty it just copy the last part to it.
- * @note It asserts if the first or the last word is a word separator (white space) or a line separator (new line character)
+ * @note It asserts if the first or the last word is a word separator (white space) or a paragraph separator (new paragraph character)
  *
  * @param[in,out] firstWordLayoutInfo The input is the layout info of the first word. The output is the layout info of the merged word.
  * @param[in] lastWordLayoutInfo Layout info of the last word.
@@ -142,14 +142,14 @@ CharacterLayoutInfo GetLastCharacterLayoutInfo( const WordLayoutInfo& wordLayout
 void CollectTextActors( std::vector<TextActor>& textActors, const WordLayoutInfo& word, std::size_t characterIndexBegin, std::size_t characterIndexEnd );
 
 /**
- * Collects text-actors from the given group of words, within the given indices, and stores them into the text-actor vector.
+ * Collects text-actors from the given paragraph, within the given indices, and stores them into the text-actor vector.
  *
- * @param[out] textActors Stores the text-actors of the given group of words.
- * @param[in] group The group of words.
+ * @param[out] textActors Stores the text-actors of the given paragraph.
+ * @param[in] paragraph The paragraph with the words.
  * @param[in] wordIndexBegin Index to the first word.
  * @param[in] wordIndexEnd Index to the last word.
  */
-void CollectTextActorsFromWords( std::vector<TextActor>& textActors, const WordGroupLayoutInfo& group, std::size_t wordIndexBegin, std::size_t wordIndexEnd );
+void CollectTextActorsFromWords( std::vector<TextActor>& textActors, const ParagraphLayoutInfo& paragraph, std::size_t wordIndexBegin, std::size_t wordIndexEnd );
 
 } //namespace TextViewProcessor
 
index 7b00a3d..4fa6bf8 100644 (file)
@@ -49,12 +49,11 @@ toolkit_base_src_files = \
    $(toolkit_base_src_dir)/controls/text-view/text-processor.cpp   \
    $(toolkit_base_src_dir)/controls/text-view/text-view-impl.cpp   \
    $(toolkit_base_src_dir)/controls/text-view/text-view-character-processor.cpp  \
-   $(toolkit_base_src_dir)/controls/text-view/text-view-line-processor.cpp  \
+   $(toolkit_base_src_dir)/controls/text-view/text-view-paragraph-processor.cpp  \
    $(toolkit_base_src_dir)/controls/text-view/text-view-processor.cpp  \
    $(toolkit_base_src_dir)/controls/text-view/text-view-processor-dbg.cpp  \
    $(toolkit_base_src_dir)/controls/text-view/text-view-processor-helper-functions.cpp  \
    $(toolkit_base_src_dir)/controls/text-view/text-view-word-processor.cpp  \
-   $(toolkit_base_src_dir)/controls/text-view/text-view-word-group-processor.cpp  \
    $(toolkit_base_src_dir)/factory/localized-control-factory-impl.cpp \
    $(toolkit_base_src_dir)/focus-manager/focus-manager-impl.cpp \
    $(toolkit_base_src_dir)/focus-manager/keyboard-focus-manager-impl.cpp \
index da7863c..32aeb7a 100644 (file)
@@ -20,7 +20,6 @@
 
 namespace
 {
-  const float DEFAULT_COLOR_VISIBILITY_REMOVE_TIME = 0.5f; // 0.5 second
 
   // Functors which wrap constraint functions with stored item IDs
   struct WrappedQuaternionConstraint
@@ -392,9 +391,6 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d
 
       constraint.SetApplyTime(durationSeconds);
       constraint.SetAlphaFunction(mAlphaFunction);
-
-      // Release color constraints slowly; this allows ItemView to co-exist with ImageActor fade-in
-      constraint.SetRemoveTime(DEFAULT_COLOR_VISIBILITY_REMOVE_TIME);
       constraint.SetRemoveAction(Dali::Constraint::Discard);
 
       actor.ApplyConstraint(constraint);
@@ -415,7 +411,6 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d
       constraint.SetAlphaFunction(mAlphaFunction);
 
       // Release visibility constraints the same time as the color constraint
-      constraint.SetRemoveTime(DEFAULT_COLOR_VISIBILITY_REMOVE_TIME);
       constraint.SetRemoveAction(Dali::Constraint::Discard);
 
       actor.ApplyConstraint(constraint);
index 2221ebd..f8fefc0 100644 (file)
@@ -34,6 +34,7 @@ TextView::CharacterLayoutInfo::CharacterLayoutInfo()
 : mSize(),
   mPosition(),
   mIsNewLineChar( false ),
+  mIsNewParagraphChar( false ),
   mIsRightToLeftCharacter( false ),
   mIsVisible( true ),
   mDescender()
@@ -47,7 +48,8 @@ TextView::CharacterLayoutInfo::~CharacterLayoutInfo()
 TextView::CharacterLayoutInfo::CharacterLayoutInfo( const TextView::CharacterLayoutInfo& characterLayoutInfo )
 : mSize( characterLayoutInfo.mSize ),
   mPosition( characterLayoutInfo.mPosition ),
-  mIsNewLineChar( characterLayoutInfo.mIsNewLineChar ),
+  mIsNewLineChar( characterLayoutInfo.mIsNewParagraphChar ),
+  mIsNewParagraphChar( characterLayoutInfo.mIsNewParagraphChar ),
   mIsRightToLeftCharacter( characterLayoutInfo.mIsRightToLeftCharacter ),
   mIsVisible( characterLayoutInfo.mIsVisible ),
   mDescender( characterLayoutInfo.mDescender )
@@ -58,7 +60,8 @@ TextView::CharacterLayoutInfo& TextView::CharacterLayoutInfo::operator=( const T
 {
   mSize = characterLayoutInfo.mSize;
   mPosition = characterLayoutInfo.mPosition;
-  mIsNewLineChar = characterLayoutInfo.mIsNewLineChar;
+  mIsNewLineChar = characterLayoutInfo.mIsNewParagraphChar;
+  mIsNewParagraphChar = characterLayoutInfo.mIsNewParagraphChar;
   mIsRightToLeftCharacter = characterLayoutInfo.mIsRightToLeftCharacter;
   mIsVisible = characterLayoutInfo.mIsVisible;
   mDescender = characterLayoutInfo.mDescender;
@@ -68,13 +71,14 @@ TextView::CharacterLayoutInfo& TextView::CharacterLayoutInfo::operator=( const T
 
 TextView::CharacterLayoutInfo::CharacterLayoutInfo( const Size& size,
                                                     const Vector3& position,
-                                                    bool isNewLineChar,
+                                                    bool isNewParagraphChar,
                                                     bool isRightToLeftCharacter,
                                                     bool isVisible,
                                                     float descender )
 : mSize( size ),
   mPosition( position ),
-  mIsNewLineChar( isNewLineChar ),
+  mIsNewLineChar( isNewParagraphChar ),
+  mIsNewParagraphChar( isNewParagraphChar ),
   mIsRightToLeftCharacter( isRightToLeftCharacter ),
   mIsVisible( isVisible ),
   mDescender( descender )
index f589d2b..d478b3b 100644 (file)
@@ -96,21 +96,22 @@ public:
      *
      * @param[in] size of the character.
      * @param[in] position of the character.
-     * @param[in] isNewLineChar Whether the character is a new line character.
+     * @param[in] isNewParagraphChar Whether the character is a new paragraph character.
      * @param[in] isRightToLeftCharacter Whether is a right to left character.
      * @param[in] visible Whether is visible.
      * @param[in] descender of the character (distance from the base line to the bottom of the character.)
      */
     CharacterLayoutInfo( const Size& size,
                          const Vector3& position,
-                         bool isNewLineChar,
+                         bool isNewParagraphChar,
                          bool isRightToLeftCharacter,
                          bool visible,
                          float descender );
 
-    Size    mSize;                     ///< Size of the group of characters.
+    Size    mSize;                     ///< Size of the character.
     Vector3 mPosition;                 ///< Position of the character within the text view.
-    bool    mIsNewLineChar:1;          ///< Whether this character represent a new line.
+    bool    mIsNewLineChar:1;          ///< @deprecated. Use mIsNewParagraphChar instead.
+    bool    mIsNewParagraphChar:1;     ///< Whether this character represent a new paragraph.
     bool    mIsRightToLeftCharacter:1; ///< Whether it's a right-to-left character.
     bool    mIsVisible:1;              ///< Whether this character is visible or not.
     float   mDescender;                ///< The character's descender which is the distance from the baseline to the bottom of the character
@@ -119,13 +120,13 @@ public:
   typedef std::vector<CharacterLayoutInfo> CharacterLayoutInfoContainer; ///< Container of layout info per character.
 
   /**
-   * @brief Stores some info about a laid-out line.
+   * @brief Stores some info about a line.
    */
   struct LineLayoutInfo
   {
-    std::size_t mCharacterGlobalIndex; ///< Global index within the whole text of the first character of current laid-out line.
-    Size        mSize;                 ///< Size of the current laid-out line.
-    float       mAscender;             ///< The max ascender of the current laid-out line.
+    std::size_t mCharacterGlobalIndex; ///< Global index within the whole text of the first character of current line.
+    Size        mSize;                 ///< Size of the current line.
+    float       mAscender;             ///< The max ascender of the current line.
   };
 
   typedef std::vector<LineLayoutInfo> LineLayoutInfoContainer; ///< Container of layout info per line.
@@ -158,7 +159,7 @@ public:
     TextLayoutInfo& operator=( const TextLayoutInfo& textLayoutInfo );
 
     CharacterLayoutInfoContainer mCharacterLayoutInfoTable;    ///< The table of character's positions and sizes sorted by the character's visual index.
-    LineLayoutInfoContainer      mLines;                       ///< For each laid-out line, it stores an index to the first character of the line.
+    LineLayoutInfoContainer      mLines;                       ///< For each line, it stores an index to the first character of the line.
     std::vector<int>             mCharacterLogicalToVisualMap; ///< The map to store the character's logical (input) index according to its visual (reordered) index.
     std::vector<int>             mCharacterVisualToLogicalMap; ///< The map to store the character's visual (reordered) index according to its logical (input) index.
     Size                         mTextSize;                    ///< Text size after relayout.
@@ -199,38 +200,38 @@ public:
   };
 
   /**
-   * @brief Define how to wrap the text in lines.
+   * @brief Define how to wrap the text's paragraphs in lines.
    *
-   * \e SplitByNewLineChar will wrap the text in lines when a '\\n' character or a \<br /\> is found.
+   * \e SplitByNewLineChar will wrap the text's paragraphs in lines when a '\\n' character or a \<br /\> is found.
    * \e SplitByWord has effect only when TextView size is assigned.
-   * It will wrap the text in lines when a '\\n' character or a \<br /\> is found or if a line exceeds the TextView's boundary. This option won't split a word in two.
+   * It will wrap the text's paragraphs in lines when a '\\n' character or a \<br /\> is found or if a paragraph exceeds the TextView's boundary. This option won't split a word in two.
    * \e SplitByChar has effect only when TextView size is assigned.
-   * It will wrap the text in lines when a '\\n' character or a \<br /\> is found or if a line exceeds the TextView's boundary. This option might split a word in two.
+   * It will wrap the text's paragraphs in lines when a '\\n' character or a \<br /\> is found or if a paragraph exceeds the TextView's boundary. This option might split a word in two.
    * The default value is \e SplitByNewLineChar.
    */
   enum MultilinePolicy
   {
-    SplitByNewLineChar, ///< Text lines will wrap when '\\n' character is found.
-    SplitByWord,        ///< Text lines will wrap by word or if '\\n' character is found. It has effect only when TextView size is assigned.
-    SplitByChar         ///< Text lines will wrap by char or if '\\n' character is found. It has effect only when TextView size is assigned.
+    SplitByNewLineChar, ///< Text's paragraphs will wrap in lines when '\\n' character is found.
+    SplitByWord,        ///< Text's paragraphs will wrap in lines by word or if '\\n' character is found. It has effect only when TextView size is assigned.
+    SplitByChar         ///< Text's paragraphs will wrap in lines by char or if '\\n' character is found. It has effect only when TextView size is assigned.
   };
 
   /**
-   * @brief Define how to display the text when it doesn't fit inside the TextView after the line wrap.
+   * @brief Define how to display the lines when they doesn't fit inside the TextView after the text's paragraphs are wrapped in lines.
    *
    * The default value is \e Original.
    */
   enum ExceedPolicy
   {
-    Original,         ///< Will display the text in its original size. If a line, a word or a character is bigger than the TextView size it may exceed its boundary.
-    Fade,             ///< Will display the text in its original size. It won't display the text which exceeds the TextView boundary. It fades the text out.
-    Split,            ///< Will split the text in a new line.
-    ShrinkToFit,      ///< Will shrink the text to fit the TextView boundary.
-    EllipsizeEnd      ///< Will ellipsize the text by the end.
+    Original,         ///< Will display the lines in their original size. If a line, a word or a character is bigger than the TextView size it may exceed its boundary.
+    Fade,             ///< Will display the lines in their original size. It won't display the part of the line which exceeds the TextView boundary. It fades the text out.
+    Split,            ///< Will split the lines in a new line(s).
+    ShrinkToFit,      ///< Will shrink the lines to fit the TextView boundary.
+    EllipsizeEnd      ///< Will ellipsize the lines by the end.
   };
 
   /**
-   * @brief Define how to justify lines inside the text area.
+   * @brief Define how to justify lines inside the text's boundary.
    *
    * The default value is \e Left.
    */
@@ -418,7 +419,7 @@ public:
   Alignment::Type GetTextAlignment() const;
 
   /**
-   * @brief Sets how to wrap the text in lines policy.
+   * @brief Sets how to split the paragraphs into lines.
    *
    * @param policy The multi-line policy. \e SplitByNewLineChar is set by default.
    */
@@ -460,7 +461,7 @@ public:
   ExceedPolicy GetHeightExceedPolicy() const;
 
   /**
-   * @brief Sets how to justify lines inside the text area.
+   * @brief Sets how to justify lines inside the text's boundary.
    *
    * @param justification The line justification. Left is set by default.
    */
index 23183a8..1ff34c2 100644 (file)
@@ -38,18 +38,21 @@ CLEANFILES = \
 COVERAGE_DIR=.cov
 COVERAGE_OUTPUT_DIR=doc/coverage
 
+# From lcov version 1.10 onwards, branch coverage is off by default and earlier versions do not support the rc option
+LCOV_OPTS=`if [ \`printf "\\\`lcov --version | cut -d' ' -f4\\\`\n1.10\n" | sort -V | head -n 1\` = 1.10 ] ; then echo "--rc lcov_branch_coverage=1" ; fi`
+
 cov_data:
        @test -z $(COVERAGE_DIR) || mkdir -p $(COVERAGE_DIR)
        @rm -f $(COVERAGE_DIR)/*
        @cp dali-toolkit/.libs/*.gcda dali-toolkit/.libs/*.gcno  $(COVERAGE_DIR)
        @for i in `find $(COVERAGE_DIR) -name "libdali_toolkit_la-*.gcda" -o -name "libdali_toolkit_la-*.gcno"` ;\
                do mv $$i `echo $$i | sed s/libdali_toolkit_la-//` ; echo $$i ; done
-       @cd $(COVERAGE_DIR) ; lcov --base-directory . --directory . -c -o dali.info
-       @cd $(COVERAGE_DIR) ; lcov --remove dali.info "*boost*" "/usr/include/*" "*/dali-env/*" -o dali.info
+       @cd $(COVERAGE_DIR) ; lcov $(LCOV_OPTS) --base-directory . --directory . -c -o dali.info
+       @cd $(COVERAGE_DIR) ; lcov $(LCOV_OPTS) --remove dali.info "*boost*" "/usr/include/*" "*/dali-env/*" -o dali.info
        @test -z $(COVERAGE_OUTPUT_DIR) || mkdir -p $(COVERAGE_OUTPUT_DIR)
 
 coverage: cov_data
-       @genhtml -o $(COVERAGE_OUTPUT_DIR) $(COVERAGE_DIR)/dali.info
+       @genhtml $(LCOV_OPTS) -o $(COVERAGE_OUTPUT_DIR) $(COVERAGE_DIR)/dali.info
 
 reset_coverage:
        @lcov -z --directory `pwd`
index 8cb5200..61060bf 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 8;
+const unsigned int TOOLKIT_MICRO_VERSION = 9;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index aae4ffd..d20e41c 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.0.8
+Version:    1.0.9
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0