|
1 /* |
|
2 * Copyright (c) 2005-2009 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: Base class for SUPL subsessions |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __C_SUPLIPCSUBSESSION_H__ |
|
22 #define __C_SUPLIPCSUBSESSION_H__ |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <lbspositioninfo.h> |
|
27 #include <epos_suplterminal.h> |
|
28 |
|
29 #include "epos_csuplsessionbase.h" |
|
30 |
|
31 #include "epos_csuplsessionrequest.h" |
|
32 #include "epos_msuplsessionobserver.h" |
|
33 #include "epos_csuplsettings.h" |
|
34 #include "epos_csuplsettingsinternal.h" |
|
35 #include "epos_csuplsettingparams.h" |
|
36 |
|
37 |
|
38 // CONSTANTS |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 |
|
42 // CLASS DECLARATION |
|
43 |
|
44 /** |
|
45 * This class provides functionality common to all SUPL subsessions. |
|
46 */ |
|
47 class CSuplIPCSubSession : public CObject,public MSuplSessionObserver |
|
48 { |
|
49 |
|
50 public: // Constructor & Destructor |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 */ |
|
55 static CSuplIPCSubSession* NewLC(CSuplSessionManager& aSessnMgr, |
|
56 CSUPLProtocolManagerBase::TSuplReqType aReqType, |
|
57 TInt aIpcSessionId, |
|
58 RSuplTerminalSubSession::TSuplServiceType aSuplService); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 virtual ~CSuplIPCSubSession(); |
|
64 |
|
65 public: // New functions |
|
66 /** |
|
67 * This function is responsible for handling the |
|
68 * servicing of client requests to the server. |
|
69 * It uses the message passed as an argument to |
|
70 * obtain the request opcode and to access client |
|
71 * addresses for reading and writing. |
|
72 * |
|
73 * @param aMessage The current message |
|
74 */ |
|
75 void ServiceL( |
|
76 /* IN */ const RMessage2& aMessage |
|
77 ); |
|
78 /** |
|
79 * Called when the server class is shutting down. |
|
80 */ |
|
81 void NotifyServerShutdown(); |
|
82 void DestroySession(CSuplSessionManager& aSessnMgr); |
|
83 |
|
84 |
|
85 void ProtocolHUnloaded(); |
|
86 |
|
87 void CompleteGetServerAddress(const RMessage2& aMessage, TInt aReason); |
|
88 TInt PackServerAddressData(const RMessage2& aMessage); |
|
89 TInt PackTriggerData(const RMessage2& aMessage); |
|
90 |
|
91 |
|
92 public: // from MSuplSessionObserver |
|
93 |
|
94 void CompleteRunSession(TInt aReason); |
|
95 void CompleteTriggerRunSession(TInt aReason); |
|
96 void CompleteGetPositionRequest(const RMessage2& aMessage, TInt aReason); |
|
97 void CompleteTriggerFiredNotifyRequest(TInt aReason); |
|
98 TInt PackPositionData(const RMessage2& aMessage); |
|
99 |
|
100 private: |
|
101 |
|
102 CSuplIPCSubSession(); |
|
103 |
|
104 void ConstructL(CSuplSessionManager& aSessnMgr, |
|
105 CSUPLProtocolManagerBase::TSuplReqType aReqType, |
|
106 TInt aIpcSessionId, |
|
107 RSuplTerminalSubSession::TSuplServiceType aSuplService); |
|
108 |
|
109 // By default, prohibit copy constructor |
|
110 CSuplIPCSubSession( const CSuplIPCSubSession& ); |
|
111 // Prohibit assigment operator |
|
112 CSuplIPCSubSession& operator= ( const CSuplIPCSubSession& ); |
|
113 |
|
114 void HandleRunSessionL( |
|
115 /* IN */ const RMessage2& aMessage); |
|
116 |
|
117 void HandleGetPositionL(const RMessage2& aMessage); |
|
118 void HandleGenericGetPositionL(const RMessage2& aMessage); |
|
119 void HandleRunSessionCancelRequestL(const RMessage2& aMessage); |
|
120 void HandleGetServerAddressL(const RMessage2& aMessage); |
|
121 |
|
122 /* |
|
123 * For Periodic Trigger Seesion |
|
124 */ |
|
125 void HandlePeriodicTriggerSessionL(const RMessage2& aMessage); |
|
126 void HandlePeriodicTriggerSessionWithServernameL(const RMessage2& aMessage); |
|
127 void HandleStopTriggerringSessionL(const RMessage2& aMessage); |
|
128 void HandleNotifyTriggerFiredL(const RMessage2& aMessage); |
|
129 |
|
130 private: // Data |
|
131 CSuplSessionBase* iSuplSession; |
|
132 CSuplSessionRequest* iSuplSessnReq; |
|
133 RMessage2 iMessage; |
|
134 HBufC8* iPositionBuffer; |
|
135 TInt iReqType; |
|
136 RSuplTerminalSubSession::TSuplServiceType iSuplService; |
|
137 }; |
|
138 |
|
139 |
|
140 #endif // __CSuplIPCSubSession_H__ |
|
141 |
|
142 // End of File |