|
1 /* |
|
2 * Copyright (c) 2007-2007 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: CSC Applicationīs Dialog |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <avkon.rsg> |
|
20 #include <StringLoader.h> |
|
21 #include <AknGlobalNote.h> |
|
22 |
|
23 #include "cscdialog.h" |
|
24 #include "csclogger.h" |
|
25 |
|
26 // ======== MEMBER FUNCTIONS ======== |
|
27 |
|
28 |
|
29 // --------------------------------------------------------------------------- |
|
30 // --------------------------------------------------------------------------- |
|
31 // |
|
32 CCSCDialog::CCSCDialog() : CActive ( EPriorityHigh ) |
|
33 { |
|
34 } |
|
35 |
|
36 |
|
37 // --------------------------------------------------------------------------- |
|
38 // --------------------------------------------------------------------------- |
|
39 // |
|
40 void CCSCDialog::ConstructL() |
|
41 { |
|
42 CSCDEBUG( "CCSCDialog::ConstructL - begin" ); |
|
43 |
|
44 CActiveScheduler::Add( this ); |
|
45 |
|
46 CSCDEBUG( "CCSCDialog::ConstructL - end" ); |
|
47 } |
|
48 |
|
49 |
|
50 // --------------------------------------------------------------------------- |
|
51 // --------------------------------------------------------------------------- |
|
52 // |
|
53 CCSCDialog* CCSCDialog::NewL() |
|
54 { |
|
55 CCSCDialog* self = CCSCDialog::NewLC(); |
|
56 CleanupStack::Pop( self ); |
|
57 return self; |
|
58 } |
|
59 |
|
60 |
|
61 // --------------------------------------------------------------------------- |
|
62 // --------------------------------------------------------------------------- |
|
63 // |
|
64 CCSCDialog* CCSCDialog::NewLC() |
|
65 { |
|
66 CCSCDialog* self = new ( ELeave ) CCSCDialog(); |
|
67 CleanupStack::PushL( self ); |
|
68 self->ConstructL(); |
|
69 return self; |
|
70 } |
|
71 |
|
72 |
|
73 // --------------------------------------------------------------------------- |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
|
76 CCSCDialog::~CCSCDialog() |
|
77 { |
|
78 Cancel(); |
|
79 } |
|
80 |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CCSCDialog::LaunchWaitNoteL |
|
84 // Launches a wait note. |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 void CCSCDialog::LaunchWaitNoteL( const TInt aResourceId ) |
|
88 { |
|
89 CSCDEBUG( "CCSCDialog::LaunchWaitNoteL" ); |
|
90 |
|
91 if ( !IsActive() ) |
|
92 { |
|
93 // Show wait note with appropriate text. |
|
94 HBufC* text = StringLoader::LoadLC( aResourceId ); |
|
95 iWaitNote = CAknGlobalNote::NewL(); |
|
96 iWaitNote->SetSoftkeys( R_AVKON_SOFTKEYS_EMPTY ); |
|
97 iNoteId = iWaitNote->ShowNoteL( |
|
98 iStatus, |
|
99 EAknGlobalWaitNote, |
|
100 *text ); |
|
101 CleanupStack::PopAndDestroy( text ); |
|
102 SetActive(); |
|
103 } |
|
104 } |
|
105 |
|
106 |
|
107 // ----------------------------------------------------------------------------- |
|
108 // CCSCDialog::DestroyWaitNote |
|
109 // Destroys a wait note. |
|
110 // ----------------------------------------------------------------------------- |
|
111 // |
|
112 void CCSCDialog::DestroyWaitNote() |
|
113 { |
|
114 Cancel(); |
|
115 } |
|
116 |
|
117 |
|
118 // --------------------------------------------------------------------------- |
|
119 // From CActive |
|
120 // CCSCDialog::RunL |
|
121 // --------------------------------------------------------------------------- |
|
122 // |
|
123 void CCSCDialog::RunL() |
|
124 { |
|
125 CSCDEBUG( "CCSCDialog::RunL" ); |
|
126 } |
|
127 |
|
128 |
|
129 // --------------------------------------------------------------------------- |
|
130 // From CActive |
|
131 // CCSCDialog::DoCancel |
|
132 // --------------------------------------------------------------------------- |
|
133 // |
|
134 void CCSCDialog::DoCancel() |
|
135 { |
|
136 if ( iWaitNote ) |
|
137 { |
|
138 TRAP_IGNORE( iWaitNote->CancelNoteL( iNoteId ) ); |
|
139 delete iWaitNote; |
|
140 iWaitNote = NULL; |
|
141 } |
|
142 } |
|
143 |