--- /dev/null
+#ifndef TEST_TOUCH_UTILS_H
+#define TEST_TOUCH_UTILS_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/public-api/actors/actor.h>
+
+namespace Dali
+{
+
+// Data for touch events
+struct TouchEventData
+{
+ TouchEventData()
+ : functorCalled(false),
+ receivedTouch(),
+ touchActor()
+ {
+ }
+
+ void Reset()
+ {
+ functorCalled = false;
+
+ receivedTouch.points.clear();
+ receivedTouch.time = 0;
+
+ touchActor.Reset();
+ }
+
+ bool functorCalled;
+ TouchEvent receivedTouch;
+ Actor touchActor;
+};
+
+// Functor that sets the data when called
+struct TouchEventDataFunctor
+{
+ TouchEventDataFunctor(TouchEventData& data) : touchEventData(data) { }
+
+ bool operator()(Actor actor, const TouchEvent& touch)
+ {
+ touchEventData.functorCalled = true;
+ touchEventData.touchActor = actor;
+ touchEventData.receivedTouch = touch;
+ return false;
+ }
+
+ // Generate a touch-event
+ Integration::TouchEvent GenerateSingleTouch( PointState::Type state, const Vector2& screenPosition ) const
+ {
+ Integration::TouchEvent touchEvent;
+ Integration::Point point;
+ point.SetState( state );
+ point.SetScreenPosition( screenPosition );
+ touchEvent.points.push_back( point );
+ return touchEvent;
+ }
+
+ TouchEventData& touchEventData;
+};
+
+
+} // namespace Dali
+
+#endif // TEST_TOUCH_UTILS_H
// EXTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
-#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
namespace Dali
{
/**
* Perform the accessibility action associated with a scroll event.
- * @param touchData The touch point (and time) of the event.
+ * @param touchEvent The touch point (and time) of the event.
* @return whether the focus is cleared or not.
*/
- virtual bool AccessibilityActionScroll( Dali::TouchData& touchData ) = 0;
+ virtual bool AccessibilityActionScroll( Dali::TouchEvent& touchEvent ) = 0;
/**
* Perform the accessibility action to move focus to the previous focusable actor (by one finger flick up).
/**
* Perform the accessibility action to mouse move (by one finger tap & hold and move).
- * @param touchData touch data
+ * @param touchEvent touch event structure
* @return whether the accessibility action is performed or not.
*/
- virtual bool AccessibilityActionTouch(const Dali::TouchData& touchData) = 0;
+ virtual bool AccessibilityActionTouch(const Dali::TouchEvent& touchEvent) = 0;
}; // class AccessibilityActionHandler
// EXTERNAL INCLUDES
-#include <dali/public-api/events/touch-point.h>
+#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/dali-adaptor-common.h>
// EXTERNAL INCLUDES
#include <dali/public-api/events/key-event.h>
+#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/events/wheel-event.h>
// INTERNAL INCLUDES
#include <dali/public-api/signals/dali-signal.h>
#include <dali/public-api/math/uint-16-pair.h>
#include <dali/public-api/math/rect.h>
+#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/any.h>
-#include <dali/public-api/events/touch-point.h>
#include <dali/integration-api/processor-interface.h>
// INTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/touch-data-integ.h>
#include <dali/integration-api/events/hover-event-integ.h>
// INTERNAL INCLUDES
// so always send the action to the action handler.
if( mActionHandler )
{
- Dali::TouchData touchData = Integration::NewTouchData( timeStamp, point );
- ret = mActionHandler->AccessibilityActionScroll( touchData );
+ Dali::TouchEvent event(timeStamp);
+ event.points.push_back(point);
+ ret = mActionHandler->AccessibilityActionScroll( event );
}
Integration::TouchEvent touchEvent;
{
bool ret = false;
- Dali::TouchData touchData = Integration::NewTouchData( timeStamp, point );
+ Dali::TouchEvent touchEvent(timeStamp);
+ touchEvent.points.push_back(point);
if( mActionHandler )
{
- ret = mActionHandler->AccessibilityActionTouch( touchData );
+ ret = mActionHandler->AccessibilityActionTouch(touchEvent);
}
return ret;
}
// EXTERNAL INCLUDES
#include <cmath>
+
+#include <dali/public-api/events/touch-point.h>
+
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/devel-api/adaptor-framework/accessibility-gesture-handler.h>
#include <dali/devel-api/adaptor-framework/accessibility-gesture-event.h>
#include <dali/integration-api/scene.h>
+#include <dali/public-api/events/touch-event.h>
namespace Dali
{