|
1 /* |
|
2 * Copyright (c) 2006-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: Source file of CFMRadioGlobalConfirmationQuery |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <AknGlobalConfirmationQuery.h> |
|
20 |
|
21 #include "fmradiodefines.h" |
|
22 #include "fmradioapp.h" |
|
23 #include "fmradioglobalconfirmationquery.h" |
|
24 |
|
25 // ======== MEMBER FUNCTIONS ======== |
|
26 |
|
27 // --------------------------------------------------------------------------- |
|
28 // CFMRadioGlobalConfirmationQuery::CFMRadioGlobalConfirmationQuery |
|
29 // --------------------------------------------------------------------------- |
|
30 // |
|
31 CFMRadioGlobalConfirmationQuery::CFMRadioGlobalConfirmationQuery(MFMRadioGlobalConfirmationQueryObserver* aObserver) |
|
32 : CActive( CActive::EPriorityStandard ), iObserver(aObserver) |
|
33 { |
|
34 CActiveScheduler::Add( this ); |
|
35 } |
|
36 |
|
37 |
|
38 // --------------------------------------------------------------------------- |
|
39 // CFMRadioGlobalConfirmationQuery::ConstructL |
|
40 // --------------------------------------------------------------------------- |
|
41 // |
|
42 void CFMRadioGlobalConfirmationQuery::ConstructL() |
|
43 { |
|
44 iAknGlobalConfirmationQuery = CAknGlobalConfirmationQuery::NewL(); |
|
45 } |
|
46 |
|
47 // --------------------------------------------------------------------------- |
|
48 // CFMRadioGlobalConfirmationQuery::NewL |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
|
51 CFMRadioGlobalConfirmationQuery* CFMRadioGlobalConfirmationQuery::NewL(MFMRadioGlobalConfirmationQueryObserver* aObserver) |
|
52 { |
|
53 CFMRadioGlobalConfirmationQuery* self = CFMRadioGlobalConfirmationQuery::NewLC(aObserver); |
|
54 CleanupStack::Pop( self ); |
|
55 return self; |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------------------------- |
|
59 // CFMRadioGlobalConfirmationQuery::NewLC |
|
60 // --------------------------------------------------------------------------- |
|
61 // |
|
62 CFMRadioGlobalConfirmationQuery* CFMRadioGlobalConfirmationQuery::NewLC(MFMRadioGlobalConfirmationQueryObserver* aObserver) |
|
63 { |
|
64 CFMRadioGlobalConfirmationQuery* self = NULL; |
|
65 self = new( ELeave ) CFMRadioGlobalConfirmationQuery(aObserver); |
|
66 CleanupStack::PushL( self ); |
|
67 self->ConstructL(); |
|
68 return self; |
|
69 } |
|
70 |
|
71 // --------------------------------------------------------------------------- |
|
72 // CFMRadioGlobalConfirmationQuery::~CFMRadioGlobalConfirmationQuery |
|
73 // --------------------------------------------------------------------------- |
|
74 // |
|
75 CFMRadioGlobalConfirmationQuery::~CFMRadioGlobalConfirmationQuery() |
|
76 { |
|
77 Cancel(); |
|
78 delete iAknGlobalConfirmationQuery; |
|
79 delete iText; |
|
80 } |
|
81 |
|
82 // --------------------------------------------------------------------------- |
|
83 // CFMRadioGlobalConfirmationQuery::ShowQueryL |
|
84 // --------------------------------------------------------------------------- |
|
85 // |
|
86 void CFMRadioGlobalConfirmationQuery::ShowQueryL(const TDesC& aText, TInt aSoftkeys, TInt aAnimation/*, TInt aDialogId*/) |
|
87 { |
|
88 Cancel(); |
|
89 delete iText; |
|
90 iText = NULL; |
|
91 iText = aText.AllocL(); |
|
92 iAknGlobalConfirmationQuery->ShowConfirmationQueryL( iStatus, *iText, aSoftkeys, aAnimation ); |
|
93 SetActive(); |
|
94 } |
|
95 |
|
96 // --------------------------------------------------------------------------- |
|
97 // CFMRadioGlobalConfirmationQuery::DoCancel |
|
98 // --------------------------------------------------------------------------- |
|
99 // |
|
100 void CFMRadioGlobalConfirmationQuery::DoCancel() |
|
101 { |
|
102 if ( iAknGlobalConfirmationQuery ) |
|
103 { |
|
104 iAknGlobalConfirmationQuery->CancelConfirmationQuery(); |
|
105 } |
|
106 } |
|
107 |
|
108 // --------------------------------------------------------------------------- |
|
109 // CFMRadioGlobalConfirmationQuery::RunL |
|
110 // --------------------------------------------------------------------------- |
|
111 // |
|
112 void CFMRadioGlobalConfirmationQuery::RunL() |
|
113 { |
|
114 if ( iObserver ) |
|
115 { |
|
116 iObserver->GlobalConfirmationQueryDismissedL(iStatus.Int()); |
|
117 } |
|
118 } |
|
119 |
|
120 // --------------------------------------------------------------------------- |
|
121 // CFMRadioGlobalConfirmationQuery::RunError |
|
122 // --------------------------------------------------------------------------- |
|
123 // |
|
124 TInt CFMRadioGlobalConfirmationQuery::RunError(TInt /*aError*/) |
|
125 { |
|
126 return KErrNone; |
|
127 } |