b38caa0541bfc4bac149c8dbfb9b36741eb8a4c0
[platform/framework/native/locations.git] / src / FLoc_LocationImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file        FLoc_LocationImpl.h
20  * @brief       This is the header file for the _LocationImpl class.
21  *
22  * This header file contains the declarations of the _LocationImpl class.
23  */
24
25 #ifndef _FLOC_INTERNAL_LOCATION_IMPL_H_
26 #define _FLOC_INTERNAL_LOCATION_IMPL_H_
27
28 #include <unique_ptr.h>
29 #include <FBaseObject.h>
30 #include <FBaseDateTime.h>
31 #include <FLocCoordinates.h>
32 #include <FLocLocation.h>
33 #include "FLoc_Types.h"
34
35 namespace Tizen { namespace Locations
36 {
37
38 class _LocationImpl
39 {
40
41 public:
42         /**
43          * This is the default constructor for this class.
44          */
45         _LocationImpl(void);
46
47         /**
48          * This is the copy constructor for the _LocationImpl class.
49          */
50         _LocationImpl(const _LocationImpl& rhs);
51
52         /**
53          * This is the destructor for this class.
54          */
55         virtual ~_LocationImpl(void);
56
57         /**
58          * @see @ref Tizen::Locations::Location::Equals()
59          */
60         virtual bool Equals(const _LocationImpl& rhs) const;
61
62         /**
63          * @see @ref Tizen::Locations::Location::GetHashCode()
64          */
65         virtual int GetHashCode(void) const;
66
67         /**
68          * @see @ref Tizen::Locations::Location::GetHorizontalAccuracy()
69          */
70         double GetHorizontalAccuracy(void) const {return __horizontalAccuracy;}
71
72         /**
73          * @see @ref Tizen::Locations::Location::GetVerticalAccuracy()
74          */
75         double GetVerticalAccuracy(void) const {return __verticalAccuracy;}
76
77         /**
78          * @see @ref Tizen::Locations::Location::GetCourse()
79          */
80         double GetCourse(void) const { return __course;}
81
82         /**
83          * @see @ref Tizen::Locations::Location::GetCoordinate()
84          */
85         Coordinates GetCoordinates(void) const { return __coordinate;}
86
87         /**
88          * @see @ref Tizen::Locations::Location::GetSpeed()
89          */
90         double GetSpeed(void) const { return __speed;}
91
92         /**
93          * @see @ref Tizen::Locations::Location::GetTimestamp()
94          */
95         Tizen::Base::DateTime GetTimestamp(void) const;
96
97         /**
98          * @see @ref Tizen::Locations::Location::GetExtraInfo()
99          */
100         Tizen::Base::String GetExtraInfo(const Tizen::Base::String& key) const;
101
102         /**
103          * @see @ref Tizen::Locations::Location::IsValid()
104          */
105         bool IsValid(void) const {return __isLocationValid;}
106
107         /**
108          * Sets the horizonal Accuracy value of the %_LocationImpl instance
109          */
110         void SetHorizontalAccuracy(double horizontalAcc) {__horizontalAccuracy = horizontalAcc;}
111
112         /**
113          * Sets the vertical Accuracy value of the %_LocationImpl instance
114          */
115         void SetVerticalAccuracy(double verticalAcc) {__verticalAccuracy = verticalAcc;}
116
117         /**
118          * Sets the course value of the %_LocationImpl instance
119          */
120         void SetCourse(double course) { __course = course;}
121
122         /**
123          * Sets the Coordinate value of the %_LocationImpl instance
124          */
125         result SetCoordinates(const Coordinates& coordinate);
126
127         /**
128          * Sets the speed value of the %_LocationImpl instance
129          */
130         void SetSpeed(double speed) { __speed = speed;}
131
132         /**
133          * Sets the Time stamp value of the %_LocationImpl instance
134          */
135         void SetTimestamp(long long timestamp) {__timestamp = timestamp;}
136
137         /**
138          * Sets the Satellite Information of the %_LocationImpl instance
139          */
140         void SetExtraInfo(const Tizen::Base::String& key, const Tizen::Base::String& value);
141
142         /**
143          *      Sets the validity of the location.
144          */
145         void SetValidity(bool validity){__isLocationValid = validity;}
146
147         //
148         // Gets the timestamp in ms.
149         //
150         long long GetTimestampInMs(void){return __timestamp;}
151
152         //
153         // Turns on the denied flag.
154         //
155         void TurnOnDeniedFlag(void) {__isDenied = true;}
156
157         //
158         // Returns the denied flag.
159         //
160         bool IsDenied(void) {return __isDenied;}
161
162         /**
163          *      Gets the Impl instance of the given %Location object
164          */
165         static _LocationImpl* GetInstance(Location& obj);
166
167         /**
168          *      Gets the Impl instance of the given %Location object
169          */
170         static const _LocationImpl* GetInstance(const Location& obj);
171
172         //
173         //@Internal: Gets the new instance of %Location.
174         //
175         static Location* GetLocationInstanceN(void);
176
177         //
178         //@Internal: Gets the new instance of %Location.
179         //
180         static Location GetLocationInstance(void);
181
182         /**
183          * Assigns the value of the specified _LocationImpl object to the current instance.
184          */
185         _LocationImpl& operator =(const _LocationImpl& rhs);
186
187         /**
188          * Compares the calling instance with the specified instance.
189          */
190         bool operator ==(const _LocationImpl& rhs) const;
191
192 private:
193         Coordinates __coordinate;
194         double __speed;
195         double __course;
196         double __horizontalAccuracy;
197         double __verticalAccuracy;
198         long long __timestamp;
199         Tizen::Base::String __locationMethod;
200         Tizen::Base::String __satelliteInformation;
201         bool __isLocationValid;
202         bool __isDenied;
203 };  // _LocationImpl
204 } } // Tizen::Location
205 #endif  // _FLOC_INTERNAL_LOCATION_IMPL_H_