|
1 /* |
|
2 * Copyright (c) 2002 - 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Execute Call command. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include <coemain.h> |
|
23 #include <AiwServiceHandler.h> //CAiwServiceHandler |
|
24 #include <AiwCommon.hrh> //KAiwCmdCall, KAiwClassBase |
|
25 #include <AiwCommon.h> //RCriteriaArray, CAiwCriteriaItem |
|
26 #include <AiwGenericParam.h> //CAiwGenericParamList, TAiwGenericParam |
|
27 #include "MuiuCallCmd.h" |
|
28 |
|
29 |
|
30 |
|
31 // ================= MEMBER FUNCTIONS ======================= |
|
32 |
|
33 // --------------------------------------------------------- |
|
34 // CMuiuCallCmd::CMuiuCallCmd |
|
35 // |
|
36 // --------------------------------------------------------- |
|
37 CMuiuCallCmd::CMuiuCallCmd () |
|
38 { |
|
39 } |
|
40 |
|
41 // --------------------------------------------------------- |
|
42 // CMuiuCallCmd::NewL |
|
43 // |
|
44 // --------------------------------------------------------- |
|
45 CMuiuCallCmd* CMuiuCallCmd::NewL() |
|
46 { |
|
47 CMuiuCallCmd* self = new( ELeave ) CMuiuCallCmd(); |
|
48 CleanupStack::PushL( self ); |
|
49 self->ConstructL(); |
|
50 CleanupStack::Pop( self ); |
|
51 return self; |
|
52 } |
|
53 |
|
54 // --------------------------------------------------------- |
|
55 // CMuiuCallCmd::~CMuiuCallCmd |
|
56 // |
|
57 // --------------------------------------------------------- |
|
58 CMuiuCallCmd::~CMuiuCallCmd() |
|
59 { |
|
60 } |
|
61 |
|
62 |
|
63 // --------------------------------------------------------- |
|
64 // CMuiuCallCmd::ExecuteLD |
|
65 // |
|
66 // Start dialing and show calling dialog |
|
67 // --------------------------------------------------------- |
|
68 void CMuiuCallCmd::ExecuteLD( const TDesC& aNumber, const TDesC& aName, TBool aCallTypeVoIP ) |
|
69 { |
|
70 CleanupStack::PushL( this ); |
|
71 // Create AIW service handler |
|
72 CAiwServiceHandler* serviceHandler = CAiwServiceHandler::NewLC(); |
|
73 // Create AIW interest |
|
74 RCriteriaArray interest; |
|
75 CleanupClosePushL( interest ); |
|
76 CAiwCriteriaItem* criteria = CAiwCriteriaItem::NewLC( |
|
77 KAiwCmdCall, KAiwCmdCall, |
|
78 _L8( "*" ) ); |
|
79 TUid base; |
|
80 base.iUid = KAiwClassBase; |
|
81 criteria->SetServiceClass( base ); |
|
82 User::LeaveIfError( interest.Append( criteria ) ); |
|
83 // Attach to AIW interest |
|
84 serviceHandler->AttachL( interest ); |
|
85 iNameBuffer = aName.Left( iNameBuffer.MaxLength() ); |
|
86 iTelNumber = aNumber.Left( iTelNumber.MaxLength() ); |
|
87 CAiwDialDataExt* dialDataExt = CAiwDialDataExt::NewLC(); |
|
88 // Set test parameters |
|
89 dialDataExt->SetNameL( iNameBuffer ); |
|
90 dialDataExt->SetPhoneNumberL( iTelNumber ); |
|
91 if ( aCallTypeVoIP ) |
|
92 { |
|
93 dialDataExt->SetCallType( CAiwDialData::EAIWVoiP ); |
|
94 } |
|
95 else |
|
96 { |
|
97 dialDataExt->SetCallType( CAiwDialData::EAIWVoice ); |
|
98 } |
|
99 dialDataExt->SetWindowGroup( CCoeEnv::Static()->RootWin().Identifier() ); |
|
100 CAiwGenericParamList& paramList = serviceHandler->InParamListL(); |
|
101 dialDataExt->FillInParamListL( paramList ); |
|
102 // Execute AIW command with notification callback |
|
103 serviceHandler->ExecuteServiceCmdL( KAiwCmdCall, |
|
104 paramList, |
|
105 serviceHandler->OutParamListL(), |
|
106 0, |
|
107 NULL ); |
|
108 serviceHandler->DetachL( interest ); |
|
109 CleanupStack::PopAndDestroy( 4 ); // criteria, interest, serviceHandler, dialDataExt |
|
110 CleanupStack::PopAndDestroy(); // this (Destroy itself as promised) |
|
111 } |
|
112 |
|
113 |
|
114 // --------------------------------------------------------- |
|
115 // CMuiuCallCmd::ConstructL |
|
116 // |
|
117 // Symbian OS default constructor can leave. |
|
118 // --------------------------------------------------------- |
|
119 void CMuiuCallCmd::ConstructL() |
|
120 { |
|
121 } |
|
122 |
|
123 |
|
124 // End of File |