apengine/apsettingshandlerui/inc/ApSettingsModel.h
changeset 71 9f263f780e41
parent 70 ac5daea24fb0
child 72 0c32cf868819
equal deleted inserted replaced
70:ac5daea24fb0 71:9f263f780e41
     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:  Declaration of class CApSettingsModel.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef APSETTINGS_MODEL_H
       
    20 #define APSETTINGS_MODEL_H
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include <ApDataHandler.h>
       
    24 #include <ApUtils.h>
       
    25 #include <ApSelect.h>
       
    26 
       
    27 #include <ApSettingsHandlerCommons.h>
       
    28 
       
    29 #include <ApProtHandler.h> //for protection of settings
       
    30 
       
    31 
       
    32 // FORWARD DECLARATION
       
    33 class CActiveApDb;
       
    34 class CApListItem;
       
    35 class CApListItemList;
       
    36 class CApAccessPointItem;
       
    37 class CApDataHandler;
       
    38 class CApSelect;
       
    39 class CAknWaitDialog;
       
    40 class CApSettingsDeleteOperation;
       
    41 class CApNetworkItemList;
       
    42 class CFeatureManagerWrapper;
       
    43 class CVpnApEngine;
       
    44 class CEikonEnv;
       
    45 
       
    46 class CWEPSecuritySettings;
       
    47 
       
    48 class CWPASecuritySettings;
       
    49 
       
    50 
       
    51 
       
    52 /**
       
    53 * A structure to hold filtering parameters
       
    54 * First, it is possible to specify which ISP-type we are looking for. 
       
    55 * The possible values are:
       
    56 * <br>
       
    57 * KEApIspTypeInternetOnly:  Filter allows only access points that are 
       
    58 *                           capable of only internet access.
       
    59 * <br>
       
    60 * KEApIspTypeWAPOnly:       Filter allows only access points that are 
       
    61 *                           capable of only WAP access.
       
    62 * <br>
       
    63 * KEApIspTypeInternetAndWAP:Filter allows only access points that are 
       
    64 *                           capable of internet AND WAP access.
       
    65 * <br>
       
    66 * KEApIspTypeWAPMandatory:  Filter allows only access points that are 
       
    67 *                           capable of WAP access AND contain mandatory
       
    68 *                           WAP settings.
       
    69 * <br>
       
    70 * KEApIspTypeAll:           No filtering is done for the isp-type, 
       
    71 *                           all types of access points are shown.
       
    72 * <br>
       
    73 * It is possible to combine them by simply adding/or-ing together the values,
       
    74 * filtering will be done in such a way that only access points with the 
       
    75 * listed ISP-types will be shown.
       
    76 * Second filtering possibility (aBearerFilter) is the desired bearer type.
       
    77 * The possible values are the values of the TApBearerType enum type and their 
       
    78 * combinations, as in case of the ISP type.
       
    79 * The ordering of the list can be specified with the aSortType parameter. 
       
    80 * It can have the following values:
       
    81 * KEApSortUidAscending:     The sorting is done according to the ID 
       
    82 *                           of the access points in ascending order.
       
    83 * KEApSortUidDescending:    The sorting is done according to the ID 
       
    84 *                           of the access points in descending order.
       
    85 * KEApSortNameAscending:    The sorting is done according to the name 
       
    86 *                           of the access points in ascending order.
       
    87 * KEApSortNameDescending:   The sorting is done according to the name 
       
    88 *                           of the access points in descending order.
       
    89 */
       
    90 typedef struct
       
    91     {
       
    92         TInt                iIspFilter;
       
    93         TInt                iBearerFilter;
       
    94         TInt                iSortType;
       
    95     }TApSettingsParams;
       
    96 
       
    97 
       
    98 
       
    99 
       
   100 
       
   101 
       
   102 
       
   103 // CLASS DECLARATION
       
   104 
       
   105 /**
       
   106 * Model for the access point settings ui.
       
   107 */
       
   108 NONSHARABLE_CLASS( CApSettingsModel ) : public CBase
       
   109     {
       
   110     public:     // Construct / destruct
       
   111 
       
   112         /**
       
   113         * Two-phased constructor. Leaves on failure.
       
   114         * The following three parameters specify the filtering and ordering 
       
   115         * criteria for the selection list creation. First, it is possible to 
       
   116         * specify which ISP-type we are looking for. The possible values are:
       
   117         * <br>
       
   118         * KEApIspTypeInternetOnly:  Filter allows only access points that are
       
   119         *                           capable of only internet access.
       
   120         * <br>
       
   121         * KEApIspTypeWAPOnly:       Filter allows only access points that are 
       
   122         *                           capable of only WAP access.
       
   123         * <br>
       
   124         * KEApIspTypeInternetAndWAP:Filter allows only access points that are
       
   125         *                           capable of internet AND WAP access.
       
   126         * <br>
       
   127         * KEApIspTypeWAPMandatory:  Filter allows only access points that are 
       
   128         *                           capable of WAP access AND contain 
       
   129         *                           mandatory WAP settings.
       
   130         * <br>
       
   131         * KEApIspTypeAll:           No filtering is done for the isp-type, all
       
   132         *                           types of access points are shown.
       
   133         * <br>
       
   134         * It is possible to combine them by simply adding/or-ing together the 
       
   135         * values, filtering will be done in such a way that only access points 
       
   136         * with the listed ISP-types will be shown.
       
   137         * Second filtering possibility (aBearerFilter) is the desired bearer 
       
   138         * type. The possible values are the values of the TApBearerType enum 
       
   139         * type and their combinations, as in case of the ISP type.
       
   140         * The ordering of the list can be specified with the aSortType 
       
   141         * parameter. It can have the following values:
       
   142         * KEApSortUidAscending:     The sorting is done according to the ID 
       
   143         *                           of the access points in ascending order.
       
   144         * KEApSortUidDescending:    The sorting is done according to the ID 
       
   145         *                           of the access points in descending order.
       
   146         * KEApSortNameAscending:    The sorting is done according to the name 
       
   147         *                           of the access points in ascending order.
       
   148         * KEApSortNameDescending:   The sorting is done according to the name 
       
   149         *                           of the access points in descending order.
       
   150         * Caution! The ordering values can not be combined!
       
   151         * @param aIspTypeFilter Filtering criteria on ISP type
       
   152         * @param aBearerFilter Filtering criteria on bearer type
       
   153         * @param aSortType Specifies the sort order to use.
       
   154         * @param aReqIpvType Specifies whether the caller would like to 
       
   155         *   have IPv4, IPv6 or both access points. If it is IPv6 or Both, 
       
   156         *   in case of IPv6 support is available as a feature, it will be 
       
   157         *   supported. If IPv6 feature is not supported by the phone, it 
       
   158         *   simply defaults to the normal IPv4 version.
       
   159         *   If it is IPv4, it uses the default IPv4 version independently 
       
   160         *   from IPv6 feature beeing available or not.
       
   161         * @param aVpnFilterType a TVpnFilterType representing the possible 
       
   162         *   additional VPN filtering.
       
   163         * @param aVariant The local variant value
       
   164         * @param aIncludeEasyWlan a TBool indicating whether to include the
       
   165         *   EasyWlan AP in the list or not
       
   166         * @param aNoEdit Gives wether editing is allowed or not
       
   167         * @return The constructed listbox.
       
   168         */
       
   169         static CApSettingsModel* NewL(
       
   170                                       TInt aIspFilter,
       
   171                                       TInt aBearerFilter,
       
   172                                       TInt aSortType,
       
   173                                       TInt aReqIpvType,
       
   174                                       TVpnFilterType aVpnFilterType,
       
   175                                       TInt aVariant,
       
   176                                       TBool aIncludeEasyWlan,
       
   177                                       TBool aNoEdit
       
   178                                      );
       
   179 
       
   180 
       
   181         /**
       
   182         * Two-phased constructor. Leaves on failure.
       
   183         * The following three parameters specify the filtering and ordering 
       
   184         * criteria for the selection list creation. First, it is possible to 
       
   185         * specify which ISP-type we are looking for. The possible values are:
       
   186         * <br>
       
   187         * KEApIspTypeInternetOnly:  Filter allows only access points that are
       
   188         *                           capable of only internet access.
       
   189         * <br>
       
   190         * KEApIspTypeWAPOnly:       Filter allows only access points that are 
       
   191         *                           capable of only WAP access.
       
   192         * <br>
       
   193         * KEApIspTypeInternetAndWAP:Filter allows only access points that are
       
   194         *                           capable of internet AND WAP access.
       
   195         * <br>
       
   196         * KEApIspTypeWAPMandatory:  Filter allows only access points that are 
       
   197         *                           capable of WAP access AND contain 
       
   198         *                           mandatory WAP settings.
       
   199         * <br>
       
   200         * KEApIspTypeAll:           No filtering is done for the isp-type, all
       
   201         *                           types of access points are shown.
       
   202         * <br>
       
   203         * It is possible to combine them by simply adding/or-ing together the 
       
   204         * values, filtering will be done in such a way that only access points 
       
   205         * with the listed ISP-types will be shown.
       
   206         * Second filtering possibility (aBearerFilter) is the desired bearer 
       
   207         * type. The possible values are the values of the TApBearerType enum 
       
   208         * type and their combinations, as in case of the ISP type.
       
   209         * The ordering of the list can be specified with the aSortType 
       
   210         * parameter. It can have the following values:
       
   211         * KEApSortUidAscending:     The sorting is done according to the ID 
       
   212         *                           of the access points in ascending order.
       
   213         * KEApSortUidDescending:    The sorting is done according to the ID 
       
   214         *                           of the access points in descending order.
       
   215         * KEApSortNameAscending:    The sorting is done according to the name 
       
   216         *                           of the access points in ascending order.
       
   217         * KEApSortNameDescending:   The sorting is done according to the name 
       
   218         *                           of the access points in descending order.
       
   219         * Caution! The ordering values can not be combined!
       
   220         * @param aDb The database to work on
       
   221         * @param aIspTypeFilter Filtering criteria on ISP type
       
   222         * @param aBearerFilter Filtering criteria on bearer type
       
   223         * @param aSortType Specifies the sort order to use.
       
   224         * @param aReqIpvType Specifies whether the caller would like to 
       
   225         *   have IPv4, IPv6 or both access points. If it is IPv6 or Both, 
       
   226         *   in case of IPv6 support is available as a feature, it will be 
       
   227         *   supported. If IPv6 feature is not supported by the phone, it 
       
   228         *   simply defaults to the normal IPv4 version.
       
   229         *   If it is IPv4, it uses the default IPv4 version independently 
       
   230         *   from IPv6 feature beeing available or not.
       
   231         * @param aVpnFilterType a TVpnFilterType representing the possible 
       
   232         *   additional VPN filtering.
       
   233         * @param aVariant The local variant value
       
   234         * @param aIncludeEasyWlan a TBool indicating whether to include the
       
   235         *   EasyWlan AP in the list or not
       
   236         * @param aNoEdit Gives wether editing is allowed or not        
       
   237         * @return The constructed listbox model.
       
   238         */
       
   239         static CApSettingsModel* NewL(
       
   240                                       CActiveApDb& aDb,
       
   241                                       TInt aIspFilter,
       
   242                                       TInt aBearerFilter,
       
   243                                       TInt aSortType,
       
   244                                       TInt aReqIpvType,
       
   245                                       TVpnFilterType aVpnFilterType,
       
   246                                       TInt aVariant,
       
   247                                       TBool aIncludeEasyWlan,
       
   248                                       TBool aNoEdit
       
   249                                      );
       
   250 
       
   251         /**
       
   252         * Destructor.
       
   253         */
       
   254         virtual ~CApSettingsModel();
       
   255 
       
   256 
       
   257     protected:
       
   258         /**
       
   259         * Constructor.
       
   260         * @param aIspTypeFilter Filtering criteria on ISP type
       
   261         * @param aBearerFilter Filtering criteria on bearer type
       
   262         * @param aSortType Specifies the sort order to use.
       
   263         * @param aReqIpvType Specifies whether the caller would like to 
       
   264         *   have IPv4, IPv6 or both access points. If it is IPv6 or Both, 
       
   265         *   in case of IPv6 support is available as a feature, it will be 
       
   266         *   supported. If IPv6 feature is not supported by the phone, it 
       
   267         *   simply defaults to the normal IPv4 version.
       
   268         *   If it is IPv4, it uses the default IPv4 version independently 
       
   269         *   from IPv6 feature beeing available or not.
       
   270         * @param aVariant   The variant
       
   271         * @param aVpnFilterType a TVpnFilterType representing the possible 
       
   272         *   additional VPN filtering.
       
   273         * @param aVariant The local variant value
       
   274         * @param aIncludeEasyWlan a TBool indicating whether to include the
       
   275         *   EasyWlan AP in the list or not
       
   276         * @param aNoEdit Gives wether editing is allowed or not
       
   277         */
       
   278         CApSettingsModel(
       
   279                         TInt aIspFilter,
       
   280                         TInt aBearerFilter,
       
   281                         TInt aSortType,
       
   282                         TInt aReqIpvType,
       
   283                         TInt aVariant,
       
   284                         TVpnFilterType aVpnFilterType,
       
   285                         TBool aIncludeEasyWlan,
       
   286                         TBool aNoEdit
       
   287                         );
       
   288 
       
   289 
       
   290         /**
       
   291         * Second phase constructor. Leaves on failure.
       
   292         * @param aDb Database to use if any, NULL otherwise.
       
   293         */
       
   294         virtual void ConstructL( CActiveApDb* aDb );
       
   295 
       
   296 
       
   297     public:
       
   298         /**
       
   299         * Returns the database object
       
   300         */
       
   301         CActiveApDb*     Database();
       
   302 
       
   303 
       
   304         /**
       
   305         * Gets the APs corresponding to the filtering criteria,
       
   306         * already ordered.
       
   307         * @param aFailedLocked a boolean indicating if the operation
       
   308         * had failed because the DB was locked
       
   309         * @param aList a reference to the list of APs.
       
   310         * The passed list will be erased, elements destroyed,
       
   311         * new elements created in it. The list owns the created elements
       
   312         * and the caller maintaines ownership of the list.
       
   313         * @param aIspFilter The isp filter to be used
       
   314         * @param aBearerFilter The bearer filter to be used
       
   315         * @param aSortType The ordering to be used.
       
   316         * @param aReqIpvType Specifies whether the caller would like to 
       
   317         *   have IPv4, IPv6 or both access points. If it is IPv6 or Both, 
       
   318         *   in case of IPv6 support is available as a feature, it will be 
       
   319         *   supported. If IPv6 feature is not supported by the phone, it 
       
   320         *   simply defaults to the normal IPv4 version.
       
   321         *   If it is IPv4, it uses the default IPv4 version independently 
       
   322         *   from IPv6 feature beeing available or not.
       
   323         * @return the number of items in the list.
       
   324         */
       
   325         TInt AllListItemDataL
       
   326                 (
       
   327                 TBool& aFailedLocked,
       
   328                 CApListItemList& aList,
       
   329                 TInt aIspFilter,
       
   330                 TInt aBearerFilter,
       
   331                 TInt aSortType,
       
   332                 TInt aReqIpvType
       
   333                 );
       
   334 
       
   335                 
       
   336         /**
       
   337         * Gets the APs corresponding to the filtering criteria,
       
   338         * already ordered.
       
   339         * @param aFailedLocked a boolean indicating if the operation
       
   340         * had failed because the DB was locked
       
   341         * @param aList a reference to the list of APs.
       
   342         * The passed list will be erased, elements destroyed,
       
   343         * new elements created in it. The list owns the created elements
       
   344         * and the caller maintaines ownership of the list.
       
   345         * @param aIspFilter The isp filter to be used
       
   346         * @param aBearerFilter The bearer filter to be used
       
   347         * @param aSortType The ordering to be used.
       
   348         * @param aReqIpvType Specifies whether the caller would like to 
       
   349         *   have IPv4, IPv6 or both access points. If it is IPv6 or Both, 
       
   350         *   in case of IPv6 support is available as a feature, it will be 
       
   351         *   supported. If IPv6 feature is not supported by the phone, it 
       
   352         *   simply defaults to the normal IPv4 version.
       
   353         *   If it is IPv4, it uses the default IPv4 version independently 
       
   354         *   from IPv6 feature beeing available or not.        
       
   355         * @param aVpnFilterType
       
   356         * @param aIncludeEasyWlan a TBool indicating whether to include the
       
   357         *   EasyWlan AP in the list or not        
       
   358         * @return the number of items in the list.
       
   359         */
       
   360         TInt AllListItemDataL
       
   361                 (
       
   362                 TBool& aFailedLocked,
       
   363                 CApListItemList& aList,
       
   364                 TInt aIspFilter,
       
   365                 TInt aBearerFilter,
       
   366                 TInt aSortType,
       
   367                 TInt aReqIpvType,
       
   368                 TVpnFilterType aVpnFilterType,
       
   369                 TBool aIncludeEasyWlan
       
   370                 );
       
   371 
       
   372 
       
   373         /**
       
   374         * Gets the APs corresponding to the filtering criteria,
       
   375         * already ordered.
       
   376         * @param aFailedLocked a boolean indicating if the operation
       
   377         * had failed because the DB was locked
       
   378         * @param aList a reference to the list of APs.
       
   379         * The passed list will be erased, elements destroyed,
       
   380         * new elements created in it. The list owns the created elements
       
   381         * and the caller maintaines ownership of the list.
       
   382         * @return the number of items in the list.
       
   383         */
       
   384         TInt AllListItemDataL( TBool& aFailedLocked, CApListItemList& aList );
       
   385 
       
   386 
       
   387         /**
       
   388         * Reads up one access point data
       
   389         * @param aUid The UID of the access point to read
       
   390         * @param aApItem A reference to a CApAccessPointItem to hold the
       
   391         * access point item readed from the database
       
   392         */
       
   393         void AccessPointDataL( TUint32 aUid, CApAccessPointItem& aApItem );
       
   394 
       
   395 
       
   396         /**
       
   397         * Updates one access point item in the database
       
   398         * @param aApItem A reference to a CApAccessPointItem holding the
       
   399         * access point item to be updated in the database
       
   400         */
       
   401         TBool UpdateAccessPointDataL( CApAccessPointItem& aApItem );
       
   402 
       
   403 
       
   404         /**
       
   405         * Returns a pointer to the CApDataHandler object
       
   406         */
       
   407         CApDataHandler* DataHandler();
       
   408 
       
   409 
       
   410         /**
       
   411         * Returns a pointer to the CApUtils object
       
   412         */
       
   413         CApUtils*   ApUtils();
       
   414 
       
   415 
       
   416         /**
       
   417         * Sets the filtering parameters for the model
       
   418         * @param aParams The filtering parameters to be used
       
   419         */
       
   420         void SetParams( TApSettingsParams aParams );
       
   421 
       
   422 
       
   423         /**
       
   424         * Gets the filtering parameters of the model
       
   425         * @return The used filtering parameters
       
   426         */
       
   427         TApSettingsParams Params();
       
   428 
       
   429 
       
   430         /**
       
   431         * Returns a pointer to the VPN engine object
       
   432         */
       
   433         CVpnApEngine* VpnEngine();
       
   434 
       
   435 
       
   436         /**
       
   437         * Launches help
       
   438         */
       
   439         void LaunchHelpL();
       
   440 
       
   441         /**
       
   442         * Deletes an access point specified by its UID
       
   443         * @param aUid The UID of the access point to delete.
       
   444         */
       
   445         void RemoveApL( TUint32 aUid );
       
   446 
       
   447 
       
   448         /**
       
   449         * Starts a transaction
       
   450         * @param aWrite A boolean indicating whether read or write lock is
       
   451         * needed.
       
   452         * @param aShowNote A boolean indicating whether to show
       
   453         * 'Cannot access database' note or not if DB is locked
       
   454         * @param aRetry A boolean indicating whether to retry or not
       
   455         * if DB is locked
       
   456         * @param aLFFSChecking Whether low disk space is checked or not
       
   457         * @return TTransactionResult containing whther it is our
       
   458         * own transaction or not or it has failed with KErrLocked
       
   459         */
       
   460         TTransactionResult StartTransactionLC
       
   461                                 (
       
   462                                 TBool aWrite,
       
   463                                 TBool aShowNote = ETrue,
       
   464                                 TBool aRetry = ETrue,
       
   465                                 TBool aLFFSChecking = ETrue
       
   466                                 );
       
   467 
       
   468         /**
       
   469         * Gets write lock on the database
       
   470         */
       
   471         void  GetWriteLockL();
       
   472 
       
   473 
       
   474         /**
       
   475         * Cleanup function for the transaction.
       
   476         * In case of leave, it will be called and
       
   477         * transaction will be rolled back
       
   478         */
       
   479         static void RollbackTransactionOnLeave( TAny* aDb );
       
   480 
       
   481 
       
   482         /**
       
   483         * Commits the transaction on the database
       
   484         */
       
   485         TInt CommitTransaction();
       
   486 
       
   487 
       
   488         /**
       
   489         * Check if Disk space goes below critical level if allocating
       
   490         * more disk space.
       
   491         * @param aShowErrorNote If ETrue, a warning note is shown.
       
   492         * @param aBytesToWrite Amount of disk space to be allocated (use an
       
   493         * estimate if exact amount is not known).
       
   494         * @return ETrue if allocation would go below critical level.
       
   495         */
       
   496         TBool FFSSpaceBelowCriticalLevelL( TBool aShowErrorNote,
       
   497                                            TInt aBytesToWrite /*=0*/ );
       
   498 
       
   499 
       
   500         /**
       
   501         * Gets the network list
       
   502         * @param aFailedLocked a boolean indicating if the operation
       
   503         * had failed because the DB was locked
       
   504         * @param aList a reference to the list of networks.
       
   505         * The passed list will be erased, elements destroyed,
       
   506         * new elements created in it. The list owns the created elements
       
   507         * and the caller must maintaine ownership of the list.
       
   508         * Leaves on error (Database and memory errors)
       
   509         * @return the number of items in the list.
       
   510         */
       
   511         TInt NetWorkListDataL( TBool& aFailedLocked, 
       
   512                                CApNetworkItemList& aList );
       
   513 
       
   514 
       
   515         /**
       
   516         * Returns the model's required IPv type (4, 6 or both, bitfield)
       
   517         */
       
   518         TInt RequestedIPvType();
       
   519 
       
   520 
       
   521         /**
       
   522         * Returns whether the Select menu item should be deleted or not
       
   523         * @param aResourceId The ID of the current menu resource
       
   524         * @param aCount The number of items in the list
       
   525         */
       
   526         TBool Need2DeleteSelect( TInt aResourceId, TInt aCount );
       
   527         
       
   528 
       
   529         /**
       
   530         * Returns whether the Open menu item should be deleted or not
       
   531         * @param aResourceId The ID of the current menu resource
       
   532         * @param aCount The number of items in the list
       
   533         * @param aUid The UID of the current item in the list
       
   534         * @param aNeedsNone Gives whether NONE is displayed as an item or not
       
   535         */
       
   536         TBool Need2DeleteOpen( TInt aResourceId, TInt aCount, 
       
   537                                TUint32 aUid, TBool aNeedsNone );
       
   538 
       
   539 
       
   540         /**
       
   541         * Returns whether the Delete menu item should be deleted or not
       
   542         * @param aResourceId The ID of the current menu resource
       
   543         * @param aCount The number of items in the list
       
   544         * @param aUid The UID of the current item in the list
       
   545         * @param aNeedsNone Gives whether NONE is displayed as an item or not
       
   546         */
       
   547         TBool Need2DeleteDeleteL( TInt aResourceId, TInt aCount, 
       
   548                                   TUint32 aUid, TBool aNeedsNone );
       
   549 
       
   550 
       
   551         /**
       
   552         * Returns tha the New/Use existing menu item should be deleted or not
       
   553         * @param aResourceId The ID of the current menu resource
       
   554         * @param aCount The number of items in the list
       
   555         */
       
   556         TBool Need2DeleteNewUseExisting(  TInt aResourceId, TInt aCount );
       
   557 
       
   558 
       
   559         /**
       
   560         * @param aResourceId The ID of the current menu resource
       
   561         * Returns whether the New menu item should be deleted or not
       
   562         */
       
   563         TBool Need2DeleteNewL(  TInt aResourceId );
       
   564 
       
   565 
       
   566         /**
       
   567         * Returns whether the Help menu item should be deleted or not
       
   568         */
       
   569         TBool Need2DeleteHelp(  TInt aResourceId );
       
   570 
       
   571 
       
   572     protected:
       
   573     
       
   574 
       
   575 
       
   576         
       
   577     public:
       
   578         /**
       
   579         * Returns the name of the first VPN accesspoint with which the access
       
   580         * point with the passed WAP UID is associated.
       
   581         * Name is placed on the CleanupStack if not null.
       
   582         * Should not be called upon VPN access points!!!
       
   583         * @param aUid The WAP UID of the normal access point
       
   584         * @return NULL or a pointer to the name of the associated access point.
       
   585         */
       
   586         HBufC* GetLinkedVpnAccessPointLC( TUint32 aUid );
       
   587 
       
   588         
       
   589         /*
       
   590         * Returns the current EikEnvironment
       
   591         */
       
   592         CEikonEnv* EikEnv();
       
   593 
       
   594 
       
   595 
       
   596         /**
       
   597         * Creates a new access point from the passed item.
       
   598         * @param aApItem A reference to a CApAccessPointItem holding the
       
   599         * access point item to be added to the database
       
   600         * @return The UID of the newly created and saved access point.
       
   601         */
       
   602         TUint32 CreateFromDataL( CApAccessPointItem& aApItem );
       
   603 
       
   604 
       
   605         /**
       
   606         * Handles WEP security settings
       
   607         * Leaves on errors
       
   608         * Return TInt giving exit or shutdown required if any, otherwise, 0
       
   609         */
       
   610         TInt ChangeWepSettingsL( CApAccessPointItem* aApItem );
       
   611 
       
   612 
       
   613         /**
       
   614         * Handles WPA security settings
       
   615         * Leaves on errors
       
   616         * Return TInt giving exit or shutdown required if any, otherwise, 0
       
   617         */
       
   618         TInt ChangeWpaSettingsL( CApAccessPointItem* aApItem );
       
   619 
       
   620 
       
   621         /**
       
   622         * Handles 802.1x security settings
       
   623         * Leaves on errors
       
   624         * Return TInt giving exit or shutdown required if any, otherwise, 0
       
   625         */
       
   626         TInt Change8021xSettingsL( CApAccessPointItem* aApItem );
       
   627 
       
   628         /**
       
   629         * Resets all WEP and WPA settings to NULL, thus forcing their 
       
   630         * re-load
       
   631         */
       
   632         void ClearWEPAndWPASettings();
       
   633 
       
   634         /*
       
   635         * Writes the WLAN settings part
       
   636         */
       
   637         void WriteWlanL( CApAccessPointItem& aApItem, TBool aIsNew );
       
   638 
       
   639 
       
   640         /*
       
   641         * Loads the WLAN settings part
       
   642         */
       
   643         void LoadWlanL( CApAccessPointItem& aApItem );
       
   644 
       
   645         /**
       
   646         * Returns whether the passed item has the security settings
       
   647         * filled correctly or not.
       
   648         */
       
   649         TBool HasWlanSecSettingsFilledL( CApAccessPointItem& aApItem );
       
   650         
       
   651         
       
   652         /**
       
   653         * Update the security mode to reflect current state.
       
   654         * Called after the user changed security settings
       
   655         * @param aApItem The access point item containing the current settings
       
   656         */
       
   657         void UpdateSecurityModeL( CApAccessPointItem& aApItem );
       
   658 
       
   659 
       
   660     private:    // data
       
   661         CActiveApDb*                iDb;
       
   662         CApDataHandler*             iApData;
       
   663         CApUtils*                   iUtils;
       
   664         CApSettingsDeleteOperation* iop;
       
   665         TApSettingsParams           iParams;
       
   666         TBool                       iDbOwned;
       
   667         TInt                        iReqIpvType;
       
   668         TVpnFilterType              iVpnFilterType;
       
   669         CVpnApEngine*               iVpnApEngine;
       
   670         TInt                        iVariant;       /// Local variant value
       
   671         TBool                       iIncludeEasyWlan;
       
   672 
       
   673         CEikonEnv*                  iEikEnv;        /// Eikon environment
       
   674 
       
   675     public:
       
   676         CWEPSecuritySettings*       iWepSecSettings;    ///< WEP settings data
       
   677         TInt                        iWepUiExitReason;   ///< WEP UI exit reason
       
   678 
       
   679         CWPASecuritySettings*       iWpaSecSettings;    ///< WPA settings data
       
   680         TInt                        iWpaUiExitReason;   ///< WPA UI exit reason
       
   681         TBool                       iNoEdit;
       
   682         
       
   683         /**
       
   684         * CFeatureManagerWrapper wraps FeatureManager to eliminate maintenance 
       
   685         * of existance of FeatureManager.
       
   686         * Owned.
       
   687         */
       
   688         CFeatureManagerWrapper*     iFeatureManagerWrapper;
       
   689         
       
   690         TBool                       iInRefresh;
       
   691         TBool                       iNeedRefresh;
       
   692         TBool                       iHelpSupported;
       
   693         TBool                       iProtectionSupported;
       
   694     };
       
   695 
       
   696 
       
   697 #endif
       
   698 
       
   699 // End of file