|
1 /* |
|
2 * Copyright (c) 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: Implements class CSPClientVideoCall which provides client video call |
|
15 * functionality |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #include <etelmm.h> |
|
21 #include <etel.h> |
|
22 #include <mccpcallobserver.h> |
|
23 #include <rmmcustomapi.h> |
|
24 |
|
25 #include "cspclientvideocall.h" |
|
26 #include "csplogger.h" |
|
27 #include "csppanic.pan" |
|
28 #include "cspconsts.h" |
|
29 #include "mcspcommoninfo.h" |
|
30 |
|
31 |
|
32 // --------------------------------------------------------------------------- |
|
33 // CSPClientVideoCall::NewL Two phased construction. |
|
34 // --------------------------------------------------------------------------- |
|
35 // |
|
36 CSPClientVideoCall* CSPClientVideoCall::NewL( const TDesC& aName, |
|
37 RMobileLine& aLine, |
|
38 const CCCECallParameters& aParams, |
|
39 MCSPCommonInfo& aCommonInfo ) |
|
40 { |
|
41 CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::NewL <<"); |
|
42 |
|
43 CSPClientVideoCall* self = new (ELeave) CSPClientVideoCall( aLine, |
|
44 aName, aCommonInfo ); |
|
45 CleanupStack::PushL( self ); |
|
46 self->ConstructL( aParams ); |
|
47 CleanupStack::Pop( self ); |
|
48 CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::NewL >>"); |
|
49 return self; |
|
50 } |
|
51 |
|
52 // --------------------------------------------------------------------------- |
|
53 // CSPClientVideoCall::~CSPClientVideoCall |
|
54 // --------------------------------------------------------------------------- |
|
55 // |
|
56 CSPClientVideoCall::~CSPClientVideoCall() |
|
57 { |
|
58 CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::~CSPClientVideoCall"); |
|
59 } |
|
60 |
|
61 // --------------------------------------------------------------------------- |
|
62 // CSPClientVideoCall::NotifyCallStateChanged |
|
63 // Notifies observers about state changes |
|
64 // --------------------------------------------------------------------------- |
|
65 // |
|
66 void CSPClientVideoCall::NotifyCallStateChanged( |
|
67 MCCPCallObserver::TCCPCallState aState ) |
|
68 { |
|
69 CSPLOGSTRING2(CSPINT, |
|
70 "CSPClientVideoCall::NotifyCallStateChanged state: %d", |
|
71 aState); |
|
72 |
|
73 // Client call type is not valid before Dialling state |
|
74 if ( aState == MCCPCallObserver::ECCPStateDialling ) |
|
75 { |
|
76 CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::NotifyCallStateChanged\ |
|
77 updating call type"); |
|
78 |
|
79 CCPCall::TCallType callType = SelectCallTypeFromProtocolCaps(); |
|
80 iParams->SetCallType( callType ); |
|
81 |
|
82 // Indicate client call to observer in Dialling state |
|
83 IndicateClientCall(); |
|
84 } |
|
85 |
|
86 CSPVideoCall::NotifyCallStateChanged( aState ); |
|
87 } |
|
88 |
|
89 // --------------------------------------------------------------------------- |
|
90 // CSPClientVideoCall::NotifyCallStateChangedWithInband |
|
91 // Notifies observers about state changes |
|
92 // --------------------------------------------------------------------------- |
|
93 // |
|
94 void CSPClientVideoCall::NotifyCallStateChangedWithInband( |
|
95 MCCPCallObserver::TCCPCallState aState ) |
|
96 { |
|
97 CSPLOGSTRING2(CSPINT, |
|
98 "CSPClientVideoCall::NotifyCallStateChangedWithInband %d", aState); |
|
99 |
|
100 // Client call type info is not available before Dialling phase |
|
101 if ( aState == MCCPCallObserver::ECCPStateDialling ) |
|
102 { |
|
103 CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::NotifyCallStateChanged\ |
|
104 updating call type"); |
|
105 |
|
106 CCPCall::TCallType callType = SelectCallTypeFromProtocolCaps(); |
|
107 iParams->SetCallType( callType ); |
|
108 |
|
109 // Indicate client call to observer in Dialling state |
|
110 IndicateClientCall(); |
|
111 } |
|
112 |
|
113 CSPVideoCall::NotifyCallStateChangedWithInband( aState ); |
|
114 } |
|
115 |
|
116 // --------------------------------------------------------------------------- |
|
117 // CSPClientVideoCall::CSPClientVideoCall |
|
118 // --------------------------------------------------------------------------- |
|
119 // |
|
120 CSPClientVideoCall::CSPClientVideoCall( RMobileLine& aLine, |
|
121 const TDesC& aName, |
|
122 MCSPCommonInfo& aCommonInfo ) : |
|
123 CSPVideoCall( aLine, ETrue, aName, |
|
124 aCommonInfo ) |
|
125 { |
|
126 CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::CSPClientVideoCall"); |
|
127 // Set client call flag(s) |
|
128 iClientCallIndicated = EFalse; |
|
129 } |
|
130 |
|
131 // --------------------------------------------------------------------------- |
|
132 // CSPClientVideoCall::ConstructL |
|
133 // Constructing CSPClientVideoCall for MT call. |
|
134 // --------------------------------------------------------------------------- |
|
135 // |
|
136 void CSPClientVideoCall::ConstructL( const CCCECallParameters& aParams ) |
|
137 { |
|
138 CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::ConstructL <"); |
|
139 CSPVideoCall::ConstructL( aParams ); |
|
140 CSPLOGSTRING(CSPOBJECT, "CSPClientVideoCall::ConstructL >"); |
|
141 } |
|
142 |
|
143 // --------------------------------------------------------------------------- |
|
144 // CSPClientVideoCall::IndicateClientCall |
|
145 // Indicate dialling if needed |
|
146 // --------------------------------------------------------------------------- |
|
147 // |
|
148 void CSPClientVideoCall::IndicateClientCall() |
|
149 { |
|
150 // Can be done only once for each call and possible duplicate |
|
151 // notifies are blocked |
|
152 if ( !iClientCallIndicated ) |
|
153 { |
|
154 iClientCallIndicated = ETrue; |
|
155 |
|
156 CSPLOGSTRING(CSPINT, |
|
157 "CSPClientVideoCall::IndicateClientCall IndicateClientCall") |
|
158 |
|
159 iCommonInfo.IndicateClientCall( this ); |
|
160 |
|
161 CSPLOGSTRING(CSPINT, |
|
162 "CSPClientVideoCall::IndicateClientCall IndicateClientCall completed") |
|
163 } |
|
164 else |
|
165 { |
|
166 CSPLOGSTRING(CSPERROR, |
|
167 "CSPClientVideoCall::IndicateClientCall already indicated") |
|
168 } |
|
169 } |
|
170 |
|
171 // --------------------------------------------------------------------------- |
|
172 // CSPClientVideoCall::OpenCallHandleL |
|
173 // --------------------------------------------------------------------------- |
|
174 // |
|
175 void CSPClientVideoCall::OpenCallHandleL() |
|
176 { |
|
177 CSPLOGSTRING(CSPINT, "CSPClientVideoCall::OpenCallHandleL <"); |
|
178 |
|
179 // Client call, open existing call handle |
|
180 OpenExistingCallL( iName ); |
|
181 |
|
182 CSPLOGSTRING(CSPINT, "CSPClientVideoCall::OpenCallHandleL >"); |
|
183 } |
|
184 |
|
185 // --------------------------------------------------------------------------- |
|
186 // CSPClientVideoCall::UpdateCallInfoImpl |
|
187 // Update call info including remote party name and number data |
|
188 // --------------------------------------------------------------------------- |
|
189 // |
|
190 void CSPClientVideoCall::UpdateCallInfoImpl( RMobileCall::TMobileCallInfoV7 aCallInfo ) |
|
191 { |
|
192 CSPLOGSTRING(CSPINT, "CSPClientVideoCall::UpdateCallInfoImpl <"); |
|
193 |
|
194 // Call was added by ETel monitor, update info accordingly |
|
195 UpdateCallNameNumberInfo( aCallInfo, ETrue ); |
|
196 UpdateCallOrigin( aCallInfo ); |
|
197 |
|
198 CSPLOGSTRING(CSPINT, "CSPClientVideoCall::UpdateCallInfoImpl >"); |
|
199 } |
|
200 |
|
201 // End of File |