Symbian3/SDK/Source/GUID-8FC2BA94-2374-5BFE-B4CF-624A6B0056BC.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE task
  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task xml:lang="en" id="GUID-8FC2BA94-2374-5BFE-B4CF-624A6B0056BC"><title>Call Waiting Status Tutorial</title><shortdesc>This tutorial describes how to get the call waiting status information with the telephony API for applications. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> <steps id="GUID-E24D656A-701E-5B29-B189-06304C4C7DE5"> <step id="GUID-4CDC8306-6814-5E5F-835A-694D1849A746"><cmd/><info>create a new instance of <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony</apiname></xref>  </info> </step> <step id="GUID-C37BEE6E-CB6F-50ED-81F1-4523E2312A6C"><cmd/><info>call<xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname> CTelephony::GetCallWaitingStatus()</apiname></xref> to get the call waiting information </info> </step> <step id="GUID-020F7560-2DC2-59E1-B685-579A33235C56"><cmd/><info>you can cancel the asynchronous request with a <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony::EGetCallWaitingStatusCancel</apiname></xref> enumeration. </info> </step> </steps> <example id="GUID-F3885187-FB33-5490-87C5-184138F7E4B3"><title>Call waiting status example</title> <codeblock id="GUID-05F9F0DE-5D96-55F8-B1B9-A9CE858CF5B7" xml:space="preserve">#include &lt;e32base.h&gt;
#include &lt;Etel3rdParty.h&gt;

class CClientApp : public CActive
    { 

private:
    CTelephony* iTelephony;
    CTelephony::TCallWaitingSupplServicesV1 iCallWaitingSupplServicesV1;
    CTelephony::TCallWaitingSupplServicesV1Pckg iCallWaitingSupplServicesV1Pckg;

public:
    CClientApp(CTelephony* aTelephony);
    void SomeFunction();

private:
    /*
       These are the pure virtual methods from CActive that  
       MUST be implemented by all active objects
       */
    void RunL();
    void DoCancel();
   };

CClientApp::CClientApp(CTelephony* aTelephony)
    : CActive(EPriorityStandard),
      iTelephony(aTelephony),
      iCallWaitingSupplServicesV1Pckg(iCallWaitingSupplServicesV1)
    {
    //default constructor
    }

void CClientApp::SomeFunction()
    {
    iTelephony-&gt;GetCallWaitingStatus(iStatus, iCallWaitingSupplServicesV1Pckg);
    SetActive();
    }

void CClientApp::RunL()
    {
    if(iStatus==KErrNone)
       {
       CTelephony::TSupplServiceStatus callWaitingStatus = iCallWaitingSupplServicesV1.iCallWaiting;
       }
    }

void CClientApp::DoCancel()
    {
    iTelephony-&gt;CancelAsync(CTelephony::EGetCallWaitingStatusCancel);
    }</codeblock> </example> </taskbody></task>