remove unnecessary return
[platform/core/api/motion.git] / src / GestureSensor.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 #ifndef __MOTION_GESTURE_SENSOR_H__
19 #define __MOTION_GESTURE_SENSOR_H__
20
21 #include <gesture_recognition.h>
22 #include "SensorAdapter.h"
23
24 struct _gesture_data_s {
25         int gesture;
26         int event;
27         int tilt_x;
28         int tilt_y;
29 };
30
31 namespace motion {
32
33         class GestureSensor : public ISensorListener {
34         public:
35                 GestureSensor();
36                 ~GestureSensor();
37
38                 bool setGesture(gesture_type_e type);
39                 void setPowerSave(bool ps);
40                 void setCallback(gesture_recognition_cb cb);
41                 void setUserData(void* data);
42
43                 bool start();
44                 bool stop();
45
46                 static bool isSupported(gesture_type_e type);
47
48         private:
49                 void onEvent(double timestamp, float* values, int accuracy);
50
51                 static sensor_type_t __toSensor(gesture_type_e type);
52
53                 gesture_type_e __gestureType;
54                 gesture_recognition_cb __callback;
55                 void *__userData;
56                 SensorAdapter __sensorAdapter;
57         };
58
59 }
60
61 #endif /* __MOTION_GESTURE_SENSOR_H__ */