tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / API / DEPRACATED / Geolocation / EventGetCurrentPosition.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /*
17  * @author      Wojciech Bielawski (w.bielawski@samsung.com)
18  */
19
20 #ifndef WRTPLUGINS_API_GEOLOCATION_EVENT_GET_CURRENT_LOCATION_H_
21 #define WRTPLUGINS_API_GEOLOCATION_EVENT_GET_CURRENT_LOCATION_H_
22
23 #include "PositionProperties.h"
24 #include "IGeolocation.h"
25
26 #include <commons/IEvent.h>
27 #include <dpl/shared_ptr.h>
28
29 namespace WrtPlugins {
30 namespace Api {
31 namespace Geolocation {
32 class EventGetCurrentPosition : public WrtPlugins::Platform::IEvent<
33         EventGetCurrentPosition>
34 {
35   private:
36     PositionProperties m_props;
37     IGeolocation::ApiLocationMethod m_method;
38
39   public:
40     void setTimestamp(std::time_t timestamp)
41     {
42         m_props.timestamp = timestamp;
43     }
44     void setLatitude(double latitude)
45     {
46         m_props.latitude = latitude;
47     }
48     void setLongitude(double longitude)
49     {
50         m_props.longitude = longitude;
51     }
52     void setAltitude(double altitude)
53     {
54         m_props.altitude = altitude;
55     }
56     void setAccuracy(double accuracy)
57     {
58         m_props.accuracy = accuracy;
59     }
60     void setAltitudeAccuracy(double accuracy)
61     {
62         m_props.altitudeAccuracy = accuracy;
63     }
64     void setSpeed(double speed)
65     {
66         m_props.speed = speed;
67     }
68     void setDirection(double direction)
69     {
70         m_props.direction = direction;
71     }
72     void setAltitudeSpeed(double climb)
73     {
74         m_props.altitudeSpeed = climb;
75     }
76     void setMethod(IGeolocation::ApiLocationMethod method)
77     {
78         m_method = method;
79     }
80
81     std::time_t getTimestamp() const
82     {
83         return m_props.timestamp;
84     }
85     double getLatitude() const
86     {
87         return m_props.latitude;
88     }
89     double getLongitude() const
90     {
91         return m_props.longitude;
92     }
93     double getAltitude() const
94     {
95         return m_props.altitude;
96     }
97     double getAccuracy() const
98     {
99         return m_props.accuracy;
100     }
101     double getAltitudeAccuracy() const
102     {
103         return m_props.altitudeAccuracy;
104     }
105     double getSpeed() const
106     {
107         return m_props.speed;
108     }
109     double getDirection() const
110     {
111         return m_props.direction;
112     }
113     double getAltitudeSpeed() const
114     {
115         return m_props.altitudeSpeed;
116     }
117     IGeolocation::ApiLocationMethod getMethod() const
118     {
119         return m_method;
120     }
121     PositionProperties getPositionProperties() const
122     {
123         return m_props;
124     }
125
126     EventGetCurrentPosition()
127     {
128     }
129 };
130
131 typedef DPL::SharedPtr<EventGetCurrentPosition> EventGetCurrentPositionPtr;
132 } // Geolocation
133 } // Api
134 } // WrtPlugins
135
136 #endif //WRTPLUGINS_API_GEOLOCATION_EVENT_GET_CURRENT_LOCATION_H_