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