mulwidgets/mulcoverflowwidget/src/mulcoverflowwidgetfactoryplugin.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:23:18 +0100
branchRCL_3
changeset 26 0e9bb658ef58
parent 0 e83bab7cf002
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 2007-2008 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:  factory plugin Implementation
*
*/

//  Include Files

#include "mulcoverflowwidgetfactoryplugin.h"
#include "mulcoverflowwidget.h"

namespace Alf
    {

const TInt KCoverFlowWidgetFactoryPluginUid =
	{
			0x2000D241
	};

const int KProductCount = 1;

static const char* const KWidget = "mulcoverflowwidget";

// ---------------------------------------------------------------------------
// NewL
// ---------------------------------------------------------------------------
//    
MulCoverFlowWidgetFactoryPlugin* MulCoverFlowWidgetFactoryPlugin::NewL()
    {
    return new(ELeave)MulCoverFlowWidgetFactoryPlugin;
    }

// ---------------------------------------------------------------------------
// ~MulCoverFlowWidgetFactoryPlugin
// ---------------------------------------------------------------------------
//    
MulCoverFlowWidgetFactoryPlugin::~MulCoverFlowWidgetFactoryPlugin()
    {   
    }
    
// ---------------------------------------------------------------------------
// createProduct
// ---------------------------------------------------------------------------
//    
IAlfInterfaceBase* MulCoverFlowWidgetFactoryPlugin::createProduct(
    const char* aProduct,
    void* aInitData)
    {
    IAlfInterfaceBase* ret(0);

    //Creates the instance of the CoverFlow widget
    if(!strcmp(aProduct,KWidget))
        {
        AlfWidgetInitData* initData = reinterpret_cast<AlfWidgetInitData*>(aInitData);
        auto_ptr<MulCoverFlowWidget> Widget (new (EMM) MulCoverFlowWidget(*initData->mEnv,
        		initData->mWidgetId,*initData->mContainerWidget) );
        ret = Widget->makeInterface(IMulCoverFlowWidget::Type());    
        Widget.release();
        }
    return ret;
    }

// ---------------------------------------------------------------------------
// makeInterface
// ---------------------------------------------------------------------------
//    
IAlfInterfaceBase* MulCoverFlowWidgetFactoryPlugin::makeInterface(
        const IfId& aType)
    {    
    if( UString(aType.mImplementationId) == UString(IAlfFactoryPlugin::type().mImplementationId) )
        {
        return static_cast<IAlfFactoryPlugin*>(this);            
        }
    return NULL;
    }

// ---------------------------------------------------------------------------
// productCount
// ---------------------------------------------------------------------------
//        
int MulCoverFlowWidgetFactoryPlugin::productCount()const
    {
    return KProductCount;    
    }
 
// ---------------------------------------------------------------------------
// productInfo
// ---------------------------------------------------------------------------
//        
const char* MulCoverFlowWidgetFactoryPlugin::productInfo(int aIndex)const
    {
    /// @bug minor:avanhata:3/7/2008 good old if would be clearer
    /// (Surely it is a caller error to call this function with aIndex >= productCount()
    /// anyway, so can simply assert)
    switch(aIndex)
        {
		case 0:
			return KWidget;

		default:
			break;
        }
    
    return 0;
    }
    
    }  //namespace Alf         
// ========================== OTHER EXPORTED FUNCTIONS =========================

using namespace Alf;

const TImplementationProxy
		ImplementationTable[] =
    {
	#ifdef __EABI__ 
    
    IMPLEMENTATION_PROXY_ENTRY(KCoverFlowWidgetFactoryPluginUid, MulCoverFlowWidgetFactoryPlugin::NewL)
    
    #else
	
	{ {KCoverFlowWidgetFactoryPluginUid},MulCoverFlowWidgetFactoryPlugin::NewL }
	
	#endif
    };

OSN_EXPORT const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
    {
    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);

    return ImplementationTable;
    }
    
//End of File