|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef LBS_POSREQUESTHANDLER_H |
|
23 #define LBS_POSREQUESTHANDLER_H |
|
24 |
|
25 // System |
|
26 #include <e32base.h> |
|
27 #include <lbspositioninfo.h> |
|
28 #include <lbs/lbssuplproxyposclient.h> |
|
29 #include <lbs/epos_comasuplposition.h> |
|
30 #include <lbssatellite.h> |
|
31 |
|
32 //Component |
|
33 |
|
34 |
|
35 class MRequestHandlerObserver |
|
36 { |
|
37 public: |
|
38 virtual void OnGetPositionComplete(TInt aError) = 0; |
|
39 virtual void OnGetSuplInfoComplete(TInt aError) = 0; |
|
40 }; |
|
41 |
|
42 /** |
|
43 * This Class Handles verification requests. |
|
44 */ |
|
45 NONSHARABLE_CLASS(CSuplPosRequestHandler) : public CActive |
|
46 { |
|
47 public: |
|
48 |
|
49 enum TRequestType |
|
50 { |
|
51 ENone, // no request outstanding |
|
52 EGetPosition, // getposition request outstanding |
|
53 EGetSuplInfo, // getsuplinfo request outstanding |
|
54 }; |
|
55 |
|
56 static CSuplPosRequestHandler* NewL(MRequestHandlerObserver& aObserver, RSuplProxyPosSubSession& aSubSession); |
|
57 |
|
58 virtual ~CSuplPosRequestHandler(); |
|
59 |
|
60 public: |
|
61 void GetPositionL(COMASuplPosition* aPosition); |
|
62 void CancelGetPosition(); |
|
63 void GetSuplInfoL(COMASuplInfoRequestList* aSuplInfoRequestList); |
|
64 void CancelGetSuplInfoL(); |
|
65 void ResetState(); |
|
66 private: // From CActive |
|
67 |
|
68 void RunL(); |
|
69 void DoCancel(); |
|
70 TInt RunError(TInt aError); |
|
71 |
|
72 private: |
|
73 // c'tor |
|
74 CSuplPosRequestHandler(MRequestHandlerObserver& aObserver, RSuplProxyPosSubSession& aSubSession); |
|
75 // Fills in the OMA position member from the LBS position info member |
|
76 void FillOMAPositionL(const TPositionInfoBase& aLbsPosition, COMASuplPosition* aSuplPosition); |
|
77 // Fills in the OMA SuplInfoRequestList |
|
78 TInt FillSuplInfoListL(); |
|
79 // whether the stored SuplInfoRequestList includes a pospayload request |
|
80 TBool RequestMaskIncludesPosPayload(); |
|
81 // sets the request mask in the structure we pass to SPPM based for GetSuplInfoL() |
|
82 void SetRequestMaskFromSuplInfoListL(); |
|
83 private: // Data |
|
84 // the subsession to use for making requests to LBS subsystem |
|
85 RSuplProxyPosSubSession& iSubSession; |
|
86 // passed by the client to store the returned position. Ownership not taken. |
|
87 COMASuplPosition* iOmaPosition; |
|
88 // observer to inform when async request completes |
|
89 MRequestHandlerObserver& iObserver; |
|
90 // Passed to the LBS subsystem to be filled with position |
|
91 TPositionCourseInfo iPosition; // pass in the biggest container we might need? |
|
92 // the type of request we are currently waiting for |
|
93 TRequestType iRequestOutstanding; |
|
94 // passed by the client to store the returned supl info. Ownership not taken. |
|
95 COMASuplInfoRequestList* iSuplInfoReqList; |
|
96 // Passed to the SPPM to be filled with supl info (not including any pospayload) |
|
97 TSuplInfoRequestData iSuplInfoRequestData; |
|
98 // Passed to the SPPM to be filled with pospayload if one requested in GetSuplInfoL() |
|
99 HBufC8* iPosPayload; |
|
100 // Indicates whether we have already seen a GetSuplInfoL() request for pospayload + velocity |
|
101 TBool iFirstSUPLPOSPosPayloadProcessed; |
|
102 }; |
|
103 |
|
104 #endif // LBS_POSREQUESTHANDLER_H |
|
105 |
|
106 |