|
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 * Implementation of CWmlBrowserFavouritesIncrementalOp. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 |
|
23 #include <AknWaitDialog.h> |
|
24 #include <BrowserNG.rsg> |
|
25 #include <eikenv.h> |
|
26 #include "BrowserFavouritesIncrementalOp.h" |
|
27 #include "BrowserFavouritesModel.h" |
|
28 #include "Browser.hrh" |
|
29 |
|
30 // ================= MEMBER FUNCTIONS ======================= |
|
31 |
|
32 // --------------------------------------------------------- |
|
33 // CBrowserFavouritesIncrementalOp::~CBrowserFavouritesIncrementalOp |
|
34 // --------------------------------------------------------- |
|
35 // |
|
36 CBrowserFavouritesIncrementalOp::~CBrowserFavouritesIncrementalOp() |
|
37 { |
|
38 // Base class cancels. |
|
39 delete iWaitNote; // Safety code. |
|
40 if ( iWait && iWait->IsStarted() ) // Safety code. |
|
41 { |
|
42 iWait->AsyncStop(); |
|
43 } |
|
44 delete iWait; |
|
45 } |
|
46 |
|
47 // --------------------------------------------------------- |
|
48 // CBrowserFavouritesIncrementalOp::ExecuteL |
|
49 // --------------------------------------------------------- |
|
50 // |
|
51 void CBrowserFavouritesIncrementalOp::ExecuteL() |
|
52 { |
|
53 CreateWaitNoteLC(); |
|
54 iWaitNote->SetCallback( this ); |
|
55 iWaitNote->RunLD(); |
|
56 Call(); // Schedule first step. |
|
57 iWait->Start(); // Wait for completion. |
|
58 } |
|
59 |
|
60 // --------------------------------------------------------- |
|
61 // CBrowserFavouritesIncrementalOp::CBrowserFavouritesIncrementalOp |
|
62 // --------------------------------------------------------- |
|
63 // |
|
64 CBrowserFavouritesIncrementalOp::CBrowserFavouritesIncrementalOp |
|
65 ( |
|
66 CBrowserFavouritesModel& aModel, |
|
67 TInt aPriority /*=CActive::EPriorityStandard*/ |
|
68 ) |
|
69 : CAsyncOneShot( aPriority ), iModel( &aModel ) |
|
70 { |
|
71 // Base class adds this to the Active Scheduler. |
|
72 } |
|
73 |
|
74 // --------------------------------------------------------- |
|
75 // CBrowserFavouritesIncrementalOp::ConstructL |
|
76 // --------------------------------------------------------- |
|
77 // |
|
78 void CBrowserFavouritesIncrementalOp::ConstructL() |
|
79 { |
|
80 iWait = new (ELeave) CActiveSchedulerWait(); |
|
81 } |
|
82 |
|
83 // --------------------------------------------------------- |
|
84 // CBrowserFavouritesIncrementalOp::DoneL |
|
85 // --------------------------------------------------------- |
|
86 // |
|
87 void CBrowserFavouritesIncrementalOp::DoneL() |
|
88 { |
|
89 // Default is do nothing. |
|
90 } |
|
91 |
|
92 // --------------------------------------------------------- |
|
93 // CBrowserFavouritesIncrementalOp::RunL |
|
94 // --------------------------------------------------------- |
|
95 // |
|
96 void CBrowserFavouritesIncrementalOp::RunL() |
|
97 { |
|
98 if ( StepL() ) |
|
99 { |
|
100 // More steps to go. |
|
101 Call(); |
|
102 } |
|
103 else |
|
104 { |
|
105 // This call deletes the dialog and NULL-s ptr. When dialog goes down, |
|
106 // DialogDismisedL will be called, and we call DoneL() and stop |
|
107 // waiting there. |
|
108 iWaitNote->ProcessFinishedL(); |
|
109 } |
|
110 } |
|
111 |
|
112 // --------------------------------------------------------- |
|
113 // CBrowserFavouritesIncrementalOp::DoCancel |
|
114 // --------------------------------------------------------- |
|
115 // |
|
116 void CBrowserFavouritesIncrementalOp::DoCancel() |
|
117 { |
|
118 delete iWaitNote; |
|
119 iWaitNote = NULL; |
|
120 iWait->AsyncStop(); |
|
121 } |
|
122 |
|
123 // --------------------------------------------------------- |
|
124 // CBrowserFavouritesIncrementalOp::RunError |
|
125 // --------------------------------------------------------- |
|
126 // |
|
127 TInt CBrowserFavouritesIncrementalOp::RunError( TInt aError ) |
|
128 { |
|
129 // Own part of error processing: clean up the wait note and terminate |
|
130 // the waiting. Then propagate the error up to base classes. |
|
131 delete iWaitNote; |
|
132 iWaitNote = NULL; |
|
133 iWait->AsyncStop(); |
|
134 return aError; |
|
135 } |
|
136 |
|
137 // --------------------------------------------------------- |
|
138 // CBrowserFavouritesIncrementalOp::DialogDismissedL |
|
139 // --------------------------------------------------------- |
|
140 // |
|
141 void CBrowserFavouritesIncrementalOp::DialogDismissedL( TInt /*aButtonId*/ ) |
|
142 { |
|
143 DoneL(); |
|
144 iWait->AsyncStop(); |
|
145 } |
|
146 // End of File |