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 IOrientation.h
18 * @author Qi Xiangguo (xiangguo.qi@samsung.com)
23 #ifndef WRTDEVICEAPIS_ORIENTATION_IORIENTATION_H_
24 #define WRTDEVICEAPIS_ORIENTATION_IORIENTATION_H_
26 #include <dpl/shared_ptr.h>
27 #include <Commons/ThreadPool.h>
28 #include <Orientation/EventOrientationChanged.h>
30 namespace WrtDeviceApis {
31 namespace Orientation {
34 class EventGetCurrentOrientation;
35 typedef DPL::SharedPtr<EventGetCurrentOrientation>
36 EventGetCurrentOrientationPtr;
39 public Commons::EventRequestReceiver<EventGetCurrentOrientation>
42 virtual ~IOrientation();
45 * Gets current orientation
46 * @param event @see WrtDeviceApis::Api::Orientation::EventGetCurrentOrientation.
47 * @exception Commons::PlatformException when platform error occurs
49 virtual void getCurrentOrientation(
50 const EventGetCurrentOrientationPtr& event) = 0;
53 * Requests sensor module to receive continuously update of current
54 * orientation if the orientation is significantly changed
55 * @param emitter @see WrtDeviceApis::Api::Orientation::EventOrientationChanged.
56 * @param minNotificationInterval
57 * @return An ID of created subscription
58 * @exception Commons::PlatformException when platform error occurs
60 virtual long watchOrientation(
61 const EventOrientationChangedEmitterPtr& emitter,
62 long minNotificationInterval) = 0;
65 * Stopping periodic orientation updates started with watchOrientation
66 * @param id An Id of listener subscription.
67 * @exception Commons::PlatformException when platform error occurs
69 virtual void clearWatch(EventOrientationChangedEmitter::IdType id) = 0;
74 virtual void OnRequestReceived(const EventGetCurrentOrientationPtr& event)
78 typedef DPL::SharedPtr<IOrientation> IOrientationPtr;
83 #endif // WRTDEVICEAPIS_ORIENTATION_IORIENTATION_H_