Symbian3/PDK/Source/GUID-B66323BB-7AC0-5303-BC3A-DD577D28CF16.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-B66323BB-7AC0-5303-BC3A-DD577D28CF16" xml:lang="en"><title>Caller
       
    13 Identification Status Tutorial</title><shortdesc>This tutorial describes how to get the caller identification status
       
    14 information with the telephony API for applications. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
       
    15 <context id="GUID-B45A8C02-1C5E-4902-8231-F98B1838CCE4"><p>The caller identification service is available only on GSM and
       
    16 WCDMA networks.  </p><p/><p>The steps to get the caller identification
       
    17 status information are:  </p></context>
       
    18 
       
    19 
       
    20 <steps id="GUID-4E8D8774-7C57-5190-A896-E045B8028AE6">
       
    21 <step id="GUID-76D5CC80-CC9D-59D1-BB44-CD9E689DBACA"><cmd/>
       
    22 <info>create a new instance of <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony</apiname></xref>  </info>
       
    23 </step>
       
    24 <step id="GUID-FD81FA29-62DC-5519-8C71-456FD09EEC0B"><cmd/>
       
    25 <info>call <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony::GetIdentityServiceStatus()</apiname></xref> to
       
    26 get the caller identification service status information </info>
       
    27 <info>Pass a <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>TIdentityService</apiname></xref> object
       
    28 with <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>EIdServiceCallerPresentation</apiname></xref>  </info>
       
    29 </step>
       
    30 <step id="GUID-662113AC-889C-51E2-9053-294B8CEE35CB"><cmd/>
       
    31 <info>pass a <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>TIdentityService</apiname></xref> object
       
    32 with <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>EIdServiceCallerRestriction</apiname></xref> to
       
    33 with hold the number </info>
       
    34 </step>
       
    35 <step id="GUID-16AA1108-AAC2-577F-A611-26224C493597"><cmd/>
       
    36 <info>pass the enumeration<xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>EGetIdentityServiceStatusCancel</apiname></xref> to
       
    37 the to cancel the asynchronous request. </info>
       
    38 </step>
       
    39 </steps>
       
    40 <example id="GUID-1BDF5DCA-672D-56C5-9DB2-A777F6E9B68E"><title>Caller identification
       
    41 status example</title> <p>Example code to get the caller identification status. </p> <codeblock id="GUID-5C67664C-8D4E-56FE-8745-F38072CE4B60" xml:space="preserve">#include &lt;e32base.h&gt;
       
    42 #include &lt;Etel3rdParty.h&gt;
       
    43 
       
    44 class CClientApp : public CActive
       
    45     { 
       
    46 
       
    47 private:
       
    48     CTelephony* iTelephony;
       
    49     CTelephony::TIdentityServiceV1 iTIdentityServiceV1;
       
    50     CTelephony::TIdentityServiceV1Pckg iTIdentityServiceV1Pckg;
       
    51 
       
    52 public:
       
    53     CClientApp(CTelephony* aTelephony);
       
    54     void SomeFunction();
       
    55 
       
    56 private:
       
    57     /*
       
    58        These are the pure virtual methods from CActive that  
       
    59        MUST be implemented by all active objects
       
    60        */
       
    61     void RunL();
       
    62     void DoCancel();
       
    63    };
       
    64 
       
    65 CClientApp::CClientApp(CTelephony* aTelephony)
       
    66     : CActive(EPriorityStandard),
       
    67       iTelephony(aTelephony),
       
    68       iTIdentityServiceV1Pckg(iTIdentityServiceV1)
       
    69     {
       
    70     //default constructor
       
    71     }
       
    72 
       
    73 void CClientApp::SomeFunction()
       
    74     {
       
    75     CTelephony::TIdentityService condition = CTelephony::EIdServiceCallerPresentation;
       
    76     iTelephony-&gt;GetIdentityServiceStatus(iStatus, condition, iTIdentityServiceV1Pckg);
       
    77     SetActive();
       
    78     }
       
    79 
       
    80 void CClientApp::RunL()
       
    81     {
       
    82     if(iStatus==KErrNone)
       
    83        {
       
    84        if( iTIdentityServiceV1.iIdentityStatus == CTelephony::EIdServiceActivePermanent )
       
    85           {} // CLIP is permanently active; 
       
    86              // Your phone will display the callers number whenever this is allowed by the caller
       
    87        }
       
    88     }
       
    89 
       
    90 void CClientApp::DoCancel()
       
    91     {
       
    92     iTelephony-&gt;CancelAsync(CTelephony::EGetIdentityServiceStatusCancel);
       
    93     }</codeblock> </example>
       
    94 </taskbody></task>