1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /* |
|
21 * File: ExtProgressDialog.h |
|
22 * Created: 17-10-2005 |
|
23 * Author: |
|
24 * |
|
25 */ |
|
26 |
|
27 #ifndef EXTPROGRESSDIALOG_H |
|
28 #define EXTPROGRESSDIALOG_H |
|
29 |
|
30 #include <akndialog.h> |
|
31 #include <coecobs.h> |
|
32 #include <ConeResLoader.h> |
|
33 |
|
34 // Forward Declarations |
|
35 class CFbsBitmap; |
|
36 class CEikLabel; |
|
37 class CEikProgressInfo; |
|
38 class CExtProgressContainer; |
|
39 class CExtProgressNoteAnimationControl; |
|
40 |
|
41 /* CLASS: MExtProgressDialogCallback |
|
42 * |
|
43 * |
|
44 */ |
|
45 class MExtProgressDialogCallback |
|
46 { |
|
47 public: |
|
48 |
|
49 /** DialogDismissedL |
|
50 * |
|
51 * Callback method. Gets called when a dialog is dismissed. |
|
52 * |
|
53 * @param aButtonId - id of the button pressed |
|
54 * @return - |
|
55 */ |
|
56 virtual void DialogDismissedL( TInt aButtonId ) = 0; |
|
57 |
|
58 }; |
|
59 |
|
60 /* CLASS: CExtProgressDialog |
|
61 * |
|
62 * |
|
63 * Usage: |
|
64 * |
|
65 * iProgNote = new (ELeave) CExtProgressDialog (&iProgNote, iBitmap1, iBitmap2); |
|
66 * iProgNote->PrepareLC(R_WAIT_DIALOG); |
|
67 * iProgNote->GetProgressInfoL()->SetFinalValue (aFinalValue); |
|
68 * iProgNote->StartAnimationL(); |
|
69 * iProgNote->SetTextL( aPrompt ); |
|
70 * iProgNote->SetCallback (this); |
|
71 * iProgNote->RunLD(); |
|
72 * |
|
73 * Resource definition: |
|
74 * |
|
75 * RESOURCE DIALOG r_wait_dialog |
|
76 * { |
|
77 * flags = EAknWaitNoteFlags; |
|
78 * buttons = R_AVKON_SOFTKEYS_CANCEL; |
|
79 * } |
|
80 * |
|
81 */ |
|
82 class CExtProgressDialog : public CAknDialog |
|
83 { |
|
84 |
|
85 public: |
|
86 |
|
87 /** Constructor |
|
88 * |
|
89 * @param aBitmap - background bitmap |
|
90 * @param aSelectedItem - selected item |
|
91 * @param aItems - Plugin info item array |
|
92 * @return - |
|
93 */ |
|
94 IMPORT_C CExtProgressDialog(CExtProgressDialog** aSelfPtr); |
|
95 |
|
96 /** Destructor |
|
97 * |
|
98 * @param - |
|
99 * @return - |
|
100 */ |
|
101 IMPORT_C ~CExtProgressDialog(); |
|
102 |
|
103 /** PrepareLC |
|
104 * |
|
105 * @param aResourceId - resource id |
|
106 * @return - |
|
107 */ |
|
108 IMPORT_C void PrepareLC(TInt aResourceId); |
|
109 |
|
110 /** SetCallback |
|
111 * |
|
112 * @param aCallback - callback |
|
113 * @return - |
|
114 */ |
|
115 IMPORT_C void SetCallback(MExtProgressDialogCallback* aCallback); |
|
116 |
|
117 /** GetProgressInfoL |
|
118 * |
|
119 * @param - |
|
120 * @return - progress info |
|
121 */ |
|
122 IMPORT_C CEikProgressInfo* GetProgressInfoL(); |
|
123 |
|
124 /** StartAnimationL |
|
125 * |
|
126 * @param - |
|
127 * @return - |
|
128 */ |
|
129 IMPORT_C void StartAnimationL(); |
|
130 |
|
131 /** SetTextL |
|
132 * |
|
133 * @param aText - title text |
|
134 * @return - |
|
135 */ |
|
136 IMPORT_C void SetTextL(const TDesC &aText); |
|
137 |
|
138 /** SetAnimationResourceId |
|
139 * |
|
140 * @param aResourceId - animation resource id |
|
141 * @return - |
|
142 */ |
|
143 IMPORT_C void SetAnimationResourceIdL(const TInt &aResourceId); |
|
144 |
|
145 protected: |
|
146 |
|
147 /** OkToExitL |
|
148 * |
|
149 * From CEikDialog update member variables . |
|
150 * @param aButtonId The ID of the button that was activated. |
|
151 * @return Should return ETrue if the dialog should exit, |
|
152 * and EFalse if it should not |
|
153 */ |
|
154 TBool OkToExitL( TInt aButtonId ); |
|
155 |
|
156 /** OfferKeyEventL |
|
157 * |
|
158 * @see CCoeControl |
|
159 * |
|
160 */ |
|
161 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
162 |
|
163 /** HandleControlEventL |
|
164 * |
|
165 * @see CCoeControl |
|
166 * |
|
167 */ |
|
168 void HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent aEventType); |
|
169 |
|
170 /** PreLayoutDynInitL |
|
171 * |
|
172 * @see CEikDialog |
|
173 * |
|
174 */ |
|
175 void PreLayoutDynInitL(); |
|
176 |
|
177 /** SetSizeAndPosition |
|
178 * |
|
179 * @see CEikDialog |
|
180 * |
|
181 */ |
|
182 void SetSizeAndPosition(const TSize &aSize); |
|
183 |
|
184 /** CountComponentControls |
|
185 * |
|
186 * @see CCoeControl |
|
187 * |
|
188 */ |
|
189 TInt CountComponentControls() const; |
|
190 |
|
191 /** ComponentControl |
|
192 * |
|
193 * @see CCoeControl |
|
194 * |
|
195 */ |
|
196 CCoeControl* ComponentControl(TInt aIndex) const; |
|
197 |
|
198 private: |
|
199 |
|
200 CExtProgressDialog** iSelfPtr; |
|
201 |
|
202 MExtProgressDialogCallback* iCallback; |
|
203 RConeResourceLoader iResLoader; |
|
204 |
|
205 CExtProgressContainer* iContainer; |
|
206 }; |
|
207 |
|
208 #endif |
|
209 |
|
210 // End of File |
|