26
|
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 the License "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 configuration QT interface
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
/*
|
27
|
20 |
* %version: 2 %
|
26
|
21 |
*/
|
|
22 |
|
|
23 |
#ifndef EAPQTCONFIGINTERFACE_H
|
|
24 |
#define EAPQTCONFIGINTERFACE_H
|
|
25 |
|
|
26 |
#include <qglobal.h>
|
|
27 |
#include <eapqtconfig.h>
|
27
|
28 |
#include <eapqtconfigdefs.h>
|
26
|
29 |
|
|
30 |
/*!
|
|
31 |
* @addtogroup group_eap_config_api
|
|
32 |
* @{
|
|
33 |
*/
|
|
34 |
|
|
35 |
class CpBaseSettingView;
|
|
36 |
class EapQtValidator;
|
|
37 |
class EapQtPluginInfo;
|
|
38 |
class EapQtPluginHandle;
|
|
39 |
class EapQtExpandedEapType;
|
|
40 |
class EapQtCertificateInfo;
|
|
41 |
class EapQtConfigInterfacePrivate;
|
|
42 |
/*!
|
|
43 |
*/
|
|
44 |
class EAP_QT_CONFIG_INTERFACE_EXPORT EapQtConfigInterface
|
|
45 |
{
|
|
46 |
public:
|
|
47 |
|
|
48 |
enum EapBearerType
|
|
49 |
{
|
|
50 |
// EAP configuration interface for WLAN
|
|
51 |
EapBearerTypeWlan,
|
|
52 |
// EAP configuration interface for VPN
|
|
53 |
EapBearerTypeVpn,
|
|
54 |
};
|
|
55 |
|
27
|
56 |
static const int IapIdUndefined = -1;
|
26
|
57 |
|
|
58 |
public:
|
|
59 |
|
|
60 |
// the default constuctor can only be used for validators,
|
|
61 |
// any other call throws an exeption;
|
|
62 |
// throws an exception if the contruction fails
|
|
63 |
EapQtConfigInterface();
|
|
64 |
|
|
65 |
EapQtValidator *validatorEap(EapQtExpandedEapType type, EapQtConfig::SettingsId id);
|
|
66 |
|
|
67 |
// this is the constructor for using the interface for all
|
|
68 |
// available operations, including validators;
|
|
69 |
// throws an exeption if the contruction fails;
|
|
70 |
// the parameter iapId is the IAP ID;
|
|
71 |
// if iapId is negative, only a limited set of methods are availble and
|
|
72 |
// setConfigurationReference must be later called to set the correct IAP ID
|
|
73 |
EapQtConfigInterface(const EapBearerType bearerType, const int iapId);
|
|
74 |
|
|
75 |
~EapQtConfigInterface();
|
|
76 |
|
|
77 |
// if iapId was IAP_ID_UNDEFINED (or negative) in the constructor, this method
|
|
78 |
// must be called before calling the following methods
|
|
79 |
bool setConfigurationReference(const int iapId) const;
|
|
80 |
|
|
81 |
/**
|
|
82 |
* all the following methods throw an exception if the instance
|
|
83 |
* was created with the default constructor;
|
|
84 |
* otherwise the return value is as defined
|
|
85 |
*/
|
|
86 |
|
|
87 |
// returns empty list on failure
|
|
88 |
QList<EapQtPluginInfo> supportedOuterTypes() const;
|
|
89 |
// returns empty list on failure
|
|
90 |
QList<EapQtPluginInfo> supportedInnerTypes(const EapQtPluginHandle outerType) const;
|
|
91 |
|
|
92 |
// returns empty list on failure
|
|
93 |
QList<EapQtCertificateInfo> certificateAuthorityCertificates() const;
|
|
94 |
// returns empty list on failure
|
|
95 |
QList<EapQtCertificateInfo> userCertificates() const;
|
|
96 |
|
|
97 |
// returns null on failure
|
|
98 |
CpBaseSettingView *uiInstance(const EapQtPluginHandle& outerHandle,
|
|
99 |
const EapQtPluginHandle& pluginHandle) const;
|
|
100 |
|
|
101 |
// returns empty list on failure
|
|
102 |
QList<EapQtPluginHandle> selectedOuterTypes() const;
|
|
103 |
|
|
104 |
// returns true if supported, false otherwise
|
|
105 |
bool isSupportedOuterType(const EapQtPluginHandle& handle) const;
|
|
106 |
bool isSupportedInnerType(const EapQtPluginHandle& outerHandle,
|
|
107 |
const EapQtPluginHandle& innerHandle) const;
|
|
108 |
|
|
109 |
/**
|
|
110 |
* all the following methods throw an exception if the instance
|
|
111 |
* was created with the default constructor;
|
|
112 |
* otherwise the methods return true on success and false on failure
|
|
113 |
*/
|
|
114 |
|
|
115 |
bool setSelectedOuterTypes(const QList<EapQtPluginHandle>& outerHandles) const;
|
|
116 |
|
|
117 |
bool readConfiguration(const EapQtPluginHandle& outerHandle,
|
|
118 |
const EapQtPluginHandle& pluginHandle, EapQtConfig &config) const;
|
|
119 |
bool saveConfiguration(const EapQtPluginHandle& pluginHandle, EapQtConfig &config) const;
|
|
120 |
bool deleteConfiguration() const;
|
|
121 |
|
|
122 |
private:
|
|
123 |
Q_DISABLE_COPY(EapQtConfigInterface)
|
|
124 |
QScopedPointer<EapQtConfigInterfacePrivate> d_ptr;
|
|
125 |
};
|
|
126 |
|
|
127 |
/*! @} */
|
|
128 |
|
|
129 |
#endif
|
|
130 |
|