pkiutilities/CTSecurityDialogs/ecomsrc/CTSecDlgWrapper.cpp
changeset 0 164170e6151a
child 26 aad866c37519
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2005 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:   CTSecDlgWrapper.cpp
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <ecom/implementationproxy.h>
       
    21 #include <AknNotifierWrapper.h> // link against aknnotifierwrapper.lib
       
    22 #include <secdlgimpldefs.h>
       
    23 #include "CTSecurityDialogDefs.h"
       
    24 
       
    25 // CONSTANTS
       
    26 const TInt KMyPriority =  MEikSrvNotifierBase2::ENotifierPriorityAbsolute;
       
    27  
       
    28 // ---------------------------------------------------------
       
    29 // CleanupArray()
       
    30 // ---------------------------------------------------------
       
    31 //
       
    32 void CleanupArray( TAny* aArray )
       
    33     {
       
    34     CArrayPtrFlat<MEikSrvNotifierBase2>* subjects = 
       
    35                 static_cast<CArrayPtrFlat<MEikSrvNotifierBase2>*>( aArray );
       
    36         
       
    37     TInt lastInd = subjects->Count()-1;
       
    38     
       
    39     for ( TInt i = lastInd; i >= 0; i-- )
       
    40         {            
       
    41         subjects->At( i )->Release();	    	    
       
    42         }
       
    43         
       
    44     delete subjects;
       
    45     }
       
    46     
       
    47 // ---------------------------------------------------------
       
    48 // DoCreateNotifierArrayL()
       
    49 // ---------------------------------------------------------
       
    50 //
       
    51 CArrayPtr<MEikSrvNotifierBase2>* DoCreateNotifierArrayL()
       
    52     {
       
    53     CArrayPtrFlat<MEikSrvNotifierBase2>* subjects =
       
    54         new ( ELeave )CArrayPtrFlat<MEikSrvNotifierBase2>( 1 );
       
    55     
       
    56     CleanupStack::PushL( TCleanupItem( CleanupArray, subjects ) );
       
    57 
       
    58     // Create Wrappers
       
    59 
       
    60     // Session owning notifier(if default implementation is enough)
       
    61     CAknCommonNotifierWrapper* master = 
       
    62         CAknCommonNotifierWrapper::NewL( KUidSecurityDialogNotifier,
       
    63                                    KUidSecurityDialogNotifier,
       
    64                                    KMyPriority,
       
    65                                    _L("CTSecDialogImpl.dll"),
       
    66                                    1 ); // we don't use synch reply                               
       
    67 	  	
       
    68     CleanupStack::PushL( master );   
       
    69     subjects->AppendL( master );
       
    70     CleanupStack::Pop( master );
       
    71     
       
    72     CleanupStack::Pop();	// array cleanup
       
    73     return( subjects );
       
    74     }
       
    75 
       
    76 // ---------------------------------------------------------
       
    77 // NotifierArray()
       
    78 // ---------------------------------------------------------
       
    79 //
       
    80 CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
       
    81     // old Lib main entry point
       
    82     {
       
    83     CArrayPtr<MEikSrvNotifierBase2>* array = 0;
       
    84     TRAP_IGNORE( array = DoCreateNotifierArrayL() ); 	
       
    85     return array;
       
    86     }
       
    87 
       
    88 // ---------------------------------------------------------
       
    89 // ImplementationTable
       
    90 // ---------------------------------------------------------
       
    91 //
       
    92 const TImplementationProxy ImplementationTable[] =
       
    93 	{
       
    94 	{{0x101F883C},(TProxyNewLPtr)NotifierArray}
       
    95 	};
       
    96 // ---------------------------------------------------------
       
    97 // ImplementationGroupProxy
       
    98 // entry point
       
    99 // ---------------------------------------------------------
       
   100 //
       
   101 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
   102 	{
       
   103 	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ;
       
   104 	return ImplementationTable;
       
   105 	}
       
   106 
       
   107 // End of File