1 #ifndef DALI_TEST_GESTURE_GENERATOR_H
2 #define DALI_TEST_GESTURE_GENERATOR_H
5 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 #include "test-application.h"
26 * These functions use touch events to trigger a gesture, assuming the default gesture parameters are used
30 * Returns the frame interval used in ms
32 uint32_t TestGetFrameInterval();
35 * Produces the initial touch of a long press
37 void TestStartLongPress( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450 );
40 * Triggers the timer to begin a long press gesture
42 void TestTriggerLongPress( TestApplication& application );
45 * Produces the initial press and triggers the timer to begin a long press gesture
47 void TestGenerateLongPress( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450 );
50 * End a long press by lifting the touch
52 void TestEndLongPress( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450 );
55 * Produces a vertical pinch gesture between (20,20) and (20,90)
57 void TestGeneratePinch( TestApplication& application );
60 * Produces the gesture started event of a pinch, using 4 touches, 50ms apart, starting with 1, ending at 2
62 void TestStartPinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
65 * Produces a gesture continuing event of a pinch, using 4 touches, 50ms apart, starting with 1, ending at 2
67 void TestContinuePinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
70 * Produces a gesture finished event of a pinch, using 2 touches, 50ms apart
72 void TestEndPinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
75 * Produces a pan gesture from (20,20) to (20,40)
77 void TestGenerateMiniPan( TestApplication& application );
80 * Produces the start event of a pan gesture, assuming minimum distance moved between start and end is greater than 15
81 * in either direction or 11 in both (x&y). Time will be incremented using the standard frame interval per touch movement
83 void TestStartPan( TestApplication& application, Vector2 start, Vector2 end, uint32_t& time );
86 * Continues a pan event by creating a single touch at pos.
87 * N.B This does not increment the time
89 void TestMovePan( TestApplication& application, Vector2 pos, uint32_t time = 400);
92 * End a pan gesture at position pos
94 void TestEndPan( TestApplication& application, Vector2 pos, uint32_t time = 500);
97 * Produces a single point tap gesture with a 20ms interval
99 void TestGenerateTap( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time_down = 100 );
102 * Produce a tap gesture with two touch points and a 20ms interval
104 void TestGenerateTwoPointTap( TestApplication& application, float x1, float y1, float x2, float y2, uint32_t time_down );
108 #endif // DALI_TEST_GESTURE_GENERATOR_H