37 |
37 |
38 // ================= MEMBER FUNCTIONS ======================= |
38 // ================= MEMBER FUNCTIONS ======================= |
39 // |
39 // |
40 // --------------------------------------------------------- |
40 // --------------------------------------------------------- |
41 // CConfirmationQuery::CConfirmationQuery |
41 // CConfirmationQuery::CConfirmationQuery |
|
42 // HOME NETWORK |
42 // --------------------------------------------------------- |
43 // --------------------------------------------------------- |
43 // |
44 // |
44 CConfirmationQuery::CConfirmationQuery( CConfirmationQueryNotif* aNotif ) |
45 CConfirmationQuery::CConfirmationQuery( CConfirmationQueryNotif* aNotif ) |
45 : CAknListQueryDialog( &iDummy ), |
46 : CAknListQueryDialog( &iDummy ), |
46 iNotif( aNotif ), |
47 iNotif( aNotif ), |
47 iButtonGroupPreviouslyChanged( EFalse ) |
48 iButtonGroupPreviouslyChanged( EFalse ) |
48 { |
49 { |
49 } |
50 } |
50 |
51 |
51 |
|
52 // --------------------------------------------------------- |
52 // --------------------------------------------------------- |
53 // CConfirmationQuery::~CConfirmationQuery |
53 // CConfirmationQuery::~CConfirmationQuery |
54 // --------------------------------------------------------- |
54 // --------------------------------------------------------- |
55 // |
55 // |
56 CConfirmationQuery::~CConfirmationQuery() |
56 CConfirmationQuery::~CConfirmationQuery() |
57 { |
57 { |
58 STATIC_CAST( CEikServAppUi*, |
58 STATIC_CAST( CEikServAppUi*, |
59 CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse ); |
59 CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse ); |
60 delete iExpiryTimer; |
60 delete iExpiryTimer; |
61 } |
61 } |
62 |
|
63 |
|
64 |
62 |
65 // --------------------------------------------------------- |
63 // --------------------------------------------------------- |
66 // CConfirmationQuery::OkToExitL |
64 // CConfirmationQuery::OkToExitL |
67 // --------------------------------------------------------- |
65 // --------------------------------------------------------- |
68 // |
66 // |
109 CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue ); |
106 CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue ); |
110 |
107 |
111 iExpiryTimer = CExpiryTimer::NewL( *this ); |
108 iExpiryTimer = CExpiryTimer::NewL( *this ); |
112 iExpiryTimer->Start(); |
109 iExpiryTimer->Start(); |
113 } |
110 } |
114 |
|
115 |
111 |
116 // --------------------------------------------------------- |
112 // --------------------------------------------------------- |
117 // CConfirmationQuery::TryExitL() |
113 // CConfirmationQuery::TryExitL() |
118 // --------------------------------------------------------- |
114 // --------------------------------------------------------- |
119 // |
115 // |
157 { |
153 { |
158 TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) ); |
154 TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) ); |
159 } |
155 } |
160 |
156 |
161 |
157 |
|
158 // ================= MEMBER FUNCTIONS ======================= |
|
159 // |
|
160 // --------------------------------------------------------- |
|
161 // CConfirmationQueryVisitor::CConfirmationQueryVisitor |
|
162 // VISITOR NETWORK |
|
163 // --------------------------------------------------------- |
|
164 // |
|
165 CConfirmationQueryVisitor::CConfirmationQueryVisitor( |
|
166 CConfirmationQueryNotif* aNotif ) |
|
167 : |
|
168 iNotif( aNotif ) |
|
169 { |
|
170 } |
|
171 |
|
172 // --------------------------------------------------------- |
|
173 // CConfirmationQueryVisitor::~CConfirmationQueryVisitor |
|
174 // --------------------------------------------------------- |
|
175 // |
|
176 CConfirmationQueryVisitor::~CConfirmationQueryVisitor() |
|
177 { |
|
178 STATIC_CAST( CEikServAppUi*, |
|
179 CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse ); |
|
180 delete iExpiryTimer; |
|
181 } |
|
182 |
|
183 // --------------------------------------------------------- |
|
184 // CConfirmationQueryVisitor::OkToExitL |
|
185 // --------------------------------------------------------- |
|
186 // |
|
187 TBool CConfirmationQueryVisitor::OkToExitL( TInt aButtonId ) |
|
188 { |
|
189 CLOG_ENTERFN( "CConfirmationQueryVisitor::OkToExitL" ); |
|
190 TBool result( EFalse ); |
|
191 TInt status = KErrCancel; |
|
192 |
|
193 if ( aButtonId == EAknSoftkeySelect || |
|
194 aButtonId == EAknSoftkeyDone || aButtonId == EAknSoftkeyOk ) |
|
195 { |
|
196 iNotif->SetSelectedChoiceL( EMsgQueryThisTime ); |
|
197 result = ETrue; |
|
198 status = KErrNone; |
|
199 } |
|
200 else if ( aButtonId == EAknSoftkeyCancel ) |
|
201 { |
|
202 status = KErrCancel; |
|
203 result = ETrue; |
|
204 } |
|
205 |
|
206 if ( result ) |
|
207 { |
|
208 CLOG_WRITEF( _L( "aButtonId = %d" ), aButtonId ); |
|
209 if ( iNotif ) |
|
210 { |
|
211 iNotif->CompleteL( status ); |
|
212 } |
|
213 } |
|
214 |
|
215 CLOG_LEAVEFN( "CConfirmationQueryVisitor::OkToExitL" ); |
|
216 |
|
217 return result; |
|
218 } |
|
219 |
|
220 // --------------------------------------------------------- |
|
221 // CConfirmationQueryVisitor::PreLayoutDynInitL() |
|
222 // --------------------------------------------------------- |
|
223 // |
|
224 void CConfirmationQueryVisitor::PreLayoutDynInitL() |
|
225 { |
|
226 CAknMessageQueryDialog::PreLayoutDynInitL(); |
|
227 |
|
228 STATIC_CAST( CEikServAppUi*, |
|
229 CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue ); |
|
230 |
|
231 iExpiryTimer = CExpiryTimer::NewL( *this ); |
|
232 iExpiryTimer->Start(); |
|
233 } |
|
234 |
|
235 // --------------------------------------------------------- |
|
236 // CConfirmationQueryVisitor::TryExitL() |
|
237 // --------------------------------------------------------- |
|
238 // |
|
239 void CConfirmationQueryVisitor::TryExitL( TInt aButtonId ) |
|
240 { |
|
241 CLOG_ENTERFN( "CConfirmationQueryVisitor::TryExitL" ); |
|
242 CAknMessageQueryDialog::TryExitL( aButtonId ); |
|
243 CLOG_LEAVEFN( "CConfirmationQueryVisitor::TryExitL" ); |
|
244 } |
|
245 |
|
246 // --------------------------------------------------------- |
|
247 // CConfirmationQueryVisitor::OfferKeyEventL |
|
248 // --------------------------------------------------------- |
|
249 // |
|
250 TKeyResponse CConfirmationQueryVisitor::OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
251 TEventCode aType) |
|
252 { |
|
253 if( aType == EEventKey && aKeyEvent.iCode == EKeyPhoneSend ) |
|
254 { |
|
255 // Let's not obscure the Dialer in the background |
|
256 if ( iExpiryTimer ) |
|
257 { |
|
258 iExpiryTimer->Cancel(); |
|
259 iExpiryTimer->StartShort(); |
|
260 } |
|
261 } |
|
262 |
|
263 return CAknMessageQueryDialog::OfferKeyEventL( aKeyEvent,aType ); |
|
264 } |
|
265 |
|
266 void CConfirmationQueryVisitor::HandleTimedOut() |
|
267 { |
|
268 TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) ); |
|
269 } |
|
270 |
162 // End of File |
271 // End of File |