|
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 * |
|
16 */ |
|
17 |
|
18 // System includes |
|
19 #include <e32err.h> |
|
20 #include <exterror.h> |
|
21 #include <etelmm.h> |
|
22 |
|
23 // User includes |
|
24 #include "seccodemodel_p.h" |
|
25 #include "seccodeuiglobal.h" |
|
26 |
|
27 // ======== MEMBER FUNCTIONS ======== |
|
28 |
|
29 /*! |
|
30 NewL |
|
31 */ |
|
32 SecCodeModelPrivate* SecCodeModelPrivate::NewL() |
|
33 { |
|
34 SecCodeModelPrivate* self = new (ELeave) SecCodeModelPrivate(); |
|
35 CleanupStack::PushL(self); |
|
36 self->ConstructL(); |
|
37 CleanupStack::Pop(); //self |
|
38 return self; |
|
39 } |
|
40 |
|
41 /*! |
|
42 SecCodeModelPrivate |
|
43 */ |
|
44 SecCodeModelPrivate::SecCodeModelPrivate() |
|
45 { |
|
46 } |
|
47 |
|
48 /*! |
|
49 ConstructL |
|
50 */ |
|
51 void SecCodeModelPrivate::ConstructL() |
|
52 { |
|
53 iSecurity = CSecuritySettings::NewL(); |
|
54 } |
|
55 |
|
56 /*! |
|
57 Destructor |
|
58 */ |
|
59 SecCodeModelPrivate::~SecCodeModelPrivate() |
|
60 { |
|
61 if (iSecurity) { |
|
62 delete iSecurity; |
|
63 } |
|
64 } |
|
65 |
|
66 /*! |
|
67 Get Pin Code Request State |
|
68 */ |
|
69 bool SecCodeModelPrivate::pinCodeRequest() const |
|
70 { |
|
71 bool isLockEnabled = false; |
|
72 QT_TRAP_THROWING(isLockEnabled = iSecurity->IsLockEnabledL( |
|
73 RMobilePhone::ELockICC)); |
|
74 return isLockEnabled; |
|
75 } |
|
76 |
|
77 /*! |
|
78 Get the Change Pin Remaining Attempts |
|
79 */ |
|
80 bool SecCodeModelPrivate::changePinCodeRequest() |
|
81 { |
|
82 bool result = false; |
|
83 QT_TRAP_THROWING(result =iSecurity->ChangePinRequestL()); |
|
84 return result; |
|
85 } |
|
86 |
|
87 /*! |
|
88 Change Pin Code |
|
89 */ |
|
90 int SecCodeModelPrivate::changePinCode() |
|
91 { |
|
92 QT_TRAP_THROWING(iSecurity->ChangePinL()); |
|
93 return 0; |
|
94 } |
|
95 |
|
96 /*! |
|
97 Change Pin2 Code |
|
98 */ |
|
99 int SecCodeModelPrivate::changePin2Code() |
|
100 { |
|
101 QT_TRAP_THROWING(iSecurity->ChangePin2L()); |
|
102 return 0; |
|
103 } |