|
1 /* |
|
2 * Copyright (c) 2006-2009 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: This is the implementation of the class for global dialer. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "vcmanagerdialer_aiw.h" |
|
21 #include <AiwCommon.hrh> //KAiwCmdCall |
|
22 #include <aiwdialdataext.h> |
|
23 #include <AiwDialDataTypes.h> |
|
24 #include <AiwServiceHandler.h> |
|
25 |
|
26 // ================= MEMBER FUNCTIONS ======================= |
|
27 |
|
28 // --------------------------------------------------------- |
|
29 // CVcManagerDialer::NewL |
|
30 // Two-phased constructor. |
|
31 // --------------------------------------------------------- |
|
32 // |
|
33 CVcManagerDialer* CVcManagerDialer::NewL() |
|
34 { |
|
35 CVcManagerDialer* self = new (ELeave) CVcManagerDialer; |
|
36 CleanupStack::PushL( self ); |
|
37 self->ConstructL(); |
|
38 CleanupStack::Pop( self ); |
|
39 return self; |
|
40 } |
|
41 |
|
42 // --------------------------------------------------------- |
|
43 // CVcManagerDialer::~CVcManagerDialer |
|
44 // Destructor |
|
45 // --------------------------------------------------------- |
|
46 // |
|
47 CVcManagerDialer::~CVcManagerDialer() |
|
48 { |
|
49 delete iServiceHandler; |
|
50 } |
|
51 |
|
52 // --------------------------------------------------------- |
|
53 // CVcManagerDialer::ExecuteLD |
|
54 // Execute dialer |
|
55 // --------------------------------------------------------- |
|
56 // |
|
57 void CVcManagerDialer::ExecuteL( TPtrC aName, TPtrC aNumber, TCallType aCallType ) |
|
58 { |
|
59 if( aNumber.Length() ) |
|
60 { |
|
61 CAiwDialDataExt* dialData = CAiwDialDataExt::NewLC(); |
|
62 dialData->SetNameL( aName.Left( AIWDialDataExt::KMaximumNameLength ) ); |
|
63 dialData->SetPhoneNumberL( aNumber ); |
|
64 |
|
65 // convert TPbkFielId to TAiwCallType |
|
66 CAiwDialData::TCallType callType( CAiwDialData::EAIWForcedCS ); |
|
67 |
|
68 if ( aCallType == EVideo ) |
|
69 { |
|
70 callType = CAiwDialData::EAIWForcedVideo; |
|
71 } |
|
72 else if ( aCallType == EVoIP ) |
|
73 { |
|
74 callType = CAiwDialData::EAIWVoiP; |
|
75 } |
|
76 |
|
77 dialData->SetCallType( callType ); |
|
78 |
|
79 CAiwGenericParamList& paramList = iServiceHandler->InParamListL(); |
|
80 dialData->FillInParamListL(paramList); |
|
81 |
|
82 iServiceHandler->ExecuteServiceCmdL( KAiwCmdCall, |
|
83 paramList, |
|
84 iServiceHandler->OutParamListL(), |
|
85 0, |
|
86 NULL ); //Callback is NULL as no dial results wanted. |
|
87 |
|
88 CleanupStack::PopAndDestroy( dialData ); |
|
89 } |
|
90 } |
|
91 |
|
92 // --------------------------------------------------------- |
|
93 // CVcManagerDialer::CVcManagerDialer |
|
94 // C++ default constructor can NOT contain any code, that |
|
95 // might leave. |
|
96 // --------------------------------------------------------- |
|
97 // |
|
98 CVcManagerDialer::CVcManagerDialer() |
|
99 { |
|
100 // nothing |
|
101 } |
|
102 |
|
103 // --------------------------------------------------------- |
|
104 // CVcManagerDialer::ConstructL |
|
105 // Second phase constructor. |
|
106 // --------------------------------------------------------- |
|
107 // |
|
108 void CVcManagerDialer::ConstructL() |
|
109 { |
|
110 iServiceHandler = CAiwServiceHandler::NewL(); |
|
111 |
|
112 // Create AIW interest |
|
113 RCriteriaArray interest; |
|
114 CleanupClosePushL( interest ); |
|
115 CAiwCriteriaItem* criteria = CAiwCriteriaItem::NewLC( KAiwCmdCall, KAiwCmdCall, |
|
116 _L8( "*" ) ); |
|
117 TUid base; |
|
118 base.iUid = KAiwClassBase; |
|
119 criteria->SetServiceClass( base ); |
|
120 User::LeaveIfError( interest.Append( criteria ) ); |
|
121 |
|
122 // attach to AIW interest |
|
123 iServiceHandler->AttachL( interest ); |
|
124 |
|
125 CleanupStack::PopAndDestroy( criteria ); |
|
126 CleanupStack::PopAndDestroy( &interest ); |
|
127 } |
|
128 |
|
129 |
|
130 // End of File |