uiservicetab/vimpstui/src/cvimpstuiextensionfactory.cpp
branchRCL_3
changeset 14 9fdee5e1da30
parent 0 5e5d6b214f4f
equal deleted inserted replaced
13:796276a1bdcc 14:9fdee5e1da30
    47 #include "cvimpstuitabbedview.h"
    47 #include "cvimpstuitabbedview.h"
    48 #include "cvimpstuisearchview.h"
    48 #include "cvimpstuisearchview.h"
    49 #include "tvimpstconsts.h"
    49 #include "tvimpstconsts.h"
    50 #include "cvimpstuiblockview.h"
    50 #include "cvimpstuiblockview.h"
    51 
    51 
    52 #include "vimpstdebugprint.h" 
    52 #include "uiservicetabtracer.h"
    53 #include "cvimpstuimenuextension.h"
    53 #include "cvimpstuimenuextension.h"
    54 
    54 
    55 // ================= MEMBER FUNCTIONS =======================
    55 // ================= MEMBER FUNCTIONS =======================
    56 
    56 
    57 inline CVIMPSTUiExtensionFactory::CVIMPSTUiExtensionFactory() :
    57 inline CVIMPSTUiExtensionFactory::CVIMPSTUiExtensionFactory() :
    66 //
    66 //
    67 void CVIMPSTUiExtensionFactory::ConstructL()
    67 void CVIMPSTUiExtensionFactory::ConstructL()
    68     {
    68     {
    69     
    69     
    70     // Load the Resource File
    70     // Load the Resource File
    71     CHAT_DP_FUNC_ENTER("CVIMPSTUiExtensionFactory::ConstructL -start");
    71 	TRACER_AUTO;
    72 	TFileName resPathWithoutDrive;
    72 	TFileName resPathWithoutDrive;
    73     resPathWithoutDrive.Zero();
    73     resPathWithoutDrive.Zero();
    74     resPathWithoutDrive.Append( KResourceDir() );
    74     resPathWithoutDrive.Append( KResourceDir() );
    75     resPathWithoutDrive.Append( KResourceFileName() );
    75     resPathWithoutDrive.Append( KResourceFileName() );
    76     
    76     
   103     iEngine = CVIMPSTUIViewManager::NewL( 
   103     iEngine = CVIMPSTUIViewManager::NewL( 
   104         			KNullDesC(), *this );  
   104         			KNullDesC(), *this );  
   105     iMenuExtension = CVIMPSTUIMenuExtension::NewL();  
   105     iMenuExtension = CVIMPSTUIMenuExtension::NewL();  
   106     // Get's all sevices
   106     // Get's all sevices
   107     CreateServicesL();
   107     CreateServicesL();
   108       CHAT_DP_FUNC_DONE("CVIMPSTUiExtensionFactory::ConstructL -end");
   108      
   109     }
   109     }
   110 
   110 
   111 
   111 
   112 // --------------------------------------------------------------------------
   112 // --------------------------------------------------------------------------
   113 // CVIMPSTUiExtensionFactory::NewL
   113 // CVIMPSTUiExtensionFactory::NewL
   114 // --------------------------------------------------------------------------
   114 // --------------------------------------------------------------------------
   115 //
   115 //
   116 CVIMPSTUiExtensionFactory* CVIMPSTUiExtensionFactory::NewL()
   116 CVIMPSTUiExtensionFactory* CVIMPSTUiExtensionFactory::NewL()
   117     {
   117     {
   118     	  CHAT_DP_FUNC_ENTER("CVIMPSTUiExtensionFactory::NewL -start");
   118 	TRACER_AUTO;
   119     CVIMPSTUiExtensionFactory* self = new (ELeave) CVIMPSTUiExtensionFactory;
   119     CVIMPSTUiExtensionFactory* self = new (ELeave) CVIMPSTUiExtensionFactory;
   120     CleanupStack::PushL(self);
   120     CleanupStack::PushL(self);
   121     self->ConstructL();
   121     self->ConstructL();
   122     CleanupStack::Pop(self);
   122     CleanupStack::Pop(self);
   123     CHAT_DP_FUNC_DONE("CVIMPSTUiExtensionFactory::NewL -end");
   123     
   124     return self;
   124     return self;
   125     }
   125     }
   126 
   126 
   127 
   127 
   128 // --------------------------------------------------------------------------
   128 // --------------------------------------------------------------------------
   129 // CVIMPSTUiExtensionFactory::~CVIMPSTUiExtensionFactory
   129 // CVIMPSTUiExtensionFactory::~CVIMPSTUiExtensionFactory
   130 // --------------------------------------------------------------------------
   130 // --------------------------------------------------------------------------
   131 //
   131 //
   132 CVIMPSTUiExtensionFactory::~CVIMPSTUiExtensionFactory()
   132 CVIMPSTUiExtensionFactory::~CVIMPSTUiExtensionFactory()
   133     {
   133     {
   134     CHAT_DP_FUNC_ENTER("CVIMPSTUiExtensionFactory::~CVIMPSTUiExtensionFactory -start");
   134 	TRACER_AUTO;
   135     delete iEngine;
   135     delete iEngine;
   136     
   136     
   137     iCoeEnv.DeleteResourceFile( iResourceOffset );
   137     iCoeEnv.DeleteResourceFile( iResourceOffset );
   138     
   138     
   139     //for deleting iEngineFactoryInstance
   139     //for deleting iEngineFactoryInstance
   140     CVIMPSTEngineFactory::Release();
   140     CVIMPSTEngineFactory::Release();
   141     
   141     
   142     delete iMenuExtension;
   142     delete iMenuExtension;
   143     CHAT_DP_FUNC_DONE("CVIMPSTUiExtensionFactory::~CVIMPSTUiExtensionFactory -end");
   143     
   144     }
   144     }
   145 
   145 
   146 
   146 
   147 
   147 
   148 // --------------------------------------------------------------------------
   148 // --------------------------------------------------------------------------
   149 // CVIMPSTUiExtensionFactory::CreateViewL
   149 // CVIMPSTUiExtensionFactory::CreateViewL
   150 // --------------------------------------------------------------------------
   150 // --------------------------------------------------------------------------
   151 //
   151 //
   152 CxSPBaseView* CVIMPSTUiExtensionFactory::CreateViewL( TUid aViewId, CPbk2UIExtensionView& aView )
   152 CxSPBaseView* CVIMPSTUiExtensionFactory::CreateViewL( TUid aViewId, CPbk2UIExtensionView& aView )
   153     {
   153     {
   154     	CHAT_DP_FUNC_ENTER("CVIMPSTUiExtensionFactory::CreateViewL-start");
   154 	TRACER_AUTO;
   155     CxSPBaseView* view = NULL;
   155     CxSPBaseView* view = NULL;
   156     
   156     
   157     TInt oldView;
   157     TInt oldView;
   158 	TInt err = iMapper->GetOldView( KIMCONTACTSEXTNIMPLEMENTATIONUID, aViewId.iUid, oldView );
   158 	TInt err = iMapper->GetOldView( KIMCONTACTSEXTNIMPLEMENTATIONUID, aViewId.iUid, oldView );
   159 	
   159 	
   197 					}
   197 					}
   198 				}
   198 				}
   199 
   199 
   200 			}
   200 			}
   201 	    }
   201 	    }
   202     CHAT_DP_FUNC_DONE("CVIMPSTUiExtensionFactory::CreateViewL-end");
   202    
   203     return view;
   203     return view;
   204     }
   204     }
   205   
   205   
   206   
   206   
   207 // --------------------------------------------------------------------------
   207 // --------------------------------------------------------------------------
   218 // CVIMPSTUiExtensionFactory::ViewInfoResource
   218 // CVIMPSTUiExtensionFactory::ViewInfoResource
   219 // --------------------------------------------------------------------------
   219 // --------------------------------------------------------------------------
   220 //                               
   220 //                               
   221 TInt CVIMPSTUiExtensionFactory::ViewInfoResource() const
   221 TInt CVIMPSTUiExtensionFactory::ViewInfoResource() const
   222 	{
   222 	{
   223 
   223 	TRACER_AUTO;
   224 	// Indicate KErrNotFound. This way static resources are not used but
   224 	// Indicate KErrNotFound. This way static resources are not used but
   225     // xSP Extension Manager queries data. Exception: If IM is not
   225     // xSP Extension Manager queries data. Exception: If IM is not
   226     // supported, indicate it via resource for simplicity
   226     // supported, indicate it via resource for simplicity
   227     TInt ret = KErrNotFound;
   227     TInt ret = KErrNotFound;
   228     
   228     
   308 // CVIMPSTUiExtensionFactory::CreateServicesL()
   308 // CVIMPSTUiExtensionFactory::CreateServicesL()
   309 // ---------------------------------------------------------------------------
   309 // ---------------------------------------------------------------------------
   310 //  
   310 //  
   311 void CVIMPSTUiExtensionFactory::CreateServicesL()
   311 void CVIMPSTUiExtensionFactory::CreateServicesL()
   312     {
   312     {
   313     CHAT_DP_FUNC_ENTER("CVIMPSTUiExtensionFactory::CreateServicesL - start");
   313 	TRACER_AUTO;
   314     // Get all available services   
   314     // Get all available services   
   315     RPointerArray<MVIMPSTEngine> engines;
   315     RPointerArray<MVIMPSTEngine> engines;
   316     
   316     
   317     if (iEngineFactoryInstance)
   317     if (iEngineFactoryInstance)
   318 	    {
   318 	    {
   319 	    iEngineFactoryInstance->GetServiceEnginePtr(engines);      
   319 	    iEngineFactoryInstance->GetServiceEnginePtr(engines);      
   320     CHAT_DP( D_CHAT_LIT("CreateServicesL() engines.Count(): %d"), engines.Count());
   320 	    TRACE("CreateServicesL() engines.Count(): %d", engines.Count());
   321     // iterate the service array
   321     // iterate the service array
   322     for ( TInt index = 0; index < engines.Count() ; index++ )        
   322     for ( TInt index = 0; index < engines.Count() ; index++ )        
   323         {
   323         {
   324         //ServiceId is used to create unique view id for each service, to avoid the reuse of view id of existing service to newly installed service
   324         //ServiceId is used to create unique view id for each service, to avoid the reuse of view id of existing service to newly installed service
   325         TInt ServiceId = engines[index]->ServiceId();
   325         TInt ServiceId = engines[index]->ServiceId();
   328         }
   328         }
   329     
   329     
   330     engines.Reset();
   330     engines.Reset();
   331     engines.Close();
   331     engines.Close();
   332 	    }
   332 	    }
   333     CHAT_DP_FUNC_DONE("CVIMPSTUiExtensionFactory::CreateServicesL - end");
   333   
   334     }	
   334     }	
   335 	
   335 	
   336 // ---------------------------------------------------------------------------
   336 // ---------------------------------------------------------------------------
   337 // CVIMPSTUiExtensionFactory::IsSearchId()
   337 // CVIMPSTUiExtensionFactory::IsSearchId()
   338 // ---------------------------------------------------------------------------
   338 // ---------------------------------------------------------------------------