phonebookui/Phonebook/PbkExt/src/CPbkExtensionLoader.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *       Implementation for extension dll loader.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "CPbkExtensionLoader.h"
       
    22 #include <ExtensionUID.h>
       
    23 #include <MPbkExtensionFactory.h>
       
    24 #include <CPbkExtensionFactory.h>
       
    25 
       
    26 #include <PbkDebug.h>
       
    27 #include "PbkProfiling.h"
       
    28 
       
    29 // ================= MEMBER FUNCTIONS =======================
       
    30 
       
    31 inline CPbkExtensionLoader::CPbkExtensionLoader()
       
    32     {
       
    33     }
       
    34 
       
    35 CPbkExtensionLoader* CPbkExtensionLoader::NewL(TUid aUid)
       
    36     {
       
    37     CPbkExtensionLoader* self = new (ELeave) CPbkExtensionLoader;
       
    38     CleanupStack::PushL(self);
       
    39     self->LoadExtensionDllL(aUid);
       
    40     CleanupStack::Pop(self);
       
    41     return self;
       
    42     }
       
    43 
       
    44 CPbkExtensionLoader::~CPbkExtensionLoader()
       
    45     {
       
    46     PBK_DEBUG_PRINT(PBK_DEBUG_STRING("Unloaded extension %x"), iFactory);
       
    47 
       
    48     delete iFactory;
       
    49     }
       
    50 
       
    51 MPbkExtensionFactory* CPbkExtensionLoader::ExtensionFactory()
       
    52     {    
       
    53     return iFactory;
       
    54     }
       
    55 
       
    56 void CPbkExtensionLoader::LoadExtensionDllL(TUid aUid)
       
    57     {
       
    58     PBK_DEBUG_PRINT(PBK_DEBUG_STRING("Start loading and initializing ECom DLL impl_uid=%x"), aUid);
       
    59     __PBK_PROFILE_START(PbkProfiling::EEComUiExtensionLoadAndInit);
       
    60 
       
    61     iFactory = CPbkExtensionFactory::NewL(aUid);
       
    62 
       
    63     __PBK_PROFILE_END(PbkProfiling::EEComUiExtensionLoadAndInit);
       
    64     __PBK_PROFILE_DISPLAY(PbkProfiling::EEComUiExtensionLoadAndInit);
       
    65     PBK_DEBUG_PRINT(PBK_DEBUG_STRING("Done loading and initializing ECom DLL impl_uid=%x"), aUid);
       
    66     }
       
    67 
       
    68 // End of File