securitysettings/qtconfigutils/eapqtconfiginterface/src/eapqtconfig.cpp
branchRCL_3
changeset 46 c74b3d9f6b9e
parent 45 bad0cc58d154
child 55 9c2aa05919d9
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
     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  *   EAP method QT configuration
       
    16  *
       
    17  */
       
    18 
       
    19 /*
       
    20  * %version: 13 %
       
    21  */
       
    22 
       
    23 // System includes
       
    24 #include <eapqtconfig.h>
       
    25 
       
    26 // User includes
       
    27 #include "eapqtconfig_p.h"
       
    28 
       
    29 /*!
       
    30  *  \class EapQtConfig
       
    31  *  \brief Public implementation of EAP method QT configuration data
       
    32  *         structure for EAP QT configuration interface
       
    33  *
       
    34  * Following lists the applicable settings per EAP method:
       
    35  * 
       
    36  * EAP-SIM, EAP-AKA
       
    37  * - UsernameAutomatic
       
    38  * - Username
       
    39  * - RealmAutomatic
       
    40  * - Realm
       
    41  * - UsePseudonyms
       
    42  * - SessionValidityTime
       
    43  * - OuterType
       
    44  * 
       
    45  * EAP-GTC, LEAP, EAP-MSCHAPv2, Plain-MSCHAPv2, PAP
       
    46  * - Username
       
    47  * - PasswordPrompt
       
    48  * - Password
       
    49  * - PasswordStored
       
    50  * - PasswordClear
       
    51  * - SessionValidityTime
       
    52  * - OuterType
       
    53  * 
       
    54  * EAP-TLS
       
    55  * - UsernameAutomatic
       
    56  * - Username
       
    57  * - RealmAutomatic
       
    58  * - Realm
       
    59  * - VerifyServerRealm
       
    60  * - ClientAuthenticationRequired
       
    61  * - SessionValidityTime
       
    62  * - CipherSuites
       
    63  * - AuthorityCertificateAutomatic
       
    64  * - AuthorityCertificate
       
    65  * - UserCertificate
       
    66  * - OuterType
       
    67  * - UseIdentityPrivacy
       
    68  *
       
    69  * EAP-TTLS
       
    70  * - UsernameAutomatic
       
    71  * - Username
       
    72  * - RealmAutomatic
       
    73  * - Realm
       
    74  * - VerifyServerRealm
       
    75  * - ClientAuthenticationRequired
       
    76  * - SessionValidityTime
       
    77  * - CipherSuites
       
    78  * - AuthorityCertificateAutomatic
       
    79  * - AuthorityCertificate
       
    80  * - UserCertificate
       
    81  * - InnerType
       
    82  * - UseIdentityPrivacy
       
    83  * 
       
    84  * EAP-FAST
       
    85  * - UsernameAutomatic
       
    86  * - Username
       
    87  * - RealmAutomatic
       
    88  * - Realm
       
    89  * - VerifyServerRealm
       
    90  * - ClientAuthenticationRequired
       
    91  * - SessionValidityTime
       
    92  * - CipherSuites
       
    93  * - AuthorityCertificateAutomatic
       
    94  * - AuthorityCertificate
       
    95  * - UserCertificate
       
    96  * - InnerType
       
    97  * - ProvisioningModeAuthenticated
       
    98  * - ProvisioningModeUnauthenticated
       
    99  * - PACGroupReference
       
   100  * - WarnADHPNoPAC
       
   101  * - WarnADHPNoMatchingPAC
       
   102  * - WarnNotDefaultServer
       
   103  * - UseIdentityPrivacy
       
   104  * 
       
   105  * PEAP
       
   106  * - UsernameAutomatic
       
   107  * - Username
       
   108  * - RealmAutomatic
       
   109  * - Realm
       
   110  * - VerifyServerRealm
       
   111  * - ClientAuthenticationRequired
       
   112  * - SessionValidityTime
       
   113  * - CipherSuites
       
   114  * - PeapVersion0Allowed
       
   115  * - PeapVersion1Allowed
       
   116  * - PeapVersion2Allowed
       
   117  * - AuthorityCertificateAutomatic
       
   118  * - AuthorityCertificate
       
   119  * - UserCertificate
       
   120  * - InnerType
       
   121  * - UseIdentityPrivacy
       
   122  */
       
   123 
       
   124 // External function prototypes
       
   125 
       
   126 // Local constants
       
   127 
       
   128 // ======== LOCAL FUNCTIONS ========
       
   129 
       
   130 // ======== MEMBER FUNCTIONS ========
       
   131 
       
   132 EapQtConfig::EapQtConfig() :
       
   133     d_ptr(new EapQtConfigPrivate)
       
   134 {
       
   135 }
       
   136 
       
   137 EapQtConfig::~EapQtConfig()
       
   138 {
       
   139     // scoped pointer deleted automatically
       
   140 }
       
   141 
       
   142 QVariant EapQtConfig::value(const SettingsId id) const
       
   143 {
       
   144     // check for valid range, otherwise memory is consumed for no reason
       
   145     if (id >= SettingsIdLast) {
       
   146         qDebug("ERROR: EapQtConfig::value - invalid id!");
       
   147         return QVariant::Invalid;
       
   148     }
       
   149     return d_ptr->mSettings[id];
       
   150 }
       
   151 
       
   152 void EapQtConfig::setValue(const SettingsId id, const QVariant &newValue) const
       
   153 {
       
   154     // check for valid range, otherwise memory is consumed for no reason
       
   155     if (id < SettingsIdLast) {
       
   156         d_ptr->mSettings[id] = newValue;
       
   157     }
       
   158     else {
       
   159         qDebug("ERROR: EapQtConfig::setValue - invalid id!");
       
   160     }
       
   161 }
       
   162 
       
   163 void EapQtConfig::clear() const
       
   164 {
       
   165     d_ptr->mSettings.clear();
       
   166 }