Create devel-api folder for header files used by Toolkit
[platform/core/uifw/dali-adaptor.git] / adaptors / devel-api / adaptor-framework / tilt-sensor.cpp
1 /*
2  * Copyright (c) 2015 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 // CLASS HEADER
19 #include "tilt-sensor.h"
20
21 // INTERNAL INCLUDES
22 #include <tilt-sensor-impl.h>
23 #include <adaptor-impl.h>
24
25 namespace Dali
26 {
27
28 const float TiltSensor::DEFAULT_UPDATE_FREQUENCY = 60.0f;
29
30 TiltSensor::TiltSensor()
31 {
32 }
33
34 TiltSensor TiltSensor::Get()
35 {
36   return Internal::Adaptor::TiltSensor::Get();
37 }
38
39 TiltSensor::~TiltSensor()
40 {
41 }
42
43 bool TiltSensor::Enable()
44 {
45   return GetImplementation(*this).Enable();
46 }
47
48 void TiltSensor::Disable()
49 {
50   GetImplementation(*this).Disable();
51 }
52
53 bool TiltSensor::IsEnabled() const
54 {
55   return GetImplementation(*this).IsEnabled();
56 }
57
58 float TiltSensor::GetRoll() const
59 {
60   return GetImplementation(*this).GetRoll();
61 }
62
63 float TiltSensor::GetPitch() const
64 {
65   return GetImplementation(*this).GetPitch();
66 }
67
68 Quaternion TiltSensor::GetRotation() const
69 {
70   return GetImplementation(*this).GetRotation();
71 }
72
73 TiltSensor::TiltedSignalType& TiltSensor::TiltedSignal()
74 {
75   return GetImplementation(*this).TiltedSignal();
76 }
77
78 void TiltSensor::SetUpdateFrequency( float frequencyHertz )
79 {
80   GetImplementation(*this).SetUpdateFrequency( frequencyHertz );
81 }
82
83 float TiltSensor::GetUpdateFrequency() const
84 {
85   return GetImplementation(*this).GetUpdateFrequency();
86 }
87
88 void TiltSensor::SetRotationThreshold(Radian rotationThreshold)
89 {
90   GetImplementation(*this).SetRotationThreshold( rotationThreshold );
91 }
92
93 Radian TiltSensor::GetRotationThreshold() const
94 {
95   return GetImplementation(*this).GetRotationThreshold();
96 }
97
98 TiltSensor::TiltSensor( Internal::Adaptor::TiltSensor* sensor )
99 : BaseHandle( sensor )
100 {
101 }
102
103 } // namespace Dali