Merge "Removed On(...)Event()" into devel/master
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / dali-test-suite-utils / test-custom-actor.cpp
index 1463118..84f54b6 100644 (file)
@@ -27,7 +27,7 @@ TestCustomActor TestCustomActor::NewNegoSize()
 {
   Impl::TestCustomActor* impl = new Impl::TestCustomActor( true );
   TestCustomActor custom( *impl ); // takes ownership
-  custom.SetName( "SizeNegotiationActor" );
+  custom.SetProperty( Dali::Actor::Property::NAME, "SizeNegotiationActor" );
 
   impl->Initialize();
 
@@ -74,9 +74,9 @@ TestCustomActor TestCustomActor::NewVariant4()
   return custom;
 }
 
-TestCustomActor TestCustomActor::NewVariant5()
+TestCustomActor TestCustomActor::NewVariant5(Integration::Scene scene)
 {
-  Impl::TestCustomActor* impl = new Impl::TestCustomActorVariant5();
+  Impl::TestCustomActor* impl = new Impl::TestCustomActorVariant5(scene);
   TestCustomActor custom( *impl ); // takes ownership
 
   impl->Initialize();
@@ -84,9 +84,9 @@ TestCustomActor TestCustomActor::NewVariant5()
   return custom;
 }
 
-TestCustomActor TestCustomActor::NewVariant6()
+TestCustomActor TestCustomActor::NewVariant6(Integration::Scene scene)
 {
-  Impl::TestCustomActor* impl = new Impl::TestCustomActorVariant6();
+  Impl::TestCustomActor* impl = new Impl::TestCustomActorVariant6(scene);
   TestCustomActor custom( *impl ); // takes ownership
 
   impl->Initialize();
@@ -200,7 +200,7 @@ bool TestCustomActor::TestRelayoutDependentOnChildrenBase( Dimension::Type dimen
   return GetImpl().TestRelayoutDependentOnChildrenBase( dimension );
 }
 
-unsigned int TestCustomActor::GetDepth()
+uint32_t TestCustomActor::GetDepth()
 {
   return GetImpl().mDepth;
 }
@@ -240,21 +240,23 @@ namespace Impl
 {
 
 TestCustomActor::TestCustomActor()
-: CustomActorImpl( ActorFlags( REQUIRES_TOUCH_EVENTS | REQUIRES_WHEEL_EVENTS | REQUIRES_HOVER_EVENTS | DISABLE_SIZE_NEGOTIATION ) ),
+: CustomActorImpl( ActorFlags( DISABLE_SIZE_NEGOTIATION ) ),
   mDaliProperty( Property::INVALID_INDEX ),
   mSizeSet( Vector3::ZERO ),
   mTargetSize( Vector3::ZERO ),
   mNego( false ),
-  mDepth(0u)
+  mDepth(0u),
+  develProp6( 10.0f )
 {
 }
 
 TestCustomActor::TestCustomActor(bool nego)
-: CustomActorImpl( ActorFlags( REQUIRES_TOUCH_EVENTS | REQUIRES_WHEEL_EVENTS | REQUIRES_HOVER_EVENTS ) ),
+: CustomActorImpl( ActorFlags() ),
   mDaliProperty( Property::INVALID_INDEX ),
   mSizeSet( Vector3::ZERO ),
   mTargetSize( Vector3::ZERO ),
-  mNego( nego )
+  mNego( nego ),
+  develProp6( 10.0f )
 {
 }
 /**
@@ -288,7 +290,7 @@ void TestCustomActor::AddToCallStacks( const char* method )
   mMethodsCalled.push_back( method );
 
   // Combine Actor name with method string
-  std::string nameAndMethod( Self().GetName() );
+  std::string nameAndMethod( Self().GetProperty< std::string >( Dali::Actor::Property::NAME ) );
   if ( 0 == nameAndMethod.size() )
   {
     nameAndMethod = "Unknown: ";
@@ -303,14 +305,14 @@ void TestCustomActor::AddToCallStacks( const char* method )
 }
 
 // From CustomActorImpl
-void TestCustomActor::OnStageConnection( int depth )
+void TestCustomActor::OnSceneConnection( int depth )
 {
-  AddToCallStacks("OnStageConnection");
+  AddToCallStacks("OnSceneConnection");
   mDepth = depth;
 }
-void TestCustomActor::OnStageDisconnection()
+void TestCustomActor::OnSceneDisconnection()
 {
-  AddToCallStacks("OnStageDisconnection");
+  AddToCallStacks("OnSceneDisconnection");
 }
 void TestCustomActor::OnChildAdd(Actor& child)
 {
@@ -320,7 +322,7 @@ void TestCustomActor::OnChildRemove(Actor& child)
 {
   AddToCallStacks("OnChildRemove");
 }
-void TestCustomActor::OnPropertySet( Property::Index index, Property::Value propertyValue )
+void TestCustomActor::OnPropertySet( Property::Index index, const Property::Value& propertyValue )
 {
   AddToCallStacks("OnPropertySet");
 }
@@ -334,26 +336,6 @@ void TestCustomActor::OnSizeAnimation(Animation& animation, const Vector3& targe
   mTargetSize = targetSize;
   AddToCallStacks("OnSizeAnimation");
 }
-bool TestCustomActor::OnTouchEvent(const TouchEvent& event)
-{
-  AddToCallStacks("OnTouchEvent");
-  return true;
-}
-bool TestCustomActor::OnHoverEvent(const HoverEvent& event)
-{
-  AddToCallStacks("OnHoverEvent");
-  return true;
-}
-bool TestCustomActor::OnWheelEvent(const WheelEvent& event)
-{
-  AddToCallStacks("OnWheelEvent");
-  return true;
-}
-bool TestCustomActor::OnKeyEvent(const KeyEvent& event)
-{
-  AddToCallStacks("OnKeyEvent");
-  return true;
-}
 void TestCustomActor::OnKeyInputFocusGained()
 {
   AddToCallStacks("OnKeyInputFocusGained");
@@ -500,6 +482,10 @@ Property::Value TestCustomActor::GetProperty( BaseObject* object, Property::Inde
       {
         return Property::Value(actorImpl.develProp5);
       }
+      case Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY6:
+      {
+        return Property::Value(actorImpl.develProp6);
+      }
     }
   }
   return Property::Value();
@@ -518,6 +504,7 @@ DALI_PROPERTY_REGISTRATION( Test, TestCustomActor, "testProperty2", VECTOR4, TES
 DALI_DEVEL_PROPERTY_REGISTRATION( Test, TestCustomActor, "develTestProperty3", VECTOR4, DEVEL_TEST_PROPERTY3)
 DALI_DEVEL_PROPERTY_REGISTRATION( Test, TestCustomActor, "develTestProperty4", INTEGER, DEVEL_TEST_PROPERTY4)
 DALI_DEVEL_PROPERTY_REGISTRATION( Test, TestCustomActor, "develTestProperty5", FLOAT, DEVEL_TEST_PROPERTY5)
+DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Test, TestCustomActor, "develTestProperty6", FLOAT, DEVEL_TEST_PROPERTY6)
 
 DALI_TYPE_REGISTRATION_END()