Bug 1717887 Part 1: Abstract RenderThread task pushing, and make it private. r=gfx...
[gecko.git] / hal / HalSensor.h
blob39fc33848bd2e02712ddc2a9bbf7d633781cbf20
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 ts=8 et ft=cpp : */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef __HAL_SENSOR_H_
8 #define __HAL_SENSOR_H_
10 #include "mozilla/Observer.h"
12 namespace mozilla {
13 namespace hal {
15 /**
16 * Enumeration of sensor types. They are used to specify type while
17 * register or unregister an observer for a sensor of given type.
18 * If you add or change any here, do the same in GeckoHalDefines.java.
20 enum SensorType {
21 SENSOR_ORIENTATION = 0,
22 SENSOR_ACCELERATION = 1,
23 SENSOR_PROXIMITY = 2,
24 SENSOR_LINEAR_ACCELERATION = 3,
25 SENSOR_GYROSCOPE = 4,
26 SENSOR_LIGHT = 5,
27 SENSOR_ROTATION_VECTOR = 6,
28 SENSOR_GAME_ROTATION_VECTOR = 7,
29 NUM_SENSOR_TYPE
32 class SensorData;
34 typedef Observer<SensorData> ISensorObserver;
36 class SensorAccuracy;
38 typedef Observer<SensorAccuracy> ISensorAccuracyObserver;
40 } // namespace hal
41 } // namespace mozilla
43 #include "ipc/EnumSerializer.h"
45 namespace IPC {
46 /**
47 * Serializer for SensorType
49 template <>
50 struct ParamTraits<mozilla::hal::SensorType>
51 : public ContiguousEnumSerializer<mozilla::hal::SensorType,
52 mozilla::hal::SENSOR_ORIENTATION,
53 mozilla::hal::NUM_SENSOR_TYPE> {};
54 } // namespace IPC
56 #endif /* __HAL_SENSOR_H_ */