|
1 /* |
|
2 * Copyright (c) 2002 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 * Operation progress reporting class. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __MSVPROGRESSREPORTEROPERATION_H__ |
|
22 #define __MSVPROGRESSREPORTEROPERATION_H__ |
|
23 |
|
24 |
|
25 // INCLUDES |
|
26 #include <msvapi.h> |
|
27 #include <msvprgreporter.h> |
|
28 |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CBaseMtmUi; |
|
32 class CMsvWrappableProgressDialog; |
|
33 |
|
34 |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Progress reporter operation. |
|
40 * |
|
41 * A 'super-operation' implementing the abstract progress reporter mixin |
|
42 * interface. This class encapsulates the operation; which provides the progress; |
|
43 * and the dialog that displays it. |
|
44 * |
|
45 */ |
|
46 class CMsvProgressReporterOperation : |
|
47 public CMsvOperation, |
|
48 public MMsvProgressReporter |
|
49 { |
|
50 public: |
|
51 /** |
|
52 * Creates new CMsvProgressReporterOperation operation |
|
53 * @param aMsvSession: reference to object of CMsvSession |
|
54 * @param aObserverRequestStatus: reference to TRequestStatus which is used when operation is completed |
|
55 * @param aImageIndex: index of the icon from avkon.mbm to be displayed in the progress note |
|
56 * @return: Object of class CMsvProgressReporterOperation. |
|
57 */ |
|
58 IMPORT_C static CMsvProgressReporterOperation* NewL( |
|
59 CMsvSession& aMsvSession, |
|
60 TRequestStatus& aObserverRequestStatus, |
|
61 TInt aImageIndex ); |
|
62 |
|
63 /** |
|
64 * @param aMsvSession: reference to object of CMsvSession |
|
65 * @param aObserverRequestStatus: reference to TRequestStatus which is used when operation is completed |
|
66 * @return: Object of class CMsvProgressReporterOperation. |
|
67 */ |
|
68 IMPORT_C static CMsvProgressReporterOperation* NewL( |
|
69 CMsvSession& aMsvSession, |
|
70 TRequestStatus& aObserverRequestStatus ); |
|
71 |
|
72 /** |
|
73 * Destructor |
|
74 */ |
|
75 IMPORT_C virtual ~CMsvProgressReporterOperation(); |
|
76 |
|
77 /** |
|
78 * @return: progress |
|
79 */ |
|
80 IMPORT_C virtual const TDesC8& ProgressL(); |
|
81 |
|
82 /** |
|
83 * Make progress visible |
|
84 */ |
|
85 IMPORT_C virtual void MakeProgressVisibleL( TBool aVisible ); |
|
86 |
|
87 /** |
|
88 * Sets text to the dialog |
|
89 */ |
|
90 IMPORT_C virtual void SetTitleL( const TDesC& aTitle ); |
|
91 |
|
92 /** |
|
93 * Sets text to the dialog |
|
94 */ |
|
95 IMPORT_C virtual void SetTitleL( TInt aTitleResourceId ); |
|
96 |
|
97 /** |
|
98 * @return mtm store |
|
99 */ |
|
100 IMPORT_C virtual CMtmStore& MtmStore(); |
|
101 |
|
102 /** |
|
103 * Sets if operation can be cancelled by user or not |
|
104 * @param aCanCancel: EFalse if operation cannot be cancelled by user, |
|
105 * ETrue otherwise |
|
106 */ |
|
107 IMPORT_C virtual void SetCanCancelL( TBool aCanCancel ); |
|
108 |
|
109 /** |
|
110 * Sets progress decoder. |
|
111 */ |
|
112 IMPORT_C virtual void SetProgressDecoder( MMsvProgressDecoder& aDecoder ); |
|
113 |
|
114 /** |
|
115 * Removes progress decoder. |
|
116 */ |
|
117 IMPORT_C virtual void UnsetProgressDecoder(); |
|
118 |
|
119 /** |
|
120 * Sets help context |
|
121 */ |
|
122 IMPORT_C virtual void SetHelpContext( const TCoeHelpContext& aContext ); |
|
123 |
|
124 /** |
|
125 * Sets animation |
|
126 */ |
|
127 IMPORT_C virtual void SetAnimationL( TInt aResourceId ); |
|
128 |
|
129 /** |
|
130 * Sets operations |
|
131 * Takes ownership of the operation so this class will delete |
|
132 * the operation. |
|
133 */ |
|
134 IMPORT_C void SetOperationL( CMsvOperation* aOp ); |
|
135 |
|
136 /** |
|
137 * Sets seeding |
|
138 */ |
|
139 IMPORT_C void SetSeeding( TBool aSeed ); |
|
140 |
|
141 /** |
|
142 * @return TRequestStatus |
|
143 */ |
|
144 IMPORT_C TRequestStatus& RequestStatus(); |
|
145 |
|
146 /** |
|
147 * @param aDelay, a boolean to set the delay on or off |
|
148 */ |
|
149 IMPORT_C void SetProgressVisibilityDelay( TBool aDelay ); |
|
150 |
|
151 /** |
|
152 * Creates new CMsvProgressReporterOperation operation |
|
153 * @param aProgressVisibilityDelayOff: constructs progress dialog without visibility delay. |
|
154 * @param aMsvSession: reference to object of CMsvSession |
|
155 * @param aObserverRequestStatus: reference to TRequestStatus which is used when operation is completed |
|
156 * @param aImageIndex: index of the icon from avkon.mbm to be displayed in the progress note |
|
157 * @return: Object of class CMsvProgressReporterOperation. |
|
158 */ |
|
159 IMPORT_C static CMsvProgressReporterOperation* NewL( |
|
160 TBool aProgressVisibilityDelayOff, |
|
161 CMsvSession& aMsvSession, |
|
162 TRequestStatus& aObserverRequestStatus, |
|
163 TInt aImageIndex ); |
|
164 |
|
165 /** |
|
166 * @param aProgressVisibilityDelayOff: constructs progress dialog without visibility delay. |
|
167 * @param aMsvSession: reference to object of CMsvSession |
|
168 * @param aObserverRequestStatus: reference to TRequestStatus which is used when operation is completed |
|
169 * @return: Object of class CMsvProgressReporterOperation. |
|
170 */ |
|
171 IMPORT_C static CMsvProgressReporterOperation* NewL( |
|
172 TBool aProgressVisibilityDelayOff, |
|
173 CMsvSession& aMsvSession, |
|
174 TRequestStatus& aObserverRequestStatus ); |
|
175 |
|
176 /** |
|
177 * SetCompleteWithExit |
|
178 * This function sets complete code |
|
179 * @param aCompleteWithExit, boolean to set if EEikCmdExit |
|
180 */ |
|
181 void SetCompleteWithExit( TBool aCompleteWithExit ); |
|
182 |
|
183 /** |
|
184 * Creates new CMsvProgressReporterOperation operation. With this method it is possible |
|
185 * to show note dialog with EWaitLayout(With wait note bar). |
|
186 * @param aProgressVisibilityDelayOff: constructs progress dialog without visibility delay. |
|
187 * @param aDisplayWaitAnimation if ETrue then shows note dialog with wait note bar |
|
188 * @param aMsvSession: reference to object of CMsvSession |
|
189 * @param aObserverRequestStatus: reference to TRequestStatus which is used when operation is completed |
|
190 * @param aImageIndex: index of the icon from avkon.mbm to be displayed in the progress note |
|
191 * @return: Object of class CMsvProgressReporterOperation. |
|
192 */ |
|
193 IMPORT_C static CMsvProgressReporterOperation* NewL( |
|
194 TBool aProgressVisibilityDelayOff, |
|
195 TBool aDisplayWaitAnimation, |
|
196 CMsvSession& aMsvSession, |
|
197 TRequestStatus& aObserverRequestStatus, |
|
198 TInt aImageIndex ); |
|
199 |
|
200 /** |
|
201 * Creates new CMsvProgressReporterOperation operation. |
|
202 * This method is used only when progress dialog is shown also in cover side. |
|
203 * @param aMsvSession: reference to object of CMsvSession |
|
204 * @param aObserverRequestStatus: reference to TRequestStatus which is used when operation is completed |
|
205 * @param aDialogIndex unique index to identify a dialog within the category. |
|
206 * @param aCategoryUid category uid |
|
207 * @return: Object of class CMsvProgressReporterOperation. |
|
208 */ |
|
209 IMPORT_C static CMsvProgressReporterOperation* NewL( |
|
210 CMsvSession& aMsvSession, |
|
211 TRequestStatus& aObserverRequestStatus, |
|
212 TInt aDialogIndex, |
|
213 TUid aCategoryUid ); |
|
214 |
|
215 /** |
|
216 * Publish new dialog on secondary display. |
|
217 * This method first dismisses the original dialog both from primary and |
|
218 * secondary displays. After that a new dialog is created and it is |
|
219 * published on secondary display with given parameters. |
|
220 * @param aDialogIndex unique index to identify a dialog within the category. |
|
221 * @param aCategoryUid category uid |
|
222 */ |
|
223 IMPORT_C void PublishNewDialogL( TInt aDialogIndex, TUid aCategoryUid ); |
|
224 |
|
225 protected: |
|
226 /** |
|
227 * from CActive |
|
228 */ |
|
229 virtual void DoCancel(); |
|
230 |
|
231 /** |
|
232 * from CActive |
|
233 */ |
|
234 virtual void RunL(); |
|
235 |
|
236 private: |
|
237 /** |
|
238 * internal |
|
239 * Completes observer with the aCode |
|
240 */ |
|
241 void CompleteObserver( TInt aCode ); |
|
242 |
|
243 private: |
|
244 /** |
|
245 * C++ constructor |
|
246 */ |
|
247 CMsvProgressReporterOperation( |
|
248 CMsvSession& aMsvSession, |
|
249 TRequestStatus& aObserverRequestStatus, |
|
250 TInt aImageIndex ); |
|
251 /** |
|
252 * Symbian OS constructor |
|
253 */ |
|
254 void ConstructL( |
|
255 TBool aProgressVisibilityDelayOff = EFalse, |
|
256 TBool aDisplayWaitAnimation = ETrue ); |
|
257 |
|
258 /** |
|
259 * Symbian OS constructor |
|
260 * This method is used only when progress dialog |
|
261 * is shown also in cover side. |
|
262 */ |
|
263 void ConstructL( |
|
264 TInt aDialogIndex, |
|
265 TUid aCategoryUid, |
|
266 TBool aProgressVisibilityDelayOff = EFalse, |
|
267 TBool aDisplayWaitAnimation = ETrue ); |
|
268 |
|
269 |
|
270 private: |
|
271 CMtmStore* iMtmStore; |
|
272 CMsvWrappableProgressDialog* iDialog; |
|
273 CMsvOperation* iOperation; |
|
274 TBufC8<1> iDummyProgress; |
|
275 TInt iImageIndex; |
|
276 TBool iCompleteWithExit; |
|
277 TBool iDisplayWaitAnimation; |
|
278 HBufC* iProgressString; |
|
279 }; |
|
280 |
|
281 #endif // __MSVPROGRESSREPORTEROPERATION_H__ |
|
282 |
|
283 // End of file |