wlansecuritysettings/wlaneapsettingsui/eapnotifwrapper/src/eapnotifwrapper.cpp
changeset 0 c8830336c852
child 2 1c7bc153c08e
equal deleted inserted replaced
-1:000000000000 0:c8830336c852
       
     1 /*
       
     2 * Copyright (c) 2001-2009 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: Implementation of ecom plugin
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "eapnotifierdialoguiddefs.h"
       
    21 
       
    22 #include <ecom/implementationproxy.h>
       
    23 #include <AknNotifierWrapper.h> // link against aknnotifierwrapper.lib
       
    24 
       
    25 
       
    26 // CONSTANTS
       
    27 const TInt KMyPriority =  MEikSrvNotifierBase2::ENotifierPriorityLow;
       
    28 const TInt KArrayGranularity = 4;
       
    29  
       
    30 
       
    31 // ---------------------------------------------------------
       
    32 // CleanupArray()
       
    33 // ---------------------------------------------------------
       
    34 //
       
    35 void CleanupArray( TAny* aArray )
       
    36     {
       
    37     CArrayPtrFlat<MEikSrvNotifierBase2>*     
       
    38         subjects = static_cast<CArrayPtrFlat<MEikSrvNotifierBase2>*>( aArray );
       
    39     TInt lastInd = subjects->Count()-1;
       
    40     for ( TInt i = lastInd; i >= 0; i-- )
       
    41         {
       
    42         subjects->At( i )->Release();
       
    43         }
       
    44 
       
    45     delete subjects;
       
    46     }
       
    47     
       
    48     
       
    49 // ---------------------------------------------------------
       
    50 // DoCreateNotifierArrayL()
       
    51 // ---------------------------------------------------------
       
    52 //
       
    53 CArrayPtr<MEikSrvNotifierBase2>* DoCreateNotifierArrayL()
       
    54     {
       
    55     CArrayPtrFlat<MEikSrvNotifierBase2>* subjects =
       
    56         new ( ELeave )CArrayPtrFlat<MEikSrvNotifierBase2>( KArrayGranularity );
       
    57     
       
    58     CleanupStack::PushL( TCleanupItem( CleanupArray, subjects ) );
       
    59 
       
    60     // Create Wrappers
       
    61     CAknCommonNotifierWrapper* master = NULL;
       
    62 
       
    63     // EAP-MSCHAPv2
       
    64     _LIT( KMsChapv2NotifierPluginName, "mschapv2notifdlg.dll" );
       
    65     master = CAknCommonNotifierWrapper::NewL( KUidMsChapv2Dialog,
       
    66                                               KUidMsChapv2Dialog,
       
    67                                               KMyPriority,
       
    68                                               KMsChapv2NotifierPluginName,
       
    69                                               1 );
       
    70 
       
    71     CleanupStack::PushL( master );   
       
    72     subjects->AppendL( master );
       
    73     CleanupStack::Pop( master );
       
    74 
       
    75 
       
    76 
       
    77     // EAP-GTC
       
    78     _LIT( KGtcNotifierPluginName, "gtcnotifdlg.dll" );
       
    79 
       
    80     // Session owning notifier(if default implementation is enough)
       
    81     master = CAknCommonNotifierWrapper::NewL( KUidGtcDialog,
       
    82                                          KUidGtcDialog,
       
    83                                          KMyPriority,
       
    84                                          KGtcNotifierPluginName,
       
    85                                          1 ); // we don't use synch reply
       
    86 
       
    87     CleanupStack::PushL( master );   
       
    88     subjects->AppendL( master );
       
    89     CleanupStack::Pop( master );
       
    90 
       
    91   
       
    92     // PAP
       
    93     _LIT( KPapNotifierPluginName, "papnotifdlg.dll" );
       
    94     master = CAknCommonNotifierWrapper::NewL( KUidPapDialog,
       
    95                                               KUidPapDialog,
       
    96                                               KMyPriority,
       
    97                                               KPapNotifierPluginName,
       
    98                                               1 );
       
    99                                               
       
   100     CleanupStack::PushL( master );   
       
   101     subjects->AppendL( master );
       
   102     CleanupStack::Pop( master );
       
   103                                                 
       
   104 
       
   105 
       
   106 #ifdef FF_WLAN_EXTENSIONS
       
   107     
       
   108     // EAP-LEAP
       
   109     _LIT( KLeapNotifierPluginName, "leapnotifdlg.dll" );
       
   110     master = CAknCommonNotifierWrapper::NewL( KUidLeapDialog,
       
   111                                               KUidLeapDialog,
       
   112                                               KMyPriority,
       
   113                                               KLeapNotifierPluginName,
       
   114                                               1 );
       
   115 
       
   116     CleanupStack::PushL( master );   
       
   117     subjects->AppendL( master );
       
   118     CleanupStack::Pop( master );
       
   119 
       
   120 #endif
       
   121                                             
       
   122     CleanupStack::Pop();    // array cleanup
       
   123     
       
   124     return subjects;
       
   125     }
       
   126 
       
   127 
       
   128 // ---------------------------------------------------------
       
   129 // NotifierArray()
       
   130 // ---------------------------------------------------------
       
   131 //
       
   132 CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
       
   133     // old Lib main entry point
       
   134     {
       
   135     CArrayPtr<MEikSrvNotifierBase2>* array = 0;
       
   136     TRAP_IGNORE( array = DoCreateNotifierArrayL() );
       
   137     return array;
       
   138     }
       
   139 
       
   140 
       
   141 // ---------------------------------------------------------
       
   142 // ImplementationTable
       
   143 // ---------------------------------------------------------
       
   144 //
       
   145 const TImplementationProxy ImplementationTable[] =
       
   146     {
       
   147 #ifdef __EABI__
       
   148     {{0x2000cf2f}, ( TFuncPtr )NotifierArray}
       
   149 #else
       
   150     {{0x2000cf2f}, NotifierArray}
       
   151 #endif
       
   152     };
       
   153 
       
   154 // ---------------------------------------------------------
       
   155 // ImplementationGroupProxy
       
   156 // entry point
       
   157 // ---------------------------------------------------------
       
   158 //
       
   159 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
       
   160                                                             TInt& aTableCount )
       
   161     {
       
   162     aTableCount = sizeof( ImplementationTable ) / 
       
   163                   sizeof( TImplementationProxy ) ;
       
   164     return ImplementationTable;
       
   165     }
       
   166 
       
   167 
       
   168 // End of File