7ef1b63e6022d6f1781f72eaa3b5ed8a203b77bc
[framework/web/wrt-plugins-common.git] / src / modules / API / Accelerometer / ISensor.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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  * @author       Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
18  */
19
20 #ifndef WRTDEVICEAPIS_ACCELEROMETER_ISENSOR_H_
21 #define WRTDEVICEAPIS_ACCELEROMETER_ISENSOR_H_
22
23 #include <dpl/noncopyable.h>
24
25 namespace WrtDeviceApis {
26 namespace Accelerometer {
27 namespace Api {
28
29 class ISensor : private DPL::Noncopyable
30 {
31   public:
32     /**
33      * Gets instance of accelerometer sensor.
34      * @return Accelerometer sensor interface.
35      * @throw UnsupportedException If platform does not support it.
36      */
37     static ISensor& getInstance();
38
39   public:
40     virtual ~ISensor() = 0;
41
42     /**
43      * Gets value on X-axis.
44      * @return Value on X-axis.
45      * @throw PlatformException If error in platform occurs.
46      */
47     virtual double getX() const = 0;
48
49     /**
50      * Gets value on Y-axis.
51      * @return Value on Y-axis.
52      * @throw PlatformException If error in platform occurs.
53      */
54     virtual double getY() const = 0;
55
56     /**
57      * Gets value on Z-axis.
58      * @return Value on Z-axis.
59      * @throw PlatformException If error in platform occurs.
60      */
61     virtual double getZ() const = 0;
62 };
63 } // Accelerometer
64 } // Api
65 } // WrtDeviceApis
66
67 #endif // WRTDEVICEAPIS_ACCELEROMETER_ISENSOR_H_