idlehomescreen/widgetmanager/src/wmdetailsdlg.cpp
branchRCL_3
changeset 83 5456b4e8b3a8
equal deleted inserted replaced
82:5f0182e07bfb 83:5456b4e8b3a8
       
     1 /*
       
     2 * Copyright (c) 2008 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:
       
    15 * Implementation of the widget details dlg for WidgetManager
       
    16 *
       
    17 */
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <gdi.h>
       
    21 #include <eikrted.h> // for CRichTextEditor
       
    22 #include <txtrich.h> // for CRichText
       
    23 #include <AknUtils.h> // for AknUtils
       
    24 #include <AknsUtils.h> // MAknsSkinInstance
       
    25 #include <AknsDrawUtils.h> // AknsDrawUtils
       
    26 #include <applayout.cdl.h> //layout
       
    27 #include <layoutmetadata.cdl.h>
       
    28 #include <aknlayoutscalable_avkon.cdl.h>
       
    29 #include <aknlayoutscalable_apps.cdl.h>
       
    30 #include <AknsBasicBackgroundControlContext.h>
       
    31 #include <AknMarqueeControl.h>
       
    32 #include <widgetmanagerview.rsg>
       
    33 
       
    34 #include "widgetmanager.hrh"
       
    35 #include "wmdetailsdlg.h"
       
    36 #include "wmimageconverter.h"
       
    37 
       
    38 
       
    39 // CONSTANTS
       
    40 
       
    41 
       
    42 // MEMBER FUNCTIONS
       
    43 
       
    44 // ---------------------------------------------------------
       
    45 // CWmDetailsDlg::NewL
       
    46 // ---------------------------------------------------------
       
    47 //
       
    48 CWmDetailsDlg* CWmDetailsDlg::NewL(
       
    49 			const TDesC& aName,
       
    50 	        const TDesC& aDescription,
       
    51 	        TBool  aCanBeAdded,
       
    52             const TDesC& aIconStr,
       
    53             const CFbsBitmap& aDefaultIcon,
       
    54             const CFbsBitmap& aDefaultIconMask )
       
    55     {
       
    56     CWmDetailsDlg* self = new ( ELeave ) CWmDetailsDlg( aCanBeAdded );
       
    57     CleanupStack::PushL( self );
       
    58     self->ConstructL( 
       
    59             aName, 
       
    60             aDescription, 
       
    61             aIconStr, 
       
    62             aDefaultIcon, 
       
    63             aDefaultIconMask );
       
    64     CleanupStack::Pop( self );
       
    65     return self;
       
    66     }
       
    67 
       
    68 // ---------------------------------------------------------
       
    69 // CWmDetailsDlg::CWmDetailsDlg
       
    70 // ---------------------------------------------------------
       
    71 //
       
    72 CWmDetailsDlg::CWmDetailsDlg( TBool aCanBeAdded )
       
    73     : CAknDialog(),
       
    74     iCanBeAdded( aCanBeAdded ),
       
    75     iNeedToScroll( EFalse )
       
    76     {
       
    77     iBorder = TGulBorder::ERaisedControl;    
       
    78     }
       
    79 
       
    80 // ---------------------------------------------------------
       
    81 // CWmDetailsDlg::~CWmDetailsDlg
       
    82 // ---------------------------------------------------------
       
    83 //
       
    84 CWmDetailsDlg::~CWmDetailsDlg()
       
    85     {
       
    86     StopMarquee();
       
    87     iEikonEnv->RemoveFromStack( iRtEditor );
       
    88     iEikonEnv->RemoveFromStack( this );
       
    89     delete iRtEditor;
       
    90     delete iMarquee;
       
    91     delete iName;
       
    92     delete iDescription;
       
    93     delete iLogoBmp;
       
    94     delete iLogoMask;
       
    95     delete iBgContext;
       
    96     delete iImageConverter;
       
    97     }
       
    98 
       
    99 // -----------------------------------------------------------------------------
       
   100 // CWmDetailsDlg::ExecuteLD
       
   101 // -----------------------------------------------------------------------------
       
   102 //
       
   103 TInt CWmDetailsDlg::ExecuteLD()
       
   104     {
       
   105     if ( iCanBeAdded )
       
   106         {
       
   107         return CAknDialog::ExecuteLD( R_WM_DETAILS_ADD_DIALOG );
       
   108         }
       
   109     else
       
   110         {
       
   111         return CAknDialog::ExecuteLD( R_WM_DETAILS_ONLY_DIALOG );
       
   112         }
       
   113     }
       
   114 
       
   115 // ---------------------------------------------------------
       
   116 // CWmDetailsDlg::ConstructL
       
   117 // ---------------------------------------------------------
       
   118 //
       
   119 void CWmDetailsDlg::ConstructL(
       
   120 			const TDesC& aName,
       
   121 	        const TDesC& aDescription,
       
   122 	        const TDesC& aIconStr,
       
   123 	        const CFbsBitmap& aDefaultIcon,
       
   124 	        const CFbsBitmap& aDefaultIconMask )
       
   125     {
       
   126  
       
   127 	CAknDialog::ConstructL( R_AVKON_DIALOG_EMPTY_MENUBAR );
       
   128     
       
   129 	iBgContext = CAknsBasicBackgroundControlContext::NewL( 
       
   130 	        KAknsIIDQsnFrPopupCenter, TRect(0,0,1,1), EFalse);
       
   131 
       
   132 	iName = aName.AllocL();
       
   133 	iDescription = aDescription.AllocL();
       
   134 	
       
   135 	iImageConverter = CWmImageConverter::NewL();
       
   136 	
       
   137     // Main window
       
   138     TRect mainPane;
       
   139     AknLayoutUtils::LayoutMetricsRect(
       
   140             AknLayoutUtils::EApplicationWindow, mainPane );
       
   141     
       
   142     // Dialog
       
   143     TAknLayoutRect dlgWindowRect;
       
   144     TAknWindowLineLayout dlgWindow = AknLayoutScalable_Apps
       
   145                ::popup_wgtman_window().LayoutLine();
       
   146     dlgWindowRect.LayoutRect( mainPane, dlgWindow );
       
   147     
       
   148     // Heading
       
   149     TAknLayoutRect layoutRect;
       
   150     TAknWindowLineLayout headingPane = AknLayoutScalable_Apps
       
   151                ::wgtman_heading_pane().LayoutLine();        
       
   152     layoutRect.LayoutRect( dlgWindowRect.Rect(), headingPane );
       
   153     
       
   154     // Icon
       
   155     TAknLayoutRect iconRect;
       
   156     TAknWindowLineLayout icongrapichs = AknLayoutScalable_Apps
       
   157             ::wgtman_heading_pane_g1().LayoutLine();
       
   158     iconRect.LayoutRect( layoutRect.Rect(), icongrapichs );
       
   159     
       
   160     iImageConverter->HandleIconString( 
       
   161             iconRect.Rect().Size(), 
       
   162             aIconStr, 
       
   163             iLogoBmp, 
       
   164             iLogoMask );
       
   165     
       
   166     // if icon creation fails use defaults
       
   167     if ( !iLogoBmp || !iLogoMask )
       
   168         {
       
   169 		delete iLogoBmp; iLogoBmp = NULL;
       
   170 		delete iLogoMask; iLogoMask = NULL;
       
   171 
       
   172 		iLogoBmp = new ( ELeave ) CFbsBitmap;        
       
   173 		iLogoMask = new ( ELeave ) CFbsBitmap;  
       
   174 
       
   175 		TSize size = iconRect.Rect().Size();
       
   176 		User::LeaveIfError(
       
   177                 iLogoBmp->Create( size, aDefaultIcon.DisplayMode() ) );
       
   178         User::LeaveIfError( 
       
   179                 iLogoMask->Create( size, aDefaultIconMask.DisplayMode() ) );
       
   180         
       
   181         iLogoBmp->Duplicate( aDefaultIcon.Handle() );
       
   182         iLogoMask->Duplicate( aDefaultIconMask.Handle() );
       
   183         
       
   184         // Resize default icons only when they are really needed
       
   185         AknIconUtils::SetSize( 
       
   186                 iLogoBmp, size, EAspectRatioPreserved );
       
   187         AknIconUtils::SetSize( 
       
   188                 iLogoMask, size, EAspectRatioPreserved );
       
   189         }
       
   190     
       
   191     iEikonEnv->AddWindowShadow( static_cast<CCoeControl*>(this) );
       
   192     }
       
   193 
       
   194 // -----------------------------------------------------------------------------
       
   195 // CWmDetailsDlg::OkToExitL
       
   196 // -----------------------------------------------------------------------------
       
   197 //
       
   198 TBool CWmDetailsDlg::OkToExitL( TInt aButtonId )
       
   199 	{
       
   200     if ( aButtonId == ECbaAddToHs ||
       
   201 		aButtonId == EAknSoftkeyClose )
       
   202         {
       
   203         // Close dlg
       
   204         return ETrue;
       
   205         }
       
   206     return EFalse;
       
   207 	}
       
   208 
       
   209 // -----------------------------------------------------------------------------
       
   210 // CWmDetailsDlg::PreLayoutDynInitL
       
   211 // -----------------------------------------------------------------------------
       
   212 //
       
   213 void CWmDetailsDlg::PreLayoutDynInitL()
       
   214     {
       
   215     iRtEditor = new(ELeave) CEikRichTextEditor();
       
   216     iRtEditor->ConstructL( this, 
       
   217                         0, 
       
   218                         0, 
       
   219                         CEikEdwin::EReadOnly | 
       
   220                         CEikEdwin::ENoAutoSelection | 
       
   221                         CEikEdwin::EAvkonDisableCursor |
       
   222                         CEikEdwin::EDisplayOnly );
       
   223     iRtEditor->SetContainerWindowL(*this);
       
   224     iRtEditor->SetAknEditorFlags( 
       
   225                     EAknEditorFlagEnableScrollBars | 
       
   226                     EEikEdwinAvkonDisableCursor |
       
   227                     EEikEdwinDisplayOnly |
       
   228                     EEikEdwinReadOnly );
       
   229     iRtEditor->EnableKineticScrollingL( ETrue );
       
   230 
       
   231     CEikScrollBarFrame* scrollBarFrame = iRtEditor->CreateScrollBarFrameL();
       
   232     scrollBarFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,
       
   233                                              CEikScrollBarFrame::EAuto );
       
   234     
       
   235     iMarquee = CAknMarqueeControl::NewL();
       
   236     TCallBack callback( RedrawCallback, this );
       
   237     iMarquee->SetRedrawCallBack( callback );
       
   238     iMarquee->SetLoops( 1 );
       
   239     iMarquee->SetContainerWindowL( *this );
       
   240     
       
   241     InsertAndFormatContentL();
       
   242     iRtEditor->UpdateScrollBarsL();
       
   243     }
       
   244 
       
   245 //------------------------------------------------------------------------------
       
   246 // CWmDetailsDlg::InsertAndFormatContentL
       
   247 //------------------------------------------------------------------------------
       
   248 //
       
   249 void CWmDetailsDlg::InsertAndFormatContentL()
       
   250     {
       
   251     CRichText* richText = iRtEditor->RichText();
       
   252     
       
   253     richText->Reset();
       
   254     richText->InsertL( richText->DocumentLength(), *iDescription );
       
   255 
       
   256     // change the color of the text according to the skin color
       
   257     TRgb color = KRgbBlack;
       
   258     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   259     AknsUtils::GetCachedColor(skin, color, KAknsIIDQsnTextColors, 
       
   260                                                     EAknsCIQsnTextColorsCG6 );
       
   261 
       
   262     // Format text 
       
   263     iRtEditor->SetSelectionL( 0, richText->DocumentLength() );
       
   264 
       
   265     // Get a logical font to base my font on:
       
   266     const CFont* logicalFont = AknLayoutUtils::FontFromId(EAknLogicalFontPrimarySmallFont);
       
   267     // Extract font information
       
   268     TFontSpec fontspec = logicalFont->FontSpecInTwips();
       
   269     TCharFormat charFormat(fontspec.iTypeface.iName, fontspec.iHeight);
       
   270     TCharFormatMask charFormatMask;
       
   271     CParaFormat paraFormat;
       
   272     TParaFormatMask paraFormatMask;
       
   273     paraFormat.iHorizontalAlignment = CParaFormat::ELeftAlign;
       
   274     charFormat.iFontPresentation.iTextColor = color;
       
   275     paraFormatMask.SetAttrib(EAttAlignment);
       
   276     charFormatMask.SetAttrib(EAttFontTypeface);
       
   277     charFormatMask.SetAttrib(EAttFontHeight);
       
   278     paraFormatMask.SetAttrib(EAttLineSpacing);
       
   279     charFormatMask.SetAttrib(EAttColor);
       
   280     iRtEditor->ApplyParaFormatL(&paraFormat, paraFormatMask);
       
   281     iRtEditor->ApplyCharFormatL(charFormat, charFormatMask);
       
   282     iRtEditor->ClearSelectionL();
       
   283     }
       
   284 
       
   285 //------------------------------------------------------------------------------
       
   286 // CWmDetailsDlg::CountComponentControls
       
   287 //------------------------------------------------------------------------------
       
   288 //
       
   289 TInt CWmDetailsDlg::CountComponentControls() const
       
   290     {
       
   291     TInt count( 0 );
       
   292     if ( iRtEditor )
       
   293         count++;
       
   294     if ( iMarquee )
       
   295         count++;
       
   296     return count;
       
   297     }
       
   298 
       
   299 //------------------------------------------------------------------------------
       
   300 // CWmDetailsDlg::ComponentControl
       
   301 //------------------------------------------------------------------------------
       
   302 //
       
   303 CCoeControl* CWmDetailsDlg::ComponentControl(TInt aIndex) const
       
   304     {
       
   305     switch (aIndex)
       
   306         {
       
   307         case 0:
       
   308             return iRtEditor;
       
   309         case 1:
       
   310             return iMarquee;
       
   311         default:
       
   312             return NULL;
       
   313         }
       
   314     }
       
   315 
       
   316 //------------------------------------------------------------------------------
       
   317 // CWmDetailsDlg::ActivateL
       
   318 //------------------------------------------------------------------------------
       
   319 //
       
   320 void CWmDetailsDlg::ActivateL()
       
   321 	{
       
   322     CAknDialog::ActivateL();
       
   323 	iEikonEnv->EikAppUi()->AddToStackL( this, ECoeStackPriorityDialog );
       
   324     iEikonEnv->EikAppUi()->AddToStackL( iRtEditor );    
       
   325     iRtEditor->SetFocus( ETrue );
       
   326     }
       
   327 
       
   328 // -----------------------------------------------------------------------------
       
   329 // CWmDetailsDlg::SetSizeAndPosition
       
   330 // -----------------------------------------------------------------------------
       
   331 //
       
   332 void CWmDetailsDlg::SetSizeAndPosition( const TSize& /*aSize*/ )
       
   333     {    
       
   334     TRect mainPane;
       
   335     AknLayoutUtils::LayoutMetricsRect(
       
   336             AknLayoutUtils::EApplicationWindow, mainPane );
       
   337     TAknWindowLineLayout dlgWindow = AknLayoutScalable_Apps
       
   338                ::popup_wgtman_window().LayoutLine();
       
   339     AknLayoutUtils::LayoutControl( this, mainPane, dlgWindow );
       
   340     }
       
   341 
       
   342 // -----------------------------------------------------------------------------
       
   343 // CWmDetailsDlg::SizeChanged
       
   344 // -----------------------------------------------------------------------------
       
   345 //
       
   346 void CWmDetailsDlg::SizeChanged()
       
   347     {
       
   348     CAknDialog::SizeChanged();
       
   349     TRect rect = Rect();
       
   350     if ( iBgContext ) { iBgContext->SetRect( rect ); }
       
   351     if ( iRtEditor ) 
       
   352         {
       
   353         TAknLayoutRect layoutRect;
       
   354         TAknWindowLineLayout contentPane = AknLayoutScalable_Apps
       
   355                    ::wgtman_content_pane().LayoutLine();        
       
   356         TAknWindowLineLayout rtePane = AknLayoutScalable_Apps
       
   357                    ::wgtman_list_pane().LayoutLine();
       
   358         layoutRect.LayoutRect( rect, contentPane );
       
   359         AknLayoutUtils::LayoutControl( iRtEditor, layoutRect.Rect(), rtePane );
       
   360         CEikScrollBarFrame* sbFrame = iRtEditor->ScrollBarFrame();
       
   361         if ( sbFrame && 
       
   362             sbFrame->ScrollBarVisibility( 
       
   363                     CEikScrollBar::EVertical ) != CEikScrollBarFrame::EOff &&
       
   364             sbFrame->VerticalScrollBar()->IsVisible() )
       
   365             {
       
   366             CEikScrollBar* scrollBar = sbFrame->VerticalScrollBar();
       
   367             TAknWindowLineLayout scrollPane = AknLayoutScalable_Apps
       
   368                            ::scroll_pane_cp036().LayoutLine();
       
   369             AknLayoutUtils::LayoutControl( scrollBar, layoutRect.Rect(), scrollPane );
       
   370             }
       
   371         TRAP_IGNORE( 
       
   372             iRtEditor->SetSkinBackgroundControlContextL( iBgContext );
       
   373             InsertAndFormatContentL(); );
       
   374 
       
   375         StartMarquee();
       
   376         }
       
   377     }
       
   378 
       
   379 // ----------------------------------------------------------------------------
       
   380 // CWmDetailsDlg::SupplyMopObject
       
   381 // ----------------------------------------------------------------------------
       
   382 //
       
   383 TTypeUid::Ptr CWmDetailsDlg::MopSupplyObject( TTypeUid aId )
       
   384     {
       
   385     if ( aId.iUid == MAknsControlContext::ETypeId )
       
   386         {
       
   387         return MAknsControlContext::SupplyMopObject( aId, iBgContext );
       
   388         }
       
   389     return CAknDialog::MopSupplyObject( aId );
       
   390     }
       
   391 	
       
   392 // ----------------------------------------------------------------------------
       
   393 // CWmDetailsDlg::OfferKeyEventL
       
   394 // ----------------------------------------------------------------------------
       
   395 //
       
   396 TKeyResponse CWmDetailsDlg::OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType )
       
   397 	{
       
   398 	if (aType == EEventKey)
       
   399 		{
       
   400 		switch (aKeyEvent.iCode)
       
   401 			{			
       
   402 			case EKeyEscape:
       
   403 				{
       
   404 				// framework calls this when dialog must shut down
       
   405 				return CAknDialog::OfferKeyEventL( aKeyEvent, aType );
       
   406         		}
       
   407 			case EKeyDownArrow:
       
   408                 {
       
   409                 if ( iRtEditor )
       
   410                     {
       
   411                     iRtEditor->MoveCursorL(TCursorPosition::EFPageDown, EFalse);
       
   412                     return EKeyWasConsumed;
       
   413                     }
       
   414                 }
       
   415             case EKeyUpArrow:
       
   416                 {
       
   417                 if ( iRtEditor )
       
   418                     {
       
   419                     iRtEditor->MoveCursorL(TCursorPosition::EFPageUp, EFalse);
       
   420                     return EKeyWasConsumed;
       
   421                     }
       
   422                 }				
       
   423             default:
       
   424 				{
       
   425 				if ( iRtEditor )
       
   426 					{
       
   427 					return iRtEditor->OfferKeyEventL( aKeyEvent, aType );
       
   428 					}
       
   429 			    break;
       
   430 				}
       
   431 			}
       
   432 		}
       
   433 	return CAknDialog::OfferKeyEventL( aKeyEvent, aType);
       
   434 	}
       
   435 
       
   436 // -----------------------------------------------------------------------------
       
   437 // CWmDetailsDlg::Draw
       
   438 // -----------------------------------------------------------------------------
       
   439 //
       
   440 void CWmDetailsDlg::Draw( const TRect& /*aRect*/ ) const
       
   441     {
       
   442     CWindowGc& gc = SystemGc();
       
   443     TRect rect = Rect();
       
   444     TRect innerRect( rect );
       
   445     TRgb color = KRgbBlack;
       
   446 
       
   447     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   448     MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
       
   449 
       
   450     // draw background
       
   451     if ( !AknsDrawUtils::Background( skin, cc, this, gc, innerRect ) )
       
   452         {
       
   453         gc.SetPenStyle( CGraphicsContext::ENullPen );
       
   454         gc.SetBrushStyle( CGraphicsContext::ENullBrush );
       
   455         gc.SetBrushColor( AKN_LAF_COLOR( 0 ) );
       
   456         gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
       
   457         gc.DrawRect( innerRect );
       
   458         gc.SetBrushStyle( CGraphicsContext::ENullBrush );
       
   459         }
       
   460 
       
   461     // draw logo
       
   462     TAknLayoutRect layoutRect;
       
   463     TAknWindowLineLayout headingPane = AknLayoutScalable_Apps
       
   464                ::wgtman_heading_pane().LayoutLine();        
       
   465     layoutRect.LayoutRect( rect, headingPane );
       
   466 
       
   467     TAknLayoutRect logoLayout;
       
   468         logoLayout.LayoutRect( layoutRect.Rect(),AknLayoutScalable_Apps
       
   469                 ::wgtman_heading_pane_g1().LayoutLine() );
       
   470         
       
   471     if( iLogoBmp && iLogoMask )
       
   472         {
       
   473         gc.DrawBitmapMasked( logoLayout.Rect(), 
       
   474                 iLogoBmp, 
       
   475                 TRect(TPoint(0, 0), iLogoBmp->SizeInPixels()), 
       
   476                 iLogoMask, 
       
   477                 EFalse );
       
   478         }
       
   479     
       
   480     AknsUtils::GetCachedColor( 
       
   481                     skin, color, 
       
   482                     KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 );
       
   483 
       
   484     // DRAW TEXT
       
   485     TAknTextLineLayout titleTextLayout = 
       
   486               AknLayoutScalable_Apps::wgtman_heading_pane_t1().LayoutLine();
       
   487     TAknLayoutText textLayoutTitle;
       
   488     textLayoutTitle.LayoutText( layoutRect.Rect(), titleTextLayout );
       
   489     
       
   490     const CFont* font = textLayoutTitle.Font();
       
   491     if ( !font ) 
       
   492         {
       
   493         font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimaryFont ); 
       
   494         }
       
   495 
       
   496     gc.UseFont( font );
       
   497     gc.SetPenColor( color );
       
   498     gc.SetPenStyle( CGraphicsContext::ESolidPen );
       
   499     
       
   500     TBool truncate( ETrue );
       
   501 
       
   502     // check if name needs scrolling
       
   503     if ( textLayoutTitle.Font()->TextWidthInPixels( *iName ) > 
       
   504         textLayoutTitle.TextRect().Width() && IsFocused() )
       
   505         {
       
   506         const_cast<CWmDetailsDlg&>(*this).iNeedToScroll = ETrue;
       
   507         const_cast<CWmDetailsDlg&>(*this).StartMarquee();
       
   508         truncate = iMarquee->DrawText(
       
   509                         gc, textLayoutTitle.TextRect(), *iName,               
       
   510                         (textLayoutTitle.TextRect().Height() - font->FontMaxDescent()),
       
   511                         CGraphicsContext::ELeft, *font );
       
   512         }
       
   513 
       
   514     if ( truncate )
       
   515         {
       
   516         const_cast<CWmDetailsDlg&>(*this).StopMarquee();
       
   517         textLayoutTitle.DrawText( gc, *iName, ETrue, color );
       
   518         }
       
   519 
       
   520     gc.DiscardFont();
       
   521 
       
   522     // draw the rounded rectangle as border
       
   523     const TInt KFrameRoundRadius = 3;
       
   524     const TInt KBorderWidth = 2;
       
   525     gc.SetPenSize( TSize( KBorderWidth, KBorderWidth ) );    
       
   526     gc.DrawRoundRect( innerRect, TSize( KFrameRoundRadius, KFrameRoundRadius ) );
       
   527     }
       
   528 
       
   529 // ---------------------------------------------------------
       
   530 // CWmDetailsDlg::RedrawCallback
       
   531 // ---------------------------------------------------------
       
   532 //
       
   533 TInt CWmDetailsDlg::RedrawCallback( TAny* aPtr )
       
   534     {
       
   535     CWmDetailsDlg* self = 
       
   536         static_cast<CWmDetailsDlg*>( aPtr );
       
   537     if ( !self->iNeedToScroll )
       
   538         {
       
   539         self->StopMarquee();    
       
   540         }
       
   541     self->DrawDeferred();
       
   542     return static_cast<TBool>( ETrue );
       
   543     }
       
   544 
       
   545 // ---------------------------------------------------------
       
   546 // CWmDetailsDlg::StartMarquee
       
   547 // ---------------------------------------------------------
       
   548 //
       
   549 void CWmDetailsDlg::StartMarquee()
       
   550     {
       
   551     if ( iMarquee && iNeedToScroll &&
       
   552         !iMarquee->IsMarqueeOn() )
       
   553         {
       
   554         iMarquee->Reset();
       
   555         iMarquee->EnableMarquee( iNeedToScroll );
       
   556         iMarquee->Start();
       
   557         }
       
   558     }
       
   559 
       
   560 // ---------------------------------------------------------
       
   561 // CWmDetailsDlg::StopMarquee
       
   562 // ---------------------------------------------------------
       
   563 //
       
   564 void CWmDetailsDlg::StopMarquee()
       
   565     {
       
   566     if ( iMarquee && iMarquee->IsMarqueeOn() )
       
   567         {
       
   568         iMarquee->EnableMarquee( EFalse );
       
   569         iMarquee->Stop();        
       
   570         }
       
   571     }
       
   572 
       
   573 // ---------------------------------------------------------
       
   574 // CWmDetailsDlg::FocusChanged
       
   575 // ---------------------------------------------------------
       
   576 //
       
   577 void CWmDetailsDlg::FocusChanged( TDrawNow aDrawNow )
       
   578     {
       
   579     CCoeControl::FocusChanged( aDrawNow );
       
   580     ( IsFocused() ? StartMarquee() : StopMarquee() );
       
   581     }
       
   582 
       
   583 
       
   584 // End of File
       
   585