Symbian3/PDK/Source/GUID-0703C141-17C7-5918-9CF3-EF6CD408975B.dita
changeset 1 25a17d01db0c
child 3 46218c8b8afa
equal deleted inserted replaced
0:89d6a7a84779 1:25a17d01db0c
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE task
       
    11   PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
       
    12 <task id="GUID-0703C141-17C7-5918-9CF3-EF6CD408975B" xml:lang="en"><title>Phone
       
    13 Security Code Tutorial</title><shortdesc>This tutorial describes how to set the security code in a Symbian
       
    14 OS device. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
       
    15 
       
    16 
       
    17 <context><p>A security code controls access to the phone and can take a number
       
    18 of
       
    19  forms, such as a phone password, or SIM PIN number. Phone security functions
       
    20 use an <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita#GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8/GUID-81A8B1D4-E771-3720-B346-AD9A79861BDD"><apiname>RMobilePhone::TMobilePhoneSecurityCode</apiname></xref> flag to
       
    21  specify the type of the code. 
       
    22 </p></context>
       
    23 <steps-unordered>
       
    24 <step id="GUID-B969E22B-1055-5CF8-B95C-98F2486D0472"><cmd>To set a security
       
    25 code, use <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::ChangeSecurityCode()</apiname></xref>. </cmd>
       
    26 <info>This takes a <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::TMobilePhonePasswordChangeV1</apiname></xref> object
       
    27 containing the old and new values. </info>
       
    28 </step>
       
    29 <step id="GUID-F7B814C8-F373-513D-9384-D218C0450798"><cmd>To verify an entered
       
    30 code against the specified stored security code, use <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::VerifySecurityCode()</apiname></xref>. </cmd>
       
    31 </step>
       
    32 <step id="GUID-976CB6F4-D2B6-5A87-8226-B97A0A92B770"><cmd>To inform the phone
       
    33 that the user has cancelled a request for a security code to be entered, use <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::AbortSecurityCode()</apiname></xref>. </cmd>
       
    34 </step>
       
    35 </steps-unordered>
       
    36 <example><title>Phone security code example</title> <p>The following code
       
    37 takes the parameters for old and new password values, and changes the phone
       
    38 password. </p> <p>The code assumes <codeph>iMobilePhone</codeph> is an <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone</apiname></xref> object. </p> <codeblock id="GUID-1FFD20DF-F10D-5B13-9088-32529980E7CB" xml:space="preserve">void CClass::SetPasswordL(const TDesC&amp; aOldPassword, const TDesC&amp; aNewPassword)
       
    39     {
       
    40     TUint32 securityCaps;
       
    41     User::LeaveIfError(iMobilePhone.GetSecurityCaps(securityCaps));
       
    42 
       
    43     if (securityCaps &amp; RMobilePhone::KCapsLockPhone)
       
    44         {
       
    45         RMobilePhone::TMobilePhonePasswordChangeV1 passwordChange;
       
    46         passwordChange.iOldPassword = aOldPassword;
       
    47         passwordChange.iNewPassword = aNewPassword;
       
    48         RMobilePhone::TMobilePhoneSecurityCode securityCode = RMobilePhone::ESecurityCodePhonePassword;
       
    49         TRequestStatus status;
       
    50         iMobilePhone.ChangeSecurityCode(status, securityCode, passwordChange);
       
    51         User::WaitForRequest(status);
       
    52         User::LeaveIfError(status.Int());
       
    53         }
       
    54     }
       
    55 </codeblock> </example>
       
    56 </taskbody></task>