|
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 xml:lang="en" id="GUID-C328D060-62A9-5425-B33A-704E5FC18290"><title>Call Waiting Settings Tutorial</title><shortdesc>This tutorial describes how to get and set the call waiting settings in a Symbian OS device. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> <steps-unordered> <step id="GUID-A978B2DF-12FD-5047-87D2-A1BA087111E3"><cmd>Use <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>CRetrieveMobilePhoneCWList</apiname></xref> to get a list of call waiting entries in a <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>CMobilePhoneCWList</apiname></xref> object. </cmd> <info>A list that indicates different waiting status for different service groups such as voice, fax, data and auxiliary voice is required. Each entry in the list is a <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::TMobilePhoneCWInfoEntryV1</apiname></xref> object, recording the service group and call waiting status. </info> </step> <step id="GUID-474DFCA5-ABAD-5367-9030-0B1E78516DED"><cmd>Set the status of the call waiting service using <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::SetCallWaitingStatus()</apiname></xref>. </cmd> <info>The action taken is described in <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::TMobilePhoneServiceAction</apiname></xref>. This is possible only in the CDMA mode if the feature code strings are programmed for the call forwarding service, see <xref href="GUID-EE8660B7-DAC2-5A57-BDEA-418900BAE421.dita">Call Supplementary Services Tutorial</xref> for more information </info> </step> <step id="GUID-B6555A38-7061-5D95-9E20-B98CBC09A044"><cmd>Use <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone::NotifyCallWaitingStatusChange()</apiname></xref> to get the notification of any changes in the status of the call waiting service. </cmd> </step> </steps-unordered> <example><title>Call waiting settings example</title> <p>The following code gets the list of call waiting entries, and prints each service group for which call waiting is active. The code assumes <codeph>iMobilePhone</codeph> is an <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone</apiname></xref> object. </p> <codeblock id="GUID-920D3E9E-CBE3-5075-A262-CA73D331E00B" xml:space="preserve">void CClientApp::CallWaitingL() |
|
13 { |
|
14 |
|
15 // Create and start CW retriever |
|
16 CRetrieveMobilePhoneCWList* retrieveCWList = CRetrieveMobilePhoneCWList::NewL(iMobilePhone); |
|
17 CleanupStack::PushL(retrieveCWList); |
|
18 |
|
19 TRequestStatus status; |
|
20 retrieveCWList->Start(status); |
|
21 User::WaitForRequest(status); |
|
22 User::LeaveIfError(status.Int()); |
|
23 |
|
24 // Get the list of call waiting entries |
|
25 CMobilePhoneCWList* cwList = retrieveCWList->RetrieveListL(); |
|
26 CleanupStack::PushL(cwList); |
|
27 |
|
28 // Print each service group for which CW is active |
|
29 TInt nEntries = cwList->Enumerate(); |
|
30 RMobilePhone::TMobilePhoneCWInfoEntryV1 cwEntry; |
|
31 |
|
32 // Names of service groups |
|
33 TText* aServiceGroupNameStings[]={_S("Unspecified"), _S("Voice"), _S("Auxiliary Voice"), |
|
34 _S("CSD"),_S("Packet"),_S("Fax"),_S("SMS"),_S("All")}; |
|
35 TPtr aServiceGroupName(NULL,20); |
|
36 |
|
37 for (TInt i=0; i<=nEntries; i++) |
|
38 { |
|
39 cwEntry = cwList->GetEntryL(i); |
|
40 if (cwEntry.iStatus == RMobilePhone::ECallWaitingStatusActive) |
|
41 { |
|
42 aServiceGroupName = aServiceGroupNameStings[cwEntry.iServiceGroup]; |
|
43 console->Printf(_L("Call waiting active for service group %d\n"),aServiceGroupName); |
|
44 } |
|
45 } |
|
46 |
|
47 // Clean up |
|
48 CleanupStack::PopAndDestroy(2); // cwList, retrieveCWList |
|
49 |
|
50 }</codeblock> </example> </taskbody></task> |