|
1 /* |
|
2 * Copyright (c) 2010 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: Verifier plug-in which derives from CPosPrivacyNotifier. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDES |
|
20 |
|
21 #ifndef CLPDVERIFIERDLG_H |
|
22 #define CLPDVERIFIERDLG_H |
|
23 |
|
24 #include "lpdrequestao.h" |
|
25 #include "lpdresulthandler.h" |
|
26 |
|
27 #include <epos_cposprivacynotifier.h> |
|
28 #include <lbs/epos_privacy.h> |
|
29 #include <lbs/epos_cposrequestor.h> |
|
30 // SYSTEM INCLUDE |
|
31 #include <bldvariant.hrh> // For the 3.2 Flag |
|
32 |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CLpdVerifierQueryLauncher; |
|
36 class CLpdNotifierQueryLauncher; |
|
37 class CLpdRequestorProcessor; |
|
38 class CLocRequestorUtilsResolver; |
|
39 |
|
40 |
|
41 // CLASS DECLARATION |
|
42 |
|
43 /** |
|
44 * Verifier plug-in which derives from CPosPrivacyNotifier. |
|
45 * Notifiers are based on RNotifier framework, and this particular |
|
46 * notifier is used to launch a privacy query for accepting/rejecting |
|
47 * privacy requests. It also shows informational notes and error |
|
48 * messages, which are received as notification. |
|
49 * |
|
50 * @lib locverifierdlg.lib |
|
51 * @since 2.1 |
|
52 */ |
|
53 class CLpdVerifierPlugin : public CPosPrivacyNotifier, public MLpdResultHandler |
|
54 { |
|
55 // To allow calls to HandleNextRequest() from active object |
|
56 friend class CLpdRequestAO; |
|
57 |
|
58 private: |
|
59 |
|
60 |
|
61 public: // Constructors and destructor |
|
62 |
|
63 /** |
|
64 * Two-phased constructor. |
|
65 * @return created object |
|
66 */ |
|
67 static CLpdVerifierPlugin* NewL(); |
|
68 |
|
69 /** |
|
70 * Destructor. |
|
71 */ |
|
72 virtual ~CLpdVerifierPlugin(); |
|
73 |
|
74 /** |
|
75 * Method for cancelling query or freeing |
|
76 * resources after finishing query. |
|
77 */ |
|
78 void FreeQueryResources(); |
|
79 |
|
80 public: // Functions from base classes |
|
81 |
|
82 /** |
|
83 * From CPosPrivacyNotifier, called when a new request arrives. |
|
84 * @param aRequestId identifier of received request |
|
85 */ |
|
86 void HandleNewRequestL( TPosQNRequestId aRequestId ); |
|
87 |
|
88 /** |
|
89 * From CPosPrivacyNotifier, called when request has been cancelled |
|
90 * @param aRequestId identifier of cancelled request |
|
91 */ |
|
92 void HandleRequestCancelled( TPosQNRequestId aRequestId ); |
|
93 |
|
94 /** |
|
95 * From CPosPrivacyNotifier, called when all requests are cancelled. |
|
96 */ |
|
97 void HandleAllRequestCancelled(); |
|
98 |
|
99 /** |
|
100 * From MLpdResultHandler, called when verification result is available. |
|
101 * @param aResultCode |
|
102 */ |
|
103 void HandleVerificationResultL( TInt aResultCode ); |
|
104 |
|
105 /** |
|
106 * From MLpdResultHandler, called when notification has been done. |
|
107 * @param aResultCode |
|
108 */ |
|
109 void HandleNotificationResultL( TInt aResultCode ); |
|
110 |
|
111 /** |
|
112 * From MLpdResultHandler, called if leave occurred in callback method |
|
113 * @param aError code |
|
114 */ |
|
115 void HandleLeave( TInt aError ); |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 protected: // New functions |
|
121 |
|
122 /** |
|
123 * Non-leaving internal method for handling next pending request. |
|
124 */ |
|
125 void HandleNextRequest(); |
|
126 |
|
127 /** |
|
128 * Internal method for handling next pending request. |
|
129 */ |
|
130 void HandleNextRequestL(); |
|
131 |
|
132 /** |
|
133 * Internal helper method used by HandleNextRequestL(). |
|
134 */ |
|
135 void HandleNextVerificationL(); |
|
136 |
|
137 /** |
|
138 * Internal helper method used by HandleNextRequestL(). |
|
139 */ |
|
140 void HandleNextNotificationL(); |
|
141 |
|
142 /** |
|
143 * Internal helper method used by HandleNextNotificationL(). |
|
144 */ |
|
145 void HandleNextNonPeriodicNotificationL(); |
|
146 |
|
147 |
|
148 /** |
|
149 * Internal helper method. |
|
150 * Completes current request and continues queue handling. |
|
151 */ |
|
152 void CompleteCurrentAndContinue( TInt aResultCode ); |
|
153 |
|
154 /** |
|
155 * Handles assert errors. Panics in debug build but leaves in release |
|
156 * build, as this component runs in EikSrv and must never panic. |
|
157 */ |
|
158 void HandleAssertErrorL() const; |
|
159 |
|
160 /** |
|
161 * Panics in debug build but does nothing in release build. |
|
162 */ |
|
163 void HandleDebugAssertError() const; |
|
164 |
|
165 |
|
166 |
|
167 |
|
168 private: |
|
169 |
|
170 /** |
|
171 * C++ default constructor. |
|
172 */ |
|
173 CLpdVerifierPlugin(); |
|
174 |
|
175 /** |
|
176 * By default Symbian 2nd phase constructor is private. |
|
177 */ |
|
178 void ConstructL(); |
|
179 |
|
180 |
|
181 |
|
182 /** |
|
183 * Checks the type of request and helps to know |
|
184 * if a given request is of SUPL periodic type |
|
185 * @param aCurrentRequest request id |
|
186 * @return CPosRequestor::TRequestType type of request enum |
|
187 */ |
|
188 CPosRequestor::TRequestType CheckRequestTypeL(); |
|
189 |
|
190 |
|
191 private: // Data |
|
192 |
|
193 |
|
194 |
|
195 // Identifier of currently handled request |
|
196 TPosQNRequestId iCurrentRequest; |
|
197 |
|
198 // Type of the current request, valid if iCurrentRequest valid |
|
199 TRequestType iCurrentRequestType; |
|
200 |
|
201 // Result code of verifier query, needed if user cancels rule query |
|
202 TInt iVerifyResult; |
|
203 |
|
204 |
|
205 // Location request accept/reject query object |
|
206 CLpdVerifierQueryLauncher* iVerifierQuery; // owns |
|
207 |
|
208 // Location request accept/reject query object |
|
209 CLpdNotifierQueryLauncher* iNotifier; // owns |
|
210 |
|
211 // Active object, used to let requests run to |
|
212 // completion instead of recursive calls. |
|
213 CLpdRequestAO* iRequestActiveObject; // owns |
|
214 |
|
215 CLpdRequestorProcessor* iRtorProcessor; // owns |
|
216 |
|
217 CLocRequestorUtilsResolver* iUtils; // owns |
|
218 |
|
219 |
|
220 }; |
|
221 |
|
222 #endif // CLPDVERIFIERDLG_H |
|
223 |
|
224 // End of File |