{
DummyControl::DummyControl()
-: mCustomSlot1Called(false)
{
}
DummyControl::DummyControl(const DummyControl& control)
-: Control( control ),
- mCustomSlot1Called(false),
- mCustomSlot1Value(Vector3::ZERO)
+: Control( control )
{
}
}
// Used to test signal connections
-void DummyControl::CustomSlot1( Actor actor, const Vector3& value )
+void DummyControlImpl::CustomSlot1( Actor actor, const Vector3& value )
{
mCustomSlot1Called = true;
mCustomSlot1Value = value;
}
DummyControlImpl::DummyControlImpl()
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) )
+: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+ mCustomSlot1Called(false),
+ mCustomSlot1Value(Vector3::ZERO)
{
}
+
DummyControlImpl::~DummyControlImpl()
{
}
}
DummyControl::DummyControl( DummyControlImpl& implementation )
-: Control( implementation ),
- mCustomSlot1Called(false),
- mCustomSlot1Value(Vector3::ZERO)
+: Control( implementation )
{
}
DummyControl::DummyControl( Dali::Internal::CustomActor* internal )
-: Control( internal ),
- mCustomSlot1Called(false),
- mCustomSlot1Value(Vector3::ZERO)
+: Control( internal )
{
VerifyCustomActorPointer<DummyControlImpl>(internal);
}
DummyControl();
DummyControl(const DummyControl& control);
- virtual ~DummyControl();
+ ~DummyControl();
static DummyControl New( bool override = false );
DummyControl& operator=(const DummyControl& control);
- // Used to test signal connections
- void CustomSlot1( Actor actor, const Vector3& value );
-
-public:
-
- bool mCustomSlot1Called;
- Vector3 mCustomSlot1Value;
-
public: // Not intended for application developers
DummyControl( DummyControlImpl& implementation );
inline TapGestureDetector GetTapGestureDetector() const { return Internal::Control::GetTapGestureDetector(); }
inline LongPressGestureDetector GetLongPressGestureDetector() const { return Internal::Control::GetLongPressGestureDetector(); }
+ // Used to test signal connections
+ void CustomSlot1( Actor actor, const Vector3& value );
+
+ bool mCustomSlot1Called;
+ Vector3 mCustomSlot1Value;
+
protected:
DummyControlImpl();
Actor actor = Actor::New();
DALI_TEST_EQUALS( actor.SetSizeSignal().GetConnectionCount(), 0u, TEST_LOCATION );
- actor.SetSizeSignal().Connect( &dummy, &DummyControl::CustomSlot1 );
+ Toolkit::Internal::Control& control = dummy.GetImplementation();
+ DummyControlImpl* dummyImpl = dynamic_cast<DummyControlImpl*>(&control);
+ DALI_TEST_CHECK( dummyImpl );
+
+ actor.SetSizeSignal().Connect( dummyImpl, &DummyControlImpl::CustomSlot1 );
DALI_TEST_EQUALS( actor.SetSizeSignal().GetConnectionCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( dummy.mCustomSlot1Called, false, TEST_LOCATION );
- DALI_TEST_EQUALS( dummy.mCustomSlot1Value, Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, false, TEST_LOCATION );
+ DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Value, Vector3::ZERO, TEST_LOCATION );
const Vector3 newSize( 10, 10, 0 );
actor.SetSize( newSize );
- DALI_TEST_EQUALS( dummy.mCustomSlot1Called, true, TEST_LOCATION );
- DALI_TEST_EQUALS( dummy.mCustomSlot1Value, newSize, TEST_LOCATION );
+ DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, true, TEST_LOCATION );
+ DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Value, newSize, TEST_LOCATION );
- dummy.mCustomSlot1Called = false;
- actor.SetSizeSignal().Disconnect( &dummy, &DummyControl::CustomSlot1 );
+ dummyImpl->mCustomSlot1Called = false;
+ actor.SetSizeSignal().Disconnect( dummyImpl, &DummyControlImpl::CustomSlot1 );
DALI_TEST_EQUALS( actor.SetSizeSignal().GetConnectionCount(), 0u, TEST_LOCATION );
const Vector3 ignoredSize( 20, 20, 0 );
actor.SetSize( ignoredSize );
- DALI_TEST_EQUALS( dummy.mCustomSlot1Called, false, TEST_LOCATION );
- DALI_TEST_EQUALS( dummy.mCustomSlot1Value, newSize/*not ignoredSize*/, TEST_LOCATION );
+ DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, false, TEST_LOCATION );
+ DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Value, newSize/*not ignoredSize*/, TEST_LOCATION );
}
END_TEST;
}
{
DummyControl dummy = DummyControlImpl::New();
+ Toolkit::Internal::Control& control = dummy.GetImplementation();
+ DummyControlImpl* dummyImpl = dynamic_cast<DummyControlImpl*>(&control);
+ DALI_TEST_CHECK( dummyImpl );
- actor.SetSizeSignal().Connect( &dummy, &DummyControl::CustomSlot1 );
+ actor.SetSizeSignal().Connect( dummyImpl, &DummyControlImpl::CustomSlot1 );
DALI_TEST_EQUALS( actor.SetSizeSignal().GetConnectionCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( dummy.mCustomSlot1Called, false, TEST_LOCATION );
- DALI_TEST_EQUALS( dummy.mCustomSlot1Value, Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, false, TEST_LOCATION );
+ DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Value, Vector3::ZERO, TEST_LOCATION );
const Vector3 newSize( 10, 10, 0 );
actor.SetSize( newSize );
- DALI_TEST_EQUALS( dummy.mCustomSlot1Called, true, TEST_LOCATION );
- DALI_TEST_EQUALS( dummy.mCustomSlot1Value, newSize, TEST_LOCATION );
+ DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, true, TEST_LOCATION );
+ DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Value, newSize, TEST_LOCATION );
}
// dummyControl automatically disconnects
DALI_TEST_CHECK( test.GetMaximumSize() == maxSize );
test.KeyEventSignal();
- DummyControl test2 = DummyControl::New();
- dynamic_cast< ConnectionTrackerInterface& >( test2 ).GetConnectionCount();
// Provide coverage for pointer destructor
Control* testControlPtr = new Control;