|
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: Security module model in advanced security settings |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "advsecsettingssecuritymodulemodel.h" |
|
19 |
|
20 #if defined(Q_OS_SYMBIAN) |
|
21 #include "advsecsettingssecuritymodulemodel_symbian_p.h" |
|
22 #else |
|
23 #include "advsecsettingssecuritymodulemodel_stub_p.h" |
|
24 #endif |
|
25 |
|
26 |
|
27 // ======== MEMBER FUNCTIONS ======== |
|
28 |
|
29 // --------------------------------------------------------------------------- |
|
30 // AdvSecSettingsSecurityModuleModel::AdvSecSettingsSecurityModuleModel() |
|
31 // --------------------------------------------------------------------------- |
|
32 // |
|
33 AdvSecSettingsSecurityModuleModel::AdvSecSettingsSecurityModuleModel( |
|
34 QObject *parent) : QObject(parent) |
|
35 { |
|
36 d_ptr = new AdvSecSettingsSecurityModuleModelPrivate(this); |
|
37 } |
|
38 |
|
39 // --------------------------------------------------------------------------- |
|
40 // AdvSecSettingsSecurityModuleModel::~AdvSecSettingsSecurityModuleModel() |
|
41 // --------------------------------------------------------------------------- |
|
42 // |
|
43 AdvSecSettingsSecurityModuleModel::~AdvSecSettingsSecurityModuleModel() |
|
44 { |
|
45 delete d_ptr; |
|
46 d_ptr = 0; |
|
47 } |
|
48 |
|
49 // --------------------------------------------------------------------------- |
|
50 // AdvSecSettingsSecurityModuleModel::initialize() |
|
51 // --------------------------------------------------------------------------- |
|
52 // |
|
53 void AdvSecSettingsSecurityModuleModel::initialize() |
|
54 { |
|
55 if (d_ptr) { |
|
56 d_ptr->initialize(); |
|
57 } |
|
58 } |
|
59 |
|
60 // --------------------------------------------------------------------------- |
|
61 // AdvSecSettingsSecurityModuleModel::moduleCount() |
|
62 // --------------------------------------------------------------------------- |
|
63 // |
|
64 int AdvSecSettingsSecurityModuleModel::moduleCount() const |
|
65 { |
|
66 if (d_ptr) { |
|
67 return d_ptr->moduleCount(); |
|
68 } |
|
69 return 0; |
|
70 } |
|
71 |
|
72 // --------------------------------------------------------------------------- |
|
73 // AdvSecSettingsSecurityModuleModel::moduleLabelsAndLocations() |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
|
76 QMap<QString,QString> AdvSecSettingsSecurityModuleModel::moduleLabelsAndLocations() const |
|
77 { |
|
78 if (d_ptr) { |
|
79 return d_ptr->moduleLabelsAndLocations(); |
|
80 } |
|
81 QMap<QString,QString> emptyMap; |
|
82 return emptyMap; |
|
83 } |
|
84 |
|
85 // --------------------------------------------------------------------------- |
|
86 // AdvSecSettingsSecurityModuleModel::getModuleStatus() |
|
87 // --------------------------------------------------------------------------- |
|
88 // |
|
89 void AdvSecSettingsSecurityModuleModel::getModuleStatus(int moduleIndex) |
|
90 { |
|
91 if (d_ptr) { |
|
92 d_ptr->getModuleStatus(moduleIndex); |
|
93 } |
|
94 } |
|
95 |
|
96 // --------------------------------------------------------------------------- |
|
97 // AdvSecSettingsSecurityModuleModel::setPinCodeRequestState() |
|
98 // --------------------------------------------------------------------------- |
|
99 // |
|
100 void AdvSecSettingsSecurityModuleModel::setPinCodeRequestState(int moduleIndex, |
|
101 bool isRequested) |
|
102 { |
|
103 if (d_ptr) { |
|
104 d_ptr->setPinCodeRequestState(moduleIndex, isRequested); |
|
105 } |
|
106 } |
|
107 |
|
108 // --------------------------------------------------------------------------- |
|
109 // AdvSecSettingsSecurityModuleModel::changePinCode() |
|
110 // --------------------------------------------------------------------------- |
|
111 // |
|
112 void AdvSecSettingsSecurityModuleModel::changePinCode(int moduleIndex) |
|
113 { |
|
114 if (d_ptr) { |
|
115 d_ptr->changePinCode(moduleIndex); |
|
116 } |
|
117 } |
|
118 |
|
119 // --------------------------------------------------------------------------- |
|
120 // AdvSecSettingsSecurityModuleModel::closeModule() |
|
121 // --------------------------------------------------------------------------- |
|
122 // |
|
123 void AdvSecSettingsSecurityModuleModel::closeModule(int moduleIndex) |
|
124 { |
|
125 if (d_ptr) { |
|
126 d_ptr->closeModule(moduleIndex); |
|
127 } |
|
128 } |
|
129 |
|
130 // --------------------------------------------------------------------------- |
|
131 // AdvSecSettingsSecurityModuleModel::isSigningPinSupported() |
|
132 // --------------------------------------------------------------------------- |
|
133 // |
|
134 bool AdvSecSettingsSecurityModuleModel::isSigningPinSupported(int moduleIndex) const |
|
135 { |
|
136 if (d_ptr) { |
|
137 return d_ptr->isSigningPinSupported(moduleIndex); |
|
138 } |
|
139 return false; |
|
140 } |
|
141 |
|
142 // --------------------------------------------------------------------------- |
|
143 // AdvSecSettingsSecurityModuleModel::changeSigningPinCode() |
|
144 // --------------------------------------------------------------------------- |
|
145 // |
|
146 void AdvSecSettingsSecurityModuleModel::changeSigningPinCode(int moduleIndex) |
|
147 { |
|
148 if (d_ptr) { |
|
149 d_ptr->changeSigningPinCode(moduleIndex); |
|
150 } |
|
151 } |
|
152 |
|
153 // --------------------------------------------------------------------------- |
|
154 // AdvSecSettingsSecurityModuleModel::isDeletable() |
|
155 // --------------------------------------------------------------------------- |
|
156 // |
|
157 bool AdvSecSettingsSecurityModuleModel::isDeletable(int moduleIndex) const |
|
158 { |
|
159 if (d_ptr) { |
|
160 return d_ptr->isDeletable(moduleIndex); |
|
161 } |
|
162 return false; |
|
163 } |
|
164 |
|
165 // --------------------------------------------------------------------------- |
|
166 // AdvSecSettingsSecurityModuleModel::deleteModule() |
|
167 // --------------------------------------------------------------------------- |
|
168 // |
|
169 void AdvSecSettingsSecurityModuleModel::deleteModule(int moduleIndex) |
|
170 { |
|
171 if (d_ptr) { |
|
172 d_ptr->deleteModule(moduleIndex); |
|
173 } |
|
174 } |
|
175 |
|
176 // --------------------------------------------------------------------------- |
|
177 // AdvSecSettingsSecurityModuleModel::handleInitializeCompleted() |
|
178 // --------------------------------------------------------------------------- |
|
179 // |
|
180 void AdvSecSettingsSecurityModuleModel::handleInitializeCompleted() |
|
181 { |
|
182 emit initializeCompleted(); |
|
183 } |
|
184 |
|
185 // --------------------------------------------------------------------------- |
|
186 // AdvSecSettingsSecurityModuleModel::handleStatusCompleted() |
|
187 // --------------------------------------------------------------------------- |
|
188 // |
|
189 void AdvSecSettingsSecurityModuleModel::handleStatusCompleted( |
|
190 int authenticationStatus) |
|
191 { |
|
192 emit statusCompleted(authenticationStatus); |
|
193 } |
|
194 |
|
195 // --------------------------------------------------------------------------- |
|
196 // AdvSecSettingsSecurityModuleModel::handleStatusChanged() |
|
197 // --------------------------------------------------------------------------- |
|
198 // |
|
199 void AdvSecSettingsSecurityModuleModel::handleStatusChanged(int moduleIndex, |
|
200 int authenticationStatus) |
|
201 { |
|
202 emit statusChanged(moduleIndex, authenticationStatus); |
|
203 } |
|
204 |
|
205 // --------------------------------------------------------------------------- |
|
206 // AdvSecSettingsSecurityModuleModel::handlePinCodeRequestSet() |
|
207 // --------------------------------------------------------------------------- |
|
208 // |
|
209 void AdvSecSettingsSecurityModuleModel::handlePinCodeRequestSet() |
|
210 { |
|
211 emit pinCodeRequestStateCompleted(); |
|
212 } |
|
213 |
|
214 // --------------------------------------------------------------------------- |
|
215 // AdvSecSettingsSecurityModuleModel::handlePinCodeChanged() |
|
216 // --------------------------------------------------------------------------- |
|
217 // |
|
218 void AdvSecSettingsSecurityModuleModel::handlePinCodeChanged() |
|
219 { |
|
220 emit pinCodeChangeCompleted(); |
|
221 } |
|
222 |
|
223 // --------------------------------------------------------------------------- |
|
224 // AdvSecSettingsSecurityModuleModel::handleModuleClosed() |
|
225 // --------------------------------------------------------------------------- |
|
226 // |
|
227 void AdvSecSettingsSecurityModuleModel::handleModuleClosed() |
|
228 { |
|
229 emit closeCompleted(); |
|
230 } |
|
231 |
|
232 // --------------------------------------------------------------------------- |
|
233 // AdvSecSettingsSecurityModuleModel::handleSigningPinCodeChanged() |
|
234 // --------------------------------------------------------------------------- |
|
235 // |
|
236 void AdvSecSettingsSecurityModuleModel::handleSigningPinCodeChanged() |
|
237 { |
|
238 emit signingPinCodeChangeCompleted(); |
|
239 } |
|
240 |
|
241 // --------------------------------------------------------------------------- |
|
242 // AdvSecSettingsSecurityModuleModel::handleModuleDeleted() |
|
243 // --------------------------------------------------------------------------- |
|
244 // |
|
245 void AdvSecSettingsSecurityModuleModel::handleModuleDeleted() |
|
246 { |
|
247 emit deleteCompleted(); |
|
248 } |
|
249 |
|
250 // --------------------------------------------------------------------------- |
|
251 // AdvSecSettingsSecurityModuleModel::handleError() |
|
252 // --------------------------------------------------------------------------- |
|
253 // |
|
254 void AdvSecSettingsSecurityModuleModel::handleError(int error) |
|
255 { |
|
256 emit errorOccurred(error); |
|
257 } |
|
258 |