|
1 /* |
|
2 * Copyright (c) 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 "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: Implementation of COMASuplPosSessionBase |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_COMASUPLPOSSESSION_H |
|
20 #define C_COMASUPLPOSSESSION_H |
|
21 |
|
22 |
|
23 #include <lbs/epos_comasuplpossessionbase.h> |
|
24 |
|
25 |
|
26 /** |
|
27 * Reference implementation of COMASuplPosSessionBase |
|
28 * @since S60 3.1u |
|
29 */ |
|
30 class COMASuplPosSession : public COMASuplPosSessionBase |
|
31 , public virtual CActive |
|
32 { |
|
33 |
|
34 public: // Constructors and destructor |
|
35 |
|
36 /** |
|
37 * Factory function that instantiates a new object of COMASuplPosSession |
|
38 * |
|
39 * @since S60 v3.1u |
|
40 */ |
|
41 static COMASuplPosSessionBase* NewL( MOMASuplObserver* aSuplObserver ); |
|
42 |
|
43 /** |
|
44 * Destructor |
|
45 * |
|
46 * @since S60 v3.0 |
|
47 */ |
|
48 ~COMASuplPosSession(); |
|
49 |
|
50 public: |
|
51 |
|
52 /** |
|
53 * From COMASuplPosSessionBase |
|
54 * Initializes the instance of COMASuplPosSession |
|
55 * @since S60 v3.1u |
|
56 */ |
|
57 void InitializeL( const TInt aRequestID, TRequestStatus &aStatus ); |
|
58 |
|
59 /** |
|
60 * From COMASuplPosSessionBase |
|
61 * Cancels an outstanding request to initialize |
|
62 * @since S60 v3.1u |
|
63 */ |
|
64 void CancelInitialize(); |
|
65 |
|
66 /** |
|
67 * From COMASuplPosSessionBase |
|
68 * Handles SUPL POS payload |
|
69 * @since S60 v3.1u |
|
70 */ |
|
71 void HandleSuplPosMessageL( const COMASuplPosPayload *aPosPayload ); |
|
72 |
|
73 /** |
|
74 * From COMASuplPosSessionBase |
|
75 * Provides different POS parameters to the SUPL FW |
|
76 * @since S60 v3.1u |
|
77 */ |
|
78 void GetSuplInfoL( COMASuplInfoRequestList *aInfoRequestList, |
|
79 TRequestStatus &aStatus ); |
|
80 |
|
81 /** |
|
82 * From COMASuplPosSessionBase |
|
83 * Cancels an outstanding request to GetSuplInfoL |
|
84 * @since S60 v3.1u |
|
85 */ |
|
86 void CancelSuplInfoRequest(); |
|
87 |
|
88 /** |
|
89 * From COMASuplPosSessionBase |
|
90 * Provides position estimates to the SUPL FW |
|
91 * @since S60 v3.1u |
|
92 */ |
|
93 void GetPositionL( TRequestStatus &aStatus, |
|
94 COMASuplPosition* aPosition ); |
|
95 |
|
96 /** |
|
97 * From COMASuplPosSessionBase |
|
98 * Cancels an outstanding request to GetPositionL |
|
99 * @since S60 v3.1u |
|
100 */ |
|
101 void CancelGetPosition(); |
|
102 |
|
103 /** |
|
104 * From COMASuplPosSessionBase |
|
105 * Terminates a SUPL POS Session |
|
106 * @since S60 v3.1u |
|
107 */ |
|
108 void SessionEnd(); |
|
109 |
|
110 |
|
111 private: |
|
112 |
|
113 /** |
|
114 * Creates an IPC connection with the SUPL gateway, forwards |
|
115 * the request and terminates the connection |
|
116 * @since S60 v3.1u |
|
117 */ |
|
118 COMASuplPosSession( MOMASuplObserver* aSuplObserver ); |
|
119 |
|
120 /** |
|
121 * From CActive |
|
122 * Request completion event handler |
|
123 * @since S60 v3.1u |
|
124 */ |
|
125 void RunL(); |
|
126 |
|
127 /** |
|
128 * From CActive |
|
129 * Called to cancel outanding requests |
|
130 * @since S60 v3.1u |
|
131 */ |
|
132 void DoCancel(); |
|
133 |
|
134 /** |
|
135 * From CActive |
|
136 * Called to handle leave in RunL |
|
137 * @since S60 v3.1u |
|
138 */ |
|
139 TInt RunError(TInt aError); |
|
140 /** |
|
141 * Completes an asynchronous request with KErrNone |
|
142 * @since S60 v3.1u |
|
143 */ |
|
144 void IdleComplete(); |
|
145 |
|
146 /** |
|
147 * Cancels an outstanding request |
|
148 * @since S60 v3.1u |
|
149 */ |
|
150 void CancelRequest(); |
|
151 |
|
152 private: |
|
153 |
|
154 /** |
|
155 * State information of an instance of COMASuplPosSession |
|
156 */ |
|
157 enum TPosSessionState |
|
158 { |
|
159 EInitialize, |
|
160 EGetSuplInfo, |
|
161 EGetPosition |
|
162 }; |
|
163 |
|
164 /** |
|
165 * Contains the client request status |
|
166 */ |
|
167 TRequestStatus* iClientStatus; |
|
168 |
|
169 /** |
|
170 * Contains the request ID |
|
171 */ |
|
172 TInt iRequestID; |
|
173 |
|
174 /** |
|
175 * A flag field to determine if the instance of COMASuplPosSession |
|
176 * was initialized |
|
177 */ |
|
178 TBool iIsInitialized; |
|
179 |
|
180 /** |
|
181 * Data field to hold the state information |
|
182 */ |
|
183 TPosSessionState iState; |
|
184 |
|
185 /** |
|
186 * Data field to hold the position estimates. The ownership of this |
|
187 * object is not taken. |
|
188 */ |
|
189 COMASuplPosition* iPosition; |
|
190 |
|
191 /** |
|
192 * Data field to hold the SUPL Info Request List. The ownership |
|
193 * of this object is not taken. |
|
194 */ |
|
195 COMASuplInfoRequestList* iSuplInfoReqList; |
|
196 |
|
197 /** |
|
198 * Data field to hold the payload information. The instance of |
|
199 * COMASuplPosSession instantiates this object and also takes |
|
200 * ownership of the same. |
|
201 */ |
|
202 COMASuplPosPayload* iPosPayload; |
|
203 |
|
204 }; |
|
205 |
|
206 |
|
207 #endif // C_COMASUPLPOSSESSION_H |