Symbian3/SDK/Source/GUID-FFBD95C6-0B12-5FD7-BA69-89BBFB97F0A1.dita
changeset 0 89d6a7a84779
equal deleted inserted replaced
-1:000000000000 0:89d6a7a84779
       
     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-FFBD95C6-0B12-5FD7-BA69-89BBFB97F0A1" xml:lang="en"><title>Call
       
    13 Resume Tutorial </title><shortdesc>This tutorial describes how to resume a call with the telephony
       
    14 API for applications. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
       
    15 
       
    16 
       
    17 <steps id="GUID-43E11818-C05F-53B4-8DCB-7246BAE47AC8">
       
    18 <step id="GUID-DF620D49-997B-5780-A7E7-EAD2CBEDBC40"><cmd/>
       
    19 <info>create a new instance of <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony</apiname></xref>  </info>
       
    20 </step>
       
    21 <step id="GUID-C5296605-2F1B-5084-B34B-F764F358AF27"><cmd/>
       
    22 <info>use <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony::GetCallDynamicCaps()</apiname></xref> to
       
    23 check if the device supports resume function </info>
       
    24 </step>
       
    25 <step id="GUID-F93FC655-7405-5BD5-9CA3-A15D09D889B5"><cmd/>
       
    26 <info>once a call is on hold, you can resume the call by with <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony::Resume()</apiname></xref>. </info>
       
    27 <info>Pass the ID of the call to resume. </info>
       
    28 </step>
       
    29 <step id="GUID-04EC72AA-318C-5BFE-A8AD-374929229D50"><cmd/>
       
    30 <info>pass the enumeration <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony::EResumeCancel</apiname></xref> to
       
    31 cancel the asynchronous request </info>
       
    32 </step>
       
    33 
       
    34 
       
    35 
       
    36 
       
    37 
       
    38 </steps>
       
    39 <example id="GUID-BFF56F2B-E7D7-5CA4-9130-AE4FC768431A"><title>Call resume
       
    40 example</title> <codeblock id="GUID-71F14CC1-40DF-5A89-9A6F-D8D31F544FFF" xml:space="preserve">#include &lt;e32base.h&gt;
       
    41 #include &lt;Etel3rdParty.h&gt;
       
    42 
       
    43 class CClientApp : public CActive
       
    44     { 
       
    45 
       
    46 private:
       
    47     CTelephony* iTelephony;
       
    48     CTelephony::TCallId iCallId;
       
    49 
       
    50 public:
       
    51     CClientApp(CTelephony* aTelephony, CTelephony::TCallId aCallId);
       
    52     TInt SomeFunction();
       
    53 
       
    54 private:
       
    55     /*
       
    56        These are the pure virtual methods from CActive that  
       
    57        MUST be implemented by all active objects
       
    58        */
       
    59     void RunL();
       
    60     void DoCancel();
       
    61    };
       
    62 
       
    63 CClientApp::CClientApp(CTelephony* aTelephony, CTelephony::TCallId aCallId)
       
    64     : CActive(EPriorityStandard),
       
    65       iTelephony(aTelephony),
       
    66       iCallId(aCallId)
       
    67     {
       
    68     //default constructor
       
    69     }
       
    70 
       
    71 TInt CClientApp::SomeFunction()
       
    72     {
       
    73     // Check that the phone supports Resuming calls.
       
    74     CTelephony::TCallCapsV1 callCapsV1;
       
    75     CTelephony::TCallCapsV1Pckg callCapsV1Pckg(callCapsV1);
       
    76     iTelephony-&gt;GetCallDynamicCaps(iCallId, callCapsV1Pckg);
       
    77 
       
    78     if( callCapsV1.iControlCaps &amp; CTelephony::KCapsResume )
       
    79        {
       
    80        // The call represented by 'iCallId' can be resumed
       
    81        iTelephony-&gt;Resume(iStatus, iCallId);
       
    82        SetActive();
       
    83        return KErrNone;
       
    84        }
       
    85     else
       
    86        {
       
    87        // The call cannot be resumed; 
       
    88        // return an error indicate this.
       
    89        return KErrNotSupported;
       
    90        }
       
    91     }
       
    92 
       
    93 void CClientApp::RunL()
       
    94     {
       
    95     if(iStatus==KErrNone)
       
    96        {} // The call has been resumed successfully;
       
    97     }
       
    98 
       
    99 void CClientApp::DoCancel()
       
   100     {
       
   101     iTelephony-&gt;CancelAsync(CTelephony::EResumeCancel);
       
   102     }
       
   103 </codeblock> </example>
       
   104 </taskbody></task>