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