|
1 /* |
|
2 * Copyright (c) 2002-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: Class for doing asynchronous service. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_COMASUPLPOSREQUESTOR_H |
|
21 #define C_COMASUPLPOSREQUESTOR_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include "lbs/epos_tomasuplallowedcapabilities.h" |
|
25 |
|
26 class COMASuplPosSessionBase; |
|
27 class COMASuplInfoRequest; |
|
28 class COMASuplInfoRequestList; |
|
29 class COMASuplTrace; |
|
30 class COMASuplSETCapabilities; |
|
31 class MOMASuplMsgStateObserver; |
|
32 class COMASuplPosition; |
|
33 |
|
34 class TOMASuplAllowedCapabilities; |
|
35 class TOMASuplPositioningMethod; |
|
36 |
|
37 /** |
|
38 Class for doing asynchronous service i.e. used for POS Handler. |
|
39 */ |
|
40 |
|
41 class COMASuplPOSRequestor : public CActive |
|
42 { |
|
43 |
|
44 public: |
|
45 enum TPOSRequestType |
|
46 { |
|
47 EPOS_SESSION_INITIALIZE = 0, |
|
48 EPOS_GET_SUPL_INFO, |
|
49 EPOS_GET_POSITION, |
|
50 EPOS_IDEAL |
|
51 }; |
|
52 public : // Constructor |
|
53 |
|
54 /** |
|
55 * NewL Method. |
|
56 * @since S60 3.1u |
|
57 * @param |
|
58 * @return Instance of COMASuplPOSRequestor |
|
59 */ |
|
60 static COMASuplPOSRequestor* NewL(MOMASuplMsgStateObserver* aObserver,COMASuplPosSessionBase* aPOSSession); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 ~COMASuplPOSRequestor(); |
|
66 |
|
67 public : |
|
68 |
|
69 /** |
|
70 * GetSuplInfoL Method. |
|
71 * @since S60 3.1u |
|
72 * @param None |
|
73 * @return Error code if function leaves otherwise KErrNone |
|
74 */ |
|
75 TInt GetSuplInfoL(); |
|
76 |
|
77 /** |
|
78 * GetPositionL Method. |
|
79 * @since S60 3.1u |
|
80 * @param position information |
|
81 * @return Error code if function leaves otherwise KErrNone |
|
82 */ |
|
83 TInt GetPositionL(COMASuplPosition* aPosition); |
|
84 |
|
85 /** |
|
86 * CancelRequest Method,Cancels any outstanding request if any |
|
87 * @since Series 60 3.1u |
|
88 * @param None |
|
89 * @return None |
|
90 */ |
|
91 void CancelRequest(); |
|
92 |
|
93 COMASuplInfoRequestList* GetOMASuplInfoRequestList(); |
|
94 |
|
95 void AppendInfoRequest(COMASuplInfoRequest* aSuplInfoRequest); |
|
96 |
|
97 TInt InitilizePOSSessionL(TInt aRequestId); |
|
98 |
|
99 /** |
|
100 * SetObserver Sets the observer that gets back data |
|
101 * from POS Message plugin |
|
102 * @since Series 60 3.1M |
|
103 * @param None |
|
104 * @return None |
|
105 */ |
|
106 |
|
107 void SetObserver(MOMASuplMsgStateObserver* aObserver); |
|
108 |
|
109 /** |
|
110 * CreateListL Creates the Info Request List |
|
111 * from POS Message plugin |
|
112 * @since Series 60 3.1M |
|
113 * @param None |
|
114 * @return None |
|
115 */ |
|
116 void CreateListL(); |
|
117 |
|
118 /** |
|
119 * DestroyList Destroys the Info Request List |
|
120 * @since Series 60 3.1M |
|
121 * @param None |
|
122 * @return None |
|
123 */ |
|
124 void DestroyList(); |
|
125 |
|
126 /** |
|
127 * SetPosMethodAndAllowedCapabilities send allowed capability and POS Method to POS Plug-in |
|
128 * @since |
|
129 * @param aPOSAllowedCapabilities The allowed capabilities |
|
130 * @param aPOSPositioningMethod The prefered positioning method |
|
131 * @return None |
|
132 */ |
|
133 void SetPosMethodAndAllowedCapabilities(TOMASuplAllowedCapabilities& aPOSAllowedCapabilities,COMASuplPosSessionBase::TOMASuplPositioningMethod aPOSPositioningMethod); |
|
134 /** |
|
135 * SetSLPAddressUsed send server address currently used for this session into the POS Plug-in |
|
136 * @since |
|
137 * @param aServerAddress The server address that is being used for this session |
|
138 * @return None |
|
139 */ |
|
140 void SetSLPAddressUsed(const TDesC& aServerAddress); |
|
141 private : |
|
142 //Constuctor |
|
143 COMASuplPOSRequestor(MOMASuplMsgStateObserver* aObserver,COMASuplPosSessionBase* aPOSSession); |
|
144 |
|
145 /** |
|
146 * By default Symbian 2nd phase constructor is private. |
|
147 */ |
|
148 void ConstructL(); |
|
149 |
|
150 |
|
151 |
|
152 protected : // Functions from CActive |
|
153 /** |
|
154 * From CActive |
|
155 * To handle request completion |
|
156 */ |
|
157 void RunL(); |
|
158 |
|
159 /** |
|
160 * From CActive |
|
161 * To cancel the asynchronous requests |
|
162 */ |
|
163 void DoCancel(); |
|
164 /** |
|
165 * From CActive |
|
166 * To handle errors in asynchronous requests |
|
167 */ |
|
168 TInt RunError(TInt aError); |
|
169 |
|
170 private : //Data |
|
171 |
|
172 MOMASuplMsgStateObserver* iObserver; |
|
173 |
|
174 //POS Session ... |
|
175 //will not have ownership with this class |
|
176 COMASuplPosSessionBase* iPOSSession; |
|
177 |
|
178 // Info Requestor List |
|
179 COMASuplInfoRequestList* iOMASuplInfoRequestList; |
|
180 |
|
181 TPOSRequestType iPOSSessionRequestType; |
|
182 |
|
183 COMASuplPosSessionBase::TOMASuplPositioningMethod iPositioningMethod; |
|
184 |
|
185 TOMASuplAllowedCapabilities iAllowedCapabilities; |
|
186 |
|
187 //Trace Utility |
|
188 COMASuplTrace* iTrace; |
|
189 }; |
|
190 |
|
191 #endif |
|
192 |