|
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: Utility class for dialogs |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "IMDialogUtils.h" |
|
22 #include "ccatextquerydialog.h" |
|
23 #include "ChatDebugPrint.h" |
|
24 #include "ChatDebugAssert.h" |
|
25 #include "ChatDefinitions.h" |
|
26 #include <aknlists.h> |
|
27 #include <aknpopup.h> |
|
28 #include <aknnotedialog.h> |
|
29 #include <aknmessagequerydialog.h> |
|
30 #include <aknnotewrappers.h> |
|
31 #include <stringloader.h> |
|
32 #include <ChatNG.rsg> |
|
33 |
|
34 // --------------------------------------------------------- |
|
35 // IMDialogUtils::DisplayInformationNoteL |
|
36 // (other items were commented in a header). |
|
37 // --------------------------------------------------------- |
|
38 // |
|
39 EXPORT_C void IMDialogUtils::DisplayInformationNoteL( const TDesC& aText ) |
|
40 { |
|
41 CAknInformationNote* note = new( ELeave ) CAknInformationNote( ETrue ); |
|
42 note->ExecuteLD( aText ); |
|
43 } |
|
44 |
|
45 // --------------------------------------------------------- |
|
46 // IMDialogUtils::DisplayInformationNoteL |
|
47 // (other items were commented in a header). |
|
48 // --------------------------------------------------------- |
|
49 // |
|
50 EXPORT_C void IMDialogUtils::DisplayInformationNoteL( TInt aTextResource, |
|
51 const TDesC& aParameter ) |
|
52 { |
|
53 HBufC* text = NULL; |
|
54 if ( aParameter == KNullDesC ) |
|
55 { |
|
56 text = CEikonEnv::Static()->AllocReadResourceLC( aTextResource ); |
|
57 } |
|
58 else |
|
59 { |
|
60 text = StringLoader::LoadLC( aTextResource, aParameter ); |
|
61 } |
|
62 |
|
63 DisplayInformationNoteL( *text ); |
|
64 CleanupStack::PopAndDestroy( text ); |
|
65 } |
|
66 |
|
67 // --------------------------------------------------------- |
|
68 // IMDialogUtils::DisplayPopupListL() |
|
69 // Displays popup list |
|
70 // (other items were commented in a header). |
|
71 // --------------------------------------------------------- |
|
72 // |
|
73 EXPORT_C void IMDialogUtils::DisplayPopupListL( MDesCArray* aItemList, |
|
74 const TInt aTitleResourceId, |
|
75 TListBoxModelItemArrayOwnership aOwnerShipType, |
|
76 const TInt aEmptyListPrompt /*=-1*/ |
|
77 ) |
|
78 { |
|
79 CAknSinglePopupMenuStyleListBox* listBox = |
|
80 new ( ELeave ) CAknSinglePopupMenuStyleListBox; |
|
81 CleanupStack::PushL( listBox ); |
|
82 CAknPopupList* popUpList = CAknPopupList::NewL( listBox, |
|
83 R_AVKON_SOFTKEYS_OK_EMPTY, AknPopupLayouts::EMenuWindow ); |
|
84 CleanupStack::PushL( popUpList ); |
|
85 listBox->ConstructL( popUpList, |
|
86 CEikListBox::ELeftDownInViewRect | CEikListBox::EDisableHighlight ); |
|
87 listBox->CreateScrollBarFrameL( ETrue ); |
|
88 listBox->ScrollBarFrame()->SetScrollBarVisibilityL( |
|
89 CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); |
|
90 |
|
91 |
|
92 CTextListBoxModel* model = listBox->Model(); |
|
93 model->SetItemTextArray( aItemList ); |
|
94 model->SetOwnershipType( aOwnerShipType ); |
|
95 |
|
96 if ( aEmptyListPrompt != KErrNotFound ) |
|
97 { |
|
98 HBufC* emptyText = CEikonEnv::Static()->AllocReadResourceLC( |
|
99 aEmptyListPrompt ); |
|
100 popUpList->ListBox()->View()->SetListEmptyTextL( *emptyText ); |
|
101 CleanupStack::PopAndDestroy( emptyText ); |
|
102 } |
|
103 HBufC* prompt = CEikonEnv::Static()->AllocReadResourceLC( |
|
104 aTitleResourceId ); |
|
105 popUpList->SetTitleL( *prompt ); |
|
106 CleanupStack::PopAndDestroy( prompt ); |
|
107 |
|
108 |
|
109 popUpList->ExecuteLD(); |
|
110 CleanupStack::Pop( popUpList ); |
|
111 CleanupStack::PopAndDestroy( listBox ); |
|
112 |
|
113 } |
|
114 |
|
115 // --------------------------------------------------------- |
|
116 // IMDialogUtils::DisplayPopupListL() |
|
117 // Displays popup list |
|
118 // (other items were commented in a header). |
|
119 // --------------------------------------------------------- |
|
120 // |
|
121 EXPORT_C void IMDialogUtils::DisplayPopupListL( TInt& aSelectedIndex, MDesCArray* aItemList, |
|
122 const TDesC& aTitle, |
|
123 TListBoxModelItemArrayOwnership aOwnerShipType, |
|
124 const TInt aEmptyListPrompt /*=-1*/ ) |
|
125 { |
|
126 CAknSinglePopupMenuStyleListBox* listBox = |
|
127 new ( ELeave ) CAknSinglePopupMenuStyleListBox; |
|
128 CleanupStack::PushL( listBox ); |
|
129 CAknPopupList* popUpList = CAknPopupList::NewL( listBox, |
|
130 R_AVKON_SOFTKEYS_SELECT_BACK, AknPopupLayouts::EMenuWindow ); |
|
131 CleanupStack::PushL( popUpList ); |
|
132 listBox->ConstructL( popUpList, |
|
133 CEikListBox::ELeftDownInViewRect/*|CEikListBox::EDisableHighlight */ ); |
|
134 listBox->CreateScrollBarFrameL( ETrue ); |
|
135 listBox->ScrollBarFrame()->SetScrollBarVisibilityL( |
|
136 CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); |
|
137 |
|
138 |
|
139 CTextListBoxModel* model = listBox->Model(); |
|
140 model->SetItemTextArray( aItemList ); |
|
141 model->SetOwnershipType( aOwnerShipType ); |
|
142 |
|
143 if ( aEmptyListPrompt != KErrNotFound ) |
|
144 { |
|
145 HBufC* emptyText = CEikonEnv::Static()->AllocReadResourceLC( |
|
146 aEmptyListPrompt ); |
|
147 popUpList->ListBox()->View()->SetListEmptyTextL( *emptyText ); |
|
148 CleanupStack::PopAndDestroy( emptyText ); |
|
149 } |
|
150 |
|
151 popUpList->SetTitleL( aTitle ); |
|
152 |
|
153 |
|
154 |
|
155 TInt ret = popUpList->ExecuteLD(); |
|
156 CleanupStack::Pop( popUpList ); |
|
157 |
|
158 if ( ret ) |
|
159 { |
|
160 aSelectedIndex = listBox->CurrentItemIndex(); |
|
161 } |
|
162 |
|
163 CleanupStack::PopAndDestroy( listBox ); |
|
164 } |
|
165 |
|
166 // --------------------------------------------------------- |
|
167 // IMDialogUtils::DisplayTextQueryDialogL() |
|
168 // Displays text query dialog |
|
169 // (other items were commented in a header). |
|
170 // --------------------------------------------------------- |
|
171 // |
|
172 EXPORT_C TInt IMDialogUtils::DisplayTextQueryDialogL( |
|
173 TDes& aDataText, |
|
174 const TInt aTitleResourceId, |
|
175 const TInt aDialogResourceId, |
|
176 TBool aPredictiveInput /* = EFalse */, |
|
177 TBool aLeftSoftkeyAlwaysVisible /* = EFalse */, |
|
178 TLeftSoftkey aLeftSoftkey /* = EDefault */, |
|
179 TInitialSelectionMode aSelectionMode /* = ESelectAll */, |
|
180 TBool aDomainSelectionQuery /* = EFalse */ ) |
|
181 { |
|
182 // CodeScanner warning ignored because CS does not |
|
183 // notice that PrepareLC puts the dialog to cleanupstack |
|
184 CAknTextQueryDialog* dlg = CCATextQueryDialog::NewL( aDataText, // CSI: 35 # See comment above |
|
185 CAknQueryDialog::ENoTone, |
|
186 aLeftSoftkeyAlwaysVisible, |
|
187 aDomainSelectionQuery ); |
|
188 |
|
189 dlg->PrepareLC( aDialogResourceId ); |
|
190 HBufC* text = CEikonEnv::Static()->AllocReadResourceLC( aTitleResourceId ); |
|
191 dlg->SetPromptL( *text ); |
|
192 dlg->SetPredictiveTextInputPermitted( aPredictiveInput ); |
|
193 |
|
194 CleanupStack::PopAndDestroy( text ); |
|
195 |
|
196 // Change cba |
|
197 if ( aLeftSoftkey == ESend ) |
|
198 { |
|
199 CEikButtonGroupContainer& cba = dlg->ButtonGroupContainer(); |
|
200 cba.SetCommandSetL( R_CHAT_INVITE_CBA_BUTTONS_SEND ); |
|
201 } |
|
202 |
|
203 // Set correct selection mode |
|
204 switch ( aSelectionMode ) |
|
205 { |
|
206 case ESelectNone: |
|
207 { |
|
208 CCoeControl* ctrl = dlg->ControlOrNull( EGeneralQuery ); |
|
209 if ( ctrl ) |
|
210 { |
|
211 CAknQueryControl* query = static_cast<CAknQueryControl*>( ctrl ); |
|
212 ctrl = query->ControlByLayoutOrNull( EDataLayout ); |
|
213 if ( ctrl ) |
|
214 { |
|
215 CEikEdwin* edwin = static_cast<CEikEdwin*>( ctrl ); |
|
216 edwin->AddFlagToUserFlags( CEikEdwin::ENoAutoSelection ); |
|
217 } |
|
218 } |
|
219 break; |
|
220 } |
|
221 default: |
|
222 { |
|
223 // Use default flags in edwin |
|
224 break; |
|
225 } |
|
226 } |
|
227 return ( dlg->RunLD() ); |
|
228 } |
|
229 |
|
230 // --------------------------------------------------------- |
|
231 // IMDialogUtils::DisplayMessageQueryDialogL |
|
232 // (other items were commented in a header). |
|
233 // --------------------------------------------------------- |
|
234 // |
|
235 EXPORT_C TInt IMDialogUtils::DisplayMessageQueryDialogL( const TInt aDialogResourceId, |
|
236 const TDesC& aMsgText, |
|
237 const TDesC& aHeaderText, |
|
238 TBool aPredictiveInput ) |
|
239 { |
|
240 // CodeScanner warning ignored because CS does not |
|
241 // notice that PrepareLC puts the dialog to cleanupstack |
|
242 CAknMessageQueryDialog* dlg = new( ELeave )CAknMessageQueryDialog(); // CSI: 35 # See comment above |
|
243 dlg->PrepareLC( aDialogResourceId ); |
|
244 if ( aMsgText != KNullDesC ) |
|
245 { |
|
246 dlg->SetMessageTextL( aMsgText ); |
|
247 } |
|
248 if ( aHeaderText != KNullDesC ) |
|
249 { |
|
250 dlg->SetHeaderTextL( aHeaderText ); |
|
251 } |
|
252 dlg->SetPredictiveTextInputPermitted( aPredictiveInput ); // T9 |
|
253 return ( dlg->RunLD() ); |
|
254 } |
|
255 |
|
256 // --------------------------------------------------------- |
|
257 // IMDialogUtils::MultiselectionListQueryDialogLC |
|
258 // (other items were commented in a header). |
|
259 // --------------------------------------------------------- |
|
260 // |
|
261 EXPORT_C CDesCArray* IMDialogUtils::MultiselectionListQueryDialogL( |
|
262 const MDesCArray& aItemList, |
|
263 const TDesC& aTitle ) |
|
264 { |
|
265 TInt count( aItemList.MdcaCount() ); |
|
266 if ( count == 0 ) |
|
267 { |
|
268 // empty list |
|
269 return NULL; |
|
270 } |
|
271 |
|
272 // array for indices |
|
273 CArrayFixFlat<TInt>* selectedIndices = |
|
274 new( ELeave ) CArrayFixFlat<TInt>( count ); |
|
275 CleanupStack::PushL( selectedIndices ); |
|
276 |
|
277 // append icon formatting |
|
278 CDesCArray* lst = new( ELeave )CDesCArrayFlat( count ); |
|
279 CleanupStack::PushL( lst ); |
|
280 for ( TInt i( 0 ); i < count; ++i ) |
|
281 { |
|
282 TPtrC item( aItemList.MdcaPoint( i ) ); |
|
283 HBufC* text = HBufC::NewMaxLC( item.Length() + |
|
284 KIconTabulator().Length() ); |
|
285 TPtr txt( text->Des() ); |
|
286 txt.Copy( KIconTabulator ); |
|
287 txt.Append( item ); |
|
288 |
|
289 CHAT_DP( D_CHAT_LIT( "appending '%S' to list" ), &txt ); |
|
290 |
|
291 lst->AppendL( *text ); |
|
292 CleanupStack::PopAndDestroy( text ); |
|
293 } |
|
294 |
|
295 // show the query |
|
296 TInt retVal( IMDialogUtils::DisplayListQueryDialogL( |
|
297 selectedIndices, lst, R_CHATVIEW_RECIPIENT_QUERY, NULL, |
|
298 KNullDesC, aTitle ) ); |
|
299 // CAknListQueryDialog returns 0 if user cancels the query |
|
300 if ( !retVal ) |
|
301 { |
|
302 // query cancelled |
|
303 CleanupStack::PopAndDestroy( 2, selectedIndices ); // lst, selectedIndices |
|
304 return NULL; |
|
305 } |
|
306 |
|
307 // selected items array |
|
308 CDesCArray* selected = NULL; |
|
309 |
|
310 count = selectedIndices->Count(); |
|
311 if ( count == 0 ) |
|
312 { |
|
313 // nothing selected, return empty array |
|
314 CleanupStack::PopAndDestroy( 2, selectedIndices ); // lst, selectedIndices |
|
315 selected = new( ELeave )CDesCArrayFlat( 1 ); |
|
316 } |
|
317 else |
|
318 { |
|
319 // specified items selected |
|
320 selected = new( ELeave )CDesCArrayFlat( count ); |
|
321 CleanupStack::PushL( selected ); |
|
322 for ( TInt i( 0 ); i < count; ++i ) |
|
323 { |
|
324 // take out the icon formatting ("0\t") |
|
325 TPtrC item( lst->MdcaPoint( selectedIndices->At( i ) ).Mid( |
|
326 KIconTabulator().Length() ) ); |
|
327 selected->AppendL( item ); |
|
328 CHAT_DP( D_CHAT_LIT( "selected %S from list" ), &item ); |
|
329 } |
|
330 CleanupStack::Pop( selected ); |
|
331 CleanupStack::PopAndDestroy( 2, selectedIndices ); // lst, selectedIndices |
|
332 } |
|
333 return selected; |
|
334 } |
|
335 |
|
336 // --------------------------------------------------------- |
|
337 // IMDialogUtils::DisplayListQueryDialogL() |
|
338 // This method displays ListQueryDialog |
|
339 // (other items were commented in a header). |
|
340 // --------------------------------------------------------- |
|
341 // |
|
342 EXPORT_C TInt IMDialogUtils::DisplayListQueryDialogL( CArrayFix< TInt >* aIndexArray, |
|
343 MDesCArray* aItemList, |
|
344 const TInt aDialogResourceId, |
|
345 CArrayFix< TInt >* aArrayOfSelectionIndexes /*NULL*/, |
|
346 const TDesC& aListEmptyText /*= KNullDesC*/, |
|
347 const TDesC& aAlternativeTitle /*= KNullDesC*/ ) |
|
348 { |
|
349 CAknListQueryDialog* dlg = new ( ELeave ) CAknListQueryDialog( aIndexArray ); |
|
350 dlg->PrepareLC( aDialogResourceId ); |
|
351 dlg->SetItemTextArray( aItemList ); |
|
352 dlg->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
|
353 |
|
354 if ( aArrayOfSelectionIndexes ) |
|
355 { |
|
356 dlg->ListBox()->SetSelectionIndexesL( aArrayOfSelectionIndexes ); |
|
357 if ( aArrayOfSelectionIndexes->Count() == 1 ) |
|
358 { |
|
359 dlg->ListBox()->SetCurrentItemIndexAndDraw( |
|
360 aArrayOfSelectionIndexes->At( 0 ) ); |
|
361 } |
|
362 |
|
363 } |
|
364 if ( aItemList->MdcaCount() == 0 ) |
|
365 { |
|
366 CEikButtonGroupContainer& cba = dlg->ButtonGroupContainer(); |
|
367 cba.SetCommandSetL( R_AVKON_SOFTKEYS_CANCEL ); |
|
368 } |
|
369 |
|
370 if ( aListEmptyText != KNullDesC ) |
|
371 { |
|
372 dlg->ListBox()->View()->SetListEmptyTextL( aListEmptyText ); |
|
373 } |
|
374 |
|
375 if ( aAlternativeTitle != KNullDesC ) |
|
376 { |
|
377 dlg->SetHeaderTextL( aAlternativeTitle ); |
|
378 } |
|
379 |
|
380 return ( dlg->RunLD() ); |
|
381 } |
|
382 |
|
383 // --------------------------------------------------------- |
|
384 // IMDialogUtils::DisplayListQueryDialogL |
|
385 // (other items were commented in a header). |
|
386 // --------------------------------------------------------- |
|
387 // |
|
388 EXPORT_C TInt IMDialogUtils::DisplayListQueryDialogL( TInt* aSelectedIndex, |
|
389 MDesCArray* aItemList, |
|
390 const TInt aDialogResourceId, |
|
391 const TDesC& aAlternativeTitle /*KNullDesC*/, |
|
392 const TDesC& aListEmptyText /*= KNullDesC*/, |
|
393 const TBool aIsForwardQuery /* EFalse */, |
|
394 const TBool aIsOnlySelect /* = EFalse */ ) |
|
395 |
|
396 { |
|
397 CAknListQueryDialog* dlg = new ( ELeave ) CAknListQueryDialog( |
|
398 aSelectedIndex ); |
|
399 dlg->PrepareLC( aDialogResourceId ); |
|
400 dlg->SetItemTextArray( aItemList ); |
|
401 dlg->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
|
402 |
|
403 if ( aAlternativeTitle != KNullDesC ) |
|
404 { |
|
405 dlg->SetHeaderTextL( aAlternativeTitle ); |
|
406 } |
|
407 |
|
408 if ( aItemList->MdcaCount() == 0 ) |
|
409 { |
|
410 CEikButtonGroupContainer& cba = dlg->ButtonGroupContainer(); |
|
411 cba.SetCommandSetL( R_AVKON_SOFTKEYS_CANCEL ); |
|
412 } |
|
413 else |
|
414 { |
|
415 if ( aIsForwardQuery ) |
|
416 { |
|
417 CEikButtonGroupContainer& cba = dlg->ButtonGroupContainer(); |
|
418 cba.SetCommandSetL( R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT ); |
|
419 } |
|
420 } |
|
421 |
|
422 if ( aIsOnlySelect ) |
|
423 { |
|
424 CEikButtonGroupContainer& cba = dlg->ButtonGroupContainer(); |
|
425 cba.SetCommandSetL( R_CHAT_SOFTKEYS_SELECT_EMPTY ); |
|
426 } |
|
427 |
|
428 dlg->ListBox()->SetCurrentItemIndex( *aSelectedIndex ); |
|
429 |
|
430 if ( aListEmptyText != KNullDesC ) |
|
431 { |
|
432 dlg->ListBox()->View()->SetListEmptyTextL( aListEmptyText ); |
|
433 } |
|
434 |
|
435 return ( dlg->RunLD() ); |
|
436 } |
|
437 |
|
438 // --------------------------------------------------------- |
|
439 // IMDialogUtils::DisplayNoteDialogL |
|
440 // (other items were commented in a header). |
|
441 // --------------------------------------------------------- |
|
442 // |
|
443 EXPORT_C TInt IMDialogUtils::DisplayNoteDialogL( const TInt aResourceId ) |
|
444 { |
|
445 CAknNoteDialog* dlg = new ( ELeave ) CAknNoteDialog( CAknNoteDialog:: |
|
446 EConfirmationTone, CAknNoteDialog::EShortTimeout ); |
|
447 return dlg->ExecuteLD( aResourceId ); |
|
448 } |
|
449 |
|
450 // --------------------------------------------------------- |
|
451 // IMDialogUtils::DisplayNoteDialogL |
|
452 // (other items were commented in a header). |
|
453 // --------------------------------------------------------- |
|
454 // |
|
455 EXPORT_C TInt IMDialogUtils::DisplayNoteDialogL( const TDesC& aText, |
|
456 const TInt aButtonsResourceId, /*= R_AVKON_SOFTKEYS_EMPTY*/ |
|
457 const CAknNoteDialog::TTimeout& aTimeout /*= CAknNoteDialog::EShortTimeout*/ ) |
|
458 { |
|
459 // CodeScanner warning ignored because CS does not |
|
460 // notice that PrepareLC puts the dialog to cleanupstack |
|
461 CAknNoteDialog* dlg = new ( ELeave ) CAknNoteDialog( // CSI: 35 # See comment above |
|
462 CAknNoteDialog::EConfirmationTone , aTimeout ); |
|
463 |
|
464 dlg->PrepareLC( R_CHAT_INFO_NOTE_TEMPLATE ); |
|
465 dlg->SetTextL( aText ); |
|
466 |
|
467 CEikButtonGroupContainer& cba = dlg->ButtonGroupContainer(); |
|
468 cba.SetCommandSetL( aButtonsResourceId ); |
|
469 |
|
470 return dlg->RunLD(); |
|
471 } |
|
472 |
|
473 // --------------------------------------------------------- |
|
474 // IMDialogUtils::DisplayErrorNoteL |
|
475 // (other items were commented in a header). |
|
476 // --------------------------------------------------------- |
|
477 // |
|
478 EXPORT_C TInt IMDialogUtils::DisplayErrorNoteL( const TInt aResourceId ) |
|
479 { |
|
480 CAknNoteDialog* dlg = new ( ELeave ) CAknNoteDialog( |
|
481 CAknNoteDialog::EErrorTone , CAknNoteDialog::ELongTimeout ); |
|
482 |
|
483 return dlg->ExecuteLD( aResourceId ); |
|
484 } |
|
485 |
|
486 // --------------------------------------------------------- |
|
487 // IMDialogUtils::DisplayErrorNoteL |
|
488 // (other items were commented in a header). |
|
489 // --------------------------------------------------------- |
|
490 // |
|
491 EXPORT_C TInt IMDialogUtils::DisplayErrorNoteL( const TDesC& aText, TBool aSoftkeyOk /*= EFalse*/ ) |
|
492 { |
|
493 if ( aSoftkeyOk ) |
|
494 { |
|
495 return IMDialogUtils::DisplayQueryDialogL( R_CHAT_ERROR_NOTE_TEMPLATE_WITH_OK, aText ); |
|
496 } |
|
497 else |
|
498 { |
|
499 // CodeScanner warning ignored because CS does not |
|
500 // notice that PrepareLC puts the dialog to cleanupstack |
|
501 CAknNoteDialog* dlg = // CSI: 35 # See comment above |
|
502 new ( ELeave ) CAknNoteDialog( CAknNoteDialog::EErrorTone , |
|
503 CAknNoteDialog::ELongTimeout ); |
|
504 dlg->PrepareLC( R_CHAT_ERROR_NOTE_TEMPLATE ); |
|
505 dlg->SetTextL( aText ); |
|
506 return dlg->RunLD(); |
|
507 } |
|
508 } |
|
509 |
|
510 // --------------------------------------------------------- |
|
511 // IMDialogUtils::DisplayQueryDialogL |
|
512 // (other items were commented in a header). |
|
513 // --------------------------------------------------------- |
|
514 // |
|
515 EXPORT_C TInt IMDialogUtils::DisplayQueryDialogL( TInt aDialogResourceId, |
|
516 TInt aTextResourceId ) |
|
517 { |
|
518 HBufC* prompt = CEikonEnv::Static()->AllocReadResourceLC( aTextResourceId ); |
|
519 TInt ret( DisplayQueryDialogL( aDialogResourceId, *prompt ) ); |
|
520 CleanupStack::PopAndDestroy( prompt ); |
|
521 |
|
522 return ret; |
|
523 } |
|
524 |
|
525 // --------------------------------------------------------- |
|
526 // IMDialogUtils::DisplayQueryDialogL |
|
527 // (other items were commented in a header). |
|
528 // --------------------------------------------------------- |
|
529 // |
|
530 EXPORT_C TInt IMDialogUtils::DisplayQueryDialogL( TInt aDialogResourceId, |
|
531 const TDesC& aPrompt ) |
|
532 { |
|
533 CAknQueryDialog* dlg = new ( ELeave ) CAknQueryDialog( |
|
534 CAknQueryDialog::ENoTone ); |
|
535 if ( aPrompt != KNullDesC ) |
|
536 { |
|
537 CleanupStack::PushL( dlg ); |
|
538 dlg->SetPromptL( aPrompt ); |
|
539 CleanupStack::Pop( dlg ); |
|
540 } |
|
541 |
|
542 return dlg->ExecuteLD( aDialogResourceId ); |
|
543 } |
|
544 |
|
545 // --------------------------------------------------------- |
|
546 // IMDialogUtils::DisplayQueryDialogL |
|
547 // (other items were commented in a header). |
|
548 // --------------------------------------------------------- |
|
549 // |
|
550 EXPORT_C TInt IMDialogUtils::DisplayYesNoConfirmationDialogL( TInt aTextResourceId ) |
|
551 { |
|
552 return IMDialogUtils::DisplayQueryDialogL( |
|
553 R_GENERIC_YES_NO_CONFIRMATION_QUERY, |
|
554 aTextResourceId ); |
|
555 } |
|
556 |
|
557 // --------------------------------------------------------- |
|
558 // IMDialogUtils::DisplayQueryDialogL |
|
559 // (other items were commented in a header). |
|
560 // --------------------------------------------------------- |
|
561 // |
|
562 EXPORT_C TInt IMDialogUtils::DisplayYesNoConfirmationDialogL( const TDesC& aPrompt ) |
|
563 { |
|
564 return IMDialogUtils::DisplayQueryDialogL( |
|
565 R_GENERIC_YES_NO_CONFIRMATION_QUERY, |
|
566 aPrompt ); |
|
567 } |
|
568 |
|
569 // --------------------------------------------------------- |
|
570 // IMDialogUtils::DisplayOKErrorNoteL |
|
571 // (other items were commented in a header). |
|
572 // --------------------------------------------------------- |
|
573 // |
|
574 EXPORT_C TInt IMDialogUtils::DisplayErrorConfirmationNoteL( TInt aTextResourceId ) |
|
575 { |
|
576 return IMDialogUtils::DisplayQueryDialogL( |
|
577 R_GENERIC_OK_ERROR_NOTE, |
|
578 aTextResourceId ); |
|
579 } |
|
580 |
|
581 // --------------------------------------------------------- |
|
582 // IMDialogUtils::DisplayErrorConfirmationNoteL |
|
583 // (other items were commented in a header). |
|
584 // --------------------------------------------------------- |
|
585 // |
|
586 EXPORT_C TInt IMDialogUtils::DisplayErrorConfirmationNoteL( const TDesC& aPrompt ) |
|
587 { |
|
588 return IMDialogUtils::DisplayQueryDialogL( |
|
589 R_GENERIC_OK_ERROR_NOTE, |
|
590 aPrompt ); |
|
591 } |
|
592 |
|
593 // --------------------------------------------------------- |
|
594 // IMDialogUtils::DisplayConfirmationNoteL |
|
595 // (other items were commented in a header). |
|
596 // --------------------------------------------------------- |
|
597 // |
|
598 EXPORT_C TInt IMDialogUtils::DisplayConfirmationNoteL( TInt aTextResourceId ) |
|
599 { |
|
600 HBufC* prompt = CEikonEnv::Static()->AllocReadResourceLC( aTextResourceId ); |
|
601 CAknConfirmationNote* dlg = new( ELeave )CAknConfirmationNote(); |
|
602 TInt ret = dlg->ExecuteLD( *prompt ); |
|
603 CleanupStack::PopAndDestroy( prompt ); |
|
604 return ret; |
|
605 } |
|
606 |
|
607 // End of File |