author | William Roberts <williamr@symbian.org> |
Thu, 22 Jul 2010 16:47:01 +0100 | |
branch | GCC_SURGE |
changeset 49 | 5f20f71a57a3 |
parent 19 | bdd4df282e3e |
parent 40 | 18280709ae43 |
permissions | -rw-r--r-- |
36 | 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: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
||
21 |
/** |
|
22 |
@file |
|
23 |
@internalComponent |
|
24 |
@released |
|
25 |
*/ |
|
26 |
||
27 |
#ifndef CPOSDIALOGCTRL_H |
|
28 |
#define CPOSDIALOGCTRL_H |
|
29 |
||
30 |
// INCLUDES |
|
31 |
#include <e32base.h> |
|
32 |
#include <lbs/epos_cposrequestor.h> |
|
33 |
#include <lbs/epos_rposrequestorstack.h> |
|
34 |
#include <lbs/EPos_TPosQNInputData.h> |
|
35 |
#include "EPos_PrivacyInternal.h" |
|
36 |
#include <lbs/lbsloccommon.h> |
|
37 |
||
38 |
// DATA TYPES |
|
39 |
||
40 |
// FORWARD DECLARATIONS |
|
41 |
||
42 |
// CLASS DECLARATION |
|
43 |
||
44 |
/** |
|
45 |
* Base class for controlling plugin privacy dialogs. |
|
46 |
* Uses the notifier plugin framework. |
|
47 |
*/ |
|
48 |
class CPosDialogCtrl : public CActive |
|
49 |
{ |
|
50 |
public: // Constructor |
|
51 |
||
52 |
/** |
|
53 |
* Two-phased constructor. |
|
54 |
*/ |
|
55 |
static CPosDialogCtrl* InstanceL(); |
|
56 |
||
57 |
/** |
|
58 |
* Destructor. |
|
59 |
*/ |
|
60 |
virtual ~CPosDialogCtrl(); |
|
61 |
||
62 |
public: // New functions |
|
63 |
||
64 |
/** |
|
65 |
* Queues a launch of the notification dialog. |
|
66 |
* If no leave occurs, this class takes ownership of the entry list. |
|
67 |
* Do not call Close() or ResetAndDestroy() on the entry list after |
|
68 |
* function has been called. |
|
69 |
* @param aEntryList The entries involved in the request. |
|
70 |
* @param aRequestData Contains data for notification requests. |
|
71 |
*/ |
|
72 |
void NotifyL( |
|
73 |
TLbsExternalRequestInfo& aRequestInfo, |
|
74 |
/* IN */ const TPosRequestData& aRequestData |
|
75 |
); |
|
76 |
||
77 |
/** |
|
78 |
* Queues a launch of the verification dialog. |
|
79 |
* @param aStatus Asynchronous request status. |
|
80 |
* @param aEntryList The entries to verify. |
|
81 |
* @param aRequestData Contains data for verification requests. |
|
82 |
*/ |
|
83 |
void VerifyL( |
|
84 |
/* IN/OUT */ TRequestStatus& aStatus, |
|
85 |
TLbsExternalRequestInfo& aRequestInfo, |
|
86 |
/* IN */ const TPosRequestData& aRequestData |
|
87 |
); |
|
88 |
||
89 |
/** |
|
90 |
* Cancels a verification request. |
|
91 |
* @param aStatus Asynchronous request status for the request to cancel. |
|
92 |
*/ |
|
93 |
void CancelLaunch( |
|
94 |
/* IN/OUT */ TRequestStatus& aStatus |
|
95 |
); |
|
96 |
||
97 |
/** |
|
98 |
* Cancels a verification request. |
|
99 |
* @param aStatus Asynchronous request status for the request to cancel. |
|
100 |
* @param aErrorCode An error code. |
|
101 |
* @param aResponse The user response |
|
102 |
* @param aRequestQueued Whether the request is queued or not. |
|
103 |
* @param aCancelReason The cancel reason. |
|
104 |
*/ |
|
105 |
void CancelLaunch( |
|
106 |
/* IN/OUT */ TRequestStatus& aStatus, |
|
107 |
/* OUT */ TInt& aErrorCode, |
|
108 |
/* OUT */ TInt& aResponse, |
|
109 |
/* OUT */ TBool& aRequestQueued, |
|
110 |
/* IN */ TPosVerifyCancelReason aCancelReason = |
|
111 |
EPosCancelReasonNotAvailable |
|
112 |
); |
|
113 |
||
114 |
/** |
|
115 |
* Returns whether or not the dialog is showing. |
|
116 |
* @return ETrue if a request is active, EFalse otherwise. |
|
117 |
*/ |
|
118 |
TBool DialogActive() const; |
|
119 |
||
120 |
protected: // Functions from base classes |
|
121 |
||
122 |
/** |
|
123 |
* From CActive |
|
124 |
* |
|
125 |
* Handles request completion. |
|
126 |
*/ |
|
127 |
void RunL(); |
|
128 |
||
129 |
/** |
|
130 |
* From CActive |
|
131 |
* |
|
132 |
* Implements cancel of an outstanding request. |
|
133 |
*/ |
|
134 |
void DoCancel(); |
|
135 |
||
136 |
private: |
|
137 |
||
138 |
struct TRequest |
|
139 |
{ |
|
140 |
TPosQNInputData::TPosRequestType iType; |
|
141 |
TPosQNRequestId iId; |
|
142 |
TLbsExternalRequestInfo* iRequestInfo; |
|
143 |
TRequestStatus* iStatus; |
|
144 |
TPosRequestSource iRequestSource; |
|
145 |
TPosRequestDecision iTimeoutStrategy; |
|
146 |
TPosRequestDecision iRequestDecision; |
|
147 |
TPosVerifyCancelReason iCancelReason; |
|
148 |
TPosNotificationReason iNotificationReason; |
|
149 |
}; |
|
150 |
||
151 |
/** |
|
152 |
* C++ default constructor. |
|
153 |
*/ |
|
154 |
CPosDialogCtrl(); |
|
155 |
||
156 |
/** |
|
157 |
* By default EPOC constructor is private. |
|
158 |
*/ |
|
159 |
void ConstructL(); |
|
160 |
||
161 |
// By default, prohibit copy constructor |
|
162 |
CPosDialogCtrl( const CPosDialogCtrl& ); |
|
163 |
// Prohibit assigment operator |
|
164 |
CPosDialogCtrl& operator= ( const CPosDialogCtrl& ); |
|
165 |
||
166 |
void NextRequest(); |
|
167 |
||
168 |
void DoCompleteRequest( |
|
169 |
/* IN */ TInt aIndex, |
|
170 |
/* IN */ TInt aCompletionCode |
|
171 |
); |
|
172 |
||
173 |
void ScheduleRequestL( |
|
174 |
/* IN */ TRequest& aRequest |
|
175 |
); |
|
176 |
||
177 |
TInt StartNotifierRequest(); |
|
178 |
||
179 |
void CreateSerializedStackL( |
|
180 |
/* OUT */ TDes8& aBuffer, |
|
181 |
/* IN */ const RPosRequestorStack& aRequestStack |
|
182 |
); |
|
183 |
||
184 |
TInt CalcSize( |
|
185 |
/* IN */ const RPosRequestorStack& aRequestStack |
|
186 |
); |
|
187 |
||
188 |
void ExtractRequestorsL( |
|
189 |
const TLbsExternalRequestInfo& aRequestInfo, |
|
190 |
RPosRequestorStack& aRequestors |
|
191 |
); |
|
192 |
||
193 |
void AddRequestorL( |
|
194 |
CPosRequestor::TRequestorType aRequestorType, |
|
195 |
TLbsExternalRequestInfo::TFormatIndicator aIdType, |
|
196 |
CPosRequestor::TRequestType aRequestType, |
|
197 |
CPosRequestor::TNetworkType aNetworkType, |
|
198 |
const TDesC& aId, |
|
199 |
RPosRequestorStack& aRequestors |
|
200 |
); |
|
201 |
||
202 |
void GivePriorityToVerificationL( |
|
203 |
/* IN */ TRequest& aRequest |
|
204 |
); |
|
205 |
||
206 |
void EnqueueRequestL( |
|
207 |
/* IN */ TRequest& aRequest |
|
208 |
); |
|
209 |
||
210 |
void DeferNotificationL(); |
|
211 |
void CreateNotificationAndEnqueueL(); |
|
40
18280709ae43
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
212 |
void UpdateProperty(); |
18280709ae43
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
213 |
|
36 | 214 |
private: // Data |
215 |
RNotifier iNotifier; |
|
216 |
RArray<TRequest> iRequestQueue; |
|
217 |
TInt iRequestId; |
|
218 |
TBool iNotifierStarted; |
|
219 |
TBool iNotifierActive; |
|
220 |
}; |
|
221 |
||
222 |
#endif // CPOSDIALOGCTRL_H |
|
223 |
||
224 |
// End of File |