|
1 /* |
|
2 * Copyright (c) 2008 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: Phonebook2 command execution handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "CCCAppCommLauncherPbkCmd.h" |
|
20 #include "ccappcommlauncherplugin.h" |
|
21 |
|
22 #include <CPbk2ApplicationServices.h> |
|
23 #include <Pbk2DataCaging.hrh> |
|
24 #include <CPbk2CommandHandler.h> |
|
25 #include <CVPbkContactManager.h> |
|
26 #include <MVPbkContactLinkArray.h> |
|
27 #include <MVPbkContactStore.h> |
|
28 #include <MVPbkStoreContact.h> |
|
29 #include <MVPbkContactOperationBase.h> |
|
30 #include <MVPbkContactLink.h> |
|
31 #include <MPbk2Command.h> |
|
32 #include <Pbk2MenuFilteringFlags.hrh> |
|
33 |
|
34 #include <coemain.h> |
|
35 |
|
36 _LIT(KPbk2CommandsDllResFileName, "Pbk2Commands.rsc"); |
|
37 _LIT(KPbk2UiControlsDllResFileName, "Pbk2UiControls.rsc"); |
|
38 _LIT(KPbk2CommonUiDllResFileName, "Pbk2CommonUi.rsc" ); |
|
39 |
|
40 /// Unnamed namespace for local definitions |
|
41 namespace |
|
42 { |
|
43 const TInt KNumberOfContacts = 1; |
|
44 } // namespace |
|
45 |
|
46 // --------------------------------------------------------------------------- |
|
47 // CCCAppCommLauncherPbkCmd::CCCAppCommLauncherPbkCmd |
|
48 // --------------------------------------------------------------------------- |
|
49 // |
|
50 CCCAppCommLauncherPbkCmd::CCCAppCommLauncherPbkCmd( CCCAppCommLauncherPlugin& aPlugin ): |
|
51 iCommandsResourceFile( *CCoeEnv::Static() ), |
|
52 iUiControlsResourceFile( *CCoeEnv::Static() ), |
|
53 iCommonUiResourceFile( *CCoeEnv::Static() ), |
|
54 iPlugin( aPlugin ), |
|
55 iCommandInProgress( EFalse ) |
|
56 { |
|
57 } |
|
58 |
|
59 |
|
60 // --------------------------------------------------------------------------- |
|
61 // CCCAppCommLauncherPbkCmd::ConstructL |
|
62 // --------------------------------------------------------------------------- |
|
63 // |
|
64 void CCCAppCommLauncherPbkCmd::ConstructL() |
|
65 { |
|
66 PreparePbk2ApplicationServicesL(); |
|
67 iCommandHandler = CPbk2CommandHandler::NewL(); |
|
68 } |
|
69 |
|
70 |
|
71 // --------------------------------------------------------------------------- |
|
72 // CCCAppCommLauncherPbkCmd::NewL |
|
73 // --------------------------------------------------------------------------- |
|
74 // |
|
75 CCCAppCommLauncherPbkCmd* CCCAppCommLauncherPbkCmd::NewL( CCCAppCommLauncherPlugin& aPlugin ) |
|
76 { |
|
77 CCCAppCommLauncherPbkCmd* self = CCCAppCommLauncherPbkCmd::NewLC( aPlugin ); |
|
78 CleanupStack::Pop( self ); |
|
79 return self; |
|
80 } |
|
81 |
|
82 |
|
83 // --------------------------------------------------------------------------- |
|
84 // CCCAppCommLauncherPbkCmd::NewLC |
|
85 // --------------------------------------------------------------------------- |
|
86 // |
|
87 CCCAppCommLauncherPbkCmd* CCCAppCommLauncherPbkCmd::NewLC( CCCAppCommLauncherPlugin& aPlugin ) |
|
88 { |
|
89 CCCAppCommLauncherPbkCmd* self = new( ELeave ) CCCAppCommLauncherPbkCmd( aPlugin ); |
|
90 CleanupStack::PushL( self ); |
|
91 self->ConstructL(); |
|
92 return self; |
|
93 } |
|
94 |
|
95 |
|
96 // --------------------------------------------------------------------------- |
|
97 // CCCAppCommLauncherPbkCmd::~CCCAppCommLauncherPbkCmd |
|
98 // --------------------------------------------------------------------------- |
|
99 // |
|
100 CCCAppCommLauncherPbkCmd::~CCCAppCommLauncherPbkCmd() |
|
101 { |
|
102 if ( iCommand ) |
|
103 { |
|
104 iCommand->ResetUiControl( *this ); |
|
105 } |
|
106 |
|
107 delete iStoreContact; |
|
108 delete iCommandHandler; |
|
109 delete iLinks; |
|
110 delete iOperation; |
|
111 |
|
112 // Close contact store |
|
113 if( iContactStore ) |
|
114 { |
|
115 iContactStore->Close( *this ); |
|
116 } |
|
117 |
|
118 Release( iAppServices ); |
|
119 |
|
120 iCommandsResourceFile.Close(); |
|
121 iUiControlsResourceFile.Close(); |
|
122 iCommonUiResourceFile.Close(); |
|
123 } |
|
124 |
|
125 // --------------------------------------------------------------------------- |
|
126 // CCCAppCommLauncherMenuHandler::PreparePbk2ApplicationServicesL |
|
127 // --------------------------------------------------------------------------- |
|
128 // |
|
129 void CCCAppCommLauncherPbkCmd::PreparePbk2ApplicationServicesL() |
|
130 { |
|
131 iCommandsResourceFile.OpenL( |
|
132 KPbk2RomFileDrive, KDC_RESOURCE_FILES_DIR, KPbk2CommandsDllResFileName ); |
|
133 iUiControlsResourceFile.OpenL( |
|
134 KPbk2RomFileDrive, KDC_RESOURCE_FILES_DIR, KPbk2UiControlsDllResFileName ); |
|
135 iCommonUiResourceFile.OpenL( |
|
136 KPbk2RomFileDrive, KDC_RESOURCE_FILES_DIR, KPbk2CommonUiDllResFileName ); |
|
137 |
|
138 iAppServices = CPbk2ApplicationServices::InstanceL(); |
|
139 }; |
|
140 |
|
141 // --------------------------------------------------------------------------- |
|
142 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdAssignDefault |
|
143 // --------------------------------------------------------------------------- |
|
144 // |
|
145 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdAssignDefaultL( const TDesC8& aContact ) |
|
146 { |
|
147 iCommandInProgress = ETrue; |
|
148 |
|
149 iPbk2CommandId = EPbk2CmdDefaultSettings; |
|
150 |
|
151 if( iLinks ) |
|
152 { |
|
153 delete iLinks; |
|
154 iLinks = NULL; |
|
155 } |
|
156 |
|
157 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
|
158 |
|
159 if ( iLinks && iLinks->Count() > 0 ) |
|
160 { |
|
161 // operation completes by StoreReady, |
|
162 // StoreUnavailable or HandleStoreEventL |
|
163 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
|
164 } |
|
165 |
|
166 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
|
167 } |
|
168 |
|
169 // --------------------------------------------------------------------------- |
|
170 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdViewImageL |
|
171 // --------------------------------------------------------------------------- |
|
172 // |
|
173 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdViewImageL( const TDesC8& aContact ) |
|
174 { |
|
175 iCommandInProgress = ETrue; |
|
176 |
|
177 iPbk2CommandId = EPbk2CmdViewImage; |
|
178 |
|
179 if( iLinks ) |
|
180 { |
|
181 delete iLinks; |
|
182 iLinks = NULL; |
|
183 } |
|
184 |
|
185 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
|
186 |
|
187 if ( iLinks && iLinks->Count() > 0 ) |
|
188 { |
|
189 // operation completes by StoreReady, |
|
190 // StoreUnavailable or HandleStoreEventL |
|
191 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
|
192 } |
|
193 |
|
194 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
|
195 } |
|
196 |
|
197 // --------------------------------------------------------------------------- |
|
198 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdChangeImageL |
|
199 // --------------------------------------------------------------------------- |
|
200 // |
|
201 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdChangeImageL( const TDesC8& aContact ) |
|
202 { |
|
203 iCommandInProgress = ETrue; |
|
204 |
|
205 iPbk2CommandId = EPbk2CmdChangeImage; |
|
206 |
|
207 if( iLinks ) |
|
208 { |
|
209 delete iLinks; |
|
210 iLinks = NULL; |
|
211 } |
|
212 |
|
213 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
|
214 |
|
215 if ( iLinks && iLinks->Count() > 0 ) |
|
216 { |
|
217 // operation completes by StoreReady, |
|
218 // StoreUnavailable or HandleStoreEventL |
|
219 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
|
220 } |
|
221 |
|
222 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
|
223 } |
|
224 |
|
225 // --------------------------------------------------------------------------- |
|
226 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdRemoveImageL |
|
227 // --------------------------------------------------------------------------- |
|
228 // |
|
229 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdRemoveImageL( const TDesC8& aContact ) |
|
230 { |
|
231 iCommandInProgress = ETrue; |
|
232 |
|
233 iPbk2CommandId = EPbk2CmdRemoveImage; |
|
234 |
|
235 if( iLinks ) |
|
236 { |
|
237 delete iLinks; |
|
238 iLinks = NULL; |
|
239 } |
|
240 |
|
241 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
|
242 |
|
243 if ( iLinks && iLinks->Count() > 0 ) |
|
244 { |
|
245 // operation completes by StoreReady, |
|
246 // StoreUnavailable or HandleStoreEventL |
|
247 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
|
248 } |
|
249 |
|
250 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
|
251 } |
|
252 |
|
253 // --------------------------------------------------------------------------- |
|
254 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdAddImageL |
|
255 // --------------------------------------------------------------------------- |
|
256 // |
|
257 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdAddImageL( const TDesC8& aContact ) |
|
258 { |
|
259 iCommandInProgress = ETrue; |
|
260 |
|
261 iPbk2CommandId = EPbk2CmdAddImage; |
|
262 |
|
263 if( iLinks ) |
|
264 { |
|
265 delete iLinks; |
|
266 iLinks = NULL; |
|
267 } |
|
268 |
|
269 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
|
270 |
|
271 if ( iLinks && iLinks->Count() > 0 ) |
|
272 { |
|
273 // operation completes by StoreReady, |
|
274 // StoreUnavailable or HandleStoreEventL |
|
275 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
|
276 } |
|
277 |
|
278 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
|
279 } |
|
280 |
|
281 // --------------------------------------------------------------------------- |
|
282 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdShowOnMapL |
|
283 // --------------------------------------------------------------------------- |
|
284 // |
|
285 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdShowMapL( const HBufC8* aContact, |
|
286 TPbk2CommandId aCommandId ) |
|
287 { |
|
288 iCommandInProgress = ETrue; |
|
289 |
|
290 iPbk2CommandId = aCommandId; |
|
291 |
|
292 if( iLinks ) |
|
293 { |
|
294 delete iLinks; |
|
295 iLinks = NULL; |
|
296 } |
|
297 |
|
298 iLinks = iAppServices->ContactManager().CreateLinksLC( *aContact ); |
|
299 |
|
300 if ( iLinks->Count() > 0 ) |
|
301 { |
|
302 // operation completes by StoreReady, |
|
303 // StoreUnavailable or HandleStoreEventL |
|
304 (iLinks->At( 0 )).ContactStore().OpenL( *this ); |
|
305 } |
|
306 |
|
307 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
|
308 } |
|
309 |
|
310 // --------------------------------------------------------------------------- |
|
311 // CCCAppCommLauncherMenuHandler::ExecutePbk2CmdDeleteL |
|
312 // --------------------------------------------------------------------------- |
|
313 // |
|
314 void CCCAppCommLauncherPbkCmd::ExecutePbk2CmdDeleteL( const TDesC8& aContact ) |
|
315 { |
|
316 iCommandInProgress = ETrue; |
|
317 |
|
318 iPbk2CommandId = EPbk2CmdDeleteMe; |
|
319 |
|
320 if( iLinks ) |
|
321 { |
|
322 delete iLinks; |
|
323 iLinks = NULL; |
|
324 } |
|
325 |
|
326 iLinks = iAppServices->ContactManager().CreateLinksLC( aContact ); |
|
327 |
|
328 if ( iLinks->Count() > 0 ) |
|
329 { |
|
330 // operation completes by StoreReady, |
|
331 // StoreUnavailable or HandleStoreEventL |
|
332 ( iLinks->At( 0 ) ).ContactStore().OpenL( *this ); |
|
333 } |
|
334 |
|
335 CleanupStack::Pop( 1 ); // iLinks (deleted in destructor) |
|
336 } |
|
337 |
|
338 // --------------------------------------------------------------------------- |
|
339 // CCCAppCommLauncherMenuHandler::HandleError |
|
340 // --------------------------------------------------------------------------- |
|
341 // |
|
342 void CCCAppCommLauncherPbkCmd::HandleError( TInt aError ) |
|
343 { |
|
344 CCoeEnv::Static()->HandleError( aError ); |
|
345 } |
|
346 // --------------------------------------------------------------------------- |
|
347 // CCCAppCommLauncherPbkCmd::StoreReady |
|
348 // --------------------------------------------------------------------------- |
|
349 // |
|
350 void CCCAppCommLauncherPbkCmd::StoreReady( |
|
351 MVPbkContactStore& aContactStore ) |
|
352 { |
|
353 iContactStore = &aContactStore; |
|
354 |
|
355 // operation completes by VPbkSingleContactOperationComplete |
|
356 // or VPbkSingleContactOperationFailed |
|
357 if( iOperation ) |
|
358 { |
|
359 delete iOperation; |
|
360 iOperation = NULL; |
|
361 } |
|
362 |
|
363 TRAPD( err,iOperation = iAppServices->ContactManager().RetrieveContactL( iLinks->At( 0 ), *this ) ;) |
|
364 if( err != KErrNone ) |
|
365 { |
|
366 HandleError( err ); |
|
367 } |
|
368 } |
|
369 |
|
370 // --------------------------------------------------------------------------- |
|
371 // CCCAppCommLauncherPbkCmd::StoreUnavailable |
|
372 // --------------------------------------------------------------------------- |
|
373 // |
|
374 void CCCAppCommLauncherPbkCmd::StoreUnavailable( |
|
375 MVPbkContactStore& /*aContactStore*/, |
|
376 TInt /*aReason*/) |
|
377 { |
|
378 } |
|
379 |
|
380 // --------------------------------------------------------------------------- |
|
381 // CCCAppCommLauncherPbkCmd::HandleStoreEventL |
|
382 // --------------------------------------------------------------------------- |
|
383 // |
|
384 void CCCAppCommLauncherPbkCmd::HandleStoreEventL( |
|
385 MVPbkContactStore& /*aContactStore*/, |
|
386 TVPbkContactStoreEvent /*aStoreEvent*/) |
|
387 { |
|
388 } |
|
389 |
|
390 // --------------------------------------------------------------------------- |
|
391 // CCCAppCommLauncherPbkCmd::VPbkSingleContactOperationComplete |
|
392 // --------------------------------------------------------------------------- |
|
393 // |
|
394 void CCCAppCommLauncherPbkCmd::VPbkSingleContactOperationComplete( |
|
395 MVPbkContactOperationBase& /*aOperation*/, |
|
396 MVPbkStoreContact* aContact ) |
|
397 { |
|
398 delete iStoreContact; |
|
399 iStoreContact = aContact; |
|
400 |
|
401 if( !iCommandHandler ) |
|
402 { |
|
403 TRAPD(err, iCommandHandler = CPbk2CommandHandler::NewL();) |
|
404 if( err != KErrNone ) |
|
405 { |
|
406 HandleError( err ); |
|
407 return; |
|
408 } |
|
409 } |
|
410 |
|
411 TRAPD(err, iCommandHandler->HandleCommandL( |
|
412 iPbk2CommandId, *this, NULL );) |
|
413 if( err != KErrNone ) |
|
414 { |
|
415 HandleError( err ); |
|
416 } |
|
417 } |
|
418 |
|
419 // --------------------------------------------------------------------------- |
|
420 // CCCAppCommLauncherPbkCmd::VPbkSingleContactOperationFailed |
|
421 // --------------------------------------------------------------------------- |
|
422 // |
|
423 void CCCAppCommLauncherPbkCmd::VPbkSingleContactOperationFailed( |
|
424 MVPbkContactOperationBase& /*aOperation*/, |
|
425 TInt /*aError*/ ) |
|
426 { |
|
427 |
|
428 } |
|
429 |
|
430 // -------------------------------------------------------------------------- |
|
431 // CCCAppCommLauncherPbkCmd::ParentControl |
|
432 // -------------------------------------------------------------------------- |
|
433 // |
|
434 MPbk2ContactUiControl* CCCAppCommLauncherPbkCmd::ParentControl() const |
|
435 { |
|
436 // Contact info control has no parent control |
|
437 return NULL; |
|
438 } |
|
439 |
|
440 // -------------------------------------------------------------------------- |
|
441 // CCCAppCommLauncherPbkCmd::NumberOfContacts |
|
442 // -------------------------------------------------------------------------- |
|
443 // |
|
444 TInt CCCAppCommLauncherPbkCmd::NumberOfContacts() const |
|
445 { |
|
446 return KNumberOfContacts; |
|
447 } |
|
448 |
|
449 // -------------------------------------------------------------------------- |
|
450 // CCCAppCommLauncherPbkCmd::FocusedContactL |
|
451 // -------------------------------------------------------------------------- |
|
452 // |
|
453 const MVPbkBaseContact* CCCAppCommLauncherPbkCmd::FocusedContactL() const |
|
454 { |
|
455 return STATIC_CAST(MVPbkBaseContact*, iStoreContact); |
|
456 } |
|
457 |
|
458 // -------------------------------------------------------------------------- |
|
459 // CCCAppCommLauncherPbkCmd::FocusedViewContactL |
|
460 // -------------------------------------------------------------------------- |
|
461 // |
|
462 const MVPbkViewContact* CCCAppCommLauncherPbkCmd::FocusedViewContactL() const |
|
463 { |
|
464 return NULL; |
|
465 } |
|
466 |
|
467 // -------------------------------------------------------------------------- |
|
468 // CCCAppCommLauncherPbkCmd::FocusedStoreContact |
|
469 // -------------------------------------------------------------------------- |
|
470 // |
|
471 const MVPbkStoreContact* CCCAppCommLauncherPbkCmd::FocusedStoreContact() const |
|
472 { |
|
473 return iStoreContact; |
|
474 } |
|
475 |
|
476 // -------------------------------------------------------------------------- |
|
477 // CCCAppCommLauncherPbkCmd::SetFocusedContactL |
|
478 // -------------------------------------------------------------------------- |
|
479 // |
|
480 void CCCAppCommLauncherPbkCmd::SetFocusedContactL( |
|
481 const MVPbkBaseContact& aContact) |
|
482 { |
|
483 if (!iStoreContact->IsSame(aContact)) |
|
484 { |
|
485 MVPbkContactLink* link = aContact.CreateLinkLC(); |
|
486 HBufC8* packed = link->PackLC(); |
|
487 |
|
488 // Update the CCA parameter contact data |
|
489 HBufC16* link16 = HBufC16::NewLC(packed->Length()); |
|
490 link16->Des().Copy(packed->Des()); |
|
491 iPlugin.AppEngine()->Parameter().SetContactDataL(link16->Des()); |
|
492 iPlugin.AppEngine()->CCAppContactEventL(); |
|
493 CleanupStack::PopAndDestroy(3); // link16, packed, link |
|
494 |
|
495 // Update the commlauncher the UI contact data |
|
496 iPlugin.ContactHandler().RefetchContactL(); |
|
497 iPlugin.Container().ContactsChangedL(); |
|
498 } |
|
499 } |
|
500 |
|
501 // -------------------------------------------------------------------------- |
|
502 // CCCAppCommLauncherPbkCmd::SetFocusedContactL |
|
503 // -------------------------------------------------------------------------- |
|
504 // |
|
505 void CCCAppCommLauncherPbkCmd::SetFocusedContactL( |
|
506 const MVPbkContactBookmark& /*aContactBookmark*/) |
|
507 { |
|
508 // Do nothing |
|
509 } |
|
510 |
|
511 // -------------------------------------------------------------------------- |
|
512 // CCCAppCommLauncherPbkCmd::SetFocusedContactL |
|
513 // -------------------------------------------------------------------------- |
|
514 // |
|
515 void CCCAppCommLauncherPbkCmd::SetFocusedContactL( |
|
516 const MVPbkContactLink& /*aContactLink*/) |
|
517 { |
|
518 // Do nothing |
|
519 } |
|
520 |
|
521 // -------------------------------------------------------------------------- |
|
522 // CCCAppCommLauncherPbkCmd::FocusedContactIndex |
|
523 // -------------------------------------------------------------------------- |
|
524 // |
|
525 TInt CCCAppCommLauncherPbkCmd::FocusedContactIndex() const |
|
526 { |
|
527 return KErrNotFound; |
|
528 } |
|
529 |
|
530 // -------------------------------------------------------------------------- |
|
531 // CCCAppCommLauncherPbkCmd::SetFocusedContactIndexL |
|
532 // -------------------------------------------------------------------------- |
|
533 // |
|
534 void CCCAppCommLauncherPbkCmd::SetFocusedContactIndexL(TInt /*aIndex*/) |
|
535 { |
|
536 // Do nothing |
|
537 } |
|
538 |
|
539 // -------------------------------------------------------------------------- |
|
540 // CCCAppCommLauncherPbkCmd::NumberOfContactFields |
|
541 // -------------------------------------------------------------------------- |
|
542 // |
|
543 TInt CCCAppCommLauncherPbkCmd::NumberOfContactFields() const |
|
544 { |
|
545 TInt cnt = KErrNotSupported; |
|
546 return cnt; |
|
547 } |
|
548 |
|
549 // -------------------------------------------------------------------------- |
|
550 // CCCAppCommLauncherPbkCmd::FocusedField |
|
551 // -------------------------------------------------------------------------- |
|
552 // |
|
553 const MVPbkBaseContactField* CCCAppCommLauncherPbkCmd::FocusedField() const |
|
554 { |
|
555 return NULL; |
|
556 } |
|
557 |
|
558 // -------------------------------------------------------------------------- |
|
559 // CCCAppCommLauncherPbkCmd::FocusedFieldIndex |
|
560 // -------------------------------------------------------------------------- |
|
561 // |
|
562 TInt CCCAppCommLauncherPbkCmd::FocusedFieldIndex() const |
|
563 { |
|
564 return 0; |
|
565 } |
|
566 |
|
567 // -------------------------------------------------------------------------- |
|
568 // CCCAppCommLauncherPbkCmd::SetFocusedFieldIndex |
|
569 // -------------------------------------------------------------------------- |
|
570 // |
|
571 void CCCAppCommLauncherPbkCmd::SetFocusedFieldIndex(TInt /*aIndex*/) |
|
572 { |
|
573 // Do nothing |
|
574 } |
|
575 |
|
576 // -------------------------------------------------------------------------- |
|
577 // CCCAppCommLauncherPbkCmd::ContactsMarked |
|
578 // -------------------------------------------------------------------------- |
|
579 // |
|
580 TBool CCCAppCommLauncherPbkCmd::ContactsMarked() const |
|
581 { |
|
582 // This control does not support contacts marking |
|
583 return EFalse; |
|
584 } |
|
585 |
|
586 // -------------------------------------------------------------------------- |
|
587 // CCCAppCommLauncherPbkCmd::SelectedContactsL |
|
588 // -------------------------------------------------------------------------- |
|
589 // |
|
590 MVPbkContactLinkArray* CCCAppCommLauncherPbkCmd::SelectedContactsL() const |
|
591 { |
|
592 // No selection support in contact info control |
|
593 return NULL; |
|
594 } |
|
595 |
|
596 // -------------------------------------------------------------------------- |
|
597 // CCCAppCommLauncherPbkCmd::SelectedContactsOrFocusedContactL |
|
598 // -------------------------------------------------------------------------- |
|
599 // |
|
600 MVPbkContactLinkArray* |
|
601 CCCAppCommLauncherPbkCmd::SelectedContactsOrFocusedContactL() const |
|
602 { |
|
603 CVPbkContactLinkArray* array = CVPbkContactLinkArray::NewLC(); |
|
604 |
|
605 if ( iStoreContact ) |
|
606 { |
|
607 MVPbkContactLink* link = iStoreContact->CreateLinkLC(); |
|
608 array->AppendL(link); |
|
609 CleanupStack::Pop(); // link |
|
610 } |
|
611 CleanupStack::Pop(); // array |
|
612 |
|
613 return array; |
|
614 } |
|
615 |
|
616 // -------------------------------------------------------------------------- |
|
617 // CCCAppCommLauncherPbkCmd::SelectedContactsIteratorL |
|
618 // -------------------------------------------------------------------------- |
|
619 // |
|
620 MPbk2ContactLinkIterator* |
|
621 CCCAppCommLauncherPbkCmd::SelectedContactsIteratorL() const |
|
622 { |
|
623 // No selection support in contact info control |
|
624 return NULL; |
|
625 } |
|
626 |
|
627 // -------------------------------------------------------------------------- |
|
628 // CCCAppCommLauncherPbkCmd::SelectedContactStoresL |
|
629 // -------------------------------------------------------------------------- |
|
630 // |
|
631 CArrayPtr<MVPbkContactStore>* |
|
632 CCCAppCommLauncherPbkCmd::SelectedContactStoresL() const |
|
633 { |
|
634 // This is not a contact store control |
|
635 return NULL; |
|
636 } |
|
637 |
|
638 // -------------------------------------------------------------------------- |
|
639 // CCCAppCommLauncherPbkCmd::ClearMarks |
|
640 // -------------------------------------------------------------------------- |
|
641 // |
|
642 void CCCAppCommLauncherPbkCmd::ClearMarks() |
|
643 { |
|
644 // Do nothing |
|
645 } |
|
646 |
|
647 // -------------------------------------------------------------------------- |
|
648 // CCCAppCommLauncherPbkCmd::SetSelectedContactL |
|
649 // -------------------------------------------------------------------------- |
|
650 // |
|
651 void CCCAppCommLauncherPbkCmd::SetSelectedContactL( |
|
652 TInt /*aIndex*/, |
|
653 TBool /*aSelected*/) |
|
654 { |
|
655 // Not supported in Contact Info |
|
656 } |
|
657 |
|
658 // -------------------------------------------------------------------------- |
|
659 // CCCAppCommLauncherPbkCmd::SetSelectedContactL |
|
660 // -------------------------------------------------------------------------- |
|
661 // |
|
662 void CCCAppCommLauncherPbkCmd::SetSelectedContactL( |
|
663 const MVPbkContactBookmark& /*aContactBookmark*/, |
|
664 TBool /*aSelected*/) |
|
665 { |
|
666 // Not supported |
|
667 } |
|
668 |
|
669 // -------------------------------------------------------------------------- |
|
670 // CCCAppCommLauncherPbkCmd::SetSelectedContactL |
|
671 // -------------------------------------------------------------------------- |
|
672 // |
|
673 void CCCAppCommLauncherPbkCmd::SetSelectedContactL( |
|
674 const MVPbkContactLink& /*aContactLink*/, |
|
675 TBool /*aSelected*/) |
|
676 { |
|
677 // Not supported |
|
678 } |
|
679 |
|
680 |
|
681 |
|
682 // -------------------------------------------------------------------------- |
|
683 // CCCAppCommLauncherPbkCmd::DynInitMenuPaneL |
|
684 // -------------------------------------------------------------------------- |
|
685 // |
|
686 void CCCAppCommLauncherPbkCmd::DynInitMenuPaneL( |
|
687 TInt /*aResourceId*/, |
|
688 CEikMenuPane* /*aMenuPane*/) const |
|
689 { |
|
690 // Nothing to do |
|
691 } |
|
692 |
|
693 // -------------------------------------------------------------------------- |
|
694 // CCCAppCommLauncherPbkCmd::ProcessCommandL |
|
695 // -------------------------------------------------------------------------- |
|
696 // |
|
697 void CCCAppCommLauncherPbkCmd::ProcessCommandL(TInt /*aCommandId*/) const |
|
698 { |
|
699 // Nothing to do |
|
700 } |
|
701 |
|
702 // -------------------------------------------------------------------------- |
|
703 // CCCAppCommLauncherPbkCmd::UpdateAfterCommandExecution |
|
704 // -------------------------------------------------------------------------- |
|
705 // |
|
706 void CCCAppCommLauncherPbkCmd::UpdateAfterCommandExecution() |
|
707 { |
|
708 if( iCommand ) |
|
709 { |
|
710 /// Reset command pointer, command has completed |
|
711 iCommand->ResetUiControl(*this); |
|
712 iCommand = NULL; |
|
713 iCommandInProgress = EFalse; |
|
714 } |
|
715 } |
|
716 |
|
717 // -------------------------------------------------------------------------- |
|
718 // CCCAppCommLauncherPbkCmd::GetMenuFilteringFlagsL |
|
719 // -------------------------------------------------------------------------- |
|
720 // |
|
721 TInt CCCAppCommLauncherPbkCmd::GetMenuFilteringFlagsL() const |
|
722 { |
|
723 TInt ret = KPbk2MenuFilteringFlagsNone; |
|
724 return ret; |
|
725 } |
|
726 |
|
727 // -------------------------------------------------------------------------- |
|
728 // CCCAppCommLauncherPbkCmd::ControlStateL |
|
729 // -------------------------------------------------------------------------- |
|
730 // |
|
731 CPbk2ViewState* CCCAppCommLauncherPbkCmd::ControlStateL() const |
|
732 { |
|
733 return NULL; |
|
734 } |
|
735 |
|
736 // -------------------------------------------------------------------------- |
|
737 // CCCAppCommLauncherPbkCmd::RestoreControlStateL |
|
738 // -------------------------------------------------------------------------- |
|
739 // |
|
740 void CCCAppCommLauncherPbkCmd::RestoreControlStateL( |
|
741 CPbk2ViewState* /*aState*/) |
|
742 { |
|
743 // Do nothing |
|
744 } |
|
745 |
|
746 // -------------------------------------------------------------------------- |
|
747 // CCCAppCommLauncherPbkCmd::FindTextL |
|
748 // -------------------------------------------------------------------------- |
|
749 // |
|
750 const TDesC& CCCAppCommLauncherPbkCmd::FindTextL() |
|
751 { |
|
752 // No find box in this control |
|
753 return KNullDesC; |
|
754 } |
|
755 |
|
756 // -------------------------------------------------------------------------- |
|
757 // CCCAppCommLauncherPbkCmd::ResetFindL |
|
758 // -------------------------------------------------------------------------- |
|
759 // |
|
760 void CCCAppCommLauncherPbkCmd::ResetFindL() |
|
761 { |
|
762 // Do nothing |
|
763 } |
|
764 |
|
765 // -------------------------------------------------------------------------- |
|
766 // CCCAppCommLauncherPbkCmd::ShowThumbnail |
|
767 // -------------------------------------------------------------------------- |
|
768 // |
|
769 void CCCAppCommLauncherPbkCmd::ShowThumbnail() |
|
770 { |
|
771 // Do nothing |
|
772 } |
|
773 |
|
774 // -------------------------------------------------------------------------- |
|
775 // CCCAppCommLauncherPbkCmd::HideThumbnail |
|
776 // -------------------------------------------------------------------------- |
|
777 // |
|
778 void CCCAppCommLauncherPbkCmd::HideThumbnail() |
|
779 { |
|
780 // Do nothing |
|
781 } |
|
782 |
|
783 // -------------------------------------------------------------------------- |
|
784 // CCCAppCommLauncherPbkCmd::SetBlank |
|
785 // -------------------------------------------------------------------------- |
|
786 // |
|
787 void CCCAppCommLauncherPbkCmd::SetBlank(TBool /*aBlank*/) |
|
788 { |
|
789 // This control does not support blanking |
|
790 } |
|
791 |
|
792 // -------------------------------------------------------------------------- |
|
793 // CCCAppCommLauncherPbkCmd::RegisterCommand |
|
794 // -------------------------------------------------------------------------- |
|
795 // |
|
796 void CCCAppCommLauncherPbkCmd::RegisterCommand(MPbk2Command* aCommand) |
|
797 { |
|
798 iCommand = aCommand; |
|
799 } |
|
800 |
|
801 // -------------------------------------------------------------------------- |
|
802 // CCCAppCommLauncherPbkCmd::SetTextL |
|
803 // -------------------------------------------------------------------------- |
|
804 // |
|
805 void CCCAppCommLauncherPbkCmd::SetTextL(const TDesC& /*aText*/) |
|
806 { |
|
807 // Do nothing |
|
808 } |
|
809 |
|
810 // -------------------------------------------------------------------------- |
|
811 // CCCAppCommLauncherPbkCmd::ContactUiControlExtension |
|
812 // -------------------------------------------------------------------------- |
|
813 // |
|
814 TAny* CCCAppCommLauncherPbkCmd::ContactUiControlExtension(TUid aExtensionUid ) |
|
815 { |
|
816 if( aExtensionUid == KMPbk2ContactUiControlExtension2Uid ) |
|
817 { |
|
818 return static_cast<MPbk2ContactUiControl2*>( this ); |
|
819 } |
|
820 |
|
821 return NULL; |
|
822 } |
|
823 |
|
824 // -------------------------------------------------------------------------- |
|
825 // CCCAppCommLauncherPbkCmd::CommandItemCount |
|
826 // -------------------------------------------------------------------------- |
|
827 // |
|
828 TInt CCCAppCommLauncherPbkCmd::CommandItemCount() const |
|
829 { |
|
830 return 0; // No command items. |
|
831 } |
|
832 |
|
833 // -------------------------------------------------------------------------- |
|
834 // CCCAppCommLauncherPbkCmd::CommandItemAt |
|
835 // -------------------------------------------------------------------------- |
|
836 // |
|
837 const MPbk2UiControlCmdItem& CCCAppCommLauncherPbkCmd::CommandItemAt( |
|
838 TInt /*aIndex*/) const |
|
839 { |
|
840 // There are no command items in this control |
|
841 __ASSERT_ALWAYS(EFalse, User::Panic(_L("Pbk2"), 4)); |
|
842 MPbk2UiControlCmdItem* item = NULL; // For compiler only |
|
843 return *item; // For compiler only |
|
844 } |
|
845 |
|
846 // -------------------------------------------------------------------------- |
|
847 // CCCAppCommLauncherPbkCmd::FocusedCommandItem |
|
848 // -------------------------------------------------------------------------- |
|
849 // |
|
850 const MPbk2UiControlCmdItem* CCCAppCommLauncherPbkCmd::FocusedCommandItem() const |
|
851 { |
|
852 return NULL; |
|
853 } |
|
854 |
|
855 // -------------------------------------------------------------------------- |
|
856 // CCCAppCommLauncherPbkCmd::DeleteCommandItemL |
|
857 // -------------------------------------------------------------------------- |
|
858 // |
|
859 void CCCAppCommLauncherPbkCmd::DeleteCommandItemL(TInt /*aIndex*/) |
|
860 { |
|
861 // Do nothing |
|
862 } |
|
863 |
|
864 // -------------------------------------------------------------------------- |
|
865 // CCCAppCommLauncherPbkCmd::AddCommandItemL |
|
866 // -------------------------------------------------------------------------- |
|
867 // |
|
868 void CCCAppCommLauncherPbkCmd::AddCommandItemL( |
|
869 MPbk2UiControlCmdItem* /*aCommand*/, TInt /*aIndex*/) |
|
870 { |
|
871 //Do nothing, since there shouldn't be any command items in this state. |
|
872 } |
|
873 |
|
874 // -------------------------------------------------------------------------- |
|
875 // CCCAppCommLauncherPbkCmd::IsPbk2CommandRunning |
|
876 // -------------------------------------------------------------------------- |
|
877 // |
|
878 TBool CCCAppCommLauncherPbkCmd::IsPbk2CommandRunning() |
|
879 { |
|
880 return iCommandInProgress; |
|
881 } |
|
882 |
|
883 // -------------------------------------------------------------------------- |
|
884 // CCCAppCommLauncherPbkCmd::ApplicationServices |
|
885 // -------------------------------------------------------------------------- |
|
886 // |
|
887 CPbk2ApplicationServices& CCCAppCommLauncherPbkCmd::ApplicationServices() const |
|
888 { |
|
889 return *iAppServices; |
|
890 } |