diff -r 000000000000 -r 96612d01cf9f videofeeds/vcxnotifier/src/vcxnotifierplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videofeeds/vcxnotifier/src/vcxnotifierplugin.cpp Mon Jan 18 20:21:12 2010 +0200 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "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: +* +*/ + + + + +#include +#include +#include +#include "IptvDebug.h" +#include "vcxnotifier.h" + +const TInt KnbrOfSubjects = 1; + +// ----------------------------------------------------------------------------- +// CleanupArray +// +// ----------------------------------------------------------------------------- +// +void CleanupArray(TAny* aArray) + { + IPTVLOGSTRING_LOW_LEVEL("VCxNotifierPlugin::CleanupArray"); + + CArrayPtrFlat* subjects = + static_cast*>(aArray); + if (subjects) + { + TInt lastInd = subjects->Count()-1; + for (TInt i = lastInd; i >= 0; i--) + { + subjects->At(i)->Release(); + } + } + delete subjects; + } + +// ----------------------------------------------------------------------------- +// DoCreateNotifierArrayL +// +// ----------------------------------------------------------------------------- +// +CArrayPtr* DoCreateNotifierArrayL() + { + IPTVLOGSTRING_LOW_LEVEL("CIptvVodNotifierPlugin::DoCreateNotifierArrayL"); + + CArrayPtrFlat* subjects = + new (ELeave)CArrayPtrFlat( KnbrOfSubjects ); + + CleanupStack::PushL( TCleanupItem( CleanupArray, subjects ) ); + + MEikSrvNotifierBase2* master = CVcXNotifier::NewL(); + CleanupStack::PushL( master ); + subjects->AppendL( master ); + CleanupStack::Pop( master ); + + CleanupStack::Pop( subjects ); + return (subjects); + } + +// ----------------------------------------------------------------------------- +// NotifierArray +// +// ----------------------------------------------------------------------------- +// +CArrayPtr* NotifierArray() + { + IPTVLOGSTRING_LOW_LEVEL("CIptvVodNotifierPlugin::NotifierArray"); + + CArrayPtr* array = 0; + TRAPD(error, array = DoCreateNotifierArrayL() ); + if (error != KErrNone) + { + IPTVLOGSTRING2_LOW_LEVEL("CIptvVodNotifierPlugin::NotifierArray --- DoCreateNotifierArrayL error %d", error); + } + + return array; + } + +const TImplementationProxy ImplementationTable[] = + { +#ifdef __EABI__ + {{0x20016BA5},(TFuncPtr)NotifierArray} +#else + {{0x20016BA5},NotifierArray} +#endif + }; + +// ----------------------------------------------------------------------------- +// ImplementationGroupProxy +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + IPTVLOGSTRING_LOW_LEVEL("CIptvVodNotifierPlugin::ImplementationGroupProxy"); + + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ; + return ImplementationTable; + }