wlanutilities/wlanwizard/t_wlanwizard/stubs/eapqtpacstoreconfig.h
changeset 53 bdc64aa9b954
parent 49 fb81b597edf1
child 60 822a45792fdd
equal deleted inserted replaced
49:fb81b597edf1 53:bdc64aa9b954
     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-FAST PAC store configuration data
       
    16  *
       
    17  */
       
    18 
       
    19 /*
       
    20  * %version: 2 %
       
    21  */
       
    22 
       
    23 #ifndef EAPQTPACSTORECONFIG_H
       
    24 #define EAPQTPACSTORECONFIG_H
       
    25 
       
    26 #include <QVariant>
       
    27 
       
    28 class EapQtPacStoreConfig
       
    29 {
       
    30 public:
       
    31 
       
    32     // PAC store is global, i.e. only a single PAC store exists in a device
       
    33 
       
    34     enum PacStoreState
       
    35     {
       
    36         // PAC store does not exist and needs to be created
       
    37         PacStoreStateStoreNotExists = 0,
       
    38         // PAC store exists but the password has not been stored and
       
    39         // is needed to access the PAC store
       
    40         PacStoreStatePasswordRequired,
       
    41         // PAC store password has been stored to settings database
       
    42         // and is not needed to use the PAC store
       
    43         PacStoreStatePasswordStored,
       
    44         // TODO: remove? delete automatically if corrupted
       
    45         // Existing PAC store is corrupted and should be reset
       
    46         PacStoreStateCorrupted,
       
    47         // marker for the last item
       
    48         PacStoreStateLast
       
    49     };
       
    50 
       
    51     enum PacStoreSettings
       
    52     {
       
    53         /*! write-only: QString
       
    54          *      password to be used for accessing the PAC store
       
    55          *      - must be new password if the read PacStoreState is PacStoreStateStoreNotExists
       
    56          *      - must be password of the existing PAC store if the PacStoreState state is
       
    57          *        PacStoreStatePasswordRequired */
       
    58         PacStorePassword = 0,
       
    59         /*! write-only: bool
       
    60          *      true: saves the password given in settings
       
    61          *      false: clears the earlier stored password from database, i.e. password
       
    62          *        will be prompted when needed, PAC store itself remains valid
       
    63          *      QVariant::Invalid: no actions */
       
    64         PacStoreSavePassword,
       
    65         /*! write-only: bool
       
    66          *      true: deletes PAC store, i.e. clears everything related to the
       
    67          *        existing PAC store inlcuding saved password
       
    68          *      false/QVariant::Invalid: no actions */
       
    69         PacStoreReset,
       
    70         /*! read-only: int (PacStoreState) */
       
    71         PacStoreState,
       
    72         /*! no write nor read operation, for validator usage only
       
    73          *  - uses the validator to check if the given password
       
    74          *      can open the existing PAC store */
       
    75         PacStorePasswordConfirmation,
       
    76         // marker for the last item
       
    77         PacStoreLast
       
    78     };
       
    79 
       
    80 public:
       
    81     EapQtPacStoreConfig();
       
    82     ~EapQtPacStoreConfig();
       
    83 
       
    84     QVariant value(PacStoreSettings id);
       
    85     void setValue(PacStoreSettings id, QVariant newValue);
       
    86     void clear();
       
    87 
       
    88 public: // FOR TESTING PURPOSE
       
    89     bool operator==(const EapQtPacStoreConfig & rhs ) const;
       
    90     bool operator=(const EapQtPacStoreConfig & rhs );
       
    91     
       
    92 private:
       
    93     QHash <int, QVariant> mPacStoreSettings;
       
    94 };
       
    95 
       
    96 #endif /* EAPQTPACSTORECONFIG_H */