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 the License "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 * Declaration of class CWmlBrowserFavouritesIncrementalOp. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef WML_BROWSER_FAVOURITES_INCREMENTAL_OP |
|
22 #define WML_BROWSER_FAVOURITES_INCREMENTAL_OP |
|
23 |
|
24 // INCLUDE FILES |
|
25 |
|
26 #include <e32base.h> |
|
27 #include <AknProgressDialog.h> |
|
28 |
|
29 // FORWARD DECLARATION |
|
30 |
|
31 class CBrowserFavouritesModel; |
|
32 class CAknWaitDialog; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Base incremental operation with a wait dialog; an Active Object. |
|
38 * Pure virtual. |
|
39 */ |
|
40 class CBrowserFavouritesIncrementalOp: |
|
41 public CAsyncOneShot, public MProgressDialogCallback |
|
42 { |
|
43 public: // construct / destruct |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~CBrowserFavouritesIncrementalOp(); |
|
49 |
|
50 public: // new methods |
|
51 |
|
52 /** |
|
53 * Start the operation and exclude the caller from the Active Scheduler |
|
54 * until done (this method returns when the operation is done). |
|
55 */ |
|
56 void ExecuteL(); |
|
57 |
|
58 protected: // construct / destruct |
|
59 |
|
60 /** |
|
61 * Constructor. |
|
62 * @param aPriority Active Object priority. |
|
63 * @param aModel Data model. |
|
64 */ |
|
65 CBrowserFavouritesIncrementalOp |
|
66 ( |
|
67 CBrowserFavouritesModel& aModel, |
|
68 TInt aPriority = CActive::EPriorityStandard |
|
69 ); |
|
70 |
|
71 /** |
|
72 * Second phase constructor. |
|
73 */ |
|
74 void ConstructL(); |
|
75 |
|
76 protected: // new methods |
|
77 |
|
78 /** |
|
79 * Perform next step. Derived classes must provide this method. |
|
80 * @return Number of steps to come (0 if done). |
|
81 */ |
|
82 virtual TInt StepL() = 0; |
|
83 |
|
84 /** |
|
85 * Create and prepare the wait note. |
|
86 */ |
|
87 virtual void CreateWaitNoteLC() = 0; |
|
88 |
|
89 /** |
|
90 * Called when all steps successfully executed; wait note is finished, |
|
91 * but waiting has not been ended. Not called if cancelled or in case of |
|
92 * any error. After this call ExecuteL returns. |
|
93 * Empty implementation provided. |
|
94 */ |
|
95 virtual void DoneL(); |
|
96 |
|
97 protected: // from CActive |
|
98 |
|
99 /** |
|
100 * Perform one step (or quit if finished). |
|
101 */ |
|
102 void RunL(); |
|
103 |
|
104 /** |
|
105 * Cancel protocol implementation. |
|
106 */ |
|
107 void DoCancel(); |
|
108 |
|
109 /** |
|
110 * Error handling: abandon operation. |
|
111 */ |
|
112 TInt RunError( TInt aError ); |
|
113 |
|
114 protected: // from MProgressDialogCallback |
|
115 |
|
116 /** |
|
117 * Callback method; gets called when a dialog is dismissed. |
|
118 * (This is where iWait is stopped - we wait for the dialog). |
|
119 * @param aButtonId Button id. |
|
120 */ |
|
121 void DialogDismissedL( TInt aButtonId ); |
|
122 |
|
123 protected: // data |
|
124 |
|
125 CBrowserFavouritesModel* iModel; ///< Data model. Not owned. |
|
126 CAknWaitDialog* iWaitNote; ///< Wait note. Owned. |
|
127 |
|
128 private: // data |
|
129 |
|
130 CActiveSchedulerWait* iWait; ///< Wait object. Owned. |
|
131 |
|
132 }; |
|
133 |
|
134 #endif |
|
135 // End of File |
|