connectionutilities/ConnectionDialogs/ecomsrc/connectiondialogswrapper.cpp
changeset 61 8b0c979bbe8c
parent 59 2709c04a4af5
child 70 ac5daea24fb0
equal deleted inserted replaced
59:2709c04a4af5 61:8b0c979bbe8c
     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:  Implementation of ecom plugin
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "ConnectionDialogsUidDefs.h"
       
    21 #include "ConnectionDialogsLogger.h"
       
    22 
       
    23 #include <ecom/implementationproxy.h>
       
    24 #include <AknNotifierWrapper.h> // link against aknnotifierwrapper.lib
       
    25 
       
    26 
       
    27 // CONSTANTS
       
    28 const TInt KMyPriority =  MEikSrvNotifierBase2::ENotifierPriorityLow;
       
    29 const TInt KArrayGranularity = 5;
       
    30  
       
    31 
       
    32 // ---------------------------------------------------------
       
    33 // CleanupArray()
       
    34 // ---------------------------------------------------------
       
    35 //
       
    36 void CleanupArray( TAny* aArray )
       
    37     {
       
    38     CArrayPtrFlat<MEikSrvNotifierBase2>*     
       
    39         subjects = static_cast<CArrayPtrFlat<MEikSrvNotifierBase2>*>( aArray );
       
    40     TInt lastInd = subjects->Count()-1;
       
    41     for ( TInt i = lastInd; i >= 0; i-- )
       
    42         {
       
    43         subjects->At( i )->Release();
       
    44         }
       
    45 
       
    46     delete subjects;
       
    47     }
       
    48     
       
    49 // ---------------------------------------------------------
       
    50 // DoCreateNotifierArrayL()
       
    51 // ---------------------------------------------------------
       
    52 //
       
    53 CArrayPtr<MEikSrvNotifierBase2>* DoCreateNotifierArrayL()
       
    54     {
       
    55     CLOG_CREATE;
       
    56     CArrayPtrFlat<MEikSrvNotifierBase2>* subjects =
       
    57         new ( ELeave )CArrayPtrFlat<MEikSrvNotifierBase2>( KArrayGranularity );
       
    58     
       
    59     CleanupStack::PushL( TCleanupItem( CleanupArray, subjects ) );
       
    60 
       
    61     // Create Wrappers
       
    62 
       
    63     _LIT( KCConnDlgPluginName, "CCONNDLGPLUGIN.DLL" );
       
    64     _LIT( KDisconnectDlgName, "DISCONNECTDLG.DLL" );
       
    65     _LIT( KConnUiUtilsNotifName, "ConnUiUtilsNotif.DLL" );
       
    66 
       
    67     // Session owning notifier(if default implementation is enough)
       
    68     CAknCommonNotifierWrapper* master = 
       
    69         CAknCommonNotifierWrapper::NewL( KUidCConnDlgIap,
       
    70                                          KUidCConnDlgIap,
       
    71                                          KMyPriority,
       
    72                                          KCConnDlgPluginName,
       
    73                                          1 ); // we don't use synch reply
       
    74 
       
    75     CleanupStack::PushL( master );   
       
    76     subjects->AppendL( master );
       
    77     CleanupStack::Pop( master );
       
    78 
       
    79     subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master,
       
    80                                             KUidCConnDlgNewIap,
       
    81                                             KUidCConnDlgNewIap,
       
    82                                             KMyPriority ) );
       
    83 
       
    84     subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master,
       
    85                                             KUidCConnDlgAuthentication,
       
    86                                             KUidCConnDlgAuthentication,
       
    87                                             KMyPriority ) );
       
    88                                    
       
    89     subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master,
       
    90                                             KUidCConnDlgReconnect,
       
    91                                             KUidCConnDlgReconnect,
       
    92                                             KMyPriority ) );
       
    93 
       
    94     subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master,
       
    95                                             KUidCConnDlgQos,
       
    96                                             KUidCConnDlgQos,
       
    97                                             KMyPriority ) );
       
    98 
       
    99     subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master,
       
   100                                             KUidCConnDlgSelectConn,
       
   101                                             KUidCConnDlgSelectConn,
       
   102                                             KMyPriority ) );
       
   103 
       
   104     // Disconnect dialog
       
   105     subjects->AppendL( CAknCommonNotifierWrapper::NewL( KUidDisconnectDlg,
       
   106                                                         KUidDisconnectDlg,
       
   107                                                         KMyPriority,
       
   108                                                         KDisconnectDlgName,
       
   109                                                         1 ) );
       
   110 
       
   111     // WLAN wrappers
       
   112     master = CAknCommonNotifierWrapper::NewL( KUidSelectWLanDlg,
       
   113                                               KUidSelectWLanDlg,
       
   114                                               KMyPriority,
       
   115                                               KConnUiUtilsNotifName,
       
   116                                               1 );
       
   117     
       
   118     CleanupStack::PushL( master );   
       
   119     subjects->AppendL( master );
       
   120     CleanupStack::Pop( master );
       
   121 
       
   122 
       
   123     subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master,
       
   124                                             KUidCOfflineWlanNoteDlg,
       
   125                                             KUidCOfflineWlanNoteDlg,
       
   126                                             KMyPriority ) );
       
   127     
       
   128     subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master,
       
   129                                             KUidCOfflineWlanDisabledNoteDlg,
       
   130                                             KUidCOfflineWlanDisabledNoteDlg,
       
   131                                             KMyPriority ) );
       
   132 
       
   133     subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master,
       
   134                                             KUidEasyWepDlg,
       
   135                                             KUidEasyWepDlg,
       
   136                                             KMyPriority ) );
       
   137 
       
   138     subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master,
       
   139                                             KUidEasyWpaDlg,
       
   140                                             KUidEasyWpaDlg,
       
   141                                             KMyPriority ) );
       
   142     
       
   143     subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master,
       
   144                                             KUidWLANNetworkUnavailableNoteDlg,
       
   145                                             KUidWLANNetworkUnavailableNoteDlg,
       
   146                                             KMyPriority ) );
       
   147                                             
       
   148     // ALR WRAPPERS
       
   149                                             
       
   150     subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master,
       
   151                                                         KUidConfirmationQuery,
       
   152                                                         KUidConfirmationQuery,
       
   153                                                         KMyPriority ) );
       
   154                                             
       
   155     subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master,
       
   156                                                         KUidConnectViaNote,
       
   157                                                         KUidConnectViaNote,
       
   158                                                         KMyPriority ) );
       
   159                                                         
       
   160     // WLAN wrappers
       
   161                                                         
       
   162     subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master,
       
   163                                             KUidWlanPowerSaveTestNote,
       
   164                                             KUidWlanPowerSaveTestNote,
       
   165                                             KMyPriority ) );
       
   166                                             
       
   167     subjects->AppendL( new( ELeave ) CAknNotifierWrapperLight( *master,
       
   168                                             KUidEasyWapiDlg,
       
   169                                             KUidEasyWapiDlg,
       
   170                                             KMyPriority ) );
       
   171 
       
   172     CleanupStack::Pop();    // array cleanup
       
   173     return( subjects );
       
   174     }
       
   175 
       
   176 // ---------------------------------------------------------
       
   177 // NotifierArray()
       
   178 // ---------------------------------------------------------
       
   179 //
       
   180 CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
       
   181     // old Lib main entry point
       
   182     {
       
   183     CArrayPtr<MEikSrvNotifierBase2>* array = 0;
       
   184     TRAP_IGNORE( array = DoCreateNotifierArrayL() );
       
   185     return array;
       
   186     }
       
   187 
       
   188 // ---------------------------------------------------------
       
   189 // ImplementationTable
       
   190 // ---------------------------------------------------------
       
   191 //
       
   192 const TImplementationProxy ImplementationTable[] =
       
   193     {
       
   194 #ifdef __EABI__
       
   195     {{0x10207375}, ( TFuncPtr )NotifierArray}
       
   196 #else
       
   197     {{0x10207375}, NotifierArray}
       
   198 #endif
       
   199     };
       
   200 
       
   201 // ---------------------------------------------------------
       
   202 // ImplementationGroupProxy
       
   203 // entry point
       
   204 // ---------------------------------------------------------
       
   205 //
       
   206 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( 
       
   207                                                             TInt& aTableCount )
       
   208     {
       
   209     aTableCount = sizeof( ImplementationTable ) / 
       
   210                   sizeof( TImplementationProxy ) ;
       
   211     return ImplementationTable;
       
   212     }
       
   213 
       
   214 
       
   215 // End of File