creator/inc/creator_wepsecuritysettings.h
changeset 0 d6fe6244b863
equal deleted inserted replaced
-1:000000000000 0:d6fe6244b863
       
     1 /*
       
     2 * Copyright (c) 2008 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 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CREATORWEPSECURITYSETTINGS_H_
       
    21 #define CREATORWEPSECURITYSETTINGS_H_
       
    22 
       
    23 //
       
    24 // Methods copied from WEPSecuritySettingsImpl.h 
       
    25 // (Part of  : WEP Security Settings UI)
       
    26 // @see \s60\mw\networking\networkingutilities\WEPSecuritySettingsUI\inc\WEPSecuritySettingsImpl.h
       
    27 //
       
    28 
       
    29 
       
    30 // INCLUDES
       
    31 
       
    32 //#include "creator_model.h"
       
    33 
       
    34 #include <e32base.h>
       
    35 #include <metadatabase.h>
       
    36 using namespace CommsDat;
       
    37 
       
    38 // FORWARD DECLARATIONS
       
    39 
       
    40 class CCommsDatabase;
       
    41 
       
    42 // Index of first key
       
    43 const TInt KFirstKey = 0;
       
    44 
       
    45 // Index of second key
       
    46 const TInt KSecondKey = 1;
       
    47 
       
    48 // Index of third key
       
    49 const TInt KThirdKey = 2;
       
    50 
       
    51 // Index of fourth key
       
    52 const TInt KFourthKey = 3;
       
    53 
       
    54 const TInt KMaxNumberofKeys = 4;
       
    55 
       
    56 // Number of characters for a 232 bits key
       
    57 const TUint KKeyDataLength232Bits = 58;
       
    58 
       
    59 // The maximum length of key data
       
    60 const TUint KMaxLengthOfKeyData = KKeyDataLength232Bits;
       
    61 
       
    62 
       
    63 
       
    64 
       
    65 class CCreatorWEPSecuritySettings : public CBase
       
    66     {
       
    67 public: 
       
    68     static CCreatorWEPSecuritySettings* NewL();
       
    69     static CCreatorWEPSecuritySettings* NewLC();
       
    70     ~CCreatorWEPSecuritySettings();
       
    71 
       
    72 private:
       
    73     CCreatorWEPSecuritySettings();
       
    74     void ConstructL(); // from MCreatorModuleBase
       
    75 
       
    76 
       
    77 public:
       
    78 /**
       
    79 * Save to database.
       
    80 * @param aIapId Wlan Service Table Id of the IAP to be saved
       
    81 * @param aCommsDb Comms database.
       
    82 */
       
    83 void SaveL( TUint32 aIapId, CCommsDatabase& aCommsDb ) const;
       
    84 
       
    85 public:
       
    86 // Enumeration of the possible keys in use
       
    87 enum TWEPKeyInUse
       
    88     {
       
    89     EKeyNumber1,            // Key number 1
       
    90     EKeyNumber2,            // Key number 2
       
    91     EKeyNumber3,            // Key number 3
       
    92     EKeyNumber4             // Key number 4
       
    93     };
       
    94 
       
    95 
       
    96 // Enumeration of the possible authentication types
       
    97 enum TWEPAuthentication
       
    98     {
       
    99     EAuthOpen,              // Open authentication
       
   100     EAuthShared             // Shared authentication
       
   101     };
       
   102 
       
   103 
       
   104 // Possible lengths of the keys
       
   105 enum TWEPKeyLength
       
   106     {
       
   107     E40Bits,                // 40 bits
       
   108     E104Bits,               // 104 bits
       
   109     E232Bits                // 232 bits
       
   110     };
       
   111 
       
   112 
       
   113 // Possible formats of the keys
       
   114 enum TWEPKeyFormat
       
   115     {
       
   116     EAscii,                 // Ascii format
       
   117     EHexadecimal            // Hex format
       
   118     };
       
   119     
       
   120     
       
   121 
       
   122 private:
       
   123 
       
   124 // Index of the key currently in use (EKeyNumber1, EKeyNumber2, 
       
   125 // EKeyNumber3, EKeyNumber4
       
   126 CCreatorWEPSecuritySettings::TWEPKeyInUse iKeyInUse;
       
   127 
       
   128 // Type of authentication (EAuthOpen, EAuthShared)
       
   129 CCreatorWEPSecuritySettings::TWEPAuthentication iAuthentication;
       
   130 
       
   131 // Length of the key (E40Bits, E104Bits, E232Bits)
       
   132 CCreatorWEPSecuritySettings::TWEPKeyLength iKeyLength[KMaxNumberofKeys];
       
   133 
       
   134 // Format of the key (EAscii, EHexadecimal)
       
   135 CCreatorWEPSecuritySettings::TWEPKeyFormat iKeyFormat[KMaxNumberofKeys];
       
   136 
       
   137 
       
   138     };
       
   139 
       
   140 
       
   141 
       
   142 #endif /*CREATORWEPSECURITYSETTINGS_H_*/