diff -r 4526337fb576 -r 3eca7e70b1b8 widgetmodel/alfwidgetfactory/src/alfwidgetfactoryplugin.cpp --- a/widgetmodel/alfwidgetfactory/src/alfwidgetfactoryplugin.cpp Tue Feb 02 00:28:09 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: File imeplemets the widgetfactory for interfaces. -* -*/ - - -//Symbian includes -#include - -//Alfred client includes -#include - -//OSN core includes -#include -#include -#include - -//Widget utils includes -#include - -//Local includes -#include "alfwidgetfactoryplugin.h" -#include "alfwidgetfactory.h" - -//Namespaces -using namespace Alf; -using namespace osncore; - - -namespace Alf - { - -const TInt KWidgetFactoryPluginUid = {0x10201256}; -const int KProductCount = 1; -static const char* const KAlfWidgetFactory = "alfwidgetfactory"; - - -IAlfFactoryPlugin* AlfWidgetFactoryPlugin::NewL() - { - // Must use (ELeave), because ECOM won't undestand bad_alloc - return new(ELeave)AlfWidgetFactoryPlugin; - } - -AlfWidgetFactoryPlugin::~AlfWidgetFactoryPlugin() - { - } - -IAlfInterfaceBase* AlfWidgetFactoryPlugin::createProduct( - const char* aProduct, - void* aInitData) - { - (void) aProduct; //Compiler Warning removal. - - CAlfEnv* env = reinterpret_cast(aInitData); - AlfWidgetFactory* widgetFactory( new( EMM ) AlfWidgetFactory(*env) ); - // This basically returns the widgetFactory object. - // The ownership of that object is transferred to the caller. - return widgetFactory->makeInterface(IAlfWidgetFactory::type()); - } - -IAlfInterfaceBase* AlfWidgetFactoryPlugin::makeInterface(const IfId& aType) - { - UString param(aType.mImplementationId); - if(param == UString(IAlfFactoryPlugin::type().mImplementationId)) - { - return static_cast(this); - } - return NULL; - } - -int AlfWidgetFactoryPlugin::productCount()const - { - return KProductCount; - } - -const char* AlfWidgetFactoryPlugin::productInfo(int aIndex)const - { - if(aIndex == 0) - { - return KAlfWidgetFactory; - } - return 0; - } - - } // namespace Alf - - - -const TImplementationProxy ImplementationTable[] = - { - #ifdef __EABI__ - IMPLEMENTATION_PROXY_ENTRY( - KWidgetFactoryPluginUid, - AlfWidgetFactoryPlugin::NewL), - #else - {{KWidgetFactoryPluginUid}, AlfWidgetFactoryPlugin::NewL} - #endif - }; - -OSN_EXPORT const TImplementationProxy* ImplementationGroupProxy( - TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - - return ImplementationTable; - } - -// End of File