phoneuis/BubbleManager/Src/BMBubbleOutlookConference.cpp
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     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:  Outlook Conference
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include    "BMBubbleManager.h" //for enumerations
       
    21 #include    "BMBubbleOutlookConference.h"
       
    22 #include    "BMBubbleImageManager.h"
       
    23 #include    "BMResourceManager.h"
       
    24 #include    "BMConfHeader.h"
       
    25 #include    "BMLayout.h"
       
    26 #include    "BMUtils.h"
       
    27 #include    "BMPanic.h"
       
    28 #include    "BMLayout2.h"
       
    29 #include    "BMLayout4.h"
       
    30 
       
    31 #include    <eiklabel.h>  
       
    32 #include    <eikimage.h>
       
    33 #include    <eikenv.h>
       
    34 #include    <AknsUtils.h>
       
    35 #include    <AknsDrawUtils.h>
       
    36 
       
    37 // ========================= MEMBER FUNCTIONS ================================
       
    38 
       
    39 CBubbleOutlookConference::CBubbleOutlookConference( 
       
    40     CBubbleManager& aBubbleManager ) 
       
    41     : CBubbleOutlook( aBubbleManager )
       
    42     {
       
    43     }
       
    44 
       
    45 // ---------------------------------------------------------------------------
       
    46 // CBubbleOutlookConference::ConstructL
       
    47 // ---------------------------------------------------------------------------
       
    48 //
       
    49 
       
    50 void CBubbleOutlookConference::ConstructL( const TUint8& aCallAmount )
       
    51     {
       
    52     iPaneAmount = aCallAmount;
       
    53     iHeader = NULL;
       
    54 
       
    55     // create panes for each call
       
    56     CBubbleConfPane* pane;
       
    57     iConfPanes = new ( ELeave ) CArrayPtrFlat<CBubbleConfPane>( iPaneAmount );    
       
    58     iConfPanes->SetReserveL( iPaneAmount );
       
    59 
       
    60     for ( TUint8 i = 0 ; i < iPaneAmount ; i++ )
       
    61         {
       
    62         pane = new( ELeave ) CBubbleConfPane;
       
    63         CleanupStack::PushL( pane );
       
    64         pane->SetContainerWindowL( *this );
       
    65         pane->ConstructL( iBubbleManager.IsTouchCallHandling() );
       
    66         iConfPanes->InsertL( i , pane );
       
    67         CleanupStack::Pop( pane );
       
    68         }
       
    69 
       
    70     // Create space for headers 
       
    71     iCalls = new( ELeave ) CArrayPtrFlat<CBubbleCallHeader>( iPaneAmount );
       
    72     iCalls->SetReserveL( iPaneAmount );
       
    73 
       
    74 
       
    75     CBubbleOutlook::ConstructL();
       
    76     ActivateL();
       
    77     }
       
    78 
       
    79 // Destructor
       
    80 CBubbleOutlookConference::~CBubbleOutlookConference()
       
    81     {
       
    82 
       
    83     if ( iCalls && iConfPanes )
       
    84         {
       
    85         Reset();
       
    86         }
       
    87 
       
    88     if ( iCalls )
       
    89         {
       
    90         iCalls->Reset( );
       
    91         delete iCalls;
       
    92         }
       
    93  
       
    94     if ( iConfPanes )
       
    95         {
       
    96         iConfPanes->ResetAndDestroy() ;
       
    97         delete iConfPanes;
       
    98         }
       
    99     
       
   100     iHeader = NULL;
       
   101     }
       
   102 
       
   103 
       
   104 // ---------------------------------------------------------------------------
       
   105 // CBubbleOutlookConference::Reset
       
   106 //
       
   107 //  
       
   108 // ---------------------------------------------------------------------------
       
   109 //
       
   110 void CBubbleOutlookConference::Reset()
       
   111     {
       
   112     iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
       
   113     iBubbleManager.ResourceManager().ReleaseEikLabel( iTimerCost );
       
   114     for ( TUint8 i = 0 ; i < iPaneAmount ; i++ )
       
   115         {
       
   116         iBubbleManager.ResourceManager().ReleaseEikImage( 
       
   117             iConfPanes->At( i )->iCallIndication );
       
   118         iBubbleManager.ResourceManager().ReleaseEikImage( 
       
   119             iConfPanes->At( i )->iCyphOffImage );
       
   120         iBubbleManager.ResourceManager().ReleaseEikLabel( 
       
   121             iConfPanes->At( i )->iTextLine );
       
   122         iConfPanes->At( i )->Reset( );
       
   123         }
       
   124 
       
   125     iCalls->Delete( 0 , iCalls->Count() );
       
   126     
       
   127     iHeader = NULL;
       
   128     }
       
   129 
       
   130 
       
   131 // ---------------------------------------------------------------------------
       
   132 // CBubbleOutlookConference::ReadBubbleHeader
       
   133 //
       
   134 //  
       
   135 // ---------------------------------------------------------------------------
       
   136 //
       
   137 void CBubbleOutlookConference::ReadBubbleHeader( CBubbleHeader& aHeader )
       
   138     {
       
   139     if ( !aHeader.IsUsed() || !aHeader.IsConference() )
       
   140         {
       
   141         return;
       
   142         }
       
   143 
       
   144     iHeader = static_cast< CBubbleConfHeader* >( &aHeader ); 
       
   145 
       
   146     // get call's info. Function returns calls in drawing order.
       
   147     iHeader->GetRows( *iCalls );
       
   148     __ASSERT_ALWAYS( iCalls->Count( ) == iPaneAmount, 
       
   149                                     Panic( EBMPanicInvalidNumberOfHeaders ) );
       
   150 
       
   151 
       
   152     iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );
       
   153 
       
   154     if ( !iCallObjectDisplay )
       
   155         {
       
   156         // Get bubble graphics
       
   157         GetCall1BubbleBitmaps();    
       
   158         }
       
   159 
       
   160     // Get call indicator for each pane.
       
   161     TUint32 flags = 0;  
       
   162     CBubbleManager::TPhoneCallState state;
       
   163 
       
   164     TInt indicationPicture = KErrNotFound;
       
   165     TInt indicationPictureMask =KErrNotFound;
       
   166 
       
   167     for ( TUint8 i = 0 ; i < iPaneAmount ; i++ )
       
   168         {
       
   169         flags = iCalls->At( i )->CallFlags( );
       
   170         state = iCalls->At( i )->CallState( );
       
   171         CEikImage*& image = iConfPanes->At( i )->CallIndicationHandle( );
       
   172 
       
   173         indicationPicture = KErrNotFound;
       
   174         indicationPictureMask = KErrNotFound;
       
   175 
       
   176         if ( state == CBubbleManager::EDisconnected )
       
   177             {
       
   178             indicationPicture = EQgn_indi_call_disconn_conf;
       
   179             indicationPictureMask = EQgn_indi_call_disconn_conf_mask;
       
   180             }
       
   181         else if ( state == CBubbleManager::EActive ) 
       
   182             {
       
   183             indicationPicture = EQgn_indi_call_active_conf;
       
   184             indicationPictureMask = EQgn_indi_call_active_conf_mask;
       
   185             }
       
   186         else 
       
   187             {
       
   188             indicationPicture = EQgn_indi_call_held_conf;
       
   189             indicationPictureMask = EQgn_indi_call_held_conf_mask;
       
   190             }
       
   191 
       
   192         if ( indicationPicture != KErrNotFound )
       
   193             {
       
   194             image = iBubbleManager.ResourceManager().ReserveEikImage();
       
   195             if ( indicationPictureMask == KErrNotFound )
       
   196                 {
       
   197                 iBubbleManager.ImageManager().SetBitmapToImage( 
       
   198                     image, (TBMIcons) indicationPicture );
       
   199                 }
       
   200             else
       
   201                 {
       
   202                 iBubbleManager.ImageManager().SetBitmapToImage( 
       
   203                     image, 
       
   204                     (TBMIcons) indicationPicture , 
       
   205                     (TBMIcons) indicationPictureMask);
       
   206                 }
       
   207             }
       
   208 
       
   209         // Cyph off
       
   210         if ( flags&CBubbleManager::ENoCiphering )
       
   211             {
       
   212             iConfPanes->At( i )->iCyphOffImage = 
       
   213                 iBubbleManager.ResourceManager().ReserveEikImage();
       
   214             iBubbleManager.ImageManager().SetBitmapToImage( 
       
   215                     iConfPanes->At( i )->iCyphOffImage, 
       
   216                     EQgn_indi_call_cyphering_off,
       
   217                     EQgn_indi_call_cyphering_off_mask );
       
   218             }
       
   219 
       
   220         // set CLI to pane
       
   221         if ( ( iCalls->At( i )->ParticipantListCLI() == 
       
   222               CBubbleManager::EParticipantListCNAP ) &&
       
   223              iCalls->At( i )->CNAP().Length() )
       
   224             {
       
   225             // Phonenumber
       
   226             iConfPanes->At( i )->iTextLine = 
       
   227                 iBubbleManager.ResourceManager().ReserveEikLabel();
       
   228             iConfPanes->At( i )->SetText( iCalls->At( i )->CNAP(), 
       
   229                                           iCalls->At( i )->CNAPClipDirection( ) );    
       
   230             }
       
   231         else            
       
   232             {
       
   233             // CLI text
       
   234             iConfPanes->At( i )->iTextLine = 
       
   235                 iBubbleManager.ResourceManager().ReserveEikLabel();
       
   236             iConfPanes->At( i )->SetText( iCalls->At( i )->CLI(), 
       
   237                                           iCalls->At( i )->CLIClipDirection( ) );
       
   238             }
       
   239                                       
       
   240         iConfPanes->At( i )->iCallObjectDisplay = iCallObjectDisplay;
       
   241         }
       
   242 
       
   243     // get highlight
       
   244     for ( TUint8 t = 0 ; t < iConfPanes->Count() ; t++ )
       
   245         {
       
   246         iConfPanes->At( t )->SetHighlight( EFalse );
       
   247         }
       
   248 
       
   249     if ( iHeader->Highlight() != 0 )
       
   250         {
       
   251         iConfPanes->At( iHeader->Highlight() - 1 )->SetHighlight( ETrue );
       
   252         }
       
   253     
       
   254     // place timer/cost text to label
       
   255     if ( !iBubbleManager.IsTouchCallHandling() )
       
   256         {
       
   257         iTimerCost = iBubbleManager.ResourceManager().ReserveEikLabel();
       
   258         BubbleUtils::ClipToLabel( 
       
   259             iHeader->TimerCost( ) , iTimerCost , CBubbleManager::ERight );
       
   260             
       
   261         }
       
   262     }
       
   263 
       
   264 // ---------------------------------------------------------------------------
       
   265 // CBubbleOutlookConference::SizeChanged
       
   266 // called by framwork when the view size is changed
       
   267 // Works with all the conference situations.
       
   268 // ---------------------------------------------------------------------------
       
   269 //
       
   270 void CBubbleOutlookConference::SizeChanged()
       
   271     {
       
   272     if( !iHeader )
       
   273         {
       
   274         return;
       
   275         }
       
   276         
       
   277     AknsUtils::RegisterControlPosition( this );
       
   278 
       
   279     if ( iBubbleManager.IsTouchCallHandling() )
       
   280         {
       
   281         TRAPD( err, DoCall4LayoutL() );
       
   282         if ( err )    
       
   283             {
       
   284             iBubble->SetPicture( NULL, NULL );
       
   285             MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   286             AknsDrawUtils::PrepareFrame( skin,
       
   287                                          iOuterRect,
       
   288                                          iInnerRect,
       
   289                                          iFrameId,
       
   290                                          KAknsIIDDefault );
       
   291             }
       
   292         }
       
   293     else if ( !iCallObjectDisplay )
       
   294         {
       
   295         DoCall1Layout();    
       
   296         }
       
   297     else
       
   298         {
       
   299         TRAPD( err, DoCall2LayoutL() );
       
   300         if ( err )    
       
   301             {
       
   302             iBubble->SetPicture( NULL, NULL );
       
   303             MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   304             AknsDrawUtils::PrepareFrame( skin,
       
   305                                          iOuterRect,
       
   306                                          iInnerRect,
       
   307                                          iFrameId,
       
   308                                          KAknsIIDDefault );
       
   309             }  
       
   310         }      
       
   311 
       
   312     }
       
   313 
       
   314 // ---------------------------------------------------------------------------
       
   315 // CBubbleOutlookConference::CountComponentControls
       
   316 //
       
   317 //  
       
   318 // ---------------------------------------------------------------------------
       
   319 //
       
   320 TInt CBubbleOutlookConference::CountComponentControls() const
       
   321     {
       
   322     if ( iTimerCost )
       
   323         {
       
   324         return 1 + iConfPanes->Count( );
       
   325         }
       
   326     return iConfPanes->Count( );
       
   327     }
       
   328 
       
   329 // ---------------------------------------------------------------------------
       
   330 // CBubbleOutlookConference::ComponentControl
       
   331 //
       
   332 //  
       
   333 // ---------------------------------------------------------------------------
       
   334 //
       
   335 CCoeControl* CBubbleOutlookConference::ComponentControl(TInt aIndex) const
       
   336     {
       
   337     if ( iTimerCost )
       
   338         {
       
   339         if ( aIndex < iConfPanes->Count( ) ) 
       
   340             {
       
   341             return iConfPanes->At( aIndex );
       
   342             }
       
   343         else if ( aIndex == iConfPanes->Count( ) ) 
       
   344             {
       
   345             return iTimerCost;
       
   346             }
       
   347         else 
       
   348             {
       
   349             return NULL;
       
   350             }
       
   351         }
       
   352     return iConfPanes->At( aIndex );
       
   353     }
       
   354 
       
   355 // ---------------------------------------------------------------------------
       
   356 // CBubbleOutlookConference::Draw
       
   357 // 
       
   358 //  
       
   359 // ---------------------------------------------------------------------------
       
   360 //
       
   361 void CBubbleOutlookConference::Draw( const TRect& /*aRect*/ ) const
       
   362     {
       
   363     }
       
   364 
       
   365 // ---------------------------------------------------------------------------
       
   366 // CBubbleOutlookConference::DrawTimerCostNow
       
   367 //
       
   368 //  
       
   369 // ---------------------------------------------------------------------------
       
   370 //
       
   371 void CBubbleOutlookConference::DrawTimerCostNow()
       
   372     {
       
   373     if ( iHeader == NULL || iTimerCost == NULL )
       
   374         {
       
   375         return;
       
   376         }
       
   377 
       
   378     if ( iHeader->CallState() != CBubbleManager::EActive 
       
   379         || iTimerCost->Text()->Compare( iHeader->TimerCost() ) == 0 )
       
   380         {
       
   381         return;
       
   382         }
       
   383     
       
   384     BubbleUtils::ClipToLabel( 
       
   385         iHeader->TimerCost() , iTimerCost , CBubbleManager::ERight );
       
   386     DrawLabelNow( iTimerCost );
       
   387     }
       
   388 
       
   389 // ---------------------------------------------------------------------------
       
   390 // CBubbleOutlookConference::DrawCLINow
       
   391 //
       
   392 //  
       
   393 // ---------------------------------------------------------------------------
       
   394 //
       
   395 void CBubbleOutlookConference::DrawCLINow()
       
   396     {
       
   397     }
       
   398 
       
   399 // ---------------------------------------------------------------------------
       
   400 // CBubbleOutlookConference::DrawRowNow
       
   401 //
       
   402 //  
       
   403 // ---------------------------------------------------------------------------
       
   404 //
       
   405 void CBubbleOutlookConference::DrawRowNow( CBubbleManager::TRowNumber aRow )
       
   406     {
       
   407     if ( iHeader == NULL || aRow == 0 )
       
   408         {
       
   409         return;
       
   410         }
       
   411 
       
   412     // get highlight
       
   413     for ( TUint8 t = 0 ; t < iConfPanes->Count() ; t++ )
       
   414         {
       
   415         iConfPanes->At( t )->SetHighlight( EFalse );
       
   416         }
       
   417 
       
   418     if ( iHeader->Highlight() != 0 )
       
   419         {
       
   420         iConfPanes->At( iHeader->Highlight() - 1 )->SetHighlight( ETrue );
       
   421         }
       
   422 
       
   423     DrawLabelNow( iConfPanes->At( aRow - 1 ) );
       
   424     }
       
   425 
       
   426 // ---------------------------------------------------------------------------
       
   427 // CBubbleOutlookConference::DrawBitmaps
       
   428 //
       
   429 //  
       
   430 // ---------------------------------------------------------------------------
       
   431 //
       
   432 void CBubbleOutlookConference::DrawBitmaps( CBitmapContext& aGc ) const
       
   433     {
       
   434     // Check that proper conference header is set
       
   435     if ( iHeader == NULL )
       
   436         {
       
   437         return;
       
   438         }
       
   439 
       
   440     if ( !iHeader->IsUsed() || !iHeader->IsConference( ) ) 
       
   441         {
       
   442         return;
       
   443         }
       
   444 
       
   445     aGc.SetBrushColor( AKN_LAF_COLOR( BubbleLayout::LayoutColourWhite() ) );
       
   446     
       
   447     if ( !iCallObjectDisplay )
       
   448         {
       
   449         BubbleUtils::DrawMaskedImage( aGc , iBubble );
       
   450         }
       
   451     else
       
   452         {
       
   453         if ( iBubble->Bitmap() )
       
   454             {
       
   455             BubbleUtils::DrawMaskedImage( aGc , iBubble );    
       
   456             }
       
   457         else
       
   458             {
       
   459             // Draw bubble frame
       
   460             MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   461             if ( !AknsDrawUtils::DrawFrame( skin,
       
   462                                             (CWindowGc&) aGc,  
       
   463                                             iOuterRect,
       
   464                                             iInnerRect,
       
   465                                             iFrameId,
       
   466                                             KAknsIIDDefault ) )
       
   467                 {
       
   468                 BubbleUtils::DrawBackgroundRect( aGc, Rect() );
       
   469                 }        
       
   470             }    
       
   471         }        
       
   472     }
       
   473 
       
   474 // ---------------------------------------------------------------------------
       
   475 // CBubbleOutlookConference::HandleAnimationStartL
       
   476 //
       
   477 //  
       
   478 // ---------------------------------------------------------------------------
       
   479 //
       
   480 void CBubbleOutlookConference::HandleAnimationStartL() const
       
   481     {
       
   482     }
       
   483 
       
   484 // ---------------------------------------------------------------------------
       
   485 //  CBubbleOutlookConference::DrawCallHeaderText
       
   486 // ---------------------------------------------------------------------------
       
   487 //
       
   488 void CBubbleOutlookConference::DrawCallHeaderText()
       
   489     {    
       
   490     }
       
   491     
       
   492 // ---------------------------------------------------------------------------
       
   493 // CBubbleOutlookConference::DoCall1Layout
       
   494 // ---------------------------------------------------------------------------
       
   495 //    
       
   496 void CBubbleOutlookConference::DoCall1Layout()
       
   497     {
       
   498     // Deprecated
       
   499     }
       
   500 
       
   501 // ---------------------------------------------------------------------------
       
   502 // CBubbleOutlookConference::DoCall2Layout
       
   503 // ---------------------------------------------------------------------------
       
   504 //
       
   505 void CBubbleOutlookConference::DoCall2LayoutL()
       
   506     {
       
   507     iBubble->SetPictureOwnedExternally( EFalse );
       
   508     iBubble->SetPicture( NULL, NULL );
       
   509     
       
   510     TAknLayoutRect bubbleRect;
       
   511     bubbleRect.LayoutRect( 
       
   512         Rect(), 
       
   513         BubbleLayout2::popup_call2_conf_pane_background() );
       
   514             
       
   515     TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
       
   516     TRect outerRect;
       
   517     TRect innerRect;
       
   518     BubbleLayout2::BubbleFrameInnerOuterRects( frameRect, 
       
   519                                                outerRect, 
       
   520                                                innerRect );
       
   521 
       
   522     iFrameId = KAknsIIDQsnFrCall2BubbleFirst;
       
   523     TAknsItemID coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;
       
   524             
       
   525     iOuterRect = outerRect;
       
   526     iOuterRect.Move( Rect().iTl );
       
   527     iInnerRect = innerRect;
       
   528     iInnerRect.Move( Rect().iTl );
       
   529             
       
   530     // CLI list and panes
       
   531     TAknLayoutRect cliList;
       
   532     cliList.LayoutRect( Rect(), 
       
   533         BubbleLayout2::popup_call2_conf_cli_list() );
       
   534     TRect cliListRect = cliList.Rect();
       
   535     
       
   536     for ( TUint8 paneIndex = 0; paneIndex < iPaneAmount; paneIndex++ )
       
   537         {
       
   538         TAknLayoutRect singlePane;
       
   539         singlePane.LayoutRect( cliListRect, 
       
   540             BubbleLayout2::popup_call2_conf_single_list_graphic_pane( 
       
   541             paneIndex ) );
       
   542         TRect singlePaneRect = singlePane.Rect();
       
   543         iConfPanes->At( paneIndex )->SetRect( singlePaneRect );
       
   544         }   
       
   545     
       
   546     // Timer
       
   547     BubbleUtils::LayoutLabel( 
       
   548         iTimerCost, 
       
   549         Rect(),
       
   550         BubbleLayout2::popup_call2_conf_window_call_timer_text() );
       
   551     
       
   552     // Create call object bitmaps
       
   553     iBubble->SetRect( bubbleRect.Rect() );                
       
   554     
       
   555     BubbleUtils::PrepareBubbleImageL( 
       
   556         iFrameId,
       
   557         outerRect,
       
   558         innerRect,
       
   559         iBubble );
       
   560     
       
   561     if ( iHeader->CallObjectImage() )
       
   562         {
       
   563         // Scale image according to bubble size
       
   564         TSize imageSize( Rect().Size() );
       
   565         imageSize.iWidth -= imageSize.iWidth / 2;
       
   566         
       
   567         BubbleUtils::PrepareCallObjectImageL(
       
   568             *iHeader,
       
   569             imageSize );
       
   570         
       
   571         TAknLayoutRect cliRect;
       
   572         cliRect.LayoutRect( 
       
   573             frameRect, 
       
   574             BubbleLayout2::popup_call2_bubble_pane_graphics_cli() );
       
   575                     
       
   576         // Combine image to bubble image
       
   577         BubbleUtils::PrepareCallObjectToBubbleImageL(
       
   578             iHeader->CallObjectImage(),
       
   579             iHeader->CallObjectImageMask(),
       
   580             cliRect.Rect(),
       
   581             coMaskFrameId, // gradient image mask
       
   582             outerRect,
       
   583             innerRect,
       
   584             iBubble );                                        
       
   585         }    
       
   586     }
       
   587     
       
   588 // ---------------------------------------------------------------------------
       
   589 // CBubbleOutlookConference::DoCall4LayoutL
       
   590 // ---------------------------------------------------------------------------
       
   591 //
       
   592 void CBubbleOutlookConference::DoCall4LayoutL()
       
   593     {
       
   594     iBubble->SetPictureOwnedExternally( EFalse );
       
   595     iBubble->SetPicture( NULL, NULL );
       
   596     
       
   597     TAknLayoutRect bubbleRect;
       
   598     bubbleRect.LayoutRect( 
       
   599         Rect(), 
       
   600         BubbleLayout4::popup_call4_conf_pane_background() );
       
   601             
       
   602     TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
       
   603     TRect outerRect;
       
   604     TRect innerRect;
       
   605     BubbleLayout2::BubbleFrameInnerOuterRects( frameRect, 
       
   606                                                outerRect, 
       
   607                                                innerRect );
       
   608 
       
   609     iFrameId = KAknsIIDQsnFrCall2BubbleFirst;
       
   610     TAknsItemID coMaskFrameId = KAknsIIDQsnFrCall2BubbleFirstCoMask;
       
   611             
       
   612     iOuterRect = outerRect;
       
   613     iOuterRect.Move( Rect().iTl );
       
   614     iInnerRect = innerRect;
       
   615     iInnerRect.Move( Rect().iTl );
       
   616             
       
   617     // CLI list and panes
       
   618     TAknLayoutRect cliList;
       
   619     cliList.LayoutRect( Rect(), 
       
   620         BubbleLayout4::popup_call4_conf_cli_list() );
       
   621     TRect cliListRect = cliList.Rect();
       
   622     
       
   623     for ( TUint8 paneIndex = 0; paneIndex < iPaneAmount; paneIndex++ )
       
   624         {
       
   625         TAknLayoutRect singlePane;
       
   626         singlePane.LayoutRect( cliListRect, 
       
   627             BubbleLayout4::popup_call4_conf_single_list_graphic_pane( 
       
   628             paneIndex ) );
       
   629         TRect singlePaneRect = singlePane.Rect();
       
   630         iConfPanes->At( paneIndex )->SetRect( singlePaneRect );
       
   631         }   
       
   632     
       
   633     // Create call object bitmaps
       
   634     iBubble->SetRect( bubbleRect.Rect() );                
       
   635     
       
   636     BubbleUtils::PrepareBubbleImageL( 
       
   637         iFrameId,
       
   638         outerRect,
       
   639         innerRect,
       
   640         iBubble );
       
   641     
       
   642     if ( iHeader->CallObjectImage() )
       
   643         {
       
   644         // Scale image according to bubble size
       
   645         TSize imageSize( Rect().Size() );
       
   646         imageSize.iWidth -= imageSize.iWidth / 2;
       
   647         
       
   648         BubbleUtils::PrepareCallObjectImageL(
       
   649             *iHeader,
       
   650             imageSize );
       
   651         
       
   652         TAknLayoutRect cliRect;
       
   653         cliRect.LayoutRect( 
       
   654             frameRect, 
       
   655             BubbleLayout2::popup_call2_bubble_pane_graphics_cli() );
       
   656                     
       
   657         // Combine image to bubble image
       
   658         BubbleUtils::PrepareCallObjectToBubbleImageL(
       
   659             iHeader->CallObjectImage(),
       
   660             iHeader->CallObjectImageMask(),
       
   661             cliRect.Rect(),
       
   662             coMaskFrameId, // gradient image mask
       
   663             outerRect,
       
   664             innerRect,
       
   665             iBubble );                                        
       
   666         }
       
   667     }    
       
   668 
       
   669 // ---------------------------------------------------------------------------
       
   670 // CBubbleOutlookConference::GetCall1BubbleBitmaps
       
   671 // ---------------------------------------------------------------------------
       
   672 //    
       
   673 void CBubbleOutlookConference::GetCall1BubbleBitmaps()
       
   674     {
       
   675     switch ( iPaneAmount )
       
   676         {
       
   677         case 2:
       
   678             iBubbleManager.ImageManager().SetBitmapToImage( 
       
   679                     iBubble , 
       
   680                     EQgn_graf_call_conf_two , 
       
   681                     EQgn_graf_call_conf_two_mask );
       
   682             break;
       
   683         case 3:
       
   684             iBubbleManager.ImageManager().SetBitmapToImage( 
       
   685                     iBubble , 
       
   686                     EQgn_graf_call_conf_three , 
       
   687                     EQgn_graf_call_conf_three_mask );
       
   688             break;
       
   689         case 4:
       
   690             iBubbleManager.ImageManager().SetBitmapToImage( 
       
   691                     iBubble , 
       
   692                     EQgn_graf_call_conf_four , 
       
   693                     EQgn_graf_call_conf_four_mask );
       
   694             break;
       
   695         case 5:
       
   696             iBubbleManager.ImageManager().SetBitmapToImage( 
       
   697                     iBubble , 
       
   698                     EQgn_graf_call_conf_five , 
       
   699                     EQgn_graf_call_conf_five_mask );
       
   700             break;
       
   701         default:
       
   702             Panic( EBMPanicTooManyCallsInConference );
       
   703             break;
       
   704         }
       
   705     }    
       
   706 
       
   707 // ---------------------------------------------------------------------------
       
   708 // CBubbleOutlookConference::HandlePointerEventL
       
   709 // ---------------------------------------------------------------------------
       
   710 //    
       
   711 void CBubbleOutlookConference::HandlePointerEventL
       
   712     ( const TPointerEvent& aPointerEvent )           
       
   713     {
       
   714     if ( !iHeader->Highlight() || 
       
   715          aPointerEvent.iType != TPointerEvent::EButton1Up )
       
   716         return;
       
   717     
       
   718     for ( TInt i=0; i < iPaneAmount; i++ )
       
   719         {
       
   720         if ( iConfPanes->At( i )->Rect().Contains(
       
   721                  aPointerEvent.iPosition ) )
       
   722             {
       
   723             TInt hightlight = i+1;
       
   724             if ( iHeader->Highlight() != hightlight )
       
   725                 {
       
   726                 iConfPanes->At( iHeader->Highlight() - 1 )->SetHighlight( EFalse );
       
   727                 iConfPanes->At( iHeader->Highlight() - 1 )->DrawDeferred();
       
   728                 iHeader->SetHighlight( hightlight );
       
   729                 iConfPanes->At( i )->SetHighlight( ETrue );
       
   730                 iConfPanes->At( i )->DrawDeferred();    
       
   731                 }
       
   732             }
       
   733         }
       
   734     }        
       
   735 
       
   736 // End of File