Add LCOV remarkers to increase line coverage rate
[platform/core/api/maps-service.git] / src / view / inertial_gesture.h
1 /* Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 #ifndef __MAPS_VIEW_INERTIAL_GESTURE_H__
17 #define __MAPS_VIEW_INERTIAL_GESTURE_H__
18
19
20 #include "gesture_detector.h"
21
22 //LCOV_EXCL_START
23 namespace view
24 {
25         class inertial_gesture : public gesture_detector {
26         protected:
27                 gesture_detector *_d;
28                 touch_point _down[MAX_FINGERS];
29                 touch_point _last[MAX_FINGERS];
30                 touch_point _prev[MAX_FINGERS];
31                 touch_point _inertial_start[MAX_FINGERS];
32                 double _cur_x[MAX_FINGERS];
33                 double _cur_y[MAX_FINGERS];
34                 double _derivative_x[MAX_FINGERS];
35                 double _derivative_y[MAX_FINGERS];
36                 bool transiting;
37                 bool transiting_part[MAX_FINGERS];
38                 bool transiting_trajectory;
39                 unsigned transiting_start[MAX_FINGERS];
40                 double _dt[MAX_FINGERS];
41         private:
42 #if (__cplusplus >= 201103L)
43                 static constexpr double __ACCURACY = 1;
44 #else
45                 static const double __ACCURACY = 1;
46 #endif
47         public:
48                 inertial_gesture(maps_view_h view);
49                 ~inertial_gesture();
50         private:
51                 inertial_gesture(const inertial_gesture &src);
52                 inertial_gesture &operator=(const inertial_gesture &src);
53         public:
54                 virtual void tap(int finger_no, const touch_point &tp);
55                 virtual void move(int finger_no, const touch_point &tp);
56                 virtual void up(int finger_no, const touch_point &tp);
57
58                 bool is_transiting() const { return transiting; }
59                 void set_transiting(bool b) { transiting = b; }
60                 bool next_transition_step();
61         public:
62                 //static void on_idle(void *data);
63         protected:
64                 double get_next_point(const double &start,
65                                       const double &derivative,
66                                       const double &dt);
67                 double get_next_derivative(const double &derivative,
68                                            const double &dt);
69                 static unsigned int get_cur_time();
70                 unsigned int get_transition_time(int finger_no) const;
71                 void reset();
72                 void update_inertial_start_point(int finger_no);
73         };
74 };
75 //LCOV_EXCL_STOP
76
77 #endif                          /* __MAPS_VIEW_INERTIAL_GESTURE_H__ */