#include <dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h>
#include <dali-toolkit/devel-api/text/rendering-backend.h>
#include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
+#include "test-text-geometry-utils.h"
using namespace Dali;
using namespace Toolkit;
const char* const PROPERTY_NAME_INPUT_EMBOSS = "inputEmboss";
const char* const PROPERTY_NAME_OUTLINE = "outline";
const char* const PROPERTY_NAME_INPUT_OUTLINE = "inputOutline";
+const char* const PROPERTY_NAME_STRIKETHROUGH = "strikethrough";
+const char* const PROPERTY_NAME_INPUT_STRIKETHROUGH = "inputStrikethrough";
const char* const PROPERTY_NAME_SMOOTH_SCROLL = "smoothScroll";
const char* const PROPERTY_NAME_SMOOTH_SCROLL_DURATION = "smoothScrollDuration";
const char* const PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION = "matchSystemLanguageDirection";
const char* const PROPERTY_NAME_MAX_LENGTH = "maxLength";
const char* const PROPERTY_NAME_FONT_SIZE_SCALE = "fontSizeScale";
+const char* const PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE = "enableFontSizeScale";
const char* const PROPERTY_NAME_GRAB_HANDLE_COLOR = "grabHandleColor";
const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP = "enableGrabHandlePopup";
const char* const PROPERTY_NAME_INPUT_METHOD_SETTINGS = "inputMethodSettings";
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_EMBOSS ) == TextEditor::Property::INPUT_EMBOSS );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_OUTLINE ) == TextEditor::Property::OUTLINE );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_OUTLINE ) == TextEditor::Property::INPUT_OUTLINE );
+ DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_STRIKETHROUGH ) == DevelTextEditor::Property::STRIKETHROUGH );
+ DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_STRIKETHROUGH ) == DevelTextEditor::Property::INPUT_STRIKETHROUGH );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_SMOOTH_SCROLL ) == TextEditor::Property::SMOOTH_SCROLL );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_SMOOTH_SCROLL_DURATION ) == TextEditor::Property::SMOOTH_SCROLL_DURATION );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SCROLL_BAR ) == TextEditor::Property::ENABLE_SCROLL_BAR );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SELECTION ) == TextEditor::Property::ENABLE_SELECTION );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER ) == TextEditor::Property::PLACEHOLDER );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_FONT_SIZE_SCALE ) == DevelTextEditor::Property::FONT_SIZE_SCALE );
+ DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE ) == DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT ) == DevelTextEditor::Property::PLACEHOLDER_TEXT );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR ) == DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SHIFT_SELECTION ) == DevelTextEditor::Property::ENABLE_SHIFT_SELECTION );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP ) == DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_METHOD_SETTINGS ) == DevelTextEditor::Property::INPUT_METHOD_SETTINGS );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_FILTER ) == DevelTextEditor::Property::INPUT_FILTER );
+ DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_STRIKETHROUGH ) == DevelTextEditor::Property::STRIKETHROUGH );
+ DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_STRIKETHROUGH ) == DevelTextEditor::Property::INPUT_STRIKETHROUGH );
END_TEST;
}
DALI_TEST_EQUALS( editor.GetProperty<float>( DevelTextEditor::Property::FONT_SIZE_SCALE ), 2.5f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
editor.SetProperty( DevelTextEditor::Property::FONT_SIZE_SCALE, 1.0f );
+ editor.SetProperty( DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE, false );
+ DALI_TEST_EQUALS( editor.GetProperty<bool>( DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE ), false, TEST_LOCATION );
+ editor.SetProperty( DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE, true );
+
// Reset font style.
fontStyleMapSet.Clear();
fontStyleMapSet.Insert( "weight", "normal" );
inputFilterMapSet.Clear();
editor.SetProperty(DevelTextEditor::Property::INPUT_FILTER, inputFilterMapSet);
+ // Check the strikethrough property
+
+ Property::Map strikethroughMapSet;
+ Property::Map strikethroughMapGet;
+
+ application.SendNotification();
+ application.Render();
+
+ // Check the input strikethrough property
+
+ strikethroughMapSet.Clear();
+ strikethroughMapGet.Clear();
+ strikethroughMapSet.Insert( "enable", true );
+ strikethroughMapSet.Insert( "color", Color::BLUE );
+ strikethroughMapSet.Insert( "height", 2.0f );
+
+ editor.SetProperty( DevelTextEditor::Property::STRIKETHROUGH, strikethroughMapSet );
+
+ application.SendNotification();
+ application.Render();
+
+ strikethroughMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::STRIKETHROUGH );
+
+ DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapSet, strikethroughMapGet ), true, TEST_LOCATION );
+
+ // Check the input strikethrough property
+ editor.SetProperty( DevelTextEditor::Property::INPUT_STRIKETHROUGH, "Strikethrough input properties" );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( DevelTextEditor::Property::INPUT_STRIKETHROUGH ), std::string("Strikethrough input properties"), TEST_LOCATION );
+
application.SendNotification();
application.Render();
editor.SetProperty( TextEditor::Property::INPUT_SHADOW, "shadow" );
editor.SetProperty( TextEditor::Property::INPUT_EMBOSS, "emboss" );
editor.SetProperty( TextEditor::Property::INPUT_OUTLINE, "outline" );
+ editor.SetProperty( DevelTextEditor::Property::INPUT_STRIKETHROUGH, "strikethrough" );
application.ProcessEvent( GenerateKey( "a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
END_TEST;
}
+int utcDaliTextEditorStrikethroughPropertyStringP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorStrikethroughPropertyStringP");
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK( editor );
+
+ std::string strikethroughSettings1( "{\"enable\":\"true\",\"color\":\"red\",\"height\":\"2\"}" );
+
+ application.GetScene().Add( editor );
+
+ editor.SetProperty( DevelTextEditor::Property::STRIKETHROUGH, strikethroughSettings1 );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( DevelTextEditor::Property::STRIKETHROUGH ), strikethroughSettings1, TEST_LOCATION );
+
+ tet_infoline("Set strikethrough settings with a map");
+ // Check the input strikethrough property
+ Property::Map strikethroughMapSet;
+ Property::Map strikethroughMapGet;
+ strikethroughMapSet.Insert( "enable", true );
+ strikethroughMapSet.Insert( "color", Color::BLUE );
+ strikethroughMapSet.Insert( "height", 2.0f );
+
+ editor.SetProperty( DevelTextEditor::Property::STRIKETHROUGH, strikethroughMapSet );
+ strikethroughMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::STRIKETHROUGH );
+ DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapSet, strikethroughMapGet ), true, TEST_LOCATION );
+
+ tet_infoline("Set strikethrough settings with a string");
+ editor.SetProperty( DevelTextEditor::Property::STRIKETHROUGH, strikethroughSettings1 );
+ Property::Value value = editor.GetProperty( DevelTextEditor::Property::STRIKETHROUGH );
+ std::string result;
+ value.Get(result);
+ DALI_TEST_EQUALS( result , strikethroughSettings1, TEST_LOCATION );
+
+ tet_infoline("Trying to set invalid strikethrough settings, should not update and stay at previous settings");
+ std::string strikethroughSettingsVoid( "{\"enable\":\"true\",\"coooolor\":\"blue\",\"height\":\"2\"}" );
+ editor.SetProperty( DevelTextEditor::Property::STRIKETHROUGH, strikethroughSettingsVoid );
+ value = editor.GetProperty( TextEditor::Property::UNDERLINE );
+ value.Get(result);
+ DALI_TEST_EQUALS( result , strikethroughSettings1, TEST_LOCATION );
+
+ END_TEST;
+}
+
int utcDaliTextEditorShadowPropertyStringP(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int utcDaliTextEditorGeometryEllipsisStart(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorGeometryEllipsisStart");
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK( editor );
+
+ application.GetScene().Add( editor );
+
+ editor.SetProperty( TextEditor::Property::POINT_SIZE, 7.f );
+ editor.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 50.f ) );
+ editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ editor.SetProperty( TextEditor::Property::ENABLE_MARKUP, true );
+ editor.SetProperty( DevelTextEditor::Property::ENABLE_SCROLL_BAR, false );
+ editor.SetProperty( DevelTextEditor::Property::ELLIPSIS, true );
+ editor.SetProperty( DevelTextEditor::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::START );
+ editor.SetProperty( TextEditor::Property::TEXT, "line1 \nline2\nline 3\nline4" );
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ unsigned int expectedCount = 2;
+ unsigned int startIndex = 0;
+ unsigned int endIndex = 24;
+
+ Vector<Vector2> positionsList = DevelTextEditor::GetTextPosition(editor, startIndex, endIndex);
+ Vector<Vector2> sizeList = DevelTextEditor::GetTextSize(editor, startIndex, endIndex);
+
+ DALI_TEST_EQUALS(positionsList.Size(), expectedCount, TEST_LOCATION);
+ DALI_TEST_EQUALS(sizeList.Size(), expectedCount, TEST_LOCATION);
+
+ Vector<Vector2> expectedSizes;
+ Vector<Vector2> expectedPositions;
+
+ expectedPositions.PushBack(Vector2(37, 0));
+ expectedSizes.PushBack(Vector2(20, 25));
+
+ expectedPositions.PushBack(Vector2(-1, 25));
+ expectedSizes.PushBack(Vector2(52, 25));
+
+ TestTextGeometryUtils::CheckGeometryResult(positionsList, sizeList, expectedPositions, expectedSizes);
+
+ END_TEST;
+}
+
+int utcDaliTextEditorGeometryEllipsisMiddle(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorGeometryEllipsisMiddle");
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK( editor );
+
+ application.GetScene().Add( editor );
+
+ editor.SetProperty( TextEditor::Property::POINT_SIZE, 7.f );
+ editor.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 50.f ) );
+ editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ editor.SetProperty( TextEditor::Property::ENABLE_MARKUP, true );
+ editor.SetProperty( DevelTextEditor::Property::ENABLE_SCROLL_BAR, false );
+ editor.SetProperty( DevelTextEditor::Property::ELLIPSIS, true );
+ editor.SetProperty( DevelTextEditor::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::MIDDLE );
+ editor.SetProperty( TextEditor::Property::TEXT, "line1 \nline2\nline 3\nline4" );
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ unsigned int expectedCount = 2;
+ unsigned int startIndex = 0;
+ unsigned int endIndex = 24;
+
+ Vector<Vector2> positionsList = DevelTextEditor::GetTextPosition(editor, startIndex, endIndex);
+ Vector<Vector2> sizeList = DevelTextEditor::GetTextSize(editor, startIndex, endIndex);
+
+ DALI_TEST_EQUALS(positionsList.Size(), expectedCount, TEST_LOCATION);
+ DALI_TEST_EQUALS(sizeList.Size(), expectedCount, TEST_LOCATION);
+
+ Vector<Vector2> expectedSizes;
+ Vector<Vector2> expectedPositions;
+
+ expectedPositions.PushBack(Vector2(-1, 0));
+ expectedSizes.PushBack(Vector2(25, 25));
+
+ expectedPositions.PushBack(Vector2(-1, 25));
+ expectedSizes.PushBack(Vector2(52, 25));
+
+ TestTextGeometryUtils::CheckGeometryResult(positionsList, sizeList, expectedPositions, expectedSizes);
+
+ END_TEST;
+}
+
+int utcDaliTextEditorGeometryEllipsisEnd(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorGeometryEllipsisEnd");
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK( editor );
+
+ application.GetScene().Add( editor );
+
+ editor.SetProperty( TextEditor::Property::POINT_SIZE, 7.f );
+ editor.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 50.f ) );
+ editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ editor.SetProperty( TextEditor::Property::ENABLE_MARKUP, true );
+ editor.SetProperty( DevelTextEditor::Property::ENABLE_SCROLL_BAR, false );
+ editor.SetProperty( DevelTextEditor::Property::ELLIPSIS, true );
+ editor.SetProperty( DevelTextEditor::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::END );
+ editor.SetProperty( TextEditor::Property::TEXT, "line1 \nline2\nline 3\nline4" );
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ unsigned int expectedCount = 2;
+ unsigned int startIndex = 0;
+ unsigned int endIndex = 24;
+
+ Vector<Vector2> positionsList = DevelTextEditor::GetTextPosition(editor, startIndex, endIndex);
+ Vector<Vector2> sizeList = DevelTextEditor::GetTextSize(editor, startIndex, endIndex);
+
+ DALI_TEST_EQUALS(positionsList.Size(), expectedCount, TEST_LOCATION);
+ DALI_TEST_EQUALS(sizeList.Size(), expectedCount, TEST_LOCATION);
+
+ Vector<Vector2> expectedSizes;
+ Vector<Vector2> expectedPositions;
+
+ expectedPositions.PushBack(Vector2(-1, 0));
+ expectedSizes.PushBack(Vector2(59, 25));
+
+ expectedPositions.PushBack(Vector2(-1, 25));
+ expectedSizes.PushBack(Vector2(25, 25));
+
+ TestTextGeometryUtils::CheckGeometryResult(positionsList, sizeList, expectedPositions, expectedSizes);
+
+ END_TEST;
+}
+
+int utcDaliTextEditorGeometryRTL(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorGeometryRTL");
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK( editor );
+
+ application.GetScene().Add( editor );
+
+ editor.SetProperty( TextEditor::Property::POINT_SIZE, 7.f );
+ editor.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 50.f ) );
+ editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ editor.SetProperty( TextEditor::Property::ENABLE_MARKUP, true );
+ editor.SetProperty( TextEditor::Property::TEXT, "line1 \nline2\nline 3\nالاخيرالسطر" );
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ unsigned int expectedCount = 4;
+ unsigned int startIndex = 3;
+ unsigned int endIndex = 24;
+
+ Vector<Vector2> positionsList = DevelTextEditor::GetTextPosition(editor, startIndex, endIndex);
+ Vector<Vector2> sizeList = DevelTextEditor::GetTextSize(editor, startIndex, endIndex);
+
+ DALI_TEST_EQUALS(positionsList.Size(), expectedCount, TEST_LOCATION);
+ DALI_TEST_EQUALS(sizeList.Size(), expectedCount, TEST_LOCATION);
+
+ Vector<Vector2> expectedSizes;
+ Vector<Vector2> expectedPositions;
+
+ expectedPositions.PushBack(Vector2(24, 0));
+ expectedSizes.PushBack(Vector2(33, 25));
+
+ expectedPositions.PushBack(Vector2(-1, 25));
+ expectedSizes.PushBack(Vector2(52, 25));
+
+ expectedPositions.PushBack(Vector2(-1, 50));
+ expectedSizes.PushBack(Vector2(59, 25));
+
+ expectedPositions.PushBack(Vector2(61, 75));
+ expectedSizes.PushBack(Vector2(37, 25));
+
+ TestTextGeometryUtils::CheckGeometryResult(positionsList, sizeList, expectedPositions, expectedSizes);
+
+ END_TEST;
+}
+
+int utcDaliTextEditorGeometryGlyphMiddle(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorGeometryGlyphMiddle");
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK( editor );
+
+ application.GetScene().Add( editor );
+
+ editor.SetProperty( TextEditor::Property::POINT_SIZE, 7.f );
+ editor.SetProperty( Actor::Property::SIZE, Vector2( 150.f, 200.f ) );
+ editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ editor.SetProperty( TextEditor::Property::ENABLE_MARKUP, true );
+ editor.SetProperty( TextEditor::Property::TEXT, "لا تحتوي على لا" );
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ unsigned int expectedCount = 1;
+ unsigned int startIndex = 1;
+ unsigned int endIndex = 13;
+
+ Vector<Vector2> positionsList = DevelTextEditor::GetTextPosition(editor, startIndex, endIndex);
+ Vector<Vector2> sizeList = DevelTextEditor::GetTextSize(editor, startIndex, endIndex);
+
+ DALI_TEST_EQUALS(positionsList.Size(), expectedCount, TEST_LOCATION);
+ DALI_TEST_EQUALS(sizeList.Size(), expectedCount, TEST_LOCATION);
+
+ Vector<Vector2> expectedSizes;
+ Vector<Vector2> expectedPositions;
+
+ expectedPositions.PushBack(Vector2(6, 0));
+ expectedSizes.PushBack(Vector2(124, 25));
+
+ TestTextGeometryUtils::CheckGeometryResult(positionsList, sizeList, expectedPositions, expectedSizes);
+
+ END_TEST;
+}
+
int utcDaliTextEditorSelectionClearedSignal(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int utcDaliTextEditorSelectionWithSecondaryCursor(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorSelectionWithSecondaryCursor");
+
+ // Checks if the actor is created.
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK( editor );
+
+ application.GetScene().Add( editor );
+
+ editor.SetProperty( TextEditor::Property::ENABLE_MARKUP, true );
+ editor.SetProperty( TextEditor::Property::TEXT, "اللغة العربية\nمرحبا بالجميع\nالسلام عليكم <span font-size='12' font-family='DejaVu Sans' >Hello world</span>" );
+ editor.SetProperty( TextEditor::Property::POINT_SIZE, 12.f );
+ editor.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 50.f ) );
+ editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ editor.SetProperty( DevelTextEditor::Property::MIN_LINE_SIZE, 50.f );
+ editor.SetProperty( DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, false );
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Tap on the text editor
+ TestGenerateTap( application, 3.0f, 25.0f );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ //Select the last Arabic word (RTL) & some the space before the English (LTR) letters.
+ DevelTextEditor::SelectText( editor, 35, 41 );// This will activate the alternative cursor position and thus 'cursorInfo.isSecondaryCursor' will be true.
+
+ application.SendNotification();
+ application.Render();
+
+ std::string selectedText = editor.GetProperty( DevelTextEditor::Property::SELECTED_TEXT ).Get<std::string>();
+ DALI_TEST_EQUALS( "عليكم ", selectedText, TEST_LOCATION );
+
+ END_TEST;
+}
+
int utcDaliTextEditorSelectionChangedSignal(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliToolkitTextEditorStrikethroughGeneration(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextEditorStrikethroughGeneration");
+
+ TextEditor textEditor = TextEditor::New();
+ textEditor.SetProperty( TextEditor::Property::TEXT, "Test" );
+ textEditor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 100.f ) );
+ textEditor.SetProperty( TextEditor::Property::POINT_SIZE, 10) ;
+ textEditor.SetProperty( TextEditor::Property::FONT_FAMILY, "DejaVu Sans");
+
+ application.GetScene().Add( textEditor );
+ application.SendNotification();
+ application.Render();
+
+ Property::Map strikethroughMapSet;
+ Property::Map strikethroughMapGet;
+
+ strikethroughMapSet.Insert( "enable", true );
+ strikethroughMapSet.Insert( "color", Color::RED );
+ strikethroughMapSet.Insert( "height", 2.0f );
+
+ // Check the strikethrough property
+ textEditor.SetProperty( DevelTextEditor::Property::STRIKETHROUGH, strikethroughMapSet );
+ strikethroughMapGet = textEditor.GetProperty<Property::Map>( DevelTextEditor::Property::STRIKETHROUGH );
+ textEditor.SetProperty( TextEditor::Property::TEXT, "Test1" );
+ DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughMapSet ), true, TEST_LOCATION );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ strikethroughMapSet.Clear();
+ strikethroughMapGet.Clear();
+
+ END_TEST;
+}
int utcDaliTextEditorInsertCharacterAfterInitWithResizePolicyNaturalSize(void)
{
application.Render();
END_TEST;
-}
\ No newline at end of file
+}