emailservices/emailframework/src/CFSMailPluginManager.cpp
changeset 0 8466d47a6819
child 8 e1b6206813b4
child 18 578830873419
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007-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:  common mailbox object
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "emailtrace.h"
       
    20 #include "CFSMailPluginManager.h"
       
    21 #include "CFSMailRequestObserver.h"
       
    22 #include "CFSMailRequestHandler.h"
       
    23 
       
    24 // ================= MEMBER FUNCTIONS ==========================================
       
    25 // -----------------------------------------------------------------------------
       
    26 // CFSMailPluginManager::CFSMailPluginManager
       
    27 // -----------------------------------------------------------------------------
       
    28 CFSMailPluginManager::CFSMailPluginManager()
       
    29 {
       
    30     FUNC_LOG;
       
    31 
       
    32 }
       
    33 
       
    34 // -----------------------------------------------------------------------------
       
    35 // CFSMailPluginManager::~CFSMailPluginManager
       
    36 // -----------------------------------------------------------------------------
       
    37 CFSMailPluginManager::~CFSMailPluginManager()
       
    38 {
       
    39     FUNC_LOG;
       
    40 	iPluginInfo.ResetAndDestroy();
       
    41 }
       
    42 
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // CFSMailPluginManager::NewLC
       
    46 // -----------------------------------------------------------------------------
       
    47 CFSMailPluginManager* CFSMailPluginManager::NewLC(TInt aConfiguration)
       
    48 {
       
    49     FUNC_LOG;
       
    50   CFSMailPluginManager* pluginManager = new (ELeave) CFSMailPluginManager();
       
    51   CleanupStack:: PushL(pluginManager);
       
    52   pluginManager->ConstructL(aConfiguration);
       
    53   return pluginManager;
       
    54 } 
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CFSMailPluginManager::NewL
       
    58 // -----------------------------------------------------------------------------
       
    59 CFSMailPluginManager* CFSMailPluginManager::NewL(TInt aConfiguration)
       
    60 {
       
    61     FUNC_LOG;
       
    62   CFSMailPluginManager* pluginManager =  CFSMailPluginManager::NewLC(aConfiguration);
       
    63   CleanupStack:: Pop(pluginManager);
       
    64   return pluginManager;
       
    65 }
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // CFSMailPluginManager::ConstructL
       
    69 // -----------------------------------------------------------------------------
       
    70 void CFSMailPluginManager::ConstructL(TInt aConfiguration)
       
    71 {
       
    72     FUNC_LOG;
       
    73 
       
    74 	// list plugin implementations
       
    75 
       
    76 	iPluginInfo.Reset();
       
    77 	CFSMailPlugin::ListImplementationsL(iPluginInfo);
       
    78 	CFSMailPlugin::Close();
       
    79 	
       
    80 	// load plugins
       
    81 	CFSMailPlugin* plugin = NULL;
       
    82     // <cmail>  	
       
    83 	TInt tempCount = iPluginInfo.Count();
       
    84 	for(TInt i=0;i<tempCount;i++)
       
    85 	// </cmail> 	    
       
    86 	{
       
    87 		TUid id = iPluginInfo[i]->ImplementationUid();
       
    88 		if(aConfiguration == EFSLoadPlugins)
       
    89 		{
       
    90 			TRAPD(err,plugin = CFSMailPlugin::NewL( id ));
       
    91 			CFSMailPlugin::Close();		
       
    92 			if(err == KErrNone && plugin != NULL)
       
    93 			{
       
    94 				AddPluginL(id,plugin);
       
    95 			}
       
    96 		}	
       
    97 // <cmail>
       
    98 		else
       
    99 		    {		    
       
   100 		    }
       
   101 // </cmail>      		
       
   102 	}
       
   103 
       
   104 }
       
   105 
       
   106 // -----------------------------------------------------------------------------
       
   107 // CFSMailPluginManager::LoadPluginL
       
   108 // -----------------------------------------------------------------------------
       
   109 void CFSMailPluginManager::LoadPluginL( TUid /*aPlugin*/ )
       
   110 {
       
   111     FUNC_LOG;
       
   112 
       
   113 }
       
   114 	
       
   115 // -----------------------------------------------------------------------------
       
   116 // CFSMailPluginManager::GetPluginByIndex
       
   117 // -----------------------------------------------------------------------------
       
   118 CFSMailPlugin* CFSMailPluginManager::GetPluginByIndex(TUint aIndex)
       
   119 	{
       
   120     FUNC_LOG;
       
   121 	return iPluginList[aIndex]->iPlugin;
       
   122 	}
       
   123 
       
   124 // -----------------------------------------------------------------------------
       
   125 // CFSMailPluginManager::GetPluginIdByIndex
       
   126 // -----------------------------------------------------------------------------
       
   127 TUid CFSMailPluginManager::GetPluginIdByIndex(TUint aIndex)
       
   128 	{
       
   129     FUNC_LOG;
       
   130 	return iPluginList[aIndex]->iPluginId;
       
   131 	}
       
   132 
       
   133 // -----------------------------------------------------------------------------
       
   134 // CFSMailPluginManager::GetPluginCount
       
   135 // -----------------------------------------------------------------------------
       
   136 TUint CFSMailPluginManager::GetPluginCount( )
       
   137 	{
       
   138     FUNC_LOG;
       
   139 	return iPluginList.Count();
       
   140 	}
       
   141 	
       
   142 
       
   143