|
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: Base class for all wait notes |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_MPXWAITNOTEDIALOG_H |
|
20 #define C_MPXWAITNOTEDIALOG_H |
|
21 |
|
22 #include <AknWaitDialog.h> |
|
23 #include <AknProgressDialog.h> |
|
24 #include <mpxcollectionobserver.h> |
|
25 #include "mpxwaitnoteobserver.h" |
|
26 #include "mpxwaitnotedefs.h" |
|
27 |
|
28 // FOWARD DECLARATIONS |
|
29 class MMPXCollectionUtility; |
|
30 class CAknQueryDialog; |
|
31 class CAknNoteDialog; |
|
32 /* |
|
33 * Simple structure to hold icon info |
|
34 */ |
|
35 class TNoteIconInfo |
|
36 { |
|
37 public: |
|
38 TInt bitmapId; |
|
39 TInt maskId; |
|
40 TFileName bmpfile; |
|
41 |
|
42 inline TNoteIconInfo( TInt b, TInt m, TFileName f ) |
|
43 { |
|
44 bitmapId=b; |
|
45 maskId=m; |
|
46 bmpfile=f; |
|
47 } |
|
48 }; |
|
49 |
|
50 /** |
|
51 * MPXWaitNoteDialog |
|
52 * |
|
53 * Base class for all wait dialogs in MPX |
|
54 * |
|
55 * @lib mpxwaitnotedialog.lib |
|
56 * @since S60 3.1 |
|
57 */ |
|
58 class CMPXWaitNoteDialog : public CBase, |
|
59 public MMPXCollectionObserver, |
|
60 public MProgressDialogCallback |
|
61 { |
|
62 |
|
63 public: |
|
64 |
|
65 /** |
|
66 * Virtual destructor |
|
67 */ |
|
68 virtual ~CMPXWaitNoteDialog(); |
|
69 |
|
70 public: // New Functions |
|
71 |
|
72 /** |
|
73 * Execute the dialog |
|
74 */ |
|
75 virtual void ExecuteLD(); |
|
76 |
|
77 /** |
|
78 * Cancel the wait note |
|
79 */ |
|
80 virtual void CancelNoteL(); |
|
81 |
|
82 /** |
|
83 * Check the dialog destruction status |
|
84 */ |
|
85 virtual TBool ReadyToDestroy(); |
|
86 |
|
87 protected: // New functions |
|
88 |
|
89 /** |
|
90 * Initialize the note before executing |
|
91 * The inherited class should set CBA, text, icons etc here |
|
92 */ |
|
93 virtual void PreNoteDisplayHandleL() = 0; |
|
94 |
|
95 /** |
|
96 * Post note dissmissal handling |
|
97 * @arg aButtonId, button ID that the note was cancelled with |
|
98 */ |
|
99 virtual void PostNoteHandleL( TInt aButtonId ); |
|
100 |
|
101 /** |
|
102 * Set the CBA for the waitnote |
|
103 * @arg aCBAId, button group ID |
|
104 */ |
|
105 void SetCBAL( TInt aCBAId ); |
|
106 |
|
107 /** |
|
108 * Set the Text in the wait note |
|
109 * @arg aText, text to display |
|
110 */ |
|
111 void SetTextL( const TDesC& aText ); |
|
112 |
|
113 /** |
|
114 * Set the icon in the wait note |
|
115 */ |
|
116 void SetIconL( TNoteIconInfo& aIconInfo ); |
|
117 |
|
118 protected: // From Base classes |
|
119 |
|
120 /** |
|
121 * From MMPXCollectionObserver |
|
122 */ |
|
123 void HandleCollectionMediaL(const CMPXMedia& aMedia, |
|
124 TInt aError); |
|
125 |
|
126 /** |
|
127 * From MMPXCollectionObserver |
|
128 */ |
|
129 void HandleCollectionMessage( |
|
130 CMPXMessage* aMessage, TInt aError ); |
|
131 |
|
132 /** |
|
133 * From MMPXCollectionObserver |
|
134 */ |
|
135 void HandleOpenL(const CMPXMedia& aEntries, |
|
136 TInt aIndex,TBool aComplete,TInt aError); |
|
137 |
|
138 /** |
|
139 * From MMPXCollectionObserver |
|
140 */ |
|
141 void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist,TInt aError); |
|
142 |
|
143 /** |
|
144 * Callback method when a dialog is dismissed. |
|
145 * @param aButtonId Button ID. |
|
146 */ |
|
147 void DialogDismissedL( TInt aButtonId ); |
|
148 |
|
149 /** |
|
150 * Display a confirmation dialog |
|
151 * @param aLabel, label for the popup note |
|
152 */ |
|
153 void DisplayConfirmationNoteL( const TDesC& aLabel ); |
|
154 |
|
155 /** |
|
156 * Display an information dialog |
|
157 * @param aLabel, label for the popup note |
|
158 */ |
|
159 void DisplayInformationNoteL( const TDesC& aLabel ); |
|
160 |
|
161 /** |
|
162 * Display a query dialog |
|
163 * @param aLabel, label for the query |
|
164 * @return button that was selected |
|
165 */ |
|
166 TInt DisplayQueryNoteL( const TDesC& aQuery ); |
|
167 |
|
168 /** |
|
169 * Dismiss the current query note, if any |
|
170 */ |
|
171 void DismissQueryNoteL(); |
|
172 |
|
173 /** |
|
174 * Display a generic CAknNoteDialog |
|
175 * @param aDlgRsc, dialog resource |
|
176 * @param aLabel, text |
|
177 */ |
|
178 void DisplayNoteDialogL( TInt aDlgRsc, const TDesC& aLabel, |
|
179 CAknNoteDialog::TTone aTone = CAknNoteDialog::ENoTone ); |
|
180 // Cover UI start |
|
181 //#ifdef __COVER_DISPLAY |
|
182 /** |
|
183 * Display a generic CAknNoteDialog |
|
184 * @param aDlgRsc, dialog resource |
|
185 * @param aLabel, text |
|
186 */ |
|
187 void DisplayNoteDialogL( TInt aDlgRsc, TInt aTextRsc, |
|
188 TInt aItemsAdded, const TDesC& aLabel, |
|
189 CAknNoteDialog::TTone aTone = CAknNoteDialog::ENoTone ); |
|
190 //#endif // __COVER_DISPLAY |
|
191 // Cover UI end |
|
192 |
|
193 protected: |
|
194 |
|
195 /** |
|
196 * Constructor |
|
197 */ |
|
198 CMPXWaitNoteDialog( MMPXWaitNoteObserver* aObs, |
|
199 TWaitNoteType aType, |
|
200 TBool aVisibilityDelayOff = ETrue ); |
|
201 |
|
202 /** |
|
203 * Two-phased constructor |
|
204 */ |
|
205 void BaseConstructL(); |
|
206 |
|
207 protected: // data |
|
208 MMPXCollectionUtility* iCollection; |
|
209 |
|
210 MMPXWaitNoteObserver* iObserver; |
|
211 TWaitNoteType iWaitNoteType; |
|
212 TBool iVisDelayOff; // VisibilityDelayOff |
|
213 CAknWaitDialog* iWaitDialog; |
|
214 TInt iResourceOffset; |
|
215 CAknQueryDialog* iQueryDialog; // Not Owned |
|
216 CAknNoteDialog* iNoteDialog; // Not Owned |
|
217 }; |
|
218 |
|
219 #endif // C_MPXWAITNOTEDIALOG_H |