author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:15:42 +0300 | |
branch | RCL_3 |
changeset 40 | 7fb4a99d4b6b |
parent 37 | 590f6f022902 |
permissions | -rw-r--r-- |
35 | 1 |
/* |
2 |
* Copyright (c) 2006 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: Dialer feature |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#include <cvtlogger.h> |
|
20 |
#include <cvideodtmfdialer.h> |
|
21 |
#include <AknsDrawUtils.h> |
|
22 |
#include <AknsUtils.h> |
|
23 |
#include <aknlayoutscalable_apps.cdl.h> |
|
24 |
#include <aknlayoutscalable_avkon.cdl.h> |
|
25 |
#include <layoutmetadata.cdl.h> |
|
26 |
#include <featmgr.h> |
|
27 |
#include <AknsBasicBackgroundControlContext.h> |
|
28 |
#include <akntoolbar.h> |
|
29 |
||
37
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
30 |
#include <videotelui.rsg> |
35 | 31 |
#include "VtUiUtility.h" |
32 |
#include "VtUiLayout.h" |
|
33 |
#include "mvtuicomponentmanager.h" |
|
34 |
#include "cvtuidialercontainer.h" |
|
35 |
#include "cvtuidialervideocontrol.h" |
|
36 |
#include "tvtuiwsevent.h" |
|
37 |
#include "tvtuistates.h" |
|
38 |
#include "cvtuidialerskmodifier.h" |
|
39 |
#include "cvtuifeaturemanager.h" |
|
40 |
#include "CVtUiAppUi.h" |
|
41 |
#include "mvtuicommandmanager.h" |
|
42 |
#include "cvtuidtmfbuffer.h" |
|
43 |
#include "CVtUiMainControl.h" |
|
44 |
#include "CVtUiContextControl.h" |
|
45 |
#include "CVtUiRemoteVideoControl.h" |
|
46 |
#include "CVtUiEndCallButtonPane.h" |
|
47 |
// Index of white color. |
|
48 |
const TInt KVtUiColorWhite = 0; |
|
49 |
||
50 |
const TInt KVtUiActOrdinalPos = 2; |
|
51 |
const TInt KVtUiDeactOrdinalPos = 4; |
|
52 |
||
53 |
// Implementation of TVtUiMiniDialerComponentState |
|
54 |
||
55 |
// --------------------------------------------------------------------------- |
|
56 |
// TVtUiDialerComponentState::TVtUiDialerComponentState |
|
57 |
// --------------------------------------------------------------------------- |
|
58 |
// |
|
59 |
TVtUiDialerComponentState::TVtUiDialerComponentState( |
|
60 |
MVtUiComponent& aComponent ) : |
|
61 |
TVtUiComponentState( aComponent, |
|
62 |
TVtUiBlockListBitField( |
|
63 |
MVtUiComponent::EComponentIdToolbar | |
|
64 |
MVtUiComponent::EComponentIdNumberEntry ) ) |
|
65 |
{ |
|
66 |
} |
|
67 |
||
68 |
// Implementation of CVtUiDialerContainer |
|
69 |
||
70 |
// --------------------------------------------------------------------------- |
|
71 |
// CVtUiDialerContainer::NewL |
|
72 |
// --------------------------------------------------------------------------- |
|
73 |
// |
|
74 |
CVtUiDialerContainer* CVtUiDialerContainer::NewL( |
|
75 |
CVtUiFeatureManager& aFeatureManager ) |
|
76 |
{ |
|
77 |
__VTPRINTENTER( "DialContainer.NewL" ) |
|
78 |
CVtUiDialerContainer* self = |
|
79 |
new ( ELeave ) CVtUiDialerContainer( aFeatureManager ); |
|
80 |
CleanupStack::PushL( self ); |
|
81 |
self->ConstructL( aFeatureManager.AppUi().BitmapManager() ); |
|
82 |
CleanupStack::Pop(); // self |
|
83 |
__VTPRINTEXIT( "DialContainer.NewL" ) |
|
84 |
return self; |
|
85 |
} |
|
86 |
||
87 |
// --------------------------------------------------------------------------- |
|
88 |
// CVtUiDialerContainer::~CVtUiDialerContainer |
|
89 |
// --------------------------------------------------------------------------- |
|
90 |
// |
|
91 |
CVtUiDialerContainer::~CVtUiDialerContainer() |
|
92 |
{ |
|
93 |
__VTPRINTENTER( "DialContainer.~" ) |
|
37
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
94 |
delete iEmergency; |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
95 |
iServer.Close(); |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
96 |
|
35 | 97 |
delete iAsyncDeactivate; |
98 |
delete iVideoControl; |
|
99 |
delete iDialer; |
|
100 |
delete iSKModifier; |
|
101 |
delete iInputBuffer; |
|
102 |
delete iBgContext; |
|
103 |
AknsUtils::DeregisterControlPosition( this ); |
|
104 |
__VTPRINTEXIT( "DialContainer.~" ) |
|
105 |
} |
|
106 |
||
107 |
// --------------------------------------------------------------------------- |
|
108 |
// CVtUiDialerContainer::HandleResourceChangeL |
|
109 |
// --------------------------------------------------------------------------- |
|
110 |
// |
|
111 |
void CVtUiDialerContainer::HandleResourceChangeL( TInt aType ) |
|
112 |
{ |
|
113 |
__VTPRINTENTER( "DialContainer.HandleResourceChangeL" ) |
|
114 |
switch ( aType ) |
|
115 |
{ |
|
116 |
case KEikDynamicLayoutVariantSwitch: |
|
117 |
case KAknsMessageSkinChange: |
|
118 |
LayoutDialerContainer(); |
|
119 |
break; |
|
120 |
default: |
|
121 |
break; |
|
122 |
} |
|
123 |
||
124 |
CCoeControl::HandleResourceChange( aType ); |
|
125 |
||
126 |
__VTPRINTEXIT( "DialContainer.HandleResourceChangeL" ) |
|
127 |
} |
|
128 |
||
129 |
// --------------------------------------------------------------------------- |
|
130 |
// CVtUiDialerContainer::ComponentId |
|
131 |
// --------------------------------------------------------------------------- |
|
132 |
// |
|
133 |
MVtUiComponent::TComponentId CVtUiDialerContainer::ComponentId() const |
|
134 |
{ |
|
135 |
return EComponentIdDialer; |
|
136 |
} |
|
137 |
||
138 |
// --------------------------------------------------------------------------- |
|
139 |
// CVtUiDialerContainer::ComponentAsControl |
|
140 |
// --------------------------------------------------------------------------- |
|
141 |
// |
|
142 |
CCoeControl* CVtUiDialerContainer::ComponentAsControl() |
|
143 |
{ |
|
144 |
return iVideoControl; |
|
145 |
} |
|
146 |
||
147 |
// --------------------------------------------------------------------------- |
|
148 |
// CVtUiDialerContainer::DoActivateL |
|
149 |
// --------------------------------------------------------------------------- |
|
150 |
// |
|
151 |
void CVtUiDialerContainer::DoActivateL() |
|
152 |
{ |
|
153 |
__VTPRINTENTER( "DialContainer.DoActivateL" ) |
|
154 |
iUiStates.SetIsDialerActivating( EFalse ); |
|
155 |
LayoutDialerContainer(); |
|
156 |
Reset(); |
|
157 |
||
158 |
// Sort control windows' ordinal pos |
|
159 |
TInt ordinalPos = KVtUiActOrdinalPos; |
|
160 |
CVtUiAppUi& appUi = iFeatureManager->AppUi(); |
|
161 |
appUi.MainControl().DrawableWindow()->SetOrdinalPosition( |
|
162 |
ordinalPos--, |
|
163 |
appUi.MainControl().DrawableWindow()->OrdinalPriority() ); |
|
164 |
||
165 |
appUi.CurrentFixedToolbar()->DrawableWindow()->SetOrdinalPosition( |
|
166 |
ordinalPos--, |
|
167 |
appUi.CurrentFixedToolbar()->DrawableWindow()->OrdinalPriority() ); |
|
168 |
||
169 |
iDialer->DrawableWindow()->SetOrdinalPosition( |
|
170 |
ordinalPos--, iDialer->DrawableWindow()->OrdinalPriority() ); |
|
171 |
||
172 |
iVideoControl->MakeVisible( ETrue ); |
|
173 |
iDialer->MakeVisible( ETrue ); |
|
174 |
MakeVisible( ETrue ); |
|
175 |
// Force a resource change and draw for the dialer |
|
176 |
HandleResourceChange( KAknsMessageSkinChange ); |
|
177 |
DrawNow(); |
|
178 |
User::LeaveIfError( iFeatureManager-> |
|
179 |
CommandManager().AddCommandModifier( *iSKModifier ) ); |
|
180 |
iInputBuffer->Activate(); |
|
181 |
iMode = CVtUiAppUi::ERenderingModeDialer; |
|
182 |
TVtUiWsEvent< CVtUiAppUi::TRenderingMode > renderingEvent( |
|
183 |
EVtUiWsEventBeginRenderingMode, &iMode ); |
|
184 |
iCoeEnv->WsSession().SendEventToWindowGroup( |
|
185 |
Window().WindowGroupId(), renderingEvent ); |
|
186 |
iUiStates.SetIsDialerOpen( ETrue ); |
|
187 |
iAsyncDeactivate->Cancel(); |
|
188 |
__VTPRINTEXIT( "DialContainer.DoActivateL" ) |
|
189 |
} |
|
190 |
||
191 |
// --------------------------------------------------------------------------- |
|
192 |
// CVtUiDialerContainer::DoDeactivateL |
|
193 |
// --------------------------------------------------------------------------- |
|
194 |
// |
|
195 |
void CVtUiDialerContainer::DoDeactivateL() |
|
196 |
{ |
|
197 |
__VTPRINTENTER( "DialContainer.DoDeactivateL" ) |
|
198 |
iFeatureManager->CommandManager(). |
|
199 |
RemoveCommandModifier( *iSKModifier ); |
|
200 |
iUiStates.SetIsDialerOpen( EFalse ); |
|
201 |
||
202 |
// Sort control windows' ordinal pos |
|
203 |
TInt ordinalPos = KVtUiDeactOrdinalPos; |
|
204 |
CVtUiAppUi& appUi = iFeatureManager->AppUi(); |
|
205 |
appUi.MainControl().DrawableWindow()->SetOrdinalPosition( |
|
206 |
ordinalPos--, |
|
207 |
appUi.MainControl().DrawableWindow()->OrdinalPriority() ); |
|
208 |
||
209 |
appUi.CurrentFixedToolbar()->DrawableWindow()->SetOrdinalPosition( |
|
210 |
ordinalPos--, |
|
211 |
appUi.CurrentFixedToolbar()->DrawableWindow()->OrdinalPriority() ); |
|
212 |
||
213 |
appUi.EndCallButtonPane().DrawableWindow()->SetOrdinalPosition( |
|
214 |
ordinalPos--, |
|
215 |
appUi.EndCallButtonPane().DrawableWindow()->OrdinalPriority() ); |
|
216 |
||
217 |
appUi.ContextControl().DrawableWindow()->SetOrdinalPosition( |
|
218 |
ordinalPos--, |
|
219 |
appUi.ContextControl().DrawableWindow()->OrdinalPriority() ); |
|
220 |
||
221 |
appUi.RemoteVideoControl().DrawableWindow()->SetOrdinalPosition( |
|
222 |
ordinalPos--, |
|
223 |
appUi.RemoteVideoControl().DrawableWindow()->OrdinalPriority() ); |
|
224 |
||
225 |
iVideoControl->MakeVisible( EFalse ); |
|
226 |
iDialer->MakeVisible( EFalse ); |
|
227 |
MakeVisible( EFalse ); |
|
228 |
Reset(); |
|
229 |
iInputBuffer->Deactivate(); |
|
230 |
iAsyncDeactivate->CallBack(); |
|
231 |
__VTPRINTEXIT( "DialContainer.DoDeactivateL" ) |
|
232 |
} |
|
233 |
||
234 |
// --------------------------------------------------------------------------- |
|
235 |
// CVtUiDialerContainer::GetContents |
|
236 |
// --------------------------------------------------------------------------- |
|
237 |
// |
|
238 |
void CVtUiDialerContainer::GetContents( TDes& aContents ) const |
|
239 |
{ |
|
240 |
__VTPRINTENTER( "DialContainer.GetContents" ) |
|
241 |
iInputBuffer->GetContents( aContents ); |
|
242 |
__VTPRINTEXIT( "DialContainer.GetContents" ) |
|
243 |
} |
|
244 |
||
245 |
// --------------------------------------------------------------------------- |
|
246 |
// CVtUiDialerContainer::OfferKeyEventL |
|
247 |
// --------------------------------------------------------------------------- |
|
248 |
// |
|
249 |
TKeyResponse CVtUiDialerContainer::OfferKeyEventL( const TKeyEvent& aEvent, |
|
250 |
TEventCode aType ) |
|
251 |
{ |
|
252 |
__VTPRINTENTER( "DialContainer.OfferKeyEventL" ) |
|
253 |
TKeyResponse response( EKeyWasNotConsumed ); |
|
254 |
TChar dtmfTone; |
|
255 |
if ( VtUiUtility::IsDTMFEvent( aEvent, dtmfTone ) && |
|
256 |
( aType == EEventKey ) ) |
|
257 |
{ |
|
258 |
response = EKeyWasConsumed; |
|
259 |
AppendDigit( dtmfTone ); |
|
260 |
} |
|
261 |
__VTPRINTEXIT( "DialContainer.OfferKeyEventL" ) |
|
262 |
return response; |
|
263 |
} |
|
264 |
||
265 |
// --------------------------------------------------------------------------- |
|
266 |
// CVtUiDialerContainer::Draw |
|
267 |
// --------------------------------------------------------------------------- |
|
268 |
// |
|
269 |
void CVtUiDialerContainer::Draw( const TRect& ) const |
|
270 |
{ |
|
271 |
__VTPRINTENTER( "DialContainer.Draw" ) |
|
272 |
CWindowGc& gc( SystemGc() ); |
|
273 |
gc.SetBrushStyle( CWindowGc::ESolidBrush ); |
|
274 |
gc.SetPenStyle( CGraphicsContext::ENullPen ); |
|
275 |
gc.SetBrushColor( AKN_LAF_COLOR( KVtUiColorWhite ) ); |
|
276 |
gc.Clear(); |
|
277 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
278 |
MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); |
|
279 |
AknsDrawUtils::Background( skin, cc, this, gc, Rect() ); |
|
280 |
__VTPRINTEXIT( "DialContainer.Draw" ) |
|
281 |
} |
|
282 |
||
283 |
// --------------------------------------------------------------------------- |
|
284 |
// CVtUiDialerContainer::SizeChanged |
|
285 |
// --------------------------------------------------------------------------- |
|
286 |
// |
|
287 |
void CVtUiDialerContainer::SizeChanged() |
|
288 |
{ |
|
289 |
__VTPRINTENTER( "DialContainer.SizeChanged" ) |
|
290 |
TRect bgRect; |
|
291 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, bgRect ); |
|
292 |
iBgContext->SetRect( bgRect ); |
|
293 |
||
294 |
AknsUtils::RegisterControlPosition( this ); |
|
295 |
CCoeControl::SizeChanged(); |
|
296 |
__VTPRINTEXIT( "DialContainer.SizeChanged" ) |
|
297 |
} |
|
298 |
||
299 |
// --------------------------------------------------------------------------- |
|
300 |
// CVtUiDialerContainer::PositionChanged |
|
301 |
// --------------------------------------------------------------------------- |
|
302 |
// |
|
303 |
void CVtUiDialerContainer::PositionChanged() |
|
304 |
{ |
|
305 |
__VTPRINTENTER( "DialContainer.PositionChanged" ) |
|
306 |
AknsUtils::RegisterControlPosition( this ); |
|
307 |
CCoeControl::PositionChanged(); |
|
308 |
__VTPRINTEXIT( "DialContainer.PositionChanged" ) |
|
309 |
} |
|
310 |
||
311 |
// --------------------------------------------------------------------------- |
|
312 |
// CVtUiDialerContainer::CountComponentControls |
|
313 |
// --------------------------------------------------------------------------- |
|
314 |
// |
|
315 |
TInt CVtUiDialerContainer::CountComponentControls() const |
|
316 |
{ |
|
317 |
return iDialer ? 1 : 0; |
|
318 |
} |
|
319 |
||
320 |
// --------------------------------------------------------------------------- |
|
321 |
// CVtUiDialerContainer::ComponentControl |
|
322 |
// --------------------------------------------------------------------------- |
|
323 |
// |
|
324 |
CCoeControl* CVtUiDialerContainer::ComponentControl( TInt aIndex ) const |
|
325 |
{ |
|
326 |
CCoeControl* result = NULL; |
|
327 |
switch ( aIndex ) |
|
328 |
{ |
|
329 |
case 0: |
|
330 |
result = iDialer; |
|
331 |
break; |
|
332 |
default: |
|
333 |
break; |
|
334 |
} |
|
335 |
return result; |
|
336 |
} |
|
337 |
||
338 |
// --------------------------------------------------------------------------- |
|
339 |
// CVtUiDialerContainer::CVtUiDialerContainer |
|
340 |
// --------------------------------------------------------------------------- |
|
341 |
// |
|
342 |
CVtUiDialerContainer::CVtUiDialerContainer( |
|
343 |
CVtUiFeatureManager& aFeatureManager ) : |
|
344 |
iComponentState( *this ), |
|
345 |
iFeatureManager( &aFeatureManager ), |
|
346 |
iComponentManager( &aFeatureManager.ComponentManager() ), |
|
347 |
iUiStates( aFeatureManager.UiStates() ) |
|
348 |
{ |
|
349 |
__VTPRINTENTER( "DialContainer.ctor" ) |
|
350 |
__VTPRINTEXIT( "DialContainer.ctor" ) |
|
351 |
} |
|
352 |
||
353 |
// --------------------------------------------------------------------------- |
|
354 |
// CVtUiDialerContainer::ConstructL |
|
355 |
// --------------------------------------------------------------------------- |
|
356 |
// |
|
357 |
void CVtUiDialerContainer::ConstructL( CVtUiBitmapManager& aBitmapManager ) |
|
358 |
{ |
|
359 |
__VTPRINTENTER( "DialContainer.ConstructL" ) |
|
360 |
iBgContext = CAknsBasicBackgroundControlContext::NewL( |
|
361 |
KAknsIIDQsnBgScreen, Rect(), ETrue ); |
|
362 |
CreateWindowL(); |
|
363 |
DrawableWindow()->SetPointerGrab( ETrue ); |
|
364 |
SetExtent( TPoint(), TSize() ); |
|
365 |
ActivateL(); |
|
366 |
MakeVisible( EFalse ); |
|
37
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
367 |
iInputBuffer = CVtUiDTMFBuffer::NewL( *iCoeEnv, this ); |
35 | 368 |
iVideoControl = CVtUiDialerVideoControl::NewL( aBitmapManager ); |
369 |
iDialer = CVideoDTMFDialer::NewL( *this, *iVideoControl, DialerRect() ); |
|
370 |
||
371 |
iSKModifier = CVtUiDialerSKModifier::NewL( *iFeatureManager ); |
|
372 |
// Disable fading when using DP (eliminates nasty color error) |
|
373 |
if ( FeatureManager::FeatureSupported( KFeatureIdDisplayPost ) ) |
|
374 |
{ |
|
375 |
Window().SetNonFading( ETrue ); |
|
376 |
} |
|
377 |
iAsyncDeactivate = new ( ELeave ) CAsyncCallBack( |
|
378 |
TCallBack( ASyncDoDeactivate, this ), CActive::EPriorityLow ); |
|
37
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
379 |
|
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
380 |
// PhClt initialization |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
381 |
User::LeaveIfError( iServer.Connect() ); |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
382 |
iEmergency = CPhCltEmergencyCall::NewL( this ); |
35 | 383 |
__VTPRINTEXIT( "DialContainer.ConstructL" ) |
384 |
} |
|
385 |
||
386 |
// --------------------------------------------------------------------------- |
|
387 |
// CVtUiDialerContainer::RegisterComponentL |
|
388 |
// --------------------------------------------------------------------------- |
|
389 |
// |
|
390 |
void CVtUiDialerContainer::RegisterComponentL() |
|
391 |
{ |
|
392 |
__VTPRINTENTER( "DialContainer.RegisterComponentL" ) |
|
393 |
User::LeaveIfError( iComponentManager->ChangeResourceChangeRegistration( |
|
394 |
*this, MVtUiComponentManager::ERegister ) ); |
|
395 |
User::LeaveIfError( |
|
396 |
iComponentManager->ChangeComponentRegistration( |
|
397 |
iComponentState, MVtUiComponentManager::ERegister ) ); |
|
398 |
User::LeaveIfError( iComponentManager->ChangeKeyEventRegistration( |
|
399 |
*this, MVtUiComponentManager::ERegister ) ); |
|
400 |
__VTPRINTEXIT( "DialContainer.RegisterComponentL" ) |
|
401 |
} |
|
402 |
||
403 |
// --------------------------------------------------------------------------- |
|
404 |
// CVtUiDialerContainer::UnregisterComponent |
|
405 |
// --------------------------------------------------------------------------- |
|
406 |
// |
|
407 |
void CVtUiDialerContainer::UnregisterComponent() |
|
408 |
{ |
|
409 |
__VTPRINTENTER( "DialContainer.UnregisterComponent" ) |
|
410 |
iComponentManager->ChangeComponentRegistration( |
|
411 |
iComponentState, MVtUiComponentManager::EUnregister ); |
|
412 |
iComponentManager->ChangeResourceChangeRegistration( |
|
413 |
*this, MVtUiComponentManager::EUnregister ); |
|
414 |
iComponentManager->ChangeKeyEventRegistration( |
|
415 |
*this, MVtUiComponentManager::EUnregister ); |
|
416 |
__VTPRINTEXIT( "DialContainer.UnregisterComponent" ) |
|
417 |
} |
|
418 |
||
419 |
// --------------------------------------------------------------------------- |
|
420 |
// CVtUiDialerContainer::UnregisterComponent |
|
421 |
// --------------------------------------------------------------------------- |
|
422 |
// |
|
423 |
MVtUiVideoWindow* CVtUiDialerContainer::ComponentAsVideoWindow() |
|
424 |
{ |
|
425 |
__VTPRINTENTER( "DialContainer.ComponentAsVideoWindow" ) |
|
426 |
__VTPRINTEXIT( "DialContainer.ComponentAsVideoWindow" ) |
|
427 |
return iVideoControl; |
|
428 |
} |
|
429 |
||
430 |
// --------------------------------------------------------------------------- |
|
431 |
// CVtUiDialerContainer::LayoutDialerContainer |
|
432 |
// --------------------------------------------------------------------------- |
|
433 |
// |
|
434 |
void CVtUiDialerContainer::LayoutDialerContainer() |
|
435 |
{ |
|
436 |
__VTPRINTENTER( "DialContainer.LayoutDialerContainer" ) |
|
437 |
||
438 |
TAknWindowLineLayout mainPaneLL; |
|
439 |
||
440 |
if ( Layout_Meta_Data::IsLandscapeOrientation() ) |
|
441 |
{ |
|
442 |
// Landscape: Option11 (thin status pane, lsc) |
|
443 |
mainPaneLL = AknLayoutScalable_Apps::main_pane( 15 ).LayoutLine(); |
|
444 |
} |
|
445 |
else |
|
446 |
{ |
|
447 |
// Portrait: main pane with status pane off, control pane on |
|
448 |
mainPaneLL = AknLayoutScalable_Apps::main_pane( 9 ).LayoutLine(); |
|
449 |
} |
|
450 |
||
451 |
TRect appWinRect; |
|
452 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EApplicationWindow, |
|
453 |
appWinRect ); |
|
454 |
||
455 |
// Layout container |
|
456 |
AknLayoutUtils::LayoutControl( this, appWinRect, mainPaneLL ); |
|
457 |
||
458 |
// Layout dialer |
|
459 |
const TInt variety( Layout_Meta_Data::IsLandscapeOrientation() ? |
|
460 |
1 : 0 ); |
|
461 |
TAknWindowLineLayout dialerLLout( |
|
462 |
AknLayoutScalable_Apps::main_video_tele_dialer_pane( |
|
463 |
variety ).LayoutLine() ); |
|
464 |
AknLayoutUtils::LayoutControl( iDialer, Rect(), dialerLLout ); |
|
465 |
||
466 |
// Layout video control |
|
467 |
AknLayoutUtils::LayoutControl( iVideoControl, iDialer->Rect(), |
|
468 |
AknLayoutScalable_Apps::video_down_pane_cp( |
|
469 |
variety ).LayoutLine() ); |
|
470 |
||
471 |
__VTPRINTEXIT( "DialContainer.LayoutDialerContainer" ) |
|
472 |
} |
|
473 |
||
474 |
// --------------------------------------------------------------------------- |
|
475 |
// CVtUiDialerContainer::DialerRect |
|
476 |
// --------------------------------------------------------------------------- |
|
477 |
// |
|
478 |
TRect CVtUiDialerContainer::DialerRect() const |
|
479 |
{ |
|
480 |
__VTPRINTENTER( "DialContainer.DialerRect" ) |
|
481 |
TRect mainPaneRect; |
|
482 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, |
|
483 |
mainPaneRect ); |
|
484 |
__VTPRINTEXIT( "DialContainer.DialerRect" ) |
|
485 |
return mainPaneRect; |
|
486 |
} |
|
487 |
||
488 |
// --------------------------------------------------------------------------- |
|
489 |
// CVtUiDialerContainer::Reset |
|
490 |
// --------------------------------------------------------------------------- |
|
491 |
// |
|
492 |
void CVtUiDialerContainer::Reset() |
|
493 |
{ |
|
494 |
__VTPRINTENTER( "DialContainer.Reset" ) |
|
495 |
iInputBuffer->Reset(); |
|
496 |
__VTPRINTEXIT( "DialContainer.Reset" ) |
|
497 |
} |
|
498 |
||
499 |
// --------------------------------------------------------------------------- |
|
500 |
// CVtUiDialerContainer::AppendDigit |
|
501 |
// --------------------------------------------------------------------------- |
|
502 |
// |
|
503 |
void CVtUiDialerContainer::AppendDigit( TChar aDigit ) |
|
504 |
{ |
|
505 |
__VTPRINTENTER( "DialContainer.AppendDigit" ) |
|
506 |
iInputBuffer->Append( aDigit ); |
|
507 |
__VTPRINTEXIT( "DialContainer.AppendDigit" ) |
|
508 |
} |
|
509 |
||
510 |
// --------------------------------------------------------------------------- |
|
511 |
// CVtUiDialerContainer::MopSupplyObject |
|
512 |
// --------------------------------------------------------------------------- |
|
513 |
// |
|
514 |
TTypeUid::Ptr CVtUiDialerContainer::MopSupplyObject( TTypeUid aId ) |
|
37
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
515 |
{ |
35 | 516 |
__VTPRINTENTER( "CVtUiDialerContainer.MopSupplyObject" ) |
37
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
517 |
// Required during rendering of the background skin in Draw() |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
518 |
if (aId.iUid == MAknsControlContext::ETypeId) |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
519 |
{ |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
520 |
__VTPRINTEXIT( "CVtUiDialerContainer.MopSupplyObject.1" ) |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
521 |
return MAknsControlContext::SupplyMopObject( aId, iBgContext ); |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
522 |
} |
35 | 523 |
__VTPRINTEXIT( "CVtUiDialerContainer.MopSupplyObject.2" ) |
37
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
524 |
return CCoeControl::MopSupplyObject( aId ); |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
525 |
} |
35 | 526 |
|
527 |
// --------------------------------------------------------------------------- |
|
528 |
// CVtUiDialerContainer::ASyncDoDeactivate |
|
529 |
// --------------------------------------------------------------------------- |
|
530 |
// |
|
531 |
TInt CVtUiDialerContainer::ASyncDoDeactivate( TAny* aSelf ) |
|
532 |
{ |
|
533 |
__VTPRINTENTER( "DialContainer.ASyncDoDeactivate" ) |
|
534 |
CVtUiDialerContainer* self = |
|
535 |
reinterpret_cast< CVtUiDialerContainer* >( aSelf ); |
|
536 |
self->iMode = CVtUiAppUi::ERenderingModeDialer; |
|
537 |
TVtUiWsEvent< CVtUiAppUi::TRenderingMode > renderingEvent( |
|
538 |
EVtUiWsEventEndRenderingMode, &self->iMode ); |
|
539 |
self->iCoeEnv->WsSession().SendEventToWindowGroup( |
|
540 |
self->Window().WindowGroupId(), renderingEvent ); |
|
541 |
__VTPRINTEXIT( "DialContainer.ASyncDoDeactivate" ) |
|
542 |
return KErrNone; |
|
543 |
} |
|
37
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
544 |
|
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
545 |
// ----------------------------------------------------------------------------- |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
546 |
// CVtUiDialerContainer::HandleEmergencyDialL |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
547 |
// ----------------------------------------------------------------------------- |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
548 |
// |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
549 |
void CVtUiDialerContainer::HandleEmergencyDialL( |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
550 |
const TInt ) |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
551 |
{ |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
552 |
__VTPRINTENTER( "CVtUiDialerContainer.HandleEmergencyDialL" ) |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
553 |
// do nothing |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
554 |
__VTPRINTEXIT( "CVtUiDialerContainer.HandleEmergencyDialL" ) |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
555 |
} |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
556 |
|
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
557 |
// ----------------------------------------------------------------------------- |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
558 |
// CVtUiDialerContainer::NotifyDTMFBufferChanged |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
559 |
// ----------------------------------------------------------------------------- |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
560 |
// |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
561 |
void CVtUiDialerContainer::NotifyDTMFBufferChangedL() |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
562 |
{ |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
563 |
__VTPRINTENTER( "CVtUiDialerContainer.NotifyDTMFBufferChanged" ) |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
564 |
CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
565 |
|
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
566 |
// Get the buffer |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
567 |
TBuf<KVtUiDTMFBufferSize> dtmfBuffer; |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
568 |
GetContents( dtmfBuffer ); |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
569 |
|
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
570 |
// If buffer is empty |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
571 |
if ( !dtmfBuffer.Length() ) |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
572 |
{ |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
573 |
__VTPRINT( DEBUG_GEN, "CVtUiDialerContainer.NotifyDTMFBufferChanged, buffer is emtpy") |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
574 |
cba->SetCommandSetL( R_VIDEOTELUI_SOFTKEYS_EMPTY_DIALEREXIT ); |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
575 |
} |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
576 |
else |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
577 |
{ |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
578 |
// First we have to see if current buffer is a EC number |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
579 |
AknTextUtils::ConvertDigitsTo( dtmfBuffer, EDigitTypeWestern ); |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
580 |
if ( !iEmergency ) |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
581 |
{ |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
582 |
iEmergency = CPhCltEmergencyCall::NewL( this ); |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
583 |
} |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
584 |
TBool isEmergencyNumber = EFalse; |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
585 |
const TInt err = |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
586 |
iEmergency->FindEmergencyPhoneNumber( dtmfBuffer, isEmergencyNumber ); |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
587 |
|
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
588 |
__VTPRINT3( DEBUG_GEN, |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
589 |
"CVtUiDialerContainer.NotifyDTMFBufferChanged, err=%d, isEC=%d", |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
590 |
err, isEmergencyNumber ) |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
591 |
|
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
592 |
// No error and It's EC number |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
593 |
if ( err == KErrNone && isEmergencyNumber ) |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
594 |
{ |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
595 |
__VTPRINT( DEBUG_GEN, "CVtUiDialerContainer.NotifyDTMFBufferChanged, is EC") |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
596 |
// change CBA to 'EC-Back' |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
597 |
cba->SetCommandSetL( R_VIDEOTELUI_SOFTKEYS_EMERGCALL_DIALEREXIT ); |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
598 |
} |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
599 |
// Error happened, but it's EC number |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
600 |
else if ( err != KErrNone && isEmergencyNumber ) |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
601 |
{ |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
602 |
__VTPRINT( DEBUG_GEN, "CVtUiDialerContainer.NotifyDTMFBufferChanged, err happened") |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
603 |
cba->SetCommandSetL( R_VIDEOTELUI_SOFTKEYS_EMPTY_DIALEREXIT ); |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
604 |
} |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
605 |
else // not EC number and we don't care about the error |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
606 |
{ |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
607 |
__VTPRINT( DEBUG_GEN, "CVtUiDialerContainer.NotifyDTMFBufferChanged, not EC") |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
608 |
// change CBA to digitl we have on hand |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
609 |
// but at the moment we dont need this, so comment it out |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
610 |
//cba->SetCommandL( EAknSoftkeyEmpty, dtmfBuffer ); |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
611 |
} |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
612 |
} |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
613 |
cba->DrawNow(); |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
614 |
__VTPRINTEXIT( "CVtUiDialerContainer.NotifyDTMFBufferChanged" ) |
590f6f022902
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
615 |
} |