|
1 /* |
|
2 * Copyright (c) 2005 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: |
|
15 * Active object and base class for subclasses implementing a SUPL session |
|
16 * request cycle. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef __CSuplSessionRequest_H__ |
|
23 #define __CSuplSessionRequest_H__ |
|
24 |
|
25 // INCLUDE FILES |
|
26 #include <e32base.h> |
|
27 #include <lbspositioninfo.h> |
|
28 #include <epos_suplterminalqop.h> |
|
29 #include <epos_suplterminaltrigger.h> |
|
30 #include "epos_suplgeocellinfo.h" |
|
31 |
|
32 // CONSTANT DECLARATIONS |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class MSuplSessionObserver; |
|
36 class MNetInitiatedObserver; |
|
37 class CSuplSessionManager; |
|
38 class CSuplSessionBase; |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * Active object implementing a position request cycle. Handles |
|
43 * activities such as controlling logging and verifying privacy. |
|
44 * |
|
45 */ |
|
46 class CSuplSessionRequest : public CActive |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 static CSuplSessionRequest* NewL(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MSuplSessionObserver* aObserver); |
|
54 static CSuplSessionRequest* NewL(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MNetInitiatedObserver* aObserver); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 virtual ~CSuplSessionRequest(); |
|
60 |
|
61 public: // New functions |
|
62 |
|
63 /** |
|
64 * Starts a SUPL session request cycle. |
|
65 * @param aMessage the request message from the client |
|
66 */ |
|
67 void MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn, TInt aSetCaps, TInt aReqId, TBool aFirstReq); |
|
68 void MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn, TInt aSetCaps, TInt aReqId, TSuplTerminalQop& aQop, TBool aFirstReq); |
|
69 void MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn, const TDesC& aHslpAddress, TBool aFallBack, TInt aSetCaps, TInt aReqId, TBool aFirstReq); |
|
70 void MakeSuplSessionRequestL(CSuplSessionBase* aSuplSessn, const TDesC& aHslpAddress, TBool aFallBack, TInt aSetCaps, TInt aReqId, TSuplTerminalQop& aQop, TBool aFirstReq); |
|
71 |
|
72 void MakeSuplSessionTriggerringRequestL( |
|
73 CSuplSessionBase* aSuplSessn, |
|
74 TSuplTerminalPeriodicTrigger& aPTrigger, |
|
75 TInt aSetCaps, |
|
76 TInt aReqId |
|
77 ); |
|
78 |
|
79 void MakeSuplSessionTriggerringRequestL( |
|
80 CSuplSessionBase* aSuplSessn, |
|
81 TSuplTerminalPeriodicTrigger& aPTrigger, |
|
82 const TDesC& aHslpAddress, |
|
83 TBool aFallBack, |
|
84 TInt aSetCaps, |
|
85 TInt aReqId |
|
86 ); |
|
87 |
|
88 void NotifyTriggerFiredRequestL( |
|
89 CSuplSessionBase* aSuplSessn, |
|
90 TSuplTriggerFireInfo& aFireInfo |
|
91 ); |
|
92 |
|
93 /** |
|
94 * Called when the server class is shutting down. |
|
95 */ |
|
96 void NotifyServerShutdown(); |
|
97 |
|
98 void ForwardMessageRequestL(CSuplSessionBase* aSuplSessn,TInt aHandle,HBufC8* clientBuf); |
|
99 |
|
100 void CancelRunSessionRequest(); |
|
101 |
|
102 void CancelTriggerringRequest(); |
|
103 |
|
104 void ProtocolHUnloaded(); |
|
105 |
|
106 void MakeLocationConversionRequestL( CSuplSessionBase* aSuplSessn,TGeoCellInfo& aCellInfo ); |
|
107 |
|
108 void CancelLocationConversionRequest(); |
|
109 void ReIssueRequestL(); |
|
110 |
|
111 protected: // From CActive |
|
112 |
|
113 void RunL(); |
|
114 TInt RunError(TInt aError); |
|
115 void DoCancel(); |
|
116 |
|
117 private: |
|
118 |
|
119 CSuplSessionRequest(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MSuplSessionObserver* aObserver); |
|
120 |
|
121 CSuplSessionRequest(CSuplSessionManager& aSessnMgr, CSuplSessionBase* aSuplSessn, MNetInitiatedObserver* aObserver); |
|
122 void ConstructL(); |
|
123 |
|
124 // By default, prohibit copy constructor |
|
125 CSuplSessionRequest( const CSuplSessionRequest& ); |
|
126 // Prohibit assigment operator |
|
127 CSuplSessionRequest& operator= ( const CSuplSessionRequest& ); |
|
128 void CompleteSelf(TInt aReason); |
|
129 |
|
130 private: // Data |
|
131 |
|
132 enum TSuplRequestStage |
|
133 { |
|
134 ESuplReqInactive = 0, |
|
135 ESuplSessionRequest, |
|
136 ESuplCancelRunSessionRequest, |
|
137 ESuplForwardMessage, |
|
138 ESuplStartTriggerRequest, |
|
139 ESuplStopTriggerRequest, |
|
140 ESuplTriggerFiredNotifyRequest, |
|
141 ESuplWaitingToRetrySession, |
|
142 ESuplRetryingSession, |
|
143 ESuplLocationConversionRequest, |
|
144 ESuplCancelLocationConversionRequest |
|
145 }; |
|
146 |
|
147 TSuplRequestStage iRequestPhase; |
|
148 HBufC8* iPositionBuffer; |
|
149 MSuplSessionObserver* iObserver; |
|
150 MNetInitiatedObserver* iNetObserver; |
|
151 CSuplSessionManager& iSessnMgr; |
|
152 CSuplSessionBase* iSuplSessn; |
|
153 TInt iHandle; |
|
154 |
|
155 CSuplSessionBase* iParamSuplSessn; |
|
156 TInt iParamSetCaps; |
|
157 TInt iParamReqId; |
|
158 TBool iParamFallback; |
|
159 TBool iParamFirstReq; |
|
160 TBool iParamExtendedQopUsed; |
|
161 TSuplTerminalQop iParamQop; |
|
162 HBufC* iParamExtendedFallback; |
|
163 }; |
|
164 |
|
165 #endif // __CSuplSessionRequest_H__ |
|
166 |
|
167 // End of File |