[ATSPI] Update accessibility-test-utils files
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / dali-toolkit-test-utils / toolkit-text-utils.cpp
index 6028e02..64a8473 100755 (executable)
@@ -102,7 +102,9 @@ void CreateTextModel( const std::string& text,
                       ModelPtr& textModel,
                       MetricsPtr& metrics,
                       bool markupProcessorEnabled,
-                      LineWrap::Mode wrapMode )
+                      LineWrap::Mode wrapMode,
+                      bool ellipsisEnabled,
+                      DevelText::EllipsisPosition::Type ellipsisPosition)
 {
   textModel = Model::New(); ///< Pointer to the text's model.
   LogicalModelPtr logicalModel = textModel->mLogicalModel;
@@ -133,6 +135,12 @@ void CreateTextModel( const std::string& text,
     utf8 = reinterpret_cast<const uint8_t*>( text.c_str() );
   }
 
+  //Ellipsis
+  textModel-> mElideEnabled = ellipsisEnabled;
+  textModel-> mVisualModel->SetTextElideEnabled(ellipsisEnabled);
+  textModel-> mEllipsisPosition = ellipsisPosition;
+  textModel-> mVisualModel->SetEllipsisPosition(ellipsisPosition);
+
   // 1) Convert to utf32
   Vector<Character>& utf32Characters = logicalModel->mText;
   utf32Characters.Resize( textSize );
@@ -323,7 +331,6 @@ void CreateTextModel( const std::string& text,
   // Set the layout parameters.
   textModel->mHorizontalAlignment = Text::HorizontalAlignment::BEGIN;
   textModel->mIgnoreSpacesAfterText = true;
-  textModel->mMatchSystemLanguageDirection = false;
   Layout::Parameters layoutParameters( textArea,
                                        textModel );
 
@@ -344,7 +351,8 @@ void CreateTextModel( const std::string& text,
   layoutEngine.LayoutText( layoutParameters,
                            layoutSize,
                            false,
-                           isAutoScroll );
+                           isAutoScroll,
+                           ellipsisPosition);
 
   if( options.align )
   {
@@ -385,7 +393,7 @@ void ConfigureTextLabel( ControllerPtr controller )
   controller->SetTextElideEnabled( true );
 
   // Disable match system language direction
-  controller->SetMatchSystemLanguageDirection(false);
+  controller->SetMatchLayoutDirection(DevelText::MatchLayoutDirection::CONTENTS);
 }
 
 void ConfigureTextField( ControllerPtr controller )
@@ -417,7 +425,7 @@ void ConfigureTextField( ControllerPtr controller )
   controller->SetTextElideEnabled( false );
 
   // Disable match system language direction
-  controller->SetMatchSystemLanguageDirection(false);
+  controller->SetMatchLayoutDirection(DevelText::MatchLayoutDirection::CONTENTS);
 }
 
 void ConfigureTextEditor( ControllerPtr controller )
@@ -449,7 +457,7 @@ void ConfigureTextEditor( ControllerPtr controller )
   controller->SetTextElideEnabled( false );
 
   // Disable match system language direction
-  controller->SetMatchSystemLanguageDirection(false);
+  controller->SetMatchLayoutDirection(DevelText::MatchLayoutDirection::CONTENTS);
 }
 
 } // namespace Text