Symbian3/PDK/Source/GUID-4B885E13-AC1E-5208-9F07-E6219E214626.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Tue, 30 Mar 2010 11:56:28 +0100
changeset 5 f345bda72bc4
parent 3 46218c8b8afa
child 14 578be2adaf3e
permissions -rw-r--r--
Week 12 contribution of PDK documentation_content. See release notes for details. Fixes Bug 2054, Bug 1583, Bug 381, Bug 390, Bug 463, Bug 1897, Bug 344, Bug 1319, Bug 394, Bug 1520, Bug 1522, Bug 1892"

<?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 id="GUID-4B885E13-AC1E-5208-9F07-E6219E214626" xml:lang="en"><title>Call
Forward Status Tutorial</title><shortdesc>This tutorial describes how to get the call forward status information
with the telephony API for applications. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>


<context id="GUID-01738CA7-BFF1-4BCF-A586-AE7AE6680AE6"><p>The call forward information is only available on the GSM and
the WCDMA networks.  </p></context>
<steps id="GUID-37576512-F408-5B5B-A660-21C97860284B">
<step id="GUID-FDD5B539-DF97-5C3B-AE17-34B1BE12622A"><cmd/>
<info>create a new instance of <xref href="GUID-5810DCBE-9C54-3ACC-9714-2A48D48940EF.dita"><apiname>CTelephony</apiname></xref>  </info>
</step>
<step id="GUID-6ABACC42-A7D1-506C-90EB-175CA2B0FE29"><cmd/>
<info>call <xref href="GUID-5810DCBE-9C54-3ACC-9714-2A48D48940EF.dita"><apiname>CTelephony::GetCallForwardingStatus()</apiname></xref> to
get the call forward status information </info>
<info>pass a <xref href="GUID-5810DCBE-9C54-3ACC-9714-2A48D48940EF.dita"><apiname>CTelephony::TCallForwardingCondition</apiname></xref> object </info>
</step>
<step id="GUID-0A59F98D-641A-5ABD-8112-C0A62FAD9A1A"><cmd/>
<info>you can cancel the asynchronous request with a <xref href="GUID-5810DCBE-9C54-3ACC-9714-2A48D48940EF.dita"><apiname>CTelephony::EGetCallForwardingStatusCancel</apiname></xref> enumeration. </info>
</step>
</steps>
<example id="GUID-BD080473-17C3-534E-A963-7C41A82C37BA"><title>Call forward
status example</title> <codeblock id="GUID-93593481-AC16-5FF9-A989-D3D4B4B7D2CF" xml:space="preserve">#include &lt;e32base.h&gt;
#include &lt;Etel3rdParty.h&gt;

class CClientApp : public CActive
    { 

private:
    CTelephony* iTelephony;
    CTelephony::TCallForwardingSupplServicesV1 iCallForwardingSupplServicesV1;
    CTelephony::TCallForwardingSupplServicesV1Pckg iCallForwardingSupplServicesV1Pckg;

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),
      iCallForwardingSupplServicesV1Pckg(iCallForwardingSupplServicesV1)
    {
    //default constructor
    }

void CClientApp::SomeFunction()
    {
    CTelephony::TCallForwardingCondition condition = CTelephony::ECallForwardingNoReply;
    iTelephony-&gt;GetCallForwardingStatus(iStatus, condition, iCallForwardingSupplServicesV1Pckg);
    SetActive();
    }

void CClientApp::RunL()
    {
    if(iStatus==KErrNone)
       {
       if( iCallForwardingSupplServicesV1.iCallForwarding == CTelephony::ENotActive )
          {} // The call forwarding condition is inactive; 
             // If the phone user does not answer a call then the call is _not_ forwarded
       }
    }

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