author | Simon Howkins <simonh@symbian.org> |
Mon, 22 Nov 2010 16:50:40 +0000 | |
branch | RCL_3 |
changeset 44 | 87ee154df721 |
parent 38 | ac48f0cc9f9c |
permissions | -rw-r--r-- |
33 | 1 |
/* |
2 |
* Copyright (c) 2005 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: The MUS application's UI class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#include "musuiactivequerydialog.h" |
|
20 |
#include "musuiqueryobserver.h" |
|
21 |
#include "muslogger.h" |
|
22 |
#include "musunittesting.h" |
|
23 |
||
24 |
#include <AknGlobalConfirmationQuery.h> |
|
25 |
#include <avkon.rsg> |
|
26 |
#include <musui.rsg> |
|
27 |
#include <StringLoader.h> |
|
28 |
||
29 |
||
30 |
// ----------------------------------------------------------------------------- |
|
31 |
// |
|
32 |
// ----------------------------------------------------------------------------- |
|
33 |
// |
|
34 |
CMusUiActiveQueryDialog* CMusUiActiveQueryDialog::NewL( |
|
35 |
MMusUiQueryObserver& aObserver ) |
|
36 |
{ |
|
37 |
CMusUiActiveQueryDialog* self |
|
38 |
= new( ELeave ) CMusUiActiveQueryDialog( aObserver ); |
|
39 |
||
40 |
CleanupStack::PushL( self ); |
|
41 |
self->ConstructL(); |
|
42 |
CleanupStack::Pop( self ); |
|
43 |
||
44 |
return self; |
|
45 |
} |
|
46 |
||
47 |
||
48 |
// ----------------------------------------------------------------------------- |
|
49 |
// |
|
50 |
// ----------------------------------------------------------------------------- |
|
51 |
CMusUiActiveQueryDialog::~CMusUiActiveQueryDialog() |
|
52 |
{ |
|
53 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiActiveQueryDialog::~CMusUiActiveQueryDialog" ); |
|
54 |
||
55 |
Cancel(); |
|
56 |
delete iGlobalQuery; |
|
57 |
||
58 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiActiveQueryDialog::~CMusUiActiveQueryDialog" ); |
|
59 |
} |
|
60 |
||
61 |
||
62 |
// ----------------------------------------------------------------------------- |
|
63 |
// |
|
64 |
// ----------------------------------------------------------------------------- |
|
65 |
// |
|
66 |
CMusUiActiveQueryDialog::CMusUiActiveQueryDialog( MMusUiQueryObserver& aObserver ) |
|
67 |
: CActive( EPriorityNormal ), iObserver( aObserver ) |
|
68 |
{ |
|
69 |
CActiveScheduler::Add( this ); |
|
70 |
} |
|
71 |
||
72 |
||
73 |
// ----------------------------------------------------------------------------- |
|
74 |
// |
|
75 |
// ----------------------------------------------------------------------------- |
|
76 |
// |
|
77 |
void CMusUiActiveQueryDialog::ConstructL() |
|
78 |
{ |
|
79 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiActiveQueryDialog::ConstructL" ); |
|
80 |
||
81 |
iGlobalQuery = CAknGlobalConfirmationQuery::NewL(); |
|
82 |
||
83 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiActiveQueryDialog::ConstructL" ); |
|
84 |
} |
|
85 |
||
86 |
||
87 |
// ----------------------------------------------------------------------------- |
|
88 |
// |
|
89 |
// ----------------------------------------------------------------------------- |
|
90 |
// |
|
91 |
void CMusUiActiveQueryDialog::ShowL( const TDesC& aPrompt ) |
|
92 |
{ |
|
93 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiActiveQueryDialog::ShowL" ); |
|
94 |
||
95 |
iGlobalQuery->ShowConfirmationQueryL( |
|
96 |
iStatus, |
|
97 |
aPrompt, |
|
98 |
R_AVKON_SOFTKEYS_YES_NO ); |
|
99 |
SetActive(); |
|
100 |
||
101 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiActiveQueryDialog::ShowL" ); |
|
102 |
} |
|
103 |
||
104 |
||
105 |
// ----------------------------------------------------------------------------- |
|
106 |
// |
|
107 |
// ----------------------------------------------------------------------------- |
|
108 |
// |
|
109 |
void CMusUiActiveQueryDialog::RunL() |
|
110 |
{ |
|
111 |
MUS_LOG1( "mus: [MUSUI ] -> CMusUiActiveQueryDialog::RunL [%d]", iStatus.Int() ); |
|
38
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
112 |
if ( iStatus == EAknSoftkeyYes || iStatus == EEikBidOk ) |
33 | 113 |
{ |
114 |
MUS_LOG( "mus: [MUSUI ] CMusUiActiveQueryDialog::RunL: if" ); |
|
115 |
iObserver.QueryAcceptedL( ETrue ); |
|
116 |
} |
|
117 |
else // EAknSoftkeyNo |
|
118 |
{ |
|
119 |
MUS_LOG( "mus: [MUSUI ] CMusUiActiveQueryDialog::RunL: else" ); |
|
120 |
iObserver.QueryAcceptedL( EFalse ); |
|
121 |
} |
|
122 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiActiveQueryDialog::RunL" ); |
|
123 |
} |
|
124 |
||
125 |
||
126 |
// ----------------------------------------------------------------------------- |
|
127 |
// |
|
128 |
// ----------------------------------------------------------------------------- |
|
129 |
// |
|
130 |
void CMusUiActiveQueryDialog::DoCancel() |
|
131 |
{ |
|
132 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiActiveQueryDialog::DoCancel" ); |
|
133 |
iGlobalQuery->CancelConfirmationQuery(); |
|
134 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiActiveQueryDialog::DoCancel" ); |
|
135 |
} |
|
136 |
||
137 |
||
138 |
// ----------------------------------------------------------------------------- |
|
139 |
// |
|
140 |
// ----------------------------------------------------------------------------- |
|
141 |
// |
|
142 |
TInt CMusUiActiveQueryDialog::RunError( TInt aError ) |
|
143 |
{ |
|
144 |
MUS_LOG1( "mus: [MUSUI ] -> CMusUiActiveQueryDialog::RunError [%d]", |
|
145 |
aError ); |
|
146 |
||
147 |
iObserver.HandleQueryError( aError ); |
|
148 |
||
149 |
return KErrNone; |
|
150 |
} |
|
151 |
||
152 |
||
153 |
// end of file |