phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/src/ccappcommlaunchercontainer.cpp
branchRCL_3
changeset 20 f4a778e096c2
child 21 9da50d567e3c
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     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:  Implementation of commlauncher plugin control container
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "ccappcommlauncherheaders.h"
       
    21 #include "spbcontentprovider.h"
       
    22 #include "ccappcommlaunchercustomlistbox.h"
       
    23 #include <Pbk2PresentationUtils.h>
       
    24 #include <CPbk2ApplicationServices.h>
       
    25 #include <CVPbkContactManager.h>
       
    26 #include <utf.h>
       
    27 #include <gulicon.h>
       
    28 #include "ccaextensionfactory.h"
       
    29 #include "ccaextensionfactory.hrh"
       
    30 #include <phonebook2ece.mbg>
       
    31 #include <aknlayoutscalable_avkon.cdl.h>
       
    32 #include <AknsUtils.h>
       
    33 #include <MVPbkContactStoreProperties.h>
       
    34 #include <VPbkContactStoreUris.h>
       
    35 #include <TVPbkContactStoreUriPtr.h>
       
    36 #include <MVPbkContactStore.h>
       
    37 #include "ccafactoryextensionnotifier.h"
       
    38 #include <featmgr.h>
       
    39 
       
    40 namespace {
       
    41 const TInt KSocialPhonebookDisabled = 2;
       
    42 const TInt KSocialPhonebookEnabled = 3;
       
    43 _LIT( KCcaIconDefaultFileName, "\\resource\\apps\\phonebook2ece.mif" );
       
    44 }
       
    45 
       
    46 // =========================== MEMBER FUNCTIONS ===============================
       
    47 
       
    48 // ----------------------------------------------------------------------------
       
    49 // CCCAppCommLauncherContainer::CCCAppCommLauncherContainer()
       
    50 // ----------------------------------------------------------------------------
       
    51 //
       
    52 CCCAppCommLauncherContainer::CCCAppCommLauncherContainer(
       
    53     CCCAppCommLauncherPlugin& aPlugin)
       
    54     : iPlugin (aPlugin)
       
    55     {
       
    56     }
       
    57 
       
    58 // ----------------------------------------------------------------------------
       
    59 // CCCAppCommLauncherContainer::~CCCAppCommLauncherContainer()
       
    60 // ----------------------------------------------------------------------------
       
    61 //
       
    62 CCCAppCommLauncherContainer::~CCCAppCommLauncherContainer()
       
    63     {    
       
    64     delete iListBox;
       
    65     delete iBackground;
       
    66     delete iModel;
       
    67     delete iHeaderCtrl;
       
    68     delete iPbkCmd;
       
    69     delete iStatusControl;
       
    70     delete iProvider;
       
    71     Release( iAppServices );
       
    72     delete iViewLauncher;
       
    73     delete iLongTapDetector;
       
    74     delete iFactoryExtensionNotifier;
       
    75     }
       
    76 
       
    77 // ----------------------------------------------------------------------------
       
    78 // CCCAppCommLauncherContainer::ConstructL()
       
    79 // ----------------------------------------------------------------------------
       
    80 //
       
    81 void CCCAppCommLauncherContainer::ConstructL()
       
    82     {
       
    83     // Create the listbox
       
    84     CreateListboxControlL();
       
    85     // Create the header
       
    86     iHeaderCtrl = CCCAppCommLauncherHeaderControl::NewL( iPlugin );
       
    87     iHeaderCtrl->SetContainerWindowL(*this);
       
    88     
       
    89     // create status control  
       
    90     CreateStatusControlL();     
       
    91     
       
    92     // Get the skin background for the view
       
    93     iBackground = CAknsBasicBackgroundControlContext::NewL(
       
    94         KAknsIIDQsnBgAreaMain, TRect(0, 0, 0, 0), EFalse);
       
    95     LongTapDetectorL();    
       
    96     }
       
    97 
       
    98 // ----------------------------------------------------------------------------
       
    99 // CCCAppCommLauncherContainer::CreateListboxControlL()
       
   100 // ----------------------------------------------------------------------------
       
   101 //
       
   102 void CCCAppCommLauncherContainer::CreateListboxControlL()
       
   103     {
       
   104     // Use customized list box 
       
   105     iListBox = CCCAppCommLauncherCustomListBox::NewL();
       
   106     iListBox->ConstructL(this, EAknListBoxLoopScrolling);
       
   107     iListBox->SetContainerWindowL(*this);
       
   108     iListBox->CreateScrollBarFrameL(ETrue);
       
   109     iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
       
   110             CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
       
   111     // Set empty text
       
   112     iListBox->View()->SetListEmptyTextL(KNullDesC());
       
   113 
       
   114     // Creating the model
       
   115     iModel = CCCAppCommLauncherLPadModel::NewL(*this, *iListBox, iPlugin);
       
   116     iListBox->Model()->SetItemTextArray(iModel);
       
   117     iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
       
   118     iListBox->ItemDrawer()->ColumnData()->SetIconArray(iModel->IconArray());
       
   119 
       
   120     //Set listbox observer
       
   121     iListBox->SetListBoxObserver(this);
       
   122     iListBox->ActivateL();
       
   123     }
       
   124 
       
   125 //-----------------------------------------------------------------------------
       
   126 // CCCAppCommLauncherContainer::CreateStatusControlL()
       
   127 //-----------------------------------------------------------------------------
       
   128 //
       
   129 void CCCAppCommLauncherContainer::CreateStatusControlL() 
       
   130     {
       
   131     FeatureManager::InitializeLibL();
       
   132     const TBool isFeatureIdFfContactsSocial =
       
   133             FeatureManager::FeatureSupported( KFeatureIdFfContactsSocial );
       
   134     FeatureManager::UnInitializeLib();
       
   135 
       
   136     if( isFeatureIdFfContactsSocial )
       
   137         {
       
   138         MVPbkContactLink* link = NULL;
       
   139         MVPbkContactLinkArray* contactArray = NULL;
       
   140         TInt isSame = KErrNotFound;
       
   141 
       
   142         if( !iAppServices )
       
   143             {
       
   144             iAppServices = CPbk2ApplicationServices::InstanceL();  
       
   145             }
       
   146         if( !iProvider )
       
   147             {
       
   148             iProvider = CSpbContentProvider::NewL( iAppServices->ContactManager(), 
       
   149                     iAppServices->StoreManager(),
       
   150                     CSpbContentProvider::EStatusMessage | 
       
   151 					    CSpbContentProvider::EServiceIcon );
       
   152             }
       
   153         HBufC& contactData = iPlugin.AppEngine()->Parameter().ContactDataL();
       
   154         HBufC8* contactData8 = HBufC8::NewLC( contactData.Size() );
       
   155         TPtr8 contactData8Ptr( contactData8->Des() );
       
   156 		contactData8Ptr.Copy( contactData.Des() ); 
       
   157         
       
   158         CVPbkContactManager* vPbkContactManager = 
       
   159                 &iAppServices->ContactManager();
       
   160         
       
   161         if( vPbkContactManager )
       
   162             {
       
   163             contactArray = vPbkContactManager->CreateLinksLC( contactData8Ptr );
       
   164 
       
   165            if( contactArray->Count() > 0 )
       
   166                 {
       
   167                 link = contactArray->At( 0 ).CloneLC();
       
   168                 }				
       
   169                             
       
   170             if ( link )
       
   171                 {    
       
   172                 const MVPbkContactStoreProperties& storeProperties = 
       
   173                     link->ContactStore().StoreProperties();
       
   174                 TVPbkContactStoreUriPtr uri = storeProperties.Uri();
       
   175             
       
   176                 isSame = uri.Compare( VPbkContactStoreUris::DefaultCntDbUri(), 
       
   177                     TVPbkContactStoreUriPtr::EContactStoreUriAllComponents );
       
   178                 }
       
   179             }
       
   180             
       
   181         if( isSame == 0 )
       
   182             {		
       
   183             iStatusControl = CCCAppStatusControl::NewL( *iProvider, *this, CCCAppStatusControl::ENormalContact );
       
   184             iStatusControl->SetContainerWindowL( *this );                   
       
   185             iStatusControl->MakeVisible( EFalse );
       
   186             iHeaderCtrl->SetStatusButtonVisibility( EFalse );
       
   187             CFbsBitmap* bmp = NULL;
       
   188             CFbsBitmap* bmpMask = NULL;
       
   189 
       
   190             AknsUtils::CreateIconL(
       
   191                 AknsUtils::SkinInstance(),
       
   192                 KAknsIIDQgnPropSocialCommunities,
       
   193                 bmp,
       
   194                 bmpMask,
       
   195                 KCcaIconDefaultFileName,
       
   196                 EMbmPhonebook2eceQgn_prop_social_communities,
       
   197                 EMbmPhonebook2eceQgn_prop_social_communities_mask );    
       
   198         
       
   199             CGulIcon* guiIcon = CGulIcon::NewL( bmp, bmpMask );
       
   200             iStatusControl->SetDefaultStatusIconL( guiIcon );
       
   201             HBufC* defaultText = 
       
   202                     StringLoader::LoadL( R_QTN_CCA_SOCIAL_NETWORKS );                                            
       
   203             iStatusControl->SetDefaultStatusTextL( defaultText );        
       
   204             iStatusControl->SetContactLinkL( *link );
       
   205 	
       
   206             iFactoryExtensionNotifier = CCCaFactoryExtensionNotifier::NewL();
       
   207             TCallBack callBack( 
       
   208                     CCCAppCommLauncherContainer::CheckExtensionFactoryL, this );
       
   209             iFactoryExtensionNotifier->ObserveExtensionFactoryL( callBack );
       
   210             }
       
   211         
       
   212         if( link )
       
   213             {
       
   214             CleanupStack::PopAndDestroy(); //link
       
   215             }
       
   216         
       
   217         if( contactArray )
       
   218             {
       
   219             CleanupStack::PopAndDestroy(); // contactArray
       
   220             }
       
   221                         
       
   222         CleanupStack::PopAndDestroy(); // contactData8	
       
   223 		} //  KFeatureIdFfContactsSocial	
       
   224 	}
       
   225 	
       
   226 	
       
   227 // ----------------------------------------------------------------------------
       
   228 // CCCAppCommLauncherContainer::Draw()
       
   229 // ----------------------------------------------------------------------------
       
   230 //
       
   231 void CCCAppCommLauncherContainer::Draw(const TRect& /*aRect*/) const
       
   232     {
       
   233     // Draw the background using skin
       
   234     if (iBackground)
       
   235         {
       
   236         AknsDrawUtils::Background(
       
   237             AknsUtils::SkinInstance(), iBackground, this, SystemGc(), Rect());
       
   238         }
       
   239     }
       
   240 
       
   241 // ----------------------------------------------------------------------------
       
   242 // CCCAppCommLauncherContainer::SizeChanged()
       
   243 // ----------------------------------------------------------------------------
       
   244 //
       
   245 void CCCAppCommLauncherContainer::SizeChanged()
       
   246     {
       
   247     const TRect rect(Rect());
       
   248     const TBool isLandscape(Layout_Meta_Data::IsLandscapeOrientation());
       
   249 
       
   250     // contact card pane layout
       
   251     TAknWindowComponentLayout contactCardPaneLayout( 
       
   252             TAknWindowComponentLayout::Compose( 
       
   253                     AknLayoutScalable_Apps::main_phob2_pane( 0 ),
       
   254                     AknLayoutScalable_Apps::phob2_contact_card_pane( 1 ) ) );
       
   255 
       
   256     
       
   257     TInt option( isLandscape ? 3 : 2 ); // (w/o button)
       
   258     if( iStatusControl && iStatusControl->IsVisible()  )
       
   259         {
       
   260         // (w button)
       
   261         if( isLandscape )
       
   262             {
       
   263             option = 1;
       
   264             }
       
   265         else
       
   266             {
       
   267             option = 0;
       
   268             }
       
   269 			
       
   270         // Status control layout
       
   271         TAknWindowComponentLayout statusPaneLayout(
       
   272             TAknWindowComponentLayout::Compose(
       
   273                 TAknWindowComponentLayout::Compose( 
       
   274                     contactCardPaneLayout,
       
   275                     AknLayoutScalable_Apps::phob2_cc_data_pane( option ) ),
       
   276                 AknLayoutScalable_Apps::phob2_cc_button_pane( option ) ) );
       
   277         
       
   278         TAknLayoutRect statusPaneLayoutRect;
       
   279         statusPaneLayoutRect.LayoutRect( rect, statusPaneLayout.LayoutLine() );
       
   280         TRect statusPaneRect( statusPaneLayoutRect.Rect() );
       
   281         iStatusControl->SetRect( statusPaneRect );
       
   282         }
       
   283     // Header and Listbox
       
   284     
       
   285     // header layout
       
   286     TAknWindowComponentLayout headerPaneLayout( 
       
   287         TAknWindowComponentLayout::Compose( 
       
   288             contactCardPaneLayout,
       
   289             AknLayoutScalable_Apps::phob2_cc_data_pane( option ) ) );
       
   290     
       
   291     TAknLayoutRect headerPaneLayoutRect;
       
   292     headerPaneLayoutRect.LayoutRect( rect, headerPaneLayout.LayoutLine() );
       
   293     TRect headerPaneRect( headerPaneLayoutRect.Rect() );
       
   294     iHeaderCtrl->SetRect( headerPaneRect );
       
   295     
       
   296     // list layout
       
   297     TAknWindowComponentLayout listPaneLayout( 
       
   298         TAknWindowComponentLayout::Compose( 
       
   299             contactCardPaneLayout,
       
   300             AknLayoutScalable_Apps::phob2_cc_listscroll_pane( option ) ) );
       
   301     
       
   302     TAknLayoutRect listPaneLayoutRect;
       
   303     listPaneLayoutRect.LayoutRect( rect, listPaneLayout.LayoutLine() );
       
   304     TRect listPaneRect( listPaneLayoutRect.Rect() );
       
   305     iListBox->SetRect( listPaneRect );
       
   306 
       
   307     // Background skin
       
   308     if (iBackground)
       
   309         {
       
   310         iBackground->SetRect(rect);
       
   311         }   
       
   312     
       
   313     DrawDeferred();
       
   314     }
       
   315 
       
   316 // ----------------------------------------------------------------------------
       
   317 // CCCAppCommLauncherContainer::HandleResourceChange()
       
   318 // ----------------------------------------------------------------------------
       
   319 //
       
   320 void CCCAppCommLauncherContainer::HandleResourceChange(TInt aType)
       
   321 	{
       
   322 	if ( aType == KEikDynamicLayoutVariantSwitch )
       
   323 		{
       
   324 		TRAP_IGNORE( iModel->ResourceChangedL() );		 
       
   325 		}
       
   326 	CCCAppViewPluginAknContainer::HandleResourceChange(aType);
       
   327 	}
       
   328 
       
   329 // ----------------------------------------------------------------------------
       
   330 // CCCAppCommLauncherContainer::CountComponentControls()
       
   331 // ----------------------------------------------------------------------------
       
   332 //
       
   333 TInt CCCAppCommLauncherContainer::CountComponentControls() const
       
   334     {
       
   335 	if( iStatusControl )
       
   336 		{
       
   337 		return KSocialPhonebookEnabled;
       
   338 		}
       
   339 	else
       
   340 		{
       
   341 		return KSocialPhonebookDisabled;
       
   342 		}
       
   343     }
       
   344 
       
   345 // ----------------------------------------------------------------------------
       
   346 // CCCAppCommLauncherContainer::ComponentControl()
       
   347 // ----------------------------------------------------------------------------
       
   348 //
       
   349 CCoeControl* CCCAppCommLauncherContainer::ComponentControl(TInt aIndex) const
       
   350     {
       
   351     switch (aIndex)
       
   352         {
       
   353         case 0:
       
   354             return iHeaderCtrl;
       
   355         case 1:
       
   356         	if( iStatusControl )
       
   357         		{
       
   358 				return iStatusControl;
       
   359         		}
       
   360         	else
       
   361         		{
       
   362 				return iListBox;
       
   363         		}
       
   364         case 2:
       
   365         	if( iStatusControl )
       
   366         		{
       
   367 				return iListBox;
       
   368         		}
       
   369         	else
       
   370         		{
       
   371 				return NULL;
       
   372         		}
       
   373         default:
       
   374             return NULL;
       
   375         }
       
   376     }
       
   377 
       
   378 // ----------------------------------------------------------------------------
       
   379 // CCCAppCommLauncherContainer::OfferKeyEventL()
       
   380 // ----------------------------------------------------------------------------
       
   381 //
       
   382 TKeyResponse CCCAppCommLauncherContainer::OfferKeyEventL(
       
   383     const TKeyEvent& aKeyEvent, TEventCode aType)
       
   384     {
       
   385     // Make sure timer can be canceled before user do any operation.
       
   386     iPlugin.CancelTimer();
       
   387     
       
   388     // Forward the key-event 1st to base-class
       
   389     TKeyResponse returnValue =
       
   390         CCCAppViewPluginAknContainer::OfferKeyEventL(aKeyEvent, aType);
       
   391 
       
   392     // Offer event to header control.
       
   393     if (EEventKey == aType
       
   394         && EKeyWasNotConsumed == returnValue)
       
   395         {
       
   396         returnValue = iHeaderCtrl->OfferKeyEventL(aKeyEvent, aType);
       
   397         }
       
   398 
       
   399 	/* Uncomment this code if it is necessary to enable navigation hardware keys
       
   400      * on devices which have these keys (its Map Extension feature)
       
   401     if( aKeyEvent.iScanCode == EStdKeyApplicationD && aType == EEventKeyUp )
       
   402         {
       
   403         DoShowMapCmdL( (TPbk2CommandId)EPbk2ExtensionAssignFromMap );
       
   404         returnValue = EKeyWasConsumed;
       
   405         }
       
   406 
       
   407     if( aKeyEvent.iScanCode == EStdKeyApplicationE && aType == EEventKeyUp )
       
   408         {
       
   409         DoShowMapCmdL( (TPbk2CommandId)EPbk2ExtensionShowOnMap );
       
   410         returnValue = EKeyWasConsumed;
       
   411         }*/
       
   412 
       
   413     if (EEventKey == aType
       
   414         && EKeyWasNotConsumed == returnValue)
       
   415         {
       
   416         // Make send key work as the select key for the list
       
   417         TKeyEvent keyToList = aKeyEvent;
       
   418         if (EKeyYes == aKeyEvent.iCode && IsFocused())
       
   419             {
       
   420             keyToList.iCode = EKeyEnter;
       
   421             }
       
   422         returnValue = iListBox->OfferKeyEventL(keyToList, aType);
       
   423         // Update popup when moving up or down in the list
       
   424         switch(aKeyEvent.iCode)
       
   425             {
       
   426             case EKeyUpArrow:
       
   427             case EKeyDownArrow:
       
   428                 returnValue = EKeyWasConsumed;
       
   429                 break;
       
   430             }
       
   431         }
       
   432 
       
   433     return returnValue;
       
   434     }
       
   435 
       
   436 // ----------------------------------------------------------------------------
       
   437 // CCCAppCommLauncherContainer::MopSupplyObject()
       
   438 // ----------------------------------------------------------------------------
       
   439 //
       
   440 TTypeUid::Ptr CCCAppCommLauncherContainer::MopSupplyObject(TTypeUid aId)
       
   441     {
       
   442     // For skinning
       
   443     if (iBackground && aId.iUid == MAknsControlContext::ETypeId)
       
   444         {
       
   445         return MAknsControlContext::SupplyMopObject(aId, iBackground);
       
   446         }
       
   447 
       
   448     return CCoeControl::MopSupplyObject(aId);
       
   449     }
       
   450 
       
   451 // ----------------------------------------------------------------------------
       
   452 // CCCAppCommLauncherContainer::FocusChanged()
       
   453 // ----------------------------------------------------------------------------
       
   454 //
       
   455 void CCCAppCommLauncherContainer::FocusChanged(TDrawNow aDrawNow)
       
   456     {
       
   457     // For enabling animated hilight (if in skin supports it)
       
   458     CCoeControl::FocusChanged(aDrawNow);
       
   459     if(iListBox)
       
   460         {
       
   461         iListBox->SetFocus(IsFocused(), aDrawNow);
       
   462         }
       
   463     }
       
   464 
       
   465 // ----------------------------------------------------------------------------
       
   466 // CCCAppCommLauncherContainer::HandlePointerEventL()
       
   467 // ----------------------------------------------------------------------------
       
   468 //
       
   469 void CCCAppCommLauncherContainer::HandlePointerEventL(
       
   470     const TPointerEvent& aPointerEvent)
       
   471     {
       
   472     // Make sure timer can be canceled before user do any operation.
       
   473     iPlugin.CancelTimer();
       
   474     
       
   475     TInt index;
       
   476     // start iLongTapDetector in listbox area and handle PointerEvent when dragged
       
   477     if ( iListBox->View()->XYPosToItemIndex( aPointerEvent.iPosition, index )
       
   478         || ( aPointerEvent.iType == TPointerEvent::EDrag ) )
       
   479         {
       
   480         if ( iLongTapDetector )
       
   481             {
       
   482             iLongTapDetector->PointerEventL( aPointerEvent );
       
   483             }
       
   484         if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
       
   485             {
       
   486             // Pressed Down Effect
       
   487             iListBox->View()->ItemDrawer()->SetFlags(
       
   488                     CListItemDrawer::EPressedDownState );
       
   489             }
       
   490         }
       
   491 
       
   492     CCoeControl::HandlePointerEventL( aPointerEvent );
       
   493     }
       
   494 
       
   495 // ----------------------------------------------------------------------------
       
   496 // CCCAppCommLauncherContainer::HandleLongTapEventL()
       
   497 // ----------------------------------------------------------------------------
       
   498 //
       
   499 void CCCAppCommLauncherContainer::HandleLongTapEventL( const TPoint& /*aPenEventLocation*/, 
       
   500                                  	const TPoint& /*aPenEventScreenLocation*/ )
       
   501     {
       
   502     if ( iPlugin.CommandState().IsRunning() )
       
   503         {
       
   504         return;
       
   505         }
       
   506     else if ( CommMethodsAvailable() )
       
   507         {
       
   508         TPtrC fullName;
       
   509         iPlugin.ContactHandler().ContactFieldItemDataL(
       
   510             CCmsContactFieldItem::ECmsFullName, fullName );
       
   511 
       
   512         TUint paramFlag = 0;//CCAContactorService::TCSParameter::EEnableDefaults;
       
   513     
       
   514         VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector
       
   515             contactActionType = iPlugin.Container().SelectedCommunicationMethod();
       
   516         
       
   517         if ( !iLongTap && contactActionType
       
   518                         == VPbkFieldTypeSelectorFactory::EFindOnMapSelector )
       
   519             {  
       
   520             iLongTap = ETrue;    
       
   521             DoShowMapCmdL( (TPbk2CommandId)EPbk2ExtensionShowOnMap );
       
   522             }
       
   523         else
       
   524             {
       
   525             CCAContactorService::TCSParameter param(
       
   526                 contactActionType,
       
   527                 *iPlugin.ContactHandler().ContactIdentifierLC(),//contactlinkarray
       
   528                 paramFlag, 
       
   529                 fullName );
       
   530                
       
   531             iPlugin.ExecuteServiceL( param );   
       
   532             
       
   533             //The Timer can be started after user selected any call item
       
   534             if ( iPlugin.ContactorService()->IsSelected() && 
       
   535                 (contactActionType == VPbkFieldTypeSelectorFactory::EVoiceCallSelector ||
       
   536                  contactActionType == VPbkFieldTypeSelectorFactory::EVideoCallSelector ||
       
   537                  contactActionType == VPbkFieldTypeSelectorFactory::EVOIPCallSelector) )
       
   538                 {
       
   539                 iPlugin.StartTimerL();
       
   540                 }
       
   541             
       
   542             
       
   543             CleanupStack::PopAndDestroy( 1 );// contactlinkarray
       
   544             }
       
   545         }
       
   546     }
       
   547 
       
   548 // ----------------------------------------------------------------------------
       
   549 // CCCAppCommLauncherContainer::HandleListBoxEventL()
       
   550 // ----------------------------------------------------------------------------
       
   551 //
       
   552 void CCCAppCommLauncherContainer::HandleListBoxEventL(
       
   553     CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
       
   554     {
       
   555     // Handle pointer events
       
   556     TBool executeContactAction = EFalse;
       
   557 
       
   558     if (aEventType == EEventItemDraggingActioned)
       
   559         {
       
   560         iHasBeenDragged = ETrue;
       
   561         }
       
   562     else if (aEventType == EEventItemSingleClicked)
       
   563     	{
       
   564         if (!iHasBeenDragged)
       
   565             {
       
   566             executeContactAction = ETrue;
       
   567             }
       
   568         else
       
   569             {
       
   570             iHasBeenDragged = EFalse;
       
   571             }
       
   572         }
       
   573     else if (aEventType == EEventEnterKeyPressed)
       
   574         {
       
   575         executeContactAction = ETrue;
       
   576         iHasBeenDragged = EFalse;
       
   577         }
       
   578 
       
   579     if ( executeContactAction && iPlugin.CommandState().IsRunning()  )
       
   580         {
       
   581         executeContactAction = EFalse;
       
   582         }
       
   583 
       
   584     if ( executeContactAction )
       
   585         {
       
   586         SetInputBlockerL();
       
   587         
       
   588         VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector
       
   589             contactActionType = iPlugin.Container().SelectedCommunicationMethod();
       
   590         
       
   591         if ( contactActionType
       
   592         		== VPbkFieldTypeSelectorFactory::EFindOnMapSelector )
       
   593         	{
       
   594             HandleFindOnMapContactActionL();           
       
   595         	}
       
   596         else
       
   597         	{
       
   598             HandleGenericContactActionL( contactActionType );
       
   599             }
       
   600         
       
   601         RemoveInputBlocker();
       
   602         }
       
   603     }
       
   604 
       
   605 // ----------------------------------------------------------------------------
       
   606 // CCCAppCommLauncherContainer::HandleFindOnMapContactActionL()
       
   607 // ----------------------------------------------------------------------------
       
   608 //
       
   609 void CCCAppCommLauncherContainer::HandleFindOnMapContactActionL()
       
   610     {
       
   611     if ( !iLongTap )
       
   612         {
       
   613         DoShowMapCmdL( (TPbk2CommandId)EPbk2ExtensionShowOnMap );
       
   614         }
       
   615     else
       
   616         {
       
   617         iLongTap = EFalse;
       
   618         }
       
   619     }
       
   620 
       
   621 // ----------------------------------------------------------------------------
       
   622 // CCCAppCommLauncherContainer::HandleGenericContactActionL()
       
   623 // ----------------------------------------------------------------------------
       
   624 //
       
   625 void CCCAppCommLauncherContainer::HandleGenericContactActionL(
       
   626     VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType )
       
   627     {
       
   628     TPtrC fullName;
       
   629     iPlugin.ContactHandler().ContactFieldItemDataL(
       
   630         CCmsContactFieldItem::ECmsFullName, fullName );  
       
   631     
       
   632     //contactlinkarray
       
   633     HBufC8* contactIdentifier = iPlugin.ContactHandler().ContactIdentifierLC();
       
   634     
       
   635     TBool fieldSelectionReq(ETrue);
       
   636     TPtrC selectedField;
       
   637     if ( VPbkFieldTypeSelectorFactory::EVoiceCallSelector == aActionType )
       
   638         {
       
   639         fieldSelectionReq = IsVoiceCallFieldSelectionAmbiguous( aActionType, selectedField );        
       
   640         }   
       
   641     
       
   642     
       
   643     if( fieldSelectionReq ) 
       
   644         {
       
   645         ExecuteContactActionServiceWithFieldSelectionL( 
       
   646             aActionType, 
       
   647             *contactIdentifier,
       
   648             fullName );
       
   649         }
       
   650     else
       
   651         {
       
   652         // Speed up contact action by skipping slow field selection operation
       
   653         ExecuteContactActionServiceWithoutFieldSelectionL(
       
   654             aActionType,
       
   655             *contactIdentifier,
       
   656             fullName,
       
   657             selectedField );          
       
   658         }
       
   659     
       
   660     //The Timer can be started after user selected any call item
       
   661     if ( iPlugin.ContactorService()->IsSelected() && 
       
   662         ( aActionType == VPbkFieldTypeSelectorFactory::EVoiceCallSelector ||
       
   663           aActionType == VPbkFieldTypeSelectorFactory::EVideoCallSelector ||
       
   664           aActionType == VPbkFieldTypeSelectorFactory::EVOIPCallSelector) )
       
   665         {
       
   666         iPlugin.StartTimerL();
       
   667         }
       
   668     
       
   669     CleanupStack::PopAndDestroy(1);// contactlinkarray
       
   670     }
       
   671 
       
   672 // ----------------------------------------------------------------------------
       
   673 // CCCAppCommLauncherContainer::IsVoiceCallFieldSelectionAmbiguous()
       
   674 // ----------------------------------------------------------------------------
       
   675 //
       
   676 TBool CCCAppCommLauncherContainer::IsVoiceCallFieldSelectionAmbiguous(
       
   677     VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType,
       
   678     TPtrC& aSelectedField )
       
   679     {
       
   680     CCCAppCommLauncherContactHandler& handler = iPlugin.ContactHandler();
       
   681     
       
   682     if ( HasContactSingleAddress( aActionType, handler ) )
       
   683         {
       
   684         RPointerArray<CCmsContactField>& fields = handler.ContactFieldDataArray();
       
   685         
       
   686         for( TInt i=0; i < fields.Count(); i++ ) 
       
   687             {
       
   688             CCmsContactField* field = fields[i];
       
   689             
       
   690             if ( HasFieldOnlyOneItem( *field ) &&
       
   691                  IsVoiceCallType( *field ) ) 
       
   692                 {
       
   693                 const CCmsContactFieldItem* fieldItem = NULL;
       
   694                 
       
   695                 TInt error = KErrNone;
       
   696                 TRAP( error, fieldItem = &field->ItemL( 0 ) );
       
   697                 
       
   698                 if( error == KErrNone ) 
       
   699                     {
       
   700                     aSelectedField.Set(fieldItem->Data());
       
   701                     //Its safe to exit here
       
   702                     //Making of Voice Call is not tedious
       
   703                     //we have only one number
       
   704                     return EFalse;
       
   705                     }                   
       
   706                 }           
       
   707             }
       
   708         }
       
   709     
       
   710     return ETrue;
       
   711     }
       
   712 
       
   713 // ----------------------------------------------------------------------------
       
   714 // CCCAppCommLauncherContainer::HasContactSingleAddress()
       
   715 // ----------------------------------------------------------------------------
       
   716 //
       
   717 TBool CCCAppCommLauncherContainer::HasContactSingleAddress(
       
   718     VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType,
       
   719     CCCAppCommLauncherContactHandler& aHandler )
       
   720     {
       
   721     TInt amount = aHandler.AddressAmount( aActionType );
       
   722     if( 1 == amount )
       
   723         {
       
   724         return ETrue;
       
   725         }
       
   726     
       
   727     return EFalse;
       
   728     }
       
   729 
       
   730 // ----------------------------------------------------------------------------
       
   731 // CCCAppCommLauncherContainer::HasFieldOnlyOneItem()
       
   732 // ----------------------------------------------------------------------------
       
   733 //
       
   734 TBool CCCAppCommLauncherContainer::HasFieldOnlyOneItem( const CCmsContactField& field ) const
       
   735     {
       
   736     const RPointerArray<CCmsContactFieldItem>& items = field.Items();
       
   737     
       
   738     if ( 1 == items.Count() )
       
   739         {
       
   740         return ETrue;
       
   741         }
       
   742     
       
   743     return EFalse;
       
   744     }
       
   745 
       
   746 // ----------------------------------------------------------------------------
       
   747 // CCCAppCommLauncherContainer::IsVoiceCallType()
       
   748 // ----------------------------------------------------------------------------
       
   749 //
       
   750 TBool CCCAppCommLauncherContainer::IsVoiceCallType( const CCmsContactField& field ) const
       
   751     {
       
   752     CCmsContactFieldItem::TCmsContactField fieldType = field.Type();
       
   753     
       
   754     if( fieldType == CCmsContactFieldItem::ECmsLandPhoneGeneric ||
       
   755         fieldType == CCmsContactFieldItem::ECmsLandPhoneHome ||
       
   756         fieldType == CCmsContactFieldItem::ECmsLandPhoneWork ||
       
   757         fieldType == CCmsContactFieldItem::ECmsMobilePhoneGeneric ||
       
   758         fieldType == CCmsContactFieldItem::ECmsMobilePhoneHome ||
       
   759         fieldType == CCmsContactFieldItem::ECmsMobilePhoneWork  )
       
   760         {    
       
   761         return ETrue;
       
   762         }
       
   763     
       
   764     return EFalse;
       
   765     }
       
   766 
       
   767 
       
   768 // ----------------------------------------------------------------------------
       
   769 // CCCAppCommLauncherContainer::ExecuteContactActionServiceWithFieldSelectionL()
       
   770 // ----------------------------------------------------------------------------
       
   771 //
       
   772 void CCCAppCommLauncherContainer::ExecuteContactActionServiceWithFieldSelectionL( 
       
   773     VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType,
       
   774     TDesC8& aContactIdentifier,
       
   775     TDesC& aFullName )
       
   776     {
       
   777     TUint paramFlag = CCAContactorService::TCSParameter::EEnableDefaults;
       
   778 
       
   779     CCAContactorService::TCSParameter param(
       
   780         aActionType,
       
   781         aContactIdentifier,
       
   782         paramFlag,
       
   783         aFullName );
       
   784     
       
   785     iPlugin.ExecuteServiceL(param);    
       
   786     }
       
   787 
       
   788 // ----------------------------------------------------------------------------
       
   789 // CCCAppCommLauncherContainer::ExecuteContactActionServiceWithoutFieldSelectionL()
       
   790 // ----------------------------------------------------------------------------
       
   791 //
       
   792 void CCCAppCommLauncherContainer::ExecuteContactActionServiceWithoutFieldSelectionL( 
       
   793     VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aActionType,
       
   794     TDesC8& aContactIdentifier,
       
   795     TDesC& aFullName,
       
   796     TDesC& aSelectedField )
       
   797     {
       
   798     CCAContactorService::TCSParameter param(
       
   799         aActionType,
       
   800         aContactIdentifier,
       
   801         CCAContactorService::TCSParameter::EUseFieldParam,
       
   802         aFullName,
       
   803         aSelectedField );
       
   804     
       
   805     iPlugin.ExecuteServiceL(param);
       
   806     }
       
   807 
       
   808 // ----------------------------------------------------------------------------
       
   809 // CCCAppCommLauncherContainer::ContactInfoFetchedNotifyL()
       
   810 // ----------------------------------------------------------------------------
       
   811 //
       
   812 void CCCAppCommLauncherContainer::ContactInfoFetchedNotifyL(
       
   813     const CCmsContactFieldInfo& aContactFieldInfo)
       
   814     {
       
   815     // update buttons
       
   816     iModel->UpdateAddressesValidationL( aContactFieldInfo );
       
   817     iModel->FillButtonArrayL();
       
   818     iListBox->HandleItemAdditionL();
       
   819     iHeaderCtrl->ContactInfoFetchedNotifyL(aContactFieldInfo);
       
   820 
       
   821     if (!CommMethodsAvailable())
       
   822         {
       
   823         // update the empty string now to avoid flickering
       
   824         HBufC* string = StringLoader::LoadLC(
       
   825             R_QTN_CCA_NO_COMMUNICATION_METHODS, iCoeEnv);
       
   826         iListBox->View()->SetListEmptyTextL(*string);
       
   827         CleanupStack::PopAndDestroy(string);
       
   828         }
       
   829     }
       
   830 
       
   831 // ----------------------------------------------------------------------------
       
   832 // CCCAppCommLauncherContainer::ContactFieldFetchedNotifyL()
       
   833 // ----------------------------------------------------------------------------
       
   834 //
       
   835 void CCCAppCommLauncherContainer::ContactFieldFetchedNotifyL(
       
   836     const CCmsContactField& aContactField)
       
   837     {
       
   838     // Forwarding to header-part
       
   839     iHeaderCtrl->ContactFieldFetchedNotifyL(aContactField);
       
   840     // Forwarding to listbox-model
       
   841     iModel->ContactFieldFetchedNotifyL(aContactField);
       
   842     }
       
   843 
       
   844 // ----------------------------------------------------------------------------
       
   845 // CCCAppCommLauncherContainer::ContactFieldFetchedNotifyL()
       
   846 // ----------------------------------------------------------------------------
       
   847 //
       
   848 void CCCAppCommLauncherContainer::ContactFieldFetchingCompletedL()
       
   849     {
       
   850     //PERFORMANCE LOGGING: 12. Plugin ready
       
   851     WriteToPerfLog();
       
   852     iHeaderCtrl->ContactFieldFetchingCompletedL();
       
   853 
       
   854     iHeaderCtrl->SetContactStoreL(iPlugin.ContactHandler().ContactStore());
       
   855 
       
   856     //Reset focused row in listbox if items removed/added.
       
   857     TInt mdlCount = iModel->MdcaCount();
       
   858     if (iMdlRowCount != mdlCount)
       
   859         {
       
   860         iListBox->SetCurrentItemIndexAndDraw(0);
       
   861         }
       
   862     iListBox->DrawDeferred();
       
   863     
       
   864     iMdlRowCount = mdlCount;
       
   865     }
       
   866 
       
   867 // ---------------------------------------------------------------------------
       
   868 // CCCAppCommLauncherContainer::Plugin
       
   869 // ---------------------------------------------------------------------------
       
   870 //
       
   871 CCCAppCommLauncherPlugin& CCCAppCommLauncherContainer::Plugin()
       
   872     {
       
   873     CCA_DP(KCommLauncherLogFile, CCA_L("CCCAppCommLauncherContainer::Plugin()"));
       
   874     return iPlugin;
       
   875     }
       
   876 
       
   877 // ---------------------------------------------------------------------------
       
   878 // CCCAppCommLauncherContainer::CommMethodsAvailable
       
   879 // ---------------------------------------------------------------------------
       
   880 //
       
   881 TBool CCCAppCommLauncherContainer::CommMethodsAvailable()
       
   882     {
       
   883     return (KErrNotFound == iListBox->CurrentItemIndex())
       
   884         ? EFalse : ETrue;
       
   885     }
       
   886 
       
   887 // ---------------------------------------------------------------------------
       
   888 // CCCAppCommLauncherContainer::IsHighlight
       
   889 // ---------------------------------------------------------------------------
       
   890 //
       
   891 const TBool CCCAppCommLauncherContainer::IsListBoxHighlightEnabled()
       
   892 	{
       
   893     return !( iListBox->ItemDrawer()->Flags() & 
       
   894     		CListItemDrawer::ESingleClickDisabledHighlight );
       
   895 	}
       
   896 
       
   897 
       
   898 // ---------------------------------------------------------------------------
       
   899 // CCCAppCommLauncherContainer::SelectedCommunicationMethod
       
   900 // ---------------------------------------------------------------------------
       
   901 //
       
   902 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector
       
   903     CCCAppCommLauncherContainer::SelectedCommunicationMethod()
       
   904     {
       
   905     return iModel->ButtonData(iListBox->CurrentItemIndex()).iContactAction;
       
   906     }
       
   907 
       
   908 // ---------------------------------------------------------------------------
       
   909 // CCCAppCommLauncherContainer::ContactsChangedL
       
   910 // ---------------------------------------------------------------------------
       
   911 //
       
   912 void CCCAppCommLauncherContainer::ContactsChangedL()
       
   913     {
       
   914     iModel->Reset();
       
   915     iListBox->HandleItemRemovalL();
       
   916     iHeaderCtrl->ClearL();
       
   917 
       
   918     if (!iStatusControl && iPlugin.ContactHandler().ContactStore() == ECmsContactStorePbk)
       
   919         {
       
   920         // create status control 
       
   921         CreateStatusControlL();
       
   922         //reset control's rect
       
   923         SizeChanged();
       
   924         }
       
   925 	
       
   926     }
       
   927 
       
   928 // ---------------------------------------------------------------------------
       
   929 // CCCAppCommLauncherContainer::ContactPresenceChangedL
       
   930 // ---------------------------------------------------------------------------
       
   931 //
       
   932 void CCCAppCommLauncherContainer::ContactPresenceChangedL(
       
   933     const CCmsContactField& aContactField)
       
   934     {
       
   935     iModel->ContactPresenceChangedL(aContactField);
       
   936     DrawDeferred();
       
   937     }
       
   938 
       
   939 // ---------------------------------------------------------------------------
       
   940 // CCCAppCommLauncherContainer::MapCommMethodToClipDirection
       
   941 // ---------------------------------------------------------------------------
       
   942 //
       
   943 AknTextUtils::TClipDirection CCCAppCommLauncherContainer::MapCommMethodToClipDirection(
       
   944     VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aContactAction)
       
   945     {
       
   946     switch (aContactAction)
       
   947         {
       
   948         case VPbkFieldTypeSelectorFactory::EEmailEditorSelector:
       
   949         case VPbkFieldTypeSelectorFactory::EInstantMessagingSelector:
       
   950         case VPbkFieldTypeSelectorFactory::EVOIPCallSelector:
       
   951         case VPbkFieldTypeSelectorFactory::EVideoCallSelector:
       
   952         case VPbkFieldTypeSelectorFactory::EVoiceCallSelector:
       
   953         case VPbkFieldTypeSelectorFactory::EUniEditorSelector:
       
   954             return AknTextUtils::EClipFromBeginning;
       
   955         case VPbkFieldTypeSelectorFactory::EURLSelector:
       
   956             return AknTextUtils::EClipFromEnd;
       
   957         default:
       
   958             return AknTextUtils::EClipFromEnd;
       
   959         }
       
   960     }
       
   961 
       
   962 // ----------------------------------------------------------------------------
       
   963 // CCCAppCommLauncherContainer::GetHelpContext()
       
   964 // ----------------------------------------------------------------------------
       
   965 //
       
   966 void CCCAppCommLauncherContainer::GetHelpContext(TCoeHelpContext& aContext) const
       
   967     {
       
   968     aContext.iMajor.iUid = KPbk2UID3;
       
   969     aContext.iContext = KHLP_CCA_LAUNCHER;
       
   970     }
       
   971 
       
   972 // ---------------------------------------------------------------------------
       
   973 // CCCAppCommLauncherContainer::DoShowMapCmdL
       
   974 // ---------------------------------------------------------------------------
       
   975 //
       
   976 void CCCAppCommLauncherContainer::DoShowMapCmdL( TPbk2CommandId aCommandId )
       
   977     {
       
   978     if( !iPbkCmd )
       
   979     	{
       
   980         iPbkCmd = CCCAppCommLauncherPbkCmd::NewL( iPlugin );
       
   981     	}
       
   982 
       
   983    
       
   984     iPbkCmd->ExecutePbk2CmdShowMapL(
       
   985             iPlugin.ContactHandler().ContactIdentifierLC(), aCommandId );
       
   986 
       
   987     CleanupStack::PopAndDestroy( 1 ); // ContactIdentifierLC
       
   988    
       
   989     }
       
   990 
       
   991 // --------------------------------------------------------------------------
       
   992 // CCCAppCommLauncherContainer::LongTapDetectorL
       
   993 // --------------------------------------------------------------------------
       
   994 //    
       
   995 CAknLongTapDetector& CCCAppCommLauncherContainer::LongTapDetectorL()
       
   996     {
       
   997     if ( !iLongTapDetector )
       
   998         {
       
   999         iLongTapDetector = CAknLongTapDetector::NewL( this );
       
  1000         }
       
  1001     return *iLongTapDetector;
       
  1002     }
       
  1003 
       
  1004 //-----------------------------------------------------------------------------
       
  1005 // CCCAppCommLauncherContainer::StatusClicked()
       
  1006 //-----------------------------------------------------------------------------
       
  1007 //
       
  1008 void CCCAppCommLauncherContainer::StatusClickedL()
       
  1009 	{
       
  1010 	if ( iViewLauncher )
       
  1011 		{
       
  1012         HBufC& contactData = iPlugin.AppEngine()->Parameter().ContactDataL();
       
  1013         HBufC8* contactData8 = HBufC8::NewLC( contactData.Size() );
       
  1014         TPtr8 contactData8Ptr( contactData8->Des() );
       
  1015         contactData8Ptr.Copy( contactData.Des() );
       
  1016         iViewLauncher->LaunchViewL( MCCAViewLauncher::ECCAView, &contactData8Ptr );
       
  1017         CleanupStack::PopAndDestroy( contactData8 );
       
  1018 		}
       
  1019 	}
       
  1020 
       
  1021 //-----------------------------------------------------------------------------
       
  1022 // CCCAppCommLauncherContainer::CheckExtensionFactoryL()
       
  1023 //-----------------------------------------------------------------------------
       
  1024 //
       
  1025 TInt CCCAppCommLauncherContainer::CheckExtensionFactoryL(TAny* aPtr)
       
  1026     {
       
  1027     CCCAppCommLauncherContainer* self = static_cast<CCCAppCommLauncherContainer*>( aPtr );
       
  1028     self->DoCheckExtensionFactoryL();
       
  1029     return 0;
       
  1030     }
       
  1031 
       
  1032 //-----------------------------------------------------------------------------
       
  1033 // CCCAppCommLauncherContainer::DoCheckExtensionFactoryL()
       
  1034 //-----------------------------------------------------------------------------
       
  1035 //
       
  1036 void CCCAppCommLauncherContainer::DoCheckExtensionFactoryL()
       
  1037     {
       
  1038     CCCAExtensionFactory* extension = iFactoryExtensionNotifier->ExtensionFactory();
       
  1039     
       
  1040     MCCAStatusProvider* ccaStatusProvider = NULL;
       
  1041     
       
  1042     // if extension is not null, extensionfactory plugins are available ->
       
  1043     // show statuscontrol        
       
  1044     if( extension )
       
  1045         {
       
  1046         if ( !iViewLauncher )
       
  1047             {
       
  1048             iViewLauncher = extension->CreateViewLauncherL();
       
  1049             }
       
  1050         if( iStatusControl )
       
  1051             {        
       
  1052 			if( extension )
       
  1053 				{				
       
  1054 				TAny* factoryExtension = extension->FactoryExtension( KCCAExtensionFactoryStatusProviderCreatorUid );        	
       
  1055 				
       
  1056 				 if( factoryExtension )
       
  1057 					 {
       
  1058 					 MCCAExtensionFactoryStatusProviderCreator* statusProviderCreator =
       
  1059 							 static_cast<MCCAExtensionFactoryStatusProviderCreator*>( factoryExtension );
       
  1060 
       
  1061 					   if( statusProviderCreator )
       
  1062 						   {
       
  1063                            ccaStatusProvider = statusProviderCreator->CreateStatusProviderL();						   
       
  1064 						   }
       
  1065 					 }
       
  1066 				}
       
  1067         
       
  1068 			iStatusControl->SetStatusProvider( ccaStatusProvider );
       
  1069             iStatusControl->MakeVisible( ETrue );
       
  1070             iHeaderCtrl->SetStatusButtonVisibility( ETrue );
       
  1071             }
       
  1072         }
       
  1073     else
       
  1074         {
       
  1075         delete iViewLauncher;
       
  1076         iViewLauncher = NULL;
       
  1077         if( iStatusControl )
       
  1078             {
       
  1079             iStatusControl->MakeVisible( EFalse );
       
  1080             iHeaderCtrl->SetStatusButtonVisibility( EFalse );
       
  1081             }
       
  1082         }
       
  1083     
       
  1084     }
       
  1085 
       
  1086 //-----------------------------------------------------------------------------
       
  1087 // CCCAppCommLauncherContainer::GetListBoxItemAmount()
       
  1088 //-----------------------------------------------------------------------------
       
  1089 //
       
  1090 const TInt CCCAppCommLauncherContainer::GetListBoxItemAmount() const
       
  1091 	{
       
  1092 	return iModel->MdcaCount();
       
  1093 	}
       
  1094 
       
  1095 //-----------------------------------------------------------------------------
       
  1096 // CCCAppCommLauncherContainer::SetInputBlockerL()
       
  1097 //-----------------------------------------------------------------------------
       
  1098 //
       
  1099 void CCCAppCommLauncherContainer::SetInputBlockerL()
       
  1100      {
       
  1101      if (!iInputBlocker)
       
  1102          {
       
  1103          iInputBlocker = CAknInputBlock::NewCancelHandlerLC( this );
       
  1104          CleanupStack::Pop( iInputBlocker );   
       
  1105          iInputBlocker->SetCancelDelete( iInputBlocker );
       
  1106          }
       
  1107      } 
       
  1108 
       
  1109 // --------------------------------------------------------------------------
       
  1110 // CCCAppCommLauncherContainer::RemoveInputBlockerL
       
  1111 // --------------------------------------------------------------------------
       
  1112 //
       
  1113 void CCCAppCommLauncherContainer::RemoveInputBlocker()
       
  1114     {
       
  1115     if (iInputBlocker)
       
  1116         {
       
  1117         iInputBlocker->Cancel();
       
  1118         }
       
  1119     }
       
  1120 
       
  1121 // --------------------------------------------------------------------------
       
  1122 // CCCAppCommLauncherContainer::AknInputBlockCancel
       
  1123 // --------------------------------------------------------------------------
       
  1124 //
       
  1125 void CCCAppCommLauncherContainer::AknInputBlockCancel()
       
  1126      {
       
  1127      iInputBlocker = NULL;
       
  1128      }
       
  1129 // End of File