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: Definition of the global progress dialog class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __OBEXUTILS_GLOBAL_PROGRESS_DIALOG__ |
|
22 #define __OBEXUTILS_GLOBAL_PROGRESS_DIALOG__ |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <stringresourcereader.h> |
|
27 #include <Obexutils.rsg> |
|
28 #include <avkon.rsg> // R_QGN_GRAF_WAIT_BAR_ANIM |
|
29 #include <AknGlobalNote.h> |
|
30 |
|
31 #include <coecntrl.h> |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CAknGlobalProgressDialog; |
|
35 |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 // Call back for progress bar |
|
40 NONSHARABLE_CLASS( MGlobalProgressCallback ) |
|
41 { |
|
42 public: |
|
43 virtual void HandleGlobalProgressDialogL( TInt aSoftkey ) = 0; |
|
44 }; |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 NONSHARABLE_CLASS( CGlobalProgressDialog ) : public CActive |
|
51 { |
|
52 public: // Constructors and destructor |
|
53 |
|
54 |
|
55 /** |
|
56 * Two-phased constructor. |
|
57 */ |
|
58 IMPORT_C static CGlobalProgressDialog* NewLC(MGlobalProgressCallback* aObserver); |
|
59 IMPORT_C static CGlobalProgressDialog* NewL(MGlobalProgressCallback* aObserver); |
|
60 |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 virtual ~CGlobalProgressDialog(); |
|
66 |
|
67 public: // New functions |
|
68 |
|
69 /** |
|
70 * Sets the icon for this dialog |
|
71 * @param aIconText Text of the icon |
|
72 * @param aIconFile File containing icon |
|
73 * @param aIconId Icon ID |
|
74 * @param aIconMaskId Icon mask ID |
|
75 * @return void |
|
76 */ |
|
77 void SetIconL( const TDesC& aIconText, const TDesC& aIconFile, |
|
78 TInt aIconId = 0, TInt aIconMaskId = -1 ); |
|
79 /** |
|
80 * Sets the image for the dialog |
|
81 * @param aImageFile Image filename |
|
82 * @param aImageId Image ID |
|
83 * @param aImageMaskId Image mask ID |
|
84 * @return void |
|
85 */ |
|
86 void SetImageL( const TDesC& aImageFile, TInt aImageId = 0, |
|
87 TInt aImageMaskId = -1 ); |
|
88 |
|
89 /** |
|
90 * Shows the progress dialog |
|
91 * @return void |
|
92 */ |
|
93 IMPORT_C void ShowProgressDialogL(TInt aStringId); |
|
94 IMPORT_C void ShowProgressDialogNameSizeL( TDesC& aFileName, |
|
95 TInt64 aFileSize); |
|
96 |
|
97 |
|
98 /** |
|
99 * Updates the progress dialog |
|
100 * @param aValue progress bar value |
|
101 * @param aFinalValue progress bar final value |
|
102 * @return void |
|
103 */ |
|
104 IMPORT_C void UpdateProgressDialog(TInt aValue, TInt aFinalValue); |
|
105 |
|
106 /** |
|
107 * Called to complete the global progress dialog |
|
108 * @return void |
|
109 */ |
|
110 IMPORT_C void ProcessFinished(); |
|
111 |
|
112 |
|
113 protected: // Functions from base classes |
|
114 |
|
115 /** |
|
116 * From CActive Active Object RunL() |
|
117 */ |
|
118 virtual void RunL(); |
|
119 |
|
120 /** |
|
121 * From CActive Active Object DoCancel() |
|
122 */ |
|
123 virtual void DoCancel(); |
|
124 |
|
125 |
|
126 private: |
|
127 |
|
128 /** |
|
129 * By default constructor is private. |
|
130 */ |
|
131 void ConstructL(MGlobalProgressCallback* aObserver); |
|
132 |
|
133 /** |
|
134 * C++ default constructor. |
|
135 */ |
|
136 CGlobalProgressDialog(); |
|
137 |
|
138 private: //data |
|
139 CAknGlobalProgressDialog* iProgressDialog; |
|
140 |
|
141 MGlobalProgressCallback* iKeyCallback; |
|
142 CStringResourceReader* iStringResourceReader; |
|
143 |
|
144 }; |
|
145 |
|
146 |
|
147 |
|
148 // Call back for note with animation and without animation |
|
149 NONSHARABLE_CLASS( MGlobalNoteCallback ) |
|
150 { |
|
151 public: |
|
152 virtual void HandleGlobalNoteDialogL( TInt aSoftkey ) = 0; |
|
153 }; |
|
154 |
|
155 |
|
156 |
|
157 NONSHARABLE_CLASS( CGlobalDialog ) : public CActive |
|
158 { |
|
159 public: // Constructors and destructor |
|
160 |
|
161 |
|
162 /** |
|
163 * Two-phased constructor. |
|
164 */ |
|
165 IMPORT_C static CGlobalDialog* NewLC(MGlobalNoteCallback* aObserver); |
|
166 IMPORT_C static CGlobalDialog* NewL(MGlobalNoteCallback* aObserver); |
|
167 |
|
168 |
|
169 /* |
|
170 * public functions |
|
171 */ |
|
172 IMPORT_C void ShowNoteDialogL( TInt aResourceId, TBool anAnimation); |
|
173 IMPORT_C void ShowErrorDialogL(TInt aResourceId); |
|
174 IMPORT_C void ProcessFinished(); |
|
175 |
|
176 /** |
|
177 * Destructor. |
|
178 */ |
|
179 virtual ~CGlobalDialog(); |
|
180 |
|
181 |
|
182 protected: // Functions from base classes |
|
183 |
|
184 /** |
|
185 * From CActive Active Object RunL() |
|
186 */ |
|
187 virtual void RunL(); |
|
188 |
|
189 /** |
|
190 * From CActive Active Object DoCancel() |
|
191 */ |
|
192 virtual void DoCancel(); |
|
193 |
|
194 |
|
195 private: |
|
196 |
|
197 /** |
|
198 * By default constructor is private. |
|
199 */ |
|
200 void ConstructL(MGlobalNoteCallback* aObserver); |
|
201 |
|
202 /** |
|
203 * C++ default constructor. |
|
204 */ |
|
205 CGlobalDialog(); |
|
206 |
|
207 private: //data |
|
208 |
|
209 MGlobalNoteCallback* iKeyCallback; |
|
210 CStringResourceReader* iStringResourceReader; |
|
211 CAknGlobalNote* iAknGlobalNote; |
|
212 TInt iWaitNoteID; |
|
213 |
|
214 }; |
|
215 |
|
216 |
|
217 |
|
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 |
|
225 |
|
226 #endif // __OBEXUTILS_GLOBAL_PROGRESS_DIALOG__ |
|