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_GEOLOCATION_EVENT_GET_CURRENT_LOCATION_H_
21 #define WRTPLUGINS_API_GEOLOCATION_EVENT_GET_CURRENT_LOCATION_H_
23 #include "PositionProperties.h"
24 #include "IGeolocation.h"
26 #include <commons/IEvent.h>
27 #include <dpl/shared_ptr.h>
29 namespace WrtPlugins {
31 namespace Geolocation {
32 class EventGetCurrentPosition : public WrtPlugins::Platform::IEvent<
33 EventGetCurrentPosition>
36 PositionProperties m_props;
37 IGeolocation::ApiLocationMethod m_method;
40 void setTimestamp(std::time_t timestamp)
42 m_props.timestamp = timestamp;
44 void setLatitude(double latitude)
46 m_props.latitude = latitude;
48 void setLongitude(double longitude)
50 m_props.longitude = longitude;
52 void setAltitude(double altitude)
54 m_props.altitude = altitude;
56 void setAccuracy(double accuracy)
58 m_props.accuracy = accuracy;
60 void setAltitudeAccuracy(double accuracy)
62 m_props.altitudeAccuracy = accuracy;
64 void setSpeed(double speed)
66 m_props.speed = speed;
68 void setDirection(double direction)
70 m_props.direction = direction;
72 void setAltitudeSpeed(double climb)
74 m_props.altitudeSpeed = climb;
76 void setMethod(IGeolocation::ApiLocationMethod method)
81 std::time_t getTimestamp() const
83 return m_props.timestamp;
85 double getLatitude() const
87 return m_props.latitude;
89 double getLongitude() const
91 return m_props.longitude;
93 double getAltitude() const
95 return m_props.altitude;
97 double getAccuracy() const
99 return m_props.accuracy;
101 double getAltitudeAccuracy() const
103 return m_props.altitudeAccuracy;
105 double getSpeed() const
107 return m_props.speed;
109 double getDirection() const
111 return m_props.direction;
113 double getAltitudeSpeed() const
115 return m_props.altitudeSpeed;
117 IGeolocation::ApiLocationMethod getMethod() const
121 PositionProperties getPositionProperties() const
126 EventGetCurrentPosition()
131 typedef DPL::SharedPtr<EventGetCurrentPosition> EventGetCurrentPositionPtr;
136 #endif //WRTPLUGINS_API_GEOLOCATION_EVENT_GET_CURRENT_LOCATION_H_