|
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-2332AFD7-30F2-5B4D-BBA9-3EA36D8F5E81" xml:lang="en"><title>Call |
|
13 Barring Status </title><shortdesc>This tutorial describes how to get the call barring status information |
|
14 with the telephony API for applications </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> |
|
15 <context><p>The call barring is a supplementary service. The client applications |
|
16 can determine the status of the service with the <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony</apiname></xref> functions. |
|
17 </p></context> |
|
18 |
|
19 |
|
20 <steps id="GUID-2BA7DD2F-8ECE-5F05-A534-FA8A213C2E04"> |
|
21 <step id="GUID-ADD96618-3A97-59A3-9A18-C34B46D36CDF"><cmd/> |
|
22 <info>create a new instance of <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony</apiname></xref> </info> |
|
23 </step> |
|
24 <step id="GUID-41E8A873-C810-5C80-95C4-4247CBAA4952"><cmd/> |
|
25 <info>use <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony::GetCallBarringStatus()</apiname></xref> to |
|
26 get the supplementary services status information. </info> |
|
27 <info>pass a <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>TCallBarringCondition</apiname></xref> object. </info> |
|
28 </step> |
|
29 <step id="GUID-F7F6B090-1A10-5902-8470-BB1A2A3E6A5E"><cmd/> |
|
30 <info>cancel the request with <xref href="GUID-97D402C8-B4B7-385A-92B3-D3FCC0CA575A.dita"><apiname>CTelephony::EGetCallBarringStatusCancel</apiname></xref> enumeration. </info> |
|
31 </step> |
|
32 </steps> |
|
33 <example id="GUID-C64CDE2B-344E-5341-88B0-624059E85CE5"><title>Call barring |
|
34 example</title> <codeblock id="GUID-873ED2A9-3B8F-57F5-8A35-46EBD87350B7" xml:space="preserve">#include <e32base.h> |
|
35 #include <Etel3rdParty.h> |
|
36 |
|
37 class CClientApp : public CActive |
|
38 { |
|
39 |
|
40 private: |
|
41 CTelephony* iTelephony; |
|
42 CTelephony::TCallBarringSupplServicesV1 iCallBarringSupplServicesV1; |
|
43 CTelephony::TCallBarringSupplServicesV1Pckg iCallBarringSupplServicesV1Pckg; |
|
44 |
|
45 public: |
|
46 CClientApp(CTelephony* aTelephony); |
|
47 void SomeFunction(); |
|
48 |
|
49 private: |
|
50 /* |
|
51 These are the pure virtual methods from CActive that |
|
52 MUST be implemented by all active objects |
|
53 */ |
|
54 void RunL(); |
|
55 void DoCancel(); |
|
56 }; |
|
57 |
|
58 CClientApp::CClientApp(CTelephony* aTelephony) |
|
59 : CActive(EPriorityStandard), |
|
60 iTelephony(aTelephony), |
|
61 iCallBarringSupplServicesV1Pckg(iCallBarringSupplServicesV1) |
|
62 { |
|
63 //default constructor |
|
64 } |
|
65 |
|
66 void CClientApp::SomeFunction() |
|
67 { |
|
68 CTelephony::TCallBarringCondition condition = CTelephony::EBarAllOutgoing; |
|
69 iTelephony->GetCallBarringStatus(iStatus, condition, iCallBarringSupplServicesV1Pckg); |
|
70 SetActive(); |
|
71 } |
|
72 |
|
73 void CClientApp::RunL() |
|
74 { |
|
75 if(iStatus==KErrNone) |
|
76 { |
|
77 if( iCallBarringSupplServicesV1.iCallBarring == CTelephony::EStatusActive ) |
|
78 {} // The call barring condition is active; |
|
79 // all outgoing calls are barred. |
|
80 } |
|
81 } |
|
82 |
|
83 void CClientApp::DoCancel() |
|
84 { |
|
85 iTelephony->CancelAsync(CTelephony::EGetCallBarringStatusCancel); |
|
86 }</codeblock> </example> |
|
87 </taskbody></task> |