author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 27 Aug 2009 07:43:07 +0300 | |
changeset 22 | fc9cf246af83 |
parent 19 | 989d2f495d90 |
child 33 | 50974a8b132e |
permissions | -rw-r--r-- |
19 | 1 |
/* |
2 |
* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: Header file for location SAPI core implementation. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef C_LOCATIONCOREIMP_H |
|
20 |
#define C_LOCATIONCOREIMP_H |
|
21 |
||
22 |
#include <lbs.h> |
|
23 |
#include <LbsSatellite.h> |
|
24 |
#include "locationservice.h" |
|
25 |
||
26 |
||
27 |
/** |
|
28 |
* Consts to identify the type of location request (trace, getlocation |
|
29 |
*/ |
|
30 |
||
31 |
const TInt KTraceRequest = 1 ; |
|
32 |
const TInt KGetLocationRequest = 2 ; |
|
33 |
||
34 |
||
35 |
||
36 |
||
37 |
||
38 |
/** |
|
39 |
* This class implements Location SAPI core logic.It has methods |
|
40 |
* for retreving information location asynchronusly . |
|
41 |
*/ |
|
42 |
||
43 |
class CGetLoc : public CActive |
|
44 |
{ |
|
45 |
public: |
|
46 |
||
47 |
||
48 |
||
49 |
/** |
|
50 |
* Creates a new instance of a @ref CGetLoc |
|
51 |
* |
|
52 |
* @param aPositionServer subsession to location server |
|
53 |
* @param aRequestorInfoStack requestor indenty |
|
54 |
* @param aList List of position fields that should be retrived |
|
55 |
* @param aLocationInfoCategory information type required(Basic, Generic) |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
56 |
* @param aModuleId the unique id of the module which should be used to |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
57 |
* open the subsession with location server |
19 | 58 |
*/ |
59 |
||
60 |
IMPORT_C static CGetLoc* NewL( RPositionServer &aPositionServer , |
|
61 |
TPositionFieldIdList aList , |
|
62 |
TInt aRequestType, |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
63 |
TInt aLocationInfoCategory, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
64 |
TPositionModuleId aModuleId) ; |
19 | 65 |
|
66 |
/** |
|
67 |
* Destructor. |
|
68 |
*/ |
|
69 |
virtual ~CGetLoc() ; |
|
70 |
||
71 |
||
72 |
||
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
73 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
74 |
* Gets users current location Asynchronously calls the users callback |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
75 |
* function when updates are recived from location server |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
76 |
* @param aLocationService pointer to the CLocationService class used in RunL |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
77 |
* @param aCallBackObj callback object for updates notification |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
78 |
* @param aUpdatesOptions update options for asynchronous calls |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
79 |
* |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
80 |
* @see TPositionUpdateOptions in LbsCommon.h for details |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
81 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
82 |
TInt GetLocationUpdates( CLocationService* aLocationService, MLocationCallBack* aCallBackObj , |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
83 |
const TPositionUpdateOptions* aUpdateOptions = NULL ); |
19 | 84 |
|
85 |
||
86 |
void SetStatusComplete() |
|
87 |
{ |
|
88 |
iRequestStatus = 1; |
|
89 |
} |
|
90 |
TBool IsStatusComplete() |
|
91 |
{ |
|
92 |
if(iRequestStatus == 0) |
|
93 |
return false; |
|
94 |
else |
|
95 |
return true; |
|
96 |
} |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
97 |
/* |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
98 |
* Returns the MLocationCallBack object pointer stored by this class |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
99 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
100 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
101 |
MLocationCallBack* GetCallBackobj() const |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
102 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
103 |
return iCallBack; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
104 |
} |
19 | 105 |
|
106 |
protected: |
|
107 |
||
108 |
/** |
|
109 |
* From CActive |
|
110 |
*/ |
|
111 |
void DoCancel(); |
|
112 |
void RunL(); |
|
113 |
||
114 |
||
115 |
private: |
|
116 |
||
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
117 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
118 |
* By default Symbian 2nd phase constructor is private. |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
119 |
* @param aPositionServer subsession to location server |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
120 |
* @param aList List of position fields that should be retrived |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
121 |
* @param aRequestType The type of request serviced by this Active object(GetLocation,Trace) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
122 |
* @param aModuleId aModuleId the unique id of the module which should be used to |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
123 |
* open the subsession with location server |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
124 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
125 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
126 |
void ConstructL(RPositionServer &aPositionServer , |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
127 |
TPositionFieldIdList aList , |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
128 |
TInt aRequestType, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
129 |
TPositionModuleId aModuleId); |
19 | 130 |
/** |
131 |
* Default constructor |
|
132 |
*/ |
|
133 |
||
134 |
CGetLoc(); |
|
135 |
TInt DoInitialiseL(); |
|
136 |
||
137 |
private: |
|
138 |
||
139 |
||
140 |
||
141 |
||
142 |
/** |
|
143 |
* Class Member which holds location server subsession |
|
144 |
*/ |
|
145 |
RPositioner iPositioner; |
|
146 |
||
147 |
/** |
|
148 |
* Basic info |
|
149 |
*/ |
|
150 |
TPositionInfo iPositionInfo; |
|
151 |
||
152 |
||
153 |
/** |
|
154 |
* Basic info base |
|
155 |
*/ |
|
156 |
TPositionInfoBase* iPosInfoBase; |
|
157 |
/** |
|
158 |
* Generic info |
|
159 |
*/ |
|
160 |
HPositionGenericInfo *iGenericPosInfo ; |
|
161 |
/** |
|
162 |
* callback object |
|
163 |
*/ |
|
164 |
MLocationCallBack *iCallBack ; |
|
165 |
||
166 |
/** |
|
167 |
* Request type (Getlocation or Trace) |
|
168 |
*/ |
|
169 |
TInt iRequestType ; |
|
170 |
||
171 |
TInt iRequestStatus; |
|
172 |
||
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
173 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
174 |
* Pointer to CLocationService used in RunL() |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
175 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
176 |
CLocationService* iLocationService; |
19 | 177 |
|
178 |
}; |
|
179 |
||
180 |
||
181 |
||
182 |
#endif //C_LOCATIONCOREIMP_H |
|
183 |
||
184 |