1 /* |
|
2 * Copyright (c) 2006 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: Global dialog handling |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_FILEMANAGERLOBALDLG_H |
|
20 #define C_FILEMANAGERLOBALDLG_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "MFileManagerGlobalDlgObserver.h" |
|
26 |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CFileManagerGlobalQueryDlg; |
|
30 class CAknGlobalProgressDialog; |
|
31 class CAknGlobalNote; |
|
32 |
|
33 |
|
34 // CLASS DECLARATION |
|
35 /** |
|
36 * This class handles global dialog wrapping |
|
37 * |
|
38 * @lib FileManagerView.lib |
|
39 * @since S60 3.1 |
|
40 */ |
|
41 class CFileManagerGlobalDlg : public CActive, |
|
42 public MFileManagerGlobalDlgObserver |
|
43 { |
|
44 |
|
45 public: // New functions |
|
46 // Global dialog types |
|
47 enum TType |
|
48 { |
|
49 ECountdownQuery = 0, |
|
50 EQuery, |
|
51 EProgressDialog, |
|
52 EErrorNote, |
|
53 EInfoNote, |
|
54 EQueryWithWarningIcon, |
|
55 EQueryWithInfoIcon |
|
56 }; |
|
57 |
|
58 /** |
|
59 * Two-phased constructor. |
|
60 */ |
|
61 IMPORT_C static CFileManagerGlobalDlg* NewL(); |
|
62 |
|
63 /** |
|
64 * Destructor |
|
65 */ |
|
66 IMPORT_C ~CFileManagerGlobalDlg(); |
|
67 |
|
68 /** |
|
69 * Sets global dialog observer |
|
70 * |
|
71 * @since S60 3.1 |
|
72 * @param aObserver Pointer to observer |
|
73 */ |
|
74 IMPORT_C void SetObserver( |
|
75 MFileManagerGlobalDlgObserver* aObserver ); |
|
76 |
|
77 /** |
|
78 * Cancels global dialog |
|
79 * |
|
80 * @since S60 3.1 |
|
81 */ |
|
82 IMPORT_C void CancelDialog(); |
|
83 |
|
84 /** |
|
85 * Shows global dialog |
|
86 * |
|
87 * @since S60 3.1 |
|
88 * @param aType Global dialog type |
|
89 * @param aText Text to display |
|
90 * @param aSkId Softkeys to display |
|
91 */ |
|
92 IMPORT_C void ShowDialogL( |
|
93 const CFileManagerGlobalDlg::TType aType, |
|
94 const TDesC& aText, |
|
95 const TInt aSkId = 0 ); |
|
96 |
|
97 /** |
|
98 * Shows global dialog |
|
99 * |
|
100 * @since S60 3.1 |
|
101 * @param aType Global dialog type |
|
102 * @param aTextId TextId to display |
|
103 * @param aSkId Softkeys to display |
|
104 */ |
|
105 IMPORT_C void ShowDialogL( |
|
106 const CFileManagerGlobalDlg::TType aType, |
|
107 const TInt aTextId, |
|
108 const TInt aSkId = 0 ); |
|
109 |
|
110 /** |
|
111 * Updates global progress dialog |
|
112 * |
|
113 * @since S60 3.1 |
|
114 * @param aValue Current progress value |
|
115 * @param aFinalValue Final progress value |
|
116 */ |
|
117 IMPORT_C void UpdateProgressDialog( |
|
118 const TInt aValue, |
|
119 const TInt aFinalValue = - 1); |
|
120 |
|
121 /** |
|
122 * Finishes global progress dialog |
|
123 * |
|
124 * @since S60 3.1 |
|
125 */ |
|
126 IMPORT_C void ProcessFinished(); |
|
127 |
|
128 private: // From CActive |
|
129 /** |
|
130 * @see CActive |
|
131 */ |
|
132 void DoCancel(); |
|
133 |
|
134 /** |
|
135 * @see CActive |
|
136 */ |
|
137 void RunL(); |
|
138 |
|
139 private: // From MFileManagerGlobalDlgObserver |
|
140 void HandleGlobalDlgResult( |
|
141 TInt aDlgType, |
|
142 TInt aDlgResult ); |
|
143 |
|
144 private: |
|
145 /** |
|
146 * Constructors |
|
147 */ |
|
148 CFileManagerGlobalDlg(); |
|
149 |
|
150 void ConstructL(); |
|
151 |
|
152 /** |
|
153 * Countdown timer callback |
|
154 * @param aPtr Pointer to this class instance |
|
155 */ |
|
156 static TInt CountdownCB( TAny* aPtr ); |
|
157 |
|
158 /** |
|
159 * Countdown timer callback |
|
160 */ |
|
161 void CountdownL(); |
|
162 |
|
163 /** |
|
164 * Starts countdown |
|
165 * @param aTimeout Timeout value |
|
166 */ |
|
167 void StartCountdownL( const TUint aTimeout ); |
|
168 |
|
169 /** |
|
170 * Notifies global dialog observer |
|
171 * @param aValue Value to notify |
|
172 */ |
|
173 void NotifyObserver( const TInt aValue ); |
|
174 |
|
175 private: // Data |
|
176 /** |
|
177 * Pointer to global query dialog |
|
178 * Own. |
|
179 */ |
|
180 CFileManagerGlobalQueryDlg* iQueryDialog; |
|
181 |
|
182 /** |
|
183 * Pointer to global progress dialog |
|
184 * Own. |
|
185 */ |
|
186 CAknGlobalProgressDialog* iProgressDialog; |
|
187 |
|
188 /** |
|
189 * Pointer to countdown step timer |
|
190 * Own. |
|
191 */ |
|
192 CPeriodic* iCountdown; |
|
193 |
|
194 /** |
|
195 * Steps to countdown |
|
196 */ |
|
197 TInt iCountdownSteps; |
|
198 |
|
199 /** |
|
200 * Pointer to global dialog observer |
|
201 * Not own. |
|
202 */ |
|
203 MFileManagerGlobalDlgObserver* iObserver; |
|
204 |
|
205 /** |
|
206 * Global dialog type |
|
207 */ |
|
208 TType iType; |
|
209 |
|
210 /** |
|
211 * Global progress dialog final value |
|
212 */ |
|
213 TInt iFinalValue; |
|
214 |
|
215 /** |
|
216 * Pointer to countdown text |
|
217 * Own. |
|
218 */ |
|
219 HBufC* iCountdownText; |
|
220 }; |
|
221 |
|
222 #endif // C_FILEMANAGERLOBALDLG_H |
|
223 |
|
224 // End of File |
|