mpxplugins/serviceplugins/screensaverplugins/mpxscreensaverplugin/src/mpxscreensaverplugincontainer.cpp
changeset 0 ff3acec5bc43
child 18 c54d95799c80
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation of Screen Saver Plugin
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include <eikenv.h>
       
    22 #include <data_caging_path_literals.hrh>
       
    23 #include <screensaverplugin.h>
       
    24 #include <AknsUtils.h>
       
    25 #include <AknUtils.h>
       
    26 #include <AknBidiTextUtils.h>
       
    27 #include <eiklabel.h>
       
    28 #include <aknlayoutscalable_avkon.cdl.h>
       
    29 #include <StringLoader.h>
       
    30 #include <bitmaptransforms.h>
       
    31 #include <e32math.h>
       
    32 
       
    33 #include <PUAcodes.hrh>
       
    34 #include <barsread.h>
       
    35 
       
    36 #include <mpxmedia.h>
       
    37 #include <mpxmediageneraldefs.h>
       
    38 #include <mpxscreensaverplugin.rsg>
       
    39 #include <mpxscreensaverplugin.mbg>
       
    40 #include <mpxplaybackframeworkdefs.h>
       
    41 #include <mpxlog.h>
       
    42 #include <mpxuser.h>
       
    43 
       
    44 #include "mpxscreensaverplugincontainer.h"
       
    45 
       
    46 // Constants
       
    47 const TInt KMPXDurationDisplayResvLen = 10;
       
    48 const TInt KMPXNumBackgrounds = 4;
       
    49 #define KMPXIndicatorColor KRgbWhite
       
    50 
       
    51 _LIT( KIconFileName, "mpxscreensaverplugin.mbm" );
       
    52 _LIT( KMXPanicCategory, "CMPXScreenSaverPluginContainer" );
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // CMPXScreenSaverPluginContainer::CMPXScreenSaverPluginContainer
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 CMPXScreenSaverPluginContainer::CMPXScreenSaverPluginContainer(
       
    59     MScreensaverPluginHost *aHost ):
       
    60     iScreenSaverHost( aHost ),
       
    61     iParentControl( NULL ),
       
    62     iBackground( KMPXNumBackgrounds )
       
    63     {
       
    64     }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CMPXScreenSaverPluginContainer::ConstructL
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 void CMPXScreenSaverPluginContainer::ConstructL()
       
    71     {
       
    72     MPX_FUNC( "CMPXScreenSaverPluginContainer::ConstructL" );
       
    73 
       
    74     iEikEnv = CEikonEnv::Static();
       
    75     iTitleLabel = new ( ELeave ) CEikLabel();
       
    76     iClockLabel = new ( ELeave ) CEikLabel();
       
    77     iAmPmLabel = new ( ELeave ) CEikLabel();
       
    78 
       
    79     RefreshDisplayInfo();
       
    80     CreateIconsL();
       
    81     }
       
    82 
       
    83 // ----------------------------------------------------------------------------
       
    84 // CMPXScreenSaverPluginContainerContainer::~CMPXScreenSaverPluginContainerContainer
       
    85 // ----------------------------------------------------------------------------
       
    86 //
       
    87 CMPXScreenSaverPluginContainer::
       
    88     ~CMPXScreenSaverPluginContainer()
       
    89     {
       
    90     MPX_DEBUG1( "CMPXScreenSaverPluginContainer::~CMPXScreenSaverPluginContainer START" );
       
    91 
       
    92     delete iPlayIcon;
       
    93     delete iPauseIcon;
       
    94     delete iMessageIcon;
       
    95     delete iMissedCallIcon;
       
    96     delete iNewInstantMessageIcon;
       
    97     delete iNewVoiceMessageIcon;
       
    98     delete iNewEmailIcon;
       
    99     delete iKeyguardIcon;
       
   100 
       
   101     delete iTitleLabel;
       
   102     delete iClockLabel;
       
   103     delete iAmPmLabel;
       
   104     delete iProfileName;
       
   105 
       
   106     iBackground.ResetAndDestroy();
       
   107     iBackground.Close();
       
   108 
       
   109     if ( iIndicatorFont && iOSBitmapDevice )
       
   110         {
       
   111         iOSBitmapDevice->ReleaseFont( iIndicatorFont );
       
   112         }
       
   113 
       
   114     delete iOffScreenBitmap;
       
   115     delete iOSBitmapContext;
       
   116     delete iOSBitmapDevice;
       
   117 
       
   118     MPX_DEBUG1( "CMPXScreenSaverPluginContainer::~CMPXScreenSaverPluginContainer END" );
       
   119     }
       
   120 
       
   121 // -----------------------------------------------------------------------------
       
   122 // CMPXScreenSaverPluginContainer::Draw
       
   123 // -----------------------------------------------------------------------------
       
   124 //
       
   125 TInt CMPXScreenSaverPluginContainer::DrawL( CWindowGc& aGc,
       
   126     TMPXPlaybackState aPlaybackState )
       
   127     {
       
   128     MPX_FUNC( "CMPXScreenSaverPluginContainer::DrawL" );
       
   129 
       
   130     TInt colorIndex = GetDrawPositionAndColorIndexL();
       
   131     if ( !iOffScreenBitmap )
       
   132         {
       
   133         TInt backgroundHeight = BackgroundHeightL();
       
   134         // create an off-screen bitmap, device and context
       
   135         iOffScreenBitmap = new ( ELeave ) CFbsBitmap();
       
   136         User::LeaveIfError( iOffScreenBitmap->Create(
       
   137             TSize( iScreenSize.iWidth, backgroundHeight),
       
   138             aGc.Device()->DisplayMode() ) );
       
   139         iOSBitmapDevice = CFbsBitmapDevice::NewL( iOffScreenBitmap );
       
   140         User::LeaveIfError( iOSBitmapDevice->CreateContext( iOSBitmapContext ) );
       
   141 
       
   142         iOSBitmapContext->SetPenColor( KMPXIndicatorColor );
       
   143         // brush style has to be null in order for icon mask to work
       
   144         iOSBitmapContext->SetBrushColor( KRgbBlack );
       
   145         iOSBitmapContext->SetBrushStyle( CGraphicsContext::ENullBrush );
       
   146         iOSBitmapContext->SetPenStyle( CGraphicsContext::ESolidPen );
       
   147 
       
   148         // update the layouts
       
   149         UpdateLayoutL();
       
   150 
       
   151         if ( iIndicatorFont )
       
   152             {
       
   153             iOSBitmapDevice->ReleaseFont( iIndicatorFont );
       
   154             }
       
   155         const CFont* origFont = AknLayoutUtils::FontFromId( EAknLogicalFontSecondaryFont );
       
   156         TFontSpec fontSpecTitle = origFont->FontSpecInTwips();
       
   157         fontSpecTitle.iHeight = iRectIndicators.Height();  // Scale smaller
       
   158         iOSBitmapDevice->GetNearestFontToDesignHeightInPixels( iIndicatorFont, fontSpecTitle );
       
   159 
       
   160         // reload the backgrounds
       
   161         LoadBackgroundsL();
       
   162         }
       
   163 
       
   164     iOSBitmapContext->Clear();
       
   165 
       
   166     DrawBackground( *iOSBitmapContext, colorIndex );
       
   167     DrawClockL( *iOSBitmapContext );
       
   168     DrawPlaybackStatusL( *iOSBitmapContext, aPlaybackState );
       
   169     DrawIndicatorsL( *iOSBitmapContext );
       
   170 
       
   171     aGc.SetBrushColor( KRgbBlack );
       
   172     aGc.Clear();
       
   173     // activate partial mode
       
   174     // partial mode is not supported in landscape orientation?
       
   175     TScreensaverPartialMode partialMode;
       
   176     TRect drawArea = TRect( TPoint(0, iStartY),
       
   177         TPoint( iOffScreenBitmap->SizeInPixels().iWidth,
       
   178         iOffScreenBitmap->SizeInPixels().iHeight + iStartY) );
       
   179     partialMode.iBpp = 8;
       
   180     partialMode.iType = EPartialModeTypeMostPowerSaving;
       
   181     TInt status = iScreenSaverHost->SetActiveDisplayArea(
       
   182         drawArea, partialMode );
       
   183     MPX_DEBUG2( "CMPXScreenSaverPluginContainer::DrawL SetActiveDisplayArea status = %d", status );
       
   184     aGc.BitBlt( TPoint(0, iStartY), iOffScreenBitmap );
       
   185 
       
   186     return KErrNone;
       
   187     }
       
   188 
       
   189 // -----------------------------------------------------------------------------
       
   190 // CMPXScreenSaverPluginContainer::SetSongPropertiesL
       
   191 // -----------------------------------------------------------------------------
       
   192 //
       
   193 void CMPXScreenSaverPluginContainer::SetSongPropertiesL(
       
   194     const CMPXMedia& aMedia )
       
   195     {
       
   196     MPX_FUNC( "CMPXScreenSaverPluginContainer::SetSongPropertiesL" );
       
   197     iTitleLabel->SetTextL(
       
   198         aMedia.ValueText( KMPXMediaGeneralTitle ) );
       
   199     }
       
   200 
       
   201 // -----------------------------------------------------------------------------
       
   202 // CMPXScreenSaverPluginContainer::SetNewVoiceMessage
       
   203 // -----------------------------------------------------------------------------
       
   204 //
       
   205 void CMPXScreenSaverPluginContainer::SetParam(
       
   206     MPXScreenSaverPluginParam aType, TInt aValue )
       
   207     {
       
   208     MPX_DEBUG3( "-->CMPXScreenSaverPluginContainer::SetParam type = %d, value = %d", aType, aValue );
       
   209 
       
   210     switch ( aType )
       
   211         {
       
   212         case MPXScreenSaverPluginParamMissedCall:
       
   213             {
       
   214             iMissedCall = aValue;
       
   215             break;
       
   216             }
       
   217         case MPXScreenSaverPluginParamNewMessage:
       
   218             {
       
   219             iNewMessage = aValue;
       
   220             break;
       
   221             }
       
   222         case MPXScreenSaverPluginParamInstantMessage:
       
   223             {
       
   224             iNewInstantMessage = aValue;
       
   225             break;
       
   226             }
       
   227         case MPXScreenSaverPluginParamEmail:
       
   228             {
       
   229             iNewEmail = aValue;
       
   230             break;
       
   231             }
       
   232         case MPXScreenSaverPluginParamVoiceMessage:
       
   233             {
       
   234             iNewVoiceMessage = aValue;
       
   235             break;
       
   236             }
       
   237         case MPXScreenSaverPluginParamKeyguard:
       
   238             {
       
   239             iKeyguard = aValue;
       
   240             break;
       
   241             }
       
   242         case MPXScreenSaverPluginParamIsSilent:
       
   243             {
       
   244             iIsSilent = aValue;
       
   245             break;
       
   246             }
       
   247         default:
       
   248             break;
       
   249         }
       
   250     MPX_DEBUG1( "<--CMPXScreenSaverPluginContainer::SetParam" );
       
   251     }
       
   252 
       
   253 // -----------------------------------------------------------------------------
       
   254 // CMPXScreenSaverPluginContainer::SetProfileNameL
       
   255 // -----------------------------------------------------------------------------
       
   256 //
       
   257 void CMPXScreenSaverPluginContainer::SetProfileNameL(
       
   258     const TDesC& aName, TBool aDisplay )
       
   259     {
       
   260     MPX_FUNC( "CMPXScreenSaverPluginContainer::SetProfileNameL" );
       
   261     delete iProfileName;
       
   262     iProfileName = NULL;
       
   263     if ( aDisplay )
       
   264         {
       
   265         iProfileName = aName.AllocL();
       
   266         }
       
   267     }
       
   268 
       
   269 // -----------------------------------------------------------------------------
       
   270 // CMPXScreenSaverPluginContainer::RefreshDisplayInfo
       
   271 // -----------------------------------------------------------------------------
       
   272 //
       
   273 void CMPXScreenSaverPluginContainer::RefreshDisplayInfo()
       
   274     {
       
   275     MPX_FUNC( "CMPXScreenSaverPluginContainer::RefreshDisplayInfo" );
       
   276 
       
   277     TScreensaverDisplayInfo displayInfo;
       
   278     displayInfo.iSize = sizeof( TScreensaverDisplayInfo );
       
   279     iScreenSaverHost->DisplayInfo( &displayInfo );
       
   280     iParentControl = displayInfo.iParent;
       
   281 
       
   282     // screen size from display info may not be full screen size
       
   283     iScreenSize = CCoeEnv::Static()->ScreenDevice()->SizeInPixels();
       
   284     MPX_DEBUG3( "CMPXScreenSaverPluginContainer::RefreshDisplayInfo Screen size: %d %d", iScreenSize.iWidth, iScreenSize.iHeight );
       
   285 
       
   286     // delete them so that they will be recreated next time
       
   287     delete iOffScreenBitmap;
       
   288     iOffScreenBitmap = NULL;
       
   289     delete iOSBitmapContext;
       
   290     iOSBitmapContext = NULL;
       
   291     delete iOSBitmapDevice;
       
   292     iOSBitmapDevice = NULL;
       
   293     }
       
   294 
       
   295 // ---------------------------------------------------------------------------
       
   296 // Create icons.
       
   297 // ---------------------------------------------------------------------------
       
   298 //
       
   299 void CMPXScreenSaverPluginContainer::CreateIconsL()
       
   300     {
       
   301     MPX_FUNC( "CMPXScreenSaverPluginContainer::CreateIconsL" );
       
   302 
       
   303     TParse parse;
       
   304     parse.Set( KIconFileName, &KDC_APP_RESOURCE_DIR, NULL );
       
   305     TFileName iconFile( parse.FullName() );
       
   306     User::LeaveIfError( MPXUser::CompleteWithDllPath( iconFile ) );
       
   307 
       
   308     iPlayIcon = CreateIconL(
       
   309         KAknsIIDQgnIndiMupPlay,
       
   310         KAknsIIDQsnIconColors,
       
   311         EAknsCIQsnIconColorsCG1,
       
   312         iconFile,
       
   313         EMbmMpxscreensaverpluginQgn_graf_mup_npv_icon_play,
       
   314         EMbmMpxscreensaverpluginQgn_graf_mup_npv_icon_play_mask,
       
   315         ETrue );
       
   316 
       
   317     iPauseIcon = CreateIconL(
       
   318         KAknsIIDQgnIndiMupPause,
       
   319         KAknsIIDQsnIconColors,
       
   320         EAknsCIQsnIconColorsCG1,
       
   321         iconFile,
       
   322         EMbmMpxscreensaverpluginQgn_graf_mup_npv_icon_pause,
       
   323         EMbmMpxscreensaverpluginQgn_graf_mup_npv_icon_pause_mask,
       
   324         ETrue );
       
   325 
       
   326     iMessageIcon = CreateIconL(
       
   327         KAknsIIDQgnStatMessage,
       
   328         KAknsIIDQsnIconColors,
       
   329         EAknsMinorDefault,
       
   330         iconFile,
       
   331         EMbmMpxscreensaverpluginQgn_stat_message,
       
   332         EMbmMpxscreensaverpluginQgn_stat_message_mask,
       
   333         ETrue );
       
   334 
       
   335     iMissedCallIcon = CreateIconL(
       
   336         KAknsIIDQgnStatMissedCallsUni,
       
   337         KAknsIIDQsnIconColors,
       
   338         EAknsMinorDefault,
       
   339         iconFile,
       
   340         EMbmMpxscreensaverpluginQgn_stat_missed_calls_uni,
       
   341         EMbmMpxscreensaverpluginQgn_stat_missed_calls_uni_mask,
       
   342         ETrue );
       
   343 
       
   344     iNewInstantMessageIcon = CreateIconL(
       
   345         KAknsIIDQgnStatImUni,
       
   346         KAknsIIDQsnIconColors,
       
   347         EAknsMinorDefault,
       
   348         iconFile,
       
   349         EMbmMpxscreensaverpluginQgn_stat_im_uni,
       
   350         EMbmMpxscreensaverpluginQgn_stat_im_uni_mask,
       
   351         ETrue );
       
   352 
       
   353     iNewVoiceMessageIcon = CreateIconL(
       
   354         KAknsIIDQgnStatVm0,
       
   355         KAknsIIDQsnIconColors,
       
   356         EAknsMinorDefault,
       
   357         iconFile,
       
   358         EMbmMpxscreensaverpluginQgn_stat_vm0,
       
   359         EMbmMpxscreensaverpluginQgn_stat_vm0_mask,
       
   360         ETrue );
       
   361 
       
   362     iNewEmailIcon = CreateIconL(
       
   363         KAknsIIDQgnStatMessageMail,
       
   364         KAknsIIDQsnIconColors,
       
   365         EAknsMinorDefault,
       
   366         iconFile,
       
   367         EMbmMpxscreensaverpluginQgn_stat_message_mail,
       
   368         EMbmMpxscreensaverpluginQgn_stat_message_mail_mask,
       
   369         ETrue );
       
   370 
       
   371     iKeyguardIcon = CreateIconL(
       
   372         KAknsIIDQgnStatKeyguard,
       
   373         KAknsIIDQsnIconColors,
       
   374         EAknsMinorDefault,
       
   375         iconFile,
       
   376         EMbmMpxscreensaverpluginQgn_stat_keyguard,
       
   377         EMbmMpxscreensaverpluginQgn_stat_keyguard_mask,
       
   378         ETrue );
       
   379 
       
   380     LoadBackgroundsL();
       
   381     }
       
   382 
       
   383 // ---------------------------------------------------------------------------
       
   384 // Create a color icon.
       
   385 // ---------------------------------------------------------------------------
       
   386 //
       
   387 CGulIcon* CMPXScreenSaverPluginContainer::CreateIconL(
       
   388     const TAknsItemID& aID,
       
   389     const TAknsItemID& aColorId,
       
   390     TInt aColorIndex,
       
   391     const TDesC& aBitmapFilename,
       
   392     TInt aFileBitmapId,
       
   393     TInt aFileMaskId,
       
   394     TBool aIsIndicator
       
   395     )
       
   396     {
       
   397     MPX_FUNC( "CMPXScreenSaverPluginContainer::CreateIconL" );
       
   398 
       
   399     MAknsSkinInstance* skin( AknsUtils::SkinInstance() );
       
   400 
       
   401     CFbsBitmap* icon( NULL );
       
   402     CFbsBitmap* mask( NULL );
       
   403 
       
   404     if ( aColorId == KAknsIIDNone )
       
   405         {
       
   406         // do not use theme color, use the default color from the file
       
   407         AknsUtils::CreateIconLC( skin, aID,
       
   408             icon, mask, aBitmapFilename, aFileBitmapId, aFileMaskId );
       
   409         }
       
   410     else
       
   411         {
       
   412         // use theme color
       
   413         AknsUtils::CreateColorIconLC( skin, aID, aColorId, aColorIndex,
       
   414             icon, mask, aBitmapFilename, aFileBitmapId, aFileMaskId, KRgbBlack );
       
   415         }
       
   416 
       
   417     if ( aIsIndicator )
       
   418         {
       
   419         // should not be theme colored since everything else is not?
       
   420         AknIconUtils::SetIconColor( icon, KMPXIndicatorColor );
       
   421         }
       
   422 
       
   423     CGulIcon* res = CGulIcon::NewL( icon, mask );
       
   424     res->SetBitmapsOwnedExternally( EFalse );
       
   425     CleanupStack::Pop( 2 ); // mask, icon
       
   426     return res;
       
   427     }
       
   428 
       
   429 // ---------------------------------------------------------------------------
       
   430 // Load the backgrounds, and resize them to screen size
       
   431 // ---------------------------------------------------------------------------
       
   432 //
       
   433 void CMPXScreenSaverPluginContainer::LoadBackgroundsL()
       
   434     {
       
   435     MPX_FUNC( "CMPXScreenSaverPluginContainer::LoadBackgroundsL" );
       
   436 
       
   437     TParse parse;
       
   438     parse.Set( KIconFileName, &KDC_APP_RESOURCE_DIR, NULL );
       
   439     TFileName iconFile;
       
   440     iconFile.Append( parse.FullName() );
       
   441     User::LeaveIfError( MPXUser::CompleteWithDllPath( iconFile ) );
       
   442 
       
   443     iBackground.ResetAndDestroy();
       
   444 
       
   445     TInt width = iScreenSize.iWidth;
       
   446     TInt height = BackgroundHeightL();
       
   447 
       
   448     CGulIcon* icon = CreateIconL(
       
   449         KAknsIIDNone,
       
   450         KAknsIIDNone,
       
   451         EAknsMinorNone,
       
   452         iconFile,
       
   453         EMbmMpxscreensaverpluginQgn_graf_mup_ss_bgnd_01,
       
   454         EMbmMpxscreensaverpluginQgn_graf_mup_ss_bgnd_01_mask,
       
   455         EFalse );
       
   456     AknIconUtils::SetSize( icon->Bitmap(), TSize( width, height ),
       
   457         EAspectRatioNotPreserved );
       
   458     iBackground.Append( icon );
       
   459     icon = NULL;
       
   460 
       
   461     icon = CreateIconL(
       
   462         KAknsIIDNone,
       
   463         KAknsIIDNone,
       
   464         EAknsMinorNone,
       
   465         iconFile,
       
   466         EMbmMpxscreensaverpluginQgn_graf_mup_ss_bgnd_02,
       
   467         EMbmMpxscreensaverpluginQgn_graf_mup_ss_bgnd_02_mask,
       
   468         EFalse );
       
   469     AknIconUtils::SetSize( icon->Bitmap(), TSize( width, height ),
       
   470         EAspectRatioNotPreserved );
       
   471     iBackground.Append( icon );
       
   472     icon = NULL;
       
   473 
       
   474     icon = CreateIconL(
       
   475         KAknsIIDNone,
       
   476         KAknsIIDNone,
       
   477         EAknsMinorNone,
       
   478         iconFile,
       
   479         EMbmMpxscreensaverpluginQgn_graf_mup_ss_bgnd_03,
       
   480         EMbmMpxscreensaverpluginQgn_graf_mup_ss_bgnd_03_mask,
       
   481         EFalse );
       
   482     AknIconUtils::SetSize( icon->Bitmap(), TSize( width, height ),
       
   483         EAspectRatioNotPreserved );
       
   484     iBackground.Append( icon );
       
   485     icon = NULL;
       
   486 
       
   487     icon = CreateIconL(
       
   488         KAknsIIDNone,
       
   489         KAknsIIDNone,
       
   490         EAknsMinorNone,
       
   491         iconFile,
       
   492         EMbmMpxscreensaverpluginQgn_graf_mup_ss_bgnd_04,
       
   493         EMbmMpxscreensaverpluginQgn_graf_mup_ss_bgnd_04_mask,
       
   494         EFalse );
       
   495     AknIconUtils::SetSize( icon->Bitmap(), TSize( width, height ),
       
   496         EAspectRatioNotPreserved );
       
   497     iBackground.Append( icon );
       
   498     icon = NULL;
       
   499     }
       
   500 
       
   501 // -----------------------------------------------------------------------------
       
   502 // CMPXScreenSaverPluginContainer::DrawClock
       
   503 // -----------------------------------------------------------------------------
       
   504 //
       
   505 void CMPXScreenSaverPluginContainer::DrawClockL( CBitmapContext& aGc )
       
   506     {
       
   507     MPX_FUNC( "CMPXScreenSaverPluginContainer::DrawClockL" );
       
   508 
       
   509     // Draw clock display
       
   510     TTime time;
       
   511     time.HomeTime();
       
   512     // R_QTN_TIME_USUAL_WITH_ZERO cannot be used because ZDigi does not have
       
   513     // alphabets
       
   514     HBufC* format = StringLoader::LoadLC(
       
   515         R_MPX_SCREENSAVER_TIME_USUAL_WITHOUT_AMPM );
       
   516     HBufC* clockTime = HBufC::NewLC(
       
   517         format->Length() + KMPXDurationDisplayResvLen );
       
   518     TPtr clockTimePtr = clockTime->Des();
       
   519     MPX_TRAPD( err, time.FormatL( clockTimePtr, *format ) );
       
   520     if (err != KErrNone)
       
   521         {
       
   522         clockTimePtr = KNullDesC;
       
   523         }
       
   524     // time digifont does not contain arabic / indic etc numbers.
       
   525     // If clock font is changed, or digifont starts supporting language-
       
   526     // specific numbers, the commented-out call below should be restored
       
   527     /*
       
   528     else
       
   529         {
       
   530         AknTextUtils::LanguageSpecificNumberConversion( clockTimePtr );
       
   531         }
       
   532     */
       
   533 
       
   534     // AM/PM text
       
   535     HBufC* ampmFormat = StringLoader::LoadLC( R_MPX_SCREENSAVER_AMPM );
       
   536     HBufC* ampm = HBufC::NewLC( ampmFormat->Length() + KMPXDurationDisplayResvLen );
       
   537     TPtr ampmPtr = ampm->Des();
       
   538     MPX_TRAP( err, time.FormatL( ampmPtr, *ampmFormat ) );
       
   539     if ( err != KErrNone )
       
   540         {
       
   541         ampmPtr = KNullDesC;
       
   542         }
       
   543 
       
   544     TRgb color( KMPXIndicatorColor );
       
   545     aGc.UseFont( iClockLabel->Font() );
       
   546     aGc.SetPenColor( color );
       
   547     TInt width = iClockLabel->Font()->TextWidthInPixels( clockTimePtr );
       
   548     // align right
       
   549     aGc.DrawText( clockTimePtr,
       
   550             TPoint( iClockLabel->Rect().iBr.iX - width, iClockLabel->Rect().iBr.iY ) );
       
   551 
       
   552     // draw AM/PM if time format is 12-hour
       
   553     TLocale locale;
       
   554     if ( locale.TimeFormat() == ETime12 )
       
   555         {
       
   556         aGc.DiscardFont();
       
   557         aGc.UseFont( iAmPmLabel->Font() );
       
   558         width = iAmPmLabel->Font()->TextWidthInPixels( ampmPtr );
       
   559         // align right
       
   560         aGc.DrawText( ampmPtr,
       
   561             TPoint( iAmPmLabel->Rect().iBr.iX - width, iAmPmLabel->Rect().iBr.iY ) );
       
   562         }
       
   563 
       
   564     aGc.DiscardFont();
       
   565     CleanupStack::PopAndDestroy( ampm );
       
   566     CleanupStack::PopAndDestroy( ampmFormat );
       
   567     CleanupStack::PopAndDestroy( clockTime );
       
   568     CleanupStack::PopAndDestroy( format );
       
   569     }
       
   570 
       
   571 // -----------------------------------------------------------------------------
       
   572 // CMPXScreenSaverPluginContainer::DrawBackground
       
   573 // -----------------------------------------------------------------------------
       
   574 //
       
   575 void CMPXScreenSaverPluginContainer::DrawBackground(
       
   576     CBitmapContext& aGc, TInt aColorIndex )
       
   577     {
       
   578     MPX_FUNC( "CMPXScreenSaverPluginContainer::DrawBackground" );
       
   579     aGc.BitBltMasked(
       
   580         TPoint(),
       
   581         iBackground[ aColorIndex ]->Bitmap(),
       
   582         TRect( aGc.Device()->SizeInPixels() ),
       
   583         iBackground[ aColorIndex ]->Mask(),
       
   584         EFalse );
       
   585     }
       
   586 
       
   587 // -----------------------------------------------------------------------------
       
   588 // CMPXScreenSaverPluginContainer::DrawPlaybackStatus
       
   589 // -----------------------------------------------------------------------------
       
   590 //
       
   591 void CMPXScreenSaverPluginContainer::DrawPlaybackStatusL(
       
   592     CBitmapContext& aGc, TMPXPlaybackState aPlaybackState )
       
   593     {
       
   594     MPX_FUNC( "CMPXScreenSaverPluginContainer::DrawPlaybackStatus" );
       
   595 
       
   596     TBool showTitle = EFalse;
       
   597 
       
   598     // Draw play status icon (if any)
       
   599     CGulIcon* icon = NULL;
       
   600     switch ( aPlaybackState )
       
   601         {
       
   602         case EPbStatePlaying:
       
   603             {
       
   604             icon = iPlayIcon;
       
   605             showTitle = ETrue;
       
   606             break;
       
   607             }
       
   608         case EPbStatePaused:
       
   609             {
       
   610             icon = iPauseIcon;
       
   611             showTitle = ETrue;
       
   612             break;
       
   613             }
       
   614         default:
       
   615             {
       
   616             break;
       
   617             }
       
   618         }
       
   619     if ( icon )
       
   620         {
       
   621         aGc.BitBltMasked(
       
   622             iRectPlaybackStatus.iTl,
       
   623             icon->Bitmap(),
       
   624             TRect( iRectPlaybackStatus.Size() ),
       
   625             icon->Mask(),
       
   626             EFalse );
       
   627         }
       
   628 
       
   629     TRgb color( KMPXIndicatorColor );
       
   630     aGc.UseFont( iTitleLabel->Font() );
       
   631     aGc.SetPenColor( color );
       
   632 
       
   633     if ( iTitleLabel->Text() && showTitle )
       
   634         {
       
   635         HBufC* buf = iTitleLabel->Text()->AllocL();
       
   636         CleanupStack::PushL( buf );
       
   637         TPtr ptr( buf->Des() );
       
   638         AknBidiTextUtils::ConvertToVisualAndClipL(
       
   639             ptr,
       
   640             *iTitleLabel->Font(),
       
   641             iTitleLabel->Rect().Width(),
       
   642             iTitleLabel->Rect().Width() );
       
   643         aGc.DrawText( ptr,
       
   644             TPoint( iTitleLabel->Rect().iTl.iX, iTitleLabel->Rect().iBr.iY ) );
       
   645         CleanupStack::PopAndDestroy( buf );
       
   646         }
       
   647     else
       
   648         {
       
   649         TTime time;
       
   650         time.HomeTime();
       
   651         HBufC* format = StringLoader::LoadLC( R_QTN_DATE_USUAL_WITH_ZERO );
       
   652         HBufC* clockTime = HBufC::NewLC( format->Length() + KMPXDurationDisplayResvLen );
       
   653         TPtr clockTimePtr = clockTime->Des();
       
   654         time.FormatL( clockTimePtr, *format );
       
   655         AknTextUtils::LanguageSpecificNumberConversion( clockTimePtr );
       
   656 
       
   657         aGc.DrawText( clockTimePtr,
       
   658             TPoint( iTitleLabel->Rect().iTl.iX, iTitleLabel->Rect().iBr.iY ) );
       
   659 
       
   660         CleanupStack::PopAndDestroy( clockTime );
       
   661         CleanupStack::PopAndDestroy( format );
       
   662         }
       
   663     aGc.DiscardFont();
       
   664     }
       
   665 
       
   666 // -----------------------------------------------------------------------------
       
   667 // CMPXScreenSaverPluginContainer::DrawIndicatorsL
       
   668 // -----------------------------------------------------------------------------
       
   669 //
       
   670 void CMPXScreenSaverPluginContainer::DrawIndicatorsL(
       
   671      CBitmapContext& aGc )
       
   672     {
       
   673     MPX_FUNC( "CMPXScreenSaverPluginContainer::DrawIndicatorsL" );
       
   674 
       
   675     TSize indicatorSize = TSize( iRectIndicators.Height(),
       
   676         iRectIndicators.Height() );
       
   677     MPX_DEBUG2( "CMPXScreenSaverPluginContainer::DrawIndicatorsL indicator height %d", iRectIndicators.Height() );
       
   678     iStartX = iRectIndicators.iTl.iX;
       
   679 
       
   680     TRgb color( KMPXIndicatorColor );
       
   681     aGc.SetPenColor( color );
       
   682     aGc.UseFont( iIndicatorFont );
       
   683 
       
   684     if ( iKeyguard > 0 )
       
   685         {
       
   686         MPX_DEBUG3( "CMPXScreenSaverPluginContainer::DrawIndicatorsL drawing keyguard %d %d", iStartX, iRectIndicators.iTl.iY );
       
   687         DoDrawIndicatorsL( aGc, -1, iKeyguardIcon, iIndicatorFont,
       
   688             iRectIndicators, indicatorSize);
       
   689         }
       
   690 
       
   691     if ( iMissedCall > 0 )
       
   692         {
       
   693         MPX_DEBUG3( "CMPXScreenSaverPluginContainer::DrawIndicatorsL drawing new miss call %d %d", iStartX, iRectIndicators.iTl.iY );
       
   694         DoDrawIndicatorsL( aGc, iMissedCall, iMissedCallIcon, iIndicatorFont,
       
   695             iRectIndicators, indicatorSize);
       
   696         }
       
   697 
       
   698     if ( iNewMessage > 0 )
       
   699         {
       
   700         MPX_DEBUG3( "CMPXScreenSaverPluginContainer::DrawIndicatorsL drawing new message %d %d", iStartX, iRectIndicators.iTl.iY );
       
   701         DoDrawIndicatorsL( aGc, iNewMessage, iMessageIcon, iIndicatorFont,
       
   702             iRectIndicators, indicatorSize);
       
   703         }
       
   704 
       
   705     if ( iNewInstantMessage > 0 )
       
   706         {
       
   707         MPX_DEBUG3( "CMPXScreenSaverPluginContainer::DrawIndicatorsL drawing new instant message %d %d", iStartX, iRectIndicators.iTl.iY );
       
   708         DoDrawIndicatorsL( aGc, 0, iNewInstantMessageIcon, iIndicatorFont,
       
   709             iRectIndicators, indicatorSize);
       
   710         }
       
   711 
       
   712     if ( iNewEmail > 0 )
       
   713         {
       
   714         MPX_DEBUG3( "CMPXScreenSaverPluginContainer::DrawIndicatorsL drawing new email %d %d", iStartX, iRectIndicators.iTl.iY );
       
   715         DoDrawIndicatorsL( aGc, 0, iNewEmailIcon, iIndicatorFont,
       
   716             iRectIndicators, indicatorSize);
       
   717         }
       
   718 
       
   719     if ( iNewVoiceMessage > 0 )
       
   720         {
       
   721         MPX_DEBUG3( "CMPXScreenSaverPluginContainer::DrawIndicatorsL drawing new voice message %d %d", iStartX, iRectIndicators.iTl.iY );
       
   722         DoDrawIndicatorsL( aGc, 0, iNewVoiceMessageIcon,
       
   723             iIndicatorFont, iRectIndicators, indicatorSize);
       
   724         }
       
   725 
       
   726     if ( ( iProfileName ) || ( iIsSilent ) )
       
   727         {
       
   728         MPX_DEBUG3( "CMPXScreenSaverPluginContainer::DrawIndicatorsL drawing profile name %d %d", iStartX, iRectIndicators.iTl.iY );
       
   729         // clip text to fit screen
       
   730         HBufC* buf;
       
   731         if ( iProfileName )
       
   732             {
       
   733             buf = HBufC::NewLC( iProfileName->Length() +
       
   734                 KMPXDurationDisplayResvLen );
       
   735             }
       
   736         else
       
   737             {
       
   738             buf = HBufC::NewLC( KMPXDurationDisplayResvLen );
       
   739             }
       
   740         TPtr ptr( buf->Des() );
       
   741         if ( iIsSilent )
       
   742             {
       
   743             ptr.Append( KPuaCodeSilentSymbol );
       
   744             }
       
   745         if ( iProfileName )
       
   746             {
       
   747             ptr.Append( iProfileName->Des() );
       
   748             AknBidiTextUtils::ConvertToVisualAndClipL(
       
   749                 ptr,
       
   750                 *iIndicatorFont,
       
   751                 iRectIndicators.iBr.iX - iStartX,
       
   752                 iRectIndicators.iBr.iX - iStartX );
       
   753             }
       
   754         aGc.DrawText(  *buf,
       
   755             TPoint( iStartX, iRectIndicators.iTl.iY + indicatorSize.iHeight ) );
       
   756         CleanupStack::PopAndDestroy( buf );
       
   757         }
       
   758 
       
   759     aGc.DiscardFont();
       
   760     }
       
   761 
       
   762 // -----------------------------------------------------------------------------
       
   763 // CMPXScreenSaverPluginContainer::DrawIndicatorsL
       
   764 // -----------------------------------------------------------------------------
       
   765 //
       
   766 void CMPXScreenSaverPluginContainer::DoDrawIndicatorsL(
       
   767      CBitmapContext& aGc, TInt aDisplayNumber, CGulIcon* aDisplayIcon,
       
   768      CFont* aFont, TRect aRect, TSize aSize )
       
   769     {
       
   770     MPX_FUNC( "CMPXScreenSaverPluginContainer::DoDrawIndicatorsL" );
       
   771 
       
   772     if ( aDisplayNumber > 0 )
       
   773         {
       
   774         HBufC* stringBuf = HBufC::NewLC( 5 );
       
   775         stringBuf->Des().AppendNum( aDisplayNumber );
       
   776         aGc.DrawText( stringBuf->Des(),
       
   777             TPoint( iStartX, aRect.iTl.iY + aSize.iHeight ) );
       
   778         iStartX = iStartX + aFont->TextWidthInPixels( stringBuf->Des() );
       
   779         CleanupStack::PopAndDestroy( stringBuf );
       
   780         }
       
   781     aGc.BitBltMasked(
       
   782         TPoint( iStartX, aRect.iTl.iY ),
       
   783         aDisplayIcon->Bitmap(),
       
   784         TRect( aSize ),
       
   785         aDisplayIcon->Mask(),
       
   786         EFalse );
       
   787     iStartX = iStartX + aSize.iWidth;
       
   788     }
       
   789 
       
   790 // ---------------------------------------------------------------------------
       
   791 // Get layout data for an graphical indicator.
       
   792 // ---------------------------------------------------------------------------
       
   793 //
       
   794 TRect CMPXScreenSaverPluginContainer::IndicatorLayout(
       
   795     MPXScreenSaverPluginControl aControl )
       
   796     {
       
   797     MPX_FUNC( "CMPXScreenSaverPluginContainer::IndicatorLayout" );
       
   798     TInt resId = 0;
       
   799     if ( iScreenSize == TSize( 176, 208 ) )    //lowest portrait
       
   800         {
       
   801         switch ( aControl )
       
   802             {
       
   803             case MPXScreenSaverPluginIndicatorPlaybackStatus:
       
   804                 {
       
   805                 resId = R_MPX_SCREENSAVER_PB_INDI_LAYOUT_LOWRES_PORTRAIT;
       
   806                 break;
       
   807                 }
       
   808             case MPXScreenSaverPluginIndicatorOther:
       
   809                 {
       
   810                 resId = R_MPX_SCREENSAVER_INDI_LAYOUT_LOWRES_PORTRAIT;
       
   811                 break;
       
   812                 }
       
   813             default:
       
   814                 {
       
   815                 __ASSERT_ALWAYS(EFalse,
       
   816                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
   817                 break;
       
   818                 }
       
   819             }
       
   820         }
       
   821     else if ( iScreenSize == TSize( 352, 416 ) ) //double portrait
       
   822         {
       
   823         switch (aControl)
       
   824             {
       
   825             case MPXScreenSaverPluginIndicatorPlaybackStatus:
       
   826                 {
       
   827                 resId = R_MPX_SCREENSAVER_PB_INDI_LAYOUT_DOUBLE_PORTRAIT;
       
   828                 break;
       
   829                 }
       
   830             case MPXScreenSaverPluginIndicatorOther:
       
   831                 {
       
   832                 resId = R_MPX_SCREENSAVER_INDI_LAYOUT_DOUBLE_PORTRAIT;
       
   833                 break;
       
   834                 }
       
   835             default:
       
   836                 {
       
   837                 __ASSERT_ALWAYS(EFalse,
       
   838                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
   839                 break;
       
   840                 }
       
   841             }
       
   842         }
       
   843     else if ( iScreenSize == TSize( 240, 320 ) ) //QVGA portrait
       
   844         {
       
   845         switch (aControl)
       
   846             {
       
   847             case MPXScreenSaverPluginIndicatorPlaybackStatus:
       
   848                 {
       
   849                 resId = R_MPX_SCREENSAVER_PB_INDI_LAYOUT_QVGA_PORTRAIT;
       
   850                 break;
       
   851                 }
       
   852             case MPXScreenSaverPluginIndicatorOther:
       
   853                 {
       
   854                 resId = R_MPX_SCREENSAVER_INDI_LAYOUT_QVGA_PORTRAIT;
       
   855                 break;
       
   856                 }
       
   857             default:
       
   858                 {
       
   859                 __ASSERT_ALWAYS(EFalse,
       
   860                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
   861                 break;
       
   862                 }
       
   863             }
       
   864         }
       
   865     else if ( iScreenSize == TSize( 208, 176 ) )    //lowest landscape
       
   866         {
       
   867         switch ( aControl )
       
   868             {
       
   869             case MPXScreenSaverPluginIndicatorPlaybackStatus:
       
   870                 {
       
   871                 resId = R_MPX_SCREENSAVER_PB_INDI_LAYOUT_LOWRES_LANDSCAPE;
       
   872                 break;
       
   873                 }
       
   874             case MPXScreenSaverPluginIndicatorOther:
       
   875                 {
       
   876                 resId = R_MPX_SCREENSAVER_INDI_LAYOUT_LOWRES_LANDSCAPE;
       
   877                 break;
       
   878                 }
       
   879             default:
       
   880                 {
       
   881                 __ASSERT_ALWAYS(EFalse,
       
   882                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
   883                 break;
       
   884                 }
       
   885             }
       
   886         }
       
   887     else if ( iScreenSize == TSize( 416, 352 ) ) //double landscape
       
   888         {
       
   889         switch (aControl)
       
   890             {
       
   891             case MPXScreenSaverPluginIndicatorPlaybackStatus:
       
   892                 {
       
   893                 resId = R_MPX_SCREENSAVER_PB_INDI_LAYOUT_DOUBLE_LANDSCAPE;
       
   894                 break;
       
   895                 }
       
   896             case MPXScreenSaverPluginIndicatorOther:
       
   897                 {
       
   898                 resId = R_MPX_SCREENSAVER_INDI_LAYOUT_DOUBLE_LANDSCAPE;
       
   899                 break;
       
   900                 }
       
   901             default:
       
   902                 {
       
   903                 __ASSERT_ALWAYS(EFalse,
       
   904                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
   905                 break;
       
   906                 }
       
   907             }
       
   908         }
       
   909     else if ( iScreenSize == TSize( 320, 240 ) ) //QVGA landscape
       
   910         {
       
   911         switch (aControl)
       
   912             {
       
   913             case MPXScreenSaverPluginIndicatorPlaybackStatus:
       
   914                 {
       
   915                 resId = R_MPX_SCREENSAVER_PB_INDI_LAYOUT_QVGA_LANDSCAPE;
       
   916                 break;
       
   917                 }
       
   918             case MPXScreenSaverPluginIndicatorOther:
       
   919                 {
       
   920                 resId = R_MPX_SCREENSAVER_INDI_LAYOUT_QVGA_LANDSCAPE;
       
   921                 break;
       
   922                 }
       
   923             default:
       
   924                 {
       
   925                 __ASSERT_ALWAYS(EFalse,
       
   926                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
   927                 break;
       
   928                 }
       
   929             }
       
   930         }
       
   931     else if ( iScreenSize == TSize( 360, 640 ) ) // QHD portrait
       
   932         {
       
   933         switch (aControl)
       
   934             {
       
   935             case MPXScreenSaverPluginIndicatorPlaybackStatus:
       
   936                 {
       
   937                 resId = R_MPX_SCREENSAVER_PB_INDI_LAYOUT_QHD_PORTRAIT;
       
   938                 break;
       
   939                 }
       
   940             case MPXScreenSaverPluginIndicatorOther:
       
   941                 {
       
   942                 resId = R_MPX_SCREENSAVER_INDI_LAYOUT_QHD_PORTRAIT;
       
   943                 break;
       
   944                 }
       
   945             default:
       
   946                 {
       
   947                 __ASSERT_ALWAYS(EFalse,
       
   948                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
   949                 break;
       
   950                 }
       
   951             }
       
   952         }
       
   953     else if ( iScreenSize == TSize( 640, 360 ) ) // QHD landscape
       
   954         {
       
   955         switch (aControl)
       
   956             {
       
   957             case MPXScreenSaverPluginIndicatorPlaybackStatus:
       
   958                 {
       
   959                 resId = R_MPX_SCREENSAVER_PB_INDI_LAYOUT_QHD_LANDSCAPE;
       
   960                 break;
       
   961                 }
       
   962             case MPXScreenSaverPluginIndicatorOther:
       
   963                 {
       
   964                 resId = R_MPX_SCREENSAVER_INDI_LAYOUT_QHD_LANDSCAPE;
       
   965                 break;
       
   966                 }
       
   967             default:
       
   968                 {
       
   969                 __ASSERT_ALWAYS(EFalse,
       
   970                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
   971                 break;
       
   972                 }
       
   973             }
       
   974         }
       
   975     else if ( iScreenSize == TSize( 480, 640 ) ) // VGA portrait
       
   976         {
       
   977         switch (aControl)
       
   978             {
       
   979             case MPXScreenSaverPluginIndicatorPlaybackStatus:
       
   980                 {
       
   981                 resId = R_MPX_SCREENSAVER_PB_INDI_LAYOUT_VGA_PORTRAIT;
       
   982                 break;
       
   983                 }
       
   984             case MPXScreenSaverPluginIndicatorOther:
       
   985                 {
       
   986                 resId = R_MPX_SCREENSAVER_INDI_LAYOUT_VGA_PORTRAIT;
       
   987                 break;
       
   988                 }
       
   989             default:
       
   990                 {
       
   991                 __ASSERT_ALWAYS(EFalse,
       
   992                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
   993                 break;
       
   994                 }
       
   995             }
       
   996         }
       
   997     else if ( iScreenSize == TSize( 640, 480 ) ) // VGA landscape
       
   998         {
       
   999         switch (aControl)
       
  1000             {
       
  1001             case MPXScreenSaverPluginIndicatorPlaybackStatus:
       
  1002                 {
       
  1003                 resId = R_MPX_SCREENSAVER_PB_INDI_LAYOUT_VGA_LANDSCAPE;
       
  1004                 break;
       
  1005                 }
       
  1006             case MPXScreenSaverPluginIndicatorOther:
       
  1007                 {
       
  1008                 resId = R_MPX_SCREENSAVER_INDI_LAYOUT_VGA_LANDSCAPE;
       
  1009                 break;
       
  1010                 }
       
  1011             default:
       
  1012                 {
       
  1013                 __ASSERT_ALWAYS(EFalse,
       
  1014                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
  1015                 break;
       
  1016                 }
       
  1017             }
       
  1018         }
       
  1019 	else
       
  1020         {
       
  1021         User::Panic( KMXPanicCategory, KErrNotSupported );
       
  1022         }
       
  1023     TAknLayoutRect res;
       
  1024     res.LayoutRect( TRect( TPoint( 0, 0),
       
  1025         TPoint( iOffScreenBitmap->SizeInPixels().iWidth,
       
  1026         iOffScreenBitmap->SizeInPixels().iHeight) ), resId );
       
  1027     return res.Rect();
       
  1028     }
       
  1029 
       
  1030 // ---------------------------------------------------------------------------
       
  1031 // Get layout data for an graphical indicator.
       
  1032 // ---------------------------------------------------------------------------
       
  1033 //
       
  1034 void CMPXScreenSaverPluginContainer::LabelLayoutL(
       
  1035     MPXScreenSaverPluginControl aControl )
       
  1036     {
       
  1037     MPX_FUNC( "CMPXScreenSaverPluginContainer::LabelLayoutL" );
       
  1038     TInt resId = 0;
       
  1039     CEikLabel* label = NULL;
       
  1040     if ( iScreenSize == TSize( 176, 208 ) )    //lowest portrait
       
  1041         {
       
  1042         switch ( aControl )
       
  1043             {
       
  1044             case MPXScreenSaverPluginLabelTitle:
       
  1045                 {
       
  1046                 resId = R_MPX_SCREENSAVER_TITLE_LAYOUT_LOWRES_PORTRAIT;
       
  1047                 label = iTitleLabel;
       
  1048                 break;
       
  1049                 }
       
  1050             case MPXScreenSaverPluginLabelClock:
       
  1051                 {
       
  1052                 TLanguage uiLanguage = User::Language();
       
  1053                 if( uiLanguage == ELangArabic ||
       
  1054                     uiLanguage == ELangUrdu ||
       
  1055                     uiLanguage == ELangFarsi )
       
  1056                     {
       
  1057                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_LOWRES_PORTRAIT_ARABIC;
       
  1058                     }
       
  1059                 else
       
  1060                     {
       
  1061                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_LOWRES_PORTRAIT;
       
  1062                     }
       
  1063                 label = iClockLabel;
       
  1064                 break;
       
  1065                 }
       
  1066             case MPXScreenSaverPluginLabelAmPm:
       
  1067                 {
       
  1068                 resId = R_MPX_SCREENSAVER_AMPM_LAYOUT_LOWRES_PORTRAIT;
       
  1069                 label = iAmPmLabel;
       
  1070                 break;
       
  1071                 }
       
  1072             default:
       
  1073                 {
       
  1074                 __ASSERT_ALWAYS(EFalse,
       
  1075                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
  1076                 break;
       
  1077                 }
       
  1078             }
       
  1079         }
       
  1080     else if ( iScreenSize == TSize( 352, 416 ) ) //double portrait
       
  1081         {
       
  1082         switch (aControl)
       
  1083             {
       
  1084             case MPXScreenSaverPluginLabelTitle:
       
  1085                 {
       
  1086                 resId = R_MPX_SCREENSAVER_TITLE_LAYOUT_DOUBLE_PORTRAIT;
       
  1087                 label = iTitleLabel;
       
  1088                 break;
       
  1089                 }
       
  1090             case MPXScreenSaverPluginLabelClock:
       
  1091                 {
       
  1092                 TLanguage uiLanguage = User::Language();
       
  1093                 if( uiLanguage == ELangArabic ||
       
  1094                     uiLanguage == ELangUrdu ||
       
  1095                     uiLanguage == ELangFarsi )
       
  1096                     {
       
  1097                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_DOUBLE_PORTRAIT_ARABIC;
       
  1098                     }
       
  1099                 else
       
  1100                     {
       
  1101                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_DOUBLE_PORTRAIT;
       
  1102                     }
       
  1103 
       
  1104                 label = iClockLabel;
       
  1105                 break;
       
  1106                 }
       
  1107             case MPXScreenSaverPluginLabelAmPm:
       
  1108                 {
       
  1109                 resId = R_MPX_SCREENSAVER_AMPM_LAYOUT_DOUBLE_PORTRAIT;
       
  1110                 label = iAmPmLabel;
       
  1111                 break;
       
  1112                 }
       
  1113             default:
       
  1114                 {
       
  1115                 __ASSERT_ALWAYS(EFalse,
       
  1116                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
  1117                 break;
       
  1118                 }
       
  1119             }
       
  1120         }
       
  1121     else if ( iScreenSize == TSize( 240, 320 ) ) //QVGA portrait
       
  1122         {
       
  1123         switch (aControl)
       
  1124             {
       
  1125             case MPXScreenSaverPluginLabelTitle:
       
  1126                 {
       
  1127                 resId = R_MPX_SCREENSAVER_TITLE_LAYOUT_QVGA_PORTRAIT;
       
  1128                 label = iTitleLabel;
       
  1129                 break;
       
  1130                 }
       
  1131             case MPXScreenSaverPluginLabelClock:
       
  1132                 {
       
  1133                 TLanguage uiLanguage = User::Language();
       
  1134                 if( uiLanguage == ELangArabic ||
       
  1135                     uiLanguage == ELangUrdu ||
       
  1136                     uiLanguage == ELangFarsi )
       
  1137                     {
       
  1138                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_QVGA_PORTRAIT_ARABIC;
       
  1139                     }
       
  1140                 else
       
  1141                     {
       
  1142                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_QVGA_PORTRAIT;
       
  1143                     }
       
  1144                 label = iClockLabel;
       
  1145                 break;
       
  1146                 }
       
  1147             case MPXScreenSaverPluginLabelAmPm:
       
  1148                 {
       
  1149                 resId = R_MPX_SCREENSAVER_AMPM_LAYOUT_QVGA_PORTRAIT;
       
  1150                 label = iAmPmLabel;
       
  1151                 break;
       
  1152                 }
       
  1153             default:
       
  1154                 {
       
  1155                 __ASSERT_ALWAYS(EFalse,
       
  1156                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
  1157                 break;
       
  1158                 }
       
  1159             }
       
  1160         }
       
  1161     else if ( iScreenSize == TSize( 208, 176 ) )    //lowest landscape
       
  1162         {
       
  1163         switch ( aControl )
       
  1164             {
       
  1165             case MPXScreenSaverPluginLabelTitle:
       
  1166                 {
       
  1167                 resId = R_MPX_SCREENSAVER_TITLE_LAYOUT_LOWRES_LANDSCAPE;
       
  1168                 label = iTitleLabel;
       
  1169                 break;
       
  1170                 }
       
  1171             case MPXScreenSaverPluginLabelClock:
       
  1172                 {
       
  1173                 TLanguage uiLanguage = User::Language();
       
  1174                 if( uiLanguage == ELangArabic ||
       
  1175                     uiLanguage == ELangUrdu ||
       
  1176                     uiLanguage == ELangFarsi )
       
  1177                     {
       
  1178                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_LOWRES_LANDSCAPE_ARABIC;
       
  1179                     }
       
  1180                 else
       
  1181                     {
       
  1182                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_LOWRES_LANDSCAPE;
       
  1183                     }
       
  1184 
       
  1185                 label = iClockLabel;
       
  1186                 break;
       
  1187                 }
       
  1188             case MPXScreenSaverPluginLabelAmPm:
       
  1189                 {
       
  1190                 resId = R_MPX_SCREENSAVER_AMPM_LAYOUT_LOWRES_LANDSCAPE;
       
  1191                 label = iAmPmLabel;
       
  1192                 break;
       
  1193                 }
       
  1194             default:
       
  1195                 {
       
  1196                 __ASSERT_ALWAYS(EFalse,
       
  1197                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
  1198                 break;
       
  1199                 }
       
  1200             }
       
  1201         }
       
  1202     else if ( iScreenSize == TSize( 416, 352 ) ) //double landscape
       
  1203         {
       
  1204         switch (aControl)
       
  1205             {
       
  1206             case MPXScreenSaverPluginLabelTitle:
       
  1207                 {
       
  1208                 resId = R_MPX_SCREENSAVER_TITLE_LAYOUT_DOUBLE_LANDSCAPE;
       
  1209                 label = iTitleLabel;
       
  1210                 break;
       
  1211                 }
       
  1212             case MPXScreenSaverPluginLabelClock:
       
  1213                 {
       
  1214                 TLanguage uiLanguage = User::Language();
       
  1215                 if( uiLanguage == ELangArabic ||
       
  1216                     uiLanguage == ELangUrdu ||
       
  1217                     uiLanguage == ELangFarsi )
       
  1218                     {
       
  1219                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_DOUBLE_LANDSCAPE_ARABIC;
       
  1220                     }
       
  1221                 else
       
  1222                     {
       
  1223                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_DOUBLE_LANDSCAPE;
       
  1224                     }
       
  1225                 label = iClockLabel;
       
  1226                 break;
       
  1227                 }
       
  1228             case MPXScreenSaverPluginLabelAmPm:
       
  1229                 {
       
  1230                 resId = R_MPX_SCREENSAVER_AMPM_LAYOUT_DOUBLE_LANDSCAPE;
       
  1231                 label = iAmPmLabel;
       
  1232                 break;
       
  1233                 }
       
  1234             default:
       
  1235                 {
       
  1236                 __ASSERT_ALWAYS(EFalse,
       
  1237                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
  1238                 break;
       
  1239                 }
       
  1240             }
       
  1241         }
       
  1242     else if ( iScreenSize == TSize( 320, 240 ) ) //QVGA landscape
       
  1243         {
       
  1244         switch (aControl)
       
  1245             {
       
  1246             case MPXScreenSaverPluginLabelTitle:
       
  1247                 {
       
  1248                 resId = R_MPX_SCREENSAVER_TITLE_LAYOUT_QVGA_LANDSCAPE;
       
  1249                 label = iTitleLabel;
       
  1250                 break;
       
  1251                 }
       
  1252             case MPXScreenSaverPluginLabelClock:
       
  1253                 {
       
  1254                 TLanguage uiLanguage = User::Language();
       
  1255                 if( uiLanguage == ELangArabic ||
       
  1256                     uiLanguage == ELangUrdu ||
       
  1257                     uiLanguage == ELangFarsi )
       
  1258                     {
       
  1259                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_QVGA_LANDSCAPE_ARABIC;
       
  1260                     }
       
  1261                 else
       
  1262                     {
       
  1263                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_QVGA_LANDSCAPE;
       
  1264                     }
       
  1265 
       
  1266                 label = iClockLabel;
       
  1267                 break;
       
  1268                 }
       
  1269             case MPXScreenSaverPluginLabelAmPm:
       
  1270                 {
       
  1271                 resId = R_MPX_SCREENSAVER_AMPM_LAYOUT_QVGA_LANDSCAPE;
       
  1272                 label = iAmPmLabel;
       
  1273                 break;
       
  1274                 }
       
  1275             default:
       
  1276                 {
       
  1277                 __ASSERT_ALWAYS(EFalse,
       
  1278                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
  1279                 break;
       
  1280                 }
       
  1281             }
       
  1282         }
       
  1283     else if ( iScreenSize == TSize( 360, 640 ) ) // QHD portrait
       
  1284         {
       
  1285         switch (aControl)
       
  1286             {
       
  1287             case MPXScreenSaverPluginLabelTitle:
       
  1288                 {
       
  1289                 resId = R_MPX_SCREENSAVER_TITLE_LAYOUT_QHD_PORTRAIT;
       
  1290                 label = iTitleLabel;
       
  1291                 break;
       
  1292                 }
       
  1293             case MPXScreenSaverPluginLabelClock:
       
  1294                 {
       
  1295                 TLanguage uiLanguage = User::Language();
       
  1296                 if( uiLanguage == ELangArabic ||
       
  1297                     uiLanguage == ELangUrdu ||
       
  1298                     uiLanguage == ELangFarsi )
       
  1299                     {
       
  1300                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_QHD_PORTRAIT_ARABIC;
       
  1301                     }
       
  1302                 else
       
  1303                     {
       
  1304                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_QHD_PORTRAIT;
       
  1305                     }
       
  1306 
       
  1307                 label = iClockLabel;
       
  1308                 break;
       
  1309                 }
       
  1310             case MPXScreenSaverPluginLabelAmPm:
       
  1311                 {
       
  1312                 resId = R_MPX_SCREENSAVER_AMPM_LAYOUT_QHD_PORTRAIT;
       
  1313                 label = iAmPmLabel;
       
  1314                 break;
       
  1315                 }
       
  1316             default:
       
  1317                 {
       
  1318                 __ASSERT_ALWAYS(EFalse,
       
  1319                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
  1320                 break;
       
  1321                 }
       
  1322             }
       
  1323         }
       
  1324     else if ( iScreenSize == TSize( 640, 360 ) ) // QHD landscape
       
  1325         {
       
  1326         switch (aControl)
       
  1327             {
       
  1328             case MPXScreenSaverPluginLabelTitle:
       
  1329                 {
       
  1330                 resId = R_MPX_SCREENSAVER_TITLE_LAYOUT_QHD_LANDSCAPE;
       
  1331                 label = iTitleLabel;
       
  1332                 break;
       
  1333                 }
       
  1334             case MPXScreenSaverPluginLabelClock:
       
  1335                 {
       
  1336                 TLanguage uiLanguage = User::Language();
       
  1337                 if( uiLanguage == ELangArabic ||
       
  1338                     uiLanguage == ELangUrdu ||
       
  1339                     uiLanguage == ELangFarsi )
       
  1340                     {
       
  1341                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_QHD_LANDSCAPE_ARABIC;
       
  1342                     }
       
  1343                 else
       
  1344                     {
       
  1345                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_QHD_LANDSCAPE;
       
  1346                     }
       
  1347 
       
  1348                 label = iClockLabel;
       
  1349                 break;
       
  1350                 }
       
  1351             case MPXScreenSaverPluginLabelAmPm:
       
  1352                 {
       
  1353                 resId = R_MPX_SCREENSAVER_AMPM_LAYOUT_QHD_LANDSCAPE;
       
  1354                 label = iAmPmLabel;
       
  1355                 break;
       
  1356                 }
       
  1357             default:
       
  1358                 {
       
  1359                 __ASSERT_ALWAYS(EFalse,
       
  1360                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
  1361                 break;
       
  1362                 }
       
  1363             }
       
  1364         }
       
  1365     else if ( iScreenSize == TSize( 480, 640 ) ) // VGA portrait
       
  1366         {
       
  1367         switch (aControl)
       
  1368             {
       
  1369             case MPXScreenSaverPluginLabelTitle:
       
  1370                 {
       
  1371                 resId = R_MPX_SCREENSAVER_TITLE_LAYOUT_VGA_PORTRAIT;
       
  1372                 label = iTitleLabel;
       
  1373                 break;
       
  1374                 }
       
  1375             case MPXScreenSaverPluginLabelClock:
       
  1376                 {
       
  1377                 TLanguage uiLanguage = User::Language();
       
  1378                 if( uiLanguage == ELangArabic ||
       
  1379                     uiLanguage == ELangUrdu ||
       
  1380                     uiLanguage == ELangFarsi )
       
  1381                     {
       
  1382                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_VGA_PORTRAIT_ARABIC;
       
  1383                     }
       
  1384                 else
       
  1385                     {
       
  1386                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_VGA_PORTRAIT;
       
  1387                     }
       
  1388 
       
  1389                 label = iClockLabel;
       
  1390                 break;
       
  1391                 }
       
  1392             case MPXScreenSaverPluginLabelAmPm:
       
  1393                 {
       
  1394                 resId = R_MPX_SCREENSAVER_AMPM_LAYOUT_VGA_PORTRAIT;
       
  1395                 label = iAmPmLabel;
       
  1396                 break;
       
  1397                 }
       
  1398             default:
       
  1399                 {
       
  1400                 __ASSERT_ALWAYS(EFalse,
       
  1401                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
  1402                 break;
       
  1403                 }
       
  1404             }
       
  1405         }
       
  1406     else if ( iScreenSize == TSize( 640, 480 ) ) // VGA landscape
       
  1407         {
       
  1408         switch (aControl)
       
  1409             {
       
  1410             case MPXScreenSaverPluginLabelTitle:
       
  1411                 {
       
  1412                 resId = R_MPX_SCREENSAVER_TITLE_LAYOUT_VGA_LANDSCAPE;
       
  1413                 label = iTitleLabel;
       
  1414                 break;
       
  1415                 }
       
  1416             case MPXScreenSaverPluginLabelClock:
       
  1417                 {
       
  1418                 TLanguage uiLanguage = User::Language();
       
  1419                 if( uiLanguage == ELangArabic ||
       
  1420                     uiLanguage == ELangUrdu ||
       
  1421                     uiLanguage == ELangFarsi )
       
  1422                     {
       
  1423                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_VGA_LANDSCAPE_ARABIC;
       
  1424                     }
       
  1425                 else
       
  1426                     {
       
  1427                     resId = R_MPX_SCREENSAVER_CLOCK_LAYOUT_VGA_LANDSCAPE;
       
  1428                     }
       
  1429 
       
  1430                 label = iClockLabel;
       
  1431                 break;
       
  1432                 }
       
  1433             case MPXScreenSaverPluginLabelAmPm:
       
  1434                 {
       
  1435                 resId = R_MPX_SCREENSAVER_AMPM_LAYOUT_VGA_LANDSCAPE;
       
  1436                 label = iAmPmLabel;
       
  1437                 break;
       
  1438                 }
       
  1439             default:
       
  1440                 {
       
  1441                 __ASSERT_ALWAYS(EFalse,
       
  1442                     User::Panic( KMXPanicCategory, KErrArgument ) );
       
  1443                 break;
       
  1444                 }
       
  1445             }
       
  1446         }
       
  1447 	else
       
  1448         {
       
  1449         User::Panic( KMXPanicCategory, KErrNotSupported );
       
  1450         }
       
  1451     TResourceReader reader;
       
  1452     CCoeEnv::Static()->CreateResourceReaderLC( reader, resId );
       
  1453 
       
  1454     // Read the layout from resource file
       
  1455     TAknTextComponentLayout textLayout;
       
  1456     textLayout.SetFont( reader.ReadInt16() );
       
  1457     textLayout.SetC( reader.ReadInt16() );
       
  1458     textLayout.Setl( reader.ReadInt16() );
       
  1459     textLayout.Setr( reader.ReadInt16() );
       
  1460     textLayout.Setb( reader.ReadInt16() );
       
  1461     textLayout.SetW( reader.ReadInt16() );
       
  1462     textLayout.SetJ( reader.ReadInt16() );
       
  1463     CleanupStack::PopAndDestroy();  // reader
       
  1464 
       
  1465     AknLayoutUtils::LayoutLabel(
       
  1466         label, TRect( TPoint( 0, 0),
       
  1467         TPoint( iOffScreenBitmap->SizeInPixels().iWidth,
       
  1468         iOffScreenBitmap->SizeInPixels().iHeight) ),
       
  1469         textLayout.LayoutLine() );
       
  1470     }
       
  1471 
       
  1472 // ---------------------------------------------------------------------------
       
  1473 // Get drawable background height.
       
  1474 // ---------------------------------------------------------------------------
       
  1475 //
       
  1476 TInt CMPXScreenSaverPluginContainer::BackgroundHeightL()
       
  1477     {
       
  1478     MPX_FUNC( "CMPXScreenSaverPluginContainer::BackgroundHeightL" );
       
  1479     TInt resId = 0;
       
  1480     if ( iScreenSize == TSize( 176, 208 ) )    //lowest portrait
       
  1481         {
       
  1482         resId = R_MPX_SCREENSAVER_BACKGROUND_HEIGHT_LOWRES_PORTRAIT;
       
  1483         }
       
  1484     else if ( iScreenSize == TSize( 352, 416 ) ) //double portrait
       
  1485         {
       
  1486         resId = R_MPX_SCREENSAVER_BACKGROUND_HEIGHT_DOUBLE_PORTRAIT;
       
  1487         }
       
  1488     else if ( iScreenSize == TSize( 240, 320 ) ) //QVGA portrait
       
  1489         {
       
  1490         resId = R_MPX_SCREENSAVER_BACKGROUND_HEIGHT_QVGA_PORTRAIT;
       
  1491         }
       
  1492     else if ( iScreenSize == TSize( 208, 176 ) )    //lowest landscape
       
  1493         {
       
  1494         resId = R_MPX_SCREENSAVER_BACKGROUND_HEIGHT_LOWRES_LANDSCAPE;
       
  1495         }
       
  1496     else if ( iScreenSize == TSize( 416, 352 ) ) //double landscape
       
  1497         {
       
  1498         resId = R_MPX_SCREENSAVER_BACKGROUND_HEIGHT_DOUBLE_LANDSCAPE;
       
  1499         }
       
  1500     else if ( iScreenSize == TSize( 320,240 ) ) // QVGA landscape
       
  1501         {
       
  1502         resId = R_MPX_SCREENSAVER_BACKGROUND_HEIGHT_QVGA_LANDSCAPE;
       
  1503         }
       
  1504     else if ( iScreenSize == TSize( 360, 640 ) ) // QHD
       
  1505         {
       
  1506         resId = R_MPX_SCREENSAVER_BACKGROUND_HEIGHT_QHD_PORTRAIT;
       
  1507         }
       
  1508     else if ( iScreenSize == TSize( 640, 360 ) ) // QHD
       
  1509         {
       
  1510         resId = R_MPX_SCREENSAVER_BACKGROUND_HEIGHT_QHD_LANDSCAPE;
       
  1511         }
       
  1512     else if ( iScreenSize == TSize( 480, 640 ) ) // VGA portrait
       
  1513         {
       
  1514         resId = R_MPX_SCREENSAVER_BACKGROUND_HEIGHT_QHD_PORTRAIT;
       
  1515         }
       
  1516     else if ( iScreenSize == TSize( 640, 480 ) ) // VGA landscape
       
  1517         {
       
  1518         resId = R_MPX_SCREENSAVER_BACKGROUND_HEIGHT_QHD_LANDSCAPE;
       
  1519         }
       
  1520 	else
       
  1521         {
       
  1522         User::Panic( KMXPanicCategory, KErrNotSupported );
       
  1523         }
       
  1524     TResourceReader reader;
       
  1525     CCoeEnv::Static()->CreateResourceReaderLC( reader, resId );
       
  1526     TInt res = reader.ReadInt16();
       
  1527     MPX_DEBUG2( "CMPXScreenSaverPluginContainer::BackgroundHeightL %d", res );
       
  1528     CleanupStack::PopAndDestroy();  // reader
       
  1529     return res;
       
  1530     }
       
  1531 
       
  1532 // ---------------------------------------------------------------------------
       
  1533 // Get draw position and background color index, draw position is stored
       
  1534 // in member variable iStartY
       
  1535 // ---------------------------------------------------------------------------
       
  1536 //
       
  1537 TInt CMPXScreenSaverPluginContainer::GetDrawPositionAndColorIndexL()
       
  1538     {
       
  1539     MPX_FUNC( "CMPXScreenSaverPluginContainer::GetDrawPositionAndColorIndexL" );
       
  1540     TTime time;
       
  1541     time.HomeTime();
       
  1542 
       
  1543     TInt colorIndex = 0;
       
  1544     TInt64 currentTime = time.Int64();
       
  1545     colorIndex = currentTime / 10000000; // not a typo, to get it to the closest 10 seconds
       
  1546     colorIndex = colorIndex % KMPXNumBackgrounds;
       
  1547 
       
  1548     TReal yReal = Math::FRand( currentTime );
       
  1549     TInt randomRangeY = iScreenSize.iHeight - BackgroundHeightL();
       
  1550     iStartY = ( TInt( yReal * randomRangeY ) );
       
  1551 
       
  1552     MPX_DEBUG3( "CMPXScreenSaverPluginContainer::GetDrawPositionAndColorIndexL index = %d, height = %d", colorIndex, iStartY );
       
  1553 
       
  1554     return colorIndex;
       
  1555     }
       
  1556 
       
  1557 // ---------------------------------------------------------------------------
       
  1558 // Resizes all the icons and rects to match current screen size
       
  1559 // ---------------------------------------------------------------------------
       
  1560 //
       
  1561 void CMPXScreenSaverPluginContainer::UpdateLayoutL()
       
  1562     {
       
  1563     MPX_FUNC( "CMPXScreenSaverPluginContainer::UpdateLayoutL" );
       
  1564 
       
  1565     iRectIndicators = IndicatorLayout( MPXScreenSaverPluginIndicatorOther );
       
  1566     AknIconUtils::SetSize( iKeyguardIcon->Bitmap(),
       
  1567         TSize( iRectIndicators.Height(), iRectIndicators.Height() ),
       
  1568         EAspectRatioNotPreserved );
       
  1569     AknIconUtils::SetSize( iMissedCallIcon->Bitmap(),
       
  1570         TSize( iRectIndicators.Height(), iRectIndicators.Height() ),
       
  1571         EAspectRatioNotPreserved );
       
  1572     AknIconUtils::SetSize( iMessageIcon->Bitmap(),
       
  1573         TSize( iRectIndicators.Height(), iRectIndicators.Height() ),
       
  1574         EAspectRatioNotPreserved );
       
  1575     AknIconUtils::SetSize( iNewInstantMessageIcon->Bitmap(),
       
  1576         TSize( iRectIndicators.Height(), iRectIndicators.Height() ),
       
  1577         EAspectRatioNotPreserved );
       
  1578     AknIconUtils::SetSize( iNewVoiceMessageIcon->Bitmap(),
       
  1579         TSize( iRectIndicators.Height(), iRectIndicators.Height() ),
       
  1580         EAspectRatioNotPreserved );
       
  1581     AknIconUtils::SetSize( iNewEmailIcon->Bitmap(),
       
  1582         TSize( iRectIndicators.Height(), iRectIndicators.Height() ),
       
  1583         EAspectRatioNotPreserved );
       
  1584 
       
  1585     iRectPlaybackStatus =
       
  1586         IndicatorLayout( MPXScreenSaverPluginIndicatorPlaybackStatus );
       
  1587     AknIconUtils::SetSize( iPlayIcon->Bitmap(), iRectPlaybackStatus.Size(),
       
  1588         EAspectRatioNotPreserved );
       
  1589     AknIconUtils::SetSize( iPauseIcon->Bitmap(), iRectPlaybackStatus.Size(),
       
  1590         EAspectRatioNotPreserved );
       
  1591 
       
  1592     LabelLayoutL( MPXScreenSaverPluginLabelTitle );
       
  1593     LabelLayoutL( MPXScreenSaverPluginLabelClock );
       
  1594     LabelLayoutL( MPXScreenSaverPluginLabelAmPm );
       
  1595     }
       
  1596 
       
  1597 
       
  1598 // End Of file.
       
  1599