Symbian3/PDK/Source/GUID-7EA8047F-BD30-5100-9284-9A684500BFE6.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-7EA8047F-BD30-5100-9284-9A684500BFE6" xml:lang="en"><title>Registration
       
    13 Status Tutorial</title><shortdesc>This tutorial describes how to get the registration information
       
    14 with the telephony API for applications. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
       
    15 <context><p>The information about the network service like Roaming, Busy,
       
    16 Emergency calls only or No service is provided to the client applications. </p></context>
       
    17 
       
    18 
       
    19 <steps id="GUID-DB410EC7-09ED-5E05-892B-23333B678FB4">
       
    20 <step id="GUID-0AF5395D-6D56-5E83-BA77-BFF6EB2D2DEC"><cmd/>
       
    21 <info>create a new instance of <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony</apiname></xref>  </info>
       
    22 </step>
       
    23 <step id="GUID-F781DB86-2235-5A24-A2B7-C4F6C85C0340"><cmd/>
       
    24 <info>use <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony::GetNetworkRegistrationStatus()</apiname></xref> to
       
    25 get the registration status information from the network </info>
       
    26 </step>
       
    27 <step id="GUID-0712E5C9-233B-5371-81C4-48A67AC38891"><cmd/>
       
    28 <info>use <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony::EGetNetworkRegistrationStatusCancel</apiname></xref> to
       
    29 cancel the asynchronous request </info>
       
    30 </step>
       
    31 <step id="GUID-D8A225B1-ED33-5AE4-B3DB-1826C796DB21"><cmd/>
       
    32 <info>use <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony::ENetworkRegistrationStatusChange</apiname></xref> to
       
    33 get the notification of any changes to the registration status </info>
       
    34 </step>
       
    35 <step id="GUID-4CD5ED70-89D5-55AB-972F-26B1AC7C8205"><cmd/>
       
    36 <info>pass the enumeration <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony::ENetworkRegistrationStatusChangeCancel</apiname></xref> to
       
    37 cancel the notification request. </info>
       
    38 </step>
       
    39 </steps>
       
    40 <example id="GUID-E42753A5-EF76-5B98-8E9E-8734C9ABFB66"><title>Registration
       
    41 status example</title> <codeblock id="GUID-84333DC0-97D7-5D8B-BFE7-F72793F38C6D" 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::TNetworkRegistrationV1 iNetworkRegistrationV1;
       
    50     CTelephony::TNetworkRegistrationV1Pckg iNetworkRegistrationV1Pckg;
       
    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       iNetworkRegistrationV1Pckg(iNetworkRegistrationV1)
       
    69     {
       
    70     //default constructor
       
    71     }
       
    72 
       
    73 void CClientApp::SomeFunction()
       
    74     {
       
    75     iTelephony-&gt;GetNetworkRegistrationStatus(iStatus, iNetworkRegistrationV1Pckg);
       
    76     SetActive();
       
    77     }
       
    78 
       
    79 void CClientApp::RunL()
       
    80     {
       
    81     if(iStatus==KErrNone)
       
    82        {
       
    83        CTelephony::TRegistrationStatus regStatus = iNetworkRegistrationV1.iRegStatus;
       
    84        }
       
    85     }
       
    86 
       
    87 void CClientApp::DoCancel()
       
    88     {
       
    89     iTelephony-&gt;CancelAsync(CTelephony::EGetNetworkRegistrationStatusCancel);
       
    90     }</codeblock> </example>
       
    91 </taskbody></task>