phonebookui/Phonebook2/ccapplication/ccapp/src/ccaappview.cpp
branchRCL_3
changeset 13 a6539d1e8e43
parent 7 b3431bff8c19
equal deleted inserted replaced
12:4ae315f230bc 13:a6539d1e8e43
    18 
    18 
    19 // INCLUDE FILES
    19 // INCLUDE FILES
    20 #include "ccappheaders.h"
    20 #include "ccappheaders.h"
    21 #include <mccappviewpluginbase2.h>
    21 #include <mccappviewpluginbase2.h>
    22 #include "ccappmycardpluginuids.hrh"
    22 #include "ccappmycardpluginuids.hrh"
       
    23 #include "ccacmscontactfetcherwrapper.h"
    23 
    24 
    24 // ======== MEMBER FUNCTIONS ========
    25 // ======== MEMBER FUNCTIONS ========
    25 
    26 
    26 // ---------------------------------------------------------------------------
    27 // ---------------------------------------------------------------------------
    27 // CCCAppView::CCCAppView
    28 // CCCAppView::CCCAppView
   107 void CCCAppView::StartViewL( const TUid aUid )
   108 void CCCAppView::StartViewL( const TUid aUid )
   108     {
   109     {
   109     CCA_DP( KCCAppLogFile, CCA_L("->CCCAppView::StartViewL"));
   110     CCA_DP( KCCAppLogFile, CCA_L("->CCCAppView::StartViewL"));
   110     iDelayedStarting = ETrue;
   111     iDelayedStarting = ETrue;
   111 
   112 
   112     // 1st start the contact fetching
       
   113     iCmsWrapper = CCCAppCmsContactFetcherWrapper::CreateInstanceL( 
       
   114          &iAppUi.Parameter(), CCCAppCmsContactFetcherWrapper::EFindContactFromOtherStores );
       
   115     iCmsWrapper->AddObserverL( *this );
       
   116 
       
   117     // At the moment mycard does not need to support tabs, so this is 
   113     // At the moment mycard does not need to support tabs, so this is 
   118     // good enough sollution for launching mycard plugin
   114     // good enough sollution for launching mycard plugin
   119     TBool isUidMyCard = ( aUid == 
   115     TBool isUidMyCard = ( aUid == 
   120             TUid::Uid( KCCAMyCardPluginImplmentationUid ) );
   116             TUid::Uid( KCCAMyCardPluginImplmentationUid ) );
   121 
   117 
       
   118 	// MyCard does not need CMS session. Initializing CMS for no real use
       
   119 	// will only waste time in MyCard launching.
       
   120     if( !isUidMyCard )
       
   121         {
       
   122         // 1st start the contact fetching
       
   123         iCmsWrapper = CCCAppCmsContactFetcherWrapper::CreateInstanceL( 
       
   124              &iAppUi.Parameter(), CCCAppCmsContactFetcherWrapper::EFindContactFromOtherStores );
       
   125         iCmsWrapper->AddObserverL( *this );
       
   126         }
   122     
   127     
   123     //In this version support only contact type data (i.e. group data discarded)
   128     //In this version support only contact type data (i.e. group data discarded)
   124     _LIT8( KCcaOpaqueTag_CNT,           "CNT" );    //Contact    
   129     _LIT8( KCcaOpaqueTag_CNT,           "CNT" );    //Contact    
   125     _LIT8( KCcaOpaqueTag_MCD,           "MCD" );    //MyCard    
   130     _LIT8( KCcaOpaqueTag_MCD,           "MCD" );    //MyCard    
   126     _LIT8( KCcaPluginTypeMyCard,        "application/x-mycard" );    
   131     _LIT8( KCcaPluginTypeMyCard,        "application/x-mycard" );    
   470 void CCCAppView::ContactFieldDataObserverHandleErrorL( 
   475 void CCCAppView::ContactFieldDataObserverHandleErrorL( 
   471     TInt aState, TInt aError )
   476     TInt aState, TInt aError )
   472     {
   477     {
   473     CCA_DP( KCCAppLogFile, CCA_L("CCCAppView::ContactFieldDataObserverHandleErrorL"));
   478     CCA_DP( KCCAppLogFile, CCA_L("CCCAppView::ContactFieldDataObserverHandleErrorL"));
   474     CCA_DP( KCCAppLogFile, CCA_L("::ContactFieldDataObserverHandleErrorL - aState: %d, aError: %d"), aState, aError );
   479     CCA_DP( KCCAppLogFile, CCA_L("::ContactFieldDataObserverHandleErrorL - aState: %d, aError: %d"), aState, aError );
   475     //todo; what kind of behaviour is wanted in error case?
   480     // If no contact found, leave here and launching CCA fails
   476     // - exit the app if no cms connection/contact is not found?
   481     if ( CCCAppCmsContactFetcherWrapper::EOpeningContact == aState )
       
   482     	{
       
   483         User::Leave(aError);
       
   484     	}
   477     }
   485     }
   478 
   486 
   479 // ---------------------------------------------------------------------------
   487 // ---------------------------------------------------------------------------
   480 // CCCAppView::ContactFieldFetchedNotifyL
   488 // CCCAppView::ContactFieldFetchedNotifyL
   481 // ---------------------------------------------------------------------------
   489 // ---------------------------------------------------------------------------