62
|
1 |
/*
|
|
2 |
* Copyright (c) 2007 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: Manager for the whole subsystem
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDE FILES
|
|
20 |
|
|
21 |
#include "BMBubbleManager.h"
|
|
22 |
#include "BMBubbleImageManager.h"
|
|
23 |
#include "BMResourceManager.h"
|
|
24 |
#include "BMCustomManager.h"
|
|
25 |
#include "BMBubbleOutlook.h"
|
|
26 |
#include "BMBubbleOutlookMiddle.h"
|
|
27 |
#include "BMBubbleOutlookConference.h"
|
|
28 |
#include "BMBubbleOutlookNE.h"
|
|
29 |
#include "BMCallHeader.h"
|
|
30 |
#include "BMConfHeader.h"
|
|
31 |
#include "BMPanic.h"
|
|
32 |
#include "BMUtils.h"
|
|
33 |
#include "BMLayout.h"
|
|
34 |
#include "BMBubbleImage.h"
|
|
35 |
#include "BubbleManagerPaths.h"
|
|
36 |
#include "BMCallObjectManager.h"
|
|
37 |
#include "BMLayout2.h"
|
|
38 |
#include "BMLayout3.h"
|
|
39 |
#include "BMLayout4.h"
|
|
40 |
#include "BMLayout6.h"
|
|
41 |
#include "BMCallObjectUtils.h"
|
|
42 |
#include "BMVideoController.h"
|
|
43 |
#include "BMTouchPane.h"
|
|
44 |
#include "BMTouchPaneInterface.h"
|
|
45 |
#include "BMMainPaneControl.h"
|
|
46 |
#include <eikimage.h> // for muted-image
|
|
47 |
#include <coemain.h>
|
|
48 |
#include <PbkFields.hrh> // for field id
|
|
49 |
#include <ConeResLoader.h>
|
|
50 |
#include <AknsUtils.h>
|
|
51 |
#include <NumberGrouping.h>
|
|
52 |
#include <AknDef.h>
|
|
53 |
#include <layoutmetadata.cdl.h>
|
|
54 |
|
|
55 |
#include <featmgr.h>
|
|
56 |
#include <telephonyvariant.hrh>
|
|
57 |
|
|
58 |
#include <centralrepository.h>
|
|
59 |
#include <NumberGroupingCRKeys.h>
|
|
60 |
#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
|
|
61 |
#include <gfxtranseffect/gfxtranseffect.h>
|
|
62 |
#include <akntransitionutils.h>
|
|
63 |
#endif
|
|
64 |
|
|
65 |
#include "BMBubbleDebug.h"
|
|
66 |
|
|
67 |
// ========================= MEMBER FUNCTIONS ================================
|
|
68 |
|
|
69 |
// ---------------------------------------------------------------------------
|
|
70 |
// CBubbleManager::NewL
|
|
71 |
// Symbian OS two phased constructor
|
|
72 |
//
|
|
73 |
// ---------------------------------------------------------------------------
|
|
74 |
//
|
|
75 |
EXPORT_C CBubbleManager* CBubbleManager::NewL( const CCoeControl& aContainer,
|
|
76 |
const TRect& aRect )
|
|
77 |
{
|
|
78 |
CBubbleManager* self = new( ELeave )CBubbleManager;
|
|
79 |
CleanupStack::PushL( self );
|
|
80 |
self->ConstructL( aContainer , aRect, EFalse );
|
|
81 |
CleanupStack::Pop(); // self
|
|
82 |
return self;
|
|
83 |
}
|
|
84 |
|
|
85 |
// ---------------------------------------------------------------------------
|
|
86 |
// CBubbleManager::NewL
|
|
87 |
// Symbian OS two phased constructor
|
|
88 |
//
|
|
89 |
// ---------------------------------------------------------------------------
|
|
90 |
//
|
|
91 |
EXPORT_C CBubbleManager* CBubbleManager::NewL( const CCoeControl& aContainer,
|
|
92 |
const TRect& aRect,
|
|
93 |
TBool aBigNEInIdle )
|
|
94 |
{
|
|
95 |
CBubbleManager* self = new( ELeave )CBubbleManager;
|
|
96 |
CleanupStack::PushL( self );
|
|
97 |
self->ConstructL( aContainer , aRect, aBigNEInIdle );
|
|
98 |
CleanupStack::Pop(); // self
|
|
99 |
return self;
|
|
100 |
}
|
|
101 |
|
|
102 |
// ---------------------------------------------------------------------------
|
|
103 |
// CBubbleManager::ConstructL
|
|
104 |
// Symbian OS two phased constructor
|
|
105 |
//
|
|
106 |
// ---------------------------------------------------------------------------
|
|
107 |
//
|
|
108 |
|
|
109 |
void CBubbleManager::ConstructL(
|
|
110 |
const CCoeControl& aContainer,
|
|
111 |
const TRect& aRect,
|
|
112 |
TBool aBigNEInIdle )
|
|
113 |
{
|
|
114 |
// Call object display
|
|
115 |
if ( FeatureManager::FeatureSupported( KFeatureIdCallImagetext ) )
|
|
116 |
{
|
|
117 |
iConfigFlags |= EBMCallObjectDisplay;
|
|
118 |
}
|
|
119 |
|
|
120 |
// Bigger number entry window in idle
|
|
121 |
if ( aBigNEInIdle )
|
|
122 |
{
|
|
123 |
iConfigFlags |= EBMBigNEInIdleState;
|
|
124 |
}
|
|
125 |
|
|
126 |
// Touch CallHandling.
|
|
127 |
if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
|
|
128 |
{
|
|
129 |
iConfigFlags |= EBMTouchCallhandling;
|
|
130 |
}
|
|
131 |
|
|
132 |
// set window
|
|
133 |
SetContainerWindowL( aContainer );
|
|
134 |
SetParent( const_cast<CCoeControl*>(&aContainer) );
|
|
135 |
iParentControl = &aContainer;
|
|
136 |
|
|
137 |
// load resource file for animation and number entry component.
|
|
138 |
RConeResourceLoader resourceLoader( *iCoeEnv );
|
|
139 |
TFileName fileName;
|
|
140 |
BubbleUtils::BubbleResourceFileName( fileName );
|
|
141 |
resourceLoader.OpenL(fileName);
|
|
142 |
CleanupClosePushL( resourceLoader );
|
|
143 |
|
|
144 |
// create image manager
|
|
145 |
iImageManager = CBubbleImageManager::NewL(
|
|
146 |
iConfigFlags & EBMCallObjectDisplay );
|
|
147 |
|
|
148 |
// create resource pool
|
|
149 |
iResourceManager = CBubbleResourceManager::NewL( *this );
|
|
150 |
|
|
151 |
// create custom manager
|
|
152 |
iCustomManager = CBubbleCustomManager::NewL(*this);
|
|
153 |
|
|
154 |
// muted image
|
|
155 |
iIsMuted = EFalse;
|
|
156 |
iMutedImage = new( ELeave ) CBubbleImage;
|
|
157 |
iMutedImage->SetContainerWindowL( *this );
|
|
158 |
iMutedImage->SetParent( this );
|
|
159 |
iMutedImage->SetPictureOwnedExternally( ETrue );
|
|
160 |
iMutedImage->MakeVisible( iIsMuted );
|
|
161 |
|
|
162 |
// create array of call headers
|
|
163 |
CBubbleCallHeader* header;
|
|
164 |
iCallHeaders = new( ELeave ) CArrayPtrFlat<CBubbleCallHeader>( 1 );
|
|
165 |
iCallHeaders->SetReserveL( KBubbleCallMaxAmount );
|
|
166 |
for ( TUint8 i = 0 ; i < KBubbleCallMaxAmount ; i++ )
|
|
167 |
{
|
|
168 |
header = CBubbleCallHeader::NewL( i );
|
|
169 |
iCallHeaders->InsertL( i , header ); // can't leave
|
|
170 |
}
|
|
171 |
|
|
172 |
// set reserve for active headers
|
|
173 |
iActiveHeaders = new ( ELeave ) CArrayPtrFlat<CBubbleHeader>( 1 );
|
|
174 |
// 1 is for conference
|
|
175 |
iActiveHeaders->SetReserveL( KBubbleCallMaxAmount + 1 );
|
|
176 |
|
|
177 |
// create conference header
|
|
178 |
iConfHeader = CBubbleConfHeader::NewL( KBubbleConferenceId );
|
|
179 |
|
|
180 |
// create number entry
|
|
181 |
iNumberEntry = new ( ELeave ) CBubbleOutlookNumberEntry( *this,
|
|
182 |
*iMutedImage );
|
|
183 |
iNumberEntry->SetCallObjectDisplay(
|
|
184 |
iConfigFlags & EBMCallObjectDisplay );
|
|
185 |
iNumberEntry->SetContainerWindowL( *this );
|
|
186 |
iNumberEntry->SetParent( this );
|
|
187 |
iNumberEntry->ConstructL();
|
|
188 |
iNumberEntry->MakeVisible( EFalse ); //add
|
|
189 |
|
|
190 |
// create places and their contents ( outlooks )
|
|
191 |
TInt maxAmount = (iConfigFlags & EBMTouchCallhandling) ?
|
|
192 |
KBubblePlaceMaxAmountTouch : KBubblePlaceMaxAmount;
|
|
193 |
CBubblePlace* place;
|
|
194 |
iBubblePlaces = new ( ELeave ) CArrayPtrFlat<CBubblePlace>( 1 );
|
|
195 |
iBubblePlaces->SetReserveL( maxAmount );
|
|
196 |
for ( TUint8 e = 0 ; e < maxAmount ; e++ )
|
|
197 |
{
|
|
198 |
place = new ( ELeave ) CBubblePlace;
|
|
199 |
CleanupStack::PushL( place );
|
|
200 |
place->SetContainerWindowL( *this );
|
|
201 |
place->SetParent( this );
|
|
202 |
place->ConstructL( CBubblePlace::TPhoneBubblePlace ( e ) , *this );
|
|
203 |
place->GetBubbleOutlook().SetCallObjectDisplay(
|
|
204 |
iConfigFlags & EBMCallObjectDisplay );
|
|
205 |
iBubblePlaces->InsertL( e , place );
|
|
206 |
CleanupStack::Pop(); //place
|
|
207 |
}
|
|
208 |
|
|
209 |
// reserve space for active places
|
|
210 |
iActivePlaces =
|
|
211 |
new (ELeave) CArrayPtrFlat<CBubblePlace>( KBubblePlaceMaxVisible );
|
|
212 |
iActivePlaces->SetReserveL( KBubblePlaceMaxVisible );
|
|
213 |
|
|
214 |
// reserve space for label text
|
|
215 |
iLabelBuf = HBufC::NewMaxL ( KBubbleLabelMaxLength );
|
|
216 |
|
|
217 |
// call object manager
|
|
218 |
if ( iConfigFlags & EBMCallObjectDisplay )
|
|
219 |
{
|
|
220 |
iCallObjectManager = CBubbleCallObjectManager::NewL( *this );
|
|
221 |
|
|
222 |
// Main pane control is not set as component control,
|
|
223 |
// it just controls the drawing of the call image to
|
|
224 |
// the main pane.
|
|
225 |
iMainPaneControl = CBubbleMainPaneControl::NewL(
|
|
226 |
*this,
|
|
227 |
*iCallObjectManager );
|
|
228 |
iMainPaneControl->ActivateL();
|
|
229 |
iMainPaneControl->SetContainerWindowL( *this );
|
|
230 |
iMainPaneControl->MakeVisible( EFalse );
|
|
231 |
}
|
|
232 |
|
|
233 |
// Video ringtone
|
|
234 |
iVideoController = CBubbleVideoController::NewL( *this );
|
|
235 |
|
|
236 |
// Touch pane
|
|
237 |
if ( iConfigFlags & EBMTouchCallhandling )
|
|
238 |
{
|
|
239 |
iTouchPane = CBubbleTouchPane::NewL();
|
|
240 |
iTouchPane->SetContainerWindowL( *this );
|
|
241 |
iTouchPane->SetParent( this );
|
|
242 |
iTouchPane->MakeVisible( EFalse );
|
|
243 |
iTouchPane->ActivateL();
|
|
244 |
}
|
|
245 |
|
|
246 |
SetRect( aRect );
|
|
247 |
ActivateL();
|
|
248 |
iResourceManager->ActivateL();
|
|
249 |
iIsReadyToDraw = 0;
|
|
250 |
|
|
251 |
// Resource file isn't needed anymore so it can be closed.
|
|
252 |
CleanupStack::PopAndDestroy(); // resourceLoader
|
|
253 |
|
|
254 |
TInt pngErr( KErrNone );
|
|
255 |
TInt pngSupported( 0 );
|
|
256 |
CRepository* repository = CRepository::NewL( KCRUidNumberGrouping );
|
|
257 |
pngErr = repository->Get( KNumberGrouping, pngSupported );
|
|
258 |
delete repository;
|
|
259 |
|
|
260 |
if ( KErrNone == pngErr && pngSupported != 0 )
|
|
261 |
{
|
|
262 |
iNumberGrouping = CPNGNumberGrouping::NewL(KBubbleLabelMaxLength);
|
|
263 |
}
|
|
264 |
#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
|
|
265 |
// Register the number entry popup in the transition server
|
|
266 |
GfxTransEffect::Register( iNumberEntry, KGfxNumberEntryPopupUid, EFalse );
|
|
267 |
|
|
268 |
CAknTransitionUtils::SetData( (TInt) this, 0 );
|
|
269 |
#endif
|
|
270 |
}
|
|
271 |
|
|
272 |
// Destructor
|
|
273 |
EXPORT_C CBubbleManager::~CBubbleManager()
|
|
274 |
{
|
|
275 |
#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
|
|
276 |
CAknTransitionUtils::RemoveData( (TInt) this );
|
|
277 |
GfxTransEffect::Deregister( iNumberEntry );
|
|
278 |
#endif
|
|
279 |
AknsUtils::DeregisterControlPosition( this );
|
|
280 |
|
|
281 |
delete iMutedImage;
|
|
282 |
|
|
283 |
if ( iActiveHeaders )
|
|
284 |
{
|
|
285 |
iActiveHeaders->Reset( );
|
|
286 |
delete iActiveHeaders;
|
|
287 |
}
|
|
288 |
|
|
289 |
delete iLabelBuf;
|
|
290 |
|
|
291 |
if ( iActivePlaces )
|
|
292 |
{
|
|
293 |
iActivePlaces->Reset( );
|
|
294 |
delete iActivePlaces;
|
|
295 |
}
|
|
296 |
|
|
297 |
if ( iBubblePlaces )
|
|
298 |
{
|
|
299 |
iBubblePlaces->ResetAndDestroy() ;
|
|
300 |
delete iBubblePlaces;
|
|
301 |
}
|
|
302 |
|
|
303 |
delete iNumberEntry;
|
|
304 |
|
|
305 |
delete iConfHeader;
|
|
306 |
|
|
307 |
|
|
308 |
if ( iCallHeaders )
|
|
309 |
{
|
|
310 |
iCallHeaders->ResetAndDestroy() ;
|
|
311 |
delete iCallHeaders;
|
|
312 |
}
|
|
313 |
|
|
314 |
delete iResourceManager;
|
|
315 |
|
|
316 |
delete iImageManager;
|
|
317 |
|
|
318 |
delete iCustomManager;
|
|
319 |
|
|
320 |
delete iNumberGrouping;
|
|
321 |
|
|
322 |
delete iCallObjectManager;
|
|
323 |
|
|
324 |
delete iMainPaneControl;
|
|
325 |
|
|
326 |
delete iVideoController;
|
|
327 |
|
|
328 |
delete iTouchPane;
|
|
329 |
}
|
|
330 |
|
|
331 |
// ---------------------------------------------------------------------------
|
|
332 |
// CBubbleManager::SizeChanged()
|
|
333 |
// called by framework when the view size is changed
|
|
334 |
//
|
|
335 |
// ---------------------------------------------------------------------------
|
|
336 |
//
|
|
337 |
void CBubbleManager::SizeChanged()
|
|
338 |
{
|
|
339 |
AknsUtils::RegisterControlPosition( this );
|
|
340 |
|
|
341 |
if ( iConfigFlags & EBMTouchCallhandling )
|
|
342 |
{
|
|
343 |
if ( iTouchPane->IsVisible() )
|
|
344 |
{
|
|
345 |
TInt variety = 0;
|
|
346 |
// Popups
|
|
347 |
TAknLayoutRect windowsPane;
|
|
348 |
windowsPane.LayoutRect(
|
|
349 |
Rect(),
|
|
350 |
BubbleLayout6::call6_windows_pane(variety));
|
|
351 |
|
|
352 |
iMainPaneControl->SetRect( windowsPane.Rect() );
|
|
353 |
|
|
354 |
TAknLayoutRect bubblePane;
|
|
355 |
bubblePane.LayoutRect(
|
|
356 |
Rect(),
|
|
357 |
BubbleLayout4::call4_windows_pane(variety));
|
|
358 |
|
|
359 |
DoLayoutCall4Bubbles( bubblePane.Rect() );
|
|
360 |
}
|
|
361 |
else
|
|
362 |
{
|
|
363 |
iMainPaneControl->SetRect( Rect() );
|
|
364 |
|
|
365 |
DoLayoutCall4Bubbles( Rect() );
|
|
366 |
}
|
|
367 |
|
|
368 |
|
|
369 |
// Muted icon
|
|
370 |
AknLayoutUtils::LayoutImage(
|
|
371 |
iMutedImage, Rect(),
|
|
372 |
BubbleLayout::main_pane_elements_muted( EFalse ) );
|
|
373 |
|
|
374 |
// Touch pane
|
|
375 |
|
|
376 |
TInt variety = 0;
|
|
377 |
AknLayoutUtils::LayoutControl(
|
|
378 |
iTouchPane,
|
|
379 |
Rect(),
|
|
380 |
BubbleLayout6::call6_button_grp_pane(variety) );
|
|
381 |
|
|
382 |
}
|
|
383 |
else if ( iConfigFlags & EBMCallObjectDisplay )
|
|
384 |
{
|
|
385 |
// call object layout
|
|
386 |
iMainPaneControl->SetRect( Rect() );
|
|
387 |
DoLayoutCall2Bubbles();
|
|
388 |
}
|
|
389 |
else
|
|
390 |
{
|
|
391 |
// old thumbnail layout
|
|
392 |
DoLayoutCall1Bubbles();
|
|
393 |
}
|
|
394 |
|
|
395 |
// Layout number entry
|
|
396 |
TInt neIndex;
|
|
397 |
switch ( iNumberEntry->Place() )
|
|
398 |
{
|
|
399 |
case CBubbleOutlookNumberEntry::ENEBottomRight:
|
|
400 |
neIndex = 1;
|
|
401 |
break;
|
|
402 |
case CBubbleOutlookNumberEntry::ENEIdleState:
|
|
403 |
neIndex = 4;
|
|
404 |
break;
|
|
405 |
default: // CBubbleOutlookNumberEntry::ENEBottom
|
|
406 |
neIndex = 0;
|
|
407 |
break;
|
|
408 |
}
|
|
409 |
|
|
410 |
AknLayoutUtils::LayoutControl(
|
|
411 |
iNumberEntry, Rect( ),
|
|
412 |
BubbleLayout::popup_number_entry_window( neIndex ) );
|
|
413 |
|
|
414 |
// Layout muted icon
|
|
415 |
if ( !(iConfigFlags & EBMTouchCallhandling) )
|
|
416 |
{
|
|
417 |
AknLayoutUtils::LayoutImage(
|
|
418 |
iMutedImage, Rect(),
|
|
419 |
BubbleLayout::main_pane_elements_muted( iNumberEntry->IsUsed() ) );
|
|
420 |
}
|
|
421 |
}
|
|
422 |
|
|
423 |
// ---------------------------------------------------------------------------
|
|
424 |
// CBubbleManager::DoLayoutCall1Bubbles
|
|
425 |
// ---------------------------------------------------------------------------
|
|
426 |
//
|
|
427 |
void CBubbleManager::DoLayoutCall1Bubbles()
|
|
428 |
{
|
|
429 |
CBubblePlace* tempBubblePlace = NULL;
|
|
430 |
TUint8 placeCount( TUint8( iBubblePlaces->Count( ) ) );
|
|
431 |
TAknWindowLineLayout placeLayout;
|
|
432 |
|
|
433 |
for ( TUint8 index = 0 ; index < placeCount ; index++ )
|
|
434 |
{
|
|
435 |
tempBubblePlace = iBubblePlaces->At( index );
|
|
436 |
CBubblePlace::TPhoneBubblePlace place =
|
|
437 |
tempBubblePlace->GetBubblePlace();
|
|
438 |
|
|
439 |
switch ( place )
|
|
440 |
{
|
|
441 |
case CBubblePlace::EBottom:
|
|
442 |
placeLayout = BubbleLayout::popup_call_audio_in_window(1);
|
|
443 |
break;
|
|
444 |
|
|
445 |
case CBubblePlace::EBottomRightActive:
|
|
446 |
placeLayout = BubbleLayout::popup_call_audio_second_window(1);
|
|
447 |
break;
|
|
448 |
|
|
449 |
case CBubblePlace::EBottomRightHeld:
|
|
450 |
placeLayout = BubbleLayout::popup_call_audio_second_window(2);
|
|
451 |
break;
|
|
452 |
|
|
453 |
case CBubblePlace::EMiddleActive:
|
|
454 |
placeLayout = BubbleLayout::popup_call_audio_first_window(3);
|
|
455 |
break;
|
|
456 |
|
|
457 |
case CBubblePlace::EMiddleHeld:
|
|
458 |
if ( iBubblePlaces->At( CBubblePlace::EBottomCnap )->IsUsed() )
|
|
459 |
{
|
|
460 |
placeLayout = BubbleLayout::popup_call_audio_first_window(7);
|
|
461 |
}
|
|
462 |
else
|
|
463 |
{
|
|
464 |
placeLayout = BubbleLayout::popup_call_audio_first_window(2);
|
|
465 |
}
|
|
466 |
break;
|
|
467 |
|
|
468 |
case CBubblePlace::ETopLeft:
|
|
469 |
placeLayout = BubbleLayout::popup_call_audio_first_window(4);
|
|
470 |
break;
|
|
471 |
|
|
472 |
case CBubblePlace::ETopRight:
|
|
473 |
placeLayout = BubbleLayout::popup_call_audio_second_window(3);
|
|
474 |
break;
|
|
475 |
|
|
476 |
case CBubblePlace::EHide:
|
|
477 |
{
|
|
478 |
TInt v = AknLayoutUtils::ScalableLayoutInterfaceAvailable() ?
|
|
479 |
5 : 6;
|
|
480 |
placeLayout = BubbleLayout::popup_call_audio_first_window(v);
|
|
481 |
}
|
|
482 |
break;
|
|
483 |
|
|
484 |
case CBubblePlace::E2InConf:
|
|
485 |
placeLayout = BubbleLayout::popup_call_audio_conf_window(1);
|
|
486 |
break;
|
|
487 |
|
|
488 |
case CBubblePlace::E3InConf:
|
|
489 |
placeLayout = BubbleLayout::popup_call_audio_conf_window(2);
|
|
490 |
break;
|
|
491 |
|
|
492 |
case CBubblePlace::E4InConf:
|
|
493 |
placeLayout = BubbleLayout::popup_call_audio_conf_window(3);
|
|
494 |
break;
|
|
495 |
|
|
496 |
case CBubblePlace::E5InConf:
|
|
497 |
placeLayout = BubbleLayout::popup_call_audio_conf_window(4);
|
|
498 |
break;
|
|
499 |
|
|
500 |
case CBubblePlace::EBottomCnap:
|
|
501 |
placeLayout = BubbleLayout::popup_call_audio_in_window(3);
|
|
502 |
break;
|
|
503 |
|
|
504 |
case CBubblePlace::EMiddleCnap:
|
|
505 |
placeLayout = BubbleLayout::popup_call_audio_in_window(4);
|
|
506 |
break;
|
|
507 |
|
|
508 |
case CBubblePlace::EVideo:
|
|
509 |
placeLayout = BubbleLayout3::popup_call3_audio_in_window(0);
|
|
510 |
break;
|
|
511 |
|
|
512 |
case CBubblePlace::EVideoCnap:
|
|
513 |
placeLayout = BubbleLayout3::popup_call3_audio_in_window(0);
|
|
514 |
break;
|
|
515 |
|
|
516 |
case CBubblePlace::EBottomText: // not active
|
|
517 |
case CBubblePlace::EBottomImage: // not active
|
|
518 |
case CBubblePlace::EBottomRightCnap: // not active
|
|
519 |
case CBubblePlace::EBottomImageCnap: // not active
|
|
520 |
placeLayout = BubbleLayout::popup_call_audio_in_window(1);
|
|
521 |
break;
|
|
522 |
|
|
523 |
default:
|
|
524 |
Panic( EBMPanicPlaceEnumerationDoesNotExist );
|
|
525 |
break;
|
|
526 |
}
|
|
527 |
|
|
528 |
AknLayoutUtils::LayoutControl( tempBubblePlace , Rect() , placeLayout );
|
|
529 |
}
|
|
530 |
}
|
|
531 |
|
|
532 |
// ---------------------------------------------------------------------------
|
|
533 |
// CBubbleManager::DoLayoutCall2Bubbles
|
|
534 |
// ---------------------------------------------------------------------------
|
|
535 |
//
|
|
536 |
void CBubbleManager::DoLayoutCall2Bubbles()
|
|
537 |
{
|
|
538 |
CBubblePlace* tempBubblePlace = NULL;
|
|
539 |
TUint8 placeCount( TUint8( iBubblePlaces->Count( ) ) );
|
|
540 |
TAknWindowLineLayout placeLayout;
|
|
541 |
|
|
542 |
for ( TUint8 index = 0 ; index < placeCount ; index++ )
|
|
543 |
{
|
|
544 |
tempBubblePlace = iBubblePlaces->At( index );
|
|
545 |
CBubblePlace::TPhoneBubblePlace place =
|
|
546 |
tempBubblePlace->GetBubblePlace();
|
|
547 |
|
|
548 |
switch ( place )
|
|
549 |
{
|
|
550 |
case CBubblePlace::EBottom:
|
|
551 |
placeLayout = BubbleLayout2::popup_call2_audio_in_window(0);
|
|
552 |
break;
|
|
553 |
|
|
554 |
case CBubblePlace::EBottomRightActive:
|
|
555 |
placeLayout = BubbleLayout2::popup_call2_audio_second_window(0);
|
|
556 |
break;
|
|
557 |
|
|
558 |
case CBubblePlace::EBottomRightHeld:
|
|
559 |
placeLayout = BubbleLayout2::popup_call2_audio_second_window(1);
|
|
560 |
break;
|
|
561 |
|
|
562 |
case CBubblePlace::EMiddleActive:
|
|
563 |
placeLayout = BubbleLayout2::popup_call2_audio_first_window(2);
|
|
564 |
break;
|
|
565 |
|
|
566 |
case CBubblePlace::EMiddleHeld:
|
|
567 |
if ( iBubblePlaces->At( CBubblePlace::EBottomRightCnap )->IsUsed() )
|
|
568 |
{
|
|
569 |
placeLayout = BubbleLayout2::popup_call2_audio_first_window(18);
|
|
570 |
}
|
|
571 |
else
|
|
572 |
{
|
|
573 |
placeLayout = BubbleLayout2::popup_call2_audio_first_window(1);
|
|
574 |
}
|
|
575 |
break;
|
|
576 |
|
|
577 |
case CBubblePlace::ETopLeft:
|
|
578 |
placeLayout = BubbleLayout2::popup_call2_audio_first_window(3);
|
|
579 |
break;
|
|
580 |
|
|
581 |
case CBubblePlace::ETopRight:
|
|
582 |
placeLayout = BubbleLayout2::popup_call2_audio_second_window(2);
|
|
583 |
break;
|
|
584 |
|
|
585 |
case CBubblePlace::EHide:
|
|
586 |
placeLayout = BubbleLayout2::popup_call2_audio_first_window(4);
|
|
587 |
break;
|
|
588 |
|
|
589 |
case CBubblePlace::E2InConf:
|
|
590 |
placeLayout = BubbleLayout2::popup_call2_audio_conf_window(0);
|
|
591 |
break;
|
|
592 |
|
|
593 |
case CBubblePlace::E3InConf:
|
|
594 |
placeLayout = BubbleLayout2::popup_call2_audio_conf_window(1);
|
|
595 |
break;
|
|
596 |
|
|
597 |
case CBubblePlace::E4InConf:
|
|
598 |
placeLayout = BubbleLayout2::popup_call2_audio_conf_window(2);
|
|
599 |
break;
|
|
600 |
|
|
601 |
case CBubblePlace::E5InConf:
|
|
602 |
placeLayout = BubbleLayout2::popup_call2_audio_conf_window(3);
|
|
603 |
break;
|
|
604 |
|
|
605 |
case CBubblePlace::EBottomCnap:
|
|
606 |
placeLayout = BubbleLayout2::popup_call2_audio_in_window(2);
|
|
607 |
break;
|
|
608 |
|
|
609 |
case CBubblePlace::EMiddleCnap:
|
|
610 |
placeLayout = BubbleLayout2::popup_call2_audio_in_window(3);
|
|
611 |
break;
|
|
612 |
|
|
613 |
case CBubblePlace::EBottomText:
|
|
614 |
placeLayout = BubbleLayout2::popup_call2_audio_in_window(8);
|
|
615 |
break;
|
|
616 |
|
|
617 |
case CBubblePlace::EBottomImage:
|
|
618 |
placeLayout = BubbleLayout2::popup_call2_audio_first_window(0);
|
|
619 |
break;
|
|
620 |
|
|
621 |
case CBubblePlace::EVideo:
|
|
622 |
placeLayout = BubbleLayout3::popup_call3_audio_in_window(0);
|
|
623 |
break;
|
|
624 |
|
|
625 |
case CBubblePlace::EVideoCnap:
|
|
626 |
placeLayout = BubbleLayout3::popup_call3_audio_in_window(0);
|
|
627 |
break;
|
|
628 |
|
|
629 |
case CBubblePlace::EBottomRightCnap:
|
|
630 |
placeLayout = BubbleLayout2::popup_call2_audio_wait_window(9);
|
|
631 |
break;
|
|
632 |
|
|
633 |
case CBubblePlace::EBottomImageCnap:
|
|
634 |
placeLayout = BubbleLayout2::popup_call2_audio_first_window(0);
|
|
635 |
break;
|
|
636 |
|
|
637 |
default:
|
|
638 |
Panic( EBMPanicPlaceEnumerationDoesNotExist );
|
|
639 |
break;
|
|
640 |
}
|
|
641 |
|
|
642 |
AknLayoutUtils::LayoutControl( tempBubblePlace , Rect() , placeLayout );
|
|
643 |
}
|
|
644 |
}
|
|
645 |
|
|
646 |
// ---------------------------------------------------------------------------
|
|
647 |
// CBubbleManager::DoLayoutCall4Bubbles
|
|
648 |
// ---------------------------------------------------------------------------
|
|
649 |
//
|
|
650 |
void CBubbleManager::DoLayoutCall4Bubbles( const TRect& aWindowPane )
|
|
651 |
{
|
|
652 |
CBubblePlace* tempBubblePlace = NULL;
|
|
653 |
TUint8 placeCount( TUint8( iBubblePlaces->Count( ) ) );
|
|
654 |
TAknWindowLineLayout placeLayout;
|
|
655 |
TBool initCall = InitializingCall();
|
|
656 |
|
|
657 |
for ( TUint8 index = 0 ; index < placeCount ; index++ )
|
|
658 |
{
|
|
659 |
tempBubblePlace = iBubblePlaces->At( index );
|
|
660 |
CBubblePlace::TPhoneBubblePlace place =
|
|
661 |
tempBubblePlace->GetBubblePlace();
|
|
662 |
|
|
663 |
switch ( place )
|
|
664 |
{
|
|
665 |
case CBubblePlace::EBottom:
|
|
666 |
case CBubblePlace::EBottomCnap:
|
|
667 |
if ( initCall )
|
|
668 |
{
|
|
669 |
// in / out
|
|
670 |
placeLayout =
|
|
671 |
BubbleLayout4::popup_call4_audio_in_window(4);
|
|
672 |
}
|
|
673 |
else
|
|
674 |
{
|
|
675 |
// incall
|
|
676 |
placeLayout =
|
|
677 |
BubbleLayout6::popup_call6_audio_first_window(0);
|
|
678 |
}
|
|
679 |
|
|
680 |
break;
|
|
681 |
|
|
682 |
// in / out with text
|
|
683 |
case CBubblePlace::EBottomText:
|
|
684 |
placeLayout = BubbleLayout2::popup_call2_audio_in_window(8);
|
|
685 |
break;
|
|
686 |
|
|
687 |
// in with video
|
|
688 |
case CBubblePlace::EVideo:
|
|
689 |
case CBubblePlace::EVideoCnap:
|
|
690 |
placeLayout = BubbleLayout3::popup_call3_audio_in_window(0);
|
|
691 |
break;
|
|
692 |
|
|
693 |
// first
|
|
694 |
case CBubblePlace::EBottomImage:
|
|
695 |
case CBubblePlace::EBottomImageCnap:
|
|
696 |
placeLayout = BubbleLayout6::popup_call6_audio_first_window(0);
|
|
697 |
break;
|
|
698 |
|
|
699 |
// two calls - active
|
|
700 |
case CBubblePlace::EBottomRightActiveTouch:
|
|
701 |
case CBubblePlace::EBottomRightActiveCnapTouch:
|
|
702 |
placeLayout = BubbleLayout4::popup_call4_audio_second_window(0);
|
|
703 |
break;
|
|
704 |
// two calls - active
|
|
705 |
case CBubblePlace::EMiddleHeldTouch:
|
|
706 |
placeLayout = BubbleLayout4::popup_call4_audio_first_window(1);
|
|
707 |
break;
|
|
708 |
|
|
709 |
// three calls - held
|
|
710 |
case CBubblePlace::ETopRight:
|
|
711 |
placeLayout = BubbleLayout4::popup_call4_audio_second_window(1);
|
|
712 |
break;
|
|
713 |
// two or three calls - active
|
|
714 |
case CBubblePlace::ETopLeft:
|
|
715 |
placeLayout = BubbleLayout4::popup_call4_audio_first_window(2);
|
|
716 |
break;
|
|
717 |
// two or three calls - waiting
|
|
718 |
case CBubblePlace::EBottomRightActive:
|
|
719 |
case CBubblePlace::EBottomRightCnap:
|
|
720 |
case CBubblePlace::EBottomRightHeld:
|
|
721 |
placeLayout = BubbleLayout4::popup_call4_audio_wait_window(0);
|
|
722 |
break;
|
|
723 |
|
|
724 |
// conference
|
|
725 |
case CBubblePlace::E2InConf:
|
|
726 |
placeLayout = BubbleLayout4::popup_call4_audio_conference_window(3);
|
|
727 |
break;
|
|
728 |
|
|
729 |
case CBubblePlace::E3InConf:
|
|
730 |
placeLayout = BubbleLayout4::popup_call4_audio_conference_window(2);
|
|
731 |
break;
|
|
732 |
|
|
733 |
case CBubblePlace::E4InConf:
|
|
734 |
placeLayout = BubbleLayout4::popup_call4_audio_conference_window(1);
|
|
735 |
break;
|
|
736 |
|
|
737 |
case CBubblePlace::E5InConf:
|
|
738 |
placeLayout = BubbleLayout4::popup_call4_audio_conference_window(0);
|
|
739 |
break;
|
|
740 |
|
|
741 |
// not used in touch
|
|
742 |
case CBubblePlace::EMiddleActive:
|
|
743 |
case CBubblePlace::EMiddleHeld:
|
|
744 |
case CBubblePlace::EMiddleCnap:
|
|
745 |
case CBubblePlace::EHide:
|
|
746 |
continue;
|
|
747 |
|
|
748 |
default:
|
|
749 |
Panic( EBMPanicPlaceEnumerationDoesNotExist );
|
|
750 |
break;
|
|
751 |
}
|
|
752 |
|
|
753 |
AknLayoutUtils::LayoutControl( tempBubblePlace , aWindowPane , placeLayout );
|
|
754 |
}
|
|
755 |
}
|
|
756 |
|
|
757 |
|
|
758 |
// ---------------------------------------------------------------------------
|
|
759 |
// CBubbleManager::PositionChanged
|
|
760 |
// ---------------------------------------------------------------------------
|
|
761 |
//
|
|
762 |
void CBubbleManager::PositionChanged()
|
|
763 |
{
|
|
764 |
AknsUtils::RegisterControlPosition( this );
|
|
765 |
}
|
|
766 |
|
|
767 |
// ---------------------------------------------------------------------------
|
|
768 |
// CBubbleManager::CountComponentControls() const
|
|
769 |
//
|
|
770 |
// Controls: NumberEntry, MutedImage and ActivePlaces
|
|
771 |
// ---------------------------------------------------------------------------
|
|
772 |
//
|
|
773 |
TInt CBubbleManager::CountComponentControls() const
|
|
774 |
{
|
|
775 |
if ( ( iConfigFlags & EBMTouchCallhandling ) &&
|
|
776 |
( iTouchPane->IsVisible() ) )
|
|
777 |
{
|
|
778 |
return 3 + iActivePlaces->Count(); // ne + muted + touchpane + places
|
|
779 |
}
|
|
780 |
else
|
|
781 |
{
|
|
782 |
return 2 + iActivePlaces->Count(); // ne + muted + places
|
|
783 |
}
|
|
784 |
}
|
|
785 |
|
|
786 |
// ---------------------------------------------------------------------------
|
|
787 |
// CBubbleManager::ComponentControl(TInt aIndex) const
|
|
788 |
//
|
|
789 |
// First give active places. Then possible NE, muted-image and AnimStarter
|
|
790 |
// ---------------------------------------------------------------------------
|
|
791 |
//
|
|
792 |
CCoeControl* CBubbleManager::ComponentControl( TInt aIndex ) const
|
|
793 |
{
|
|
794 |
TInt activePlacesCount = iActivePlaces->Count();
|
|
795 |
|
|
796 |
// If too high value, return NULL
|
|
797 |
if ( aIndex >= activePlacesCount + 3 )
|
|
798 |
{
|
|
799 |
return NULL;
|
|
800 |
}
|
|
801 |
|
|
802 |
if ( aIndex < activePlacesCount )
|
|
803 |
{
|
|
804 |
return iActivePlaces->At( aIndex );
|
|
805 |
}
|
|
806 |
|
|
807 |
if ( aIndex == activePlacesCount )
|
|
808 |
{
|
|
809 |
return iNumberEntry;
|
|
810 |
}
|
|
811 |
|
|
812 |
if ( iConfigFlags & EBMTouchCallhandling )
|
|
813 |
{
|
|
814 |
if ( aIndex == ( activePlacesCount + 1 ) )
|
|
815 |
{
|
|
816 |
return iMutedImage;
|
|
817 |
}
|
|
818 |
|
|
819 |
return iTouchPane;
|
|
820 |
}
|
|
821 |
else
|
|
822 |
{
|
|
823 |
return iMutedImage;
|
|
824 |
}
|
|
825 |
}
|
|
826 |
|
|
827 |
// ---------------------------------------------------------------------------
|
|
828 |
// CBubbleManager::Draw
|
|
829 |
// ---------------------------------------------------------------------------
|
|
830 |
//
|
|
831 |
void CBubbleManager::Draw( const TRect& aRect ) const
|
|
832 |
{
|
|
833 |
// clear the backround area.
|
|
834 |
CWindowGc& gc = SystemGc();
|
|
835 |
gc.SetBrushColor( AKN_LAF_COLOR( BubbleLayout::LayoutColourWhite() ) );
|
|
836 |
|
|
837 |
// Draw just the bitmaps
|
|
838 |
if ( iMainPaneControl &&
|
|
839 |
iMainPaneControl->IsVisible() )
|
|
840 |
{
|
|
841 |
// main pane image
|
|
842 |
iMainPaneControl->DrawBitmaps( aRect );
|
|
843 |
}
|
|
844 |
|
|
845 |
for ( TInt i = 0 ; i < iActivePlaces->Count() ; i++ )
|
|
846 |
{
|
|
847 |
iActivePlaces->At(i)->GetBubbleOutlook().DrawBitmaps( gc );
|
|
848 |
}
|
|
849 |
|
|
850 |
if ( iNumberEntry->IsUsed() )
|
|
851 |
{
|
|
852 |
iNumberEntry->DrawBitmaps( gc );
|
|
853 |
}
|
|
854 |
}
|
|
855 |
|
|
856 |
// ---------------------------------------------------------------------------
|
|
857 |
// CBubbleManager::MakeVisible
|
|
858 |
//
|
|
859 |
//
|
|
860 |
// ---------------------------------------------------------------------------
|
|
861 |
//
|
|
862 |
void CBubbleManager::MakeVisible( TBool aVisible )
|
|
863 |
{
|
|
864 |
CCoeControl::MakeVisible( aVisible );
|
|
865 |
|
|
866 |
if ( aVisible )
|
|
867 |
{
|
|
868 |
StartAnimations();
|
|
869 |
}
|
|
870 |
}
|
|
871 |
|
|
872 |
// ---------------------------------------------------------------------------
|
|
873 |
// CBubbleManager::StartChanges
|
|
874 |
//
|
|
875 |
// Reset all places so there won't be anything wrong left.
|
|
876 |
// ---------------------------------------------------------------------------
|
|
877 |
//
|
|
878 |
EXPORT_C void CBubbleManager::StartChanges( )
|
|
879 |
{
|
|
880 |
BM_TRACE_( "[BUBBLEMANAGER] CBubbleManager::StartChanges" );
|
|
881 |
iIsReadyToDraw++;
|
|
882 |
if ( iIsReadyToDraw > 1 ) // is this called already?
|
|
883 |
{
|
|
884 |
return;
|
|
885 |
}
|
|
886 |
|
|
887 |
// clear all used areas
|
|
888 |
CBubblePlace* tempBubblePlace = NULL;
|
|
889 |
TInt placeCount = iBubblePlaces->Count();
|
|
890 |
for ( TUint8 index = 0 ; index < placeCount ; index++ )
|
|
891 |
{
|
|
892 |
tempBubblePlace = iBubblePlaces->At( index );
|
|
893 |
if ( tempBubblePlace->IsUsed() )
|
|
894 |
{
|
|
895 |
Window().Invalidate( tempBubblePlace->Rect() );
|
|
896 |
tempBubblePlace->SetIsUsed( EFalse );
|
|
897 |
}
|
|
898 |
}
|
|
899 |
|
|
900 |
iActivePlaces->Delete( 0 , iActivePlaces->Count() ); // do not compress!!
|
|
901 |
|
|
902 |
if ( iTouchPane )
|
|
903 |
{
|
|
904 |
iTouchPane->SetUpdating( ETrue );
|
|
905 |
}
|
|
906 |
}
|
|
907 |
|
|
908 |
// ---------------------------------------------------------------------------
|
|
909 |
// CBubbleManager::EndChanges
|
|
910 |
//
|
|
911 |
// Check the situation and decide which outlook to take.
|
|
912 |
// ---------------------------------------------------------------------------
|
|
913 |
//
|
|
914 |
EXPORT_C void CBubbleManager::EndChanges( )
|
|
915 |
{
|
|
916 |
BM_TRACE_( "[BUBBLEMANAGER] CBubbleManager::EndChanges" );
|
|
917 |
|
|
918 |
__ASSERT_ALWAYS(
|
|
919 |
iIsReadyToDraw > 0 , Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
920 |
|
|
921 |
iIsReadyToDraw--;
|
|
922 |
if ( iIsReadyToDraw != 0 )
|
|
923 |
{
|
|
924 |
return;
|
|
925 |
}
|
|
926 |
|
|
927 |
if ( iConfHeader->IsExpanded() )
|
|
928 |
{
|
|
929 |
BuildExpandedConference();
|
|
930 |
}
|
|
931 |
else if ( iNumberEntry->IsUsed() && iNumberEntry->IsVisible() )
|
|
932 |
{
|
|
933 |
BuildBubblesWithNE();
|
|
934 |
}
|
|
935 |
else if ( ( iConfigFlags & EBMTouchCallhandling ) )
|
|
936 |
{
|
|
937 |
BuildBubblesForTouch();
|
|
938 |
}
|
|
939 |
else
|
|
940 |
{
|
|
941 |
BuildBubbles();
|
|
942 |
}
|
|
943 |
|
|
944 |
// Stop video if playing and video bubble is not active.
|
|
945 |
if ( ( iVideoFlags & EBMVideoPlayingVideo ) &&
|
|
946 |
!( iVideoFlags & EBMVideoBubbleActive ) )
|
|
947 |
{
|
|
948 |
StopAndDeleteVideoPlayer();
|
|
949 |
}
|
|
950 |
|
|
951 |
// Touch pane
|
|
952 |
if ( iConfigFlags & EBMTouchCallhandling )
|
|
953 |
{
|
|
954 |
if ( iTouchPaneSetVisible && // Client sets
|
|
955 |
iActiveHeaders->Count() > 0 && // Incall situation
|
|
956 |
!iNumberEntry->IsVisible() )
|
|
957 |
{
|
|
958 |
iTouchPane->MakeVisible( ETrue );
|
|
959 |
}
|
|
960 |
else
|
|
961 |
{
|
|
962 |
iTouchPane->MakeVisible( EFalse );
|
|
963 |
}
|
|
964 |
}
|
|
965 |
|
|
966 |
if ( ( iConfigFlags & EBMCallObjectDisplay ) &&
|
|
967 |
iActiveHeaders->Count() > 0 &&
|
|
968 |
!( iVideoFlags & EBMVideoBubbleActive ) )
|
|
969 |
{
|
|
970 |
// Image is created only for incoming & outgoing
|
|
971 |
// calls, check is inside method.
|
|
972 |
BuildMainPaneImage();
|
|
973 |
}
|
|
974 |
|
|
975 |
SizeChanged();
|
|
976 |
|
|
977 |
// Invalidate the new areas.
|
|
978 |
for ( TInt i = 0 ; i < iActivePlaces->Count() ; i++ )
|
|
979 |
{
|
|
980 |
iActivePlaces->At(i)->GetBubbleOutlook().DrawDeferred();
|
|
981 |
}
|
|
982 |
if ( iNumberEntry->IsUsed() )
|
|
983 |
{
|
|
984 |
iNumberEntry->DrawDeferred();
|
|
985 |
iNumberEntry->GetEditor()->DrawDeferred();
|
|
986 |
}
|
|
987 |
|
|
988 |
if ( iTouchPane )
|
|
989 |
{
|
|
990 |
iTouchPane->SetUpdating( EFalse );
|
|
991 |
}
|
|
992 |
|
|
993 |
#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
|
|
994 |
TBool calledBegin = (TBool) CAknTransitionUtils::GetData( ( TInt ) this );
|
|
995 |
// Only draw parent control if no number entry exists, the number entry is
|
|
996 |
// used or if begin has not been called.
|
|
997 |
if ( iNumberEntry->IsUsed() || !calledBegin )
|
|
998 |
{
|
|
999 |
// Do redraw. Do not use DrawDeferred() here!
|
|
1000 |
iParentControl->DrawNow();
|
|
1001 |
}
|
|
1002 |
#else
|
|
1003 |
// Do redraw. Do not use DrawDeferred() here!
|
|
1004 |
iParentControl->DrawNow();
|
|
1005 |
#endif
|
|
1006 |
// Start animations.
|
|
1007 |
StartAnimations();
|
|
1008 |
|
|
1009 |
// Start video if video bubble is active.
|
|
1010 |
if ( ( iVideoFlags & EBMVideoBubbleActive ) &&
|
|
1011 |
!( iVideoFlags & EBMVideoPlayingVideo ) )
|
|
1012 |
{
|
|
1013 |
CreateVideoPlayerAndPlay();
|
|
1014 |
}
|
|
1015 |
#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
|
|
1016 |
if ( calledBegin )
|
|
1017 |
{
|
|
1018 |
// Initialize transition effect
|
|
1019 |
CAknTransitionUtils::SetAllParents( iNumberEntry );
|
|
1020 |
GfxTransEffect::SetDemarcation( iNumberEntry, iNumberEntry->Rect() );
|
|
1021 |
GfxTransEffect::End( iNumberEntry );
|
|
1022 |
|
|
1023 |
// Reset begin call reminder
|
|
1024 |
CAknTransitionUtils::SetData( (TInt) this, 0 );
|
|
1025 |
}
|
|
1026 |
// SetFocus here instead of in SetNumberEntryVisible
|
|
1027 |
if ( iNumberEntry->IsVisible() )
|
|
1028 |
{
|
|
1029 |
iNumberEntry->SetFocus( ETrue );
|
|
1030 |
}
|
|
1031 |
#endif
|
|
1032 |
return;
|
|
1033 |
}
|
|
1034 |
|
|
1035 |
|
|
1036 |
// ---------------------------------------------------------------------------
|
|
1037 |
// CBubbleManager::SetActivePlace
|
|
1038 |
//
|
|
1039 |
// This helps the EndChanges() to make bubble places active.
|
|
1040 |
// ---------------------------------------------------------------------------
|
|
1041 |
//
|
|
1042 |
void CBubbleManager::SetActivePlace(
|
|
1043 |
const CBubblePlace::TPhoneBubblePlace& aPlace ,
|
|
1044 |
CBubbleHeader& aHeader )
|
|
1045 |
{
|
|
1046 |
CBubblePlace* place = iBubblePlaces->At( aPlace );
|
|
1047 |
place->SetIsUsed( ETrue );
|
|
1048 |
CBubbleOutlook& bubbleOutlook = place->GetBubbleOutlook( );
|
|
1049 |
bubbleOutlook.ReadBubbleHeader( aHeader );
|
|
1050 |
iActivePlaces->InsertL( iActivePlaces->Count( ), place ); // Can't leave
|
|
1051 |
}
|
|
1052 |
|
|
1053 |
|
|
1054 |
void CBubbleManager::BuildExpandedConference()
|
|
1055 |
{
|
|
1056 |
iNumberEntry->SetPlace( CBubbleOutlookNumberEntry::ENENone );
|
|
1057 |
switch ( iConfHeader->RowCount() )
|
|
1058 |
{
|
|
1059 |
// Cases mean number of calls in conference.
|
|
1060 |
case 2:
|
|
1061 |
SetActivePlace( CBubblePlace::E2InConf , *iConfHeader );
|
|
1062 |
break;
|
|
1063 |
case 3:
|
|
1064 |
SetActivePlace( CBubblePlace::E3InConf , *iConfHeader );
|
|
1065 |
break;
|
|
1066 |
case 4:
|
|
1067 |
SetActivePlace( CBubblePlace::E4InConf , *iConfHeader );
|
|
1068 |
break;
|
|
1069 |
case 5:
|
|
1070 |
SetActivePlace( CBubblePlace::E5InConf , *iConfHeader );
|
|
1071 |
break;
|
|
1072 |
default:
|
|
1073 |
Panic( EBMPanicPlaceEnumerationDoesNotExist );
|
|
1074 |
break;
|
|
1075 |
}
|
|
1076 |
return;
|
|
1077 |
}
|
|
1078 |
|
|
1079 |
|
|
1080 |
// ---------------------------------------------------------------------------
|
|
1081 |
// CBubbleManager::FindNextDrawableHeader
|
|
1082 |
//
|
|
1083 |
//
|
|
1084 |
// ---------------------------------------------------------------------------
|
|
1085 |
//
|
|
1086 |
void CBubbleManager::FindNextDrawableHeader( TUint8& aIndex )
|
|
1087 |
{
|
|
1088 |
while( iActiveHeaders->At( aIndex )->IsInConference() )
|
|
1089 |
{
|
|
1090 |
aIndex++;
|
|
1091 |
}
|
|
1092 |
}
|
|
1093 |
|
|
1094 |
// ---------------------------------------------------------------------------
|
|
1095 |
// CBubbleManager::ShownHeaderCount
|
|
1096 |
// ---------------------------------------------------------------------------
|
|
1097 |
//
|
|
1098 |
EXPORT_C TUint8 CBubbleManager::ShownHeaderCount() const
|
|
1099 |
{
|
|
1100 |
// We have to find headers that are really shown.
|
|
1101 |
// That means headers which are
|
|
1102 |
// used and are NOT in conference.
|
|
1103 |
TUint8 bubbleAmount = 0;
|
|
1104 |
TUint activeCount = iActiveHeaders->Count();
|
|
1105 |
for (TUint8 i = 0 ; i < activeCount ; i++ )
|
|
1106 |
{
|
|
1107 |
if ( !iActiveHeaders->At(i)->IsInConference() )
|
|
1108 |
{
|
|
1109 |
bubbleAmount++;
|
|
1110 |
}
|
|
1111 |
}
|
|
1112 |
return bubbleAmount;
|
|
1113 |
}
|
|
1114 |
|
|
1115 |
// ---------------------------------------------------------------------------
|
|
1116 |
// CBubbleManager::BuildBubbles
|
|
1117 |
//
|
|
1118 |
//
|
|
1119 |
// ---------------------------------------------------------------------------
|
|
1120 |
//
|
|
1121 |
void CBubbleManager::BuildBubbles()
|
|
1122 |
{
|
|
1123 |
const TUint8 bubbleAmount = ShownHeaderCount();
|
|
1124 |
iVideoFlags &= ~EBMVideoBubbleActive;
|
|
1125 |
|
|
1126 |
// Without number entry.
|
|
1127 |
switch ( bubbleAmount )
|
|
1128 |
{
|
|
1129 |
case 0:
|
|
1130 |
break;
|
|
1131 |
case 1:
|
|
1132 |
{
|
|
1133 |
TUint8 index = 0;
|
|
1134 |
FindNextDrawableHeader( index );
|
|
1135 |
CBubbleHeader* header = iActiveHeaders->At( index );
|
|
1136 |
TPhoneCallState callState = header->CallState();
|
|
1137 |
TBool callObjectText(
|
|
1138 |
( iConfigFlags & EBMCallObjectDisplay ) &&
|
|
1139 |
( header->CallObjectText().Length() > 0) );
|
|
1140 |
TBool callObjectImage(
|
|
1141 |
( iConfigFlags & EBMCallObjectDisplay ) &&
|
|
1142 |
header->CallObjectImage() );
|
|
1143 |
|
|
1144 |
TInt cnapLength = header->CNAP().Length();
|
|
1145 |
|
|
1146 |
// Video
|
|
1147 |
if ( callState == EIncoming &&
|
|
1148 |
iVideoFlags & EBMVideoSetAsRingTone )
|
|
1149 |
{
|
|
1150 |
if ( cnapLength ) // 3-lines
|
|
1151 |
{
|
|
1152 |
SetActivePlace( CBubblePlace::EVideoCnap,
|
|
1153 |
*header );
|
|
1154 |
iVideoFlags |= EBMVideoBubbleActive;
|
|
1155 |
}
|
|
1156 |
else
|
|
1157 |
{
|
|
1158 |
SetActivePlace( CBubblePlace::EVideo,
|
|
1159 |
*header );
|
|
1160 |
iVideoFlags |= EBMVideoBubbleActive;
|
|
1161 |
}
|
|
1162 |
}
|
|
1163 |
// Caller text
|
|
1164 |
else if ( callObjectText && ( callState == EIncoming ||
|
|
1165 |
callState == EOutgoing ||
|
|
1166 |
callState == EAlerting ||
|
|
1167 |
callState == EAlertToDisconnected ) )
|
|
1168 |
{
|
|
1169 |
SetActivePlace( CBubblePlace::EBottomText,
|
|
1170 |
*header );
|
|
1171 |
}
|
|
1172 |
// Caller image
|
|
1173 |
else if ( callObjectImage && ( callState == EActive ||
|
|
1174 |
callState == EOnHold ||
|
|
1175 |
callState == EDisconnected ) )
|
|
1176 |
{
|
|
1177 |
CBubbleHeader::TBMCallObjectImageType imageType =
|
|
1178 |
header->CallObjectImageType();
|
|
1179 |
|
|
1180 |
// Theme image -> use normal bubble
|
|
1181 |
if ( imageType == CBubbleHeader::EThemeImage ||
|
|
1182 |
imageType == CBubbleHeader::ETextBasedImage )
|
|
1183 |
{
|
|
1184 |
if ( cnapLength ) // 3-lines
|
|
1185 |
{
|
|
1186 |
SetActivePlace( CBubblePlace::EBottomCnap,
|
|
1187 |
*header );
|
|
1188 |
}
|
|
1189 |
else
|
|
1190 |
{
|
|
1191 |
SetActivePlace( CBubblePlace::EBottom,
|
|
1192 |
*header );
|
|
1193 |
}
|
|
1194 |
}
|
|
1195 |
// Caller image -> use bigger bubble
|
|
1196 |
else
|
|
1197 |
{
|
|
1198 |
TSize imageSize = header->CallObjectImage()->SizeInPixels();
|
|
1199 |
TSize tinySize = CallObjectImageIncallSize( ETrue );
|
|
1200 |
TBool tiny = imageSize.iHeight < tinySize.iHeight;
|
|
1201 |
iBottomImageVariety = tiny ? 0 : 4;
|
|
1202 |
|
|
1203 |
if ( cnapLength ) // 3-lines
|
|
1204 |
{
|
|
1205 |
CBubblePlace::TPhoneBubblePlace place = tiny ?
|
|
1206 |
CBubblePlace::EBottomCnap : CBubblePlace::EBottomImageCnap;
|
|
1207 |
|
|
1208 |
SetActivePlace( place,
|
|
1209 |
*header );
|
|
1210 |
}
|
|
1211 |
else
|
|
1212 |
{
|
|
1213 |
CBubblePlace::TPhoneBubblePlace place = tiny ?
|
|
1214 |
CBubblePlace::EBottom : CBubblePlace::EBottomImage;
|
|
1215 |
|
|
1216 |
SetActivePlace( place,
|
|
1217 |
*header );
|
|
1218 |
}
|
|
1219 |
}
|
|
1220 |
}
|
|
1221 |
// Basic
|
|
1222 |
else
|
|
1223 |
{
|
|
1224 |
if ( cnapLength ) // 3-lines
|
|
1225 |
{
|
|
1226 |
SetActivePlace( CBubblePlace::EBottomCnap,
|
|
1227 |
*header );
|
|
1228 |
}
|
|
1229 |
else
|
|
1230 |
{
|
|
1231 |
SetActivePlace( CBubblePlace::EBottom ,
|
|
1232 |
*header );
|
|
1233 |
}
|
|
1234 |
}
|
|
1235 |
break;
|
|
1236 |
}
|
|
1237 |
case 2:
|
|
1238 |
{
|
|
1239 |
// first call: middle held/active
|
|
1240 |
TUint8 index = 0;
|
|
1241 |
FindNextDrawableHeader( index );
|
|
1242 |
TPhoneCallState callState =
|
|
1243 |
iActiveHeaders->At( index )->CallState();
|
|
1244 |
TInt cnapLength = iActiveHeaders->At( index )->CNAP().Length();
|
|
1245 |
|
|
1246 |
// second call: bottom held/active
|
|
1247 |
TUint8 index2 = TUint8(index + 1);
|
|
1248 |
FindNextDrawableHeader( index2 );
|
|
1249 |
TInt cnapLength2 = iActiveHeaders->At( index2 )->CNAP().Length();
|
|
1250 |
TPhoneCallState callState2 =
|
|
1251 |
iActiveHeaders->At( index2 )->CallState();
|
|
1252 |
|
|
1253 |
|
|
1254 |
CBubblePlace::TPhoneBubblePlace place;
|
|
1255 |
|
|
1256 |
if ( callState == EOnHold )
|
|
1257 |
{
|
|
1258 |
place = CBubblePlace::EMiddleHeld;
|
|
1259 |
}
|
|
1260 |
else if ( cnapLength ) // and not held
|
|
1261 |
{
|
|
1262 |
place = CBubblePlace::EMiddleCnap;
|
|
1263 |
}
|
|
1264 |
else
|
|
1265 |
{
|
|
1266 |
place = CBubblePlace::EMiddleActive;
|
|
1267 |
}
|
|
1268 |
|
|
1269 |
CBubblePlace::TPhoneBubblePlace place2 =
|
|
1270 |
CBubblePlace::EBottomRightActive;
|
|
1271 |
|
|
1272 |
if ( callState2 == EOnHold )
|
|
1273 |
{
|
|
1274 |
place2 = CBubblePlace::EBottomRightHeld;
|
|
1275 |
}
|
|
1276 |
else if ( cnapLength2 ) // and not held
|
|
1277 |
{
|
|
1278 |
if ( cnapLength == 0 ||
|
|
1279 |
callState2 == EOutgoing ||
|
|
1280 |
callState2 == EAlerting ||
|
|
1281 |
callState2 == EAlertToDisconnected ||
|
|
1282 |
callState2 == EWaiting ||
|
|
1283 |
callState2 == EActive )
|
|
1284 |
{
|
|
1285 |
// bottom shows 3-lines
|
|
1286 |
place = CBubblePlace::EMiddleHeld;
|
|
1287 |
place2 = CBubblePlace::EBottomRightCnap;
|
|
1288 |
}
|
|
1289 |
else
|
|
1290 |
{
|
|
1291 |
place2 = CBubblePlace::EBottomRightHeld;
|
|
1292 |
}
|
|
1293 |
}
|
|
1294 |
else
|
|
1295 |
{
|
|
1296 |
place2 = CBubblePlace::EBottomRightActive;
|
|
1297 |
}
|
|
1298 |
|
|
1299 |
// set drawing order
|
|
1300 |
if ( callState2 > callState )
|
|
1301 |
{
|
|
1302 |
SetActivePlace( place , *iActiveHeaders->At( index ) );
|
|
1303 |
SetActivePlace( place2 , *iActiveHeaders->At( index2 ) );
|
|
1304 |
}
|
|
1305 |
else
|
|
1306 |
{
|
|
1307 |
SetActivePlace( place2 , *iActiveHeaders->At( index2 ) );
|
|
1308 |
SetActivePlace( place , *iActiveHeaders->At( index ) );
|
|
1309 |
}
|
|
1310 |
}
|
|
1311 |
break;
|
|
1312 |
case 3:
|
|
1313 |
{
|
|
1314 |
TUint8 index = 0;
|
|
1315 |
FindNextDrawableHeader( index );
|
|
1316 |
|
|
1317 |
TUint8 index2 = TUint8( index + 1 );
|
|
1318 |
FindNextDrawableHeader( index2 );
|
|
1319 |
|
|
1320 |
if ( iActiveHeaders->At( index2 )->CallState( )
|
|
1321 |
> iActiveHeaders->At( index )->CallState( ) )
|
|
1322 |
{
|
|
1323 |
SetActivePlace(
|
|
1324 |
CBubblePlace::ETopLeft , *iActiveHeaders->At( index ) );
|
|
1325 |
SetActivePlace(
|
|
1326 |
CBubblePlace::ETopRight , *iActiveHeaders->At( index2 ) );
|
|
1327 |
}
|
|
1328 |
else
|
|
1329 |
{
|
|
1330 |
SetActivePlace(
|
|
1331 |
CBubblePlace::ETopRight , *iActiveHeaders->At( index2 ) );
|
|
1332 |
SetActivePlace(
|
|
1333 |
CBubblePlace::ETopLeft , *iActiveHeaders->At( index ) );
|
|
1334 |
}
|
|
1335 |
|
|
1336 |
|
|
1337 |
index = TUint8( index2 + 1 );
|
|
1338 |
FindNextDrawableHeader( index );
|
|
1339 |
SetActivePlace(
|
|
1340 |
CBubblePlace::EBottom , *iActiveHeaders->At( index ) );
|
|
1341 |
break;
|
|
1342 |
}
|
|
1343 |
default:
|
|
1344 |
Panic( EBMPanicInvalidNumberOfHeaders );
|
|
1345 |
break;
|
|
1346 |
}
|
|
1347 |
}
|
|
1348 |
|
|
1349 |
// ---------------------------------------------------------------------------
|
|
1350 |
// CBubbleManager::BuildBubblesWithNE
|
|
1351 |
//
|
|
1352 |
//
|
|
1353 |
// ---------------------------------------------------------------------------
|
|
1354 |
//
|
|
1355 |
void CBubbleManager::BuildBubblesWithNE()
|
|
1356 |
{
|
|
1357 |
const TUint8 bubbleAmount = ShownHeaderCount();
|
|
1358 |
iVideoFlags &= ~EBMVideoBubbleActive;
|
|
1359 |
|
|
1360 |
switch ( bubbleAmount )
|
|
1361 |
{
|
|
1362 |
case 0:
|
|
1363 |
if ( iConfigFlags & EBMBigNEInIdleState )
|
|
1364 |
{
|
|
1365 |
iNumberEntry->SetPlace(
|
|
1366 |
CBubbleOutlookNumberEntry::ENEIdleState );
|
|
1367 |
}
|
|
1368 |
else
|
|
1369 |
{
|
|
1370 |
iNumberEntry->SetPlace(
|
|
1371 |
CBubbleOutlookNumberEntry::ENEBottom );
|
|
1372 |
}
|
|
1373 |
break;
|
|
1374 |
case 1:
|
|
1375 |
{
|
|
1376 |
// NE is placed according to it's activation time compared
|
|
1377 |
// to call's activation.
|
|
1378 |
TUint8 index = 0;
|
|
1379 |
FindNextDrawableHeader( index );
|
|
1380 |
TInt cnapLength = iActiveHeaders->At( index )->CNAP().Length();
|
|
1381 |
TPhoneCallState callState =
|
|
1382 |
iActiveHeaders->At( index )->CallState();
|
|
1383 |
|
|
1384 |
CBubbleOutlook& bubbleOutlook =
|
|
1385 |
iBubblePlaces->
|
|
1386 |
At( CBubblePlace::EMiddleHeld )->GetBubbleOutlook( );
|
|
1387 |
CBubbleOutlookMiddle& bubbleMiddle =
|
|
1388 |
static_cast< CBubbleOutlookMiddle& >( bubbleOutlook ) ;
|
|
1389 |
bubbleMiddle.SetIsUnder( ETrue );
|
|
1390 |
|
|
1391 |
if ( cnapLength )
|
|
1392 |
{
|
|
1393 |
SetActivePlace( CBubblePlace::EMiddleCnap ,
|
|
1394 |
*iActiveHeaders->At( index ) );
|
|
1395 |
}
|
|
1396 |
else
|
|
1397 |
{
|
|
1398 |
SetActivePlace( CBubblePlace::EMiddleHeld ,
|
|
1399 |
*iActiveHeaders->At( index ) );
|
|
1400 |
}
|
|
1401 |
iNumberEntry->SetPlace( CBubbleOutlookNumberEntry::ENEBottomRight );
|
|
1402 |
break;
|
|
1403 |
}
|
|
1404 |
case 2:
|
|
1405 |
{
|
|
1406 |
// NE goes top left. Calls go like second and waiting
|
|
1407 |
// call when there are three calls.
|
|
1408 |
iNumberEntry->SetPlace( CBubbleOutlookNumberEntry::ENEBottom );
|
|
1409 |
|
|
1410 |
// first call: middle held/active
|
|
1411 |
TUint8 index = 0;
|
|
1412 |
FindNextDrawableHeader( index );
|
|
1413 |
CBubblePlace::TPhoneBubblePlace place = CBubblePlace::ETopLeft;
|
|
1414 |
|
|
1415 |
// second call: bottom held/active
|
|
1416 |
TUint8 index2 = TUint8(index + 1);
|
|
1417 |
FindNextDrawableHeader( index2 );
|
|
1418 |
CBubblePlace::TPhoneBubblePlace place2 = CBubblePlace::ETopRight;
|
|
1419 |
|
|
1420 |
// set drawing order
|
|
1421 |
if ( iActiveHeaders->At( index2 )->CallState( )
|
|
1422 |
> iActiveHeaders->At( index )->CallState( ) )
|
|
1423 |
{
|
|
1424 |
SetActivePlace( place , *iActiveHeaders->At( index ) );
|
|
1425 |
SetActivePlace( place2 , *iActiveHeaders->At( index2 ) );
|
|
1426 |
}
|
|
1427 |
else
|
|
1428 |
{
|
|
1429 |
SetActivePlace( place2 , *iActiveHeaders->At( index2 ) );
|
|
1430 |
SetActivePlace( place , *iActiveHeaders->At( index ) );
|
|
1431 |
}
|
|
1432 |
|
|
1433 |
break;
|
|
1434 |
}
|
|
1435 |
case 3:
|
|
1436 |
{
|
|
1437 |
iNumberEntry->SetPlace( CBubbleOutlookNumberEntry::ENEBottom );
|
|
1438 |
|
|
1439 |
TUint8 index = 0;
|
|
1440 |
FindNextDrawableHeader( index );
|
|
1441 |
|
|
1442 |
TUint8 index2 = TUint8( index + 1 );
|
|
1443 |
FindNextDrawableHeader( index2 );
|
|
1444 |
|
|
1445 |
if ( iActiveHeaders->At( index2 )->CallState( )
|
|
1446 |
> iActiveHeaders->At( index )->CallState( ) )
|
|
1447 |
{
|
|
1448 |
SetActivePlace(
|
|
1449 |
CBubblePlace::EHide , *iActiveHeaders->At( index ) );
|
|
1450 |
SetActivePlace(
|
|
1451 |
CBubblePlace::ETopLeft , *iActiveHeaders->At( index2 ) );
|
|
1452 |
}
|
|
1453 |
else
|
|
1454 |
{
|
|
1455 |
SetActivePlace(
|
|
1456 |
CBubblePlace::EHide , *iActiveHeaders->At( index2 ) );
|
|
1457 |
SetActivePlace(
|
|
1458 |
CBubblePlace::ETopLeft , *iActiveHeaders->At( index ) );
|
|
1459 |
}
|
|
1460 |
|
|
1461 |
index = TUint8( index2 + 1 );
|
|
1462 |
FindNextDrawableHeader( index );
|
|
1463 |
SetActivePlace(
|
|
1464 |
CBubblePlace::ETopRight , *iActiveHeaders->At( index ) );
|
|
1465 |
break;
|
|
1466 |
}
|
|
1467 |
default:
|
|
1468 |
Panic( EBMPanicInvalidNumberOfHeaders );
|
|
1469 |
break;
|
|
1470 |
}
|
|
1471 |
return;
|
|
1472 |
}
|
|
1473 |
|
|
1474 |
// ---------------------------------------------------------------------------
|
|
1475 |
// CBubbleManager::BuildBubblesForTouch
|
|
1476 |
//
|
|
1477 |
//
|
|
1478 |
// ---------------------------------------------------------------------------
|
|
1479 |
//
|
|
1480 |
void CBubbleManager::BuildBubblesForTouch()
|
|
1481 |
{
|
|
1482 |
const TUint8 bubbleAmount = ShownHeaderCount();
|
|
1483 |
iVideoFlags &= ~EBMVideoBubbleActive;
|
|
1484 |
|
|
1485 |
// Without number entry.
|
|
1486 |
switch ( bubbleAmount )
|
|
1487 |
{
|
|
1488 |
case 0:
|
|
1489 |
break;
|
|
1490 |
case 1:
|
|
1491 |
{
|
|
1492 |
TUint8 index = 0;
|
|
1493 |
FindNextDrawableHeader( index );
|
|
1494 |
CBubbleHeader* header = iActiveHeaders->At( index );
|
|
1495 |
TPhoneCallState callState = header->CallState();
|
|
1496 |
TBool callObjectText(
|
|
1497 |
( iConfigFlags & EBMCallObjectDisplay ) &&
|
|
1498 |
( header->CallObjectText().Length() > 0) );
|
|
1499 |
TBool callObjectImage(
|
|
1500 |
( iConfigFlags & EBMCallObjectDisplay ) &&
|
|
1501 |
header->CallObjectImage() );
|
|
1502 |
|
|
1503 |
TInt cnapLength = header->CNAP().Length();
|
|
1504 |
|
|
1505 |
// Video
|
|
1506 |
if ( iVideoFlags & EBMVideoSetAsRingTone &&
|
|
1507 |
( callState == EIncoming || callState == EAlertToDisconnected ) )
|
|
1508 |
{
|
|
1509 |
if ( cnapLength ) // 3-lines
|
|
1510 |
{
|
|
1511 |
SetActivePlace( CBubblePlace::EVideoCnap,
|
|
1512 |
*header );
|
|
1513 |
iVideoFlags |= EBMVideoBubbleActive;
|
|
1514 |
}
|
|
1515 |
else
|
|
1516 |
{
|
|
1517 |
SetActivePlace( CBubblePlace::EVideo,
|
|
1518 |
*header );
|
|
1519 |
iVideoFlags |= EBMVideoBubbleActive;
|
|
1520 |
}
|
|
1521 |
}
|
|
1522 |
// Caller text
|
|
1523 |
else if ( callObjectText && ( callState == EIncoming ||
|
|
1524 |
callState == EOutgoing ||
|
|
1525 |
callState == EAlerting ||
|
|
1526 |
callState == EAlertToDisconnected ) )
|
|
1527 |
{
|
|
1528 |
SetActivePlace( CBubblePlace::EBottomText,
|
|
1529 |
*header );
|
|
1530 |
}
|
|
1531 |
// Incall
|
|
1532 |
else if ( ( callState == EActive ||
|
|
1533 |
callState == EOnHold ||
|
|
1534 |
callState == EDisconnected ) )
|
|
1535 |
{
|
|
1536 |
CBubbleHeader::TBMCallObjectImageType imageType =
|
|
1537 |
header->CallObjectImageType();
|
|
1538 |
|
|
1539 |
if ( callObjectImage &&
|
|
1540 |
( imageType == CBubbleHeader::EGalleryImage ) )
|
|
1541 |
{
|
|
1542 |
TSize imageSize = header->CallObjectImage()->SizeInPixels();
|
|
1543 |
TSize tinySize = CallObjectImageIncallSize( ETrue );
|
|
1544 |
TBool tiny = imageSize.iHeight < tinySize.iHeight;
|
|
1545 |
iBottomImageVariety = tiny ? 0 : 4;
|
|
1546 |
|
|
1547 |
CBubblePlace::TPhoneBubblePlace place;
|
|
1548 |
place = cnapLength ? CBubblePlace::EBottomCnap :
|
|
1549 |
CBubblePlace::EBottomImage;
|
|
1550 |
|
|
1551 |
SetActivePlace( place,
|
|
1552 |
*header );
|
|
1553 |
}
|
|
1554 |
else
|
|
1555 |
{
|
|
1556 |
CBubblePlace::TPhoneBubblePlace place =
|
|
1557 |
cnapLength ? CBubblePlace::EBottomCnap :
|
|
1558 |
CBubblePlace::EBottom;
|
|
1559 |
|
|
1560 |
SetActivePlace( place,
|
|
1561 |
*header );
|
|
1562 |
}
|
|
1563 |
}
|
|
1564 |
// Initializing call
|
|
1565 |
else
|
|
1566 |
{
|
|
1567 |
if ( cnapLength ) // 3-lines
|
|
1568 |
{
|
|
1569 |
SetActivePlace( CBubblePlace::EBottomCnap,
|
|
1570 |
*header );
|
|
1571 |
}
|
|
1572 |
else
|
|
1573 |
{
|
|
1574 |
SetActivePlace( CBubblePlace::EBottom ,
|
|
1575 |
*header );
|
|
1576 |
}
|
|
1577 |
}
|
|
1578 |
break;
|
|
1579 |
}
|
|
1580 |
case 2:
|
|
1581 |
{
|
|
1582 |
// first call: middle held/active
|
|
1583 |
TUint8 index = 0;
|
|
1584 |
FindNextDrawableHeader( index );
|
|
1585 |
TPhoneCallState callState =
|
|
1586 |
iActiveHeaders->At( index )->CallState();
|
|
1587 |
TInt cnapLength = iActiveHeaders->At( index )->CNAP().Length();
|
|
1588 |
|
|
1589 |
// second call: bottom held/active
|
|
1590 |
TUint8 index2 = TUint8(index + 1);
|
|
1591 |
FindNextDrawableHeader( index2 );
|
|
1592 |
TInt cnapLength2 = iActiveHeaders->At( index2 )->CNAP().Length();
|
|
1593 |
TPhoneCallState callState2 =
|
|
1594 |
iActiveHeaders->At( index2 )->CallState();
|
|
1595 |
TPhoneCallState previousState =
|
|
1596 |
iActiveHeaders->At( index )->PreviousCallState();
|
|
1597 |
TPhoneCallState previousState2 =
|
|
1598 |
iActiveHeaders->At( index2 )->PreviousCallState();
|
|
1599 |
|
|
1600 |
CBubblePlace::TPhoneBubblePlace place;
|
|
1601 |
CBubblePlace::TPhoneBubblePlace place2;
|
|
1602 |
|
|
1603 |
if ( !InitializingCall() ) // Incall
|
|
1604 |
{
|
|
1605 |
if ( ( callState == EActive ) ||
|
|
1606 |
( callState == EDisconnected &&
|
|
1607 |
previousState == EActive ) )
|
|
1608 |
{
|
|
1609 |
// First call shown on bottom
|
|
1610 |
place = cnapLength ?
|
|
1611 |
CBubblePlace::EBottomRightActiveCnapTouch :
|
|
1612 |
CBubblePlace::EBottomRightActiveTouch;
|
|
1613 |
place2 = CBubblePlace::EMiddleHeldTouch;
|
|
1614 |
}
|
|
1615 |
else if ( ( callState2 == EActive ) ||
|
|
1616 |
( callState2 == EDisconnected &&
|
|
1617 |
previousState2 == EActive ) )
|
|
1618 |
{
|
|
1619 |
// Second call is shown on bottom
|
|
1620 |
place = CBubblePlace::EMiddleHeldTouch;
|
|
1621 |
place2 = cnapLength2 ?
|
|
1622 |
CBubblePlace::EBottomRightActiveCnapTouch :
|
|
1623 |
CBubblePlace::EBottomRightActiveTouch;
|
|
1624 |
}
|
|
1625 |
else
|
|
1626 |
{
|
|
1627 |
// The call that was shown in the held call position
|
|
1628 |
// keeps that position.
|
|
1629 |
if ( previousState == EOnHold )
|
|
1630 |
{
|
|
1631 |
place = CBubblePlace::EMiddleHeldTouch;
|
|
1632 |
place2 = cnapLength2 ?
|
|
1633 |
CBubblePlace::EBottomRightActiveCnapTouch :
|
|
1634 |
CBubblePlace::EBottomRightActiveTouch;
|
|
1635 |
}
|
|
1636 |
else
|
|
1637 |
{
|
|
1638 |
place = cnapLength ?
|
|
1639 |
CBubblePlace::EBottomRightActiveCnapTouch :
|
|
1640 |
CBubblePlace::EBottomRightActiveTouch;
|
|
1641 |
place2 = CBubblePlace::EMiddleHeldTouch;
|
|
1642 |
}
|
|
1643 |
}
|
|
1644 |
}
|
|
1645 |
else // Initializing call
|
|
1646 |
{
|
|
1647 |
// the call that is in initializing state is shown in
|
|
1648 |
// primary position.
|
|
1649 |
place = CBubblePlace::ETopLeft;
|
|
1650 |
place2 = cnapLength2 ? CBubblePlace::EBottomRightCnap :
|
|
1651 |
CBubblePlace::EBottomRightActive;
|
|
1652 |
}
|
|
1653 |
|
|
1654 |
// set drawing order
|
|
1655 |
if ( callState2 > callState )
|
|
1656 |
{
|
|
1657 |
SetActivePlace( place , *iActiveHeaders->At( index ) );
|
|
1658 |
SetActivePlace( place2 , *iActiveHeaders->At( index2 ) );
|
|
1659 |
}
|
|
1660 |
else
|
|
1661 |
{
|
|
1662 |
SetActivePlace( place2 , *iActiveHeaders->At( index2 ) );
|
|
1663 |
SetActivePlace( place , *iActiveHeaders->At( index ) );
|
|
1664 |
}
|
|
1665 |
}
|
|
1666 |
break;
|
|
1667 |
case 3:
|
|
1668 |
{
|
|
1669 |
TUint8 index = 0;
|
|
1670 |
FindNextDrawableHeader( index );
|
|
1671 |
|
|
1672 |
TUint8 index2 = TUint8( index + 1 );
|
|
1673 |
FindNextDrawableHeader( index2 );
|
|
1674 |
|
|
1675 |
if ( iActiveHeaders->At( index2 )->CallState( )
|
|
1676 |
> iActiveHeaders->At( index )->CallState( ) )
|
|
1677 |
{
|
|
1678 |
SetActivePlace(
|
|
1679 |
CBubblePlace::ETopRight , *iActiveHeaders->At( index ) );
|
|
1680 |
SetActivePlace(
|
|
1681 |
CBubblePlace::ETopLeft , *iActiveHeaders->At( index2 ) );
|
|
1682 |
}
|
|
1683 |
else
|
|
1684 |
{
|
|
1685 |
SetActivePlace(
|
|
1686 |
CBubblePlace::ETopRight , *iActiveHeaders->At( index2 ) );
|
|
1687 |
SetActivePlace(
|
|
1688 |
CBubblePlace::ETopLeft , *iActiveHeaders->At( index ) );
|
|
1689 |
}
|
|
1690 |
|
|
1691 |
|
|
1692 |
index = TUint8( index2 + 1 );
|
|
1693 |
FindNextDrawableHeader( index );
|
|
1694 |
SetActivePlace(
|
|
1695 |
CBubblePlace::EBottomRightActive , *iActiveHeaders->At( index ) );
|
|
1696 |
break;
|
|
1697 |
}
|
|
1698 |
default:
|
|
1699 |
Panic( EBMPanicInvalidNumberOfHeaders );
|
|
1700 |
break;
|
|
1701 |
}
|
|
1702 |
}
|
|
1703 |
|
|
1704 |
// ---------------------------------------------------------------------------
|
|
1705 |
// CBubbleManager::SetPhoneMuted
|
|
1706 |
//
|
|
1707 |
//
|
|
1708 |
// ---------------------------------------------------------------------------
|
|
1709 |
//
|
|
1710 |
EXPORT_C void CBubbleManager::SetPhoneMuted( const TBool& aIsMuted )
|
|
1711 |
{
|
|
1712 |
__ASSERT_ALWAYS(
|
|
1713 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
1714 |
|
|
1715 |
if ( aIsMuted && iMutedImage->Bitmap() == NULL )
|
|
1716 |
{
|
|
1717 |
iImageManager->SetBitmapToImage( iMutedImage ,
|
|
1718 |
EQgn_indi_call_muted ,
|
|
1719 |
EQgn_indi_call_muted_mask );
|
|
1720 |
}
|
|
1721 |
|
|
1722 |
iIsMuted = aIsMuted;
|
|
1723 |
iMutedImage->MakeVisible( iIsMuted );
|
|
1724 |
if ( !iIsMuted )
|
|
1725 |
{
|
|
1726 |
iMutedImage->DrawDeferred();
|
|
1727 |
}
|
|
1728 |
}
|
|
1729 |
|
|
1730 |
// ---------------------------------------------------------------------------
|
|
1731 |
// CBubbleManager::CreateCallHeader
|
|
1732 |
//
|
|
1733 |
//
|
|
1734 |
// ---------------------------------------------------------------------------
|
|
1735 |
//
|
|
1736 |
EXPORT_C CBubbleManager::TBubbleId CBubbleManager::CreateCallHeader( )
|
|
1737 |
{
|
|
1738 |
__ASSERT_ALWAYS(
|
|
1739 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
1740 |
|
|
1741 |
// find unused call header for use.
|
|
1742 |
|
|
1743 |
TUint8 index = 0;
|
|
1744 |
while ( iCallHeaders->At( index )->IsUsed( ) )
|
|
1745 |
{
|
|
1746 |
index++;
|
|
1747 |
__ASSERT_ALWAYS( index < iCallHeaders->Count( ),
|
|
1748 |
Panic( EBMPanicInvalidNumberOfHeaders ) );
|
|
1749 |
}
|
|
1750 |
|
|
1751 |
CBubbleCallHeader* header = iCallHeaders->At( index );
|
|
1752 |
|
|
1753 |
header->SetIsUsed( ETrue );
|
|
1754 |
iActiveHeaders->InsertL( iActiveHeaders->Count( ), header );// Can't leave
|
|
1755 |
|
|
1756 |
return header->BubbleId( );
|
|
1757 |
}
|
|
1758 |
|
|
1759 |
// ---------------------------------------------------------------------------
|
|
1760 |
// CBubbleManager::RemoveCallHeader
|
|
1761 |
//
|
|
1762 |
//
|
|
1763 |
// ---------------------------------------------------------------------------
|
|
1764 |
//
|
|
1765 |
EXPORT_C void CBubbleManager::RemoveCallHeader( const TBubbleId& aBubbleId )
|
|
1766 |
{
|
|
1767 |
__ASSERT_ALWAYS(
|
|
1768 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
1769 |
|
|
1770 |
// find header
|
|
1771 |
CBubbleHeader* header = NULL;
|
|
1772 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
1773 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
1774 |
|
|
1775 |
if ( header->IsConference() )
|
|
1776 |
{
|
|
1777 |
__ASSERT_DEBUG(
|
|
1778 |
EFalse , Panic( EBMPanicReferredHeaderIsConferenceHeader ) );
|
|
1779 |
return;
|
|
1780 |
}
|
|
1781 |
|
|
1782 |
if ( header->IsInConference() )
|
|
1783 |
{
|
|
1784 |
__ASSERT_DEBUG(
|
|
1785 |
EFalse , Panic( EBMPanicReferredCallHeaderIsInConferenceCall ) );
|
|
1786 |
return;
|
|
1787 |
}
|
|
1788 |
|
|
1789 |
header->Reset();
|
|
1790 |
|
|
1791 |
|
|
1792 |
// find the active header from array
|
|
1793 |
TUint8 index = 0;
|
|
1794 |
while ( iActiveHeaders->At( index )->BubbleId( ) != aBubbleId )
|
|
1795 |
{
|
|
1796 |
index++;
|
|
1797 |
}
|
|
1798 |
|
|
1799 |
iActiveHeaders->Delete( index );
|
|
1800 |
|
|
1801 |
iCustomManager->RemoveCustomElements( aBubbleId );
|
|
1802 |
|
|
1803 |
// remove main pane call object
|
|
1804 |
if ( iMainPaneControl &&
|
|
1805 |
iMainPaneControl->BubbleId() == aBubbleId )
|
|
1806 |
{
|
|
1807 |
iMainPaneControl->Reset();
|
|
1808 |
}
|
|
1809 |
|
|
1810 |
if ( ( iConfigFlags & EBMCallObjectDisplay ) && iCallObjectManager )
|
|
1811 |
{
|
|
1812 |
iCallObjectManager->CancelCallObjectLoading( aBubbleId );
|
|
1813 |
}
|
|
1814 |
}
|
|
1815 |
|
|
1816 |
|
|
1817 |
// ---------------------------------------------------------------------------
|
|
1818 |
// CBubbleManager::SetState
|
|
1819 |
//
|
|
1820 |
// for conf also (active/on hold/ none)
|
|
1821 |
// ---------------------------------------------------------------------------
|
|
1822 |
//
|
|
1823 |
EXPORT_C void CBubbleManager::SetState( const TBubbleId& aBubbleId,
|
|
1824 |
const TPhoneCallState& aState )
|
|
1825 |
{
|
|
1826 |
|
|
1827 |
__ASSERT_ALWAYS(
|
|
1828 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
1829 |
|
|
1830 |
// find header
|
|
1831 |
CBubbleHeader* header = NULL;
|
|
1832 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
1833 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
1834 |
|
|
1835 |
TPhoneCallState oldstate = header->CallState();
|
|
1836 |
header->SetCallState( aState );
|
|
1837 |
|
|
1838 |
TUint activeCount = iActiveHeaders->Count();
|
|
1839 |
|
|
1840 |
//check if we have to change the bubble order
|
|
1841 |
if ( (oldstate == EAlerting || oldstate == EOutgoing
|
|
1842 |
|| oldstate == EWaiting || oldstate == EIncoming )
|
|
1843 |
&& aState == EActive
|
|
1844 |
&& iActiveHeaders->At( activeCount - 1 )->BubbleId() == aBubbleId)
|
|
1845 |
{
|
|
1846 |
//so we know that the connected call was the last
|
|
1847 |
if ( activeCount > 1 )
|
|
1848 |
{
|
|
1849 |
//we know that there is another call
|
|
1850 |
TPhoneCallState previouscallstate =
|
|
1851 |
iActiveHeaders->At( activeCount - 2 )->CallState();
|
|
1852 |
|
|
1853 |
if ( previouscallstate == EAlerting
|
|
1854 |
|| previouscallstate == EOutgoing
|
|
1855 |
|| previouscallstate == EWaiting
|
|
1856 |
|| previouscallstate == EIncoming
|
|
1857 |
|| previouscallstate == EAlertToDisconnected )
|
|
1858 |
{
|
|
1859 |
//we know that it's too about to get connection
|
|
1860 |
|
|
1861 |
// now we must change the bubble order so active bubble
|
|
1862 |
// don't stay under rectangular bubble.
|
|
1863 |
|
|
1864 |
CBubbleHeader* tempBubble =
|
|
1865 |
iActiveHeaders->At( activeCount-2 );
|
|
1866 |
iActiveHeaders->At( activeCount-2 ) =
|
|
1867 |
iActiveHeaders->At(activeCount-1 );
|
|
1868 |
iActiveHeaders->At( activeCount-1 ) = tempBubble;
|
|
1869 |
}
|
|
1870 |
|
|
1871 |
}
|
|
1872 |
|
|
1873 |
}
|
|
1874 |
|
|
1875 |
// Call collision exception cases:
|
|
1876 |
|
|
1877 |
// Case: AlertToDisconnected + Waiting
|
|
1878 |
// We have change the drawing order:
|
|
1879 |
if ( activeCount == 2 )
|
|
1880 |
{
|
|
1881 |
if ( iActiveHeaders->At(0)->CallState() == EAlertToDisconnected
|
|
1882 |
&& iActiveHeaders->At(1)->CallState() == EWaiting )
|
|
1883 |
{
|
|
1884 |
// now we must change the bubble order so waiting bubble
|
|
1885 |
// don't stay under alerttodisconnected bubble.
|
|
1886 |
CBubbleHeader* tempBubble = iActiveHeaders->At(0);
|
|
1887 |
iActiveHeaders->At(0) = iActiveHeaders->At(1);
|
|
1888 |
iActiveHeaders->At(1) = tempBubble;
|
|
1889 |
}
|
|
1890 |
}
|
|
1891 |
|
|
1892 |
}
|
|
1893 |
|
|
1894 |
|
|
1895 |
// ---------------------------------------------------------------------------
|
|
1896 |
// CBubbleManager::SetLabel
|
|
1897 |
//
|
|
1898 |
// for conf also
|
|
1899 |
// ---------------------------------------------------------------------------
|
|
1900 |
//
|
|
1901 |
EXPORT_C void CBubbleManager::SetLabel(
|
|
1902 |
const TBubbleId& aBubbleId,
|
|
1903 |
const TDesC& aText,
|
|
1904 |
const TPhoneClippingDirection& aClipDirection)
|
|
1905 |
{
|
|
1906 |
__ASSERT_ALWAYS(
|
|
1907 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
1908 |
|
|
1909 |
// find header
|
|
1910 |
CBubbleHeader* header = NULL;
|
|
1911 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
1912 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
1913 |
|
|
1914 |
BubbleUtils::AddTextToHeader( *header,
|
|
1915 |
BubbleUtils::EBubbleHeaderLabel ,
|
|
1916 |
aText ,
|
|
1917 |
KBubbleLabelMaxLength ,
|
|
1918 |
aClipDirection );
|
|
1919 |
}
|
|
1920 |
|
|
1921 |
// ---------------------------------------------------------------------------
|
|
1922 |
// CBubbleManager::SetLabel
|
|
1923 |
//
|
|
1924 |
// for conf also
|
|
1925 |
// ---------------------------------------------------------------------------
|
|
1926 |
//
|
|
1927 |
EXPORT_C void CBubbleManager::SetLabel(
|
|
1928 |
const TBubbleId& aBubbleId,
|
|
1929 |
const TDesC& aLongText,
|
|
1930 |
const TDesC& aShortText,
|
|
1931 |
const TPhoneClippingDirection& aClipDirection)
|
|
1932 |
{
|
|
1933 |
__ASSERT_ALWAYS(
|
|
1934 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
1935 |
|
|
1936 |
// find header
|
|
1937 |
CBubbleHeader* header = NULL;
|
|
1938 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
1939 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
1940 |
|
|
1941 |
// set both text to single buffer. text are cut from the end.
|
|
1942 |
TInt shortLength = aShortText.Length();
|
|
1943 |
TInt longLength = aLongText.Length();
|
|
1944 |
TInt textLength = longLength + shortLength + 1;
|
|
1945 |
|
|
1946 |
TPtr16 textPtr = iLabelBuf->Des();
|
|
1947 |
textPtr.Zero();
|
|
1948 |
if ( textPtr.MaxLength() < textLength )
|
|
1949 |
{
|
|
1950 |
TRAPD ( err, iLabelBuf = iLabelBuf->ReAllocL( textLength ) );
|
|
1951 |
textPtr.Set( iLabelBuf->Des() );
|
|
1952 |
textPtr.Zero();
|
|
1953 |
if ( longLength > 0 )
|
|
1954 |
{
|
|
1955 |
if ( err != KErrNone )
|
|
1956 |
{
|
|
1957 |
longLength = textPtr.MaxLength() - shortLength - 1;
|
|
1958 |
textPtr.Append( aLongText.Left( longLength ) );
|
|
1959 |
}
|
|
1960 |
else
|
|
1961 |
{
|
|
1962 |
textPtr.Append( aLongText );
|
|
1963 |
}
|
|
1964 |
}
|
|
1965 |
else
|
|
1966 |
{
|
|
1967 |
textPtr.Append( KNullDesC );
|
|
1968 |
}
|
|
1969 |
}
|
|
1970 |
else
|
|
1971 |
{
|
|
1972 |
if ( longLength > 0 )
|
|
1973 |
{
|
|
1974 |
textPtr.Append( aLongText );
|
|
1975 |
}
|
|
1976 |
else
|
|
1977 |
{
|
|
1978 |
textPtr.Append( KNullDesC );
|
|
1979 |
}
|
|
1980 |
}
|
|
1981 |
|
|
1982 |
textPtr.Append( KBubbleTextSeparator );
|
|
1983 |
|
|
1984 |
if ( shortLength > 0 )
|
|
1985 |
{
|
|
1986 |
textPtr.Append( aShortText );
|
|
1987 |
}
|
|
1988 |
else
|
|
1989 |
{
|
|
1990 |
textPtr.Append( KNullDesC );
|
|
1991 |
}
|
|
1992 |
|
|
1993 |
header->SetText( textPtr , aClipDirection );
|
|
1994 |
}
|
|
1995 |
|
|
1996 |
|
|
1997 |
// ---------------------------------------------------------------------------
|
|
1998 |
// CBubbleManager::SetCLI
|
|
1999 |
//
|
|
2000 |
// for conf also
|
|
2001 |
// ---------------------------------------------------------------------------
|
|
2002 |
//
|
|
2003 |
EXPORT_C void CBubbleManager::SetCLI(
|
|
2004 |
const TBubbleId& aBubbleId,
|
|
2005 |
const TDesC& aCLIText,
|
|
2006 |
const TPhoneClippingDirection& aClipDirection )
|
|
2007 |
{
|
|
2008 |
__ASSERT_ALWAYS(
|
|
2009 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
2010 |
|
|
2011 |
// find header
|
|
2012 |
CBubbleHeader* header = NULL;
|
|
2013 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
2014 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
2015 |
|
|
2016 |
|
|
2017 |
// We have a number
|
|
2018 |
if ( aClipDirection == ELeft )
|
|
2019 |
{
|
|
2020 |
BubbleUtils::AddTextToHeader( *header,
|
|
2021 |
BubbleUtils::EBubbleHeaderCLI ,
|
|
2022 |
NumberGroup( aCLIText ),
|
|
2023 |
KBubbleLabelMaxLength ,
|
|
2024 |
aClipDirection );
|
|
2025 |
}
|
|
2026 |
else
|
|
2027 |
{
|
|
2028 |
BubbleUtils::AddTextToHeader( *header,
|
|
2029 |
BubbleUtils::EBubbleHeaderCLI ,
|
|
2030 |
aCLIText ,
|
|
2031 |
KBubbleLabelMaxLength ,
|
|
2032 |
aClipDirection );
|
|
2033 |
}
|
|
2034 |
}
|
|
2035 |
|
|
2036 |
// ---------------------------------------------------------------------------
|
|
2037 |
// CBubbleManager::UpdateCLI
|
|
2038 |
//
|
|
2039 |
// for conf also
|
|
2040 |
// ---------------------------------------------------------------------------
|
|
2041 |
//
|
|
2042 |
EXPORT_C void CBubbleManager::UpdateCLI(
|
|
2043 |
const TBubbleId& aBubbleId,
|
|
2044 |
const TDesC& aCLIText,
|
|
2045 |
const TPhoneClippingDirection& aClipDirection )
|
|
2046 |
{
|
|
2047 |
// find header
|
|
2048 |
CBubbleHeader* header = NULL;
|
|
2049 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
2050 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
2051 |
|
|
2052 |
BubbleUtils::AddTextToHeader( *header,
|
|
2053 |
BubbleUtils::EBubbleHeaderCLI ,
|
|
2054 |
aCLIText ,
|
|
2055 |
KBubbleLabelMaxLength ,
|
|
2056 |
aClipDirection );
|
|
2057 |
|
|
2058 |
|
|
2059 |
// Tell active bubbles to update their CLI if it's visible.
|
|
2060 |
CBubbleOutlook* outlook = NULL;
|
|
2061 |
TInt placeCount = iActivePlaces->Count();
|
|
2062 |
for ( TUint8 index = 0 ; index < placeCount ; index++ )
|
|
2063 |
{
|
|
2064 |
outlook = &iActivePlaces->At( index )->GetBubbleOutlook( );
|
|
2065 |
outlook->DrawCLINow();
|
|
2066 |
}
|
|
2067 |
|
|
2068 |
}
|
|
2069 |
|
|
2070 |
// ---------------------------------------------------------------------------
|
|
2071 |
// CBubbleManager::SetCallTime
|
|
2072 |
//
|
|
2073 |
// for conf also
|
|
2074 |
// ---------------------------------------------------------------------------
|
|
2075 |
//
|
|
2076 |
EXPORT_C void CBubbleManager::SetCallTime( const TBubbleId& aBubbleId,
|
|
2077 |
const TDesC& aCallTime )
|
|
2078 |
{
|
|
2079 |
__ASSERT_ALWAYS(
|
|
2080 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
2081 |
|
|
2082 |
// find header
|
|
2083 |
CBubbleHeader* header = NULL;
|
|
2084 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
2085 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
2086 |
|
|
2087 |
|
|
2088 |
BubbleUtils::AddTextToHeader( *header,
|
|
2089 |
BubbleUtils::EBubbleHeaderTimerCost ,
|
|
2090 |
aCallTime ,
|
|
2091 |
KBubbleLabelMaxLength ,
|
|
2092 |
CBubbleManager::ERight );
|
|
2093 |
|
|
2094 |
}
|
|
2095 |
|
|
2096 |
// ---------------------------------------------------------------------------
|
|
2097 |
// CBubbleManager::UpdateCallTime
|
|
2098 |
//
|
|
2099 |
// for conf also
|
|
2100 |
// ---------------------------------------------------------------------------
|
|
2101 |
//
|
|
2102 |
EXPORT_C void CBubbleManager::UpdateCallTime( const TBubbleId& aBubbleId,
|
|
2103 |
const TDesC& aCallTime )
|
|
2104 |
{
|
|
2105 |
// find header
|
|
2106 |
CBubbleHeader* header = NULL;
|
|
2107 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
2108 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
2109 |
|
|
2110 |
BubbleUtils::AddTextToHeader( *header,
|
|
2111 |
BubbleUtils::EBubbleHeaderTimerCost ,
|
|
2112 |
aCallTime ,
|
|
2113 |
KBubbleLabelMaxLength ,
|
|
2114 |
CBubbleManager::ERight );
|
|
2115 |
|
|
2116 |
// Tell active bubbles to update their timer/cost text if it's visible.
|
|
2117 |
CBubbleOutlook* outlook = NULL;
|
|
2118 |
TInt placeCount = iActivePlaces->Count();
|
|
2119 |
for ( TUint8 index = 0 ; index < placeCount ; index++ )
|
|
2120 |
{
|
|
2121 |
outlook = &iActivePlaces->At( index )->GetBubbleOutlook( );
|
|
2122 |
outlook->DrawTimerCostNow();
|
|
2123 |
}
|
|
2124 |
|
|
2125 |
}
|
|
2126 |
|
|
2127 |
// ---------------------------------------------------------------------------
|
|
2128 |
// CBubbleManager::UpdateCallHeaderText
|
|
2129 |
//
|
|
2130 |
// for conf also
|
|
2131 |
// ---------------------------------------------------------------------------
|
|
2132 |
//
|
|
2133 |
EXPORT_C void CBubbleManager::UpdateCallHeaderText( const TBubbleId& aBubbleId,
|
|
2134 |
const TDesC& aLongText,
|
|
2135 |
const TDesC& aShortText,
|
|
2136 |
const TPhoneClippingDirection& aClipDirection )
|
|
2137 |
{
|
|
2138 |
// find header
|
|
2139 |
CBubbleHeader* header = NULL;
|
|
2140 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
2141 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
2142 |
|
|
2143 |
iIsReadyToDraw++;
|
|
2144 |
SetLabel( aBubbleId, aLongText, aShortText, aClipDirection);
|
|
2145 |
iIsReadyToDraw--;
|
|
2146 |
|
|
2147 |
// Tell active bubbles to update call header text if it's visible.
|
|
2148 |
CBubbleOutlook* outlook = NULL;
|
|
2149 |
TInt placeCount = iActivePlaces->Count();
|
|
2150 |
for ( TUint8 index = 0 ; index < placeCount ; index++ )
|
|
2151 |
{
|
|
2152 |
outlook = &iActivePlaces->At( index )->GetBubbleOutlook( );
|
|
2153 |
outlook->DrawCallHeaderText();
|
|
2154 |
}
|
|
2155 |
|
|
2156 |
}
|
|
2157 |
|
|
2158 |
// ---------------------------------------------------------------------------
|
|
2159 |
// CBubbleManager::SetThumbnail
|
|
2160 |
//
|
|
2161 |
//
|
|
2162 |
// ---------------------------------------------------------------------------
|
|
2163 |
//
|
|
2164 |
EXPORT_C void CBubbleManager::SetThumbnail( const TBubbleId& aBubbleId,
|
|
2165 |
CFbsBitmap* aTnBitmap,
|
|
2166 |
CFbsBitmap* aTnBitmapMask,
|
|
2167 |
TBool aDataOwnershipTransferred )
|
|
2168 |
{
|
|
2169 |
if ( !(iConfigFlags & EBMCallObjectDisplay) )
|
|
2170 |
{
|
|
2171 |
__ASSERT_ALWAYS(
|
|
2172 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
2173 |
}
|
|
2174 |
|
|
2175 |
// find header
|
|
2176 |
CBubbleHeader* header = NULL;
|
|
2177 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
2178 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
2179 |
|
|
2180 |
header->SetTnBitmap( aTnBitmap );
|
|
2181 |
header->SetTnBitmapMask( aTnBitmapMask );
|
|
2182 |
header->SetTnDataOwnership( aDataOwnershipTransferred );
|
|
2183 |
}
|
|
2184 |
|
|
2185 |
// ---------------------------------------------------------------------------
|
|
2186 |
// CBubbleManager::SetCallFlags
|
|
2187 |
//
|
|
2188 |
// for conf also
|
|
2189 |
// ---------------------------------------------------------------------------
|
|
2190 |
//
|
|
2191 |
EXPORT_C void CBubbleManager::SetCallFlags( const TBubbleId& aBubbleId,
|
|
2192 |
const TUint32& aFlags )
|
|
2193 |
{
|
|
2194 |
__ASSERT_ALWAYS(
|
|
2195 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
2196 |
|
|
2197 |
// find header
|
|
2198 |
CBubbleHeader* header = NULL;
|
|
2199 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
2200 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
2201 |
|
|
2202 |
header->SetCallFlags( aFlags );
|
|
2203 |
}
|
|
2204 |
|
|
2205 |
// ---------------------------------------------------------------------------
|
|
2206 |
// CBubbleManager::SetCallFlag
|
|
2207 |
//
|
|
2208 |
// for conf also
|
|
2209 |
// ---------------------------------------------------------------------------
|
|
2210 |
//
|
|
2211 |
EXPORT_C void CBubbleManager::SetCallFlag( const TBubbleId& aBubbleId,
|
|
2212 |
const TPhoneCallTypeFlags& aFlag,
|
|
2213 |
const TBool& aSet )
|
|
2214 |
{
|
|
2215 |
__ASSERT_ALWAYS(
|
|
2216 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
2217 |
|
|
2218 |
// find header
|
|
2219 |
CBubbleHeader* header = NULL;
|
|
2220 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
2221 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
2222 |
|
|
2223 |
if ( aSet )
|
|
2224 |
{
|
|
2225 |
header->SetCallFlag( aFlag );
|
|
2226 |
}
|
|
2227 |
else
|
|
2228 |
{
|
|
2229 |
header->RemoveCallFlag( aFlag );
|
|
2230 |
}
|
|
2231 |
}
|
|
2232 |
|
|
2233 |
// ---------------------------------------------------------------------------
|
|
2234 |
// CBubbleManager::SetNumberType
|
|
2235 |
//
|
|
2236 |
//
|
|
2237 |
// ---------------------------------------------------------------------------
|
|
2238 |
//
|
|
2239 |
EXPORT_C void CBubbleManager::SetNumberType( const TBubbleId& aBubbleId,
|
|
2240 |
const TPhoneNumberType& aNumType )
|
|
2241 |
{
|
|
2242 |
__ASSERT_ALWAYS(
|
|
2243 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
2244 |
|
|
2245 |
// find header
|
|
2246 |
CBubbleHeader* header = NULL;
|
|
2247 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
2248 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
2249 |
|
|
2250 |
header->SetNumberType( aNumType );
|
|
2251 |
}
|
|
2252 |
|
|
2253 |
|
|
2254 |
// ---------------------------------------------------------------------------
|
|
2255 |
// CBubbleManager::SetPbkNumberType
|
|
2256 |
//
|
|
2257 |
//
|
|
2258 |
// ---------------------------------------------------------------------------
|
|
2259 |
//
|
|
2260 |
EXPORT_C void CBubbleManager::SetPbkNumberType( const TBubbleId& aBubbleId,
|
|
2261 |
const TInt aNumType )
|
|
2262 |
{
|
|
2263 |
TPhoneNumberType numType = ENotSet;
|
|
2264 |
switch ( aNumType )
|
|
2265 |
{
|
|
2266 |
case EPbkFieldIdPhoneNumberMobile:
|
|
2267 |
numType = EMobile;
|
|
2268 |
break;
|
|
2269 |
case EPbkFieldIdPhoneNumberStandard:
|
|
2270 |
case EPbkFieldIdPhoneNumberHome:
|
|
2271 |
case EPbkFieldIdPhoneNumberWork:
|
|
2272 |
numType = EPhone;
|
|
2273 |
break;
|
|
2274 |
case EPbkFieldIdFaxNumber:
|
|
2275 |
numType = EFaxNumber;
|
|
2276 |
break;
|
|
2277 |
case EPbkFieldIdPagerNumber:
|
|
2278 |
numType = EPager;
|
|
2279 |
break;
|
|
2280 |
case EPbkFieldIdCarNumber:
|
|
2281 |
numType = ECar;
|
|
2282 |
break;
|
|
2283 |
case EPbkFieldIdAssistantNumber:
|
|
2284 |
numType = EAssistant;
|
|
2285 |
break;
|
|
2286 |
case EPbkFieldIdNone: // flow through
|
|
2287 |
default:
|
|
2288 |
numType = ENotSet;
|
|
2289 |
break;
|
|
2290 |
}
|
|
2291 |
SetNumberType( aBubbleId , numType );
|
|
2292 |
}
|
|
2293 |
|
|
2294 |
// ---------------------------------------------------------------------------
|
|
2295 |
// CBubbleManager::SetPhCntNumberType
|
|
2296 |
//
|
|
2297 |
//
|
|
2298 |
// ---------------------------------------------------------------------------
|
|
2299 |
//
|
|
2300 |
EXPORT_C void CBubbleManager::SetPhCntNumberType(
|
|
2301 |
const TBubbleId& aBubbleId,
|
|
2302 |
const MPhCntMatch::TNumberType aNumberType )
|
|
2303 |
{
|
|
2304 |
#ifdef RD_VIRTUAL_PHONEBOOK
|
|
2305 |
TPhoneNumberType numType = ENotSet;
|
|
2306 |
switch( aNumberType )
|
|
2307 |
{
|
|
2308 |
case MPhCntMatch::EMobileNumber:
|
|
2309 |
numType = EMobile;
|
|
2310 |
break;
|
|
2311 |
|
|
2312 |
case MPhCntMatch::EVoipNumber:
|
|
2313 |
case MPhCntMatch::EStandardNumber:
|
|
2314 |
numType = EPhone;
|
|
2315 |
break;
|
|
2316 |
|
|
2317 |
case MPhCntMatch::EFaxNumber:
|
|
2318 |
numType = EFaxNumber;
|
|
2319 |
break;
|
|
2320 |
|
|
2321 |
case MPhCntMatch::EPagerNumber:
|
|
2322 |
numType = EPager;
|
|
2323 |
break;
|
|
2324 |
case MPhCntMatch::EAssistantNumber:
|
|
2325 |
numType = EAssistant;
|
|
2326 |
break;
|
|
2327 |
case MPhCntMatch::ECarNumber:
|
|
2328 |
numType = ECar;
|
|
2329 |
break;
|
|
2330 |
default:
|
|
2331 |
break;
|
|
2332 |
}
|
|
2333 |
SetNumberType( aBubbleId, numType );
|
|
2334 |
#else
|
|
2335 |
(void) aBubbleId;
|
|
2336 |
(void) aNumberType;
|
|
2337 |
#endif // RD_VIRTUAL_PHONEBOOK
|
|
2338 |
}
|
|
2339 |
|
|
2340 |
// ---------------------------------------------------------------------------
|
|
2341 |
// CBubbleManager::CreateConference
|
|
2342 |
//
|
|
2343 |
// For conference calls only
|
|
2344 |
// ---------------------------------------------------------------------------
|
|
2345 |
//
|
|
2346 |
EXPORT_C CBubbleManager::TBubbleId CBubbleManager::CreateConference(
|
|
2347 |
const TBubbleId& aBubble1,
|
|
2348 |
const TBubbleId& aBubble2 )
|
|
2349 |
{
|
|
2350 |
__ASSERT_ALWAYS(
|
|
2351 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
2352 |
__ASSERT_ALWAYS( iActiveHeaders->Count() < KBubblePlaceMaxVisible,
|
|
2353 |
Panic( EBMPanicInvalidNumberOfHeaders ) );
|
|
2354 |
__ASSERT_DEBUG( !iConfHeader->IsUsed() , Panic( EBMPanicConferenceIsUsed ) );
|
|
2355 |
|
|
2356 |
iConfHeader->SetIsUsed( ETrue );
|
|
2357 |
|
|
2358 |
AddRowToConference( aBubble1 );
|
|
2359 |
AddRowToConference( aBubble2 );
|
|
2360 |
|
|
2361 |
// Put conference header to first so it will be drawn always on top.
|
|
2362 |
iActiveHeaders->InsertL( 0 , iConfHeader ); //Can't leave
|
|
2363 |
|
|
2364 |
return iConfHeader->BubbleId( );
|
|
2365 |
}
|
|
2366 |
|
|
2367 |
// ---------------------------------------------------------------------------
|
|
2368 |
// CBubbleManager::RemoveConference
|
|
2369 |
//
|
|
2370 |
// For conference calls only
|
|
2371 |
// ---------------------------------------------------------------------------
|
|
2372 |
//
|
|
2373 |
EXPORT_C void CBubbleManager::RemoveConference( )
|
|
2374 |
{
|
|
2375 |
__ASSERT_ALWAYS(
|
|
2376 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
2377 |
__ASSERT_ALWAYS( iConfHeader->IsUsed( ), Panic( EBMPanicConferenceNotUsed ) );
|
|
2378 |
|
|
2379 |
iConfHeader->Reset();
|
|
2380 |
|
|
2381 |
|
|
2382 |
// find the active element
|
|
2383 |
TUint8 index = 0;
|
|
2384 |
__ASSERT_ALWAYS(
|
|
2385 |
iActiveHeaders->Count( ) > 0, Panic( EBMPanicInvalidNumberOfHeaders ) );
|
|
2386 |
while ( iActiveHeaders->At( index )->BubbleId( ) != KBubbleConferenceId )
|
|
2387 |
{
|
|
2388 |
index++;
|
|
2389 |
__ASSERT_ALWAYS( index != iActiveHeaders->Count( ),
|
|
2390 |
Panic( EBMPanicInvalidNumberOfHeaders ) );
|
|
2391 |
}
|
|
2392 |
|
|
2393 |
iActiveHeaders->Delete( index );
|
|
2394 |
}
|
|
2395 |
|
|
2396 |
// ---------------------------------------------------------------------------
|
|
2397 |
// CBubbleManager::AddRowToConference
|
|
2398 |
//
|
|
2399 |
// For conference calls only
|
|
2400 |
// ---------------------------------------------------------------------------
|
|
2401 |
//
|
|
2402 |
EXPORT_C void CBubbleManager::AddRowToConference( const TBubbleId& aBubbleId )
|
|
2403 |
{
|
|
2404 |
__ASSERT_ALWAYS(
|
|
2405 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
2406 |
|
|
2407 |
// find header
|
|
2408 |
CBubbleHeader* header = NULL;
|
|
2409 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
2410 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
2411 |
|
|
2412 |
__ASSERT_ALWAYS( header->IsUsed(), Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
2413 |
__ASSERT_ALWAYS( !header->IsConference(),
|
|
2414 |
Panic( EBMPanicReferredHeaderIsConferenceHeader ) );
|
|
2415 |
__ASSERT_ALWAYS( !header->IsInConference(),
|
|
2416 |
Panic( EBMPanicReferredCallHeaderIsInConferenceCall ) );
|
|
2417 |
|
|
2418 |
iConfHeader->AddRow( static_cast<CBubbleCallHeader&>( *header ) ); // type cast downwards
|
|
2419 |
}
|
|
2420 |
|
|
2421 |
// ---------------------------------------------------------------------------
|
|
2422 |
// CBubbleManager::RemoveRowFromConference
|
|
2423 |
//
|
|
2424 |
// For conference calls only
|
|
2425 |
// ---------------------------------------------------------------------------
|
|
2426 |
//
|
|
2427 |
EXPORT_C void CBubbleManager::RemoveRowFromConference( const TBubbleId& aBubbleId )
|
|
2428 |
{
|
|
2429 |
__ASSERT_ALWAYS(
|
|
2430 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
2431 |
|
|
2432 |
iConfHeader->RemoveRow( aBubbleId );
|
|
2433 |
}
|
|
2434 |
|
|
2435 |
// ---------------------------------------------------------------------------
|
|
2436 |
// CBubbleManager::ConferenceRowCount
|
|
2437 |
//
|
|
2438 |
// For conference calls only
|
|
2439 |
// ---------------------------------------------------------------------------
|
|
2440 |
//
|
|
2441 |
EXPORT_C TUint8 CBubbleManager::ConferenceRowCount( ) const
|
|
2442 |
{
|
|
2443 |
return iConfHeader->RowCount();
|
|
2444 |
}
|
|
2445 |
|
|
2446 |
// ---------------------------------------------------------------------------
|
|
2447 |
// CBubbleManager::SetExpandedConferenceCallHeader
|
|
2448 |
//
|
|
2449 |
// For conference calls only
|
|
2450 |
// ---------------------------------------------------------------------------
|
|
2451 |
//
|
|
2452 |
EXPORT_C void CBubbleManager::SetExpandedConferenceCallHeader(
|
|
2453 |
const TBool& aIsExpanded )
|
|
2454 |
{
|
|
2455 |
iConfHeader->SetIsExpanded( aIsExpanded );
|
|
2456 |
}
|
|
2457 |
|
|
2458 |
// ---------------------------------------------------------------------------
|
|
2459 |
// CBubbleManager::IsConferenceExpanded
|
|
2460 |
//
|
|
2461 |
// For conference calls only
|
|
2462 |
// ---------------------------------------------------------------------------
|
|
2463 |
//
|
|
2464 |
EXPORT_C TBool CBubbleManager::IsConferenceExpanded( ) const
|
|
2465 |
{
|
|
2466 |
return iConfHeader->IsExpanded();
|
|
2467 |
}
|
|
2468 |
|
|
2469 |
// ---------------------------------------------------------------------------
|
|
2470 |
// CBubbleManager::SetSelectionInConference
|
|
2471 |
//
|
|
2472 |
// For conference calls only
|
|
2473 |
// ---------------------------------------------------------------------------
|
|
2474 |
//
|
|
2475 |
EXPORT_C void CBubbleManager::SetSelectionInConference(
|
|
2476 |
const TRowNumber& aRowNumber )
|
|
2477 |
{
|
|
2478 |
CBubbleManager::TRowNumber oldrow = iConfHeader->Highlight();
|
|
2479 |
iConfHeader->SetHighlight( aRowNumber );
|
|
2480 |
CBubbleManager::TRowNumber newrow = iConfHeader->Highlight();
|
|
2481 |
|
|
2482 |
UpdateConferenceRows( oldrow , newrow );
|
|
2483 |
}
|
|
2484 |
|
|
2485 |
// ---------------------------------------------------------------------------
|
|
2486 |
// CBubbleManager::SetSelectionIdInConference
|
|
2487 |
//
|
|
2488 |
// For conference calls only
|
|
2489 |
// ---------------------------------------------------------------------------
|
|
2490 |
//
|
|
2491 |
EXPORT_C void CBubbleManager::SetSelectionIdInConference(
|
|
2492 |
const TBubbleId& aBubbleId )
|
|
2493 |
{
|
|
2494 |
CBubbleManager::TRowNumber oldrow = iConfHeader->Highlight();
|
|
2495 |
iConfHeader->SetHighlightId( aBubbleId );
|
|
2496 |
CBubbleManager::TRowNumber newrow = iConfHeader->Highlight();
|
|
2497 |
|
|
2498 |
UpdateConferenceRows( oldrow , newrow );
|
|
2499 |
}
|
|
2500 |
// ---------------------------------------------------------------------------
|
|
2501 |
// CBubbleManager::SelectionInConference
|
|
2502 |
//
|
|
2503 |
// For conference calls only
|
|
2504 |
// ---------------------------------------------------------------------------
|
|
2505 |
//
|
|
2506 |
EXPORT_C CBubbleManager::TRowNumber
|
|
2507 |
CBubbleManager::SelectionInConference() const
|
|
2508 |
{
|
|
2509 |
return iConfHeader->Highlight();
|
|
2510 |
}
|
|
2511 |
|
|
2512 |
// ---------------------------------------------------------------------------
|
|
2513 |
// CBubbleManager::SelectionIdInConference
|
|
2514 |
//
|
|
2515 |
// For conference calls only
|
|
2516 |
// ---------------------------------------------------------------------------
|
|
2517 |
//
|
|
2518 |
EXPORT_C CBubbleManager::TBubbleId
|
|
2519 |
CBubbleManager::SelectionIdInConference() const
|
|
2520 |
{
|
|
2521 |
return iConfHeader->HighlightId();
|
|
2522 |
}
|
|
2523 |
|
|
2524 |
// ---------------------------------------------------------------------------
|
|
2525 |
// CBubbleManager::MoveHighlightOneUpInConference
|
|
2526 |
//
|
|
2527 |
// For conference calls only
|
|
2528 |
// ---------------------------------------------------------------------------
|
|
2529 |
//
|
|
2530 |
EXPORT_C void CBubbleManager::MoveHighlightOneUpInConference()
|
|
2531 |
{
|
|
2532 |
CBubbleManager::TRowNumber oldrow = iConfHeader->Highlight();
|
|
2533 |
iConfHeader->MoveHighlightOneUp();
|
|
2534 |
CBubbleManager::TRowNumber newrow = iConfHeader->Highlight();
|
|
2535 |
|
|
2536 |
UpdateConferenceRows( oldrow , newrow );
|
|
2537 |
}
|
|
2538 |
|
|
2539 |
// ---------------------------------------------------------------------------
|
|
2540 |
// CBubbleManager::MoveHighlightOneDownInConference
|
|
2541 |
//
|
|
2542 |
// For conference calls only
|
|
2543 |
// ---------------------------------------------------------------------------
|
|
2544 |
//
|
|
2545 |
EXPORT_C void CBubbleManager::MoveHighlightOneDownInConference()
|
|
2546 |
{
|
|
2547 |
CBubbleManager::TRowNumber oldrow = iConfHeader->Highlight();
|
|
2548 |
iConfHeader->MoveHighlightOneDown();
|
|
2549 |
CBubbleManager::TRowNumber newrow = iConfHeader->Highlight();
|
|
2550 |
|
|
2551 |
UpdateConferenceRows( oldrow , newrow );
|
|
2552 |
}
|
|
2553 |
|
|
2554 |
|
|
2555 |
|
|
2556 |
// ---------------------------------------------------------------------------
|
|
2557 |
// CBubbleManager::CreateNumberEntry
|
|
2558 |
//
|
|
2559 |
// For number entry
|
|
2560 |
// ---------------------------------------------------------------------------
|
|
2561 |
//
|
|
2562 |
EXPORT_C void CBubbleManager::CreateNumberEntry()
|
|
2563 |
{
|
|
2564 |
__ASSERT_ALWAYS(
|
|
2565 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
2566 |
__ASSERT_ALWAYS( !iNumberEntry->IsUsed(), Panic( EBMPanicNumberEntryInUse ) );
|
|
2567 |
|
|
2568 |
#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
|
|
2569 |
if ( !ShownHeaderCount() ) // Only effects in number entry
|
|
2570 |
{
|
|
2571 |
// Capture transition begin state
|
|
2572 |
GfxTransEffect::Begin( iNumberEntry, KGfxControlAppearAction );
|
|
2573 |
// Set reminder that Begin has been called.
|
|
2574 |
CAknTransitionUtils::SetData( (TInt) this, (TAny*) 1 );
|
|
2575 |
}
|
|
2576 |
#endif //NOT_RD_UI_TRANSITION_EFFECTS_PHASE2
|
|
2577 |
|
|
2578 |
iNumberEntry->SetIsUsed( ETrue );
|
|
2579 |
iNumberEntry->MakeVisible( ETrue );
|
|
2580 |
}
|
|
2581 |
|
|
2582 |
// ---------------------------------------------------------------------------
|
|
2583 |
// CBubbleManager::GetNumberEntry
|
|
2584 |
//
|
|
2585 |
// For number entry
|
|
2586 |
// ---------------------------------------------------------------------------
|
|
2587 |
//
|
|
2588 |
EXPORT_C CCoeControl* CBubbleManager::GetNumberEntry( ) const
|
|
2589 |
{
|
|
2590 |
return iNumberEntry->GetEditor();
|
|
2591 |
}
|
|
2592 |
|
|
2593 |
// ---------------------------------------------------------------------------
|
|
2594 |
// CBubbleManager::IsNumberEntryUsed
|
|
2595 |
//
|
|
2596 |
// For number entry
|
|
2597 |
// ---------------------------------------------------------------------------
|
|
2598 |
//
|
|
2599 |
EXPORT_C TBool CBubbleManager::IsNumberEntryUsed( ) const
|
|
2600 |
{
|
|
2601 |
return iNumberEntry->IsUsed();
|
|
2602 |
}
|
|
2603 |
|
|
2604 |
// ---------------------------------------------------------------------------
|
|
2605 |
// CBubbleManager::SetNumberEntryVisible
|
|
2606 |
//
|
|
2607 |
// For number entry
|
|
2608 |
// ---------------------------------------------------------------------------
|
|
2609 |
//
|
|
2610 |
EXPORT_C void CBubbleManager::SetNumberEntryVisible( const TBool& aVisibility )
|
|
2611 |
{
|
|
2612 |
__ASSERT_ALWAYS(
|
|
2613 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
2614 |
|
|
2615 |
iNumberEntry->SetPlace( CBubbleOutlookNumberEntry::ENENone );
|
|
2616 |
iNumberEntry->MakeVisible( aVisibility );
|
|
2617 |
CCoeControl* editor = iNumberEntry->GetEditor();
|
|
2618 |
if ( !aVisibility )
|
|
2619 |
{
|
|
2620 |
editor->SetFocus( EFalse );
|
|
2621 |
}
|
|
2622 |
else
|
|
2623 |
{
|
|
2624 |
// Don't set focus now ( wait until the screen is redirected )
|
|
2625 |
// We don't want the cursor to be shown until the transition is finished
|
|
2626 |
#ifndef RD_UI_TRANSITION_EFFECTS_PHASE2
|
|
2627 |
editor->SetFocus( ETrue );
|
|
2628 |
#endif
|
|
2629 |
}
|
|
2630 |
}
|
|
2631 |
|
|
2632 |
// ---------------------------------------------------------------------------
|
|
2633 |
// CBubbleManager::SetTextToNumberEntry
|
|
2634 |
//
|
|
2635 |
// For number entry
|
|
2636 |
// ---------------------------------------------------------------------------
|
|
2637 |
//
|
|
2638 |
EXPORT_C void CBubbleManager::SetTextToNumberEntry( const TDesC& aDesC )
|
|
2639 |
{
|
|
2640 |
iNumberEntry->SetText( aDesC );
|
|
2641 |
}
|
|
2642 |
|
|
2643 |
// ---------------------------------------------------------------------------
|
|
2644 |
// CBubbleManager::GetTextFromNumberEntry
|
|
2645 |
//
|
|
2646 |
// For number entry
|
|
2647 |
// ---------------------------------------------------------------------------
|
|
2648 |
//
|
|
2649 |
EXPORT_C void CBubbleManager::GetTextFromNumberEntry( TDes& aDesC )
|
|
2650 |
{
|
|
2651 |
iNumberEntry->GetText( aDesC );
|
|
2652 |
}
|
|
2653 |
|
|
2654 |
// ---------------------------------------------------------------------------
|
|
2655 |
// CBubbleManager::RemoveNumberEntry
|
|
2656 |
//
|
|
2657 |
// For number entry
|
|
2658 |
// ---------------------------------------------------------------------------
|
|
2659 |
//
|
|
2660 |
EXPORT_C void CBubbleManager::RemoveNumberEntry( )
|
|
2661 |
{
|
|
2662 |
__ASSERT_ALWAYS(
|
|
2663 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
2664 |
__ASSERT_ALWAYS(
|
|
2665 |
iNumberEntry->IsUsed(), Panic( EBMPanicNumberEntryNotInUse ) );
|
|
2666 |
|
|
2667 |
#ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
|
|
2668 |
if ( !ShownHeaderCount() ) // Only effects in number entry
|
|
2669 |
{
|
|
2670 |
// Capture transition begin state
|
|
2671 |
GfxTransEffect::Begin( iNumberEntry, KGfxControlDisappearAction );
|
|
2672 |
// Set reminder that Begin has been called.
|
|
2673 |
CAknTransitionUtils::SetData( (TInt) this, (TAny*) 1 );
|
|
2674 |
}
|
|
2675 |
#endif
|
|
2676 |
|
|
2677 |
iNumberEntry->Reset();
|
|
2678 |
iNumberEntry->MakeVisible( EFalse );
|
|
2679 |
}
|
|
2680 |
|
|
2681 |
|
|
2682 |
// ---------------------------------------------------------------------------
|
|
2683 |
// CBubbleManager::FindHeader
|
|
2684 |
//
|
|
2685 |
//
|
|
2686 |
// ---------------------------------------------------------------------------
|
|
2687 |
//
|
|
2688 |
TBool CBubbleManager::FindHeader(
|
|
2689 |
const TBubbleId& aBubbleID,
|
|
2690 |
CBubbleHeader*& aHeader ) const
|
|
2691 |
{
|
|
2692 |
TUint count( TUint8( iCallHeaders->Count() ) );
|
|
2693 |
CBubbleHeader* tempHeader = NULL;
|
|
2694 |
for ( TUint8 i = 0 ; i < count ; i++ )
|
|
2695 |
{
|
|
2696 |
tempHeader = iCallHeaders->At( i );
|
|
2697 |
if ( aBubbleID == tempHeader->BubbleId() )
|
|
2698 |
{
|
|
2699 |
aHeader = tempHeader;
|
|
2700 |
return ETrue;
|
|
2701 |
}
|
|
2702 |
}
|
|
2703 |
aHeader = NULL;
|
|
2704 |
return EFalse;
|
|
2705 |
}
|
|
2706 |
|
|
2707 |
// ---------------------------------------------------------------------------
|
|
2708 |
// CBubbleManager::FindActiveHeader
|
|
2709 |
//
|
|
2710 |
//
|
|
2711 |
// ---------------------------------------------------------------------------
|
|
2712 |
//
|
|
2713 |
TBool CBubbleManager::FindActiveHeader(
|
|
2714 |
const TBubbleId& aBubbleID,
|
|
2715 |
CBubbleHeader*& aHeader ) const
|
|
2716 |
{
|
|
2717 |
TUint count( TUint8( iActiveHeaders->Count() ) );
|
|
2718 |
CBubbleHeader* tempHeader = NULL;
|
|
2719 |
for ( TUint8 i = 0 ; i < count ; i++ )
|
|
2720 |
{
|
|
2721 |
tempHeader = iActiveHeaders->At( i );
|
|
2722 |
if ( aBubbleID == tempHeader->BubbleId() )
|
|
2723 |
{
|
|
2724 |
aHeader = tempHeader;
|
|
2725 |
return ETrue;
|
|
2726 |
}
|
|
2727 |
}
|
|
2728 |
aHeader = NULL;
|
|
2729 |
return EFalse;
|
|
2730 |
}
|
|
2731 |
|
|
2732 |
// ---------------------------------------------------------------------------
|
|
2733 |
// CBubbleManager::UpdateConferenceRows
|
|
2734 |
//
|
|
2735 |
//
|
|
2736 |
// ---------------------------------------------------------------------------
|
|
2737 |
//
|
|
2738 |
void CBubbleManager::UpdateConferenceRows( CBubbleManager::TRowNumber aRow1,
|
|
2739 |
CBubbleManager::TRowNumber aRow2 )
|
|
2740 |
{
|
|
2741 |
// if the rows are the same or conf is not expanded - nothing to do.
|
|
2742 |
if ( aRow1 == aRow2 || !iConfHeader->IsExpanded() )
|
|
2743 |
{
|
|
2744 |
return;
|
|
2745 |
}
|
|
2746 |
|
|
2747 |
// if we are surrounded by start-/endchanges, we don't have to
|
|
2748 |
// worry about drawing.
|
|
2749 |
if ( iIsReadyToDraw > 0 )
|
|
2750 |
{
|
|
2751 |
return;
|
|
2752 |
}
|
|
2753 |
|
|
2754 |
// find current control:
|
|
2755 |
|
|
2756 |
// There should be only one active place: the expanded conference place
|
|
2757 |
if ( iActivePlaces->Count() != 1 )
|
|
2758 |
{
|
|
2759 |
__ASSERT_DEBUG( EFalse, User::Invariant() );
|
|
2760 |
return;
|
|
2761 |
}
|
|
2762 |
|
|
2763 |
CBubbleOutlookConference* control =
|
|
2764 |
static_cast< CBubbleOutlookConference* >
|
|
2765 |
( &iActivePlaces->At(0)->GetBubbleOutlook() );
|
|
2766 |
|
|
2767 |
// make sure it's what we want
|
|
2768 |
if ( control == NULL )
|
|
2769 |
{
|
|
2770 |
__ASSERT_DEBUG( EFalse, User::Invariant() );
|
|
2771 |
return;
|
|
2772 |
}
|
|
2773 |
|
|
2774 |
|
|
2775 |
// Draw row1 first:
|
|
2776 |
control->DrawRowNow( aRow1 );
|
|
2777 |
|
|
2778 |
// Then second row:
|
|
2779 |
control->DrawRowNow( aRow2 );
|
|
2780 |
}
|
|
2781 |
|
|
2782 |
|
|
2783 |
// ---------------------------------------------------------------------------
|
|
2784 |
// CBubbleManager::FocusChanged
|
|
2785 |
//
|
|
2786 |
//
|
|
2787 |
// ---------------------------------------------------------------------------
|
|
2788 |
//
|
|
2789 |
void CBubbleManager::FocusChanged( TDrawNow aDrawNow )
|
|
2790 |
{
|
|
2791 |
if ( iNumberEntry->IsUsed() && iNumberEntry->IsVisible() )
|
|
2792 |
{
|
|
2793 |
iNumberEntry->SetFocus( IsFocused(), aDrawNow );
|
|
2794 |
}
|
|
2795 |
}
|
|
2796 |
|
|
2797 |
// ---------------------------------------------------------------------------
|
|
2798 |
// CBubbleManager::ImageManager
|
|
2799 |
//
|
|
2800 |
//
|
|
2801 |
// ---------------------------------------------------------------------------
|
|
2802 |
//
|
|
2803 |
CBubbleImageManager& CBubbleManager::ImageManager()
|
|
2804 |
{
|
|
2805 |
return *iImageManager;
|
|
2806 |
}
|
|
2807 |
|
|
2808 |
// ---------------------------------------------------------------------------
|
|
2809 |
// CBubbleManager::ResourceManager
|
|
2810 |
//
|
|
2811 |
//
|
|
2812 |
// ---------------------------------------------------------------------------
|
|
2813 |
//
|
|
2814 |
CBubbleResourceManager& CBubbleManager::ResourceManager()
|
|
2815 |
{
|
|
2816 |
return *iResourceManager;
|
|
2817 |
}
|
|
2818 |
|
|
2819 |
// ---------------------------------------------------------------------------
|
|
2820 |
// CBubbleManager::CustomManager
|
|
2821 |
//
|
|
2822 |
//
|
|
2823 |
// ---------------------------------------------------------------------------
|
|
2824 |
//
|
|
2825 |
CBubbleCustomManager& CBubbleManager::CustomManager()
|
|
2826 |
{
|
|
2827 |
return *iCustomManager;
|
|
2828 |
}
|
|
2829 |
|
|
2830 |
// ---------------------------------------------------------------------------
|
|
2831 |
// CBubbleManager::HandleResourceChange
|
|
2832 |
//
|
|
2833 |
//
|
|
2834 |
// ---------------------------------------------------------------------------
|
|
2835 |
//
|
|
2836 |
void CBubbleManager::HandleResourceChange(TInt aType)
|
|
2837 |
{
|
|
2838 |
if ( aType == KEikMessageUnfadeWindows )
|
|
2839 |
{
|
|
2840 |
if ( iIsReadyToDraw == 0 )
|
|
2841 |
{
|
|
2842 |
if ( iActivePlaces->Count() > 0 )
|
|
2843 |
{
|
|
2844 |
iParentControl->DrawNow();
|
|
2845 |
}
|
|
2846 |
}
|
|
2847 |
}
|
|
2848 |
|
|
2849 |
if ( aType == KAknsMessageSkinChange ||
|
|
2850 |
aType == KEikDynamicLayoutVariantSwitch )
|
|
2851 |
{
|
|
2852 |
StartChanges();
|
|
2853 |
|
|
2854 |
if ( aType == KAknsMessageSkinChange )
|
|
2855 |
{
|
|
2856 |
// Remove muted image. It will be reloaded when
|
|
2857 |
// needed for the next time.
|
|
2858 |
iMutedImage->SetPicture( NULL , NULL );
|
|
2859 |
iMutedImage->MakeVisible( EFalse );
|
|
2860 |
|
|
2861 |
// Release all bitmaps from the animations
|
|
2862 |
for ( TInt i = 0; i < iBubblePlaces->Count() ; i++ )
|
|
2863 |
{
|
|
2864 |
iBubblePlaces->At( i )->GetBubbleOutlook().ReleaseBitmaps();
|
|
2865 |
}
|
|
2866 |
|
|
2867 |
// Number entry
|
|
2868 |
iNumberEntry->ReleaseBitmaps();
|
|
2869 |
|
|
2870 |
// Clear all the skinned images from own cache
|
|
2871 |
iImageManager->ClearSkinsCache();
|
|
2872 |
|
|
2873 |
// Set the image back if it was there...
|
|
2874 |
SetPhoneMuted( iIsMuted );
|
|
2875 |
|
|
2876 |
// Recreate all bitmaps from the animations
|
|
2877 |
for ( TInt a = 0; a < iBubblePlaces->Count() ; a++ )
|
|
2878 |
{
|
|
2879 |
iBubblePlaces->At( a )->GetBubbleOutlook().RebuildBitmaps();
|
|
2880 |
}
|
|
2881 |
|
|
2882 |
// Number entry
|
|
2883 |
iNumberEntry->RebuildBitmaps();
|
|
2884 |
|
|
2885 |
// Touch pane
|
|
2886 |
if ( iTouchPane )
|
|
2887 |
{
|
|
2888 |
iTouchPane->HandleResourceChange( aType );
|
|
2889 |
}
|
|
2890 |
|
|
2891 |
// Update preloaded theme image
|
|
2892 |
if ( iCallObjectManager &&
|
|
2893 |
iCallObjectManager->CallThemeImageIcon() )
|
|
2894 |
{
|
|
2895 |
iMainPaneControl->Reset();
|
|
2896 |
|
|
2897 |
iCallObjectManager->ReleaseCallThemeImage();
|
|
2898 |
iCallObjectManager->LoadCallThemeImage(
|
|
2899 |
*iImageManager,
|
|
2900 |
MainPaneImageRect().Size() );
|
|
2901 |
}
|
|
2902 |
}
|
|
2903 |
else if ( aType == KEikDynamicLayoutVariantSwitch )
|
|
2904 |
{
|
|
2905 |
iImageManager->PrepareCachedBitmaps();
|
|
2906 |
}
|
|
2907 |
|
|
2908 |
// Call object
|
|
2909 |
if ( aType == KEikDynamicLayoutVariantSwitch )
|
|
2910 |
{
|
|
2911 |
if ( iCallObjectManager &&
|
|
2912 |
iCallObjectManager->CallThemeImageIcon() )
|
|
2913 |
{
|
|
2914 |
iCallObjectManager->ResizeCallThemeImage( MainPaneImageRect().Size() );
|
|
2915 |
}
|
|
2916 |
|
|
2917 |
if ( iMainPaneControl &&
|
|
2918 |
iMainPaneControl->IsUsed() )
|
|
2919 |
{
|
|
2920 |
ReloadCallObjectImage();
|
|
2921 |
}
|
|
2922 |
}
|
|
2923 |
|
|
2924 |
EndChanges();
|
|
2925 |
|
|
2926 |
// Relayout video
|
|
2927 |
if ( iVideoFlags & EBMVideoPlayingVideo )
|
|
2928 |
{
|
|
2929 |
iVideoController->HandleLayoutChange();
|
|
2930 |
}
|
|
2931 |
|
|
2932 |
return;
|
|
2933 |
}
|
|
2934 |
|
|
2935 |
CCoeControl::HandleResourceChange(aType);
|
|
2936 |
}
|
|
2937 |
|
|
2938 |
// ---------------------------------------------------------------------------
|
|
2939 |
// CBubbleManager::SetCNAP
|
|
2940 |
//
|
|
2941 |
//
|
|
2942 |
// ---------------------------------------------------------------------------
|
|
2943 |
//
|
|
2944 |
EXPORT_C void CBubbleManager::SetCNAP(
|
|
2945 |
const TBubbleId& aBubbleId,
|
|
2946 |
const TDesC& aCNAPText,
|
|
2947 |
const TPhoneClippingDirection& aClipDirection )
|
|
2948 |
{
|
|
2949 |
__ASSERT_ALWAYS(
|
|
2950 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
2951 |
|
|
2952 |
// find header
|
|
2953 |
CBubbleHeader* header = NULL;
|
|
2954 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
2955 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
2956 |
|
|
2957 |
if ( aCNAPText.Length() == 0 )
|
|
2958 |
{
|
|
2959 |
return;
|
|
2960 |
}
|
|
2961 |
|
|
2962 |
// We have a number
|
|
2963 |
if ( aClipDirection == ELeft )
|
|
2964 |
{
|
|
2965 |
BubbleUtils::AddTextToHeader(
|
|
2966 |
*header,
|
|
2967 |
BubbleUtils::EBubbleHeaderCNAP,
|
|
2968 |
NumberGroup( aCNAPText ),
|
|
2969 |
KBubbleLabelMaxLength ,
|
|
2970 |
aClipDirection );
|
|
2971 |
}
|
|
2972 |
else
|
|
2973 |
{
|
|
2974 |
BubbleUtils::AddTextToHeader(
|
|
2975 |
*header,
|
|
2976 |
BubbleUtils::EBubbleHeaderCNAP,
|
|
2977 |
aCNAPText,
|
|
2978 |
KBubbleLabelMaxLength ,
|
|
2979 |
aClipDirection );
|
|
2980 |
}
|
|
2981 |
}
|
|
2982 |
|
|
2983 |
// ---------------------------------------------------------------------------
|
|
2984 |
// CBubbleManager::NumberGroup
|
|
2985 |
//
|
|
2986 |
//
|
|
2987 |
// ---------------------------------------------------------------------------
|
|
2988 |
//
|
|
2989 |
const TDesC& CBubbleManager::NumberGroup( const TDesC& aNumber )
|
|
2990 |
{
|
|
2991 |
if ( iNumberGrouping )
|
|
2992 |
{
|
|
2993 |
iNumberGrouping->Set( aNumber );
|
|
2994 |
return iNumberGrouping->FormattedNumber();
|
|
2995 |
}
|
|
2996 |
else
|
|
2997 |
{
|
|
2998 |
return aNumber;
|
|
2999 |
}
|
|
3000 |
}
|
|
3001 |
|
|
3002 |
// ---------------------------------------------------------------------------
|
|
3003 |
// CBubbleManager::SetCallObjectImage
|
|
3004 |
//
|
|
3005 |
//
|
|
3006 |
// ---------------------------------------------------------------------------
|
|
3007 |
//
|
|
3008 |
EXPORT_C void CBubbleManager::SetCallObjectImage(
|
|
3009 |
const TBubbleId& aBubbleId,
|
|
3010 |
const TDesC& aImageFileName )
|
|
3011 |
{
|
|
3012 |
__ASSERT_ALWAYS( iCallObjectManager,
|
|
3013 |
Panic( EBMPanicFeatureNotSupported ) );
|
|
3014 |
|
|
3015 |
CBubbleHeader* header = NULL;
|
|
3016 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
3017 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
3018 |
|
|
3019 |
if ( !header->CallObjectImage() )
|
|
3020 |
{
|
|
3021 |
if ( !header->IsConference() )
|
|
3022 |
{
|
|
3023 |
// load image from file
|
|
3024 |
TBool threeLines( header->CNAP().Length() > 0 );
|
|
3025 |
CBubbleCallObjectManager::TImageLoadingParams params;
|
|
3026 |
params.iPreferredSize = MainPaneImageRect().Size();
|
|
3027 |
params.iTinyImageSize = MainPaneImageRect( ETrue,
|
|
3028 |
threeLines ).Size();
|
|
3029 |
params.iDisplayMode = Window().DisplayMode();
|
|
3030 |
params.iThumbnailSize = CallObjectImageIncallSize( ETrue );
|
|
3031 |
iCallObjectManager->LoadImageFromFile( aBubbleId,
|
|
3032 |
aImageFileName,
|
|
3033 |
params );
|
|
3034 |
}
|
|
3035 |
else // conference
|
|
3036 |
{
|
|
3037 |
TAknLayoutRect bubbleRect;
|
|
3038 |
bubbleRect.LayoutRect( Rect(),
|
|
3039 |
BubbleLayout2::popup_call2_audio_conf_window(3) );
|
|
3040 |
|
|
3041 |
TSize imageSize(
|
|
3042 |
CallObjectImageIncallSize().iWidth,
|
|
3043 |
bubbleRect.Rect().Size().iHeight );
|
|
3044 |
|
|
3045 |
// load image from file
|
|
3046 |
CBubbleCallObjectManager::TImageLoadingParams params;
|
|
3047 |
params.iPreferredSize = imageSize;
|
|
3048 |
params.iDisplayMode = Window().DisplayMode();
|
|
3049 |
params.iTinyImageSize = TSize(0,0);
|
|
3050 |
params.iThumbnailSize = TSize(0,0);
|
|
3051 |
iCallObjectManager->LoadImageFromFile( aBubbleId,
|
|
3052 |
aImageFileName,
|
|
3053 |
params );
|
|
3054 |
}
|
|
3055 |
|
|
3056 |
header->SetCallObjectFileName( aImageFileName.Alloc() );
|
|
3057 |
header->SetCallObjectImageType(
|
|
3058 |
CBubbleHeader::EGalleryImage );
|
|
3059 |
}
|
|
3060 |
|
|
3061 |
return;
|
|
3062 |
}
|
|
3063 |
|
|
3064 |
// ---------------------------------------------------------------------------
|
|
3065 |
// CBubbleManager::SetCallObjectImage
|
|
3066 |
//
|
|
3067 |
//
|
|
3068 |
// ---------------------------------------------------------------------------
|
|
3069 |
//
|
|
3070 |
EXPORT_C void CBubbleManager::SetCallObjectImage( const TBubbleId& aBubbleId,
|
|
3071 |
CFbsBitmap* aCOBitmap,
|
|
3072 |
CFbsBitmap* aCOBitmapMask,
|
|
3073 |
TBool aDataOwnershipTrasferred )
|
|
3074 |
{
|
|
3075 |
__ASSERT_ALWAYS( ( iConfigFlags & EBMCallObjectDisplay ),
|
|
3076 |
Panic( EBMPanicFeatureNotSupported ) );
|
|
3077 |
|
|
3078 |
__ASSERT_ALWAYS(
|
|
3079 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
3080 |
|
|
3081 |
// find header
|
|
3082 |
CBubbleHeader* header = NULL;
|
|
3083 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
3084 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
3085 |
|
|
3086 |
header->SetCallObjectImage( aCOBitmap );
|
|
3087 |
header->SetCallObjectImageMask( aCOBitmapMask );
|
|
3088 |
header->SetCallObjectImageDataOwnership( aDataOwnershipTrasferred );
|
|
3089 |
iCallObjectChanged = ETrue;
|
|
3090 |
}
|
|
3091 |
|
|
3092 |
// ---------------------------------------------------------------------------
|
|
3093 |
// CBubbleManager::SetCallObjectTheme
|
|
3094 |
//
|
|
3095 |
//
|
|
3096 |
// ---------------------------------------------------------------------------
|
|
3097 |
//
|
|
3098 |
EXPORT_C void CBubbleManager::SetCallObjectFromTheme(
|
|
3099 |
const TBubbleId& aBubbleId )
|
|
3100 |
{
|
|
3101 |
CBubbleHeader* header = NULL;
|
|
3102 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
3103 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
3104 |
|
|
3105 |
if ( !header->CallObjectImage() )
|
|
3106 |
{
|
|
3107 |
CEikImage* themeImage = new CEikImage;
|
|
3108 |
if ( themeImage != NULL )
|
|
3109 |
{
|
|
3110 |
iImageManager->SetBitmapToImage( themeImage,
|
|
3111 |
EQgn_graf_call_image_1,
|
|
3112 |
EQgn_graf_call_image_1_mask );
|
|
3113 |
SetCallObjectImage(
|
|
3114 |
aBubbleId,
|
|
3115 |
const_cast<CFbsBitmap*> ( themeImage->Bitmap() ),
|
|
3116 |
const_cast<CFbsBitmap*> ( themeImage->Mask() ),
|
|
3117 |
ETrue );
|
|
3118 |
|
|
3119 |
themeImage->SetPictureOwnedExternally( ETrue );
|
|
3120 |
delete themeImage;
|
|
3121 |
header->SetCallObjectImageType( CBubbleHeader::EThemeImage );
|
|
3122 |
}
|
|
3123 |
}
|
|
3124 |
}
|
|
3125 |
|
|
3126 |
// ---------------------------------------------------------------------------
|
|
3127 |
// CBubbleManager::SetCallObjectText
|
|
3128 |
//
|
|
3129 |
//
|
|
3130 |
// ---------------------------------------------------------------------------
|
|
3131 |
//
|
|
3132 |
EXPORT_C void CBubbleManager::SetCallObjectText( const TBubbleId& aBubbleId,
|
|
3133 |
const TDesC& aCOText )
|
|
3134 |
{
|
|
3135 |
__ASSERT_ALWAYS( iCallObjectManager,
|
|
3136 |
Panic( EBMPanicFeatureNotSupported ) );
|
|
3137 |
|
|
3138 |
__ASSERT_ALWAYS(
|
|
3139 |
iIsReadyToDraw > 0, Panic( EBMPanicErrorInStartAndEndChanges ) );
|
|
3140 |
|
|
3141 |
// find header
|
|
3142 |
CBubbleHeader* header = NULL;
|
|
3143 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
3144 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
3145 |
|
|
3146 |
if ( !header->CallObjectText().Length() &&
|
|
3147 |
!header->IsConference() )
|
|
3148 |
{
|
|
3149 |
HBufC* text = aCOText.Alloc();
|
|
3150 |
header->SetCallObjectText( text ); // takes ownership
|
|
3151 |
iCallObjectChanged = ETrue;
|
|
3152 |
|
|
3153 |
CBubbleCallObjectManager::TImageLoadingParams params;
|
|
3154 |
params.iPreferredSize = CallObjectImageIncallSize();
|
|
3155 |
params.iTinyImageSize = TSize(0,0);
|
|
3156 |
params.iThumbnailSize = TSize(0,0);
|
|
3157 |
params.iDisplayMode = Window().DisplayMode();
|
|
3158 |
iCallObjectManager->LoadImageFromText( aBubbleId,
|
|
3159 |
aCOText,
|
|
3160 |
params );
|
|
3161 |
header->SetCallObjectImageType(
|
|
3162 |
CBubbleHeader::ETextBasedImage );
|
|
3163 |
}
|
|
3164 |
}
|
|
3165 |
|
|
3166 |
// ---------------------------------------------------------------------------
|
|
3167 |
// CBubbleManager::ChangeEditorMode
|
|
3168 |
//
|
|
3169 |
//
|
|
3170 |
// ---------------------------------------------------------------------------
|
|
3171 |
//
|
|
3172 |
EXPORT_C TInt CBubbleManager::ChangeEditorMode( TBool aDefaultMode )
|
|
3173 |
{
|
|
3174 |
return iNumberEntry->ChangeEditorMode( aDefaultMode );
|
|
3175 |
}
|
|
3176 |
|
|
3177 |
// ---------------------------------------------------------------------------
|
|
3178 |
// CBubbleManager::GetEditorMode
|
|
3179 |
//
|
|
3180 |
//
|
|
3181 |
// ---------------------------------------------------------------------------
|
|
3182 |
//
|
|
3183 |
EXPORT_C TInt CBubbleManager::GetEditorMode() const
|
|
3184 |
{
|
|
3185 |
return iNumberEntry->GetEditorMode();
|
|
3186 |
}
|
|
3187 |
|
|
3188 |
// ---------------------------------------------------------------------------
|
|
3189 |
// CBubbleManager::ResetEditorToDefaultValues
|
|
3190 |
//
|
|
3191 |
//
|
|
3192 |
// ---------------------------------------------------------------------------
|
|
3193 |
//
|
|
3194 |
EXPORT_C void CBubbleManager::ResetEditorToDefaultValues()
|
|
3195 |
{
|
|
3196 |
iNumberEntry->ResetEditorToDefaultValues();
|
|
3197 |
}
|
|
3198 |
|
|
3199 |
// ---------------------------------------------------------------------------
|
|
3200 |
// CBubbleManager::DeactivatepPopupDisplay
|
|
3201 |
//
|
|
3202 |
//
|
|
3203 |
// ---------------------------------------------------------------------------
|
|
3204 |
//
|
|
3205 |
TBool CBubbleManager::FindHeader( const TPhoneCallState& aCallState,
|
|
3206 |
CBubbleHeader*& aHeader ) const
|
|
3207 |
{
|
|
3208 |
// lookup outgoing and incoming call headers
|
|
3209 |
TInt activeHeaderCount( iActiveHeaders->Count() );
|
|
3210 |
for ( TInt i(0); i < activeHeaderCount; i++ )
|
|
3211 |
{
|
|
3212 |
CBubbleHeader* header = iActiveHeaders->At( i );
|
|
3213 |
TPhoneCallState callState( header->CallState() );
|
|
3214 |
if ( callState == aCallState )
|
|
3215 |
{
|
|
3216 |
aHeader = header;
|
|
3217 |
return ETrue;
|
|
3218 |
}
|
|
3219 |
}
|
|
3220 |
|
|
3221 |
return EFalse;
|
|
3222 |
}
|
|
3223 |
|
|
3224 |
|
|
3225 |
// ---------------------------------------------------------------------------
|
|
3226 |
// CBubbleManager::BuildMainPaneCallObjectL
|
|
3227 |
//
|
|
3228 |
//
|
|
3229 |
// ---------------------------------------------------------------------------
|
|
3230 |
//
|
|
3231 |
void CBubbleManager::BuildMainPaneImage()
|
|
3232 |
{
|
|
3233 |
BM_TRACE_( "[BUBBLEMANAGER] CBubbleManager::BuildMainPaneImage" );
|
|
3234 |
|
|
3235 |
CBubbleHeader* incomingHeader = NULL;
|
|
3236 |
CBubbleHeader* outgoingHeader = NULL;
|
|
3237 |
CBubbleHeader* activeHeader = NULL;
|
|
3238 |
CBubbleHeader* holdHeader = NULL;
|
|
3239 |
CBubbleHeader* activeConfHeader = NULL;
|
|
3240 |
|
|
3241 |
// get incoming and outgoing call headers
|
|
3242 |
TInt activeHeaderCount( iActiveHeaders->Count() );
|
|
3243 |
for ( TInt i(0); i < activeHeaderCount; i++ )
|
|
3244 |
{
|
|
3245 |
CBubbleHeader* header = iActiveHeaders->At( i );
|
|
3246 |
TPhoneCallState callState( header->CallState() );
|
|
3247 |
if ( callState == EIncoming || callState == EWaiting )
|
|
3248 |
{
|
|
3249 |
incomingHeader = header;
|
|
3250 |
activeHeader = NULL;
|
|
3251 |
holdHeader = NULL;
|
|
3252 |
activeConfHeader = NULL;
|
|
3253 |
break;
|
|
3254 |
}
|
|
3255 |
else if ( callState == EOutgoing || callState == EAlerting )
|
|
3256 |
{
|
|
3257 |
outgoingHeader = header;
|
|
3258 |
activeHeader = NULL;
|
|
3259 |
holdHeader = NULL;
|
|
3260 |
activeConfHeader = NULL;
|
|
3261 |
break;
|
|
3262 |
}
|
|
3263 |
else if ( callState == EActive )
|
|
3264 |
{
|
|
3265 |
holdHeader = NULL;
|
|
3266 |
if( header->IsConference() )
|
|
3267 |
{
|
|
3268 |
// active conference founded, no image to show
|
|
3269 |
activeConfHeader = header;
|
|
3270 |
activeHeader = NULL;
|
|
3271 |
}
|
|
3272 |
else if ( !activeConfHeader )
|
|
3273 |
{
|
|
3274 |
// no conference, single active
|
|
3275 |
activeHeader = header;
|
|
3276 |
}
|
|
3277 |
}
|
|
3278 |
else if ( callState == EOnHold )
|
|
3279 |
{
|
|
3280 |
if( !activeHeader && !activeConfHeader )
|
|
3281 |
{
|
|
3282 |
// none active headers, hold need to handle
|
|
3283 |
holdHeader = header;
|
|
3284 |
}
|
|
3285 |
}
|
|
3286 |
BM_TRACE_1( "[BUBBLEMANAGER] CBubbleManager::BuildMainPaneImage - callState = %d", callState );
|
|
3287 |
}
|
|
3288 |
|
|
3289 |
if ( holdHeader && iMainPaneControl->IsUsed() )
|
|
3290 |
{
|
|
3291 |
// Keep image in mainpane displayed
|
|
3292 |
return;
|
|
3293 |
}
|
|
3294 |
else if ( activeConfHeader || ( !incomingHeader && !outgoingHeader && !activeHeader && !holdHeader ) )
|
|
3295 |
{
|
|
3296 |
// there are conference call or no incoming, outgoing, active, hold calls , no image
|
|
3297 |
// in mainpane is displayed
|
|
3298 |
iMainPaneControl->Reset();
|
|
3299 |
return;
|
|
3300 |
}
|
|
3301 |
|
|
3302 |
CBubbleHeader* header = incomingHeader;
|
|
3303 |
if ( outgoingHeader )
|
|
3304 |
{
|
|
3305 |
header = outgoingHeader;
|
|
3306 |
}
|
|
3307 |
else if ( activeHeader )
|
|
3308 |
{
|
|
3309 |
// single active
|
|
3310 |
header = activeHeader;
|
|
3311 |
iCallObjectChanged = ETrue;
|
|
3312 |
}
|
|
3313 |
else if ( holdHeader )
|
|
3314 |
{
|
|
3315 |
// single hold and no image yet
|
|
3316 |
header = holdHeader;
|
|
3317 |
iCallObjectChanged = ETrue;
|
|
3318 |
}
|
|
3319 |
|
|
3320 |
if ( header->IsInConference() || header->CallObjectText().Length() )
|
|
3321 |
{
|
|
3322 |
// Conference item or Text is not shown in mainpane.
|
|
3323 |
return;
|
|
3324 |
}
|
|
3325 |
|
|
3326 |
if ( !iMainPaneControl->IsUsed() || iCallObjectChanged )
|
|
3327 |
{
|
|
3328 |
iMainPaneControl->Reset();
|
|
3329 |
iMainPaneControl->ReadBubbleHeader( *header );
|
|
3330 |
iCallObjectChanged = EFalse;
|
|
3331 |
}
|
|
3332 |
}
|
|
3333 |
|
|
3334 |
// ---------------------------------------------------------------------------
|
|
3335 |
// CBubbleManager::ReloadCallObjectImage
|
|
3336 |
//
|
|
3337 |
//
|
|
3338 |
// ---------------------------------------------------------------------------
|
|
3339 |
//
|
|
3340 |
void CBubbleManager::ReloadCallObjectImage()
|
|
3341 |
{
|
|
3342 |
const TBubbleId bubble = iMainPaneControl->BubbleId();
|
|
3343 |
|
|
3344 |
iMainPaneControl->Reset();
|
|
3345 |
|
|
3346 |
CBubbleHeader* header = NULL;
|
|
3347 |
FindActiveHeader( bubble , header );
|
|
3348 |
|
|
3349 |
if ( header && header->CallObjectFileName().Length() )
|
|
3350 |
{
|
|
3351 |
TBool threeLines( header->CNAP().Length() > 0 );
|
|
3352 |
|
|
3353 |
CBubbleCallObjectManager::TImageLoadingParams params;
|
|
3354 |
params.iPreferredSize = MainPaneImageRect().Size();
|
|
3355 |
params.iTinyImageSize = MainPaneImageRect( ETrue, threeLines ).Size();
|
|
3356 |
params.iThumbnailSize = CallObjectImageIncallSize( ETrue );
|
|
3357 |
params.iDisplayMode = Window().DisplayMode();
|
|
3358 |
|
|
3359 |
iCallObjectManager->CancelCallObjectLoading( bubble );
|
|
3360 |
|
|
3361 |
iCallObjectManager->LoadImageFromFile(
|
|
3362 |
bubble,
|
|
3363 |
header->CallObjectFileName(),
|
|
3364 |
params );
|
|
3365 |
|
|
3366 |
header->SetCallObjectImage( NULL );
|
|
3367 |
}
|
|
3368 |
}
|
|
3369 |
|
|
3370 |
// ---------------------------------------------------------------------------
|
|
3371 |
// CBubbleManager::CallIsDroppedByEndKey
|
|
3372 |
//
|
|
3373 |
//
|
|
3374 |
// ---------------------------------------------------------------------------
|
|
3375 |
//
|
|
3376 |
TBool CBubbleManager::IsCallDroppedByEndKey(
|
|
3377 |
const TPhoneCallState& aState ) const
|
|
3378 |
{
|
|
3379 |
TUint activeCallCount( iActiveHeaders->Count() );
|
|
3380 |
|
|
3381 |
if ( activeCallCount == 1 )
|
|
3382 |
{
|
|
3383 |
// just one call, it is always dropped by end key
|
|
3384 |
return ETrue;
|
|
3385 |
}
|
|
3386 |
|
|
3387 |
// Dropping order in multicall state
|
|
3388 |
// 1. Disconnected call
|
|
3389 |
// 2. Initialising or alerting call
|
|
3390 |
// 3. Active call
|
|
3391 |
// 4. Held call
|
|
3392 |
// 5. Waiting call
|
|
3393 |
|
|
3394 |
if ( aState == EWaiting )
|
|
3395 |
{
|
|
3396 |
// never dropped by end key
|
|
3397 |
return EFalse;
|
|
3398 |
}
|
|
3399 |
|
|
3400 |
// go through ongoing calls and check if there is a call with
|
|
3401 |
// higher dropping priority
|
|
3402 |
TBool dropped( ETrue );
|
|
3403 |
for ( TInt i(0); i < activeCallCount; i++ )
|
|
3404 |
{
|
|
3405 |
TPhoneCallState callState = iActiveHeaders->At( i )->CallState();
|
|
3406 |
|
|
3407 |
if ( aState == EOnHold && ( callState == EDisconnected ||
|
|
3408 |
callState == EOutgoing || callState == EAlerting ||
|
|
3409 |
callState == EActive ) )
|
|
3410 |
{
|
|
3411 |
dropped = EFalse;
|
|
3412 |
break;
|
|
3413 |
}
|
|
3414 |
else if ( aState == EActive && ( callState == EDisconnected ||
|
|
3415 |
callState == EOutgoing || callState == EAlerting ) )
|
|
3416 |
{
|
|
3417 |
dropped = EFalse;
|
|
3418 |
break;
|
|
3419 |
}
|
|
3420 |
else if ( ( aState == EOutgoing || aState == EAlerting ) &&
|
|
3421 |
( callState == EDisconnected ) )
|
|
3422 |
{
|
|
3423 |
dropped = EFalse;
|
|
3424 |
break;
|
|
3425 |
}
|
|
3426 |
else
|
|
3427 |
{
|
|
3428 |
// do nothing
|
|
3429 |
}
|
|
3430 |
} // for
|
|
3431 |
|
|
3432 |
return dropped;
|
|
3433 |
}
|
|
3434 |
|
|
3435 |
// ---------------------------------------------------------------------------
|
|
3436 |
// CBubbleManager::ActiveCallCount
|
|
3437 |
//
|
|
3438 |
//
|
|
3439 |
// ---------------------------------------------------------------------------
|
|
3440 |
//
|
|
3441 |
TUint8 CBubbleManager::ActiveCallCount() const
|
|
3442 |
{
|
|
3443 |
return iActiveHeaders->Count();
|
|
3444 |
}
|
|
3445 |
|
|
3446 |
// ---------------------------------------------------------------------------
|
|
3447 |
// CBubbleManager::MainPaneImageRect
|
|
3448 |
//
|
|
3449 |
//
|
|
3450 |
// ---------------------------------------------------------------------------
|
|
3451 |
//
|
|
3452 |
const TRect CBubbleManager::MainPaneImageRect(
|
|
3453 |
TBool aTinyImage,
|
|
3454 |
TBool aThreeLinesShown ) const
|
|
3455 |
{
|
|
3456 |
TRect imageRect; // whole main
|
|
3457 |
|
|
3458 |
if ( aTinyImage )
|
|
3459 |
{
|
|
3460 |
TInt variety = aThreeLinesShown ? 1 : 0;
|
|
3461 |
|
|
3462 |
if ( iConfigFlags & EBMTouchCallhandling )
|
|
3463 |
{
|
|
3464 |
// requires call2_image_placing_area to LAF data.
|
|
3465 |
TAknLayoutRect callPane;
|
|
3466 |
callPane.LayoutRect(
|
|
3467 |
Rect(),
|
|
3468 |
BubbleLayout4::call4_windows_pane(2) );
|
|
3469 |
|
|
3470 |
TAknLayoutRect image;
|
|
3471 |
image.LayoutRect(
|
|
3472 |
callPane.Rect(),
|
|
3473 |
BubbleLayout2::call2_image_placing_area( variety ) );
|
|
3474 |
imageRect = image.Rect();
|
|
3475 |
}
|
|
3476 |
else
|
|
3477 |
{
|
|
3478 |
TAknLayoutRect image;
|
|
3479 |
image.LayoutRect(
|
|
3480 |
Rect(),
|
|
3481 |
BubbleLayout2::call2_image_placing_area( variety ) );
|
|
3482 |
imageRect = image.Rect();
|
|
3483 |
}
|
|
3484 |
}
|
|
3485 |
else
|
|
3486 |
{
|
|
3487 |
if ( iConfigFlags & EBMTouchCallhandling )
|
|
3488 |
{
|
|
3489 |
TAknLayoutRect image;
|
|
3490 |
image.LayoutRect(
|
|
3491 |
Rect(),
|
|
3492 |
BubbleLayout4::call4_image_pane( 2 ) );
|
|
3493 |
imageRect = image.Rect();
|
|
3494 |
}
|
|
3495 |
else
|
|
3496 |
{
|
|
3497 |
// mainpane
|
|
3498 |
imageRect = Rect();
|
|
3499 |
}
|
|
3500 |
}
|
|
3501 |
|
|
3502 |
return imageRect;
|
|
3503 |
}
|
|
3504 |
|
|
3505 |
// ---------------------------------------------------------------------------
|
|
3506 |
// CBubbleManager::PrepareIcons
|
|
3507 |
//
|
|
3508 |
//
|
|
3509 |
// ---------------------------------------------------------------------------
|
|
3510 |
//
|
|
3511 |
EXPORT_C void CBubbleManager::PrepareIcons()
|
|
3512 |
{
|
|
3513 |
iImageManager->PrepareCachedBitmaps();
|
|
3514 |
}
|
|
3515 |
|
|
3516 |
// ---------------------------------------------------------------------------
|
|
3517 |
// CBubbleManager::PreloadCallThemeImage
|
|
3518 |
//
|
|
3519 |
//
|
|
3520 |
// ---------------------------------------------------------------------------
|
|
3521 |
//
|
|
3522 |
EXPORT_C void CBubbleManager::PreloadCallThemeImage( TBool aPreload )
|
|
3523 |
{
|
|
3524 |
__ASSERT_ALWAYS( ( iConfigFlags & EBMCallObjectDisplay ),
|
|
3525 |
Panic( EBMPanicFeatureNotSupported ) );
|
|
3526 |
StartChanges();
|
|
3527 |
iMainPaneControl->Reset();
|
|
3528 |
if ( aPreload )
|
|
3529 |
{
|
|
3530 |
iCallObjectManager->LoadCallThemeImage(
|
|
3531 |
*iImageManager,
|
|
3532 |
MainPaneImageRect().Size() );
|
|
3533 |
}
|
|
3534 |
else
|
|
3535 |
{
|
|
3536 |
iCallObjectManager->ReleaseCallThemeImage();
|
|
3537 |
}
|
|
3538 |
EndChanges();
|
|
3539 |
}
|
|
3540 |
|
|
3541 |
// ---------------------------------------------------------------------------
|
|
3542 |
// CBubbleManager::StartAnimations
|
|
3543 |
//
|
|
3544 |
//
|
|
3545 |
// ---------------------------------------------------------------------------
|
|
3546 |
//
|
|
3547 |
void CBubbleManager::StartAnimations()
|
|
3548 |
{
|
|
3549 |
if ( !IsVisible() )
|
|
3550 |
{
|
|
3551 |
// Animation will be started when this control becomes visible.
|
|
3552 |
return;
|
|
3553 |
}
|
|
3554 |
|
|
3555 |
for ( TInt i = 0 ; i < iActivePlaces->Count() ; i++ )
|
|
3556 |
{
|
|
3557 |
TRAP_IGNORE(
|
|
3558 |
iActivePlaces->At(i)->GetBubbleOutlook().HandleAnimationStartL() );
|
|
3559 |
}
|
|
3560 |
}
|
|
3561 |
|
|
3562 |
// ---------------------------------------------------------------------------
|
|
3563 |
// CBubbleManager::HandleBackgroundImageChange
|
|
3564 |
//
|
|
3565 |
//
|
|
3566 |
// ---------------------------------------------------------------------------
|
|
3567 |
//
|
|
3568 |
EXPORT_C void CBubbleManager::HandleBackgroundImageChange()
|
|
3569 |
{
|
|
3570 |
// Restart animations to update background frames.
|
|
3571 |
StartAnimations();
|
|
3572 |
}
|
|
3573 |
|
|
3574 |
// ---------------------------------------------------------------------------
|
|
3575 |
// CBubbleManager::SetVideoRingTone
|
|
3576 |
//
|
|
3577 |
//
|
|
3578 |
// ---------------------------------------------------------------------------
|
|
3579 |
//
|
|
3580 |
EXPORT_C void CBubbleManager::SetVideoRingTone(
|
|
3581 |
const TDesC& aFileName,
|
|
3582 |
TBubbleVideoPlayMode aPlayMode,
|
|
3583 |
TInt aVolumeLevel,
|
|
3584 |
TBool aUseArbitraryScaling,
|
|
3585 |
MBubbleVideoPlaybackObserver* aObserver )
|
|
3586 |
{
|
|
3587 |
iVideoController->StopAndDeletePlayer();
|
|
3588 |
iVideoController->PrepareToPlayVideo( aFileName,
|
|
3589 |
aPlayMode,
|
|
3590 |
aVolumeLevel,
|
|
3591 |
aUseArbitraryScaling,
|
|
3592 |
aObserver );
|
|
3593 |
|
|
3594 |
iVideoFlags |= EBMVideoSetAsRingTone;
|
|
3595 |
|
|
3596 |
if ( iCallObjectManager )
|
|
3597 |
{
|
|
3598 |
iCallObjectManager->Suspend();
|
|
3599 |
}
|
|
3600 |
}
|
|
3601 |
|
|
3602 |
// ---------------------------------------------------------------------------
|
|
3603 |
// CBubbleManager::StopVideoRingTone
|
|
3604 |
//
|
|
3605 |
//
|
|
3606 |
// ---------------------------------------------------------------------------
|
|
3607 |
//
|
|
3608 |
EXPORT_C void CBubbleManager::StopVideoRingTone()
|
|
3609 |
{
|
|
3610 |
iVideoController->StopPlaying();
|
|
3611 |
}
|
|
3612 |
|
|
3613 |
// ---------------------------------------------------------------------------
|
|
3614 |
// CBubbleManager::MuteVideoRingTone
|
|
3615 |
//
|
|
3616 |
//
|
|
3617 |
// ---------------------------------------------------------------------------
|
|
3618 |
//
|
|
3619 |
EXPORT_C void CBubbleManager::MuteVideoRingTone()
|
|
3620 |
{
|
|
3621 |
iVideoController->MutePlaying();
|
|
3622 |
}
|
|
3623 |
|
|
3624 |
// ---------------------------------------------------------------------------
|
|
3625 |
// CBubbleManager::StopVideoRingTone
|
|
3626 |
//
|
|
3627 |
//
|
|
3628 |
// ---------------------------------------------------------------------------
|
|
3629 |
//
|
|
3630 |
EXPORT_C void CBubbleManager::CancelVideoRingTone()
|
|
3631 |
{
|
|
3632 |
StopAndDeleteVideoPlayer();
|
|
3633 |
}
|
|
3634 |
|
|
3635 |
// ---------------------------------------------------------------------------
|
|
3636 |
// CBubbleManager::CreateVideoPlayerAndPlay
|
|
3637 |
//
|
|
3638 |
//
|
|
3639 |
// ---------------------------------------------------------------------------
|
|
3640 |
//
|
|
3641 |
void CBubbleManager::CreateVideoPlayerAndPlay()
|
|
3642 |
{
|
|
3643 |
iVideoController->CreatePlayerAndPlay();
|
|
3644 |
iVideoFlags |= EBMVideoPlayingVideo;
|
|
3645 |
}
|
|
3646 |
|
|
3647 |
// ---------------------------------------------------------------------------
|
|
3648 |
// CBubbleManager::StopAndDeleteVideoPlayer
|
|
3649 |
//
|
|
3650 |
//
|
|
3651 |
// ---------------------------------------------------------------------------
|
|
3652 |
//
|
|
3653 |
void CBubbleManager::StopAndDeleteVideoPlayer()
|
|
3654 |
{
|
|
3655 |
iVideoController->StopAndDeletePlayer();
|
|
3656 |
iVideoFlags &= ~EBMVideoPlayingVideo;
|
|
3657 |
iVideoFlags &= ~EBMVideoSetAsRingTone;
|
|
3658 |
if ( iCallObjectManager )
|
|
3659 |
{
|
|
3660 |
iCallObjectManager->Resume();
|
|
3661 |
}
|
|
3662 |
}
|
|
3663 |
|
|
3664 |
// ---------------------------------------------------------------------------
|
|
3665 |
// CBubbleManager::VideoController
|
|
3666 |
//
|
|
3667 |
//
|
|
3668 |
// ---------------------------------------------------------------------------
|
|
3669 |
//
|
|
3670 |
CBubbleVideoController& CBubbleManager::VideoController() const
|
|
3671 |
{
|
|
3672 |
return *iVideoController;
|
|
3673 |
}
|
|
3674 |
|
|
3675 |
// ---------------------------------------------------------------------------
|
|
3676 |
// CBubbleManager::CallState
|
|
3677 |
//
|
|
3678 |
//
|
|
3679 |
// ---------------------------------------------------------------------------
|
|
3680 |
//
|
|
3681 |
CBubbleManager::TPhoneCallState CBubbleManager::CallState(
|
|
3682 |
const TBubbleId& aBubbleId )
|
|
3683 |
{
|
|
3684 |
CBubbleHeader* header = NULL;
|
|
3685 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
3686 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
3687 |
return header->CallState();
|
|
3688 |
}
|
|
3689 |
|
|
3690 |
|
|
3691 |
// ---------------------------------------------------------------------------
|
|
3692 |
// CBubbleManager::CallObjectImageIncallSize
|
|
3693 |
//
|
|
3694 |
//
|
|
3695 |
// ---------------------------------------------------------------------------
|
|
3696 |
//
|
|
3697 |
TSize CBubbleManager::CallObjectImageIncallSize( TBool aBigBubble )
|
|
3698 |
{
|
|
3699 |
TAknLayoutRect bubbleRect;
|
|
3700 |
|
|
3701 |
if ( iConfigFlags & EBMTouchCallhandling )
|
|
3702 |
{
|
|
3703 |
TInt variety = aBigBubble ? 4 : 0;
|
|
3704 |
|
|
3705 |
bubbleRect.LayoutRect( Rect(),
|
|
3706 |
BubbleLayout4::popup_call4_audio_first_window(variety) );
|
|
3707 |
}
|
|
3708 |
else
|
|
3709 |
{
|
|
3710 |
if ( aBigBubble )
|
|
3711 |
{
|
|
3712 |
bubbleRect.LayoutRect( Rect(),
|
|
3713 |
BubbleLayout2::popup_call2_audio_first_window(0) );
|
|
3714 |
}
|
|
3715 |
else
|
|
3716 |
{
|
|
3717 |
bubbleRect.LayoutRect( Rect(),
|
|
3718 |
BubbleLayout2::popup_call2_audio_in_window(0) );
|
|
3719 |
}
|
|
3720 |
}
|
|
3721 |
|
|
3722 |
// image size is half from bubble size
|
|
3723 |
TSize imageSize( bubbleRect.Rect().Size() );
|
|
3724 |
// Opaque part in bubble approx. 45%.
|
|
3725 |
imageSize.iWidth -= (45 * imageSize.iWidth) / 100;
|
|
3726 |
return imageSize;
|
|
3727 |
}
|
|
3728 |
|
|
3729 |
// ---------------------------------------------------------------------------
|
|
3730 |
// CBubbleManager::SetParticipantListCLI
|
|
3731 |
//
|
|
3732 |
//
|
|
3733 |
// ---------------------------------------------------------------------------
|
|
3734 |
//
|
|
3735 |
EXPORT_C void CBubbleManager::SetParticipantListCLI(
|
|
3736 |
const TBubbleId& aBubbleId,
|
|
3737 |
TBubbleParticipantListCLI aParticipantCLI )
|
|
3738 |
{
|
|
3739 |
CBubbleHeader* header = NULL;
|
|
3740 |
__ASSERT_ALWAYS( FindActiveHeader( aBubbleId , header ) ,
|
|
3741 |
Panic( EBMPanicBubbleIdIsNotInUse ) );
|
|
3742 |
header->SetParticipantListCLI( aParticipantCLI );
|
|
3743 |
}
|
|
3744 |
|
|
3745 |
// ---------------------------------------------------------------------------
|
|
3746 |
// CBubbleManager::TouchPane
|
|
3747 |
//
|
|
3748 |
//
|
|
3749 |
// ---------------------------------------------------------------------------
|
|
3750 |
//
|
|
3751 |
EXPORT_C MBubbleTouchPaneInterface* CBubbleManager::TouchPane()
|
|
3752 |
{
|
|
3753 |
return iTouchPane;
|
|
3754 |
}
|
|
3755 |
|
|
3756 |
// ---------------------------------------------------------------------------
|
|
3757 |
// CBubbleManager::SetTouchPaneVisible
|
|
3758 |
//
|
|
3759 |
//
|
|
3760 |
// ---------------------------------------------------------------------------
|
|
3761 |
//
|
|
3762 |
EXPORT_C void CBubbleManager::SetTouchPaneVisible( TBool aVisible )
|
|
3763 |
{
|
|
3764 |
iTouchPaneSetVisible = aVisible;
|
|
3765 |
}
|
|
3766 |
|
|
3767 |
// ---------------------------------------------------------------------------
|
|
3768 |
// CBubbleManager::InitializingCall
|
|
3769 |
//
|
|
3770 |
//
|
|
3771 |
// ---------------------------------------------------------------------------
|
|
3772 |
//
|
|
3773 |
TBool CBubbleManager::InitializingCall() const
|
|
3774 |
{
|
|
3775 |
TBool initializingCall = EFalse;
|
|
3776 |
|
|
3777 |
TInt activeHeaderCount( iActiveHeaders->Count() );
|
|
3778 |
for ( TInt i(0); i < activeHeaderCount; i++ )
|
|
3779 |
{
|
|
3780 |
CBubbleHeader* header = iActiveHeaders->At( i );
|
|
3781 |
TPhoneCallState callState( header->CallState() );
|
|
3782 |
if ( callState == EIncoming || callState == EWaiting ||
|
|
3783 |
callState == EAlerting || callState == EOutgoing ||
|
|
3784 |
callState == EAlertToDisconnected )
|
|
3785 |
{
|
|
3786 |
initializingCall = ETrue;
|
|
3787 |
break;
|
|
3788 |
}
|
|
3789 |
}
|
|
3790 |
|
|
3791 |
return initializingCall;
|
|
3792 |
}
|
|
3793 |
|
|
3794 |
// ---------------------------------------------------------------------------
|
|
3795 |
// CBubbleManager::IsTouchCallHandling
|
|
3796 |
//
|
|
3797 |
//
|
|
3798 |
// ---------------------------------------------------------------------------
|
|
3799 |
//
|
|
3800 |
TBool CBubbleManager::IsTouchCallHandling() const
|
|
3801 |
{
|
|
3802 |
return (iConfigFlags & EBMTouchCallhandling);
|
|
3803 |
}
|
|
3804 |
|
|
3805 |
// ---------------------------------------------------------------------------
|
|
3806 |
// CBubbleManager::AddCustomElement
|
|
3807 |
//
|
|
3808 |
//
|
|
3809 |
// ---------------------------------------------------------------------------
|
|
3810 |
//
|
|
3811 |
EXPORT_C void CBubbleManager::AddCustomElement(
|
|
3812 |
const TBubbleId& aBubbleId,
|
|
3813 |
CTelBubbleCustomElement* aElement,
|
|
3814 |
TInt aPriority )
|
|
3815 |
{
|
|
3816 |
if ( aElement->ElementType() == CTelBubbleCustomElement::ECallImage &&
|
|
3817 |
aBubbleId == iMainPaneControl->BubbleId() )
|
|
3818 |
{
|
|
3819 |
// reset control to get it replaced with this custom element
|
|
3820 |
iMainPaneControl->Reset();
|
|
3821 |
}
|
|
3822 |
|
|
3823 |
iCustomManager->AddCustomElement( aBubbleId, aElement, aPriority );
|
|
3824 |
}
|
|
3825 |
|
|
3826 |
// ---------------------------------------------------------------------------
|
|
3827 |
// CBubbleManager::RemoveCustomElement
|
|
3828 |
//
|
|
3829 |
//
|
|
3830 |
// ---------------------------------------------------------------------------
|
|
3831 |
//
|
|
3832 |
EXPORT_C void CBubbleManager::RemoveCustomElement(
|
|
3833 |
const TBubbleId& aBubbleId,
|
|
3834 |
CTelBubbleCustomElement* aElement )
|
|
3835 |
{
|
|
3836 |
if ( aElement->ElementType() == CTelBubbleCustomElement::ECallImage &&
|
|
3837 |
aBubbleId == iMainPaneControl->BubbleId() )
|
|
3838 |
{
|
|
3839 |
// aElement is being used; release it, before removing
|
|
3840 |
// it from custom manager.
|
|
3841 |
iMainPaneControl->Reset();
|
|
3842 |
}
|
|
3843 |
|
|
3844 |
iCustomManager->RemoveCustomElement( aBubbleId, aElement );
|
|
3845 |
}
|
|
3846 |
|
|
3847 |
// End of File
|