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