| author | hgs |
| Thu, 10 Jun 2010 16:12:28 +0300 | |
| changeset 30 | 4d3faa401db5 |
| parent 27 | 9660a5eb236f |
| child 34 | ad1f037f1ac2 |
| permissions | -rw-r--r-- |
|
22
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* Control Panel EAP plugin information |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
* |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
*/ |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
/* |
| 27 | 20 |
* %version: 15 % |
|
22
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
*/ |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
|
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
#include "eapqtpluginhandle.h" |
| 26 | 24 |
#include "eapqtpluginhandle_p.h" |
25 |
||
26 |
struct EapQtPluginHandleMapper |
|
27 |
{
|
|
28 |
EapQtExpandedEapType::Type mType; |
|
29 |
int mUid; |
|
30 |
}; |
|
31 |
||
32 |
static const EapQtPluginHandleMapper handleMapper[EapQtPluginHandle::PluginLast] = {
|
|
33 |
{EapQtExpandedEapType::TypeUndefined, 0x00000000},
|
|
34 |
{EapQtExpandedEapType::TypeEapAka, 0x102073c2},
|
|
35 |
{EapQtExpandedEapType::TypeEapFast, 0x2000BF12},
|
|
36 |
{EapQtExpandedEapType::TypeEapGtc, 0x101f8e80},
|
|
37 |
{EapQtExpandedEapType::TypeLeap, 0x101f8ea7},
|
|
38 |
{EapQtExpandedEapType::TypeEapMschapv2, 0x101f8e67},
|
|
39 |
{EapQtExpandedEapType::TypePeap, 0x101f8e4e},
|
|
40 |
{EapQtExpandedEapType::TypeEapSim, 0x101f8e4b},
|
|
41 |
{EapQtExpandedEapType::TypeEapTls, 0x101f8e4d},
|
|
42 |
{EapQtExpandedEapType::TypeEapTtls, 0x101f8e4f},
|
|
43 |
{EapQtExpandedEapType::TypePap, 0x2001B2F2},
|
|
44 |
{EapQtExpandedEapType::TypePlainMschapv2, 0x101f8e7b}
|
|
45 |
}; |
|
46 |
||
47 |
static const EapQtPluginHandle::Plugin typeMapper[EapQtExpandedEapType::TypeLast] = {
|
|
48 |
EapQtPluginHandle::PluginUndefined, |
|
49 |
EapQtPluginHandle::PluginEapAka, |
|
50 |
EapQtPluginHandle::PluginEapFast, |
|
51 |
EapQtPluginHandle::PluginEapGtc, |
|
52 |
EapQtPluginHandle::PluginLeap, |
|
53 |
EapQtPluginHandle::PluginEapMschapv2, |
|
54 |
EapQtPluginHandle::PluginPeap, |
|
55 |
EapQtPluginHandle::PluginEapSim, |
|
56 |
EapQtPluginHandle::PluginEapTls, |
|
57 |
EapQtPluginHandle::PluginEapTtls, |
|
58 |
EapQtPluginHandle::PluginUndefined, /* no wps plugin */ |
|
59 |
EapQtPluginHandle::PluginPap, |
|
60 |
EapQtPluginHandle::PluginPlainMschapv2 |
|
61 |
}; |
|
|
22
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
|
| 27 | 63 |
|
64 |
||
|
22
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
//---------------------------------------------------------------------------- |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
// EapQtPluginHandle |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
//---------------------------------------------------------------------------- |
| 26 | 68 |
EapQtPluginHandle::EapQtPluginHandle() : |
69 |
d_ptr(new EapQtPluginHandlePrivate(handleMapper[PluginUndefined].mType, |
|
70 |
handleMapper[PluginUndefined].mUid)) |
|
71 |
{
|
|
72 |
} |
|
|
22
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
|
| 26 | 74 |
EapQtPluginHandle::EapQtPluginHandle(Plugin id) : |
75 |
d_ptr(NULL) |
|
76 |
{
|
|
| 27 | 77 |
Plugin localId; |
| 26 | 78 |
if (id < PluginLast) {
|
| 27 | 79 |
localId = id; |
| 26 | 80 |
} |
81 |
else {
|
|
| 27 | 82 |
localId = PluginUndefined; |
| 26 | 83 |
} |
| 27 | 84 |
d_ptr.reset(new EapQtPluginHandlePrivate(handleMapper[localId].mType, |
85 |
handleMapper[localId].mUid)); |
|
| 26 | 86 |
} |
|
22
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
|
| 26 | 88 |
EapQtPluginHandle::EapQtPluginHandle(EapQtExpandedEapType type, int uid) : |
89 |
d_ptr(new EapQtPluginHandlePrivate(type, uid)) |
|
90 |
{
|
|
91 |
} |
|
92 |
||
93 |
EapQtPluginHandle::EapQtPluginHandle(EapQtExpandedEapType type) : |
|
94 |
d_ptr(new EapQtPluginHandlePrivate(type, handleMapper[typeMapper[type.type()]].mUid)) |
|
95 |
{
|
|
96 |
} |
|
97 |
||
98 |
EapQtPluginHandle::EapQtPluginHandle(const EapQtPluginHandle& handle) : |
|
99 |
d_ptr(new EapQtPluginHandlePrivate(handle.type(), handle.protocolImplementationUid())) |
|
|
22
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
100 |
{
|
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
101 |
} |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
102 |
|
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
EapQtPluginHandle::~EapQtPluginHandle() |
|
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
{
|
| 26 | 105 |
// scoped pointer delete |
|
22
093cf0757204
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
} |
| 26 | 107 |
|
108 |
EapQtExpandedEapType EapQtPluginHandle::type() const |
|
109 |
{
|
|
110 |
return d_ptr->mType; |
|
111 |
} |
|
112 |
||
113 |
int EapQtPluginHandle::protocolImplementationUid() const |
|
114 |
{
|
|
115 |
return d_ptr->mProtocolImplementationUid; |
|
116 |
} |
|
117 |
||
118 |
EapQtPluginHandle::Plugin EapQtPluginHandle::pluginId() const |
|
119 |
{
|
|
120 |
return typeMapper[d_ptr->mType.type()]; |
|
121 |
} |
|
122 |
||
123 |
bool EapQtPluginHandle::operator==(const EapQtPluginHandle &other) const |
|
124 |
{
|
|
125 |
return (other.d_ptr->mProtocolImplementationUid == d_ptr->mProtocolImplementationUid) |
|
126 |
&& (other.d_ptr->mType == d_ptr->mType); |
|
127 |
} |
|
128 |
||
129 |
EapQtPluginHandle& EapQtPluginHandle::operator=(const EapQtPluginHandle &handle) |
|
130 |
{
|
|
131 |
// check if assigning to myself |
|
132 |
if (this != &handle) {
|
|
133 |
d_ptr.reset(new EapQtPluginHandlePrivate(handle.type(), handle.protocolImplementationUid())); |
|
134 |
} |
|
135 |
return *this; |
|
136 |
} |
|
137 |