cpsecplugins/simpincodeplugin/src/seccodemodel_symbian.cpp
branchRCL_3
changeset 21 09b1ac925e3f
equal deleted inserted replaced
20:63339781d179 21:09b1ac925e3f
       
     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 #include <../../inc/cpsecplugins.h>
       
    27 
       
    28 // ======== MEMBER FUNCTIONS ========
       
    29 
       
    30 /*!
       
    31     NewL
       
    32 */
       
    33 SecCodeModelPrivate* SecCodeModelPrivate::NewL()
       
    34 {
       
    35     SecCodeModelPrivate* self = new (ELeave) SecCodeModelPrivate();
       
    36     CleanupStack::PushL(self);
       
    37     self->ConstructL();
       
    38     CleanupStack::Pop(); //self
       
    39     return self;
       
    40 }
       
    41 
       
    42 /*!
       
    43     SecCodeModelPrivate
       
    44 */
       
    45 SecCodeModelPrivate::SecCodeModelPrivate()
       
    46 {
       
    47 }
       
    48 
       
    49 /*!
       
    50     ConstructL
       
    51 */
       
    52 void SecCodeModelPrivate::ConstructL()
       
    53 {
       
    54 	RDEBUG("0", 0);
       
    55 	iSecurity = CSecuritySettings::NewL(); 
       
    56 }
       
    57 
       
    58 /*!
       
    59     Destructor
       
    60 */
       
    61 SecCodeModelPrivate::~SecCodeModelPrivate()
       
    62 {
       
    63 	if (iSecurity) {
       
    64 		delete iSecurity;
       
    65 	}
       
    66 }
       
    67 
       
    68 /*!
       
    69     Get Pin Code Request State
       
    70 */
       
    71 bool SecCodeModelPrivate::pinCodeRequest() const
       
    72 {
       
    73 	RDEBUG("0", 0);
       
    74 	bool isLockEnabled = false;
       
    75 	QT_TRAP_THROWING(isLockEnabled = iSecurity->IsLockEnabledL(
       
    76 		RMobilePhone::ELockICC));
       
    77 	RDEBUG("isLockEnabled", isLockEnabled);
       
    78 	return isLockEnabled;
       
    79 }
       
    80 
       
    81 /*!
       
    82     Get the Change Pin Remaining Attempts
       
    83 */
       
    84 bool SecCodeModelPrivate::changePinCodeRequest()
       
    85 {
       
    86 	RDEBUG("0", 0);
       
    87     bool result = false;
       
    88 	QT_TRAP_THROWING(result =iSecurity->ChangePinRequestL());
       
    89 	RDEBUG("result", result);
       
    90 	return result;
       
    91 }
       
    92 
       
    93 /*!
       
    94     Change Pin Code
       
    95 */
       
    96 int SecCodeModelPrivate::changePinCode()
       
    97 {
       
    98 	RDEBUG("0", 0);
       
    99 	QT_TRAP_THROWING(iSecurity->ChangePinL());
       
   100 	RDEBUG("0", 0);
       
   101 	return 0;
       
   102 }
       
   103 
       
   104 /*!
       
   105     Change Pin2 Code
       
   106 */
       
   107 int SecCodeModelPrivate::changePin2Code()
       
   108 {
       
   109 	RDEBUG("0", 0);
       
   110 	QT_TRAP_THROWING(iSecurity->ChangePin2L());
       
   111 	RDEBUG("0", 0);
       
   112 	return 0;
       
   113 }