phoneuis/BubbleManager/Src/BMBubbleOutlookNE.cpp
changeset 0 5f000ab63145
child 9 8871b09be73b
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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 Number Entry
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include    "BMBubbleManager.h" 
       
    21 #include    "BMBubbleOutlookNE.h"
       
    22 #include    "BMBubbleImageManager.h"
       
    23 #include    "BMBubbleHeader.h"
       
    24 #include    "BMUtils.h"
       
    25 #include    "BMResourceManager.h"
       
    26 #include    "BMLayout.h"
       
    27 #include    "BMLayout2.h"
       
    28 
       
    29 #include    <eiklabel.h>
       
    30 #include    <eikimage.h>
       
    31 #include    <eikenv.h>
       
    32 #include    <AknPhoneNumberEditor.h>
       
    33 #include    <AknsBasicBackgroundControlContext.h>
       
    34 #include    <AknsFrameBackgroundControlContext.h>
       
    35 #include    <AknsDrawUtils.h>
       
    36 #include    <AknLayoutFont.h>
       
    37 #include    <applayout.cdl.h>
       
    38 #include    <aknappui.h>
       
    39 #include    <eikspane.h>
       
    40 #include    <AknStatuspaneUtils.h>
       
    41 
       
    42 //for resources
       
    43 #include    <barsread.h>
       
    44 #include    <Bubblemanager.rsg>
       
    45 
       
    46 // CONSTANTS
       
    47 const TUint8 KBubbleNE1LongLineFormat = 0;
       
    48 const TUint8 KBubbleNE2LongLineFormat = 1;
       
    49 const TUint8 KBubbleNE1ShortLineFormat = 2;
       
    50 const TUint8 KBubbleNE2ShortLineFormat = 3;
       
    51 const TUint8 KBubbleNEIdleStateFormat = 4;
       
    52 
       
    53 const TInt KBubbleNEFormatOffsetIfNoStatusPane = 5;
       
    54 
       
    55 
       
    56 
       
    57 // ========================= MEMBER FUNCTIONS ================================
       
    58 
       
    59 
       
    60 // ---------------------------------------------------------------------------
       
    61 // CBubbleOutlookNumberEntry::CBubbleOutlookNumberEntry
       
    62 //
       
    63 //  
       
    64 // ---------------------------------------------------------------------------
       
    65 //
       
    66 CBubbleOutlookNumberEntry::CBubbleOutlookNumberEntry( 
       
    67                                     CBubbleManager& aBubbleManager,
       
    68                                     const CCoeControl& aMutedImage )
       
    69 : CBubbleOutlook( aBubbleManager ) , iMutedImage( aMutedImage )
       
    70 
       
    71     {
       
    72 
       
    73     }
       
    74 
       
    75 // ---------------------------------------------------------------------------
       
    76 // CBubbleOutlookNumberEntry::ConstructL
       
    77 // 
       
    78 // ---------------------------------------------------------------------------
       
    79 //
       
    80 
       
    81 void CBubbleOutlookNumberEntry::ConstructL()
       
    82     {
       
    83     iPlace = ENENone;
       
    84     iIsUsed = EFalse;
       
    85     iEditor = NULL;
       
    86 
       
    87     // Create skin background control context,
       
    88     // the actual image ID and rectangle will be set later
       
    89     if ( iCallObjectDisplay )
       
    90         {
       
    91         iFrameContext = CAknsFrameBackgroundControlContext::NewL(
       
    92             KAknsIIDNone, TRect(0,0,4,4), TRect(1,1,3,3), EFalse );
       
    93         }
       
    94     else
       
    95         {
       
    96         iSkinContext = CAknsBasicBackgroundControlContext::NewL(
       
    97             KAknsIIDNone, TRect(0,0,1,1), EFalse );
       
    98         }    
       
    99     
       
   100     // Create editor from resources:
       
   101     iEditor = new( ELeave ) CAknPhoneNumberEditor;
       
   102     iEditor->SetContainerWindowL( *this );
       
   103     iEditor->SetParent( this );
       
   104 
       
   105     TResourceReader reader;
       
   106     iCoeEnv->CreateResourceReaderLC( reader, R_BUBBLEMANAGER_EDITOR );
       
   107     ConstructEditorFromResourceAndLayoutL( reader );
       
   108 
       
   109     CleanupStack::PopAndDestroy();    // reader
       
   110 
       
   111     iEditor->SetObserver( this );
       
   112     iEditor->SetFormat( KBubbleNEIdleStateFormat );
       
   113     
       
   114     iStatusPane = static_cast<CAknAppUi*>(iEikonEnv->
       
   115         EikAppUi() )->StatusPane();
       
   116 
       
   117     CBubbleOutlook::ConstructL( );
       
   118 
       
   119     SetBlank();
       
   120     ActivateL();
       
   121     }
       
   122 
       
   123 // ---------------------------------------------------------------------------
       
   124 // CBubbleOutlookNumberEntry::~CBubbleOutlookNumberEntry
       
   125 //
       
   126 //  
       
   127 // ---------------------------------------------------------------------------
       
   128 //
       
   129 CBubbleOutlookNumberEntry::~CBubbleOutlookNumberEntry()
       
   130     {
       
   131     if ( iBubble )
       
   132         {
       
   133         iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
       
   134         }
       
   135     delete iEditor;
       
   136     delete iSkinContext;
       
   137     delete iFrameContext;
       
   138     }
       
   139 
       
   140 
       
   141 // ---------------------------------------------------------------------------
       
   142 // CBubbleOutlookNumberEntry::Reset
       
   143 //
       
   144 //  
       
   145 // ---------------------------------------------------------------------------
       
   146 //
       
   147 void CBubbleOutlookNumberEntry::Reset( )
       
   148     {
       
   149     if ( iBubble )
       
   150         {
       
   151         iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
       
   152         }
       
   153     iPlace = ENENone;
       
   154     iIsUsed = EFalse;
       
   155     iEditor->SetFocus( EFalse );
       
   156     SetText( KNullDesC );
       
   157     }
       
   158 
       
   159 
       
   160 // ---------------------------------------------------------------------------
       
   161 // CBubbleOutlookNumberEntry::ReadBubbleHeader
       
   162 //
       
   163 //  
       
   164 // ---------------------------------------------------------------------------
       
   165 //
       
   166 void CBubbleOutlookNumberEntry::ReadBubbleHeader( CBubbleHeader& /*aHeader*/ )
       
   167     {
       
   168     // ignore
       
   169     }
       
   170 
       
   171 // ---------------------------------------------------------------------------
       
   172 // CBubbleOutlookNumberEntry::SetPlace
       
   173 //
       
   174 //  
       
   175 // ---------------------------------------------------------------------------
       
   176 //
       
   177 void CBubbleOutlookNumberEntry::SetPlace( const TPhoneNumberEntryPlace& aPlace )
       
   178     {
       
   179     if ( iPlace == aPlace )
       
   180         {
       
   181         return;
       
   182         }
       
   183 
       
   184     iPlace = aPlace;
       
   185 
       
   186     if ( iCallObjectDisplay )
       
   187         {
       
   188         SetPlace2( iPlace );
       
   189         }
       
   190     else
       
   191         {
       
   192         SetPlace1( iPlace );
       
   193         }        
       
   194 
       
   195     SizeChanged();
       
   196     }
       
   197 
       
   198 // ---------------------------------------------------------------------------
       
   199 // CBubbleOutlookNumberEntry::SetPlace1
       
   200 //
       
   201 //  
       
   202 // ---------------------------------------------------------------------------
       
   203 //    
       
   204 void CBubbleOutlookNumberEntry::SetPlace1( 
       
   205     const TPhoneNumberEntryPlace& aPlace )
       
   206     {
       
   207     switch ( aPlace )
       
   208         {
       
   209         case ENEBottom:
       
   210             {
       
   211             if ( iBubble )
       
   212                 {
       
   213                 iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
       
   214                 }
       
   215         
       
   216             iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );
       
   217                     
       
   218             iBubbleManager.ImageManager().SetBitmapToImage( 
       
   219                 iBubble , 
       
   220                 EQgn_graf_call_rec_big , 
       
   221                 EQgn_graf_call_rec_big_mask );
       
   222          
       
   223             iSkinContext->SetBitmap( KAknsIIDQgnGrafCallRecBig );
       
   224             break;
       
   225             }
       
   226         case ENEBottomRight:
       
   227             {
       
   228             if ( iBubble )
       
   229                 {
       
   230                 iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
       
   231                 }
       
   232             
       
   233             iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );
       
   234             
       
   235             iBubbleManager.ImageManager().SetBitmapToImage( 
       
   236                 iBubble , 
       
   237                 EQgn_graf_call_rec_big_right , 
       
   238                 EQgn_graf_call_rec_big_right_mask );
       
   239          
       
   240             iSkinContext->SetBitmap( KAknsIIDQgnGrafCallRecBigRight );
       
   241             break;
       
   242             }
       
   243         case ENEIdleState:
       
   244             {
       
   245             if ( iBubble )
       
   246                 {
       
   247                 iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
       
   248                 }
       
   249          
       
   250             iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );
       
   251          
       
   252             iBubbleManager.ImageManager().SetBitmapToImage( 
       
   253                 iBubble , 
       
   254                 EQgn_graf_call_rec_bigger , 
       
   255                 EQgn_graf_call_rec_bigger_mask );
       
   256          
       
   257             iSkinContext->SetBitmap( KAknsIIDQgnGrafCallRecBigger );
       
   258             break;            
       
   259             }
       
   260         case ENENone:
       
   261         default:
       
   262             break;
       
   263         }
       
   264     
       
   265     iSkinContext->SetParentContext( 
       
   266         AknsDrawUtils::ControlContextOfParent(this) );
       
   267     }    
       
   268 
       
   269 // ---------------------------------------------------------------------------
       
   270 // CBubbleOutlookNumberEntry::SetPlace2
       
   271 //  
       
   272 // ---------------------------------------------------------------------------
       
   273 //    
       
   274 void CBubbleOutlookNumberEntry::SetPlace2( 
       
   275     const TPhoneNumberEntryPlace& aPlace )
       
   276     {
       
   277     switch ( aPlace )
       
   278         {
       
   279         case ENEBottom:
       
   280             iFrameContext->SetFrame( KAknsIIDQsnFrCall2Rect );
       
   281             break;
       
   282         case ENEBottomRight:
       
   283             iFrameContext->SetFrame( KAknsIIDQsnFrCall2Rect );
       
   284             break;
       
   285         case ENEIdleState:
       
   286             iFrameContext->SetFrame( KAknsIIDQsnFrCall2Rect );
       
   287             break;            
       
   288         case ENENone:
       
   289         default:
       
   290             break;
       
   291         }    
       
   292 
       
   293     iFrameContext->SetParentContext( 
       
   294         AknsDrawUtils::ControlContextOfParent(this) );        
       
   295     }
       
   296 
       
   297 // ---------------------------------------------------------------------------
       
   298 // CBubbleOutlookNumberEntry::Place
       
   299 //
       
   300 //  
       
   301 // ---------------------------------------------------------------------------
       
   302 //
       
   303 CBubbleOutlookNumberEntry::TPhoneNumberEntryPlace 
       
   304                                     CBubbleOutlookNumberEntry::Place() const
       
   305     {
       
   306     return iPlace;
       
   307     }
       
   308 
       
   309 
       
   310 // ---------------------------------------------------------------------------
       
   311 // CBubbleOutlookNumberEntry::SizeChanged
       
   312 // called by framwork when the view size is changed
       
   313 //  
       
   314 // ---------------------------------------------------------------------------
       
   315 //
       
   316 void CBubbleOutlookNumberEntry::SizeChanged()
       
   317     {
       
   318     AknsUtils::RegisterControlPosition( this );
       
   319     
       
   320     if ( iCallObjectDisplay )
       
   321         {
       
   322         SizeChanged2();
       
   323         }
       
   324     else
       
   325         {
       
   326         SizeChanged1();    
       
   327         }        
       
   328     
       
   329     UpdateEditorFormats( iPlace );
       
   330 
       
   331     // DOES NOT LEAVE! Own implementation. L comes from observer
       
   332     // interface
       
   333     UpdateAndDrawEditor();
       
   334     }
       
   335     
       
   336 // ---------------------------------------------------------------------------
       
   337 // CBubbleOutlookNumberEntry::SizeChanged1
       
   338 //
       
   339 //  
       
   340 // ---------------------------------------------------------------------------
       
   341 //
       
   342 void CBubbleOutlookNumberEntry::SizeChanged1()
       
   343     {
       
   344     switch ( iPlace )
       
   345         {
       
   346         case ENEBottom:
       
   347             BubbleUtils::LayoutBackgroundImage( 
       
   348                 iBubble, 
       
   349                 Rect(), 
       
   350                 BubbleLayout::popup_number_entry_window_graphics_1( 0 ) );
       
   351             
       
   352             iSkinContext->SetRect( iBubble->Rect() );
       
   353             break;
       
   354             
       
   355         case ENEBottomRight:
       
   356             BubbleUtils::LayoutBackgroundImage( 
       
   357                 iBubble , 
       
   358                 Rect(), 
       
   359                 BubbleLayout::popup_number_entry_window_graphics_1( 0 ) );
       
   360 
       
   361             iSkinContext->SetRect( iBubble->Rect() );
       
   362             break;
       
   363             
       
   364         case ENEIdleState:
       
   365             BubbleUtils::LayoutBackgroundImage( 
       
   366                 iBubble, 
       
   367                 Rect(), 
       
   368                 BubbleLayout::popup_number_entry_window_graphics_1( 3 ) );
       
   369 
       
   370             iSkinContext->SetRect( iBubble->Rect() );
       
   371             break;            
       
   372 
       
   373         case ENENone:
       
   374         default:
       
   375             break;
       
   376 
       
   377         }
       
   378     }
       
   379     
       
   380 // ---------------------------------------------------------------------------
       
   381 // CBubbleOutlookNumberEntry::SizeChanged2
       
   382 //
       
   383 //  
       
   384 // ---------------------------------------------------------------------------
       
   385 //
       
   386 void CBubbleOutlookNumberEntry::SizeChanged2()
       
   387     {
       
   388     TAknLayoutRect frameRect;
       
   389     TBool prepareFrame( EFalse );
       
   390     
       
   391     switch ( iPlace )
       
   392         {
       
   393         case ENEBottom:
       
   394         case ENEBottomRight:
       
   395            frameRect.LayoutRect( 
       
   396                Rect(), 
       
   397                BubbleLayout::popup_number_entry_window_graphics_1( 0 ) );
       
   398            prepareFrame = ETrue;     
       
   399            break;
       
   400 
       
   401         case ENEIdleState:
       
   402             frameRect.LayoutRect( 
       
   403                 Rect(), 
       
   404                 BubbleLayout::popup_number_entry_window_graphics_1( 3 ) );
       
   405             prepareFrame = ETrue;                
       
   406             break;            
       
   407         case ENENone:
       
   408         default:
       
   409             break;
       
   410         }
       
   411         
       
   412     if ( prepareFrame )        
       
   413         {
       
   414         BubbleLayout2::RectFrameInnerOuterRects(
       
   415            frameRect.Rect(),
       
   416            iOuterRect,
       
   417            iInnerRect );
       
   418 
       
   419         iFrameContext->SetFrameRects( iOuterRect, iInnerRect );
       
   420                 
       
   421         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   422         AknsDrawUtils::PrepareFrame( skin,
       
   423                                      iOuterRect,
       
   424                                      iInnerRect,
       
   425                                      KAknsIIDQsnFrCall2Rect,
       
   426                                      KAknsIIDDefault );            
       
   427         }        
       
   428     }    
       
   429 
       
   430 // ---------------------------------------------------------------------------
       
   431 // CBubbleOutlookNumberEntry::CountComponentControls
       
   432 //
       
   433 //  
       
   434 // ---------------------------------------------------------------------------
       
   435 //
       
   436 TInt CBubbleOutlookNumberEntry::CountComponentControls() const
       
   437     {
       
   438     return 1;
       
   439     }
       
   440 
       
   441 // ---------------------------------------------------------------------------
       
   442 // CBubbleOutlookNumberEntry::ComponentControl
       
   443 //
       
   444 //  
       
   445 // ---------------------------------------------------------------------------
       
   446 //
       
   447 CCoeControl* CBubbleOutlookNumberEntry::ComponentControl(TInt aIndex) const
       
   448     {
       
   449     if ( aIndex == 0 )
       
   450         {
       
   451         return iEditor;
       
   452         }
       
   453     return NULL;
       
   454     
       
   455     }
       
   456 
       
   457 
       
   458 // ---------------------------------------------------------------------------
       
   459 // CBubbleOutlookNumberEntry::DrawTimerCostNow
       
   460 //
       
   461 //  Pure virtual in base class.
       
   462 // ---------------------------------------------------------------------------
       
   463 //
       
   464 void CBubbleOutlookNumberEntry::DrawTimerCostNow()
       
   465     {
       
   466     }
       
   467 
       
   468 // ---------------------------------------------------------------------------
       
   469 // CBubbleOutlookNumberEntry::DrawCLINow
       
   470 //
       
   471 //  Pure virtual in base class.
       
   472 // ---------------------------------------------------------------------------
       
   473 //
       
   474 void CBubbleOutlookNumberEntry::DrawCLINow()
       
   475     {
       
   476     }
       
   477 
       
   478 
       
   479 // ---------------------------------------------------------------------------
       
   480 // CBubbleOutlookNumberEntry::HandleControlEventL
       
   481 //  
       
   482 //  This must be non leaving function, because others use it too.
       
   483 // ---------------------------------------------------------------------------
       
   484 //
       
   485 void CBubbleOutlookNumberEntry::HandleControlEventL( CCoeControl* aControl, 
       
   486                                                      TCoeEvent aEventType)
       
   487     {
       
   488     if ( aControl != iEditor  
       
   489         && aEventType != EEventStateChanged 
       
   490         || iPlace == ENENone)
       
   491         return;
       
   492 
       
   493     UpdateAndDrawEditor();
       
   494     
       
   495 	ReportEventL( EEventStateChanged );
       
   496     
       
   497     }
       
   498 
       
   499 // ---------------------------------------------------------------------------
       
   500 // CBubbleOutlookNumberEntry::OfferKeyEventL
       
   501 //
       
   502 //  
       
   503 // ---------------------------------------------------------------------------
       
   504 //
       
   505 TKeyResponse CBubbleOutlookNumberEntry::OfferKeyEventL( 
       
   506                                             const TKeyEvent& aKeyEvent, 
       
   507                                             TEventCode aType )
       
   508     {
       
   509     return iEditor->OfferKeyEventL( aKeyEvent, aType );
       
   510     }
       
   511 
       
   512 // ---------------------------------------------------------------------------
       
   513 // CBubbleOutlookNumberEntry::SetIsUsed
       
   514 //
       
   515 //  
       
   516 // ---------------------------------------------------------------------------
       
   517 //
       
   518 void CBubbleOutlookNumberEntry::SetIsUsed( const TBool& aIsUsed )
       
   519     {
       
   520 #ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
       
   521     // Don't set in focus if transition effects are turned on
       
   522     // We don't want blinking cursor during transitions
       
   523     if ( !aIsUsed )
       
   524         {
       
   525         iEditor->SetFocus( aIsUsed );
       
   526         }
       
   527 #else
       
   528     iEditor->SetFocus( aIsUsed );
       
   529 #endif    
       
   530     iIsUsed = aIsUsed;    
       
   531     }
       
   532 
       
   533 // ---------------------------------------------------------------------------
       
   534 // CBubbleOutlookNumberEntry::IsUsed
       
   535 //
       
   536 //  
       
   537 // ---------------------------------------------------------------------------
       
   538 //
       
   539 TBool CBubbleOutlookNumberEntry::IsUsed() const
       
   540     {
       
   541     return iIsUsed;
       
   542     }
       
   543 
       
   544 // ---------------------------------------------------------------------------
       
   545 // CBubbleOutlookNumberEntry::GetEditor
       
   546 //
       
   547 //  
       
   548 // ---------------------------------------------------------------------------
       
   549 //
       
   550 CCoeControl* CBubbleOutlookNumberEntry::GetEditor( ) const
       
   551     {
       
   552     return iEditor; 
       
   553     }
       
   554 
       
   555 // ---------------------------------------------------------------------------
       
   556 // CBubbleOutlookNumberEntry::SetText
       
   557 //
       
   558 //  
       
   559 // ---------------------------------------------------------------------------
       
   560 //
       
   561 void CBubbleOutlookNumberEntry::SetText( const TDesC& aDesC )
       
   562     {
       
   563     iEditor->DrawDeferred();
       
   564     iEditor->SetText( aDesC );   
       
   565     iEditor->DrawDeferred();
       
   566     }
       
   567 
       
   568 // ---------------------------------------------------------------------------
       
   569 // CBubbleOutlookNumberEntry::GetText
       
   570 //
       
   571 //  
       
   572 // ---------------------------------------------------------------------------
       
   573 //
       
   574 void CBubbleOutlookNumberEntry::GetText( TDes& aDesC )
       
   575     {
       
   576     iEditor->GetText( aDesC );
       
   577     }
       
   578 
       
   579 // ---------------------------------------------------------------------------
       
   580 // CBubbleOutlookNumberEntry::FocusChanged
       
   581 //
       
   582 //  
       
   583 // ---------------------------------------------------------------------------
       
   584 //
       
   585 void CBubbleOutlookNumberEntry::FocusChanged( TDrawNow aDrawNow )
       
   586     {
       
   587     // Don't allow drawing
       
   588     iEditor->SetFocus( IsFocused(), ENoDrawNow );
       
   589     if ( aDrawNow == EDrawNow && iMutedImage.IsVisible() )
       
   590         {
       
   591         // muted image goes on top 
       
   592         // so it must be redrawn too
       
   593         DrawLabelNow( iMutedImage );
       
   594         }
       
   595     }
       
   596 
       
   597 // ---------------------------------------------------------------------------
       
   598 // CBubbleOutlookNumberEntry::DrawBitmaps
       
   599 //
       
   600 //  
       
   601 // ---------------------------------------------------------------------------
       
   602 //
       
   603 #ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
       
   604 void CBubbleOutlookNumberEntry::DrawBitmaps( CBitmapContext& ) const
       
   605 #else
       
   606 void CBubbleOutlookNumberEntry::DrawBitmaps( CBitmapContext& aGc ) const
       
   607 #endif
       
   608     {
       
   609     if ( iPlace == ENENone || !iIsUsed ) 
       
   610         {
       
   611         return;
       
   612         }
       
   613 
       
   614 #ifdef RD_UI_TRANSITION_EFFECTS_PHASE2
       
   615     // Must use SystemGc instead of aGc when transition effects are turned on
       
   616     CWindowGc& aGc = SystemGc();
       
   617 #endif
       
   618 
       
   619     if ( iCallObjectDisplay )
       
   620         {
       
   621         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   622         if ( !AknsDrawUtils::DrawFrame( skin,
       
   623                                         (CWindowGc&) aGc,  
       
   624                                         iOuterRect,
       
   625                                         iInnerRect,
       
   626                                         KAknsIIDQsnFrCall2Rect,
       
   627                                         KAknsIIDDefault ) )
       
   628             {
       
   629             BubbleUtils::DrawBackgroundRect( aGc, Rect() );
       
   630             }       
       
   631         }
       
   632     else if ( !BubbleUtils::DrawMaskedImage( aGc , iBubble ) )
       
   633         {
       
   634         BubbleUtils::DrawBackgroundRect( aGc, Rect() );
       
   635         }
       
   636     }
       
   637 
       
   638 // ---------------------------------------------------------------------------
       
   639 // CBubbleOutlookNumberEntry::HandleAnimationStartL
       
   640 //
       
   641 //  Pure virtual in base class.
       
   642 // ---------------------------------------------------------------------------
       
   643 //
       
   644 void CBubbleOutlookNumberEntry::HandleAnimationStartL() const
       
   645     {
       
   646     }
       
   647 
       
   648 // ---------------------------------------------------------------------------
       
   649 // CBubbleOutlookNumberEntry::ReleaseBitmaps
       
   650 // ---------------------------------------------------------------------------
       
   651 //
       
   652 void CBubbleOutlookNumberEntry::ReleaseBitmaps()
       
   653     {
       
   654     if ( iBubble )
       
   655         {
       
   656         iBubbleManager.ResourceManager().ReleaseEikImage( iBubble );
       
   657         }
       
   658     }
       
   659 
       
   660 // ---------------------------------------------------------------------------
       
   661 // CBubbleOutlookNumberEntry::RebuildBitmaps
       
   662 // ---------------------------------------------------------------------------
       
   663 //
       
   664 void CBubbleOutlookNumberEntry::RebuildBitmaps()
       
   665     {
       
   666     if ( iCallObjectDisplay )
       
   667         {
       
   668         return;            
       
   669         }
       
   670     
       
   671     switch ( iPlace )
       
   672         {
       
   673         case ENEBottom:
       
   674             iBubble = iBubbleManager.ResourceManager().ReserveEikImage(ETrue);
       
   675             iBubbleManager.ImageManager().SetBitmapToImage( 
       
   676                 iBubble , 
       
   677                 EQgn_graf_call_rec_big , 
       
   678                 EQgn_graf_call_rec_big_mask );
       
   679             break;
       
   680         case ENEBottomRight:
       
   681             iBubble = iBubbleManager.ResourceManager().ReserveEikImage(ETrue);
       
   682             iBubbleManager.ImageManager().SetBitmapToImage( 
       
   683                 iBubble , 
       
   684                 EQgn_graf_call_rec_big_right , 
       
   685                 EQgn_graf_call_rec_big_right_mask );
       
   686             break;
       
   687         case ENEIdleState:
       
   688             iBubble = iBubbleManager.ResourceManager().ReserveEikImage(ETrue);
       
   689             iBubbleManager.ImageManager().SetBitmapToImage( 
       
   690                 iBubble , 
       
   691                 EQgn_graf_call_rec_bigger , 
       
   692                 EQgn_graf_call_rec_bigger_mask );
       
   693             break;
       
   694         case ENENone:
       
   695         default:
       
   696             break;
       
   697         }
       
   698     }
       
   699 
       
   700 // ---------------------------------------------------------------------------
       
   701 // CBubbleOutlookNumberEntry::MopSupplyObject
       
   702 // ---------------------------------------------------------------------------
       
   703 //
       
   704 TTypeUid::Ptr CBubbleOutlookNumberEntry::MopSupplyObject( TTypeUid aId )
       
   705     {
       
   706     if( !iCallObjectDisplay && 
       
   707         aId.iUid == MAknsControlContext::ETypeId && 
       
   708         iSkinContext )
       
   709         {
       
   710         return MAknsControlContext::SupplyMopObject( aId, iSkinContext );
       
   711         }
       
   712     else if ( iCallObjectDisplay && 
       
   713               aId.iUid == MAknsControlContext::ETypeId && 
       
   714               iFrameContext )
       
   715         {
       
   716         return MAknsControlContext::SupplyMopObject( aId, iFrameContext );    
       
   717         }
       
   718     else
       
   719         {
       
   720         return CBubbleOutlook::MopSupplyObject( aId );
       
   721         }
       
   722     }
       
   723 
       
   724 
       
   725 // ---------------------------------------------------------------------------
       
   726 // CBubbleOutlookNumberEntry::DrawCallHeaderText
       
   727 //
       
   728 //  Pure virtual in base class.
       
   729 // ---------------------------------------------------------------------------
       
   730 //
       
   731 void CBubbleOutlookNumberEntry::DrawCallHeaderText()
       
   732     {
       
   733     }
       
   734 
       
   735 // ---------------------------------------------------------------------------
       
   736 // CBubbleOutlookNumberEntry::Draw
       
   737 // ---------------------------------------------------------------------------
       
   738 //
       
   739 void CBubbleOutlookNumberEntry::Draw( const TRect& /*aRect*/ ) const
       
   740     {
       
   741     if ( iPlace == ENENone || !iIsUsed ) 
       
   742         {
       
   743         return;
       
   744         }
       
   745 
       
   746     CWindowGc& gc = SystemGc( );
       
   747     gc.SetBrushColor( AKN_LAF_COLOR( BubbleLayout::LayoutColourWhite() ) );
       
   748     TRect rect = iEditor->Rect();
       
   749 
       
   750     // Draw the skin background of the parent 
       
   751     // (the bubble may be transparent)
       
   752     AknsDrawUtils::DrawBackground( AknsUtils::SkinInstance(), 
       
   753         AknsDrawUtils::ControlContextOfParent(this), this, gc, 
       
   754         rect.iTl, rect, KAknsDrawParamDefault );
       
   755     // Don't set clipping rect if transition effects are turned on
       
   756 #ifndef RD_UI_TRANSITION_EFFECTS_PHASE2
       
   757     gc.SetClippingRect( rect );
       
   758 #endif
       
   759     if ( iCallObjectDisplay )
       
   760         {
       
   761         // Draw bubble frame
       
   762         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   763         if ( !AknsDrawUtils::DrawFrame( skin,
       
   764                                         (CWindowGc&) gc,  
       
   765                                         iOuterRect,
       
   766                                         iInnerRect,
       
   767                                         KAknsIIDQsnFrCall2Rect,
       
   768                                         KAknsIIDDefault ) )
       
   769             {
       
   770             BubbleUtils::DrawBackgroundRect( gc, Rect() );
       
   771             }                
       
   772         }
       
   773     else
       
   774         {
       
   775         if ( !BubbleUtils::DrawMaskedImage( gc , iBubble ) )
       
   776             {
       
   777             BubbleUtils::DrawBackgroundRect( gc, Rect() );
       
   778             }            
       
   779         }        
       
   780     gc.CancelClippingRect();
       
   781     }
       
   782 
       
   783 // ---------------------------------------------------------------------------
       
   784 // CBubbleOutlookNumberEntry::ConstructEditorFromResourceAndLayoutL
       
   785 //
       
   786 //  
       
   787 // ---------------------------------------------------------------------------
       
   788 //
       
   789 void CBubbleOutlookNumberEntry::ConstructEditorFromResourceAndLayoutL( 
       
   790     TResourceReader& aReader )
       
   791     {
       
   792     TInt maxChars = aReader.ReadInt16();
       
   793     TInt maxLines = aReader.ReadInt16();
       
   794     HBufC* truncation = aReader.ReadHBufCL();
       
   795     CleanupStack::PushL( truncation );
       
   796     TInt formatCount = aReader.ReadInt16();
       
   797     iEditor->ConstructL( maxChars, maxLines, formatCount, *truncation );
       
   798     CleanupStack::PopAndDestroy();  // truncation
       
   799 
       
   800     iFormatCount = formatCount;
       
   801 
       
   802     // get supporting layouts
       
   803     TRgb color;
       
   804     TRect numberEntryRect = NumberEntryRect( 0 , color );
       
   805 
       
   806     // get the relevant layouts
       
   807     TAknLayoutText texts1LongText;
       
   808     TAknLayoutText texts1ShortText;
       
   809     TAknLayoutText texts2LongLine1Text;
       
   810     TAknLayoutText texts2ShortLine1Text;
       
   811     TAknLayoutText texts2LongLine2Text;
       
   812     TAknLayoutText texts2ShortLine2Text;
       
   813     TAknLayoutText textsIdleLine1Text;
       
   814     TAknLayoutText textsIdleLine2Text;
       
   815 
       
   816     texts1LongText.LayoutText( numberEntryRect, 
       
   817         BubbleLayout::popup_number_entry_window_texts_1( 0 ) );
       
   818     texts1ShortText.LayoutText( numberEntryRect, 
       
   819         BubbleLayout::popup_number_entry_window_texts_1( 1 ) );
       
   820     texts2LongLine1Text.LayoutText( numberEntryRect, 
       
   821         BubbleLayout::popup_number_entry_window_texts_2( 0, 0 ) );
       
   822     texts2ShortLine1Text.LayoutText( numberEntryRect, 
       
   823         BubbleLayout::popup_number_entry_window_texts_2( 1, 0 ) );
       
   824     texts2LongLine2Text.LayoutText( numberEntryRect, 
       
   825         BubbleLayout::popup_number_entry_window_texts_2( 0, 1 ) );
       
   826     texts2ShortLine2Text.LayoutText( numberEntryRect, 
       
   827         BubbleLayout::popup_number_entry_window_texts_2( 1, 1 ) );
       
   828     textsIdleLine1Text.LayoutText( numberEntryRect, 
       
   829         BubbleLayout::popup_number_entry_window_texts_3( 1 ) );
       
   830     textsIdleLine2Text.LayoutText( numberEntryRect, 
       
   831         BubbleLayout::popup_number_entry_window_texts_3( 0 ) );        
       
   832         
       
   833 
       
   834     // although only specified for two line case, we need to have 
       
   835     // some kind of value for the one line case but as there is 
       
   836     // only one line, it isn't used.
       
   837     TInt baselineSeparation = texts2LongLine2Text.TextRect().iBr.iY 
       
   838         - texts2LongLine1Text.TextRect().iBr.iY;
       
   839 
       
   840     for (TInt ii = 0; ii < formatCount; ii++)
       
   841         {
       
   842         CAknPhoneNumberEditor::TFormat format( aReader );
       
   843 
       
   844         // override the format values using the layout data
       
   845         TInt next = ii;
       
   846         TBool noStatusPane = EFalse;
       
   847         if( ii > KBubbleNEIdleStateFormat )
       
   848             {
       
   849             next -= KBubbleNEFormatOffsetIfNoStatusPane;
       
   850             noStatusPane = ETrue;
       
   851             }
       
   852         
       
   853         const CAknLayoutFont* layoutFont;
       
   854 
       
   855         switch( next )
       
   856             {
       
   857             case KBubbleNE1LongLineFormat:
       
   858                 format.iFont = texts1LongText.Font();
       
   859                 layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
       
   860                 format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
       
   861                 format.iOuterRect = texts1LongText.TextRect(); 
       
   862                 break;
       
   863             case KBubbleNE2LongLineFormat:
       
   864                 format.iFont = texts2LongLine1Text.Font();
       
   865                 layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
       
   866                 format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
       
   867 
       
   868                 format.iOuterRect = texts2LongLine2Text.TextRect();
       
   869                 format.iOuterRect.iTl.iY -= format.iBottomBaselineOffset; // have to add extra gap
       
   870                 format.iOuterRect.iTl.iY -= baselineSeparation; // have to add extra lines.
       
   871                 break;
       
   872             case KBubbleNE1ShortLineFormat:
       
   873                 format.iFont = texts1ShortText.Font();
       
   874                 layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
       
   875                 format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
       
   876                 format.iOuterRect = texts1ShortText.TextRect();
       
   877                 break;
       
   878             case KBubbleNE2ShortLineFormat:
       
   879                 format.iFont = texts2ShortLine1Text.Font();
       
   880                 layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
       
   881                 format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
       
   882                 format.iOuterRect = texts2ShortLine2Text.TextRect();
       
   883                 format.iOuterRect.iTl.iY -= format.iBottomBaselineOffset; // have to add extra gap
       
   884                 format.iOuterRect.iTl.iY -= baselineSeparation; // have to add extra lines.
       
   885                 break;
       
   886             case KBubbleNEIdleStateFormat:
       
   887                 format.iFont = textsIdleLine1Text.Font();
       
   888                 layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
       
   889                 format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
       
   890 
       
   891                 format.iOuterRect = textsIdleLine2Text.TextRect();
       
   892                 format.iOuterRect.iTl.iY -= format.iBottomBaselineOffset; // have to add extra gap
       
   893                 
       
   894                 baselineSeparation = textsIdleLine2Text.TextRect().iBr.iY 
       
   895                     - textsIdleLine1Text.TextRect().iBr.iY;
       
   896                 
       
   897                 format.iOuterRect.iTl.iY -= baselineSeparation; // have to add extra lines.
       
   898                 break;
       
   899             }
       
   900 
       
   901         if(noStatusPane)
       
   902             {
       
   903             format.iOuterRect.iTl.iY += BubbleLayout::MainPaneRect().iTl.iY;
       
   904             format.iOuterRect.iBr.iY += BubbleLayout::MainPaneRect().iTl.iY;
       
   905             }
       
   906         format.iBaselineSeparation = baselineSeparation;
       
   907         iEditor->AddFormat( format );
       
   908         }
       
   909 
       
   910     iEditor->SetFormat( KBubbleNEIdleStateFormat );
       
   911     UpdateEditorColor( color );
       
   912     }
       
   913 
       
   914 // -----------------------------------------------------------------------------
       
   915 // CBubbleOutlookNumberEntry::NumberEntryRect
       
   916 // -----------------------------------------------------------------------------
       
   917 //
       
   918 TRect CBubbleOutlookNumberEntry::NumberEntryRect( TInt aIndex, TRgb& aColor )
       
   919     {
       
   920     TRect mainRect = BubbleLayout::MainPaneRect();
       
   921     TAknLayoutRect numberEntryLayoutRect;
       
   922     numberEntryLayoutRect.LayoutRect( mainRect, 
       
   923         BubbleLayout::popup_number_entry_window( aIndex ) );
       
   924 
       
   925     aColor = numberEntryLayoutRect.Color();
       
   926     TRect numberEntryRect = numberEntryLayoutRect.Rect();
       
   927     // relative to mainpane
       
   928     numberEntryRect.iTl.iY -= mainRect.iTl.iY;
       
   929     numberEntryRect.iBr.iY -= mainRect.iTl.iY;
       
   930     numberEntryRect.iTl.iX -= mainRect.iTl.iX;
       
   931     numberEntryRect.iBr.iX -= mainRect.iTl.iX;
       
   932 
       
   933     return numberEntryRect ;
       
   934     }
       
   935 
       
   936 // -----------------------------------------------------------------------------
       
   937 // CBubbleOutlookNumberEntry::UpdateEditorFormats
       
   938 // -----------------------------------------------------------------------------
       
   939 //
       
   940 void CBubbleOutlookNumberEntry::UpdateEditorFormats( 
       
   941     TPhoneNumberEntryPlace aPlace )
       
   942     {
       
   943     // get supporting layouts
       
   944     TRect numberEntryRect;
       
   945     TRgb color;
       
   946     if ( aPlace == ENEBottom )
       
   947         {
       
   948         numberEntryRect = NumberEntryRect( 0, color );
       
   949         }
       
   950     else if ( aPlace == ENEBottomRight )
       
   951         {
       
   952         numberEntryRect = NumberEntryRect( 1, color );
       
   953         }
       
   954     else if ( aPlace == ENEIdleState )
       
   955         {
       
   956         numberEntryRect = NumberEntryRect( 4, color );
       
   957         }        
       
   958     else
       
   959         {
       
   960         return;
       
   961         }
       
   962 
       
   963     // get the relevant layouts
       
   964     TAknLayoutText texts1LongText;
       
   965     TAknLayoutText texts1ShortText;
       
   966     TAknLayoutText texts2LongLine1Text;
       
   967     TAknLayoutText texts2ShortLine1Text;
       
   968     TAknLayoutText texts2LongLine2Text;
       
   969     TAknLayoutText texts2ShortLine2Text;
       
   970     TAknLayoutText textsIdleLine1Text;
       
   971     TAknLayoutText textsIdleLine2Text;
       
   972 
       
   973     texts1LongText.LayoutText( numberEntryRect, 
       
   974         BubbleLayout::popup_number_entry_window_texts_1( 0 ) );
       
   975     texts1ShortText.LayoutText( numberEntryRect, 
       
   976         BubbleLayout::popup_number_entry_window_texts_1( 1 ) );
       
   977     texts2LongLine1Text.LayoutText( numberEntryRect, 
       
   978         BubbleLayout::popup_number_entry_window_texts_2(0, 0));
       
   979     texts2ShortLine1Text.LayoutText( numberEntryRect, 
       
   980         BubbleLayout::popup_number_entry_window_texts_2(1, 0));
       
   981     texts2LongLine2Text.LayoutText( numberEntryRect, 
       
   982         BubbleLayout::popup_number_entry_window_texts_2(0, 1));
       
   983     texts2ShortLine2Text.LayoutText( numberEntryRect, 
       
   984         BubbleLayout::popup_number_entry_window_texts_2(1, 1));
       
   985     textsIdleLine1Text.LayoutText( numberEntryRect, 
       
   986         BubbleLayout::popup_number_entry_window_texts_3( 1 ) );
       
   987     textsIdleLine2Text.LayoutText( numberEntryRect, 
       
   988         BubbleLayout::popup_number_entry_window_texts_3( 0 ) );               
       
   989 
       
   990     // although only specified for two line case, we need to have 
       
   991     // some kind of value for the one line case but as there is 
       
   992     // only one line, it isn't used.
       
   993     TInt baselineSeparation = texts2LongLine2Text.TextRect().iBr.iY 
       
   994                             - texts2LongLine1Text.TextRect().iBr.iY;
       
   995     TInt currentFormat = iEditor->CurrentFormatIndex();
       
   996 
       
   997     for (TInt ii = 0; ii < iFormatCount; ii++)
       
   998         {
       
   999         CAknPhoneNumberEditor::TFormat format( iEditor->Format( ii ) );
       
  1000 
       
  1001         // override the format values using the layout data
       
  1002         TInt next = ii;
       
  1003         TBool noStatusPane = EFalse;
       
  1004         if( ii > KBubbleNEIdleStateFormat )
       
  1005             {
       
  1006             next -= KBubbleNEFormatOffsetIfNoStatusPane;
       
  1007             noStatusPane = ETrue;
       
  1008             }
       
  1009 
       
  1010         const CAknLayoutFont* layoutFont;
       
  1011         switch( next )
       
  1012             {
       
  1013             case KBubbleNE1LongLineFormat:
       
  1014                 format.iFont = texts1LongText.Font();
       
  1015                 layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
       
  1016                 format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
       
  1017                 format.iOuterRect = texts1LongText.TextRect(); 
       
  1018                 break;
       
  1019             case KBubbleNE2LongLineFormat:
       
  1020                 format.iFont = texts2LongLine1Text.Font();
       
  1021                 layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
       
  1022                 format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
       
  1023                 format.iOuterRect = texts2LongLine2Text.TextRect();
       
  1024                 format.iOuterRect.iTl.iY -= format.iBottomBaselineOffset; // have to add extra gap
       
  1025                 format.iOuterRect.iTl.iY -= baselineSeparation; // have to add extra lines.
       
  1026                 break;
       
  1027             case KBubbleNE1ShortLineFormat:
       
  1028                 format.iFont = texts1ShortText.Font();
       
  1029                 layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
       
  1030                 format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
       
  1031                 format.iOuterRect = texts1ShortText.TextRect();
       
  1032                 break;
       
  1033             case KBubbleNE2ShortLineFormat:
       
  1034                 format.iFont = texts2ShortLine1Text.Font();
       
  1035                 layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
       
  1036                 format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
       
  1037                 format.iOuterRect = texts2ShortLine2Text.TextRect();
       
  1038                 format.iOuterRect.iTl.iY -= format.iBottomBaselineOffset; // have to add extra gap
       
  1039                 format.iOuterRect.iTl.iY -= baselineSeparation; // have to add extra lines.
       
  1040                 break;
       
  1041             case KBubbleNEIdleStateFormat:
       
  1042                 format.iFont = textsIdleLine1Text.Font();
       
  1043                 layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( format.iFont);
       
  1044                 format.iBottomBaselineOffset = layoutFont->BaselineToTextPaneBottom();
       
  1045 
       
  1046                 format.iOuterRect = textsIdleLine2Text.TextRect();
       
  1047                 format.iOuterRect.iTl.iY -= format.iBottomBaselineOffset; // have to add extra gap
       
  1048                 
       
  1049                 baselineSeparation = textsIdleLine2Text.TextRect().iBr.iY 
       
  1050                     - textsIdleLine1Text.TextRect().iBr.iY;
       
  1051                 
       
  1052                 format.iOuterRect.iTl.iY -= baselineSeparation; // have to add extra lines.
       
  1053                 break;                
       
  1054             };
       
  1055 
       
  1056         if(noStatusPane)
       
  1057             {
       
  1058             format.iOuterRect.iTl.iY += BubbleLayout::MainPaneRect().iTl.iY;
       
  1059             format.iOuterRect.iBr.iY += BubbleLayout::MainPaneRect().iTl.iY;
       
  1060             }
       
  1061         format.iBaselineSeparation = baselineSeparation;
       
  1062 
       
  1063         iEditor->Format( ii ) = format;
       
  1064         }
       
  1065 
       
  1066     iEditor->SetFormat( currentFormat );
       
  1067     UpdateEditorColor( color );
       
  1068     }
       
  1069 
       
  1070 
       
  1071 // ---------------------------------------------------------------------------
       
  1072 //  CBubbleOutlookNumberEntry::ChangeEditorMode
       
  1073 //  
       
  1074 // 
       
  1075 // ---------------------------------------------------------------------------
       
  1076 //
       
  1077 TInt CBubbleOutlookNumberEntry::ChangeEditorMode( TBool aDefaultMode )
       
  1078     {
       
  1079     return iEditor->ChangeEditorMode( aDefaultMode );
       
  1080     }
       
  1081     
       
  1082 // ---------------------------------------------------------------------------
       
  1083 //  CBubbleOutlookNumberEntry::GetEditorMode
       
  1084 //  
       
  1085 // 
       
  1086 // ---------------------------------------------------------------------------
       
  1087 //
       
  1088 TInt CBubbleOutlookNumberEntry::GetEditorMode() const
       
  1089     {
       
  1090     return iEditor->GetEditorMode();
       
  1091     }
       
  1092     
       
  1093 // ---------------------------------------------------------------------------
       
  1094 //  CBubbleOutlookNumberEntry::ResetEditorToDefaultValues
       
  1095 //  
       
  1096 // 
       
  1097 // ---------------------------------------------------------------------------
       
  1098 //
       
  1099 void CBubbleOutlookNumberEntry::ResetEditorToDefaultValues()
       
  1100     {
       
  1101     iEditor->ResetEditorToDefaultValues();
       
  1102     }
       
  1103 
       
  1104 // -----------------------------------------------------------------------------
       
  1105 // CBubbleOutlookNumberEntry::UpdateEditorColor
       
  1106 // -----------------------------------------------------------------------------
       
  1107 //
       
  1108 void CBubbleOutlookNumberEntry::UpdateEditorColor( const TRgb aColor )
       
  1109     {
       
  1110     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
  1111     TRgb skinColor = aColor;
       
  1112 
       
  1113     AknsUtils::GetCachedColor( 
       
  1114         skin, 
       
  1115         skinColor, 
       
  1116         KAknsIIDQsnTextColors,
       
  1117         EAknsCIQsnTextColorsCG51 );
       
  1118 
       
  1119     // Ignore error
       
  1120     TRAP_IGNORE( iEditor->OverrideColorL( EColorControlText, skinColor ) );
       
  1121     }
       
  1122 
       
  1123 // -----------------------------------------------------------------------------
       
  1124 // CBubbleOutlookNumberEntry::UpdateAndDrawEditor
       
  1125 // -----------------------------------------------------------------------------
       
  1126 //
       
  1127 void CBubbleOutlookNumberEntry::UpdateAndDrawEditor()
       
  1128     {
       
  1129     TInt format = 0;
       
  1130       
       
  1131       if ( iPlace == ENEBottom )
       
  1132           {
       
  1133           if ( iEditor->CountFormats() < 2 )
       
  1134               {
       
  1135               return;
       
  1136               }
       
  1137           format = KBubbleNE1LongLineFormat;
       
  1138           if ( !iEditor->WouldTextFitInFormat( format ) )
       
  1139               {
       
  1140               format = KBubbleNE2LongLineFormat;
       
  1141               }
       
  1142           }
       
  1143       else if ( iPlace == ENEBottomRight )
       
  1144           {
       
  1145           if ( iEditor->CountFormats() < 4 )
       
  1146               {
       
  1147               return;
       
  1148               }
       
  1149           format = KBubbleNE1ShortLineFormat;
       
  1150           if ( !iEditor->WouldTextFitInFormat( KBubbleNE1ShortLineFormat ) )
       
  1151               {
       
  1152               format = KBubbleNE2ShortLineFormat;
       
  1153               }
       
  1154           }
       
  1155       else if ( iPlace == ENEIdleState )
       
  1156           {
       
  1157           if ( iEditor->CountFormats() < 9 )
       
  1158               {
       
  1159               return;
       
  1160               }
       
  1161           format = KBubbleNEIdleStateFormat;
       
  1162           }
       
  1163 
       
  1164       // If there is no status pane the relative coordinates editor must be
       
  1165       // moved 44 pixels downwards, because editor's coordinates are absolute - 
       
  1166       // NOT relative to parent rect.
       
  1167       if ( iStatusPane && !iStatusPane->IsVisible() &&
       
  1168            !AknStatuspaneUtils::StaconPaneActive() )
       
  1169           {
       
  1170           format += KBubbleNEFormatOffsetIfNoStatusPane;
       
  1171           }
       
  1172 
       
  1173       if (iEditor->CurrentFormatIndex() != format)
       
  1174           {
       
  1175           iEditor->SetFormat(format);
       
  1176           if ( iBubble )
       
  1177               {
       
  1178               iEditor->DrawNow();
       
  1179               if ( iMutedImage.IsVisible() )
       
  1180                   {
       
  1181                   iMutedImage.DrawNow();
       
  1182                   }
       
  1183               }
       
  1184           }
       
  1185     }
       
  1186 
       
  1187 
       
  1188 // End of File