2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file IAccelerometer.h
18 * @author Qi Xiangguo (xiangguo.qi@samsung.com)
23 #ifndef WRTDEVICEAPIS_IACCELEROMETER_H_
24 #define WRTDEVICEAPIS_IACCELEROMETER_H_
26 #include <dpl/shared_ptr.h>
27 #include <Commons/ThreadPool.h>
28 #include <Accelerometer/EventAccelerationChanged.h>
30 namespace WrtDeviceApis {
31 namespace Accelerometer {
34 class EventGetCurrentAcceleration;
35 typedef DPL::SharedPtr<EventGetCurrentAcceleration>
36 EventGetCurrentAccelerationPtr;
38 class IAccelerometer :
39 public Commons::EventRequestReceiver<EventGetCurrentAcceleration>
42 virtual ~IAccelerometer();
45 * Gets current acceleration
46 * @param event @see WrtDeviceApis::Api::Accelerometer::EventGetCurrentAcceleration.
47 * @exception Commons::PlatformException when platform error occurs
49 virtual void getCurrentAcceleration(
50 const EventGetCurrentAccelerationPtr& event) = 0;
53 * Requests sensor module to receive continuously update of current
54 * acceleration if the acceleration is significantly changed
55 * @param emitter @see WrtDeviceApis::Api::Accelerometer::EventAccelerationChanged.
56 * @param minNotificationInterval
57 * @return An ID of created subscription
58 * @exception Commons::PlatformException when platform error occurs
60 virtual long watchAcceleration(
61 const EventAccelerationChangedEmitterPtr& emitter,
62 long minNotificationInterval) = 0;
65 * Stopping periodic acceleration updates started with watchAcceleration
66 * @param id An Id of listener subscription.
67 * @exception Commons::PlatformException when platform error occurs
69 virtual void clearWatch(EventAccelerationChangedEmitter::IdType id) = 0;
74 virtual void OnRequestReceived(const EventGetCurrentAccelerationPtr& event)
78 typedef DPL::SharedPtr<IAccelerometer> IAccelerometerPtr;
83 #endif /* WRTDEVICEAPIS_API_IACCELEROMETER_H_ */