|
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 privacy notifier extension helper. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 /** |
|
22 @file |
|
23 @internalComponent |
|
24 @released |
|
25 */ |
|
26 |
|
27 #ifndef CPOSPRIVACYNOTIFIEREXTENSION_H |
|
28 #define CPOSPRIVACYNOTIFIEREXTENSION_H |
|
29 |
|
30 // INCLUDES |
|
31 #include <eiknotapi.h> |
|
32 #include <lbs/epos_rposrequestorstack.h> |
|
33 #include <lbs/EPos_TPosQNInputData.h> |
|
34 #include <EPos_CPosPrivacyNotifier.h> |
|
35 // FORWARD DECLARATIONS |
|
36 class CPosRequestHandler; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * The privacy notifier extension helper class. |
|
42 */ |
|
43 NONSHARABLE_CLASS(CPosPrivacyNotifierExtension) : public CBase, public MEikSrvNotifierBase2 |
|
44 { |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 */ |
|
50 static CPosPrivacyNotifierExtension* NewL( |
|
51 CPosPrivacyNotifier* aPrivNotifier); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CPosPrivacyNotifierExtension(); |
|
57 |
|
58 public: // New functions |
|
59 |
|
60 /** |
|
61 * Finds the request id in the array which matches the specified |
|
62 * request id. |
|
63 * @param aRequestId The id of a query or notification request. |
|
64 * @return The index of the matching request id within the array. |
|
65 * KErrNotFound, if no matching request id can be found. |
|
66 */ |
|
67 TInt Find(TPosQNRequestId aRequestId) const; |
|
68 |
|
69 /** |
|
70 * Resets data |
|
71 */ |
|
72 void ResetData(); |
|
73 |
|
74 /** |
|
75 * Removes a request from the array containing all outstanding requests. |
|
76 * @param aRequestId The id of a query or notification request. |
|
77 * @return The index of the matching request id within the array. |
|
78 * KErrNotFound, if no matching request id can be found. |
|
79 */ |
|
80 TInt RemoveRequestFromArray(TPosQNRequestId aRequestId); |
|
81 |
|
82 /** |
|
83 * Empties the array containing all outstanding requests. |
|
84 */ |
|
85 // void RemoveAllRequestsFromArray(); |
|
86 |
|
87 /** |
|
88 * Prepares the current request by getting RequestorStack. |
|
89 */ |
|
90 void PrepareL(TPosQNRequestId aRequestId); |
|
91 |
|
92 /** |
|
93 * This method completes a privacy query or notification request. |
|
94 * |
|
95 * @param aRequestId The id of the privacy query or notification request |
|
96 * to complete. |
|
97 * @param aCompletionCode The request completion code. |
|
98 */ |
|
99 void CompleteRequest( |
|
100 /* IN */ TPosQNRequestId aRequestId, |
|
101 /* IN */ TInt aCompletionCode |
|
102 ); |
|
103 |
|
104 /** |
|
105 * This method completes all outstanding requests. |
|
106 * |
|
107 * This function should be used if a serious error is encountered. All |
|
108 * requests can then be completed with the same error code. |
|
109 * |
|
110 * @param aCompletionCode The request completion code. |
|
111 */ |
|
112 void CompleteAllRequests( |
|
113 /* IN */ TInt aCompletionCode |
|
114 ); |
|
115 |
|
116 public: // Functions from base classes |
|
117 |
|
118 /** |
|
119 * From MEikSrvNotifierBase2 Called to destroy notifier. |
|
120 */ |
|
121 void Release(); |
|
122 |
|
123 /** |
|
124 * From MEikSrvNotifierBase2 Called when the DLL is loaded. |
|
125 * @return info object containing UID, channel and priority |
|
126 */ |
|
127 TNotifierInfo RegisterL(); |
|
128 |
|
129 /** |
|
130 * From MEikSrvNotifierBase2 |
|
131 * @return info object containing UID, channel and priority |
|
132 */ |
|
133 TNotifierInfo Info() const; |
|
134 |
|
135 /** |
|
136 * From MEikSrvNotifierBase2 |
|
137 * |
|
138 * Not supported, leaves if called. |
|
139 * @param aBuffer Input descriptor. Not used. |
|
140 * @return TPtrC8 |
|
141 */ |
|
142 TPtrC8 StartL(const TDesC8& aBuffer); |
|
143 |
|
144 /** |
|
145 * From MEikSrvNotifierBase2 |
|
146 * |
|
147 * @param aBuffer Input descriptor, contains the format. Not used. |
|
148 * @param aReplySlot Reply slot. Not used. |
|
149 * @param aMessage Used to write data back to client |
|
150 */ |
|
151 void StartL( |
|
152 const TDesC8& aBuffer, |
|
153 TInt aReplySlot, |
|
154 const RMessagePtr2& aMessage |
|
155 ); |
|
156 |
|
157 /** |
|
158 * From MEikSrvNotifierBase2 |
|
159 * Cancels all outstanding requests. |
|
160 */ |
|
161 void Cancel(); |
|
162 |
|
163 /** |
|
164 * From MEikSrvNotifierBase2 |
|
165 * Starts the notifier dialog. |
|
166 * @param aBuffer Input descriptor, contains the format. |
|
167 * A TPosQNInputData is expected as input. |
|
168 * @return TPtrC8 |
|
169 */ |
|
170 TPtrC8 UpdateL(const TDesC8& aBuffer); |
|
171 |
|
172 private: |
|
173 /** |
|
174 * C++ default constructor. |
|
175 */ |
|
176 CPosPrivacyNotifierExtension(); |
|
177 |
|
178 /** |
|
179 * By default Symbian 2nd phase constructor is private. |
|
180 */ |
|
181 void ConstructL(CPosPrivacyNotifier* aPrivNotifier); |
|
182 |
|
183 // By default, prohibit copy constructor |
|
184 CPosPrivacyNotifierExtension(const CPosPrivacyNotifierExtension&); |
|
185 // Prohibit assigment operator |
|
186 CPosPrivacyNotifierExtension& operator= ( |
|
187 const CPosPrivacyNotifierExtension&); |
|
188 |
|
189 public: // Data |
|
190 TNotifierInfo iNotifierInfo; |
|
191 RArray<TPosQNInputData> iRequestArray; |
|
192 TPosQNRequestId iCurrentRequestId; |
|
193 RPosRequestorStack iRequestorStack; |
|
194 RMessagePtr2 iMessage; |
|
195 |
|
196 private: // Data |
|
197 CPosPrivacyNotifier* iPrivacyNotifier; |
|
198 CPosRequestHandler* iRequestHandler; |
|
199 |
|
200 }; |
|
201 |
|
202 #endif // CPOSPRIVACYNOTIFIEREXTENSION_H |
|
203 |
|
204 // End of File |