calendarui/views/src/calenweeklistboxdata.cpp
changeset 0 f979ecb2b13e
child 60 96907930389d
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2002 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:   Drawing WeekView Listbox data.
       
    15  *                Event bar and Event icon, event indicator
       
    16  *
       
    17 */
       
    18 
       
    19 
       
    20 //debug
       
    21 #include "calendarui_debug.h"
       
    22 #include "calenweeklistboxdata.h"
       
    23 #include "calendrawutils.h"
       
    24 #include "calenweekdata.h"
       
    25 #include "calendar.hrh"
       
    26 
       
    27 #include <Calendar.rsg>
       
    28 #include <AknBidiTextUtils.h>
       
    29 #include <AknsDrawUtils.h>
       
    30 #include <AknsEffectAnim.h>
       
    31 #include <AknUtils.h>
       
    32 #include <barsread.h>
       
    33 #include <eikenv.h>
       
    34 #include <gulicon.h>
       
    35 #include <gulutil.h>
       
    36 #include <aknlayoutscalable_apps.cdl.h>
       
    37 #include <aknlayoutscalable_avkon.cdl.h>
       
    38 #include <eikenv.h>
       
    39 
       
    40 //  LOCAL CONSTANTS AND MACROS
       
    41 
       
    42 const TInt KStartColorForPattern = 8716481;
       
    43 const TInt KEndColorForPattern = 16777215;
       
    44 const TInt KPatternBrushWidth = 7;
       
    45 // ================= MEMBER FUNCTIONS =======================
       
    46 
       
    47 // Destructor
       
    48 CCalenWeekLBData::~CCalenWeekLBData()
       
    49     {
       
    50     TRACE_ENTRY_POINT;
       
    51     if(iGradientBitmap)
       
    52         {
       
    53         delete iGradientBitmap;
       
    54         iGradientBitmap = NULL;
       
    55         }
       
    56     TRACE_EXIT_POINT;
       
    57     }
       
    58 
       
    59 // Two-phased constructor.
       
    60 CCalenWeekLBData* CCalenWeekLBData::NewL()
       
    61     {
       
    62     TRACE_ENTRY_POINT;
       
    63     
       
    64     CCalenWeekLBData* self = new(ELeave) CCalenWeekLBData();
       
    65     // Construct list animation by default
       
    66     self->ConstructLD( KAknsIIDQsnAnimList );
       
    67     
       
    68 
       
    69     TRACE_EXIT_POINT;
       
    70     return self;
       
    71     }
       
    72 
       
    73 // ----------------------------------------------------
       
    74 // CCalenWeekLBData::CurrentSubCellPos
       
    75 // (other items were commented in a header).
       
    76 // ----------------------------------------------------
       
    77 //
       
    78 void CCalenWeekLBData::CurrentSubCellPos(TRect& aCurrentSubCellRect, const TPoint& aCurrentItemPos)
       
    79     {
       
    80     TRACE_ENTRY_POINT;
       
    81     
       
    82     aCurrentSubCellRect.SetRect( SubCellPosition(iHilightedSubCell + 1),
       
    83                                  SubCellSize(iHilightedSubCell + 1) );
       
    84     aCurrentSubCellRect.Move( aCurrentItemPos );
       
    85     
       
    86     TRACE_EXIT_POINT;
       
    87     }
       
    88 
       
    89 // ----------------------------------------------------
       
    90 // CCalenWeekLBData::SetHilightedSubCell
       
    91 // Set hilighted sub cell. But it does not redraw.
       
    92 // (other items were commented in a header).
       
    93 // ----------------------------------------------------
       
    94 //
       
    95 void CCalenWeekLBData::SetHilightedSubCell(TInt aHilightedSubCell)
       
    96     {
       
    97     TRACE_ENTRY_POINT;
       
    98     
       
    99     iHilightedSubCell = aHilightedSubCell;
       
   100     
       
   101     TRACE_EXIT_POINT;
       
   102     }
       
   103 
       
   104 // ----------------------------------------------------
       
   105 // CCalenWeekLBData::HilightedSubCell
       
   106 // Return hilighted subcell index
       
   107 // (other items were commented in a header).
       
   108 // ----------------------------------------------------
       
   109 //
       
   110 TInt CCalenWeekLBData::HilightedSubCell()
       
   111     {
       
   112     TRACE_ENTRY_POINT;
       
   113     
       
   114     TRACE_EXIT_POINT;
       
   115     return iHilightedSubCell;
       
   116     }
       
   117 
       
   118 // ----------------------------------------------------
       
   119 // CCalenWeekLBData::SetCellCount
       
   120 // Set cell count. because "LastSubCell" is private function.
       
   121 // (other items were commented in a header).
       
   122 // ----------------------------------------------------
       
   123 //
       
   124 void CCalenWeekLBData::SetCelCount(TInt aCount)   // Setting cell count
       
   125     {
       
   126     TRACE_ENTRY_POINT;
       
   127     
       
   128     iCellCount = aCount;
       
   129     
       
   130     TRACE_EXIT_POINT;
       
   131     }
       
   132     
       
   133 // ----------------------------------------------------
       
   134 // CCalenWeekLBData::SetVariantIndex
       
   135 // (other items were commented in a header).
       
   136 // ----------------------------------------------------
       
   137 //
       
   138 void CCalenWeekLBData::SetVariantIndex(TInt aLayout) 
       
   139     {
       
   140     TRACE_ENTRY_POINT;
       
   141     
       
   142     iLayoutVariant = aLayout;
       
   143     
       
   144     TRACE_EXIT_POINT;
       
   145     }
       
   146 
       
   147 // ----------------------------------------------------
       
   148 // CCalenWeekLBData::SetCellCount
       
   149 // Rreturn Cell count
       
   150 // (other items were commented in a header).
       
   151 // ----------------------------------------------------
       
   152 //
       
   153 TInt CCalenWeekLBData::CellCount() const
       
   154     {
       
   155     TRACE_ENTRY_POINT;
       
   156     
       
   157     TRACE_EXIT_POINT;
       
   158     return iCellCount;
       
   159     }
       
   160 
       
   161 // ----------------------------------------------------
       
   162 // CCalenWeekLBData::Draw
       
   163 // Drawing item data and highlight
       
   164 // (other items were commented in a header).
       
   165 // ----------------------------------------------------
       
   166 //
       
   167 void CCalenWeekLBData::Draw(TListItemProperties aProperties,// Item property
       
   168                             CWindowGc& aGc,                 // Graphics context
       
   169                             const TDesC* aText,             // Drawing item text
       
   170                             const TRect& aRect,             // Item rectangle
       
   171                             TBool aHighlight,               // ETrue: hilighted
       
   172                             const TColors& aColors) const   // Item color
       
   173     {
       
   174     TRACE_ENTRY_POINT;
       
   175     
       
   176     const TRect& aItemRect = aRect;
       
   177 
       
   178     // LAF code for highlight drawing. 
       
   179     // FIXME: dead code, can be removed?
       
   180     TRect subCellRect(SubCellPosition(iHilightedSubCell + 1), SubCellSize(iHilightedSubCell + 1));
       
   181     subCellRect.Move(aRect.iTl);
       
   182 
       
   183     // Draw the actual items.
       
   184     DrawFormatted(aProperties, aGc, aText, aItemRect, aColors, aHighlight);
       
   185 
       
   186     aGc.Reset();
       
   187     
       
   188     TRACE_EXIT_POINT;
       
   189     }
       
   190 
       
   191 // -----------------------------------------------------------------------------
       
   192 // Constructor
       
   193 // ?implementation_description
       
   194 // (other items were commented in a header).
       
   195 // -----------------------------------------------------------------------------
       
   196 //
       
   197 CCalenWeekLBData::CCalenWeekLBData()
       
   198     {
       
   199     TRACE_ENTRY_POINT;
       
   200     
       
   201     TRAP_IGNORE(InitialisePatternL());
       
   202 
       
   203     TRACE_EXIT_POINT;
       
   204     }
       
   205 
       
   206 // ----------------------------------------------------
       
   207 // CCalenWeekLBData::DrawFormatted
       
   208 // Drawing item
       
   209 // (other items were commented in a header).
       
   210 // ----------------------------------------------------
       
   211 //
       
   212 void CCalenWeekLBData::DrawFormatted( TListItemProperties aProperties,   // Item property
       
   213                                       CWindowGc& aGc,                    // Graphics context
       
   214                                       const TDesC* aText,                // Drawing item text
       
   215                                       const TRect& aItemRect,            // Item rectangle
       
   216                                       const TColors& aColors,            // Item colors
       
   217                                       TBool aHighlight ) const
       
   218     {
       
   219     TRACE_ENTRY_POINT;
       
   220     
       
   221     const CFont* font = SubCellFont(0);
       
   222     const TText* ptr = aText->Ptr();
       
   223     const SDisplayData* dispData = (const SDisplayData*)ptr;
       
   224 
       
   225     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   226     MAknsControlContext* cc = NULL;
       
   227 
       
   228     TInt lastSubCell(CellCount() - 1);
       
   229     // mark highlight as "not done" only if we need to draw the highlight
       
   230     TBool highlightDone( aHighlight ? EFalse : ETrue );
       
   231 
       
   232     if(!font)
       
   233         {
       
   234         font = CEikonEnv::Static()->NormalFont();
       
   235         }
       
   236 
       
   237     if((cc = AknsDrawUtils::ControlContextOfParent( Control() )) == NULL)
       
   238         {
       
   239         cc = SkinBackgroundContext();
       
   240         }
       
   241 
       
   242     // Draw subcells into textRect
       
   243 
       
   244     for(TInt subcell(0); subcell <= lastSubCell; ++subcell)
       
   245         {
       
   246         aGc.SetPenStyle(CGraphicsContext::ESolidPen);
       
   247         aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
       
   248         // SetPosition, SetSize and margins support
       
   249         TRect bRect( SubCellPosition(subcell), SubCellSize(subcell) );
       
   250         TMargins m( SubCellMargins(subcell) );
       
   251         TRect cRect(
       
   252             bRect.iTl +TSize(m.iLeft, m.iTop),
       
   253             bRect.Size() -TSize(m.iRight + m.iLeft, m.iBottom + m.iTop) );
       
   254         TRect textRect( aItemRect.iTl +cRect.iTl, cRect.Size() );
       
   255 
       
   256         aGc.SetPenColor(aColors.iText);
       
   257         aGc.SetBrushColor(aColors.iBack);
       
   258 
       
   259         switch(subcell)
       
   260             {
       
   261             case ECalenWeekFirstDay:    // May be Monday
       
   262             case ECalenWeekSecondDay:   // May be Tuesday
       
   263             case ECalenWeekThirdDay:    // May be Wednesday
       
   264             case ECalenWeekForthDay:    // May be Thursday
       
   265             case ECalenWeekFifthDay:    // May be friday
       
   266             case ECalenWeekSixthDay:    // May be saturday
       
   267             case ECalenWeekSeventhDay:  // May be sunday
       
   268                 {
       
   269                 const TCalenWeekHour& hourData = dispData->iHourData[subcell -1];
       
   270                 bRect.Move( aItemRect.iTl );
       
   271 
       
   272                 if (! AknsDrawUtils::Background( skin, cc, NULL, aGc, bRect,
       
   273                                                  KAknsDrawParamNoClearUnderImage))
       
   274                     {
       
   275                     aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
       
   276                     aGc.Clear(bRect);
       
   277                     aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
       
   278                     }
       
   279 
       
   280                 if(!highlightDone && aHighlight 
       
   281                    && subcell == iHilightedSubCell+1)
       
   282                     {
       
   283                     highlightDone = DrawHighlight( bRect, aGc, ETrue );
       
   284                     }
       
   285 
       
   286                 switch(hourData.DataType())
       
   287                     {
       
   288                     case TCalenWeekHour::ENoData:
       
   289                     break;
       
   290 
       
   291                     case TCalenWeekHour::EHasIcon:
       
   292                         DrawIcon( aGc, hourData, bRect );
       
   293                     break;
       
   294 
       
   295                     case TCalenWeekHour::EHasBar:
       
   296                         DrawDurationBar( aGc, hourData, bRect );
       
   297                     break;
       
   298                     }
       
   299 
       
   300                 // draw non-skinned highlight
       
   301                 if(!highlightDone && aHighlight && subcell == iHilightedSubCell +1)
       
   302                     {
       
   303                     highlightDone = DrawHighlight( bRect, aGc, EFalse );
       
   304                     }
       
   305                 }
       
   306             break;
       
   307 
       
   308             case ECalenWeekHour:
       
   309                 {
       
   310                 // build the background of this column.
       
   311                 TRect dRect( aItemRect.iTl +bRect.iTl, bRect.Size() );
       
   312 
       
   313                 if (! AknsDrawUtils::Background( skin, cc, NULL, aGc, dRect, KAknsDrawParamNoClearUnderImage))
       
   314                     {
       
   315                     aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
       
   316                     aGc.Clear( dRect );
       
   317                     aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
       
   318                     }
       
   319 
       
   320                 DrawCellText( aProperties, subcell, aGc, dispData->iHourDes, cRect, textRect, aColors );
       
   321                 }
       
   322             break;
       
   323 
       
   324             default:
       
   325             break;
       
   326             }//switch
       
   327         }//for loop
       
   328      
       
   329     TRACE_EXIT_POINT;
       
   330     }
       
   331 
       
   332 // ----------------------------------------------------
       
   333 // CCalenWeekLBData::DrawHighlight
       
   334 // (other items were commented in a header).
       
   335 // ----------------------------------------------------
       
   336 //
       
   337 TBool CCalenWeekLBData::DrawHighlight(const TRect aCellRect, CWindowGc& aGc, const TBool aDrawSkinned) const
       
   338     {
       
   339     TRACE_ENTRY_POINT;
       
   340     
       
   341     // Note: aCellRect should match cell_cale_week_pane layout item
       
   342 
       
   343     // Highlight rect 
       
   344     TAknLayoutRect grid_highlight_pane_cp07;
       
   345     grid_highlight_pane_cp07.LayoutRect( 
       
   346         aCellRect /*P:cell_cale_week_pane*/,
       
   347         AknLayoutScalable_Apps::grid_highlight_pane_cp07().LayoutLine() );
       
   348 
       
   349     if( aDrawSkinned )
       
   350         {
       
   351         TBool done = EFalse;
       
   352         if( HighlightAnim() )
       
   353             {
       
   354             AboutToDrawHighlightAnim();
       
   355             if( HighlightAnim() )
       
   356                 done = HighlightAnim()->Render( aGc, grid_highlight_pane_cp07.Rect() );
       
   357             }
       
   358 
       
   359         // Either animation does not exist or drawing it failed
       
   360         if( !done )
       
   361             {
       
   362             // Highlight skin center
       
   363             TAknLayoutRect cell_highlight_pane_g1;
       
   364             cell_highlight_pane_g1.LayoutRect(
       
   365                 grid_highlight_pane_cp07.Rect(),
       
   366                 AknLayoutScalable_Avkon::cell_highlight_pane_g1().LayoutLine() );
       
   367 
       
   368             done = AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), aGc, 
       
   369                                              grid_highlight_pane_cp07.Rect(), 
       
   370                                              cell_highlight_pane_g1.Rect(),
       
   371                                              KAknsIIDQsnFrGrid, 
       
   372                                              KAknsIIDQsnFrGridCenter );
       
   373             }
       
   374         
       
   375         TRACE_EXIT_POINT;
       
   376         return done;
       
   377         }
       
   378     else
       
   379         {
       
   380         // non-skinned highlight. Is this possible anymore ?
       
   381         // And what color we should use? 
       
   382         grid_highlight_pane_cp07.DrawOutLineRect( aGc );
       
   383         }
       
   384     
       
   385     TRACE_EXIT_POINT;
       
   386     return ETrue;
       
   387     }
       
   388 
       
   389 // ----------------------------------------------------
       
   390 // CCalenWeekLBData::DrawCellText
       
   391 // Drawing cell text
       
   392 // (other items were commented in a header).
       
   393 // ----------------------------------------------------
       
   394 //
       
   395 void CCalenWeekLBData::DrawCellText(TListItemProperties aProperties, // Item property
       
   396                                     TInt aSubCell,                 // Sub cell index
       
   397                                     CWindowGc& aGc,                // Graphics context
       
   398                                     const TPtrC aText,             // Drawing desriptor
       
   399                                     const TRect& /*aCellRect*/,    // Cell rectangle
       
   400                                     const TRect& aTextRect,        // Text rectangle
       
   401                                     const TColors& aColors) const  // text colors
       
   402     {
       
   403     TRACE_ENTRY_POINT;
       
   404     
       
   405     CGraphicsContext::TTextAlign align(SubCellAlignment(aSubCell));
       
   406     const CFont* cellFont = Font(aProperties, aSubCell);
       
   407     aGc.UseFont(cellFont);
       
   408     aGc.SetPenColor(aColors.iText);
       
   409     TInt baseLineOffset = SubCellBaselinePos(aSubCell);
       
   410 
       
   411     TBuf<ECalenCharsInLine> numTmp = aText;
       
   412     AknTextUtils::DisplayTextLanguageSpecificNumberConversion(numTmp);
       
   413     TBuf<ECalenCharsInLine> visualTmp;
       
   414     AknBidiTextUtils::ConvertToVisualAndClip(
       
   415         numTmp, visualTmp, *cellFont, aTextRect.Width(), aTextRect.Width());
       
   416 
       
   417     aGc.DrawText(visualTmp, aTextRect, baseLineOffset, align);
       
   418     
       
   419     TRACE_EXIT_POINT;
       
   420     }
       
   421 
       
   422 
       
   423 // ----------------------------------------------------
       
   424 // CCalenWeekLBData::DrawDurationBar
       
   425 // Drawing cell event indicator bar
       
   426 // (other items were commented in a header).
       
   427 // ----------------------------------------------------
       
   428 //
       
   429 void CCalenWeekLBData::DrawDurationBar(
       
   430     CWindowGc& aGc,
       
   431     const TCalenWeekHour& aHourData,
       
   432     const TRect& aCellRect
       
   433     ) const
       
   434     {
       
   435     TRACE_ENTRY_POINT;
       
   436     
       
   437     // Note: Cell rectangle should match cell_cale_week_pane layout item
       
   438 
       
   439     // Indicator bar consists of 6 small parts, each representing 10 minutes of one hour
       
   440     // Each have color, which indicates current events synchronization type
       
   441     // or that there is multiple overlapping events in that 10 minutes slot
       
   442     const TInt KDurationBarCount = 6;
       
   443     ASSERT( KDurationBarCount == KEventsInHour );
       
   444 
       
   445     TAknLayoutRect durationBars[ KDurationBarCount ];
       
   446     for (TInt i=0; i < KDurationBarCount; ++i)
       
   447         {
       
   448         durationBars[i].LayoutRect(
       
   449             aCellRect /*P:cell_cale_week_pane*/,
       
   450             AknLayoutScalable_Apps::cell_cale_week_pane_g3(i).LayoutLine() );
       
   451         }
       
   452 
       
   453     // Set our pen properties
       
   454     aGc.SetPenStyle( CGraphicsContext::ENullPen );
       
   455     aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
       
   456 
       
   457     // Note: Below is 1) correct implementation and 2) currently used implementation
       
   458 
       
   459     // 1) Correct implementation is commented out. There are gaps between duration 
       
   460     // bars in layouts so we can't yet put correct implementation in.
       
   461 //     for (TInt i=0; i < KEventsInHour; i++)
       
   462 //         {
       
   463 //         TEventColor barType = aHourData.Event(i);
       
   464 //         if ( barType != ENoEvent )
       
   465 //            {
       
   466 //            aGc.SetBrushColor( BarColor( barType ) );
       
   467 //         // FIXME: there is skin qgn_indi_cale_duration, that could be drawn here.
       
   468 //         // It should be fetched and colored for different possible colors
       
   469 //         // in sizechanged. Normal drawing has to be preserved, as this skin item
       
   470 //         // is not usually available.
       
   471 //            aGc.DrawRect( durationBars[i].Rect() );
       
   472 //            }
       
   473 //         }
       
   474 
       
   475     // 2) Implementation that circumvents layout data gaps between slots:
       
   476     // it adjust slot rect to be adjacent to next slot's rect
       
   477 
       
   478     for( TInt i=0; i < KEventsInHour; ++i)
       
   479         {
       
   480         TUint32 color= aHourData.Event(i);
       
   481         if ( color != ENoEvent || color == EBlackColoredEvent )
       
   482             {
       
   483             aGc.SetBrushColor( color );
       
   484             TRect slotRect = durationBars[i].Rect();
       
   485             
       
   486             // if not drawing last bar slot, extend rect to be adjacent to next slot
       
   487             // Note that TRect's bottom-right corner is outside of rect. 
       
   488             const TInt KLastSlotIndex = KEventsInHour - 1;
       
   489             if( i != KLastSlotIndex )
       
   490                 {
       
   491                 TInt nextSlot = i + 1;
       
   492                 slotRect.iBr.iY = durationBars[ nextSlot ].Rect().iTl.iY;
       
   493                 }
       
   494             
       
   495             if(color == EManyEvents)
       
   496                 {
       
   497                 // draw pattern for the conflicting meeting events from 
       
   498                 // different calendar db
       
   499                 aGc.SetPenStyle(CGraphicsContext::ENullPen);
       
   500                 aGc.UseBrushPattern(iGradientBitmap);
       
   501                 aGc.SetBrushStyle(CGraphicsContext::EPatternedBrush);
       
   502                 aGc.DrawRect(slotRect);
       
   503                 aGc.DiscardBrushPattern();
       
   504                 }
       
   505             else
       
   506                 {
       
   507                 // Set pen properties
       
   508                 aGc.SetPenStyle( CGraphicsContext::ENullPen );
       
   509                 aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
       
   510                 aGc.DrawRect( slotRect );
       
   511                 }
       
   512             }
       
   513         }
       
   514 
       
   515     // Return normal pen properties (is this needed?)
       
   516     aGc.SetPenStyle( CGraphicsContext::ESolidPen );
       
   517     aGc.SetBrushStyle( CGraphicsContext::ENullBrush );
       
   518     
       
   519     TRACE_EXIT_POINT;
       
   520     }
       
   521 
       
   522 // ----------------------------------------------------
       
   523 // CCalenWeekLBData::DrawIcon
       
   524 // Draw non-timed note icon icon
       
   525 // (other items were commented in a header).
       
   526 // ----------------------------------------------------
       
   527 //
       
   528 void CCalenWeekLBData::DrawIcon( CWindowGc& aGc,
       
   529                                  const TCalenWeekHour& aHourData, 
       
   530                                  const TRect& aCellRect
       
   531                                  ) const
       
   532     {
       
   533     TRACE_ENTRY_POINT;
       
   534     
       
   535     // Note: aCellRect should match cell_cale_week_pane layout item
       
   536     // Also icon should have been layouted to correct size in SizeChanged of listbox
       
   537 
       
   538     TInt index(aHourData.IconIndex());
       
   539 
       
   540     if(index >= 0)
       
   541         {
       
   542         CGulIcon* icon = (*IconArray())[index];
       
   543         CFbsBitmap* bitmap = icon->Bitmap();
       
   544 
       
   545         TAknLayoutRect iconLayout;
       
   546         iconLayout.LayoutRect( aCellRect /*P:cell_cale_week_pane*/,
       
   547                                AknLayoutScalable_Apps::cell_cale_week_pane_g2(iLayoutVariant).LayoutLine() );
       
   548 
       
   549         if(icon->Mask())
       
   550             {
       
   551             TRect iconSizeRect( TPoint( 0, 0 ), bitmap->SizeInPixels() );
       
   552             aGc.BitBltMasked( iconLayout.Rect().iTl, bitmap, iconSizeRect, icon->Mask(), ETrue );
       
   553             }
       
   554         else
       
   555             {
       
   556             aGc.BitBlt( iconLayout.Rect().iTl, bitmap );
       
   557             }
       
   558         }
       
   559     TRACE_EXIT_POINT;
       
   560     }
       
   561 
       
   562 // ----------------------------------------------------------------------------
       
   563 // CCalenWeekLBData::InitialisePatternL
       
   564 // Initialise Pattern at the construction period
       
   565 // ----------------------------------------------------------------------------
       
   566 void CCalenWeekLBData::InitialisePatternL()
       
   567     {
       
   568     TRACE_ENTRY_POINT;
       
   569     // initialise pattern gradient    
       
   570     iGradientBitmap = new(ELeave)CFbsBitmap;
       
   571     CEikonEnv* env = CEikonEnv::Static();
       
   572     ColorUtils::TBitmapOrientation patternOrientation
       
   573             = ColorUtils::EBitmapOrientationVertical;
       
   574     ColorUtils::CreateGradientBitmapL( *iGradientBitmap,env->WsSession(),
       
   575                                         KPatternBrushWidth,
       
   576                                         patternOrientation,
       
   577                                         KStartColorForPattern,
       
   578                                         KEndColorForPattern);
       
   579     TRACE_EXIT_POINT;
       
   580     }
       
   581 // End of File