Further Setter/Getter public API removal from Dali::Actor
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-TextEditor.cpp
index 91c9a79..c84000d 100755 (executable)
@@ -949,9 +949,9 @@ int utcDaliTextEditorInputStyleChanged01(void)
   DALI_TEST_CHECK( editor );
 
 
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.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, "<font family='DejaVuSerif' size='18'>He<color value='green'>llo</color> <font weight='bold'>world</font> demo</font>" );
@@ -1163,9 +1163,9 @@ int utcDaliTextEditorInputStyleChanged02(void)
   DALI_TEST_CHECK( editor );
 
 
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.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, "<font family='DejaVuSerif' size='18'>He<color value='blue'> l</color><color value='green'>lo</color> <font weight='bold'>world</font> demo</font>" );
@@ -1400,9 +1400,9 @@ int utcDaliTextEditorEvent01(void)
 
   Stage::GetCurrent().Add( editor );
 
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -1440,10 +1440,10 @@ int utcDaliTextEditorEvent01(void)
   // Create a second text editor and send key events to it.
   TextEditor editor2 = TextEditor::New();
 
-  editor2.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor2.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  editor2.SetSize( 100.f, 100.f );
-  editor2.SetPosition( 100.f, 100.f );
+  editor2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor2.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+  editor2.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
+  editor2.SetProperty( Actor::Property::POSITION, Vector2( 100.f, 100.f ));
 
   Stage::GetCurrent().Add( editor2 );
 
@@ -1485,9 +1485,9 @@ int utcDaliTextEditorEvent02(void)
 
   Stage::GetCurrent().Add( editor );
 
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -1538,7 +1538,7 @@ int utcDaliTextEditorEvent02(void)
   }
 
   // Move the cursor and check the position changes.
-  Vector3 position1 = cursor.GetCurrentPosition();
+  Vector3 position1 = cursor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
 
   application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
   application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
@@ -1547,7 +1547,7 @@ int utcDaliTextEditorEvent02(void)
   application.SendNotification();
   application.Render();
 
-  Vector3 position2 = cursor.GetCurrentPosition();
+  Vector3 position2 = cursor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
 
   DALI_TEST_CHECK( position2.x < position1.x );
 
@@ -1558,7 +1558,7 @@ int utcDaliTextEditorEvent02(void)
   application.SendNotification();
   application.Render();
 
-  Vector3 position3 = cursor.GetCurrentPosition();
+  Vector3 position3 = cursor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
 
   DALI_TEST_EQUALS( position1, position3, TEST_LOCATION ); // Should be in the same position1.
 
@@ -1572,7 +1572,7 @@ int utcDaliTextEditorEvent02(void)
   application.Render();
 
   // Cursor position should be the same than position1.
-  Vector3 position4 = cursor.GetCurrentPosition();
+  Vector3 position4 = cursor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
 
   DALI_TEST_EQUALS( position2, position4, TEST_LOCATION ); // Should be in the same position2.
 
@@ -1583,7 +1583,7 @@ int utcDaliTextEditorEvent02(void)
   application.SendNotification();
   application.Render();
 
-  Vector3 position5 = cursor.GetCurrentPosition();
+  Vector3 position5 = cursor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
 
   DALI_TEST_CHECK( position5.x > position4.x );
 
@@ -1597,7 +1597,7 @@ int utcDaliTextEditorEvent02(void)
   application.Render();
 
   // Cursor position should be the same than position2.
-  Vector3 position6 = cursor.GetCurrentPosition();
+  Vector3 position6 = cursor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
 
   DALI_TEST_EQUALS( position2, position6, TEST_LOCATION );// Should be in the same position2.
 
@@ -1621,9 +1621,9 @@ int utcDaliTextEditorEvent03(void)
 
   editor.SetProperty( TextEditor::Property::TEXT, "This is a long text for the size of the text-editor." );
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
-  editor.SetSize( 30.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 30.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -1714,9 +1714,9 @@ int utcDaliTextEditorEvent04(void)
 
   editor.SetProperty( TextEditor::Property::TEXT, "Hello\nworl" );
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
-  editor.SetSize( 100.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  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 );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -1803,9 +1803,9 @@ int utcDaliTextEditorEvent05(void)
 
   editor.SetProperty( TextEditor::Property::TEXT, "Hello\nworl" );
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
-  editor.SetSize( 50.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 50.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::SMOOTH_SCROLL, true );
   editor.SetProperty( TextEditor::Property::SMOOTH_SCROLL_DURATION, 0.2f );
   editor.SetProperty( TextEditor::Property::ENABLE_SCROLL_BAR, true );
@@ -1885,9 +1885,9 @@ int utcDaliTextEditorEvent06(void)
 
   editor.SetProperty( TextEditor::Property::TEXT, "Hello\nworld\nHello world" );
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
-  editor.SetSize( 100.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  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 );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -1975,9 +1975,9 @@ int utcDaliTextEditorEvent07(void)
 
   editor.SetProperty( TextEditor::Property::TEXT, "Hello\nworld\nHello world" );
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
-  editor.SetSize( 100.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  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 );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2119,9 +2119,9 @@ int utcDaliTextEditorEvent08(void)
 
   editor.SetProperty( TextEditor::Property::TEXT, "DALi" );
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
-  editor.SetSize( 100.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  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 );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2326,9 +2326,9 @@ int utcDaliTextEditorHandles(void)
   editor.SetProperty( TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT, imagePropertyMap );
   editor.SetProperty( TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, imagePropertyMap );
 
-  editor.SetSize( 30.f, 500.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 30.f, 500.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2356,7 +2356,7 @@ int utcDaliTextEditorHandles(void)
 
   // Get the handle's actor.
   Actor handle = activeLayer.GetChildAt( 1u );
-  handle.SetSize( 100.f, 100.f );
+  handle.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
 
   // Render and notify
   application.SendNotification();
@@ -2522,11 +2522,11 @@ int utcDaliTextEditorGetPropertyLinecountP(void)
 
   Stage::GetCurrent().Add( editor );
 
-  editor.SetSize( 100.0f, 100.0f );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
   lineCount =  editor.GetProperty<int>( TextEditor::Property::LINE_COUNT );
   DALI_TEST_EQUALS( lineCount, 14, TEST_LOCATION );
 
-  editor.SetSize( 50.0f, 100.0f );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 50.f, 100.f ) );
   lineCount =  editor.GetProperty<int>( TextEditor::Property::LINE_COUNT );
   DALI_TEST_EQUALS( lineCount, 28, TEST_LOCATION );
 
@@ -2545,9 +2545,9 @@ int utcDaliTextEditorScrollStateChangedSignalTest(void)
   Stage::GetCurrent().Add( editor );
 
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
-  editor.SetSize( 50.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 50.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_SCROLL_BAR, true );
   editor.SetKeyboardFocusable(true);
 
@@ -2582,7 +2582,7 @@ int UtcDaliToolkitTextEditorTextWrapMode(void)
   int lineCount =0 ;
 
   TextEditor editor = TextEditor::New();
-  editor.SetSize( 150.0f, 300.f );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 150.0f, 300.f ) );
   editor.SetProperty( TextEditor::Property::TEXT, "Hello world Hello world" );
 
   Stage::GetCurrent().Add( editor );
@@ -2633,9 +2633,9 @@ int UtcDaliTextEditorSetPaddingProperty(void)
 
   TextEditor editor = TextEditor::New();
   DALI_TEST_CHECK( editor );
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   Stage::GetCurrent().Add( editor );
 
   application.SendNotification();
@@ -2666,9 +2666,9 @@ int UtcDaliTextEditorEnableShiftSelectionProperty(void)
 
   TextEditor editor = TextEditor::New();
   DALI_TEST_CHECK( editor );
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   Stage::GetCurrent().Add( editor );
 
   application.SendNotification();
@@ -2694,9 +2694,9 @@ int UtcDaliTextEditorEnableGrabHandleProperty(void)
 
   TextEditor editor = TextEditor::New();
   DALI_TEST_CHECK( editor );
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   Stage::GetCurrent().Add( editor );
 
   application.SendNotification();
@@ -2722,9 +2722,9 @@ int UtcDaliTextEditorMatchSystemLanguageDirectionProperty(void)
 
   TextEditor editor = TextEditor::New();
   DALI_TEST_CHECK( editor );
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   Stage::GetCurrent().Add( editor );
 
   application.SendNotification();