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 * @author Wojciech Bielawski (w.bielawski@samsung.com)
20 #ifndef WRTPLUGINS_API_IGEOLOCATION_H_
21 #define WRTPLUGINS_API_IGEOLOCATION_H_
23 #include "EventPositionChanged.h"
25 #include <dpl/shared_ptr.h>
26 #include <platform/commons/ThreadPool.h>
28 namespace WrtPlugins {
30 namespace Geolocation {
31 class EventGetCurrentPosition;
32 typedef DPL::SharedPtr<EventGetCurrentPosition> EventGetCurrentPositionPtr;
35 public Platform::EventRequestReceiver<EventGetCurrentPosition>
48 virtual ~IGeolocation();
51 * Gets current position
52 * @param event @see WrtPlugins::Api::Geolocation::EventGetCurrentPosition.
53 * @exception Commons::PlatformException when platform error occurs
55 virtual void getCurrentPosition(const EventGetCurrentPositionPtr& event) =
59 * Requests location module to receive continuously update of current
60 * position if the position is significantly changed
61 * @param emitter @see WrtPlugins::Api::Geolocation::EventPositionChanged.
65 * @return An ID of created subscription
66 * @exception Commons::PlatformException when platform error occurs
68 virtual long watchPosition(const EventPositionChangedEmitterPtr& emitter,
71 bool highAccuracy) = 0;
74 * Stopping periodic location updates started with watchPosition
75 * @param id An Id of listener subscription.
76 * @exception Commons::PlatformException when platform error occurs
78 virtual void clearWatch(EventPositionChangedEmitter::IdType id) = 0;
81 * Choses location method
82 * @param method A location method
83 * @exception Commons::PlatformException when platform error occurs
84 * @remarks does nothing when executed with the same method as currently
87 virtual void changeLocationMethod(ApiLocationMethod method) = 0;
92 virtual void OnRequestReceived(const EventGetCurrentPositionPtr& event) = 0;
95 typedef DPL::SharedPtr<IGeolocation> IGeolocationPtr;
100 #endif /* WRTPLUGINS_API_IGEOLOCATION_H_ */