apengine/apsettingshandlerui/src/apsettingsui.cpp
changeset 61 8b0c979bbe8c
parent 59 2709c04a4af5
child 70 ac5daea24fb0
equal deleted inserted replaced
59:2709c04a4af5 61:8b0c979bbe8c
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     Defines the handler, CApSettingsUi and oem API for 
       
    16 *       the Access Point settings.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 #include <ApSettingsHandlerCommons.h>
       
    26 #include "apsettingsui.h"
       
    27 #include "ApsettingshandleruiImpl.h"
       
    28 
       
    29 #include "ApSettingsHandlerLogger.h"
       
    30 #include <data_caging_path_literals.hrh>
       
    31 
       
    32 
       
    33 // ================= MEMBER FUNCTIONS =======================
       
    34 
       
    35 // ---------------------------------------------------------
       
    36 // CApSettingsUi::NewLC
       
    37 // ---------------------------------------------------------
       
    38 //
       
    39 EXPORT_C CApSettingsUi* CApSettingsUi::NewLC(
       
    40                                         TBool aStartWithSelection,
       
    41                                         TSelectionListType aListType,
       
    42                                         TSelectionMenuType aSelMenuType,
       
    43                                         TInt aIspFilter,
       
    44                                         TInt aBearerFilter,
       
    45                                         TInt aSortType,
       
    46                                         TInt aReqIpvType,
       
    47                                         TVpnFilterType aVpnFilterType
       
    48                                             )
       
    49     {
       
    50     APSETUILOGGER_CREATE;
       
    51     APSETUILOGGER_ENTERFN( EAPI,"SettingsUi::NewLC")
       
    52 
       
    53     CApSettingsUi* db = 
       
    54         new( ELeave ) CApSettingsUi( aStartWithSelection,
       
    55                                           aListType,
       
    56                                           aSelMenuType,
       
    57                                           aReqIpvType
       
    58                                           );
       
    59     CleanupStack::PushL( db );
       
    60     
       
    61 
       
    62     db->ConstructL( aIspFilter, aBearerFilter, 
       
    63                     aSortType, aVpnFilterType );
       
    64     APSETUILOGGER_LEAVEFN( EAPI,"SettingsUi::NewLC")    
       
    65     return db;
       
    66     }
       
    67 
       
    68 
       
    69 
       
    70 // Destructor
       
    71 EXPORT_C CApSettingsUi::~CApSettingsUi()
       
    72     {
       
    73     APSETUILOGGER_DELETE;
       
    74 
       
    75     delete iImpl;    
       
    76     }
       
    77 
       
    78 
       
    79 
       
    80 
       
    81 // Constructor
       
    82 CApSettingsUi::CApSettingsUi( TBool aStartWithSelection,
       
    83                             TSelectionListType aListType,
       
    84                             TSelectionMenuType aSelMenuType,
       
    85                             TInt aReqIpvType )
       
    86 :iStartWithSelection( aStartWithSelection ),
       
    87 iListType( aListType ),
       
    88 iSelMenuType( aSelMenuType ),
       
    89 iReqIpvType( aReqIpvType )
       
    90     {
       
    91     }
       
    92 
       
    93 
       
    94 
       
    95 // ---------------------------------------------------------
       
    96 // CApSettingsUi::ConstructL
       
    97 // ---------------------------------------------------------
       
    98 //
       
    99 EXPORT_C void CApSettingsUi::ConstructL( TInt aIspFilter,
       
   100                                          TInt aBearerFilter,
       
   101                                          TInt aSortType,
       
   102                                          TVpnFilterType aVpnFilterType
       
   103                                         )
       
   104     {
       
   105     APSETUILOGGER_ENTERFN( EAPI,"SettingsUi::ConstructL");
       
   106 
       
   107     // must place it to a temp variable, otherwise CodeScanner reports 
       
   108     // it as a bad practice putting up member to Cleanupstack, but 
       
   109     // we have NO NewL so we must use this.
       
   110     CApSettingsHandlerImpl* tmp = CApSettingsHandlerImpl::NewLC( 
       
   111                                      iStartWithSelection,
       
   112                                      iListType, iSelMenuType,
       
   113                                      aIspFilter, aBearerFilter, 
       
   114                                      aSortType, iReqIpvType,
       
   115                                      aVpnFilterType,
       
   116                                      EFalse );
       
   117                                      
       
   118     CleanupStack::Pop( tmp );   // soon will be a member, need to pop
       
   119     iImpl = tmp;
       
   120     
       
   121     APSETUILOGGER_LEAVEFN( EAPI,"SettingsUi::ConstructL")    
       
   122     }
       
   123 
       
   124 
       
   125 
       
   126 // ---------------------------------------------------------
       
   127 // CApSettingsUi::RunSettingsL
       
   128 // ---------------------------------------------------------
       
   129 //
       
   130 EXPORT_C TInt CApSettingsUi::RunSettingsL( TUint32 aHighLight,
       
   131                                                 TUint32& aSelected )
       
   132     {
       
   133     APSETUILOGGER_ENTERFN( EAPI,"SettingsUi::RunSettingsL")
       
   134     __ASSERT_DEBUG( iImpl, Panic( ENullPointer ) );
       
   135 
       
   136     iImpl->RunSettingsL( aHighLight, aSelected );
       
   137     
       
   138     APSETUILOGGER_LEAVEFN( EAPI,"SettingsUi::RunSettingsL")
       
   139     
       
   140     return iImpl->EventStore();
       
   141     }
       
   142 
       
   143 
       
   144 
       
   145 // End of File
       
   146