2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FLocLocation.h
20 * @brief This is the header file for the %Location class.
22 * This header file contains the declarations of the %Location class.
25 #ifndef _FLOC_LOCATION_H_
26 #define _FLOC_LOCATION_H_
28 #include <FBaseObject.h>
30 namespace Tizen { namespace Base
36 namespace Tizen { namespace Locations
42 * @brief This class contains and provides information about a location including its geographical coordinates, altitude, and so on.
46 * @final This class is not intended for extension.
48 * The %Location class contains all information about a location that the location provider fixed at a certain moment.
49 * It basically provides geographical coordinates and horizontal accuracy that gives the estimated error about the coordinates,
50 * while the altitude, vertical accuracy, speed, and course at the location are optionally provided.
51 * It also contains detailed and specific positioning information, such as satellites used to fix the location.
53 * An application obtains the %Location instances from LocationProvider.
55 class _OSP_EXPORT_ Location
56 : public Tizen::Base::Object
60 * Copying of objects using this copy constructor is allowed.
64 * @param[in] rhs An instance of %Location to copy
66 Location(const Location& rhs);
69 * This destructor overrides Tizen::Base::Object::~Object().
73 virtual ~Location(void);
76 * Compares the calling instance with the specified instance for equality.
80 * @return @c true if all the fields in the objects are equal, @n
82 * @param[in] rhs The object to compare
84 virtual bool Equals(const Tizen::Base::Object& rhs) const;
87 * Gets the hash value of the calling instance.
91 * @return The hash value of the calling instance
93 virtual int GetHashCode(void) const;
96 * Gets the horizontal accuracy.
100 * @return The horizontal accuracy in meters, @n
101 * else @c NaN if it is not available
103 double GetHorizontalAccuracy(void) const;
106 * Gets the vertical accuracy.
110 * @return The vertical accuracy in meters, @n
111 * else @c NaN if it is not available
113 double GetVerticalAccuracy(void) const;
118 * The course is the angle of moving direction measured clockwise from true north.
122 * @return The course in degrees within the range [0.0, +360.0], @n
123 * else @c NaN if it is not available
125 double GetCourse(void) const;
128 * Gets the coordinates.
132 * @return The geographical coordinates
134 Coordinates GetCoordinates(void) const;
137 * Gets the ground speed.
141 * @return The speed in km/h, @n
142 * else @c NaN if it is not available
144 double GetSpeed(void) const;
147 * Gets the timestamp when this location is fixed.
151 * @return The fix time in UTC
153 Tizen::Base::DateTime GetTimestamp(void) const;
156 * Gets the detailed positioning information.
158 * The detailed positioning information is queried using a key, and the %GetExtraInfo() method returns the information corresponding to the key.
160 <tr><th>Key</th><th>Information</th></tr>
161 <tr><td>location_method</td><td>Positioning technology used to fix this location. Possible values are "gps" and "network".</td></tr>
162 <tr><td>satellite</td>
163 <td>GPS satellite information in the semicolon-separated satellite sentences.
164 Each sentence forms "PRN, Elevation, Azimuth, SNR, Active" where PRN is a satellite ID, Elevation is in degree, Azimuth is in degree,
165 SNR is a signal to nose ratio in dBHZ, and Active is @c 1, if the satellite is in use for positioning, or @c 0.
166 For example, it can be "02, 40.0, 83.0, 35.0, 1; 15, 30.0, 65.0, 35.0, 0; 22, 80.0, 120.0, 40.0, 1;".</td>
171 * @return The information corresponding to the key, @n
172 * else an empty string if the @c key is invalid or the requested information is not available for this location
173 * @param[in] key The key to the positioning information
175 Tizen::Base::String GetExtraInfo(const Tizen::Base::String& key) const;
178 * Checks the validity for this location.
182 * @return @c true if the location is valid, @n
185 bool IsValid(void) const;
188 * Copying of objects using this copy assignment operator is allowed.
192 * @return A reference to the current instance
193 * @param[in] rhs An instance of %Location to assign
195 Location& operator =(const Location& rhs);
199 // This default constructor is intentionally declared as private so that only the platform can create an instance.
206 class _LocationImpl* __pImpl;
207 friend class _LocationImpl;
209 }} // Tizen::Locations
210 #endif // _FLOC_LOCATION_H_