|
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 CPOSPRIVMANAGER_H |
|
28 #define CPOSPRIVMANAGER_H |
|
29 |
|
30 // INCLUDES |
|
31 #include <e32base.h> |
|
32 #include "EPos_PrivacyInternal.h" |
|
33 #include <lbs/lbsloccommon.h> |
|
34 |
|
35 // DATA TYPES |
|
36 enum TPosVerActivity |
|
37 { |
|
38 EPosInactive, |
|
39 EPosResolvingForVerification, |
|
40 EPosResolvingForNotification, |
|
41 EPosVerifying, |
|
42 EPosCancelBeforeDialog, |
|
43 EPosCancelDuringDialog, |
|
44 EPosCancelAfterDialog1, |
|
45 EPosCancelAfterDialog2 |
|
46 }; |
|
47 |
|
48 // FORWARD DECLARATIONS |
|
49 class CPosDialogCtrl; |
|
50 |
|
51 // CLASS DECLARATION |
|
52 |
|
53 /** |
|
54 * Handles all requests to the privacy server. |
|
55 */ |
|
56 class CPosPrivManager : public CActive |
|
57 { |
|
58 public: // Constructors and destructor |
|
59 |
|
60 enum TEPosPrivacyResult |
|
61 { |
|
62 EVerifyReject, |
|
63 EVerifyAccept, |
|
64 EVerifyAskUser |
|
65 }; |
|
66 |
|
67 /** |
|
68 * Two-phased constructor. |
|
69 * @return A new instance of this class. |
|
70 */ |
|
71 static CPosPrivManager* NewL(); |
|
72 |
|
73 /** |
|
74 * Destructor. |
|
75 */ |
|
76 virtual ~CPosPrivManager(); |
|
77 |
|
78 public: // New functions |
|
79 |
|
80 /** |
|
81 * Performs verification. |
|
82 * @param aMessage The verification request. |
|
83 * @param aRequestorStack The involved contacts and services. |
|
84 * @param aRequestData Contains data for verification requests. |
|
85 * @param aRequestId The request id. |
|
86 */ |
|
87 void VerifyL( |
|
88 /* IN */ TRequestStatus& aRequestStatus, |
|
89 /* IN */ const TLbsExternalRequestInfo& aRequestInfo, |
|
90 /* IN */ const TPosRequestData& aRequestData, |
|
91 /* IN */ TInt aRequestId |
|
92 ); |
|
93 |
|
94 /** |
|
95 * Cancels verification. |
|
96 */ |
|
97 void CancelVerify(); |
|
98 |
|
99 /** |
|
100 * Cancels verification. |
|
101 * @param aCancelReason A cancel reason. |
|
102 * @param aMessage The cancel request. |
|
103 */ |
|
104 void CancelVerifyL( |
|
105 /* IN */ TPosVerifyCancelReason aCancelReason |
|
106 ); |
|
107 |
|
108 /** |
|
109 * Performs notification |
|
110 * @param aMessage The notification request. |
|
111 * @param aRequestorStack The involved contacts and services. |
|
112 * @param aRequestData Contains data for notification requests. |
|
113 * @param aRequestId The request id associated with this notification. |
|
114 */ |
|
115 void NotifyL( |
|
116 /* IN */ TRequestStatus& aRequestStatus, |
|
117 /* IN */ const TLbsExternalRequestInfo& aRequestInfo, |
|
118 /* IN */ const TPosRequestData& aRequestData, |
|
119 /* IN */ TInt aRequestId |
|
120 ); |
|
121 |
|
122 protected: // Functions from base classes |
|
123 |
|
124 /** |
|
125 * From CActive Handles asynchronous request completion. |
|
126 */ |
|
127 void RunL(); |
|
128 |
|
129 /** |
|
130 * From CActive Cancels any outstanding request. |
|
131 */ |
|
132 void DoCancel(); |
|
133 |
|
134 /** |
|
135 * From CActive Handles a leave in RunL. |
|
136 * @param aError The RunL leave code. |
|
137 * @return Always KErrNone, because all errors are handled |
|
138 */ |
|
139 TInt RunError( |
|
140 /* IN */ TInt aError |
|
141 ); |
|
142 |
|
143 private: |
|
144 |
|
145 /** |
|
146 * C++ default constructor. |
|
147 */ |
|
148 CPosPrivManager(); |
|
149 |
|
150 /** |
|
151 * By default EPOC constructor is private. |
|
152 */ |
|
153 void ConstructL(); |
|
154 |
|
155 // By default, prohibit copy constructor |
|
156 CPosPrivManager( const CPosPrivManager& ); |
|
157 // Prohibit assigment operator |
|
158 CPosPrivManager& operator= ( const CPosPrivManager& ); |
|
159 |
|
160 private: // New functions |
|
161 |
|
162 void ResolveL(); |
|
163 |
|
164 void CompleteRequestL(TInt aCompleteCode); |
|
165 |
|
166 void NotifyPluginL(); |
|
167 |
|
168 TBool IsVerifying() const; |
|
169 |
|
170 private: // Data |
|
171 |
|
172 CPosDialogCtrl* iDlgCtrl; |
|
173 |
|
174 TRequestStatus* iRequestStatus; |
|
175 TLbsExternalRequestInfo* iRequestInfo; |
|
176 TPosVerActivity iActivity; |
|
177 |
|
178 TInt iRequestId; |
|
179 |
|
180 TPosRequestData iRequestData; |
|
181 TInt iUserResponse; |
|
182 |
|
183 TUint iLastVerificationResult; |
|
184 |
|
185 }; |
|
186 |
|
187 #endif // CPOSPRIVMANAGER_H |
|
188 |
|
189 // End of File |