Remove Setter/Getter public APIs from Dali::Layer
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-Tooltip.cpp
index 3dfaec2..6eabaed 100644 (file)
@@ -508,9 +508,9 @@ int UtcDaliTooltipDisplay(void)
 
   Control control = Control::New();
   control.SetProperty( DevelControl::Property::TOOLTIP, "Test" );
-  control.SetAnchorPoint( AnchorPoint::CENTER );
-  control.SetParentOrigin( ParentOrigin::CENTER );
-  control.SetSize( 100.0f, 100.0f );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
 
   Actor rootActor = Stage::GetCurrent().GetRootLayer();
   rootActor.Add( control );
@@ -543,9 +543,9 @@ int UtcDaliTooltipDisplayWithTail(void)
   ToolkitTestApplication application;  // Exceptions require ToolkitTestApplication
 
   Control control = Control::New();
-  control.SetAnchorPoint( AnchorPoint::CENTER );
-  control.SetParentOrigin( ParentOrigin::CENTER );
-  control.SetSize( 100.0f, 100.0f );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
   control.SetProperty( DevelControl::Property::TOOLTIP,
                        Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
                                       .Add( Tooltip::Property::TAIL,
@@ -583,9 +583,9 @@ int UtcDaliTooltipDisplayWithContentArray(void)
   ToolkitTestApplication application;  // Exceptions require ToolkitTestApplication
 
   Control control = Control::New();
-  control.SetAnchorPoint( AnchorPoint::CENTER );
-  control.SetParentOrigin( ParentOrigin::CENTER );
-  control.SetSize( 100.0f, 100.0f );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
   control.SetProperty( DevelControl::Property::TOOLTIP,
                        Property::Map().Add( Tooltip::Property::CONTENT,
                                             Property::Array().Add( Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::IMAGE )
@@ -627,9 +627,9 @@ int UtcDaliTooltipDisplayBelow(void)
   ToolkitTestApplication application;  // Exceptions require ToolkitTestApplication
 
   Control control = Control::New();
-  control.SetAnchorPoint( AnchorPoint::CENTER );
-  control.SetParentOrigin( ParentOrigin::CENTER );
-  control.SetSize( 100.0f, 100.0f );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
   control.SetProperty( DevelControl::Property::TOOLTIP,
                        Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
                                       .Add( Tooltip::Property::POSITION, Tooltip::Position::BELOW )
@@ -653,7 +653,7 @@ int UtcDaliTooltipDisplayBelow(void)
   Actor tooltip = rootActor.GetChildAt( rootActor.GetChildCount() - 1 ); // Last actor added will be our tooltip
 
   tet_infoline( "Ensure tooltip is below control" );
-  DALI_TEST_CHECK( ( control.GetCurrentWorldPosition().y + 50.0f /* Half Size */) < tooltip.GetCurrentWorldPosition().y );
+  DALI_TEST_CHECK( ( control.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y + 50.0f /* Half Size */) < tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y );
 
   END_TEST;
 }
@@ -663,9 +663,9 @@ int UtcDaliTooltipDisplayAbove(void)
   ToolkitTestApplication application;  // Exceptions require ToolkitTestApplication
 
   Control control = Control::New();
-  control.SetAnchorPoint( AnchorPoint::CENTER );
-  control.SetParentOrigin( ParentOrigin::CENTER );
-  control.SetSize( 100.0f, 100.0f );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
   control.SetProperty( DevelControl::Property::TOOLTIP,
                        Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
                                       .Add( Tooltip::Property::POSITION, Tooltip::Position::ABOVE )
@@ -689,7 +689,7 @@ int UtcDaliTooltipDisplayAbove(void)
   Actor tooltip = rootActor.GetChildAt( rootActor.GetChildCount() - 1 ); // Last actor added will be our tooltip
 
   tet_infoline( "Ensure tooltip is above control" );
-  DALI_TEST_CHECK( ( control.GetCurrentWorldPosition().y - 50.0f /* Half Size */) >= ( tooltip.GetCurrentWorldPosition().y + 0.5f * tooltip.GetCurrentSize().height ) );
+  DALI_TEST_CHECK( ( control.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y - 50.0f /* Half Size */) >= ( tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y + 0.5f * tooltip.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height ) );
 
   END_TEST;
 }
@@ -699,9 +699,9 @@ int UtcDaliTooltipDisplayAtHoverPoint(void)
   ToolkitTestApplication application;  // Exceptions require ToolkitTestApplication
 
   Control control = Control::New();
-  control.SetAnchorPoint( AnchorPoint::CENTER );
-  control.SetParentOrigin( ParentOrigin::CENTER );
-  control.SetSize( 100.0f, 100.0f );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
   control.SetProperty( DevelControl::Property::TOOLTIP,
                        Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
                                       .Add( Tooltip::Property::POSITION, Tooltip::Position::HOVER_POINT )
@@ -728,8 +728,8 @@ int UtcDaliTooltipDisplayAtHoverPoint(void)
   Actor tooltip = rootActor.GetChildAt( rootActor.GetChildCount() - 1 ); // Last actor added will be our tooltip
 
   tet_infoline( "Ensure tooltip is below and to the right of control" );
-  DALI_TEST_CHECK( ( hoverPoint.y - stageSize.height * 0.5f ) < tooltip.GetCurrentWorldPosition().y );
-  DALI_TEST_CHECK( ( hoverPoint.x - stageSize.width  * 0.5f ) < tooltip.GetCurrentWorldPosition().x );
+  DALI_TEST_CHECK( ( hoverPoint.y - stageSize.height * 0.5f ) < tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y );
+  DALI_TEST_CHECK( ( hoverPoint.x - stageSize.width  * 0.5f ) < tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).x );
 
   END_TEST;
 }
@@ -739,9 +739,9 @@ int UtcDaliTooltipExceedThreshold(void)
   ToolkitTestApplication application;  // Exceptions require ToolkitTestApplication
 
   Control control = Control::New();
-  control.SetAnchorPoint( AnchorPoint::CENTER );
-  control.SetParentOrigin( ParentOrigin::CENTER );
-  control.SetSize( 100.0f, 100.0f );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
   control.SetProperty( DevelControl::Property::TOOLTIP,
                        Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
                                       .Add( Tooltip::Property::MOVEMENT_THRESHOLD, 5 )
@@ -788,9 +788,9 @@ int UtcDaliTooltipGoOutOfBounds(void)
   ToolkitTestApplication application;  // Exceptions require ToolkitTestApplication
 
   Control control = Control::New();
-  control.SetAnchorPoint( AnchorPoint::CENTER );
-  control.SetParentOrigin( ParentOrigin::CENTER );
-  control.SetSize( 100.0f, 100.0f );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
   control.SetProperty( DevelControl::Property::TOOLTIP, "Test" );
 
   Actor rootActor = Stage::GetCurrent().GetRootLayer();
@@ -834,9 +834,9 @@ int UtcDaliTooltipHideTooltipWhenOutOfBounds(void)
 
   Control control = Control::New();
   control.SetProperty( DevelControl::Property::TOOLTIP, "Test" );
-  control.SetAnchorPoint( AnchorPoint::CENTER );
-  control.SetParentOrigin( ParentOrigin::CENTER );
-  control.SetSize( 100.0f, 100.0f );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
 
   Actor rootActor = Stage::GetCurrent().GetRootLayer();
   rootActor.Add( control );
@@ -877,9 +877,9 @@ int UtcDaliTooltipHideTooltipWhenSetToDisapperOnMovement(void)
   ToolkitTestApplication application;  // Exceptions require ToolkitTestApplication
 
   Control control = Control::New();
-  control.SetAnchorPoint( AnchorPoint::CENTER );
-  control.SetParentOrigin( ParentOrigin::CENTER );
-  control.SetSize( 100.0f, 100.0f );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
   control.SetProperty( DevelControl::Property::TOOLTIP,
                        Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
                                       .Add( Tooltip::Property::DISAPPEAR_ON_MOVEMENT, true )
@@ -926,9 +926,9 @@ int UtcDaliTooltipChangeContent(void)
 
   Control control = Control::New();
   control.SetProperty( DevelControl::Property::TOOLTIP, "Test" );
-  control.SetAnchorPoint( AnchorPoint::CENTER );
-  control.SetParentOrigin( ParentOrigin::CENTER );
-  control.SetSize( 100.0f, 100.0f );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
 
   Actor rootActor = Stage::GetCurrent().GetRootLayer();
   rootActor.Add( control );
@@ -1013,9 +1013,9 @@ int UtcDaliTooltipEnsureRemainsOnStage1(void)
 
   tet_infoline( "Create a control and place it at the bottom of the screen, setting the tooltip to appear below" );
   Control control = Control::New();
-  control.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
-  control.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
-  control.SetSize( stageSize );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+  control.SetProperty( Actor::Property::SIZE, stageSize );
   control.SetProperty( DevelControl::Property::TOOLTIP,
                        Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
                                       .Add( Tooltip::Property::TAIL,
@@ -1042,7 +1042,7 @@ int UtcDaliTooltipEnsureRemainsOnStage1(void)
 
   tet_infoline( "Ensure tooltip is still on the screen" );
   Actor tooltip = rootActor.GetChildAt( rootActor.GetChildCount() - 1 ); // Last actor added will be our tooltip
-  DALI_TEST_CHECK( ( tooltip.GetCurrentWorldPosition().y + tooltip.GetCurrentSize().height * 0.5f ) <= centerPoint.height );
+  DALI_TEST_CHECK( ( tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y + tooltip.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height * 0.5f ) <= centerPoint.height );
 
   END_TEST;
 }
@@ -1055,9 +1055,9 @@ int UtcDaliTooltipEnsureRemainsOnStage2(void)
 
   tet_infoline( "Create a control and place it at the top of the screen, setting the tooltip to appear above" );
   Control control = Control::New();
-  control.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-  control.SetParentOrigin( ParentOrigin::TOP_CENTER );
-  control.SetSize( stageSize );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+  control.SetProperty( Actor::Property::SIZE, stageSize );
   control.SetProperty( DevelControl::Property::TOOLTIP,
                        Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
                                       .Add( Tooltip::Property::TAIL,
@@ -1084,7 +1084,7 @@ int UtcDaliTooltipEnsureRemainsOnStage2(void)
 
   tet_infoline( "Ensure tooltip is still on the screen" );
   Actor tooltip = rootActor.GetChildAt( rootActor.GetChildCount() - 1 ); // Last actor added will be our tooltip
-  DALI_TEST_CHECK( ( tooltip.GetCurrentWorldPosition().y - tooltip.GetCurrentSize().height * 0.5f ) >= -centerPoint.height );
+  DALI_TEST_CHECK( ( tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y - tooltip.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height * 0.5f ) >= -centerPoint.height );
 
   END_TEST;
 }
@@ -1098,9 +1098,9 @@ int UtcDaliTooltipEnsureRemainsOnStage3(void)
 
   tet_infoline( "Create a control and adjust it's position so that the tooltip will attempt to appear to the left of the screen" );
   Control control = Control::New();
-  control.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
-  control.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
-  control.SetSize( stageSize );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+  control.SetProperty( Actor::Property::SIZE, stageSize );
   control.SetProperty( DevelControl::Property::TOOLTIP,
                        Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
                                       .Add( Tooltip::Property::TAIL,
@@ -1109,7 +1109,7 @@ int UtcDaliTooltipEnsureRemainsOnStage3(void)
                                                            .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" ) )
                                       .Add( Tooltip::Property::POSITION, Tooltip::Position::BELOW )
                      );
-  control.SetX( -centerPoint.x );
+  control.SetProperty( Actor::Property::POSITION_X,  -centerPoint.x );
 
   Actor rootActor = Stage::GetCurrent().GetRootLayer();
   rootActor.Add( control );
@@ -1129,7 +1129,7 @@ int UtcDaliTooltipEnsureRemainsOnStage3(void)
 
   tet_infoline( "Ensure tooltip is still on the screen" );
   Actor tooltip = rootActor.GetChildAt( rootActor.GetChildCount() - 1 ); // Last actor added will be our tooltip
-  DALI_TEST_CHECK( ( tooltip.GetCurrentWorldPosition().x - tooltip.GetCurrentSize().width * 0.5f ) >= -centerPoint.width );
+  DALI_TEST_CHECK( ( tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).x - tooltip.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width * 0.5f ) >= -centerPoint.width );
 
   END_TEST;
 }
@@ -1143,9 +1143,9 @@ int UtcDaliTooltipEnsureRemainsOnStage4(void)
 
   tet_infoline( "Create a control and adjust it's position so that the tooltip will attempt to appear to the right of the screen" );
   Control control = Control::New();
-  control.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
-  control.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
-  control.SetSize( stageSize );
+  control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
+  control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+  control.SetProperty( Actor::Property::SIZE, stageSize );
   control.SetProperty( DevelControl::Property::TOOLTIP,
                        Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
                                       .Add( Tooltip::Property::TAIL,
@@ -1154,7 +1154,7 @@ int UtcDaliTooltipEnsureRemainsOnStage4(void)
                                                            .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" ) )
                                       .Add( Tooltip::Property::POSITION, Tooltip::Position::BELOW )
                      );
-  control.SetX( centerPoint.x );
+  control.SetProperty( Actor::Property::POSITION_X,  centerPoint.x );
 
   Actor rootActor = Stage::GetCurrent().GetRootLayer();
   rootActor.Add( control );
@@ -1174,7 +1174,7 @@ int UtcDaliTooltipEnsureRemainsOnStage4(void)
 
   tet_infoline( "Ensure tooltip is still on the screen" );
   Actor tooltip = rootActor.GetChildAt( rootActor.GetChildCount() - 1 ); // Last actor added will be our tooltip
-  DALI_TEST_CHECK( ( tooltip.GetCurrentWorldPosition().x + tooltip.GetCurrentSize().width * 0.5f ) <= centerPoint.width );
+  DALI_TEST_CHECK( ( tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).x + tooltip.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width * 0.5f ) <= centerPoint.width );
 
   END_TEST;
 }