videofeeds/vcxnotifier/src/vcxnotifierplugin.cpp
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2006 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 the License "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 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <ecom/implementationproxy.h>
       
    23 #include <eiknotapi.h>
       
    24 #include "IptvDebug.h"
       
    25 #include "vcxnotifier.h"
       
    26 
       
    27 const TInt KnbrOfSubjects = 1;
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // CleanupArray
       
    31 // 
       
    32 // -----------------------------------------------------------------------------
       
    33 //  
       
    34 void CleanupArray(TAny* aArray)
       
    35     {
       
    36     IPTVLOGSTRING_LOW_LEVEL("VCxNotifierPlugin::CleanupArray");
       
    37 
       
    38     CArrayPtrFlat<MEikSrvNotifierBase2>* subjects = 
       
    39             static_cast<CArrayPtrFlat<MEikSrvNotifierBase2>*>(aArray);
       
    40     if (subjects)
       
    41         {
       
    42         TInt lastInd = subjects->Count()-1;
       
    43         for (TInt i = lastInd; i >= 0; i--)
       
    44             {        
       
    45             subjects->At(i)->Release();	    	    
       
    46             }
       
    47         }
       
    48     delete subjects;
       
    49     }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // DoCreateNotifierArrayL
       
    53 // 
       
    54 // -----------------------------------------------------------------------------
       
    55 //  
       
    56 CArrayPtr<MEikSrvNotifierBase2>* DoCreateNotifierArrayL()
       
    57     {
       
    58     IPTVLOGSTRING_LOW_LEVEL("CIptvVodNotifierPlugin::DoCreateNotifierArrayL");
       
    59 
       
    60     CArrayPtrFlat<MEikSrvNotifierBase2>* subjects = 
       
    61                 new (ELeave)CArrayPtrFlat<MEikSrvNotifierBase2>( KnbrOfSubjects );    
       
    62                 
       
    63     CleanupStack::PushL( TCleanupItem( CleanupArray, subjects ) );
       
    64     
       
    65     MEikSrvNotifierBase2* master = CVcXNotifier::NewL();	   
       
    66     CleanupStack::PushL( master );
       
    67     subjects->AppendL( master );
       
    68     CleanupStack::Pop( master );
       
    69 
       
    70     CleanupStack::Pop( subjects );       
       
    71     return (subjects);
       
    72     }
       
    73 
       
    74 // -----------------------------------------------------------------------------
       
    75 // NotifierArray
       
    76 // 
       
    77 // -----------------------------------------------------------------------------
       
    78 //  
       
    79 CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
       
    80     {
       
    81     IPTVLOGSTRING_LOW_LEVEL("CIptvVodNotifierPlugin::NotifierArray");
       
    82 
       
    83     CArrayPtr<MEikSrvNotifierBase2>* array = 0;
       
    84     TRAPD(error, array = DoCreateNotifierArrayL() );
       
    85     if (error != KErrNone)
       
    86         {
       
    87         IPTVLOGSTRING2_LOW_LEVEL("CIptvVodNotifierPlugin::NotifierArray --- DoCreateNotifierArrayL error %d", error);
       
    88         }            
       
    89     
       
    90     return array;
       
    91     }
       
    92 
       
    93 const TImplementationProxy ImplementationTable[] =
       
    94 	{    
       
    95 #ifdef __EABI__    
       
    96     {{0x20016BA5},(TFuncPtr)NotifierArray}
       
    97 #else
       
    98     {{0x20016BA5},NotifierArray}
       
    99 #endif
       
   100 	};
       
   101 
       
   102 // -----------------------------------------------------------------------------
       
   103 // ImplementationGroupProxy
       
   104 // 
       
   105 // -----------------------------------------------------------------------------
       
   106 // 
       
   107 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
   108 	{
       
   109     IPTVLOGSTRING_LOW_LEVEL("CIptvVodNotifierPlugin::ImplementationGroupProxy");
       
   110 
       
   111 	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ;
       
   112 	return ImplementationTable;
       
   113 	}