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: For EAP Wizard testing |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef EAPQTPACSTORECONFIG_H |
|
20 #define EAPQTPACSTORECONFIG_H |
|
21 |
|
22 // System includes |
|
23 #include <QVariant> |
|
24 |
|
25 // User includes |
|
26 |
|
27 // Forward declarations |
|
28 |
|
29 // External data types |
|
30 |
|
31 // Constants |
|
32 |
|
33 // Class declaration |
|
34 |
|
35 class EapQtPacStoreConfig |
|
36 { |
|
37 public: |
|
38 |
|
39 // PAC store is global, i.e. only a single PAC store exists in a device |
|
40 |
|
41 // Data types |
|
42 |
|
43 enum PacStoreStatus |
|
44 { |
|
45 // PAC store does not exist and needs to be created |
|
46 // (status also reverts to PacStoreStateStoreNotExists if the PAC store is |
|
47 // corrupted, i.e. it gets deleted automatically) |
|
48 PacStoreStateStoreNotExists = 0, |
|
49 // PAC store exists but the password has not been stored and |
|
50 // is needed to access the PAC store |
|
51 PacStoreStatePasswordRequired, |
|
52 // PAC store password has been stored to settings database |
|
53 // and is not needed to use the PAC store |
|
54 PacStoreStatePasswordStored, |
|
55 // marker for the last item |
|
56 PacStoreStateLast |
|
57 }; |
|
58 |
|
59 enum PacStoreSettings |
|
60 { |
|
61 /*! write-only: QString |
|
62 * password to be used for accessing the PAC store |
|
63 * - must be new password if the read PacStoreState is PacStoreStateStoreNotExists |
|
64 * - must be password of the existing PAC store if the PacStoreState state is |
|
65 * PacStoreStatePasswordRequired */ |
|
66 PacStorePassword = 0, |
|
67 /*! write-only: bool |
|
68 * true: saves the password given in settings |
|
69 * false: clears the earlier stored password from database, i.e. password |
|
70 * will be prompted when needed, PAC store itself remains valid |
|
71 * QVariant::Invalid: no actions */ |
|
72 PacStoreSavePassword, |
|
73 /*! write-only: bool |
|
74 * true: deletes PAC store, i.e. clears everything related to the |
|
75 * existing PAC store including saved password |
|
76 * false/QVariant::Invalid: no actions */ |
|
77 PacStoreReset, |
|
78 /*! read-only: int (PacStoreStatus) */ |
|
79 PacStoreState, |
|
80 /*! no write nor read operation, for validator usage only |
|
81 * - uses the validator to check if the given password |
|
82 * can open the existing PAC store */ |
|
83 PacStorePasswordConfirmation, |
|
84 // marker for the last item |
|
85 PacStoreLast |
|
86 }; |
|
87 |
|
88 public: |
|
89 EapQtPacStoreConfig(); |
|
90 ~EapQtPacStoreConfig(); |
|
91 |
|
92 // gets the configuration field referred to by an id from PacStoreSettings |
|
93 // returns QVariant::Invalid is the field has not been set |
|
94 QVariant value(const PacStoreSettings id) const; |
|
95 |
|
96 // sets the configuration field referred to by an id from PacStoreSettings |
|
97 // does nothing if newValue >= PacStoreLast |
|
98 void setValue(const PacStoreSettings id, const QVariant &newValue); |
|
99 |
|
100 // resets the object i.e. any successive call to |
|
101 // value() returns QVariant::Invalid |
|
102 void clear(); |
|
103 |
|
104 public: // FOR TESTING PURPOSE |
|
105 bool operator==(const EapQtPacStoreConfig & rhs ) const; |
|
106 bool operator=(const EapQtPacStoreConfig & rhs ); |
|
107 |
|
108 private: |
|
109 QHash <int, QVariant> mPacStoreSettings; |
|
110 }; |
|
111 |
|
112 #endif /* EAPQTPACSTORECONFIG_H */ |
|