uifw/AvKon/src/aknlists.cpp
changeset 0 2f259fa3e83a
child 3 8ca85d2f0db7
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002-2009 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:  Avkon list layouts
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /*
       
    20  * AKNLISTS.CPP
       
    21  * 
       
    22  * This file has avkon listboxes
       
    23  */
       
    24 
       
    25 #include <aknenv.h>
       
    26 #include <aknlists.h>
       
    27 #include <aknjavalists.h>
       
    28 #include <eiklbv.h>
       
    29 #include <eikclbd.h>
       
    30 #include <AknPanic.h>
       
    31 #include <barsread.h>
       
    32 #include <AknAppGrid.h>
       
    33 #include <aknsfld.h>
       
    34 #include <aknlayoutscalable_avkon.cdl.h>
       
    35 #include <aknlayoutscalable_apps.cdl.h>
       
    36 #include <layoutmetadata.cdl.h>
       
    37 #include <skinlayout.cdl.h>
       
    38 
       
    39 #include <AknTasHook.h>
       
    40 #include "AknDebug.h"
       
    41 
       
    42 
       
    43 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
    44 #include <aknlistloadertfx.h>
       
    45 #include <aknlistboxtfxinternal.h>
       
    46 #endif //RD_UI_TRANSITION_EFFECTS_LIST
       
    47 
       
    48 #include <akntransitionutils.h>
       
    49 #include "akntrace.h"
       
    50 
       
    51 // non colorskinned additional icons
       
    52 _LIT(KFirstIconReplacement, "0");
       
    53 
       
    54 // for colorskinning additional icons
       
    55 _LIT(KFirstCSIconReplacement, "-1");
       
    56 _LIT(KFirstMovingCSIconReplacement, "-1\t%s");
       
    57 
       
    58 #ifdef RD_LIST_STRETCH
       
    59 _LIT(KEmptySpace, " ");
       
    60 #endif // RD_LIST_STRETCH
       
    61 
       
    62 //
       
    63 // Drawing utilities
       
    64 //
       
    65 
       
    66 #ifdef AVKON_RDEBUG_ERROR
       
    67 #define __LAYOUT_DEBUG(var, cmd) \
       
    68     if (!(var)) { cmd; }
       
    69 #else
       
    70 #define __LAYOUT_DEBUG(var, cmd)
       
    71 #endif
       
    72 
       
    73 enum TAknPopupLayoutPanicCodes
       
    74     {
       
    75     EAknPopupLayoutUnknownResolution
       
    76     };
       
    77 
       
    78 void Panic(TAknPopupLayoutPanicCodes aPanic)
       
    79     {
       
    80     _LIT(KPanicCat,"AknPopupLayout");
       
    81     User::Panic(KPanicCat, aPanic);
       
    82     }
       
    83     
       
    84 // -----------------------------------------------------------------------------
       
    85 // If a parent to the supplied control has its Gc set, this function will find 
       
    86 // it and return it.
       
    87 // -----------------------------------------------------------------------------
       
    88 //
       
    89 LOCAL_C CWindowGc* ReplaceGcWithCustomGc( const CEikListBox* aListBox )
       
    90     {
       
    91     _AKNTRACE( "[%s][%d].", __FUNCTION__, __LINE__ );
       
    92     const CCoeControl* parent = aListBox;
       
    93     CWindowGc* customGc;
       
    94     while ( parent )
       
    95         {
       
    96         customGc = parent->GetGc();
       
    97         if ( customGc )
       
    98             {
       
    99             CListItemDrawer* itemDrawer = aListBox->View()->ItemDrawer();
       
   100             CWindowGc* originalGc = itemDrawer->Gc();
       
   101             if ( customGc == originalGc )
       
   102                 {
       
   103                 return NULL;
       
   104                 }
       
   105             else
       
   106                 {
       
   107                 itemDrawer->SetGc( customGc );
       
   108                 return originalGc;
       
   109                 }
       
   110             }
       
   111         parent = parent->Parent();
       
   112         }
       
   113     return NULL;
       
   114     }
       
   115 
       
   116 // This is used by listboxes to handle item mark correctly. Can be used to other purposes too.
       
   117 
       
   118  // AVKON ITEM MARKS
       
   119 
       
   120 _LIT(KReplacementString, "%S");
       
   121 
       
   122 EXPORT_C void AknLAFUtils::ReplaceColumn(
       
   123     TPtr aTarget, TDesC* aSource, TDesC* aReplacement, TChar aColumnSeparator, TInt aColumn)
       
   124     {
       
   125     _AKNTRACE( "[%s][%s][%d].", "AknLAFUtils", __FUNCTION__, __LINE__ );
       
   126     TBool bufferIsLargeEnough = EFalse;
       
   127 
       
   128     // Is the given buffer large enough to hold all column texts without truncation?
       
   129     // (+1 is for the last column separator)
       
   130     if ( aSource && aReplacement )
       
   131         {
       
   132         TInt maxSize = aSource->Length() + aReplacement->Length() + 1;
       
   133         if ( aColumn >= 0 )
       
   134             {
       
   135             maxSize += aColumn; // column separators
       
   136             }
       
   137 
       
   138         bufferIsLargeEnough = ( aTarget.MaxLength() >= maxSize );
       
   139         }
       
   140 
       
   141     TInt end=0;
       
   142     TInt column=0;
       
   143     TPtrC text;
       
   144     if (aSource)
       
   145         {
       
   146         text.Set(*aSource);
       
   147         }
       
   148     while (text.Length() || column<=aColumn) 
       
   149         {
       
   150         end = text.Locate(aColumnSeparator);
       
   151         if (end == KErrNotFound)
       
   152             {
       
   153             end = text.Length();
       
   154             }
       
   155 
       
   156         if (column == aColumn) 
       
   157             {
       
   158             if ( aReplacement ) 
       
   159                 {
       
   160                 TInt replace = aReplacement->FindF(KReplacementString);
       
   161                 if (replace != KErrNotFound)
       
   162                     {
       
   163                     aTarget.Append(aReplacement->Left(replace));
       
   164                     aTarget.Append(text.Left(end));
       
   165                     aTarget.Append(aReplacement->Mid(replace+2)); // 2 == length of %s
       
   166                     }
       
   167                 else
       
   168                     {
       
   169                     aTarget.Append(*aReplacement);
       
   170                     }
       
   171 
       
   172                 if (end!=text.Length()) 
       
   173                     {
       
   174                     aTarget.Append(aColumnSeparator);
       
   175                     }
       
   176                 }
       
   177             } 
       
   178         else 
       
   179             {
       
   180             if (bufferIsLargeEnough || end<KMaxColumnDataLength)
       
   181                 {
       
   182                 aTarget.Append(text.Left(end));
       
   183                 }
       
   184             else
       
   185                 {
       
   186                 aTarget.Append(text.Left(KMaxColumnDataLength));
       
   187                 }
       
   188             aTarget.Append(aColumnSeparator);
       
   189             }
       
   190         
       
   191         if (end<text.Length())
       
   192             {
       
   193             ++end;
       
   194             }
       
   195         text.Set(text.Mid(end));
       
   196         ++column;
       
   197         }
       
   198     }
       
   199  // END OF AVKON LAF
       
   200 
       
   201 
       
   202 /** DEPRECATED
       
   203  *
       
   204  * Spec argument expects two things: ItemType typedef and ReadResource(TResourceReader&, ItemType&) method
       
   205  */
       
   206 template<class Spec>
       
   207 class CArrayReader : public CBase
       
   208     {
       
   209 public:
       
   210     ~CArrayReader()
       
   211     { delete iArray; }
       
   212     void ConstructFromResourceL(TResourceReader &aResource);
       
   213     CArrayFix<typename Spec::ItemType> *iArray; // Public
       
   214     };
       
   215 
       
   216 template<class Spec>
       
   217 void CArrayReader<Spec>::ConstructFromResourceL(TResourceReader &aResource)
       
   218     {
       
   219 #ifdef __WINS__
       
   220     iArray = new(ELeave) CArrayFixFlat<Spec::ItemType>(4);
       
   221 #else
       
   222     iArray = new(ELeave) CArrayFixFlat<typename Spec::ItemType>(4);
       
   223 #endif
       
   224     const TInt count = aResource.ReadInt16();
       
   225     for (TInt ii=0; ii<count; ++ii)
       
   226         {
       
   227         typename Spec::ItemType value;
       
   228         Spec::ReadResource(aResource, value);
       
   229         iArray->AppendL(value);
       
   230         }
       
   231     }
       
   232 
       
   233 
       
   234 // Not for apps
       
   235 struct SAknLayoutGfx
       
   236     {
       
   237     TInt id;    
       
   238     TInt C;
       
   239     TInt l, t, r, b, W, H;
       
   240     // the next ones are used by array resource reader template
       
   241     typedef SAknLayoutGfx ItemType;
       
   242     static void ReadResource(TResourceReader& aReader, ItemType& aTarget);    
       
   243     // Accessors for drawing code
       
   244     TInt Id() const;
       
   245     TInt Color() const;
       
   246     TRect Rect(const TRect &aParent) const;
       
   247     };
       
   248 // Not for apps
       
   249 struct SAknLayoutText 
       
   250     {
       
   251     TInt id; // must be first
       
   252     const CFont* font; 
       
   253     TInt C;
       
   254     TInt lm, rm, B, W;
       
   255     CGraphicsContext::TTextAlign align;
       
   256 
       
   257     typedef SAknLayoutText ItemType;
       
   258     static void ReadResource(TResourceReader& aReader, ItemType& aTarget);
       
   259     };
       
   260 // Not for apps
       
   261 struct SAknLayoutCmd
       
   262     {
       
   263     TInt id; // must be first
       
   264     TInt cmd;
       
   265     TInt data;
       
   266     
       
   267     typedef SAknLayoutCmd ItemType;
       
   268     static void ReadResource(TResourceReader& aReader, ItemType& aTarget);
       
   269     };
       
   270 
       
   271 //
       
   272 // Layout resource readers
       
   273 //
       
   274 void SAknLayoutPos::ReadResource(TResourceReader& aReader, ItemType& aTarget)
       
   275     {
       
   276     aTarget.l = aReader.ReadInt16();
       
   277     aTarget.t = aReader.ReadInt16();
       
   278     aTarget.r = aReader.ReadInt16();
       
   279     aTarget.b = aReader.ReadInt16();
       
   280     aTarget.W = aReader.ReadInt16();
       
   281     aTarget.H = aReader.ReadInt16();
       
   282     }
       
   283 
       
   284 void SAknLayoutGfx::ReadResource(TResourceReader& aReader, ItemType& aTarget)
       
   285     {
       
   286     aTarget.id = aReader.ReadInt16();
       
   287     aTarget.C = aReader.ReadInt16();
       
   288     aTarget.l = aReader.ReadInt16();
       
   289     aTarget.t = aReader.ReadInt16();
       
   290     aTarget.r = aReader.ReadInt16();
       
   291     aTarget.b = aReader.ReadInt16();
       
   292     aTarget.W = aReader.ReadInt16();
       
   293     aTarget.H = aReader.ReadInt16();
       
   294     }
       
   295 
       
   296 TInt SAknLayoutGfx::Id() const { return id; }
       
   297 
       
   298 TInt SAknLayoutGfx::Color() const { return C; }
       
   299 
       
   300 TRect SAknLayoutGfx::Rect(const TRect &aParent) const
       
   301     {
       
   302     return AknLayoutUtils::RectFromCoords(aParent,l, t, r, b, W, H);
       
   303     }
       
   304  
       
   305 void SAknLayoutText::ReadResource(TResourceReader& aReader, ItemType& aTarget)
       
   306     {
       
   307     aTarget.id = aReader.ReadInt16();
       
   308     TInt fontid = aReader.ReadInt16();
       
   309     aTarget.font = AknLayoutUtils::FontFromId(fontid);
       
   310 
       
   311     aTarget.C = aReader.ReadInt16();
       
   312     aTarget.lm = aReader.ReadInt16();
       
   313     aTarget.rm = aReader.ReadInt16();
       
   314     aTarget.B = aReader.ReadInt16();
       
   315     aTarget.W = aReader.ReadInt16();
       
   316     TInt alignid = aReader.ReadInt16();
       
   317     aTarget.align = AknLayoutUtils::TextAlignFromId(alignid);
       
   318     }
       
   319 void SAknLayoutCmd::ReadResource(TResourceReader& aReader, ItemType& aTarget)
       
   320     {
       
   321     aTarget.id = aReader.ReadInt16();
       
   322     aTarget.cmd = aReader.ReadInt16();
       
   323     aTarget.data = aReader.ReadInt16();
       
   324     }
       
   325 
       
   326 
       
   327 //
       
   328 // Resource reader for columnlistbox layouts
       
   329 //
       
   330 
       
   331 EXPORT_C void CAknGenericReader::ConstructL(TInt aResourceId)
       
   332     {
       
   333     TResourceReader reader;
       
   334     CEikonEnv::Static()->CreateResourceReaderLC(reader, aResourceId);
       
   335     ConstructFromResourceL(reader);
       
   336     CleanupStack::PopAndDestroy(); // reader
       
   337     }
       
   338 
       
   339 EXPORT_C void CAknGenericReader::ConstructFromResourceL(TResourceReader &reader)
       
   340     {
       
   341     iGfx = new(ELeave) CArrayReader<SAknLayoutGfx>;
       
   342     iGfx->ConstructFromResourceL(reader);
       
   343 
       
   344     iText = new(ELeave) CArrayReader<SAknLayoutText>;
       
   345     iText->ConstructFromResourceL(reader);
       
   346 
       
   347     iCmd = new(ELeave) CArrayReader<SAknLayoutCmd>;
       
   348     iCmd->ConstructFromResourceL(reader);
       
   349     
       
   350     iArea = new(ELeave) CArrayReader<SAknLayoutGfx>;
       
   351     iArea->ConstructFromResourceL(reader);
       
   352     }
       
   353 
       
   354 EXPORT_C CAknGenericReader::~CAknGenericReader()
       
   355     {
       
   356     delete iGfx;
       
   357     delete iText;
       
   358     delete iCmd;
       
   359     delete iArea;
       
   360     }
       
   361 
       
   362     
       
   363 EXPORT_C const SAknLayoutGfx* CAknGenericReader::GfxItem(TInt aIndex) const
       
   364     {
       
   365     TInt index=KErrNotFound;
       
   366     TKeyArrayFix key(0,ECmpTInt);
       
   367     SAknLayoutGfx gfx;
       
   368     gfx.id = aIndex;
       
   369     TInt zeroiffound = iGfx->iArray->Find(gfx, key, index);
       
   370     if (zeroiffound!=0) return 0;
       
   371     return &iGfx->iArray->At(index);
       
   372     }
       
   373 
       
   374 EXPORT_C const SAknLayoutText* CAknGenericReader::TextItem(TInt aIndex) const
       
   375     {
       
   376     TInt index=KErrNotFound;
       
   377     TKeyArrayFix key(0,ECmpTInt);
       
   378     SAknLayoutText text;
       
   379     text.id = aIndex;
       
   380     TInt zeroiffound = iText->iArray->Find(text, key, index);
       
   381     if (zeroiffound!=0) return 0;
       
   382     return &iText->iArray->At(index);
       
   383     }
       
   384 
       
   385 EXPORT_C const SAknLayoutCmd* CAknGenericReader::CmdItem(TInt aIndex) const
       
   386     {       
       
   387     TInt index=KErrNotFound;
       
   388     TKeyArrayFix key(0,ECmpTInt);
       
   389     SAknLayoutCmd cmd;
       
   390     cmd.id = aIndex;
       
   391     TBool zeroiffound = iCmd->iArray->Find(cmd, key, index);
       
   392     if (zeroiffound!=0) return 0;
       
   393     return &iCmd->iArray->At(index);
       
   394     }
       
   395 
       
   396 EXPORT_C const SAknLayoutGfx* CAknGenericReader::AreaItem(TInt aIndex) const
       
   397     {
       
   398     TInt index=KErrNotFound;
       
   399     TKeyArrayFix key(0,ECmpTInt);
       
   400     SAknLayoutGfx area;
       
   401     area.id = aIndex;
       
   402     TBool zeroiffound = iArea->iArray->Find(area, key, index);
       
   403     if (zeroiffound!=0) return 0;
       
   404     return &iArea->iArray->At(index);
       
   405     }
       
   406 
       
   407 
       
   408 
       
   409 //
       
   410 // Implementation of this module is completely Avkon LAF Code!
       
   411 //
       
   412 
       
   413 TBool IsEmptyVal(TInt aValue)
       
   414     {
       
   415     return aValue == ELayoutEmpty || aValue == -1;
       
   416     }
       
   417 
       
   418 
       
   419 #define ITEM_EXISTS(x) (((x) > -1) && ((x) < aListBox->Model()->NumberOfItems()))
       
   420 static void HandleItemRemovalBodyL(CEikListBox *aListBox, TInt currentitem, TInt topitem)
       
   421     {
       
   422     TInt lastitem = aListBox->Model()->NumberOfItems()-1;
       
   423     if (lastitem < topitem) topitem = lastitem;
       
   424 
       
   425 
       
   426     TInt numItems = aListBox->View()->NumberOfItemsThatFitInRect(aListBox->View()->ViewRect());
       
   427     if (!ITEM_EXISTS(topitem + numItems -1)) topitem = lastitem - numItems +1;
       
   428     if (topitem < 0) topitem = 0;
       
   429     if (topitem!=-1) aListBox->SetTopItemIndex(topitem);
       
   430 
       
   431     if (currentitem != -1 && lastitem != -1) aListBox->SetCurrentItemIndexAndDraw(currentitem > lastitem ? lastitem : currentitem);
       
   432     if (topitem==-1 || lastitem == -1) aListBox->DrawDeferred();
       
   433     }
       
   434 
       
   435 EXPORT_C void AknListBoxUtils::HandleItemRemovalAndPositionHighlightL(CEikListBox *aListBox, TInt aCurrentItemIndex , TBool /* aCurrentRemoved */)
       
   436     {
       
   437     _AKNTRACE( "[%s][%s][%d].", "AknListBoxUtils", __FUNCTION__, __LINE__ );
       
   438     // Handle the actual positioning of the list and highlight
       
   439     TInt currentitem = aCurrentItemIndex;
       
   440 
       
   441     TInt topitem = aListBox->TopItemIndex();
       
   442     aListBox->HandleItemRemovalL();
       
   443     HandleItemRemovalBodyL(aListBox, currentitem, topitem);
       
   444     }
       
   445 
       
   446 EXPORT_C void AknListBoxUtils::HandleItemRemovalAndPositionHighlightL(CEikListBox *aListBox, TInt aCurrentItemIndex, CArrayFix<TInt> &aIndexes)
       
   447     {
       
   448     _AKNTRACE( "[%s][%s][%d].", "AknListBoxUtils", __FUNCTION__, __LINE__ );
       
   449     TInt currentitem = aCurrentItemIndex;
       
   450     TInt topitem = aListBox->TopItemIndex();
       
   451     aListBox->HandleItemRemovalL(aIndexes);
       
   452     HandleItemRemovalBodyL(aListBox, currentitem, topitem);
       
   453     }
       
   454 
       
   455 EXPORT_C void AknListBoxLayouts::SetupStandardListBox(CEikListBox& aListBox)
       
   456     {
       
   457     aListBox.SetBorder(TGulBorder::ENone);
       
   458     }
       
   459 
       
   460 // Added for Selection Grid
       
   461 EXPORT_C void AknListBoxLayouts::SetupStandardGrid(CAknGrid& aGrid)
       
   462     {
       
   463     _AKNTRACE( "[%s][%s][%d].", "AknListBoxLayouts", __FUNCTION__, __LINE__ );
       
   464     aGrid.SetBorder(TGulBorder::ENone);
       
   465     // This method is used by e.g. GMS grid and color selection grid. Text color
       
   466     // taken from color selection grid.
       
   467     TInt textColor = AKN_LAYOUT_TEXT_Cell_pane_texts__pop_up_large_graphic_colour_none__Line_1.iC;
       
   468     aGrid.ItemDrawer()->SetTextColor(AKN_LAF_COLOR_STATIC(textColor));
       
   469     aGrid.ItemDrawer()->SetBackColor(AKN_LAF_COLOR_STATIC(0));
       
   470 
       
   471     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   472     TRgb color;
       
   473     /*
       
   474     * do not set highlight color here, since grid type is
       
   475     * unknown here and every grid which wants to set
       
   476     * it's highlightcolor  will do that in it's
       
   477     * SizeChanged() method
       
   478     *
       
   479     * so try to get an extended skin color and if that fails
       
   480     * use old code
       
   481     */
       
   482     TInt error = AknsUtils::GetCachedColor( skin,
       
   483                                             color,
       
   484                                             KAknsIIDQsnTextColors,
       
   485                                             EAknsCIQsnTextColorsCG10 );
       
   486     if (error)
       
   487         {
       
   488         color = AKN_LAF_COLOR( textColor );
       
   489         aGrid.ItemDrawer()->SetHighlightedTextColor(color);
       
   490         }
       
   491 
       
   492 
       
   493     aGrid.ItemDrawer()->SetHighlightedBackColor(AKN_LAF_COLOR_STATIC(0));
       
   494     aGrid.ItemDrawer()->FormattedCellData()->SetSkinParentPos(aGrid.ItemDrawer()->FormattedCellData()->Control()->PositionRelativeToScreen());
       
   495     AknsUtils::RegisterControlPosition(aGrid.ItemDrawer()->FormattedCellData()->Control());
       
   496     }
       
   497 
       
   498 void AknListBoxLayouts::SetupGridPos(CAknGrid& aGrid,
       
   499                                      const TAknWindowLineLayout &aLayout)
       
   500     {
       
   501     SetupGridPos(aGrid,aLayout.il, aLayout.it, aLayout.ir, aLayout.ib, aLayout.iW, aLayout.iH);
       
   502     }
       
   503 
       
   504 EXPORT_C void AknListBoxLayouts::SetupGridPos(CAknGrid& aGrid,
       
   505                 TInt l, TInt t, TInt r, TInt b, TInt W, TInt H) 
       
   506     {
       
   507     _AKNTRACE( "[%s][%s][%d].", "AknListBoxLayouts", __FUNCTION__, __LINE__ );
       
   508     TSize sz( aGrid.Rect().Size() );
       
   509     TInt gridHeight = aGrid.Rect().Height();
       
   510 
       
   511     if (IsParentRelative(W)) { W = sz.iWidth - ELayoutP + W; }
       
   512     if (IsParentRelative(H)) { H = sz.iHeight - ELayoutP + H; }
       
   513     if (IsParentRelative(l)) { l = sz.iWidth - ELayoutP + l; }
       
   514     if (IsParentRelative(t)) { t = sz.iHeight - ELayoutP + t; }
       
   515     if (IsParentRelative(r)) { r = sz.iWidth - ELayoutP + r; }
       
   516     if (IsParentRelative(b)) { b = sz.iHeight - ELayoutP + b; }
       
   517 
       
   518     if (IsEmptyVal(W)) W = sz.iWidth - r - l;
       
   519     if (IsEmptyVal(H)) H = gridHeight - t - b;
       
   520     if (IsEmptyVal(l)) l = sz.iWidth - W - r;
       
   521     if (IsEmptyVal(t)) t = gridHeight - H - b;
       
   522     if (IsEmptyVal(r)) r = sz.iWidth - l - W;
       
   523     if (IsEmptyVal(b)) b = gridHeight - t - H;
       
   524 
       
   525 
       
   526     aGrid.SetColumnWidth(W);
       
   527     TRAP_IGNORE(aGrid.SetItemHeightL(H));
       
   528     aGrid.SetHorizontalMargin(l);
       
   529     aGrid.SetVerticalMargin(t);
       
   530 
       
   531     __LAYOUT_DEBUG(aGrid.ItemHeight() == H, RDebug::Print(_L("EEikPanicListboxSizeIsNotAccordingToLAFSpec")));
       
   532     __LAYOUT_DEBUG(aGrid.ColumnWidth() == W, RDebug::Print(_L("EEikPanicListboxSizeIsNotAccordingToLAFSpec")));
       
   533 
       
   534     __LAYOUT_DEBUG(aGrid.MinimumSize().iHeight % H == 0, RDebug::Print(_L("AknListBoxLayouts/GridPos: ERROR: Layout not according to LAF spec: %d/%d"),aGrid.MinimumSize().iHeight,H));
       
   535     __LAYOUT_DEBUG(aGrid.MinimumSize().iWidth % W == 0, RDebug::Print(_L("AknListBoxLayouts/GridPos: ERROR: aGrid.MinimumSize().iWidth[%d] != width[%d]. Please fix grid MinimumSize()"),aGrid.MinimumSize().iWidth,W));
       
   536     __LAYOUT_DEBUG(aGrid.View()->ViewRect().Size().iWidth % W == 0, RDebug::Print(_L("AknListBoxLayouts/GridPos: ERROR: aListBox.View()->ViewRect().Size().iWidth[%d] != width[%d]. Please fix grid Rect()"),aGrid.MinimumSize().iWidth,W));
       
   537 
       
   538     __LAYOUT_DEBUG(aGrid.View()->ViewRect().Size().iHeight % H == 0, RDebug::Print(_L("AknListBoxLayouts/GridPos: ERROR: ViewRect height not according to LAF spec: %d/%d"), aGrid.View()->ViewRect().Size().iHeight,H));
       
   539     __LAYOUT_DEBUG(aGrid.View()->ViewRect().iTl.iY - t == aGrid.Rect().iTl.iY, RDebug::Print(_L("AknListBoxLayouts/GridPos: ERROR: ViewRect position not according to LAF spec %d/%d"),aGrid.View()->ViewRect().iTl.iY - t,aGrid.Rect().iTl.iY));
       
   540 
       
   541     }
       
   542 
       
   543 EXPORT_C void AknListBoxLayouts::SetupListboxPos(CEikListBox& aListBox, 
       
   544                    const TAknWindowLineLayout &aLayout)
       
   545 {
       
   546     TRAP_IGNORE( SetupListboxPosL( aListBox, aLayout ) );
       
   547 }
       
   548 
       
   549 EXPORT_C void AknListBoxLayouts::SetupListboxPos(CEikListBox& aListBox,
       
   550                   TInt aStartX, TInt aStartY, TInt aEndX,TInt aEndY, TInt aWidth, TInt aHeight)
       
   551     {
       
   552     _AKNTRACE( "[%s][%s][%d].", "AknListBoxLayouts", __FUNCTION__, __LINE__ );
       
   553     // construct layout data from the given values
       
   554     TAknWindowLineLayout layout;
       
   555     layout.iC = ELayoutEmpty;
       
   556     layout.il = aStartX;
       
   557     layout.it = aStartY;
       
   558     layout.ir = aEndX;
       
   559     layout.ib = aEndY;
       
   560     layout.iW = aWidth;
       
   561     layout.iH = aHeight;
       
   562 
       
   563     TRAP_IGNORE( SetupListboxPosL( aListBox, layout ) );
       
   564     }
       
   565 
       
   566 void AknListBoxLayouts::SetupListboxPosL( CEikListBox& aListBox,
       
   567                                           const TAknWindowLineLayout& aLayout ) // layout of first item
       
   568     {
       
   569     _AKNTRACE( "[%s][%s][%d].", "AknListBoxLayouts", __FUNCTION__, __LINE__ );;
       
   570     // this is quite akward in order to adapt into "legacy" code
       
   571     TAknLayoutRect layoutRect;
       
   572     layoutRect.LayoutRect( TRect( aListBox.Size() ), aLayout );
       
   573     
       
   574     TRect rect( layoutRect.Rect() );
       
   575     
       
   576     aListBox.SetHorizontalMargin( rect.iTl.iX );
       
   577     aListBox.SetVerticalMargin( rect.iTl.iY );
       
   578     aListBox.SetItemHeightL( rect.Height() );
       
   579     aListBox.View()->ItemDrawer()->SetItemCellSize( rect.Size() );
       
   580     }
       
   581 
       
   582 
       
   583 EXPORT_C void AknListBoxLayouts::SetupStandardColumnListbox(CColumnListBoxItemDrawer* aItemDrawer)
       
   584     {
       
   585     _AKNTRACE( "[%s][%s][%d].", "AknListBoxLayouts", __FUNCTION__, __LINE__ );
       
   586     __ASSERT_ALWAYS(aItemDrawer, Panic(EAknPanicInvalidValue));
       
   587     // Text color taken from single item listbox.
       
   588     TInt textColor = AKN_LAYOUT_TEXT_List_pane_texts__single__Line_1(0,0).iC;
       
   589     aItemDrawer->SetTextColor(AKN_LAF_COLOR_STATIC(textColor));
       
   590     aItemDrawer->SetBackColor(AKN_LAF_COLOR_STATIC(0));
       
   591     
       
   592     TRgb color = AKN_LAF_COLOR_STATIC( textColor );
       
   593     AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), color, 
       
   594                     KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 );
       
   595 
       
   596     aItemDrawer->SetHighlightedTextColor(color);
       
   597     aItemDrawer->SetHighlightedBackColor(AKN_LAF_COLOR_STATIC(
       
   598         AKN_LAYOUT_WINDOW_List_pane_highlight_graphics__various__Line_2(TRect()).iC));
       
   599     }
       
   600 
       
   601 
       
   602 EXPORT_C void AknListBoxLayouts::SetupStandardFormListbox(CFormattedCellListBoxItemDrawer* aItemDrawer)
       
   603     {
       
   604     _AKNTRACE( "[%s][%s][%d].", "AknListBoxLayouts", __FUNCTION__, __LINE__ );
       
   605     __ASSERT_ALWAYS(aItemDrawer, Panic(EAknPanicInvalidValue));
       
   606     // Text color taken from double item listbox.
       
   607     TInt textColor = AKN_LAYOUT_TEXT_List_pane_texts__double__Line_1(0).iC;
       
   608     aItemDrawer->SetTextColor(AKN_LAF_COLOR_STATIC(textColor));
       
   609     aItemDrawer->SetBackColor(AKN_LAF_COLOR_STATIC(0));
       
   610     
       
   611     TRgb color = AKN_LAF_COLOR_STATIC( textColor );
       
   612     AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), color, 
       
   613                     KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 );
       
   614 
       
   615     aItemDrawer->SetHighlightedTextColor(color);
       
   616     aItemDrawer->SetHighlightedBackColor(AKN_LAF_COLOR_STATIC(
       
   617         AKN_LAYOUT_WINDOW_List_pane_highlight_graphics__various__Line_2(TRect(0,0,0,0)).iC));
       
   618     }
       
   619     
       
   620 TInt AknListBoxLayouts::AdjustPopupLayoutData( const TRect& aScreenRect )
       
   621     {
       
   622     _AKNTRACE( "[%s][%s][%d].", "AknListBoxLayouts", __FUNCTION__, __LINE__ );
       
   623     TInt width = aScreenRect.Width();
       
   624     TInt height = aScreenRect.Height();
       
   625     
       
   626     if (  width ==640 &&  height ==360 ) //QHD
       
   627         {
       
   628         return 32;
       
   629         }
       
   630     else if(( width ==320 && height ==240 ) //QVGA, QVGA2
       
   631             ||( width ==640 && height ==480 )) //VGA, VAG3
       
   632         {
       
   633         return 0;
       
   634         }
       
   635     else
       
   636         {
       
   637         Panic( EAknPopupLayoutUnknownResolution );
       
   638         return 0;
       
   639         }
       
   640     }
       
   641 // -----------------------------------------------------------------------------
       
   642 // IdFromTextAlign
       
   643 // -----------------------------------------------------------------------------
       
   644 //
       
   645 static TInt IdFromTextAlign( const CGraphicsContext::TTextAlign aAlign )
       
   646     {
       
   647     TInt id;
       
   648     
       
   649     switch( aAlign ) 
       
   650         {
       
   651         case CGraphicsContext::ELeft:
       
   652             id = ELayoutAlignLeft;
       
   653             break;
       
   654             
       
   655         case CGraphicsContext::ECenter:
       
   656             id = ELayoutAlignCenter;
       
   657             break;
       
   658             
       
   659         case CGraphicsContext::ERight:
       
   660             id = ELayoutAlignRight;
       
   661             break;
       
   662             
       
   663         default:
       
   664             id = ELayoutAlignLeft;
       
   665         }
       
   666     _AKNTRACE( "[%s] return id = %d", __FUNCTION__, id );
       
   667     return id;
       
   668     }
       
   669 
       
   670 static const TAknsItemID *LinePositionToItemId(TAknSeparatorLinePosition pos)
       
   671     {
       
   672     const TAknsItemID * id = &KAknsIIDNone;
       
   673     switch(pos)
       
   674         {
       
   675         case EAColumn: 
       
   676             id = &KAknsIIDQsnBgColumn0; 
       
   677             break;
       
   678         case EABColumn: id = &KAknsIIDQsnBgColumnA; break;
       
   679         case EBCColumn: 
       
   680         case EBCColumnStretched:
       
   681             id = &KAknsIIDQsnBgColumnAB;  break;
       
   682         case ENoLine: id = &KAknsIIDNone; break;
       
   683         default:
       
   684             ; 
       
   685             break;
       
   686         };
       
   687     _AKNTRACE( "[%s] return id = %d", __FUNCTION__, id );    
       
   688     return id;
       
   689     }
       
   690 
       
   691 static const TAknsItemID *LinePositionToListEndId(TAknSeparatorLinePosition pos)
       
   692     {
       
   693     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
   694     const TAknsItemID *listEndId = &KAknsIIDNone;
       
   695     switch(pos)
       
   696         {
       
   697         case EAColumn: listEndId = &KAknsIIDQsnBgSliceList0;  break;
       
   698         case EABColumn: listEndId = &KAknsIIDQsnBgSliceListA;  break;
       
   699         case EBCColumn: 
       
   700         case EBCColumnStretched:
       
   701             listEndId = &KAknsIIDQsnBgSliceListAB;  break;
       
   702         case ENoLine: break;
       
   703         default: ; break;
       
   704         };
       
   705     return listEndId;
       
   706     }
       
   707 
       
   708 static void SetSeparatorLinePosition(const CEikFormattedCellListBox *aListBox, TAknSeparatorLinePosition pos)
       
   709     {
       
   710     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
   711     aListBox->ItemDrawer()->FormattedCellData()->SetSeparatorLinePosition(pos);
       
   712     TAknWindowLineLayout tile(SkinLayout::Column_background_and_list_slice_skin_placing_Line_2());
       
   713 
       
   714     switch(pos)
       
   715         {
       
   716         case EAColumn:
       
   717             tile = SkinLayout::Column_background_and_list_slice_skin_placing_Line_1();
       
   718             break;
       
   719         case EABColumn:
       
   720             tile = SkinLayout::Column_background_and_list_slice_skin_placing_Line_2();
       
   721             break;
       
   722         case EBCColumn:
       
   723             tile = SkinLayout::Column_background_and_list_slice_skin_placing_Line_3();
       
   724             break;
       
   725         case ENoLine: break;
       
   726         default: ; break;
       
   727         };
       
   728 
       
   729     TAknWindowLineLayout listEnd(SkinLayout::Column_background_and_list_slice_skin_placing_Line_7());
       
   730 
       
   731     TAknLayoutRect tileLayout;
       
   732     tileLayout.LayoutRect(aListBox->Rect(), tile);
       
   733     aListBox->ItemDrawer()->FormattedCellData()->SetSkinStyle(LinePositionToItemId(pos), tileLayout.Rect());
       
   734 
       
   735     TAknLayoutRect listEndLayout;
       
   736     listEndLayout.LayoutRect(aListBox->Rect(), listEnd);
       
   737     aListBox->ItemDrawer()->FormattedCellData()->SetListEndSkinStyle(LinePositionToListEndId(pos), listEndLayout.Rect());
       
   738 
       
   739     CAknListBoxFilterItems *filter = STATIC_CAST(CAknFilteredTextListBoxModel*,aListBox->Model())->Filter();
       
   740     if (filter)
       
   741         {
       
   742         CAknSearchField *find = (CAknSearchField*)filter->FindBox();
       
   743         if (find)
       
   744             {
       
   745             find->SetLinePos(pos);
       
   746             }
       
   747         }
       
   748 
       
   749     }
       
   750     
       
   751 static void SetSeparatorLinePosition(CEikColumnListBox *aListBox, TAknSeparatorLinePosition pos)
       
   752     {
       
   753     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
   754     aListBox->ItemDrawer()->ColumnData()->SetSeparatorLinePosition(pos);
       
   755 
       
   756     TAknWindowLineLayout tile(SkinLayout::Column_background_and_list_slice_skin_placing_Line_2());
       
   757     switch(pos)
       
   758         {
       
   759         case EAColumn:
       
   760             tile = SkinLayout::Column_background_and_list_slice_skin_placing_Line_1();
       
   761             break;
       
   762         case EABColumn:
       
   763             tile = SkinLayout::Column_background_and_list_slice_skin_placing_Line_2();
       
   764             break;
       
   765         case EBCColumn:
       
   766             tile = SkinLayout::Column_background_and_list_slice_skin_placing_Line_3();
       
   767             break;
       
   768         case EBCColumnStretched:
       
   769             {
       
   770             TAknWindowComponentLayout l1 = AknLayoutScalable_Avkon::bg_list_pane( 0 );
       
   771             TAknWindowComponentLayout l2 = 
       
   772                 AknLayoutScalable_Avkon::bg_list_pane_g1( 4 );
       
   773             
       
   774             tile = TAknWindowComponentLayout::Compose( l1, l2 ).LayoutLine();
       
   775             }
       
   776             break;
       
   777         case ENoLine: break;
       
   778         default: ; break;
       
   779         };
       
   780 
       
   781     TAknWindowLineLayout listEnd(SkinLayout::Column_background_and_list_slice_skin_placing_Line_7());
       
   782 
       
   783     TAknLayoutRect tileLayout;
       
   784     tileLayout.LayoutRect(aListBox->Rect(), tile);
       
   785     aListBox->ItemDrawer()->ColumnData()->SetSkinStyle(LinePositionToItemId(pos), tileLayout.Rect());
       
   786 
       
   787     TAknLayoutRect listEndLayout;
       
   788     listEndLayout.LayoutRect(aListBox->Rect(), listEnd);
       
   789     aListBox->ItemDrawer()->ColumnData()->SetListEndSkinStyle(LinePositionToListEndId(pos), listEndLayout.Rect());
       
   790 
       
   791 
       
   792     CAknListBoxFilterItems *filter = STATIC_CAST(CAknFilteredTextListBoxModel*,aListBox->Model())->Filter();
       
   793     if (filter)
       
   794         {
       
   795         CAknSearchField *find = (CAknSearchField*)filter->FindBox();
       
   796         if (find)
       
   797             {
       
   798             find->SetLinePos(pos);
       
   799             }
       
   800         }
       
   801 
       
   802     }
       
   803 
       
   804 static void SetSeparatorLinePosition(CAknGrid *aGrid, TAknSeparatorLinePosition pos)
       
   805     {
       
   806     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
   807     aGrid->ItemDrawer()->FormattedCellData()->SetSeparatorLinePosition(pos);
       
   808     TAknWindowLineLayout tile(SkinLayout::Column_background_and_list_slice_skin_placing_Line_2());
       
   809     switch(pos)
       
   810         {
       
   811         case EABColumn:
       
   812             tile = SkinLayout::Column_background_and_list_slice_skin_placing_Line_2();
       
   813             break;
       
   814         case EBCColumn:
       
   815             tile = SkinLayout::Column_background_and_list_slice_skin_placing_Line_3();
       
   816             break;
       
   817         case EAColumn:
       
   818         case ENoLine: break;
       
   819         default: ; break;
       
   820         };
       
   821 
       
   822     TAknLayoutRect tileLayout;
       
   823     tileLayout.LayoutRect(aGrid->Rect(), tile);
       
   824     aGrid->ItemDrawer()->FormattedCellData()->SetSkinStyle(&KAknsIIDNone, tileLayout.Rect());
       
   825     }
       
   826 
       
   827 void CommonSetupScrollbarLayout( CAknListBoxFilterItems * /*aFilter*/, 
       
   828                                  CEikScrollBarFrame *aScrollBarFrame,
       
   829                                  TBool /*aExternalFindBox*/,
       
   830                                  const CEikListBox* aListBox )
       
   831     {
       
   832     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
   833     TAknWindowComponentLayout layout = TAknWindowComponentLayout::Compose( 
       
   834         AknLayoutScalable_Avkon::listscroll_gen_pane(0),
       
   835         AknLayoutScalable_Avkon::scroll_pane()); 
       
   836      
       
   837     TRect scrollBarParent( aListBox->Rect() );    
       
   838     AknLayoutUtils::LayoutVerticalScrollBar( aScrollBarFrame,
       
   839                                              scrollBarParent,
       
   840                                              layout.LayoutLine() );
       
   841     }
       
   842 
       
   843 // for setting up scrollbar layout in square - used by predefined list layouts
       
   844 static void SetupScrollbarLayout(const CEikFormattedCellListBox *aListBox, CEikScrollBarFrame *aScrollBarFrame)
       
   845     {
       
   846     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
   847     CAknListBoxFilterItems *filter = STATIC_CAST(CAknFilteredTextListBoxModel*,aListBox->Model())->Filter();
       
   848     CommonSetupScrollbarLayout(filter, aScrollBarFrame, EFalse, aListBox);
       
   849     }
       
   850 
       
   851 static void SetupScrollbarLayout(const CEikColumnListBox *aListBox, CEikScrollBarFrame *aScrollBarFrame)
       
   852     {
       
   853     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
   854     CAknListBoxFilterItems *filter = STATIC_CAST(CAknFilteredTextListBoxModel*,aListBox->Model())->Filter();
       
   855 
       
   856     TBool findBox = static_cast<CAknColumnListBoxView*>(aListBox->View())
       
   857         ->GetFindEmptyListState();
       
   858 
       
   859     CommonSetupScrollbarLayout(filter, aScrollBarFrame, findBox, aListBox);
       
   860     }
       
   861 
       
   862 
       
   863 TSize ListBoxItemSize(CEikListBox &aListBox, CColumnListBoxItemDrawer* aItemDrawer)
       
   864     {
       
   865     TSize size(aItemDrawer->LafItemSize().iWidth,aListBox.View()->ItemSize().iHeight);
       
   866     return size;
       
   867     }
       
   868 
       
   869 TSize ListBoxItemSize(CEikListBox &aListBox, CFormattedCellListBoxItemDrawer *aItemDrawer)
       
   870     {
       
   871     TSize size( aItemDrawer->LafItemSize().iWidth, aListBox.View()->ItemSize().iHeight);
       
   872     return size;
       
   873     }
       
   874 
       
   875 void SetupColumnGfxCellL(CEikListBox& aListBox, CColumnListBoxItemDrawer* aItemDrawer, TInt index,
       
   876                                   TInt l, TInt t, TInt r, TInt b, TInt W, TInt H, TInt startx, TInt endx)
       
   877     {
       
   878     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
   879     TSize sz( ListBoxItemSize( aListBox, aItemDrawer ) );
       
   880     
       
   881     if ( IsParentRelative( W ) ) { W = sz.iWidth - ELayoutP + W; }
       
   882     if ( IsParentRelative( H ) ) { H = sz.iHeight - ELayoutP + H; }
       
   883     if ( IsParentRelative( r ) ) { r = sz.iWidth - ELayoutP + r; }
       
   884     if ( IsParentRelative( b ) ) { b = sz.iHeight - ELayoutP + b; }
       
   885     if ( IsParentRelative( l ) ) { l = sz.iWidth - ELayoutP + l; }
       
   886     if ( IsParentRelative( t ) ) { t = sz.iHeight - ELayoutP + t; }
       
   887 
       
   888     // position graphics by left/right and size
       
   889     TAknWindowLineLayout windowLine;
       
   890 
       
   891     if ( IsEmptyVal( l ) )
       
   892         {
       
   893         windowLine.ir = r;
       
   894         windowLine.il = ELayoutEmpty;
       
   895         }
       
   896     else
       
   897         {
       
   898         windowLine.il = l;
       
   899         windowLine.ir = ELayoutEmpty;
       
   900         }
       
   901 
       
   902     if ( IsEmptyVal( l ) ) { l = sz.iWidth - r - W; }
       
   903     if ( IsEmptyVal( W ) ) { W = sz.iWidth - r - l; }
       
   904     if ( IsEmptyVal( r ) ) { r = sz.iWidth - l - W; }
       
   905     if ( IsEmptyVal( t ) ) { t = sz.iHeight - b - H; }
       
   906     if ( IsEmptyVal( H ) ) { H = sz.iHeight - b - t; }
       
   907     if ( IsEmptyVal( b ) ) { b = sz.iHeight - t - H; }
       
   908 
       
   909     windowLine.it = t;
       
   910     windowLine.iW = W;
       
   911     windowLine.iH = H;
       
   912 
       
   913     aItemDrawer->ColumnData()->SetGraphicSubCellL( index, windowLine );
       
   914     aItemDrawer->ColumnData()->SetColumnAlignmentL( index, CGraphicsContext::ECenter );
       
   915     
       
   916     if ( endx < startx )
       
   917         {
       
   918         aItemDrawer->ColumnData()->SetOptionalColumnL( index, ETrue );
       
   919         }
       
   920         
       
   921     aItemDrawer->ColumnData()->SubCellsMightIntersect( ETrue );        
       
   922     }
       
   923 
       
   924 EXPORT_C void AknListBoxLayouts::SetupColumnGfxCell(CEikListBox& aListBox, CColumnListBoxItemDrawer* aItemDrawer, TInt index,
       
   925                                   TInt l, TInt t, TInt r, TInt b, TInt W, TInt H, TInt startx, TInt endx)
       
   926     {
       
   927     TRAP_IGNORE(SetupColumnGfxCellL(aListBox, aItemDrawer, index, l, t, r, b, W, H, startx, endx));
       
   928     }
       
   929 
       
   930 void SetupColumnTextCellL(CEikListBox& aListBox, CColumnListBoxItemDrawer* aItemDrawer, TInt index,
       
   931                 const CFont *font, TInt C, TInt lm, TInt rm, TInt B, TInt W, CGraphicsContext::TTextAlign aAlign, TInt /*startx*/, TInt /*endx*/)
       
   932     {
       
   933     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
   934     TSize size( ListBoxItemSize( aListBox, aItemDrawer ) );
       
   935 
       
   936     if ( IsParentRelative( lm ) ) { lm = size.iWidth - ELayoutP + lm; }
       
   937     if ( IsParentRelative( rm ) ) { rm = size.iWidth - ELayoutP + rm; }
       
   938     if ( IsParentRelative( W ) ) { W = size.iWidth - ELayoutP + W; }
       
   939 
       
   940     if ( IsEmptyVal( lm ) ) { lm = size.iWidth - rm - W; }
       
   941     if ( IsEmptyVal( rm ) ) { rm = size.iWidth - lm - W; }
       
   942     if ( IsEmptyVal( W ) ) { W = size.iWidth - lm - rm; }
       
   943 
       
   944     TAknTextLineLayout textLine;
       
   945     textLine.iC = C;                        // color
       
   946     textLine.il = lm;                       // left
       
   947     textLine.ir = rm;                       // right
       
   948     textLine.iB = B;                        // baseline
       
   949     textLine.iW = ELayoutEmpty;             // width
       
   950     textLine.iJ = IdFromTextAlign( aAlign );// justification
       
   951     textLine.iFont = EAknLogicalFontPrimaryFont;       // a default font id
       
   952     textLine.iBaselineSkip = 0;           
       
   953     textLine.iNumberOfLinesShown = 1;
       
   954     
       
   955     aItemDrawer->ColumnData()->SetTextSubCellL( index, textLine );
       
   956     aItemDrawer->ColumnData()->SetColumnFontL( index, font );
       
   957     aItemDrawer->ColumnData()->SubCellsMightIntersect( ETrue );        
       
   958     }     
       
   959     
       
   960 EXPORT_C void AknListBoxLayouts::SetupColumnTextCell(CEikListBox& aListBox, CColumnListBoxItemDrawer* aItemDrawer, TInt index,
       
   961                 const CFont *font, TInt C, TInt lm, TInt rm, TInt B, TInt W, CGraphicsContext::TTextAlign aAlign, TInt startx, TInt endx)
       
   962     {
       
   963     TRAP_IGNORE(SetupColumnTextCellL(aListBox, aItemDrawer, index, font, C,lm,rm,B,W,aAlign,startx,endx));
       
   964     }
       
   965 
       
   966 void SetupFormGfxCellL(CEikListBox& aListBox, CFormattedCellListBoxItemDrawer* aItemDrawer, TInt index,
       
   967                                 TInt l, TInt t, TInt r, TInt b, TInt W, TInt H, TPoint /*p1*/, TPoint /*p2*/)
       
   968     {
       
   969     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
   970     TSize sz( ListBoxItemSize( aListBox, aItemDrawer ) );
       
   971     
       
   972     if ( IsParentRelative( W ) ) { W = sz.iWidth - ELayoutP + W; }
       
   973     if ( IsParentRelative( H ) ) { H = sz.iHeight - ELayoutP + H; }
       
   974     if ( IsParentRelative( r ) ) { r = sz.iWidth - ELayoutP + r; }
       
   975     if ( IsParentRelative( b ) ) { b = sz.iHeight - ELayoutP + b; }
       
   976     if ( IsParentRelative( l ) ) { l = sz.iWidth - ELayoutP + l; }
       
   977     if ( IsParentRelative( t ) ) { t = sz.iHeight - ELayoutP + t; }
       
   978 
       
   979     // position graphics by left/right and size
       
   980     TAknWindowLineLayout windowLine;
       
   981 
       
   982     if ( IsEmptyVal( l ) )
       
   983         {
       
   984         windowLine.ir = r;
       
   985         windowLine.il = ELayoutEmpty;
       
   986         }
       
   987     else
       
   988         {
       
   989         windowLine.il = l;
       
   990         windowLine.ir = ELayoutEmpty;
       
   991         }
       
   992 
       
   993     if ( IsEmptyVal( l ) ) { l = sz.iWidth - r - W; }
       
   994     if ( IsEmptyVal( W ) ) { W = sz.iWidth - r - l; }
       
   995     if ( IsEmptyVal( r ) ) { r = sz.iWidth - l - W; }
       
   996     if ( IsEmptyVal( t ) ) { t = sz.iHeight - b - H; }
       
   997     if ( IsEmptyVal( H ) ) { H = sz.iHeight - b - t; }
       
   998     if ( IsEmptyVal( b ) ) { b = sz.iHeight - t - H; }
       
   999 
       
  1000     windowLine.it = t;
       
  1001     windowLine.iW = W;
       
  1002     windowLine.iH = H;
       
  1003 
       
  1004     aItemDrawer->FormattedCellData()->SetGraphicSubCellL( index, windowLine );
       
  1005     aItemDrawer->FormattedCellData()->SubCellsMightIntersect( ETrue );
       
  1006     }
       
  1007 
       
  1008 EXPORT_C void AknListBoxLayouts::SetupFormGfxCell(CEikListBox& aListBox, CFormattedCellListBoxItemDrawer* aItemDrawer, TInt index,
       
  1009                                 TInt l, TInt t, TInt r, TInt b, TInt W, TInt H, TPoint p1, TPoint p2)
       
  1010     {
       
  1011     TRAP_IGNORE(SetupFormGfxCellL(aListBox, aItemDrawer, index, l,t,r,b,W,H,p1,p2));
       
  1012     }
       
  1013 
       
  1014 
       
  1015 EXPORT_C void AknListBoxLayouts::SetupGridFormGfxCell(CAknGrid& aGrid, CFormattedCellListBoxItemDrawer* aItemDrawer, TInt aIndex,
       
  1016                                 TInt l, TInt t, TInt r, TInt b, TInt W, TInt H, TPoint aP1, TPoint aP2)
       
  1017     {
       
  1018     TRAP_IGNORE(SetupFormGfxCellL(aGrid, aItemDrawer, aIndex, l,t,r,b,W,H,aP1,aP2));
       
  1019     }
       
  1020 
       
  1021 
       
  1022 EXPORT_C void AknListBoxLayouts::SetupGridFormGfxCell(CAknGrid& aGrid, CFormattedCellListBoxItemDrawer* aItemDrawer, TInt aIndex,
       
  1023                                 const TAknWindowLineLayout &aLine,
       
  1024                                 TPoint& aP1, TPoint& aP2)
       
  1025     {
       
  1026     TRAP_IGNORE(SetupFormGfxCellL(aGrid, aItemDrawer, aIndex, aLine.il, aLine.it, aLine.ir, aLine.ib, aLine.iW, aLine.iH,aP1,aP2));
       
  1027     }
       
  1028 
       
  1029 EXPORT_C void AknListBoxLayouts::SetupColumnTextCell(CEikListBox& aListBox, 
       
  1030                                 CColumnListBoxItemDrawer* aItemDrawer, 
       
  1031                                 TInt aIndex,
       
  1032                                 const TAknTextLineLayout &aLayout,
       
  1033                                 TInt startx, 
       
  1034                                 TInt endx)
       
  1035     {
       
  1036     TSize sz( ListBoxItemSize(aListBox, aItemDrawer) );
       
  1037     TInt B = AknLayoutUtils::CorrectBaseline(sz.iHeight, aLayout.iB, aLayout.FontId());
       
  1038     const CFont *font = AknLayoutUtils::FontFromId(aLayout.FontId());
       
  1039     CGraphicsContext::TTextAlign align = AknLayoutUtils::TextAlignFromId(aLayout.iJ);
       
  1040     SetupColumnTextCell(aListBox, aItemDrawer, aIndex, font, aLayout.iC, aLayout.il, aLayout.ir, B, aLayout.iW, align, startx,endx);
       
  1041     }
       
  1042 
       
  1043 EXPORT_C void AknListBoxLayouts::SetupFormTextCell( CEikListBox& /*aListBox*/,
       
  1044                                                    CFormattedCellListBoxItemDrawer* aItemDrawer,
       
  1045                                                    TInt aIndex,
       
  1046                                                    const TAknTextLineLayout &aLayout,
       
  1047                                                    const TPoint& p1,
       
  1048                                                    const TPoint& p2 )
       
  1049     {
       
  1050     _AKNTRACE( "[%s][%s][%d]", "AknListBoxLayouts", __FUNCTION__, __LINE__ );
       
  1051     CFormattedCellListBoxData* d( aItemDrawer->FormattedCellData() );
       
  1052     TRAP_IGNORE( d->SetTextSubCellL( aIndex, aLayout ) );
       
  1053     d->SubCellsMightIntersect( ETrue );
       
  1054 
       
  1055     // new layout system sets subcell's position etc. However, if this
       
  1056     // fallback method is used, old p1 and p2 need to override
       
  1057     // position given by layout. Subcell position & size are not used
       
  1058     // by new drawing system, but might be queried by 3rd party apps.
       
  1059     TRAP_IGNORE( d->SetSubCellPositionL( aIndex, p1 );
       
  1060                  d->SetSubCellSizeL( aIndex,TSize( (p2-p1).iX, (p2-p1).iY ) ));
       
  1061     d->UseScalableLayoutData( ETrue );
       
  1062     }
       
  1063 
       
  1064 EXPORT_C void AknListBoxLayouts::SetupColumnGfxCell(CEikListBox& aListBox, 
       
  1065                    CColumnListBoxItemDrawer* aItemDrawer, 
       
  1066                    TInt aIndex,
       
  1067                    const TAknWindowLineLayout &aLayout,
       
  1068                    TInt startx, 
       
  1069                    TInt endx)
       
  1070     {
       
  1071     SetupColumnGfxCell(aListBox, aItemDrawer, aIndex, aLayout.il, aLayout.it, aLayout.ir, aLayout.ib, aLayout.iW, aLayout.iH, startx, endx);
       
  1072     }
       
  1073 
       
  1074 EXPORT_C void
       
  1075 AknListBoxLayouts::SetupFormGfxCell( CEikListBox& /*aListBox*/, 
       
  1076                                      CFormattedCellListBoxItemDrawer* aItemDrawer, 
       
  1077                                      TInt aIndex,
       
  1078                                      const TAknWindowLineLayout &aLayout,
       
  1079                                      const TPoint& p1, 
       
  1080                                      const TPoint& p2 )
       
  1081     {
       
  1082     _AKNTRACE( "[%s][%s][%d]", "AknListBoxLayouts", __FUNCTION__, __LINE__ );
       
  1083     CFormattedCellListBoxData* d( aItemDrawer->FormattedCellData() );
       
  1084     TRAP_IGNORE( d->SetGraphicSubCellL( aIndex, aLayout ) );
       
  1085     d->SubCellsMightIntersect( ETrue );
       
  1086 
       
  1087     // new layout system sets subcell's position etc. However, if this
       
  1088     // fallback method is used, old p1 and p2 need to override
       
  1089     // position given by layout. Subcell position & size are not used
       
  1090     // by new drawing system, but might be queried by 3rd party apps.
       
  1091     TRAP_IGNORE( d->SetSubCellPositionL( aIndex, p1 );
       
  1092                  d->SetSubCellSizeL( aIndex, TSize( (p2-p1).iX, (p2-p1).iY)));
       
  1093     d->UseScalableLayoutData( ETrue );
       
  1094     }
       
  1095 
       
  1096 EXPORT_C void AknListBoxLayouts::SetupFormTextCell(CEikListBox& aListBox, CFormattedCellListBoxItemDrawer* aItemDrawer, 
       
  1097                  TInt index,
       
  1098                  const CFont *font, 
       
  1099                  TInt C, 
       
  1100                  TInt lm, 
       
  1101                  TInt rm, 
       
  1102                  TInt B, 
       
  1103                  TInt W, 
       
  1104                  CGraphicsContext::TTextAlign aAlign, 
       
  1105                  TPoint /*p1*/, 
       
  1106                  TPoint /*p2*/)
       
  1107     {
       
  1108     _AKNTRACE( "[%s][%s][%d]", "AknListBoxLayouts", __FUNCTION__, __LINE__ );
       
  1109     TSize size( ListBoxItemSize( aListBox, aItemDrawer ) );
       
  1110 
       
  1111     if ( IsParentRelative( lm ) ) { lm = size.iWidth - ELayoutP + lm; }
       
  1112     if ( IsParentRelative( rm ) ) { rm = size.iWidth - ELayoutP + rm; }
       
  1113     if ( IsParentRelative( W ) ) { W = size.iWidth - ELayoutP + W; }
       
  1114 
       
  1115     if ( IsEmptyVal( lm ) ) { lm = size.iWidth - rm - W; }
       
  1116     if ( IsEmptyVal( rm ) ) { rm = size.iWidth - lm - W; }
       
  1117     if ( IsEmptyVal( W ) ) { W = size.iWidth - lm - rm; }
       
  1118 
       
  1119     TAknTextLineLayout textLine;
       
  1120     textLine.iC = C;                        // color
       
  1121     textLine.il = lm;                       // left
       
  1122     textLine.ir = rm;                       // right
       
  1123     textLine.iB = B;                        // baseline
       
  1124     textLine.iW = ELayoutEmpty;             // width
       
  1125     textLine.iJ = IdFromTextAlign( aAlign );// justification
       
  1126     // font id - must not be ELayoutEmpty, because it will crash in chinece variant
       
  1127     textLine.iFont = EAknLogicalFontPrimaryFont;
       
  1128     textLine.iBaselineSkip = 0;           
       
  1129     textLine.iNumberOfLinesShown = 1;
       
  1130     
       
  1131     TRAP_IGNORE( aItemDrawer->FormattedCellData()->SetTextSubCellL( index, textLine );
       
  1132                  aItemDrawer->FormattedCellData()->SetSubCellFontL( index, font ) );
       
  1133     aItemDrawer->FormattedCellData()->SubCellsMightIntersect( ETrue );
       
  1134     aItemDrawer->FormattedCellData()->UseScalableLayoutData( ETrue );
       
  1135     if (C != 215) // Black is default text color and we don't want to set all colors... 
       
  1136         {
       
  1137         CFormattedCellListBoxData::TColors colors;
       
  1138         colors.iText = AKN_LAF_COLOR_STATIC(C);
       
  1139         colors.iBack = aItemDrawer->BackColor();
       
  1140         colors.iHighlightedText = aItemDrawer->HighlightedTextColor();
       
  1141         colors.iHighlightedBack = aItemDrawer->HighlightedBackColor();
       
  1142         TRAP_IGNORE( 
       
  1143             aItemDrawer->FormattedCellData()->SetSubCellColorsL(index, colors));
       
  1144         }
       
  1145     }
       
  1146 
       
  1147 EXPORT_C void AknListBoxLayouts::SetupFormAntiFlickerTextCell(CEikListBox& /*aListBox*/, CFormattedCellListBoxItemDrawer* aItemDrawer,
       
  1148                            TInt aIndex,
       
  1149                            const TAknTextLineLayout &aLayout,
       
  1150                            const TPoint& /*p1*/,
       
  1151                            const TPoint& /*p2*/)
       
  1152     {
       
  1153     TRAP_IGNORE( aItemDrawer->FormattedCellData()->SetTextSubCellL( aIndex, aLayout ) );
       
  1154     aItemDrawer->FormattedCellData()->SubCellsMightIntersect( ETrue );
       
  1155     }
       
  1156 
       
  1157 EXPORT_C void AknListBoxLayouts::SetupFormAntiFlickerTextCell(CEikListBox& aListBox, CFormattedCellListBoxItemDrawer* aItemDrawer, 
       
  1158                  TInt index,
       
  1159                  const CFont *font, 
       
  1160                  TInt C, 
       
  1161                  TInt lm, 
       
  1162                  TInt rm, 
       
  1163                  TInt B, 
       
  1164                  TInt W, 
       
  1165                  CGraphicsContext::TTextAlign aAlign, 
       
  1166                  TPoint p1, 
       
  1167                  TPoint p2)
       
  1168     {
       
  1169     SetupFormTextCell( aListBox, aItemDrawer, index, font, C, lm, rm, B, W, aAlign, p1, p2 );
       
  1170     }
       
  1171 
       
  1172 // this is common popuplist setup code
       
  1173 static TSize PopupListItemSize(const TAknWindowLineLayout &aL)
       
  1174     {
       
  1175     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
  1176     TAknLayoutRect temp, layout;
       
  1177     TRect mainPane;
       
  1178     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EPopupParent, mainPane );
       
  1179 
       
  1180     temp.LayoutRect( mainPane, AknLayoutScalable_Avkon::popup_menu_window(13));
       
  1181     
       
  1182     TRect screenRect;
       
  1183     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect ); 
       
  1184     TAknWindowLineLayout lineLayout = AknLayoutScalable_Avkon::listscroll_menu_pane(0).LayoutLine();
       
  1185     
       
  1186     // Layout data of listscroll_menu_pane are changed for CR 417-35260.
       
  1187     // The change is just for QHD landscape model.
       
  1188     // The CR makes listscroll_menu_pane's ir or il bigger than normal,
       
  1189     // so that width of list item is smaller than needs. Then, first cell 
       
  1190     // of list item can not be drawn on proper position.
       
  1191     // Adjustment of layout is a solution for this problem. This is not a perfect idea, but
       
  1192     // creating a new layout for popuplist is too complex to do that. Adjustment is a must.
       
  1193     if(Layout_Meta_Data::IsLandscapeOrientation())       
       
  1194         {
       
  1195         TInt offset  = AknListBoxLayouts::AdjustPopupLayoutData( screenRect );
       
  1196         if (!AknLayoutUtils::LayoutMirrored())
       
  1197             {
       
  1198             lineLayout.ir -= offset;
       
  1199             }
       
  1200         else
       
  1201             {
       
  1202             lineLayout.il -= offset;
       
  1203             }
       
  1204         }
       
  1205     layout.LayoutRect( temp.Rect(), lineLayout);
       
  1206    
       
  1207     temp.LayoutRect( layout.Rect(), AknLayoutScalable_Avkon::list_menu_pane(0));
       
  1208     layout.LayoutRect( temp.Rect(), aL);
       
  1209 
       
  1210     return layout.Rect().Size();
       
  1211     }
       
  1212 
       
  1213 static void SetupCommonPopupListL(CEikFormattedCellListBox* aListBox, const TAknWindowLineLayout &aLayout )
       
  1214     {
       
  1215     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
  1216     CFormattedCellListBoxItemDrawer *itemDrawer = aListBox->ItemDrawer();
       
  1217 
       
  1218     AknListBoxLayouts::SetupStandardListBox( *aListBox );
       
  1219     AknListBoxLayouts::SetupStandardFormListbox( itemDrawer );
       
  1220     AknListBoxLayouts::SetupListboxPosL( *aListBox, aLayout );
       
  1221 
       
  1222     itemDrawer->FormattedCellData()->ResetSLSubCellArray();
       
  1223     itemDrawer->SetItemCellSize( PopupListItemSize( aLayout ) );
       
  1224     }
       
  1225 
       
  1226 //
       
  1227 // AVKON STYLE LISTBOXES!
       
  1228 //
       
  1229 
       
  1230 static TAknLayoutRect CommonLayoutRect(TAknWindowLineLayout aLayoutLine,
       
  1231                                        TAknWindowLineLayout aParent)
       
  1232     {
       
  1233     TAknLayoutRect parent;
       
  1234 
       
  1235     TRect mainPane;
       
  1236     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EPopupParent, mainPane );
       
  1237     parent.LayoutRect( mainPane, aParent );
       
  1238 
       
  1239     TAknLayoutRect layout;
       
  1240     layout.LayoutRect(parent.Rect(), aLayoutLine);
       
  1241     return layout;
       
  1242     }
       
  1243 
       
  1244 static TAknLayoutRect CommonLayoutRect(TAknWindowLineLayout aLayoutLine,
       
  1245                                        TAknWindowLineLayout aParent,
       
  1246                                        TAknWindowLineLayout aGrandParent)
       
  1247     {    
       
  1248     TAknLayoutRect parent = CommonLayoutRect(aParent, aGrandParent);
       
  1249     TAknLayoutRect layout;
       
  1250     layout.LayoutRect(parent.Rect(), aLayoutLine);
       
  1251     return layout;
       
  1252     }
       
  1253 
       
  1254 // extended skin support
       
  1255 static void SetESSTextColor( CListItemDrawer* aItemDrawer,
       
  1256                              TAknsQsnTextColorsIndex aIndex )
       
  1257     {
       
  1258     TRgb color( KRgbBlack );  // sane default for nonskinned case
       
  1259 
       
  1260     // unfortunately, we still need to check this. It is still
       
  1261     // possible in 3.0 to create an application, that is not
       
  1262     // skinned. If skinning is not checked here, it is possible to
       
  1263     // have a list with white background and white text.
       
  1264     
       
  1265     if ( AknsUtils::AvkonSkinEnabled() )
       
  1266         {
       
  1267         // this does not modify color unless it gets a correct one
       
  1268         // no real need to check errors
       
  1269         AknsUtils::GetCachedColor( AknsUtils::SkinInstance(),
       
  1270                                    color, KAknsIIDQsnTextColors, aIndex );
       
  1271         }
       
  1272 
       
  1273     aItemDrawer->SetTextColor( color );
       
  1274     }
       
  1275 
       
  1276 
       
  1277 // extended skin support
       
  1278 static void SetESSHighlightedTextColor( CListItemDrawer* aItemDrawer,
       
  1279                                         TAknsQsnTextColorsIndex aIndex )
       
  1280     {
       
  1281     TRgb color( KRgbBlack );
       
  1282     if ( AknsUtils::AvkonSkinEnabled() )
       
  1283         {
       
  1284         // this does not modify color unless it gets a correct one
       
  1285         // no real need to check errors
       
  1286         AknsUtils::GetCachedColor( AknsUtils::SkinInstance(),
       
  1287                                    color, KAknsIIDQsnTextColors, aIndex );
       
  1288         }
       
  1289     aItemDrawer->SetHighlightedTextColor( color );
       
  1290     }
       
  1291 
       
  1292 static void SetESSHighlightedTextColor( CListItemDrawer* aItemDrawer )
       
  1293     {
       
  1294     SetESSHighlightedTextColor( aItemDrawer, EAknsCIQsnTextColorsCG10 );
       
  1295     }
       
  1296 
       
  1297 
       
  1298 // extended skin support
       
  1299 static void SetESSHighlightedTextColor( CFormattedCellListBoxData::TColors& aColors,
       
  1300                                         TAknsQsnTextColorsIndex aIndex )
       
  1301     {
       
  1302     TRgb color( aIndex == EAknsCIQsnTextColorsCG12 ? KRgbWhite : KRgbBlack );
       
  1303     if ( AknsUtils::AvkonSkinEnabled() )
       
  1304         {
       
  1305         // this does not modify color unless it gets a correct one
       
  1306         // no real need to check errors
       
  1307         AknsUtils::GetCachedColor( AknsUtils::SkinInstance(),
       
  1308                                    color, KAknsIIDQsnTextColors, aIndex );
       
  1309         }
       
  1310 
       
  1311     aColors.iHighlightedText = color;
       
  1312     }
       
  1313 
       
  1314 static void SetESSTextColor( CFormattedCellListBoxData::TColors& aColors,
       
  1315                              TAknsQsnTextColorsIndex aIndex )
       
  1316     {
       
  1317     TRgb color( aIndex == EAknsCIQsnTextColorsCG12 ? KRgbWhite : KRgbBlack );
       
  1318     if ( AknsUtils::AvkonSkinEnabled() )
       
  1319         {
       
  1320         // this does not modify color unless it gets a correct one
       
  1321         // no real need to check errors
       
  1322         AknsUtils::GetCachedColor( AknsUtils::SkinInstance(),
       
  1323                                    color, KAknsIIDQsnTextColors, aIndex );
       
  1324         }
       
  1325     aColors.iText = color;
       
  1326     }
       
  1327 
       
  1328 
       
  1329 // -----------------------------------------------------------------------------
       
  1330 // SetupStretchableListL
       
  1331 // -----------------------------------------------------------------------------
       
  1332 //
       
  1333 static void SetupStretchableListL( 
       
  1334             CEikFormattedCellListBox* aListBox,
       
  1335             const TAknWindowComponentLayout& aNormalLayout,
       
  1336 #ifdef RD_LIST_STRETCH
       
  1337             const TAknWindowComponentLayout& aStretchedLayout,
       
  1338 #else            
       
  1339             const TAknWindowComponentLayout& /*aStretchedLayout*/,
       
  1340 #endif // RD_LIST_STRETCH
       
  1341             const TBool aSetColors = ETrue )
       
  1342     {
       
  1343     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
  1344     const TAknWindowComponentLayout* listLayout;
       
  1345 
       
  1346 #ifdef RD_LIST_STRETCH
       
  1347     if ( Layout_Meta_Data::IsLandscapeOrientation() &&
       
  1348          Layout_Meta_Data::IsListStretchingEnabled() &&
       
  1349          aListBox->ItemDrawer()->FormattedCellData()->StretchingEnabled() )
       
  1350         {
       
  1351         listLayout = &aStretchedLayout;
       
  1352         }
       
  1353     else
       
  1354 #endif // RD_LIST_STRETCH
       
  1355         {
       
  1356         listLayout = &aNormalLayout;
       
  1357         }
       
  1358     
       
  1359     TAknWindowComponentLayout layout = TAknWindowComponentLayout::Compose(
       
  1360         AknLayoutScalable_Avkon::listscroll_gen_pane( 0 ),
       
  1361         TAknWindowComponentLayout::Compose( 
       
  1362         AknLayoutScalable_Avkon::list_gen_pane( 0 ), *listLayout ) );
       
  1363 
       
  1364     AknListBoxLayouts::SetupStandardListBox( *aListBox );
       
  1365     AknListBoxLayouts::SetupStandardFormListbox( aListBox->ItemDrawer() );
       
  1366     AknListBoxLayouts::SetupListboxPosL( *aListBox, layout.LayoutLine() );
       
  1367     
       
  1368     if ( aSetColors && AknsUtils::AvkonSkinEnabled() )
       
  1369         {
       
  1370         SetESSHighlightedTextColor( aListBox->ItemDrawer() );
       
  1371         SetESSTextColor( aListBox->ItemDrawer(), EAknsCIQsnTextColorsCG6 );
       
  1372         }
       
  1373 
       
  1374     aListBox->ItemDrawer()->FormattedCellData()->ResetSLSubCellArray();
       
  1375     }
       
  1376 
       
  1377 // -----------------------------------------------------------------------------
       
  1378 // SetupStretchableListL
       
  1379 // -----------------------------------------------------------------------------
       
  1380 //
       
  1381 static void SetupStretchableListL( 
       
  1382             CEikColumnListBox* aListBox,
       
  1383             const TAknWindowComponentLayout& aNormalLayout,
       
  1384             const TAknWindowComponentLayout& aStretchedLayout )
       
  1385     {
       
  1386     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
  1387     const TAknWindowComponentLayout* listLayout;
       
  1388     
       
  1389     if ( Layout_Meta_Data::IsLandscapeOrientation() )
       
  1390         {
       
  1391         listLayout = &aStretchedLayout;
       
  1392         }
       
  1393     else
       
  1394         {
       
  1395         listLayout = &aNormalLayout;
       
  1396         }
       
  1397     
       
  1398     TAknWindowComponentLayout layout = TAknWindowComponentLayout::Compose(
       
  1399         AknLayoutScalable_Avkon::listscroll_gen_pane( 0 ),
       
  1400         TAknWindowComponentLayout::Compose( 
       
  1401         AknLayoutScalable_Avkon::list_gen_pane( 0 ), *listLayout ) );
       
  1402 
       
  1403     AknListBoxLayouts::SetupStandardListBox( *aListBox );
       
  1404     AknListBoxLayouts::SetupStandardColumnListbox( aListBox->ItemDrawer() );
       
  1405     AknListBoxLayouts::SetupListboxPosL( *aListBox, layout.LayoutLine() );
       
  1406     
       
  1407     if ( AknsUtils::AvkonSkinEnabled() )
       
  1408         {
       
  1409         SetESSHighlightedTextColor( aListBox->ItemDrawer() );
       
  1410         SetESSTextColor( aListBox->ItemDrawer(), EAknsCIQsnTextColorsCG6 );
       
  1411         }
       
  1412 
       
  1413     aListBox->ItemDrawer()->ColumnData()->ResetSLSubCellArray();
       
  1414     }
       
  1415 
       
  1416 // -----------------------------------------------------------------------------
       
  1417 // SetupListL
       
  1418 // -----------------------------------------------------------------------------
       
  1419 //
       
  1420 static void SetupListL( CEikColumnListBox* aListBox,
       
  1421                        const TAknWindowComponentLayout& aNormalLayout )
       
  1422     {
       
  1423     SetupStretchableListL( aListBox, aNormalLayout, aNormalLayout );
       
  1424     }
       
  1425 
       
  1426 // -----------------------------------------------------------------------------
       
  1427 // ShowAllRows
       
  1428 // -----------------------------------------------------------------------------
       
  1429 //
       
  1430 #ifdef RD_LIST_STRETCH
       
  1431 static TBool ShowAllRows( CFormattedCellListBoxData* aData )
       
  1432     {
       
  1433     TBool result( aData->SecondRowHidden() & aData->StretchingEnabled() );
       
  1434     result &= Layout_Meta_Data::IsLandscapeOrientation();
       
  1435     result &= Layout_Meta_Data::IsListStretchingEnabled();
       
  1436     result |= !aData->SecondRowHidden();
       
  1437 
       
  1438     return result;
       
  1439     }
       
  1440 #else
       
  1441 static TBool ShowAllRows( CFormattedCellListBoxData* /*aData*/ )
       
  1442     {
       
  1443     return ETrue;    
       
  1444     }
       
  1445 #endif // RD_LIST_STRETCH
       
  1446 
       
  1447 EXPORT_C CAknSingleStyleListBox::CAknSingleStyleListBox() : AKNCOLUMNLISTBOXNAME(R_LIST_PANE_LINES_A_COLUMN) { AKNTASHOOK_ADD( this, "CAknSingleStyleListBox" ); }
       
  1448 
       
  1449 EXPORT_C CAknSingleNumberStyleListBox::CAknSingleNumberStyleListBox() : AKNCOLUMNLISTBOXNAME(R_LIST_PANE_LINES_AB_COLUMN) { AKNTASHOOK_ADD( this, "CAknSingleNumberStyleListBox" ); }
       
  1450 
       
  1451 EXPORT_C CAknSingleHeadingStyleListBox::CAknSingleHeadingStyleListBox() : AKNCOLUMNLISTBOXNAME(R_LIST_PANE_LINES_BC_COLUMN) { AKNTASHOOK_ADD( this, "CAknSingleHeadingStyleListBox" ); }
       
  1452 
       
  1453 EXPORT_C void CAknSingleHeadingStyleListBox::CreateItemDrawerL() 
       
  1454     {
       
  1455     CColumnListBoxData* columnData=CColumnListBoxData::NewL();
       
  1456     CleanupStack::PushL(columnData);
       
  1457     __ASSERT_DEBUG(iItemDrawer == 0, Panic(EAknPanicOutOfRange));
       
  1458     iItemDrawer=new(ELeave)CSingleHeadingStyleItemDrawer(Model(), iEikonEnv->NormalFont(), columnData);
       
  1459     CleanupStack::Pop();
       
  1460     }
       
  1461 
       
  1462 
       
  1463 EXPORT_C void CAknSetStyleListBox::CreateItemDrawerL() 
       
  1464     {
       
  1465     CFormattedCellListBoxData* cellData=CSettingItemEditingListBoxData::NewL();
       
  1466     CleanupStack::PushL(cellData);
       
  1467     __ASSERT_DEBUG(iItemDrawer == 0, Panic(EAknPanicOutOfRange));
       
  1468     iItemDrawer=new(ELeave)CFormattedCellListBoxItemDrawer(Model(), iEikonEnv->NormalFont(), cellData);
       
  1469     CleanupStack::Pop();
       
  1470     }
       
  1471 
       
  1472 EXPORT_C void CAknFormGraphicStyleListBox::CreateItemDrawerL() 
       
  1473     {
       
  1474     CFormattedCellListBoxData* cellData=CFormGraphicListBoxData::NewL();
       
  1475     CleanupStack::PushL(cellData);
       
  1476     __ASSERT_DEBUG(iItemDrawer == 0, Panic(EAknPanicOutOfRange));
       
  1477     iItemDrawer=new(ELeave)CFormattedCellListBoxItemDrawer(Model(), iEikonEnv->NormalFont(), cellData);
       
  1478     CleanupStack::Pop();
       
  1479     }
       
  1480 
       
  1481 
       
  1482 EXPORT_C void CAknDoublePopupMenuStyleListBox::CreateItemDrawerL() 
       
  1483     {
       
  1484     CFormattedCellListBoxData* cellData=CPopupFormattedListBoxData::NewL();
       
  1485     CleanupStack::PushL(cellData);
       
  1486     __ASSERT_DEBUG(iItemDrawer == 0, Panic(EAknPanicOutOfRange));
       
  1487     iItemDrawer=new(ELeave)CFormattedCellListBoxItemDrawer(Model(), iEikonEnv->NormalFont(), cellData);
       
  1488     CleanupStack::Pop();
       
  1489     }
       
  1490 
       
  1491 EXPORT_C void CAknSinglePopupMenuStyleListBox::CreateItemDrawerL() 
       
  1492     {
       
  1493     CFormattedCellListBoxData* cellData=CPopupFormattedListBoxData::NewL();
       
  1494     CleanupStack::PushL(cellData);
       
  1495     __ASSERT_DEBUG(iItemDrawer == 0, Panic(EAknPanicOutOfRange));
       
  1496     iItemDrawer=new(ELeave)CFormattedCellListBoxItemDrawer(Model(), iEikonEnv->NormalFont(), cellData);
       
  1497     CleanupStack::Pop();
       
  1498     }
       
  1499 
       
  1500 EXPORT_C void CAknSingleGraphicPopupMenuStyleListBox::CreateItemDrawerL() 
       
  1501     {
       
  1502     CFormattedCellListBoxData* cellData=CPopupFormattedListBoxData::NewL();
       
  1503     CleanupStack::PushL(cellData);
       
  1504     __ASSERT_DEBUG(iItemDrawer == 0, Panic(EAknPanicOutOfRange));
       
  1505     iItemDrawer=new(ELeave)CFormattedCellListBoxItemDrawer(Model(), iEikonEnv->NormalFont(), cellData);
       
  1506     CleanupStack::Pop();
       
  1507     }
       
  1508 
       
  1509 EXPORT_C void CAknSingleGraphicHeadingPopupMenuStyleListBox::CreateItemDrawerL() 
       
  1510     {
       
  1511     CFormattedCellListBoxData* cellData=CPopupFormattedListBoxData::NewL();
       
  1512     CleanupStack::PushL(cellData);
       
  1513     __ASSERT_DEBUG(iItemDrawer == 0, Panic(EAknPanicOutOfRange));
       
  1514     iItemDrawer=new(ELeave)CFormattedCellListBoxItemDrawer(Model(), iEikonEnv->NormalFont(), cellData);
       
  1515     CleanupStack::Pop();
       
  1516     }
       
  1517 
       
  1518 EXPORT_C void CAknSingleHeadingPopupMenuStyleListBox::CreateItemDrawerL() 
       
  1519     {
       
  1520     CFormattedCellListBoxData* cellData=CPopupFormattedListBoxData::NewL();
       
  1521     CleanupStack::PushL(cellData);
       
  1522     __ASSERT_DEBUG(iItemDrawer == 0, Panic(EAknPanicOutOfRange));
       
  1523     iItemDrawer=new(ELeave)CFormattedCellListBoxItemDrawer(Model(), iEikonEnv->NormalFont(), cellData);
       
  1524     CleanupStack::Pop();
       
  1525     }
       
  1526 
       
  1527 
       
  1528 
       
  1529 
       
  1530 
       
  1531 EXPORT_C void CAknDoubleLargeGraphicPopupMenuStyleListBox::CreateItemDrawerL() 
       
  1532     {
       
  1533     CFormattedCellListBoxData* cellData=CPopupFormattedListBoxData::NewL();
       
  1534     CleanupStack::PushL(cellData);
       
  1535     __ASSERT_DEBUG(iItemDrawer == 0, Panic(EAknPanicOutOfRange));
       
  1536     iItemDrawer=new(ELeave)CFormattedCellListBoxItemDrawer(Model(), iEikonEnv->NormalFont(), cellData);
       
  1537     CleanupStack::Pop();
       
  1538     }
       
  1539 
       
  1540 
       
  1541 EXPORT_C void CAknSingle2GraphicPopupMenuStyleListBox::CreateItemDrawerL() 
       
  1542     {
       
  1543     CFormattedCellListBoxData* cellData=CPopupFormattedListBoxData::NewL();
       
  1544     CleanupStack::PushL(cellData);
       
  1545     __ASSERT_DEBUG(iItemDrawer == 0, Panic(EAknPanicOutOfRange));
       
  1546     iItemDrawer=new(ELeave)CFormattedCellListBoxItemDrawer(Model(), iEikonEnv->NormalFont(), cellData);
       
  1547     CleanupStack::Pop();
       
  1548     }
       
  1549 
       
  1550 EXPORT_C void CAknDoubleGraphicPopupMenuStyleListBox::CreateItemDrawerL() 
       
  1551     {
       
  1552     CFormattedCellListBoxData* cellData=CPopupFormattedListBoxData::NewL();
       
  1553     CleanupStack::PushL(cellData);
       
  1554     __ASSERT_DEBUG(iItemDrawer == 0, Panic(EAknPanicOutOfRange));
       
  1555     iItemDrawer=new(ELeave)CFormattedCellListBoxItemDrawer(Model(), iEikonEnv->NormalFont(), cellData);
       
  1556     CleanupStack::Pop();
       
  1557     }
       
  1558 
       
  1559 
       
  1560 
       
  1561 EXPORT_C CListBoxView*
       
  1562 CAknSingleHeadingStyleListBox::MakeViewClassInstanceL()
       
  1563     {
       
  1564     return (new(ELeave) CSingleHeadingStyleView);
       
  1565     }
       
  1566 
       
  1567 EXPORT_C CAknSingleGraphicStyleListBox::CAknSingleGraphicStyleListBox() : AKNCOLUMNLISTBOXNAME(R_LIST_PANE_LINES_AB_COLUMN) 
       
  1568     {
       
  1569     iCoeEnv = CCoeEnv::Static();
       
  1570     AKNTASHOOK_ADD( this, "CAknSingleGraphicStyleListBox" );
       
  1571     }
       
  1572 
       
  1573 
       
  1574 EXPORT_C void CSingleHeadingStyleItemDrawer::SetTopItemIndex(TInt aTop)
       
  1575     {
       
  1576     iTopItemIndex = aTop; 
       
  1577     }
       
  1578 
       
  1579 EXPORT_C void CDoubleLargeStyleItemDrawer::DrawItem(TInt aItemIndex, TPoint aItemRectPos, TBool aItemIsSelected, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aViewIsDimmed) const
       
  1580     {
       
  1581     CFormattedCellListBoxItemDrawer::DrawItem(aItemIndex, aItemRectPos, aItemIsSelected, aItemIsCurrent, aViewIsEmphasized, aViewIsDimmed);
       
  1582     }
       
  1583 
       
  1584 
       
  1585 EXPORT_C void CSingleHeadingStyleItemDrawer::DrawItem(TInt aItemIndex, TPoint aItemRectPos, TBool aItemIsSelected, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aViewIsDimmed) const
       
  1586     {
       
  1587     TRect actualItemRect(aItemRectPos, iItemCellSize);
       
  1588     DrawActualItem(aItemIndex,actualItemRect,aItemIsCurrent, aViewIsEmphasized, aViewIsDimmed, aItemIsSelected);
       
  1589 
       
  1590     }
       
  1591 
       
  1592 
       
  1593 EXPORT_C void 
       
  1594 CWordWrappedFormattedCellItemDrawer::DrawItem( TInt aItemIndex,
       
  1595                                                TPoint aItemRectPos,
       
  1596                                                TBool aItemIsSelected,
       
  1597                                                TBool aItemIsCurrent,
       
  1598                                                TBool aViewIsEmphasized,
       
  1599                                                TBool aViewIsDimmed ) const
       
  1600     {
       
  1601     CFormattedCellListBoxItemDrawer::DrawItem( aItemIndex,
       
  1602                                                aItemRectPos,
       
  1603                                                aItemIsSelected,
       
  1604                                                aItemIsCurrent,
       
  1605                                                aViewIsEmphasized,
       
  1606                                                aViewIsDimmed );
       
  1607     }
       
  1608 
       
  1609 
       
  1610 // -----------------------------------------------------------------------------
       
  1611 // CWordWrappedFormattedCellItemDrawer::DrawItemText
       
  1612 // -----------------------------------------------------------------------------
       
  1613 //
       
  1614 EXPORT_C void 
       
  1615 CWordWrappedFormattedCellItemDrawer::DrawItemText( TInt aItemIndex,
       
  1616                                                    const TRect& aItemTextRect,
       
  1617                                                    TBool aItemIsCurrent,
       
  1618                                                    TBool /*aViewIsEmphasized*/, 
       
  1619                                                    TBool aItemIsSelected ) const
       
  1620     {
       
  1621     _AKNTRACE( "[%s][%s][%d]", "CWordWrappedFormattedCellItemDrawer", __FUNCTION__, __LINE__ );
       
  1622     iGc->SetPenColor(iTextColor);
       
  1623     iGc->SetBrushColor(iBackColor);
       
  1624     
       
  1625     TPtrC itemText = iModel->ItemText( aItemIndex );
       
  1626 
       
  1627     SetupGc(aItemIndex);
       
  1628 
       
  1629 
       
  1630     TBufC<KMaxTotalDataLength> target;
       
  1631     // AVKON ITEM MARKS!
       
  1632 
       
  1633     TPtrC repl;
       
  1634     TInt pos = -1;
       
  1635 
       
  1636     TBool removeicon = (!aItemIsSelected && !ItemMarkReverse()) || (aItemIsSelected && ItemMarkReverse());
       
  1637     if ( Flags() & EDrawMarkSelection && ItemMarkPosition() != -1 && removeicon)
       
  1638         {
       
  1639         repl.Set( ItemMarkReplacement() );
       
  1640         pos = ItemMarkPosition();
       
  1641         } 
       
  1642 
       
  1643 #ifdef RD_LIST_STRETCH
       
  1644     // +2 is for the last column separator and space between the first and the
       
  1645     // second text lines in case they are concanated.
       
  1646     TInt size( itemText.Length() + repl.Length() + 2 );
       
  1647 #else
       
  1648     // (+1 is for the last column separator)
       
  1649     TInt size = itemText.Length() + repl.Length() + 1;
       
  1650 #endif // RD_LIST_STRETCH
       
  1651     if ( pos >= 0 )
       
  1652         {
       
  1653         size += pos; // space for other column separators
       
  1654         }
       
  1655 
       
  1656     HBufC* buffer = HBufC::New( size );
       
  1657     if ( !buffer )
       
  1658         {
       
  1659         return;
       
  1660         }
       
  1661 
       
  1662     TPtr des = ( buffer ? buffer->Des() : target.Des() );
       
  1663     // Note that ReplaceColumn does not update correct length in variable 'des',
       
  1664     // because it is not a reference parameter :(
       
  1665     AknLAFUtils::ReplaceColumn(des, &itemText, &repl, '\t', pos);
       
  1666     des.Set( buffer->Des() );
       
  1667 
       
  1668     // END OF ITEM MARKS!
       
  1669     
       
  1670     TPtr targetptr = des;
       
  1671     TBufC<KMaxTotalDataLength> target2(KNullDesC);
       
  1672 
       
  1673     // Try to allocate buffer dynamically. If out of memory, use the fixed size stack buffer.
       
  1674     // This size should be sufficient.
       
  1675     size = targetptr.Length() * 2;
       
  1676     HBufC* buffer2 = HBufC::New( size );
       
  1677     if ( !buffer2 )
       
  1678         {
       
  1679         delete buffer;
       
  1680         return;
       
  1681         }
       
  1682 
       
  1683     TPtr des2 = buffer2->Des();
       
  1684 
       
  1685 #ifdef RD_LIST_STRETCH
       
  1686     // If list strecthing is enabled and the device is in landscape orientation
       
  1687     // then one-line layout should be used -> we must move the second text line 
       
  1688     // after the first line if two independent lines are specified. 
       
  1689     // Otherwerwise the first text line can be used as it is.
       
  1690     if ( Layout_Meta_Data::IsLandscapeOrientation() &&
       
  1691          Layout_Meta_Data::IsListStretchingEnabled() &&
       
  1692          FormattedCellData()->StretchingEnabled() )
       
  1693         {
       
  1694         TPtrC itemText;
       
  1695         TextUtils::ColumnText( itemText, iSubCell, &targetptr );
       
  1696 
       
  1697         TPtrC secondaryText;
       
  1698         TextUtils::ColumnText( secondaryText, iSubCell2, &targetptr );
       
  1699         
       
  1700         if ( secondaryText.Length() > 0 )
       
  1701             {
       
  1702             // append secondary text after the item text
       
  1703             TInt columnPos = targetptr.FindF( secondaryText );
       
  1704             
       
  1705             if ( columnPos != KErrNotFound )
       
  1706                 {
       
  1707                 --columnPos; // subtract column separator
       
  1708                 targetptr.Replace( columnPos, secondaryText.Length(), secondaryText );
       
  1709                 targetptr[columnPos + secondaryText.Length()] = '\t';
       
  1710                 targetptr.Insert( columnPos, KEmptySpace );
       
  1711                 }
       
  1712             }
       
  1713         
       
  1714         des2.Append( targetptr );
       
  1715         }
       
  1716     else
       
  1717         {
       
  1718         WordWrapListItem(des2, targetptr, iSubCell,iSubCell2, aItemIndex);
       
  1719         // Set again because ReplaceColumn in WordWrapListItem does not update the length to 'des2' !
       
  1720         des2.Set( buffer2 ? buffer2->Des() : target2.Des() );
       
  1721         }
       
  1722 #else
       
  1723     WordWrapListItem(des2, targetptr, iSubCell,iSubCell2, aItemIndex);
       
  1724 #endif // RD_LIST_STRETCH    
       
  1725 
       
  1726     // Set again because ReplaceColumn in WordWrapListItem does not update the length to 'des2' !
       
  1727     des2.Set( buffer2->Des() );
       
  1728 
       
  1729     DrawBackgroundAndSeparatorLines( aItemTextRect );
       
  1730 
       
  1731     if( aItemIsCurrent )
       
  1732         {
       
  1733         FormattedCellData()->SetCurrentItemIndex(aItemIndex); // fonts for java
       
  1734         }
       
  1735         
       
  1736     FormattedCellData()->SetCurrentlyDrawnItemIndex( aItemIndex );
       
  1737     
       
  1738     CFormattedCellListBoxData::TColors colors;
       
  1739     colors.iText=iTextColor;
       
  1740     colors.iBack=iBackColor;
       
  1741     colors.iHighlightedText=iHighlightedTextColor;
       
  1742     colors.iHighlightedBack=iHighlightedBackColor;
       
  1743     FormattedCellData()->Draw( Properties( aItemIndex ),
       
  1744                                *iGc,
       
  1745                                &des2,
       
  1746                                aItemTextRect,
       
  1747                                aItemIsCurrent, colors );
       
  1748     
       
  1749     delete buffer2;
       
  1750     delete buffer;
       
  1751     }
       
  1752 
       
  1753 EXPORT_C void CAknColumnListBoxView::EnableFindEmptyList()
       
  1754     {
       
  1755     SetFindEmptyListState(ETrue);
       
  1756     }
       
  1757 
       
  1758 EXPORT_C void CAknColumnListBoxView::SetFindEmptyListState(TBool aUsedWithFind)
       
  1759     {
       
  1760     iEmptyListWithFind = aUsedWithFind;
       
  1761     }
       
  1762 
       
  1763 TBool CAknColumnListBoxView::GetFindEmptyListState()
       
  1764     {
       
  1765     return iEmptyListWithFind;
       
  1766     }
       
  1767 
       
  1768 EXPORT_C void CAknColumnListBoxView::DrawEmptyList(const TRect &aClientRect) const 
       
  1769     {
       
  1770     _AKNTRACE( "[%s][%s][%d]", "CAknColumnListBoxView", __FUNCTION__, __LINE__ );
       
  1771     if (RedrawDisabled() || !IsVisible())
       
  1772         return;
       
  1773     CColumnListBoxItemDrawer *id = (CColumnListBoxItemDrawer*)ItemDrawer();
       
  1774     if (id && id->ColumnData()) // OOM test of itemdrawer and data.
       
  1775         { 
       
  1776         if (!iEmptyListWithFind)
       
  1777             {
       
  1778             AknDrawWithSkins::DrawEmptyList(aClientRect, *iGc, *EmptyListText(), id->ColumnData()->Control());
       
  1779             } 
       
  1780         else
       
  1781             {
       
  1782             AknDrawWithSkins::DrawEmptyListWithFind(aClientRect, *iGc, *EmptyListText(), id->ColumnData()->Control());
       
  1783             }
       
  1784         }
       
  1785     }
       
  1786 
       
  1787 EXPORT_C void CAknColumnListBoxView::CalcBottomItemIndex()
       
  1788     {
       
  1789     CColumnListBoxView::CalcBottomItemIndex();
       
  1790     //
       
  1791     // The next piece of code removes filtering from find box when
       
  1792     // new list items are added.
       
  1793     //     
       
  1794     if (Flags() & EItemCountModified)
       
  1795     {
       
  1796     CAknFilteredTextListBoxModel *model = STATIC_CAST(CAknFilteredTextListBoxModel*,iModel);
       
  1797     CAknListBoxFilterItems *filter = model ? model->Filter() : 0;
       
  1798     if (filter) 
       
  1799         {
       
  1800         TRAP_IGNORE(filter->ResetFilteringL());
       
  1801 
       
  1802         }
       
  1803     }
       
  1804     }
       
  1805 
       
  1806 EXPORT_C TAny* CAknColumnListBoxView::Reserved_1()
       
  1807     {
       
  1808     return NULL;
       
  1809     }
       
  1810 
       
  1811 
       
  1812 EXPORT_C void CSingleHeadingStyleView::DrawEmptyList(const TRect& aClientRect) const 
       
  1813     {
       
  1814     CAknColumnListBoxView::DrawEmptyList(aClientRect);
       
  1815     }
       
  1816 
       
  1817 EXPORT_C TAny* CSingleHeadingStyleView::Reserved_1()
       
  1818     {
       
  1819     return NULL;
       
  1820     }
       
  1821 
       
  1822 
       
  1823 EXPORT_C void CAknSetStyleListBox::Draw(const TRect& aRect) const
       
  1824     {
       
  1825     // NOTE THIS DRAW METHOD MUST NOT CALL THE BASE CLASS METHODS!
       
  1826     // THE ClearMargins() call should NOT be called with Set Style Lists!
       
  1827 
       
  1828     if (iModel->NumberOfItems() == 0)
       
  1829         {
       
  1830         iView->DrawEmptyList(Rect());
       
  1831         }
       
  1832     else
       
  1833         {
       
  1834 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
  1835         MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iItemDrawer->Gc() );
       
  1836         if ( transApi )
       
  1837             {
       
  1838             transApi->BeginRedraw( MAknListBoxTfxInternal::EListView, Rect() );
       
  1839             }
       
  1840 #endif
       
  1841         iView->Draw(&aRect);
       
  1842 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
  1843         if ( transApi )
       
  1844             {
       
  1845             transApi->EndViewRedraw( aRect );
       
  1846             }
       
  1847 #endif        
       
  1848         }
       
  1849     }
       
  1850 
       
  1851 EXPORT_C TTypeUid::Ptr CAknSetStyleListBox::MopSupplyObject(TTypeUid aId)
       
  1852     {
       
  1853     return CEikTextListBox::MopSupplyObject( aId );
       
  1854     }
       
  1855 
       
  1856 
       
  1857 EXPORT_C void CSingleHeadingStyleView::Draw(const TRect *aRect) const
       
  1858     {
       
  1859     // Expects certain itemdrawer implementation!
       
  1860     STATIC_CAST(CSingleHeadingStyleItemDrawer*,iItemDrawer)->SetTopItemIndex(iTopItemIndex);
       
  1861     CAknColumnListBoxView::Draw(aRect);
       
  1862     }
       
  1863 
       
  1864 EXPORT_C CSingleHeadingStyleItemDrawer::CSingleHeadingStyleItemDrawer(MTextListBoxModel* aTextListBoxModel, const CFont* aFont, CColumnListBoxData* aColumnData)
       
  1865     : CColumnListBoxItemDrawer(aTextListBoxModel, aFont, aColumnData)
       
  1866     {
       
  1867     SetData(aColumnData);
       
  1868     }
       
  1869 
       
  1870 
       
  1871 
       
  1872 EXPORT_C CSingleHeadingStyleItemDrawer::~CSingleHeadingStyleItemDrawer()
       
  1873     {
       
  1874     }
       
  1875 
       
  1876 
       
  1877 EXPORT_C void CAknSingleGraphicHeadingStyleListBox::CreateItemDrawerL() 
       
  1878     {
       
  1879     CColumnListBoxData* columnData=CColumnListBoxData::NewL();
       
  1880     CleanupStack::PushL(columnData);
       
  1881     __ASSERT_DEBUG(iItemDrawer == 0, Panic(EAknPanicOutOfRange));
       
  1882     iItemDrawer=new(ELeave)CSingleHeadingStyleItemDrawer(Model(), iEikonEnv->NormalFont(), columnData);
       
  1883     CleanupStack::Pop();
       
  1884     }
       
  1885 
       
  1886 EXPORT_C void CAknDoubleLargeStyleListBox::CreateItemDrawerL() 
       
  1887     {
       
  1888     CFormattedCellListBoxData* cellData=CFormattedCellListBoxData::NewL();
       
  1889     CleanupStack::PushL( cellData );
       
  1890     iItemDrawer=new(ELeave) CDoubleLargeStyleItemDrawer(Model(), iEikonEnv->NormalFont(), cellData, this);
       
  1891     CleanupStack::Pop();
       
  1892     }
       
  1893 
       
  1894 EXPORT_C void CAknDoubleStyle2ListBox::CreateItemDrawerL() 
       
  1895     {
       
  1896     CFormattedCellListBoxData* cellData=CFormattedCellListBoxData::NewL();
       
  1897     CleanupStack::PushL( cellData );
       
  1898     iItemDrawer=new(ELeave) CWordWrappedFormattedCellItemDrawer(Model(), iEikonEnv->NormalFont(), cellData, this, 1,2);
       
  1899     CleanupStack::Pop();
       
  1900     }
       
  1901 
       
  1902 
       
  1903 EXPORT_C CDoubleLargeStyleItemDrawer::CDoubleLargeStyleItemDrawer(MTextListBoxModel* aTextListBoxModel, const CFont* aFont, CFormattedCellListBoxData* aFormattedCellData, CEikListBox *aListBox)
       
  1904     : CFormattedCellListBoxItemDrawer(aTextListBoxModel, aFont, aFormattedCellData)
       
  1905     {
       
  1906     iListBox_tmp = aListBox;
       
  1907     }
       
  1908 
       
  1909 EXPORT_C void CDoubleLargeStyleItemDrawer::CFormattedCellListBoxItemDrawer_Reserved()
       
  1910     {
       
  1911     }
       
  1912 
       
  1913 
       
  1914 EXPORT_C CWordWrappedFormattedCellItemDrawer::CWordWrappedFormattedCellItemDrawer(MTextListBoxModel* aTextListBoxModel, const CFont* aFont, CFormattedCellListBoxData* aFormattedCellData, CEikListBox * /*aListBox*/, TInt aSubCell, TInt aSubCell2)
       
  1915     : CFormattedCellListBoxItemDrawer(aTextListBoxModel, aFont, aFormattedCellData)
       
  1916     {
       
  1917     iSubCell = aSubCell;
       
  1918     iSubCell2 = aSubCell2;
       
  1919     }
       
  1920 
       
  1921 EXPORT_C void CWordWrappedFormattedCellItemDrawer::CFormattedCellListBoxItemDrawer_Reserved()
       
  1922     {
       
  1923     }
       
  1924 
       
  1925 EXPORT_C CListBoxView*
       
  1926 CAknSingleGraphicHeadingStyleListBox::MakeViewClassInstanceL()
       
  1927     {
       
  1928     return (new(ELeave) CSingleHeadingStyleView);
       
  1929     }
       
  1930 
       
  1931 EXPORT_C CListBoxView*
       
  1932 CAknColumnListBox::MakeViewClassInstanceL()
       
  1933     {
       
  1934     return (new(ELeave) CAknColumnListBoxView);
       
  1935     }
       
  1936 
       
  1937 EXPORT_C void CAknColumnListBox::CreateModelL()
       
  1938     {
       
  1939     __ASSERT_DEBUG(iModel == 0, Panic(EAknPanicOutOfRange));
       
  1940     CTextListBoxModel* model=new(ELeave) CAknFilteredTextListBoxModel;
       
  1941     iModel=model;
       
  1942     }
       
  1943 
       
  1944 EXPORT_C TInt CAknFormGraphicStyleListBox::AdjustRectHeightToWholeNumberOfItems(TRect& aRect) const
       
  1945     {
       
  1946     _AKNTRACE( "[%s][%s][%d]", "CAknFormGraphicStyleListBox", __FUNCTION__, __LINE__ );
       
  1947     // the last item in the list does not need a border, so we need to remove the remainder
       
  1948     __LAYOUT_DEBUG(aRect.Height() % iItemHeight == 0, RDebug::Print(_L("FormGraphicStyleListBox Rect() is odd?")));
       
  1949     TInt remainder = 18-21;
       
  1950     aRect.iBr.iY -= remainder;
       
  1951     return remainder;
       
  1952     }
       
  1953 
       
  1954 EXPORT_C TInt CAknColumnListBox::AdjustRectHeightToWholeNumberOfItems(TRect &aRect)  const
       
  1955     {
       
  1956     _AKNTRACE( "[%s][%s][%d]", "CAknColumnListBox", __FUNCTION__, __LINE__ );
       
  1957     // This code used to be in eiklbx.cpp.
       
  1958     TInt remainder = aRect.Height() % iItemHeight;
       
  1959     if (remainder != 0)
       
  1960     {
       
  1961     aRect.iBr.iY -= remainder;
       
  1962     }
       
  1963     return remainder;
       
  1964     }
       
  1965     
       
  1966 EXPORT_C void CAknColumnListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  1967     { 
       
  1968     CEikColumnListBox::HandlePointerEventL(aPointerEvent); 
       
  1969     }    
       
  1970 
       
  1971 EXPORT_C void* CAknColumnListBox::ExtensionInterface( TUid /*aInterface*/ ) 
       
  1972     { 
       
  1973     return NULL;
       
  1974     }
       
  1975 
       
  1976 EXPORT_C void CAknColumnListBox::CEikListBox_Reserved() 
       
  1977     {
       
  1978     }
       
  1979 
       
  1980 EXPORT_C void CAknSingleNumberHeadingStyleListBox::CreateItemDrawerL() 
       
  1981     {
       
  1982     CColumnListBoxData* columnData=CColumnListBoxData::NewL();
       
  1983     CleanupStack::PushL(columnData);
       
  1984     __ASSERT_DEBUG(iItemDrawer == 0, Panic(EAknPanicOutOfRange));
       
  1985     iItemDrawer=new(ELeave)CSingleHeadingStyleItemDrawer(Model(), iEikonEnv->NormalFont(), columnData);
       
  1986     CleanupStack::Pop();
       
  1987     }
       
  1988 
       
  1989 EXPORT_C CListBoxView*
       
  1990 CAknSingleNumberHeadingStyleListBox::MakeViewClassInstanceL()
       
  1991     {
       
  1992     return (new(ELeave) CSingleHeadingStyleView);
       
  1993     }
       
  1994 
       
  1995 EXPORT_C CAknSingleGraphicHeadingStyleListBox::CAknSingleGraphicHeadingStyleListBox() : AKNCOLUMNLISTBOXNAME(R_LIST_PANE_LINES_BC_COLUMN) { AKNTASHOOK_ADD( this, "CAknSingleGraphicHeadingStyleListBox" ); }
       
  1996 
       
  1997 EXPORT_C CAknSingleNumberHeadingStyleListBox::CAknSingleNumberHeadingStyleListBox() : AKNCOLUMNLISTBOXNAME(R_LIST_PANE_LINES_BC_COLUMN) { AKNTASHOOK_ADD( this, "CAknSingleNumberHeadingStyleListBox" ); }
       
  1998 
       
  1999 EXPORT_C CAknSingleLargeStyleListBox::CAknSingleLargeStyleListBox() : AKNCOLUMNLISTBOXNAME(R_LIST_PANE_LINES_BC_COLUMN_X) { AKNTASHOOK_ADD( this, "CAknSingleLargeStyleListBox" ); }
       
  2000 
       
  2001 EXPORT_C CAknSingle2GraphicStyleListBox::CAknSingle2GraphicStyleListBox() : AKNCOLUMNLISTBOXNAME(R_LIST_PANE_LINES_AB_COLUMN) 
       
  2002     {
       
  2003     iCoeEnv = CCoeEnv::Static();
       
  2004     }
       
  2005 
       
  2006 EXPORT_C CAknDoubleStyleListBox::CAknDoubleStyleListBox() : AKNDOUBLELISTBOXNAME(R_LIST_PANE_LINES_A_COLUMN) { AKNTASHOOK_ADD( this, "CAknDoubleStyleListBox" ); }
       
  2007 
       
  2008 EXPORT_C CAknDoubleNumberStyleListBox::CAknDoubleNumberStyleListBox() : AKNDOUBLELISTBOXNAME(R_LIST_PANE_LINES_AB_COLUMN_XX) { AKNTASHOOK_ADD( this, "CAknDoubleNumberStyleListBox" ); }
       
  2009 
       
  2010 EXPORT_C CAknDoubleGraphicStyleListBox::CAknDoubleGraphicStyleListBox() : AKNDOUBLELISTBOXNAME(R_LIST_PANE_LINES_AB_COLUMN) { AKNTASHOOK_ADD( this, "CAknDoubleGraphicStyleListBox" ); }
       
  2011 
       
  2012 EXPORT_C CAknDoubleLargeStyleListBox::CAknDoubleLargeStyleListBox() : AKNDOUBLELISTBOXNAME(R_LIST_PANE_LINES_BC_COLUMN_XX) { AKNTASHOOK_ADD( this, "CAknDoubleLargeStyleListBox" ); }
       
  2013 
       
  2014 EXPORT_C CAknDoubleTimeStyleListBox::CAknDoubleTimeStyleListBox() : AKNDOUBLELISTBOXNAME(R_LIST_PANE_LINES_BC_COLUMN) { AKNTASHOOK_ADD( this, "CAknDoubleTimeStyleListBox" ); }
       
  2015 
       
  2016 
       
  2017 //CAknDouble2GraphicStyleListBox
       
  2018 EXPORT_C void CAknDouble2GraphicStyleListBox::CreateItemDrawerL() 
       
  2019     {
       
  2020     CFormattedCellListBoxData* cellData=CFormattedCellListBoxData::NewL();
       
  2021     CleanupStack::PushL( cellData );
       
  2022     iItemDrawer=new(ELeave) CWordWrappedFormattedCellItemDrawer(Model(), iEikonEnv->NormalFont(), cellData, this, 1,2);
       
  2023     CleanupStack::Pop();
       
  2024     }
       
  2025 
       
  2026 EXPORT_C CAknDouble2GraphicStyleListBox::CAknDouble2GraphicStyleListBox() : AKNDOUBLELISTBOXNAME(R_LIST_PANE_LINES_AB_COLUMN) { AKNTASHOOK_ADD( this, "CAknDouble2GraphicStyleListBox" ); }
       
  2027 
       
  2028 //CAknDouble2LargeStyleListBox
       
  2029 EXPORT_C void CAknDouble2LargeStyleListBox::CreateItemDrawerL() 
       
  2030     {
       
  2031     CFormattedCellListBoxData* cellData=CFormattedCellListBoxData::NewL();
       
  2032     CleanupStack::PushL( cellData );
       
  2033     iItemDrawer=new(ELeave) CWordWrappedFormattedCellItemDrawer(Model(), iEikonEnv->NormalFont(), cellData, this, 1,2);
       
  2034     CleanupStack::Pop();
       
  2035     }
       
  2036 
       
  2037 EXPORT_C CAknDouble2LargeStyleListBox::CAknDouble2LargeStyleListBox() : AKNDOUBLELISTBOXNAME(R_LIST_PANE_LINES_BC_COLUMN_XX) { AKNTASHOOK_ADD( this, "CAknDouble2LargeStyleListBox" ); }
       
  2038 
       
  2039 
       
  2040 //CAknDouble2GraphicLargeStyleListBox
       
  2041 EXPORT_C void CAknDouble2GraphicLargeStyleListBox::CreateItemDrawerL() 
       
  2042     {
       
  2043     CFormattedCellListBoxData* cellData=CFormattedCellListBoxData::NewL();
       
  2044     CleanupStack::PushL( cellData );
       
  2045     iItemDrawer=new(ELeave) CWordWrappedFormattedCellItemDrawer(Model(), iEikonEnv->NormalFont(), cellData, this, 2, 3);
       
  2046     CleanupStack::Pop();
       
  2047     }
       
  2048 
       
  2049 EXPORT_C CAknDouble2GraphicLargeStyleListBox::CAknDouble2GraphicLargeStyleListBox() : AKNDOUBLELISTBOXNAME(R_LIST_PANE_LINES_AB_COLUMN_XX) { }
       
  2050 
       
  2051 // CAknDouble2GraphicLargeGraphicStyleListBox
       
  2052 EXPORT_C void CAknDouble2GraphicLargeGraphicStyleListBox::CreateItemDrawerL() 
       
  2053     {
       
  2054     CFormattedCellListBoxData* cellData=CFormattedCellListBoxData::NewL();
       
  2055     CleanupStack::PushL( cellData );
       
  2056     iItemDrawer=new(ELeave) CWordWrappedFormattedCellItemDrawer( Model(), iEikonEnv->NormalFont(),
       
  2057                                                                  cellData, this, 2, 3 );
       
  2058     CleanupStack::Pop();
       
  2059     }
       
  2060 
       
  2061 EXPORT_C CAknDouble2GraphicLargeGraphicStyleListBox::CAknDouble2GraphicLargeGraphicStyleListBox() : AKNDOUBLELISTBOXNAME(R_LIST_PANE_LINES_AB_COLUMN_XX) { AKNTASHOOK_ADD( this, "CAknDouble2GraphicLargeGraphicStyleListBox" ); }
       
  2062 
       
  2063 EXPORT_C CAknSettingStyleListBox::CAknSettingStyleListBox() : AKNSETTINGLISTBOXNAME(R_LIST_PANE_LINES_A_COLUMN_X) { AKNTASHOOK_ADD( this, "CAknSettingStyleListBox" ); }
       
  2064 
       
  2065 EXPORT_C CAknSettingNumberStyleListBox::CAknSettingNumberStyleListBox() : AKNSETTINGLISTBOXNAME(R_LIST_PANE_LINES_AB_COLUMN_X) { AKNTASHOOK_ADD( this, "CAknSettingNumberStyleListBox" ); }
       
  2066 
       
  2067 EXPORT_C void CAknSingleGraphicBtPopupMenuStyleListBox::SizeChanged()
       
  2068     {
       
  2069     _AKNTRACE_FUNC_ENTER;
       
  2070     CAknSingleGraphicPopupMenuStyleListBox::SizeChanged();
       
  2071     _AKNTRACE_FUNC_EXIT;
       
  2072     }
       
  2073 
       
  2074 EXPORT_C CAknSingleHeadingPopupMenuStyleListBox::CAknSingleHeadingPopupMenuStyleListBox() { AKNTASHOOK_ADD( this, "CAknSingleHeadingPopupMenuStyleListBox" ); }
       
  2075 
       
  2076 EXPORT_C CAknSingleGraphicHeadingPopupMenuStyleListBox::CAknSingleGraphicHeadingPopupMenuStyleListBox() { AKNTASHOOK_ADD( this, "CAknSingleGraphicHeadingPopupMenuStyleListBox" ); }
       
  2077 
       
  2078 // deprecated 
       
  2079 EXPORT_C void CAknSinglePopupSubmenuStyleListBox::SizeChanged()
       
  2080     {
       
  2081     _AKNTRACE_FUNC_ENTER;
       
  2082     CEikFormattedCellListBox::SizeChanged();
       
  2083     TRAP_IGNORE( SizeChangedL() );
       
  2084     _AKNTRACE_FUNC_EXIT;
       
  2085     }
       
  2086 
       
  2087 // deprecated 
       
  2088 void CAknSinglePopupSubmenuStyleListBox::SizeChangedL()
       
  2089     {
       
  2090     _AKNTRACE_FUNC_ENTER;
       
  2091     // not used in Series 60 - no need to remove magic numbers
       
  2092     CEikFormattedCellListBox &aListBox = *this;
       
  2093     CFormattedCellListBoxItemDrawer *itemDrawer = aListBox.ItemDrawer();
       
  2094 
       
  2095     TInt width = aListBox.MinimumSize().iWidth;
       
  2096     TInt textwidth=0;
       
  2097      
       
  2098     if (!(width == 60 ||width == 81 ||width == 102)) width = 60;
       
  2099 
       
  2100     __LAYOUT_DEBUG((width == 60 || width == 81 || width ==102),
       
  2101                    RDebug::Print(_L("EEikPanicListboxSizeIsNotAccordingToLAFSpec")));
       
  2102     
       
  2103     AknListBoxLayouts::SetupStandardListBox(aListBox);
       
  2104     AknListBoxLayouts::SetupStandardFormListbox(itemDrawer);
       
  2105     AknListBoxLayouts::SetupListboxPos(aListBox, 0, 0, -1, -1, width, 18);
       
  2106 
       
  2107     if (width == 60) textwidth = 38;
       
  2108     if (width == 59) textwidth = 59;
       
  2109     if (width == 102) textwidth = 88; 
       
  2110     AknListBoxLayouts::SetupFormAntiFlickerTextCell(aListBox, itemDrawer, 0,
       
  2111                 LatinBold12(), 215, 8, 6, 12, textwidth, CGraphicsContext::ELeft, TPoint(0,0), TPoint(width,18));
       
  2112     _AKNTRACE_FUNC_EXIT;
       
  2113     }
       
  2114 
       
  2115 EXPORT_C void CAknDouble2PopupMenuStyleListBox::CreateItemDrawerL() 
       
  2116     {
       
  2117     CFormattedCellListBoxData* cellData=CPopupFormattedListBoxData::NewL();
       
  2118     CleanupStack::PushL(cellData);
       
  2119     __ASSERT_DEBUG(iItemDrawer == 0, Panic(EAknPanicOutOfRange));
       
  2120     iItemDrawer=new(ELeave)CFormattedCellListBoxItemDrawer(Model(), iEikonEnv->NormalFont(), cellData);
       
  2121     CleanupStack::Pop();
       
  2122     }
       
  2123 
       
  2124 
       
  2125 /**
       
  2126  * list_single_2graphic_pane_cp2
       
  2127  *
       
  2128  * list item string format: "0\t1\tTextLabel\t2\t3"
       
  2129  * where 0,1,2,3 are index to the icon array 
       
  2130  */
       
  2131 
       
  2132 EXPORT_C CAknSingle2GraphicPopupMenuStyleListBox::CAknSingle2GraphicPopupMenuStyleListBox() { AKNTASHOOK_ADD( this, "CAknSingle2GraphicPopupMenuStyleListBox" ); }
       
  2133 
       
  2134 EXPORT_C CAknDoubleGraphicPopupMenuStyleListBox ::CAknDoubleGraphicPopupMenuStyleListBox() { AKNTASHOOK_ADD( this, "CAknDoubleGraphicPopupMenuStyleListBox" ); }
       
  2135 
       
  2136 EXPORT_C void CAknSetStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  2137     { 
       
  2138     CEikFormattedCellListBox::HandlePointerEventL(aPointerEvent); 
       
  2139     }    
       
  2140 
       
  2141 EXPORT_C void CAknSetStyleListBoxView::DrawEmptyList(const TRect &aClientRect) const
       
  2142     {
       
  2143     if (RedrawDisabled() ||!IsVisible()) 
       
  2144         return;
       
  2145     
       
  2146     CFormattedCellListBoxItemDrawer *itemDrawer = (CFormattedCellListBoxItemDrawer*)iItemDrawer;
       
  2147     AknDrawWithSkins::DrawEmptyListForSettingPage(aClientRect, *iGc, *EmptyListText(), itemDrawer->FormattedCellData()->Control());
       
  2148     }
       
  2149 
       
  2150 EXPORT_C TAny* CAknSetStyleListBoxView::Reserved_1()
       
  2151     {
       
  2152     return NULL;
       
  2153     }
       
  2154 
       
  2155 EXPORT_C CListBoxView*
       
  2156 CAknSetStyleListBox::MakeViewClassInstanceL()
       
  2157     {
       
  2158     return (new(ELeave) CAknSetStyleListBoxView);
       
  2159     }
       
  2160 
       
  2161 
       
  2162 EXPORT_C void CAknFormGraphicStyleListBox::ConstructWithWindowL(const CCoeControl *aParent,
       
  2163                    TInt aFlags)
       
  2164     {
       
  2165     _AKNTRACE( "[%s][%s][%d]", "CAknFormGraphicStyleListBox", __FUNCTION__, __LINE__ );
       
  2166     CAknFilteredTextListBoxModel* model=new(ELeave) CAknFilteredTextListBoxModel;
       
  2167     __ASSERT_DEBUG(iModel == 0, Panic(EAknPanicOutOfRange));
       
  2168     iModel=model;
       
  2169     model->ConstructL();
       
  2170     CreateItemDrawerL();
       
  2171     iItemDrawer->SetDrawMark(EFalse);
       
  2172     
       
  2173     iListBoxFlags = aFlags;
       
  2174     CreateWindowL(aParent);
       
  2175     if ( AknLayoutUtils::PenEnabled() )
       
  2176         {
       
  2177         SetGloballyCapturing(ETrue);
       
  2178         SetPointerCapture(ETrue);
       
  2179         }
       
  2180     EnableDragEvents();
       
  2181     Window().SetPointerGrab(ETrue);
       
  2182     if (iListBoxFlags & EIncrementalMatching)
       
  2183     CreateMatchBufferL();
       
  2184     CreateViewL();
       
  2185     }
       
  2186 
       
  2187 // ---------------------------------------------------------
       
  2188 // CAknFormGraphicStyleListBox::HandlePointerEventL
       
  2189 // Handles pointerevents of popupfield list in forms
       
  2190 // Closes popup if clicked outside of list. 
       
  2191 // ---------------------------------------------------------
       
  2192 //
       
  2193 
       
  2194 EXPORT_C void CAknFormGraphicStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  2195     {
       
  2196     _AKNTRACE( "[%s][%s][%d]", "CAknFormGraphicStyleListBox", __FUNCTION__, __LINE__ );
       
  2197     if ( AknLayoutUtils::PenEnabled() )    
       
  2198         {
       
  2199         TRect rect(Rect());
       
  2200     
       
  2201         if ( aPointerEvent.iType == TPointerEvent::EButton1Down && !rect.Contains(aPointerEvent.iPosition) )
       
  2202             {
       
  2203             // Clicked outside listbox rect, pointer event to popupfield
       
  2204             Parent()->HandlePointerEventL(aPointerEvent);
       
  2205             IgnoreEventsUntilNextPointerUp();
       
  2206             }
       
  2207         else 
       
  2208             {           
       
  2209             TPointerEvent newPointerEvent = aPointerEvent;
       
  2210             
       
  2211             // Remove Shift and Ctrl modifiers from PointerEvent to get radiobuttons to work
       
  2212             // without multiselection   
       
  2213             newPointerEvent.iModifiers &= ~EModifierShift;
       
  2214             newPointerEvent.iModifiers &= ~EModifierCtrl;
       
  2215                     
       
  2216             CEikListBox::HandlePointerEventL(newPointerEvent);
       
  2217             }
       
  2218         }
       
  2219     }
       
  2220 
       
  2221  
       
  2222 EXPORT_C void CAknSetStyleListBox::ConstructWithWindowL(const CCoeControl *aParent,
       
  2223                    TInt aFlags)
       
  2224     {
       
  2225     _AKNTRACE( "[%s][%s][%d]", "CAknSetStyleListBox", __FUNCTION__, __LINE__ );
       
  2226     CAknFilteredTextListBoxModel* model=new(ELeave) CAknFilteredTextListBoxModel;
       
  2227     __ASSERT_DEBUG(iModel == 0, Panic(EAknPanicOutOfRange));
       
  2228     iModel=model;
       
  2229     model->ConstructL();
       
  2230     CreateItemDrawerL();
       
  2231     iItemDrawer->SetDrawMark(EFalse);
       
  2232     
       
  2233     iListBoxFlags = aFlags;
       
  2234     CreateWindowL(aParent);
       
  2235     EnableDragEvents();
       
  2236     Window().SetPointerGrab(ETrue);
       
  2237     if (iListBoxFlags & EIncrementalMatching)
       
  2238     CreateMatchBufferL();
       
  2239     CreateViewL();
       
  2240     }
       
  2241 
       
  2242 EXPORT_C void CAknAppStyleGrid::SetShortcutEnabledL(TBool aValue)
       
  2243     {
       
  2244     AKNSHORTCUTGRID::SetShortcutEnabledL(aValue);
       
  2245     }
       
  2246 
       
  2247 EXPORT_C void CAknAppStyleGrid::DrawBackgroundAroundGrid(CWindowGc &aGc, const TRect &aClientRect, const TRect &aGridRect)
       
  2248     {
       
  2249     _AKNTRACE( "[%s][%s][%d]", "CAknAppStyleGrid", __FUNCTION__, __LINE__ );
       
  2250     MAknsControlContext *cc = AknsDrawUtils::ControlContext( this );
       
  2251     MAknsSkinInstance *skin = AknsUtils::SkinInstance();
       
  2252     if (!cc) cc = ItemDrawer()->FormattedCellData()->SkinBackgroundContext();
       
  2253     AknsDrawUtils::BackgroundBetweenRects(skin, cc, aGc, aClientRect, aGridRect);
       
  2254     }
       
  2255 
       
  2256 EXPORT_C void CAknAppStyleGrid::ConstructL(const CCoeControl* aParent, TInt aFlags)
       
  2257     {
       
  2258     _AKNTRACE( "[%s][%s][%d]", "CAknAppStyleGrid", __FUNCTION__, __LINE__ );
       
  2259     AKNSHORTCUTGRID::ConstructL(aParent, aFlags);
       
  2260 
       
  2261     TResourceReader reader;
       
  2262     CEikonEnv::Static()->CreateResourceReaderLC(reader, R_AVKON_GRID_STYLE_APP_GRID_AUTOMATIC_MIRRORING);
       
  2263     SetLayoutFromResourceL(reader);
       
  2264     CleanupStack::PopAndDestroy();
       
  2265     }
       
  2266 
       
  2267 EXPORT_C void CAknAppStyleGrid::SizeChanged() 
       
  2268     {
       
  2269     _AKNTRACE_FUNC_ENTER;
       
  2270     // remember current data index  in case this is layout switch
       
  2271     TInt currentDataIndex = GridView()->CurrentDataIndex(); 
       
  2272 
       
  2273     // this needs to be called before baseclass to set layouts correctly
       
  2274     TRAP_IGNORE( SizeChangedL() );
       
  2275 
       
  2276     // so baseclass has up to date information here
       
  2277     CAknGrid::SizeChanged();
       
  2278     
       
  2279     // restore current data index
       
  2280     GridView()->SetCurrentDataIndex( currentDataIndex );
       
  2281 
       
  2282     // UpdateScrollBarsL(); already called by CAknGrid::SizeChanged();
       
  2283     _AKNTRACE_FUNC_EXIT;
       
  2284     }
       
  2285 
       
  2286 enum
       
  2287     {
       
  2288     EAknAppStyleGrid3x3 = 0,
       
  2289     EAknAppStyleGrid3x4 = 1,
       
  2290     EAknAppStyleGrid4x3 = 2
       
  2291     };
       
  2292 
       
  2293 void CAknAppStyleGrid::SizeChangedL()
       
  2294     {
       
  2295     _AKNTRACE_FUNC_ENTER;
       
  2296     CAknGrid &listbox = *this;
       
  2297     CFormattedCellListBoxItemDrawer *itemDrawer( listbox.ItemDrawer() );
       
  2298     CFormattedCellListBoxData* d( itemDrawer->FormattedCellData() );
       
  2299     AknListBoxLayouts::SetupStandardGrid(listbox);  // TODO ??
       
  2300     
       
  2301     TRect parentRect( Rect() );
       
  2302     
       
  2303     // First is checked if 3x4 or 4x3 items fits to the grid.
       
  2304     TAknWindowLineLayout listscrollAppPaneLayout;        
       
  2305     TAknWindowLineLayout gridAppPaneLayout;
       
  2306     TAknWindowLineLayout cellAppPaneLayout;
       
  2307     if (Layout_Meta_Data::IsLandscapeOrientation())
       
  2308         {
       
  2309         // Layout data for 4x3 grid
       
  2310         listscrollAppPaneLayout = AknLayoutScalable_Avkon::listscroll_app_pane(1); 
       
  2311         gridAppPaneLayout = AknLayoutScalable_Avkon::grid_app_pane(3);        
       
  2312         cellAppPaneLayout = AknLayoutScalable_Avkon::cell_app_pane(2, 0, 0);       
       
  2313         }
       
  2314     else
       
  2315         {
       
  2316         // Layout data for 3x4 grid
       
  2317         listscrollAppPaneLayout = AknLayoutScalable_Avkon::listscroll_app_pane(1); 
       
  2318         gridAppPaneLayout = AknLayoutScalable_Avkon::grid_app_pane(2);          
       
  2319         cellAppPaneLayout = AknLayoutScalable_Avkon::cell_app_pane(1, 0, 0);       
       
  2320         }
       
  2321     
       
  2322     TAknLayoutRect listscrollAppPane;
       
  2323     TAknLayoutRect gridAppPane;
       
  2324     TAknLayoutRect gridItem;
       
  2325     
       
  2326     listscrollAppPane.LayoutRect( parentRect, listscrollAppPaneLayout); 
       
  2327     gridAppPane.LayoutRect( listscrollAppPane.Rect(), gridAppPaneLayout); 
       
  2328     gridItem.LayoutRect( gridAppPane.Rect(), cellAppPaneLayout);
       
  2329     
       
  2330     TInt gridLayout = EAknAppStyleGrid3x3;
       
  2331     
       
  2332     if ( Layout_Meta_Data::IsLandscapeOrientation() )
       
  2333         {
       
  2334         if (gridItem.Rect().Width() * 4 <= parentRect.Width() && 
       
  2335             gridItem.Rect().Height() * 3 <= parentRect.Height())
       
  2336             {
       
  2337             // 4x3 grid is used if the items fit
       
  2338             gridLayout = EAknAppStyleGrid4x3;
       
  2339             }
       
  2340         }
       
  2341     else
       
  2342         {
       
  2343         if (gridItem.Rect().Width() * 3 <= parentRect.Width() && 
       
  2344             gridItem.Rect().Height() * 4 <= parentRect.Height())
       
  2345             {
       
  2346             // 3x4 grid is used if the items fit
       
  2347             gridLayout = EAknAppStyleGrid3x4;          
       
  2348             }           
       
  2349         }
       
  2350 
       
  2351     if ( gridLayout == EAknAppStyleGrid3x3 )
       
  2352         {
       
  2353         // 4x3 or 3x4 grid did not fit to the main pane. 
       
  2354         // 3x3 grid is used instead. Layout data of 3x3 grid is needed
       
  2355         listscrollAppPaneLayout = AknLayoutScalable_Avkon::listscroll_app_pane(0);        
       
  2356         if (Layout_Meta_Data::IsLandscapeOrientation())
       
  2357             {
       
  2358             gridAppPaneLayout = AknLayoutScalable_Avkon::grid_app_pane(1);
       
  2359             }
       
  2360         else
       
  2361             {
       
  2362             gridAppPaneLayout = AknLayoutScalable_Avkon::grid_app_pane(0);                
       
  2363             }
       
  2364         cellAppPaneLayout = AknLayoutScalable_Avkon::cell_app_pane(0, 0, 0);
       
  2365 
       
  2366         listscrollAppPane.LayoutRect( parentRect, listscrollAppPaneLayout );
       
  2367         gridAppPane.LayoutRect( listscrollAppPane.Rect(), gridAppPaneLayout );
       
  2368         gridItem.LayoutRect( gridAppPane.Rect(), cellAppPaneLayout );
       
  2369         }
       
  2370 
       
  2371     // set up grid size, and number of items in both orientations
       
  2372     TRect itemRect( gridItem.Rect() );
       
  2373     TInt primaryItems, secondaryItems;
       
  2374                     
       
  2375     switch( gridLayout )
       
  2376         {
       
  2377         case EAknAppStyleGrid3x4:
       
  2378             primaryItems = 3;
       
  2379             secondaryItems = 4;
       
  2380             break;
       
  2381 
       
  2382         case EAknAppStyleGrid4x3:
       
  2383             primaryItems = 4;
       
  2384             secondaryItems = 3;
       
  2385             break;
       
  2386         case EAknAppStyleGrid3x3:  // fall trough
       
  2387         default:                    
       
  2388             primaryItems = 3;
       
  2389             secondaryItems = 3;
       
  2390             break;
       
  2391         }
       
  2392 
       
  2393     TSize itemSize( itemRect.Size() );
       
  2394     SetLayoutL( EFalse,                            //aVerticalOrientation
       
  2395                 !AknLayoutUtils::LayoutMirrored(), //aLeftToRight
       
  2396                 ETrue,                             //aTopToBottom
       
  2397                 primaryItems,                      //aNumOfItemsInPrimaryOrient
       
  2398                 secondaryItems,                    //aNumOfItemsInSecondaryOrient
       
  2399                 itemSize );                        //aSizeOfItems
       
  2400     
       
  2401     // Left margin is needed for a/h layouts to make room for the scroll bar
       
  2402     TInt leftMargin = 0;
       
  2403 
       
  2404     if ( AknLayoutUtils::LayoutMirrored() )
       
  2405         {
       
  2406         TAknLayoutRect scrollPane;
       
  2407         scrollPane.LayoutRect( listscrollAppPane.Rect(), AknLayoutScalable_Avkon::scroll_pane_cp15(0) );
       
  2408         leftMargin = scrollPane.Rect().Width();
       
  2409         }
       
  2410 
       
  2411     AknListBoxLayouts::SetupGridPos( listbox,
       
  2412                                      cellAppPaneLayout.il + leftMargin,
       
  2413                                      cellAppPaneLayout.it,
       
  2414                                      cellAppPaneLayout.ir,
       
  2415                                      cellAppPaneLayout.ib,
       
  2416                                      gridItem.Rect().Width(),
       
  2417                                      gridItem.Rect().Height() );
       
  2418 
       
  2419 //    AknListBoxLayouts::SetupListboxPosL( listbox, gridAppPaneLayout );
       
  2420     // TODO: should check the varieties. No need to worry too much,
       
  2421     // since adaptation layer did not chech these either...
       
  2422     d->SetGraphicSubCellL( 0, AknLayoutScalable_Avkon::cell_app_pane_g1( 0 ) );
       
  2423     d->SetTextSubCellL(    1, AknLayoutScalable_Avkon::cell_app_pane_t1( 0 ) );
       
  2424     d->SetGraphicSubCellL( 2, AknLayoutScalable_Avkon::cell_app_pane_g2( 0 ) );
       
  2425     
       
  2426     if ( AknsUtils::AvkonSkinEnabled() )
       
  2427         {
       
  2428         SetESSHighlightedTextColor( itemDrawer, EAknsCIQsnTextColorsCG11 );
       
  2429         SetESSTextColor( itemDrawer, EAknsCIQsnTextColorsCG9 );
       
  2430         }
       
  2431 
       
  2432     itemDrawer->SetItemMarkPosition( 2 );
       
  2433     itemDrawer->SetItemMarkReplacement( KFirstCSIconReplacement );
       
  2434     itemDrawer->SetItemMarkReverse( ETrue );
       
  2435     SetSeparatorLinePosition(this, ENoLine);
       
  2436     _AKNTRACE_FUNC_EXIT;
       
  2437     }
       
  2438  
       
  2439 
       
  2440 EXPORT_C void CAknPinbStyleGrid::SizeChanged() 
       
  2441     {
       
  2442     _AKNTRACE_FUNC_ENTER;
       
  2443     CAknGrid::SizeChanged();
       
  2444     TRAP_IGNORE( SizeChangedL() );
       
  2445     _AKNTRACE_FUNC_EXIT;
       
  2446     }
       
  2447 
       
  2448 void CAknPinbStyleGrid::SizeChangedL()
       
  2449     {
       
  2450     _AKNTRACE_FUNC_ENTER;
       
  2451     TAknLayoutRect gridLayout;
       
  2452     gridLayout.LayoutRect( Rect(), AknLayoutScalable_Apps::cell_pinb_pane( 0, 0 ) );
       
  2453 
       
  2454     SetLayoutL( ETrue,  // aVerticalOrientation
       
  2455                 !AknLayoutUtils::LayoutMirrored(),   // aLeftToRight
       
  2456                 ETrue,   // aTopToBottom
       
  2457                 5,       // aNumOfItemsInPrimaryOrient
       
  2458                 5,       // aNumOfItemsInSecondaryOrient
       
  2459                 gridLayout.Rect().Size(), // aSizeOfItems
       
  2460                 0,      // aWidthOfSpaceBetweenItems=0
       
  2461                 0 );    // aHeightOfSpaceBetweenItems=0 
       
  2462 
       
  2463     SetPrimaryScrollingType( CAknGridView::EScrollFollowsItemsAndStops );
       
  2464     SetSecondaryScrollingType( CAknGridView::EScrollFollowsItemsAndLoops );
       
  2465 
       
  2466     CFormattedCellListBoxItemDrawer *itemDrawer = ItemDrawer();
       
  2467 
       
  2468     AknListBoxLayouts::SetupStandardGrid( *this );
       
  2469     AknListBoxLayouts::SetupGridPos( *this, AknLayoutScalable_Apps::cell_pinb_pane( 0, 0 ) );
       
  2470     
       
  2471     itemDrawer->FormattedCellData()->SetGraphicSubCellL( 0, 
       
  2472         AknLayoutScalable_Apps::cell_pinb_pane_g1( 1 ).LayoutLine() );
       
  2473         
       
  2474     itemDrawer->FormattedCellData()->SetGraphicSubCellL( 1, 
       
  2475         AknLayoutScalable_Apps::cell_pinb_pane_g2( 0 ).LayoutLine() );
       
  2476         
       
  2477     itemDrawer->FormattedCellData()->SetGraphicSubCellL( 2, 
       
  2478         AknLayoutScalable_Apps::cell_pinb_pane_g3( 0 ).LayoutLine() );
       
  2479 
       
  2480     itemDrawer->SetItemMarkPosition( 2 );
       
  2481     itemDrawer->SetItemMarkReplacement( KFirstCSIconReplacement );
       
  2482     itemDrawer->SetItemMarkReverse( ETrue );
       
  2483   
       
  2484     SetSeparatorLinePosition( this, ENoLine );
       
  2485     
       
  2486     itemDrawer->FormattedCellData()->SetBackgroundSkinStyle( &KAknsIIDQsnBgAreaMainPinb, Rect() );
       
  2487 
       
  2488     if ( AknsUtils::AvkonSkinEnabled() )
       
  2489         {
       
  2490         SetESSHighlightedTextColor( itemDrawer, EAknsCIQsnTextColorsCG11 );
       
  2491         SetESSTextColor( itemDrawer, EAknsCIQsnTextColorsCG6 );
       
  2492         }
       
  2493     _AKNTRACE_FUNC_EXIT;
       
  2494     }
       
  2495 
       
  2496 EXPORT_C void CAknQdialStyleGrid::SizeChanged() 
       
  2497     {    
       
  2498     _AKNTRACE_FUNC_ENTER;
       
  2499     CAknGrid::SizeChanged();
       
  2500     TRAP_IGNORE( SizeChangedL() );
       
  2501     _AKNTRACE_FUNC_EXIT;
       
  2502     }
       
  2503 
       
  2504 void CAknQdialStyleGrid::SizeChangedL()
       
  2505     {
       
  2506     _AKNTRACE_FUNC_ENTER;
       
  2507     TInt i;
       
  2508 
       
  2509     TInt v = 0;  // variety
       
  2510     if (Layout_Meta_Data::IsLandscapeOrientation())
       
  2511         {
       
  2512         v = 1;
       
  2513         }
       
  2514         
       
  2515     
       
  2516     TAknLayoutRect gridLayout;
       
  2517     gridLayout.LayoutRect(Rect(), AknLayoutScalable_Apps::cell_qdial_pane(0,0));
       
  2518 
       
  2519     SetLayoutL( EFalse,  // aVerticalOrientation
       
  2520                 ETrue,   // aLeftToRight
       
  2521                 ETrue,   // aTopToBottom
       
  2522                 3,       // aNumOfItemsInPrimaryOrient
       
  2523                 3,       // aNumOfItemsInSecondaryOrient
       
  2524                 // aSizeOfItems
       
  2525                 gridLayout.Rect().Size(),
       
  2526                 0,      // aWidthOfSpaceBetweenItems=0
       
  2527                 0 );    // aHeightOfSpaceBetweenItems=0 
       
  2528     
       
  2529     SetPrimaryScrollingType( CAknGridView::EScrollFollowsItemsAndStops );
       
  2530     SetSecondaryScrollingType( CAknGridView::EScrollFollowsItemsAndLoops );
       
  2531 
       
  2532     CAknGrid &listbox = *this;
       
  2533     CFormattedCellListBoxItemDrawer *itemDrawer = listbox.ItemDrawer();
       
  2534     CFormattedCellListBoxData* d = itemDrawer->FormattedCellData();
       
  2535     AknListBoxLayouts::SetupStandardGrid(listbox);
       
  2536 
       
  2537     // set up text cells, 2 options:
       
  2538     // either subcells 0, 3, 4: up to 3 lines of text
       
  2539     // or     subcells 2, 3, 4: up to 3 lines of text with
       
  2540     //        small numbertype indication icon in 1st line
       
  2541     // subcells 3 and 4 are same in both cases
       
  2542 
       
  2543     // 1st text line, without image
       
  2544     d->SetTextSubCellL( 0, AknLayoutScalable_Apps::cell_qdial_pane_t1(0).LayoutLine() );
       
  2545 
       
  2546     // 1st text line with image. the image is in subcell #1
       
  2547     d->SetTextSubCellL( 2, AknLayoutScalable_Apps::cell_qdial_pane_t1(1).LayoutLine() );
       
  2548 
       
  2549     // 2nd text line
       
  2550     d->SetTextSubCellL( 3, AknLayoutScalable_Apps::cell_qdial_pane_t2(0).LayoutLine() );
       
  2551 
       
  2552     // 3rd text line
       
  2553     d->SetTextSubCellL( 4, AknLayoutScalable_Apps::cell_qdial_pane_t3(0).LayoutLine() );
       
  2554 
       
  2555     // ----------------------------------------------------------------------
       
  2556     //
       
  2557     // set up graphical subcells
       
  2558     // subcell  1: number type indication. Used with texts
       
  2559     // subcell 16: marked item indication
       
  2560     // subcell 15: voice mbox / large number icon, different size from thumbnail
       
  2561     // subcells 6, 8, 10, 12, 14 : numbertype indication icon, similar to 1 but
       
  2562     //                             used with thumbnail images
       
  2563     // subcells 5, 7, 9, 11, 13  : thumbnail image, all same size, this many
       
  2564     //                             needed for legacy support
       
  2565     // multiple subcells should be eventually phased out without breaking
       
  2566     // 
       
  2567 
       
  2568     // subcell 1: number type indication for list items with texts, variety 1
       
  2569     d->SetGraphicSubCellL( 1, AknLayoutScalable_Apps::cell_qdial_pane_g2(1).LayoutLine() );
       
  2570 
       
  2571     // subcells 5, 7, 9, 11, 13, all same size (thumbnail)
       
  2572     for ( i = 5; i <= 13; i+=2 )
       
  2573         {
       
  2574         d->SetGraphicSubCellL( i, AknLayoutScalable_Apps::thumbnail_qdial_pane(v).LayoutLine() );
       
  2575         }
       
  2576 
       
  2577     // subcells 6, 8, 10, 12, 14, all same size (numbertype indication for thumbnail items)
       
  2578     for ( i = 6; i <= 14; i+=2 )
       
  2579         {
       
  2580         d->SetGraphicSubCellL( i, AknLayoutScalable_Apps::cell_qdial_pane_g2(0).LayoutLine() );
       
  2581         }
       
  2582 
       
  2583     // subcell 15 (large icon)
       
  2584     d->SetGraphicSubCellL( 15, AknLayoutScalable_Apps::cell_qdial_pane_g1(v).LayoutLine() );
       
  2585 
       
  2586     // subcell 16: marked item indication
       
  2587     // This must be in last subcell because of drawing order
       
  2588     itemDrawer->SetItemMarkPosition( 16 );
       
  2589     itemDrawer->SetItemMarkReplacement( KFirstCSIconReplacement );
       
  2590     itemDrawer->SetItemMarkReverse( ETrue );
       
  2591   
       
  2592     d->SetGraphicSubCellL( 16, AknLayoutScalable_Apps::cell_qdial_pane_g2(v).LayoutLine() );
       
  2593     
       
  2594     SetSeparatorLinePosition(this, ENoLine);
       
  2595     
       
  2596     d->SetBackgroundSkinStyle( &KAknsIIDQsnBgAreaMainQdial, Rect() );
       
  2597 
       
  2598     if ( AknsUtils::AvkonSkinEnabled() )
       
  2599         {
       
  2600         SetESSHighlightedTextColor( itemDrawer, EAknsCIQsnTextColorsCG11 );
       
  2601         SetESSTextColor( itemDrawer, EAknsCIQsnTextColorsCG6 );
       
  2602         }
       
  2603     
       
  2604     DisableScrolling( ETrue );
       
  2605     _AKNTRACE_FUNC_EXIT;
       
  2606     }
       
  2607 
       
  2608 
       
  2609 EXPORT_C void CAknCaleMonthStyleGrid::SizeChanged() 
       
  2610     {
       
  2611     _AKNTRACE_FUNC_ENTER;
       
  2612     CAknGrid::SizeChanged();
       
  2613     TRAP_IGNORE( SizeChangedL() );
       
  2614     _AKNTRACE_FUNC_EXIT;
       
  2615     }
       
  2616 
       
  2617 void CAknCaleMonthStyleGrid::SizeChangedL()
       
  2618     {
       
  2619     _AKNTRACE_FUNC_ENTER;
       
  2620     // currently not used
       
  2621     SetLayoutL(ETrue,ETrue,ETrue,7, 8, TSize(21,19), 1, 1);
       
  2622     SetPrimaryScrollingType(CAknGridView::EScrollFollowsItemsAndStops);
       
  2623     SetSecondaryScrollingType(CAknGridView::EScrollFollowsItemsAndLoops);
       
  2624 
       
  2625     CAknGrid &aGrid = *this;
       
  2626 
       
  2627     CFormattedCellListBoxItemDrawer *itemDrawer = aGrid.ItemDrawer();
       
  2628     AknListBoxLayouts::SetupStandardGrid(aGrid);
       
  2629 
       
  2630     AknListBoxLayouts::SetupGridPos(aGrid,0,0,-1,-1,22,20);
       
  2631 
       
  2632 
       
  2633     // The rectangle needs to be a bitmap.
       
  2634     // 21x19 bitmap (draw separator lines inside the bitmap)
       
  2635     AknListBoxLayouts::SetupFormGfxCell(aGrid, itemDrawer, 0,
       
  2636                 0,0, -1,-1, 21,19,
       
  2637                 TPoint(0,0),TPoint(21,19));
       
  2638 
       
  2639 
       
  2640     // needs transparency (5x5 bitmap)
       
  2641     itemDrawer->FormattedCellData()->SetTransparentSubCellL(1, ETrue);
       
  2642     itemDrawer->FormattedCellData()->SetNotAlwaysDrawnSubCellL(1,ETrue);
       
  2643     AknListBoxLayouts::SetupFormGfxCell(aGrid, itemDrawer, 1,
       
  2644                 16,14, -1,-1, 5,5,
       
  2645                 TPoint(16,14),TPoint(21,19));
       
  2646 
       
  2647     // needs transparency (day number)
       
  2648     itemDrawer->FormattedCellData()->SetTransparentSubCellL(2, ETrue);
       
  2649     itemDrawer->FormattedCellData()->SetNotAlwaysDrawnSubCellL(2,ETrue);
       
  2650 
       
  2651     AknListBoxLayouts::SetupFormAntiFlickerTextCell(aGrid, itemDrawer, 2,
       
  2652                  LatinBold12(), 215, 3,4,14,14,CGraphicsContext::ECenter,
       
  2653                  TPoint(0,0),TPoint(21,19));
       
  2654 
       
  2655     SetSeparatorLinePosition(this, ENoLine);
       
  2656     
       
  2657     DisableScrolling( ETrue );
       
  2658     _AKNTRACE_FUNC_EXIT;
       
  2659     }
       
  2660 
       
  2661 //
       
  2662 //
       
  2663 //   MinimumSize() methods for concrete listboxes
       
  2664 //
       
  2665 //
       
  2666 
       
  2667 TSize MinimumSizeImpl(CEikListBox *aListBox, TBool /*aFindPossible*/)
       
  2668     {
       
  2669     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
  2670     // this must be equal to "old" main pane lists or dialogs will break (sigh)
       
  2671     TRect mainPane;
       
  2672     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
       
  2673 
       
  2674     TSize ret = mainPane.Size();
       
  2675     TInt height = 0;
       
  2676 
       
  2677     // If we have find pane, then listbox has less space.
       
  2678     CAknListBoxFilterItems *filter = static_cast<CAknFilteredTextListBoxModel*>( aListBox->Model())->Filter();
       
  2679 
       
  2680     if ( filter && filter->FindBox() && filter->FindBox()->IsVisible() )
       
  2681         {
       
  2682         height = filter->FindBox()->Rect().Height();
       
  2683         }
       
  2684 
       
  2685     ret.SetSize(ret.iWidth,ret.iHeight - height );
       
  2686     return ret;
       
  2687     }
       
  2688 
       
  2689 EXPORT_C TSize CAknSingleStyleListBox::MinimumSize()
       
  2690     {
       
  2691     return MinimumSizeImpl(this, ETrue);
       
  2692     }
       
  2693 
       
  2694 EXPORT_C TSize CAknSingleNumberStyleListBox::MinimumSize()
       
  2695     {
       
  2696     return MinimumSizeImpl(this, ETrue);
       
  2697     }
       
  2698 
       
  2699 EXPORT_C TSize CAknSingleHeadingStyleListBox::MinimumSize()
       
  2700     {
       
  2701     return MinimumSizeImpl(this, ETrue);
       
  2702     }
       
  2703 
       
  2704 EXPORT_C TSize CAknSingleGraphicStyleListBox::MinimumSize()
       
  2705     {
       
  2706     _AKNTRACE( "[%s][%s][%d]", "CAknSingleGraphicStyleListBox", __FUNCTION__, __LINE__ );
       
  2707     TRect mainPane;
       
  2708     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
       
  2709     TRect parentrect( TPoint( 0, 0 ),TSize( mainPane.Width(), mainPane.Height() ) );
       
  2710     
       
  2711     // If we have find pane, then listbox has less space.
       
  2712     CAknListBoxFilterItems *filter = static_cast<CAknFilteredTextListBoxModel*>( this->Model())->Filter();
       
  2713 
       
  2714     TInt height;
       
  2715     // If it is popup find that is not visible, treat it like no find at all.
       
  2716     if ( filter && filter->FindBox() && filter->FindBox()->IsVisible() )
       
  2717         {
       
  2718         //TInt bb = AknLayoutScalable_Avkon::popup_find_window().LayoutLine().Rect().Height();
       
  2719         TInt findHight = filter->FindBox()->Rect().Height();
       
  2720         height = parentrect.Height() - findHight;
       
  2721         }
       
  2722     else
       
  2723         {
       
  2724         height = parentrect.Height();
       
  2725         } 
       
  2726     
       
  2727     return TSize( parentrect.Width(), height );
       
  2728     }
       
  2729 
       
  2730 EXPORT_C TSize CAknSingleGraphicHeadingStyleListBox::MinimumSize()
       
  2731     {
       
  2732     return MinimumSizeImpl(this, ETrue);
       
  2733     }
       
  2734 
       
  2735 EXPORT_C TSize CAknSingleNumberHeadingStyleListBox::MinimumSize()
       
  2736     {
       
  2737     return MinimumSizeImpl(this, ETrue);
       
  2738     }
       
  2739 
       
  2740 EXPORT_C TSize CAknSingleLargeStyleListBox::MinimumSize()
       
  2741     {
       
  2742     return MinimumSizeImpl(this, EFalse);
       
  2743     }
       
  2744 
       
  2745 EXPORT_C TSize CAknSingle2GraphicStyleListBox::MinimumSize()
       
  2746     {
       
  2747     return MinimumSizeImpl(this, ETrue);
       
  2748     }
       
  2749 
       
  2750 EXPORT_C TSize CAknDoubleStyleListBox::MinimumSize()
       
  2751     {
       
  2752     return MinimumSizeImpl(this, EFalse);
       
  2753     }
       
  2754 
       
  2755 EXPORT_C TSize CAknDoubleNumberStyleListBox::MinimumSize()
       
  2756     {
       
  2757     return MinimumSizeImpl(this, EFalse);
       
  2758     }
       
  2759 
       
  2760 EXPORT_C TSize CAknDoubleTimeStyleListBox::MinimumSize()
       
  2761     {
       
  2762     return MinimumSizeImpl(this, EFalse);
       
  2763     }
       
  2764 
       
  2765 EXPORT_C TSize CAknDoubleLargeStyleListBox::MinimumSize()
       
  2766     {
       
  2767     return MinimumSizeImpl(this, EFalse);
       
  2768     }
       
  2769 
       
  2770 EXPORT_C TSize CAknDoubleGraphicStyleListBox::MinimumSize()
       
  2771     {
       
  2772     return MinimumSizeImpl(this, EFalse);
       
  2773     }
       
  2774 
       
  2775 EXPORT_C TSize CAknDouble2GraphicStyleListBox::MinimumSize()
       
  2776     {
       
  2777     return MinimumSizeImpl(this, EFalse);
       
  2778     }
       
  2779 
       
  2780 EXPORT_C TSize CAknDouble2LargeStyleListBox::MinimumSize()
       
  2781     {
       
  2782     return MinimumSizeImpl(this, EFalse);
       
  2783     }
       
  2784 
       
  2785 EXPORT_C TSize CAknDouble2GraphicLargeStyleListBox::MinimumSize()
       
  2786     {
       
  2787     return MinimumSizeImpl(this, EFalse);
       
  2788     }
       
  2789 
       
  2790 EXPORT_C TSize CAknDouble2GraphicLargeGraphicStyleListBox::MinimumSize()
       
  2791     {
       
  2792     return MinimumSizeImpl(this, EFalse);
       
  2793     }
       
  2794 
       
  2795 EXPORT_C TSize CAknSettingStyleListBox::MinimumSize()
       
  2796     {
       
  2797     return MinimumSizeImpl(this, EFalse);
       
  2798     }
       
  2799 
       
  2800 EXPORT_C TSize CAknSettingNumberStyleListBox::MinimumSize()
       
  2801     {
       
  2802     return MinimumSizeImpl(this, EFalse);
       
  2803     }
       
  2804 
       
  2805 static TSize CalcPopupSize(CEikListBox *aListbox,
       
  2806                            const TAknWindowLineLayout &aL,
       
  2807                            const TAknLayoutScalableParameterLimits &aLimits,
       
  2808                            TInt aMinItems = 1) // how to get rid of this?
       
  2809     {
       
  2810     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
  2811     TInt num = aListbox->Model()->NumberOfItems();
       
  2812     TInt maxItems = aLimits.LastRow() + 1; // last row is a zero based index, we need num items which is 1 based
       
  2813         
       
  2814     TSize itemSize( PopupListItemSize(aL) );
       
  2815 
       
  2816     if (num < aMinItems) num = aMinItems;
       
  2817     if (num > maxItems) num = maxItems;    
       
  2818     return TSize(itemSize.iWidth, itemSize.iHeight*num);
       
  2819     }
       
  2820 
       
  2821 static TSize CalcPopupSize(CEikListBox *aListbox, 
       
  2822                            TAknWindowLineLayout aWindowLineLayout,
       
  2823                            TAknWindowLineLayout aParent,
       
  2824                            TAknWindowLineLayout aGrandParent,
       
  2825                            TInt aMinItems, TInt aMaxItems)
       
  2826     {
       
  2827     _AKNTRACE( "[%s][%d]", __FUNCTION__, __LINE__ );
       
  2828     __ASSERT_DEBUG(aMinItems <= aMaxItems, Panic(EAknPanicOutOfRange));
       
  2829     
       
  2830     TAknLayoutRect layout = CommonLayoutRect(aWindowLineLayout, aParent, aGrandParent);
       
  2831     TInt num = aListbox->Model()->NumberOfItems();
       
  2832 
       
  2833     if (num < aMinItems) num = aMinItems;
       
  2834     if (num > aMaxItems) num = aMaxItems;    
       
  2835     return TSize(layout.Rect().Width(), layout.Rect().Height()*num);
       
  2836     }
       
  2837 
       
  2838 EXPORT_C TSize CAknSinglePopupMenuStyleListBox::MinimumSize()
       
  2839     {
       
  2840     return CalcPopupSize(this,
       
  2841         AknLayoutScalable_Avkon::list_single_pane_cp2(0),
       
  2842         AknLayoutScalable_Avkon::list_single_pane_cp2_ParamLimits());
       
  2843     }
       
  2844 
       
  2845 EXPORT_C TSize CAknSingleGraphicPopupMenuStyleListBox::MinimumSize()
       
  2846     {
       
  2847     return CalcPopupSize(this,
       
  2848         AknLayoutScalable_Avkon::list_single_graphic_pane_cp2(0),
       
  2849         AknLayoutScalable_Avkon::list_single_graphic_pane_cp2_ParamLimits());
       
  2850     }
       
  2851 
       
  2852 EXPORT_C TSize CAknSingleGraphicHeadingPopupMenuStyleListBox::MinimumSize()
       
  2853     {
       
  2854     return CalcPopupSize(this,
       
  2855         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_cp2(0),
       
  2856         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_cp2_ParamLimits());
       
  2857     }
       
  2858 
       
  2859 EXPORT_C TSize CAknSingleHeadingPopupMenuStyleListBox::MinimumSize()
       
  2860     {
       
  2861     return CalcPopupSize(this,
       
  2862         AknLayoutScalable_Avkon::list_single_heading_pane_cp2(0),
       
  2863         AknLayoutScalable_Avkon::list_single_heading_pane_cp2_ParamLimits());
       
  2864     }
       
  2865 
       
  2866 
       
  2867 EXPORT_C TSize CAknDoublePopupMenuStyleListBox::MinimumSize()
       
  2868     {
       
  2869     return CalcPopupSize(this,
       
  2870         AknLayoutScalable_Avkon::list_double_pane_cp2(0),
       
  2871         AknLayoutScalable_Avkon::list_double_pane_cp2_ParamLimits());
       
  2872     }
       
  2873 
       
  2874 // deprecated 
       
  2875 EXPORT_C TSize CAknSinglePopupSubmenuStyleListBox::MinimumSize()
       
  2876     {
       
  2877     _AKNTRACE( "[%s][%s][%d]", "CAknSinglePopupSubmenuStyleListBox", __FUNCTION__, __LINE__ );
       
  2878     // most likely will never be used
       
  2879     TAknLayoutRect layout = CommonLayoutRect(AKN_LAYOUT_WINDOW_list_single_popup_submenu_pane(0,0),
       
  2880         AKN_LAYOUT_WINDOW_list_submenu_pane(0, 5),
       
  2881         AKN_LAYOUT_WINDOW_Pop_up_windows__main_pane_as_parent__Line_2(5));
       
  2882     TInt num = Model()->NumberOfItems();
       
  2883 
       
  2884     if (num < 1) num = 1;
       
  2885     if (num > 2) num = 2;    
       
  2886     return TSize(layout.Rect().Width(), layout.Rect().Height()*num);
       
  2887     }
       
  2888 EXPORT_C TSize CAknDoubleLargeGraphicPopupMenuStyleListBox::MinimumSize()
       
  2889     {
       
  2890     return CalcPopupSize(this,
       
  2891         AknLayoutScalable_Avkon::list_double_large_graphic_pane_cp2(0),
       
  2892         AknLayoutScalable_Avkon::list_double_large_graphic_pane_cp2_ParamLimits());
       
  2893     }
       
  2894 
       
  2895 EXPORT_C TSize CAknDouble2PopupMenuStyleListBox::MinimumSize()
       
  2896     {
       
  2897     return CalcPopupSize(this,
       
  2898         AknLayoutScalable_Avkon::list_double2_pane_cp2(0),
       
  2899         AknLayoutScalable_Avkon::list_double2_pane_cp2_ParamLimits());
       
  2900     }
       
  2901 
       
  2902 EXPORT_C TSize CAknSingle2GraphicPopupMenuStyleListBox::MinimumSize()
       
  2903     {
       
  2904     return CalcPopupSize(this,
       
  2905         AknLayoutScalable_Avkon::list_single_2graphic_pane_cp2(0),
       
  2906         AknLayoutScalable_Avkon::list_single_2graphic_pane_cp2_ParamLimits());
       
  2907     }
       
  2908 
       
  2909 EXPORT_C TSize CAknDoubleGraphicPopupMenuStyleListBox::MinimumSize()
       
  2910     {
       
  2911     return CalcPopupSize(this,
       
  2912         AknLayoutScalable_Avkon::list_double_graphic_pane_cp2(0),
       
  2913         AknLayoutScalable_Avkon::list_double_graphic_pane_cp2_ParamLimits());
       
  2914     }
       
  2915 
       
  2916 
       
  2917 EXPORT_C TSize CAknSetStyleListBox::MinimumSize()
       
  2918     {
       
  2919     _AKNTRACE( "[%s][%s][%d]", "CAknSetStyleListBox", __FUNCTION__, __LINE__ );
       
  2920     const TInt minItems = 2;
       
  2921     const TInt maxItems = 6;
       
  2922     
       
  2923     TInt num = this->Model()->NumberOfItems();
       
  2924     
       
  2925     if (num < minItems) num = minItems;
       
  2926     if (num > maxItems) num = maxItems;
       
  2927 
       
  2928     TRect mainPane;
       
  2929     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
       
  2930     
       
  2931     CEikFormattedCellListBox &aListBox = *this;
       
  2932     CFormattedCellListBoxItemDrawer *itemDrawer = aListBox.ItemDrawer();
       
  2933 
       
  2934     TAknLayoutRect layout;
       
  2935     if (itemDrawer->ColumnData()->IsBackgroundDrawingEnabled())
       
  2936         {
       
  2937         layout.LayoutRect(mainPane, AKN_LAYOUT_WINDOW_list_set_pane(num - 1));
       
  2938         }
       
  2939     else
       
  2940         {
       
  2941         layout.LayoutRect(mainPane, AKN_LAYOUT_WINDOW_list_set_trans_pane(num - 1));
       
  2942         }
       
  2943     
       
  2944     return TSize(layout.Rect().Width(), layout.Rect().Height());
       
  2945     }
       
  2946 
       
  2947 EXPORT_C TSize CAknFormGraphicStyleListBox::MinimumSize()
       
  2948     {
       
  2949     TAknLayoutScalableParameterLimits paneLimits = AknLayoutScalable_Avkon::form_field_popup_pane_ParamLimits();
       
  2950     TInt maxItems = paneLimits.LastVariety() + 1; // last variety is a zero based index, we need num items which is 1 based
       
  2951     maxItems -= 1;
       
  2952     TAknWindowLineLayout pane = AKN_LAYOUT_WINDOW_list_form_graphic_pane(0);
       
  2953     TAknWindowLineLayout pane2 = AKN_LAYOUT_WINDOW_list_form_pane(0);
       
  2954     TAknWindowLineLayout pane3 = AKN_LAYOUT_WINDOW_form_field_popup_pane(0,0);
       
  2955     return CalcPopupSize(this, pane, pane2, pane3, 2, maxItems);
       
  2956     }
       
  2957 
       
  2958 EXPORT_C TSize CAknFormGraphicWideStyleListBox::MinimumSize()
       
  2959     {
       
  2960     TAknLayoutScalableParameterLimits paneLimits = AknLayoutScalable_Avkon::form_field_popup_wide_pane_ParamLimits();
       
  2961     TInt maxItems = paneLimits.LastVariety() + 1; // last variety is a zero based index, we need num items which is 1 based
       
  2962     maxItems -= 1;
       
  2963     TAknWindowLineLayout pane = AKN_LAYOUT_WINDOW_list_form_graphic_wide_pane(0);
       
  2964     TAknWindowLineLayout pane2 = AKN_LAYOUT_WINDOW_list_form_wide_pane(0,0);
       
  2965     TAknWindowLineLayout pane3 = AKN_LAYOUT_WINDOW_form_field_popup_wide_pane(0,0);
       
  2966 
       
  2967     return CalcPopupSize(this, pane, pane2, pane3, 2, maxItems);
       
  2968     }
       
  2969 
       
  2970 
       
  2971 EXPORT_C TSize CAknAppStyleGrid::MinimumSize()
       
  2972     {
       
  2973     _AKNTRACE( "[%s][%s][%d]", "CAknAppStyleGrid", __FUNCTION__, __LINE__ );
       
  2974     TRect mainPane;
       
  2975     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
       
  2976 
       
  2977     TAknLayoutRect layout;
       
  2978     layout.LayoutRect(mainPane, AKN_LAYOUT_WINDOW_grid_app_pane);
       
  2979 
       
  2980     return layout.Rect().Size();
       
  2981     }
       
  2982 
       
  2983 EXPORT_C TSize CAknPinbStyleGrid::MinimumSize()
       
  2984     {
       
  2985     // currently not used
       
  2986     return TSize(165,145);
       
  2987     }
       
  2988 
       
  2989 EXPORT_C TSize CAknQdialStyleGrid::MinimumSize()
       
  2990     {
       
  2991     _AKNTRACE( "[%s][%s][%d]", "CAknQdialStyleGrid", __FUNCTION__, __LINE__ );
       
  2992     TRect screen;
       
  2993     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen );
       
  2994     TAknLayoutRect r;
       
  2995     r.LayoutRect( screen, AknLayoutScalable_Avkon::application_window( 0 ) );
       
  2996     // main pane varieties:
       
  2997     // 1 portrait, no status pane, possibly touch pane
       
  2998     // 4 landscape with both upper & lower stacon(?) panes, possibly touch pane
       
  2999     TInt mainPaneVariety( Layout_Meta_Data::IsLandscapeOrientation() ? 4 : 1 );
       
  3000     r.LayoutRect( r.Rect(), AknLayoutScalable_Avkon::main_pane( mainPaneVariety ) );
       
  3001     r.LayoutRect( r.Rect(), AknLayoutScalable_Apps::main_qdial_pane() );
       
  3002     r.LayoutRect( r.Rect(), AknLayoutScalable_Apps::grid_qdial_pane() );
       
  3003     return r.Rect().Size();
       
  3004     }
       
  3005 
       
  3006 
       
  3007 EXPORT_C TSize CAknCaleMonthStyleGrid::MinimumSize()
       
  3008     {
       
  3009     // currently not used
       
  3010     return TSize(176,144);
       
  3011     }
       
  3012     
       
  3013 EXPORT_C void CAknCaleMonthStyleGrid::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3014     { 
       
  3015     CAknSelectionGridTypedef::HandlePointerEventL(aPointerEvent); 
       
  3016     }    
       
  3017 
       
  3018 static MAknsControlContext *LinesDefaultContext(const CEikFormattedCellListBox *aListBox)
       
  3019     {
       
  3020     return aListBox->ItemDrawer()->FormattedCellData()->SkinBackgroundContext();
       
  3021     }
       
  3022 
       
  3023 static MAknsControlContext *LinesDefaultContext(const CEikColumnListBox *aListBox)
       
  3024     {
       
  3025     return aListBox->ItemDrawer()->ColumnData()->SkinBackgroundContext();
       
  3026     }
       
  3027 
       
  3028 template<class T>
       
  3029 EXPORT_C AknListBoxLinesTemplate<T>::AknListBoxLinesTemplate(TInt /*aResourceId*/)
       
  3030     {
       
  3031     iResized = EFalse;
       
  3032     }
       
  3033 
       
  3034 template<class T>
       
  3035 EXPORT_C void AknListBoxLinesTemplate<T>::SizeChanged()
       
  3036     {
       
  3037     _AKNTRACE_FUNC_ENTER;
       
  3038     T::SizeChanged();
       
  3039     iResized = ETrue;
       
  3040     _AKNTRACE_FUNC_EXIT;
       
  3041     }
       
  3042     
       
  3043 template<class T>
       
  3044 EXPORT_C void AknPopupListEmpty<T>::Draw(const TRect &aRect) const
       
  3045     {
       
  3046     if (this->iModel->NumberOfItems() == 0)
       
  3047         {
       
  3048 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
       
  3049         CAknTransitionUtils::SetData( ( TInt )this->iView, &this->SystemGc() );
       
  3050 #endif
       
  3051         this->iView->DrawEmptyList(this->Rect());
       
  3052         
       
  3053 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
       
  3054         CAknTransitionUtils::RemoveData( ( TInt )this->iView );
       
  3055 #endif
       
  3056         }
       
  3057     else
       
  3058         {
       
  3059 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
  3060         MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( this->iItemDrawer->Gc() );
       
  3061             if ( transApi )
       
  3062                 {
       
  3063                 transApi->SetListType( MAknListBoxTfxInternal::EListBoxTypePopup );
       
  3064             }
       
  3065 #endif //RD_UI_TRANSITION_EFFECTS_LIST
       
  3066 
       
  3067         T::Draw(aRect);
       
  3068         }
       
  3069     }
       
  3070 
       
  3071 template<class T>
       
  3072 EXPORT_C void AknListBoxLinesTemplate<T>::Draw(const TRect& aRect) const
       
  3073     {
       
  3074     if (!iResized)
       
  3075         {
       
  3076         return;
       
  3077         }
       
  3078 
       
  3079     CWindowGc* gc = this->iItemDrawer->Gc();
       
  3080 
       
  3081     // If a parent has a custom gc, draw listbox using that gc
       
  3082     CWindowGc* replacedGc = ReplaceGcWithCustomGc(
       
  3083                                     static_cast<const CEikListBox*>( this ) );
       
  3084 
       
  3085     if (this->iModel->NumberOfItems() == 0)
       
  3086         {
       
  3087         this->iView->DrawEmptyList(this->Rect());
       
  3088 
       
  3089         if ( replacedGc )
       
  3090             {
       
  3091             // Stop using the custom gc
       
  3092             this->iItemDrawer->SetGc( replacedGc );
       
  3093             }
       
  3094         return;
       
  3095         }
       
  3096 
       
  3097 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
  3098     MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( gc );
       
  3099     
       
  3100     if ( transApi )
       
  3101         {
       
  3102         transApi->SetListType( MAknListBoxTfxInternal::EListBoxTypeMainPane );
       
  3103         transApi->BeginRedraw( MAknListBoxTfxInternal::EListView, this->Rect() );
       
  3104         }
       
  3105 #endif //RD_UI_TRANSITION_EFFECTS_LIST
       
  3106     if (!this->iView->RedrawDisabled())
       
  3107         {
       
  3108         MAknsControlContext *cc = AknsDrawUtils::ControlContext( this );
       
  3109         if (!cc) cc = ::LinesDefaultContext(this);
       
  3110 
       
  3111         if (gc)
       
  3112             {
       
  3113             TRect clientRect;
       
  3114             this->RestoreClientRectFromViewRect(clientRect);
       
  3115 #ifdef RD_UI_TRANSITION_EFFECTS_LIST           
       
  3116             if ( transApi )
       
  3117                 {
       
  3118                 transApi->StartDrawing( MAknListBoxTfxInternal::EListView );
       
  3119                 }
       
  3120 #endif //RD_UI_TRANSITION_EFFECTS_LIST
       
  3121             gc->SetBrushColor(this->BackColor());
       
  3122             AknsDrawUtils::BackgroundBetweenRects( AknsUtils::SkinInstance(), cc, this, *gc, clientRect, this->iView->ViewRect() );
       
  3123 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
  3124             if ( transApi )
       
  3125                 {
       
  3126                 transApi->StopDrawing();
       
  3127         }
       
  3128 #endif //RD_UI_TRANSITION_EFFECTS_LIST
       
  3129             }
       
  3130         }
       
  3131     if ( this->iModel->NumberOfItems() )
       
  3132         {
       
  3133         // finally, draw the actual list
       
  3134         this->iView->Draw(&aRect);
       
  3135         }
       
  3136 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
  3137     if ( transApi )
       
  3138         {
       
  3139         transApi->EndViewRedraw( aRect );
       
  3140         }
       
  3141 #endif //RD_UI_TRANSITION_EFFECTS_LIST
       
  3142     if ( replacedGc )
       
  3143         {
       
  3144         // Stop using the custom gc
       
  3145         this->iItemDrawer->SetGc( replacedGc );
       
  3146         }
       
  3147     }
       
  3148 
       
  3149 template<class T>
       
  3150 EXPORT_C TInt AknListBoxLinesTemplate<T>::CountComponentControls() const
       
  3151     {
       
  3152     return T::CountComponentControls();
       
  3153     }
       
  3154 
       
  3155 template<class T>
       
  3156 EXPORT_C CCoeControl* AknListBoxLinesTemplate<T>::ComponentControl(TInt aIndex) const
       
  3157     {
       
  3158     TInt count = T::CountComponentControls();
       
  3159     if (aIndex < count) 
       
  3160     {
       
  3161     return T::ComponentControl(aIndex);
       
  3162     } else return 0;
       
  3163     }       
       
  3164 
       
  3165 EXPORT_C TBool AknListBoxUtils::ListBoxLinesShown( MAknsSkinInstance *aInstance,
       
  3166                                                    MAknsControlContext* /*aCc*/ )
       
  3167     {  // DEPRECATED
       
  3168     return AknsDrawUtils::IsListSeperatorLines( aInstance );
       
  3169     }
       
  3170 
       
  3171 EXPORT_C void CAknPinbStyleGrid::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3172     { 
       
  3173     CAknSelectionGridTypedef::HandlePointerEventL(aPointerEvent); 
       
  3174     }   
       
  3175 
       
  3176 EXPORT_C void CAknQdialStyleGrid::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3177     { 
       
  3178     CAknSelectionGridTypedef::HandlePointerEventL(aPointerEvent); 
       
  3179     }
       
  3180     
       
  3181 EXPORT_C void CAknDoubleStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3182     { 
       
  3183     CEikFormattedCellListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3184     }    
       
  3185     
       
  3186 EXPORT_C void CAknSingleStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3187     { 
       
  3188     CEikColumnListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3189     }    
       
  3190     
       
  3191 EXPORT_C void CAknDoubleStyle2ListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3192     { 
       
  3193     CAknDoubleStyleListBox::HandlePointerEventL(aPointerEvent); 
       
  3194     }    
       
  3195 
       
  3196 EXPORT_C void CAknSettingStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3197     { 
       
  3198     CEikSettingsListBoxTypedef::HandlePointerEventL( aPointerEvent ); 
       
  3199     }    
       
  3200     
       
  3201 EXPORT_C void CAknDoubleTimeStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3202     { 
       
  3203     CEikFormattedCellListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3204     }    
       
  3205     
       
  3206 EXPORT_C void CAknFormDoubleStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3207     { 
       
  3208     CAknDoubleStyleListBox::HandlePointerEventL(aPointerEvent); 
       
  3209     }    
       
  3210     
       
  3211 EXPORT_C void CAknDoubleLargeStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3212     { 
       
  3213     CEikFormattedCellListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3214     }    
       
  3215     
       
  3216 EXPORT_C void CAknSingleLargeStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3217     { 
       
  3218     CEikColumnListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3219     }     
       
  3220     
       
  3221 EXPORT_C void CAknDouble2LargeStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3222     { 
       
  3223     CEikFormattedCellListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3224     }    
       
  3225     
       
  3226 EXPORT_C void CAknDoubleNumberStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3227     { 
       
  3228     CEikFormattedCellListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3229     }    
       
  3230     
       
  3231 EXPORT_C void CAknSingleNumberStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3232     { 
       
  3233     CEikColumnListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3234     }    
       
  3235     
       
  3236 EXPORT_C void CAknDoubleGraphicStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3237     { 
       
  3238     CEikFormattedCellListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3239     }    
       
  3240     
       
  3241 EXPORT_C void CAknSettingNumberStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3242     { 
       
  3243     CEikSettingsListBoxTypedef::HandlePointerEventL( aPointerEvent );
       
  3244     }    
       
  3245     
       
  3246 EXPORT_C void CAknSingleGraphicStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3247     { 
       
  3248     CEikColumnListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3249     }    
       
  3250     
       
  3251 EXPORT_C void CAknSingleHeadingStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3252     { 
       
  3253     CEikColumnListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3254     }    
       
  3255     
       
  3256 EXPORT_C void CAknDouble2GraphicStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3257     { 
       
  3258     CEikFormattedCellListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3259     } 
       
  3260     
       
  3261 EXPORT_C void CAknDoublePopupMenuStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3262     { 
       
  3263     CEikFormattedCellListBox::HandlePointerEventL(aPointerEvent); 
       
  3264     }       
       
  3265 
       
  3266 EXPORT_C void CAknFormGraphicWideStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3267     { 
       
  3268     CAknFormGraphicStyleListBox::HandlePointerEventL(aPointerEvent); 
       
  3269     }
       
  3270     
       
  3271 EXPORT_C void CAknSinglePopupMenuStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3272     { 
       
  3273     CEikFormattedCellListBox::HandlePointerEventL(aPointerEvent); 
       
  3274     }    
       
  3275     
       
  3276 EXPORT_C void CAknDouble2PopupMenuStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3277     { 
       
  3278     CEikFormattedCellListBox::HandlePointerEventL(aPointerEvent); 
       
  3279     }    
       
  3280     
       
  3281 EXPORT_C void CAknFormDoubleGraphicStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3282     { 
       
  3283     CAknDoubleGraphicStyleListBox::HandlePointerEventL(aPointerEvent); 
       
  3284     }    
       
  3285     
       
  3286 // deprecated 
       
  3287 EXPORT_C void CAknSinglePopupSubmenuStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3288     { 
       
  3289     CEikFormattedCellListBox::HandlePointerEventL(aPointerEvent); 
       
  3290     }  
       
  3291     
       
  3292 EXPORT_C void CAknSingleNumberHeadingStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3293     { 
       
  3294     CEikColumnListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3295     }      
       
  3296     
       
  3297 EXPORT_C void CAknSingleGraphicHeadingStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3298     { 
       
  3299     CEikColumnListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3300     }    
       
  3301     
       
  3302 EXPORT_C void CAknSingleGraphicPopupMenuStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3303     { 
       
  3304     CEikFormattedCellListBox::HandlePointerEventL(aPointerEvent); 
       
  3305     }    
       
  3306     
       
  3307 EXPORT_C void CAknSingleHeadingPopupMenuStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3308     { 
       
  3309     CEikFormattedCellListBox::HandlePointerEventL(aPointerEvent); 
       
  3310     }
       
  3311     
       
  3312 EXPORT_C void CAknSingleGraphicBtPopupMenuStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3313     { 
       
  3314     CAknSingleGraphicPopupMenuStyleListBox::HandlePointerEventL(aPointerEvent); 
       
  3315     }
       
  3316     
       
  3317 EXPORT_C void CAknDoubleLargeGraphicPopupMenuStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3318     { 
       
  3319     CEikFormattedCellListBox::HandlePointerEventL(aPointerEvent); 
       
  3320     }
       
  3321     
       
  3322 EXPORT_C void CAknSingleGraphicHeadingPopupMenuStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3323     { 
       
  3324     CEikFormattedCellListBox::HandlePointerEventL(aPointerEvent); 
       
  3325     }     
       
  3326     
       
  3327 EXPORT_C void CAknSingle2GraphicPopupMenuStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3328     { 
       
  3329     CEikFormattedCellListBox::HandlePointerEventL(aPointerEvent); 
       
  3330     }     
       
  3331     
       
  3332 EXPORT_C void CAknDoubleGraphicPopupMenuStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3333     { 
       
  3334     CEikFormattedCellListBox::HandlePointerEventL(aPointerEvent); 
       
  3335     }     
       
  3336 
       
  3337 EXPORT_C void CAknDouble2GraphicLargeGraphicStyleListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
       
  3338     { 
       
  3339     CEikFormattedCellListBoxTypedef::HandlePointerEventL(aPointerEvent); 
       
  3340     }               
       
  3341 
       
  3342 // -----------------------------------------------------------------------------
       
  3343 // CEikFormattedCellListBox derivatives.
       
  3344 // Following functions use the new listbox layout system.
       
  3345 // -----------------------------------------------------------------------------
       
  3346 
       
  3347 // -----------------------------------------------------------------------------
       
  3348 // CAknDoubleGraphicStyleListBox::SizeChanged
       
  3349 // -----------------------------------------------------------------------------
       
  3350 //
       
  3351 EXPORT_C void CAknDoubleGraphicStyleListBox::SizeChanged()
       
  3352     {
       
  3353     _AKNTRACE_FUNC_ENTER;
       
  3354     AKNFORMATTEDLISTBOX::SizeChanged();
       
  3355     TRAP_IGNORE( SizeChangedL() );
       
  3356     SetupScrollbarLayout( this, iSBFrame );
       
  3357     UpdateScrollBarThumbs();
       
  3358     _AKNTRACE_FUNC_EXIT;
       
  3359     }
       
  3360 
       
  3361 // -----------------------------------------------------------------------------
       
  3362 // CAknDoubleGraphicStyleListBox::SizeChangedL
       
  3363 // -----------------------------------------------------------------------------
       
  3364 //
       
  3365 void CAknDoubleGraphicStyleListBox::SizeChangedL()
       
  3366     {
       
  3367     _AKNTRACE_FUNC_ENTER;
       
  3368     CFormattedCellListBoxItemDrawer* itemDrawer( ItemDrawer() );
       
  3369     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
       
  3370     if ( !formattedCellData->SecondRowHidden() )
       
  3371         {
       
  3372         SetupStretchableListL( this,
       
  3373                               AknLayoutScalable_Avkon::list_double_graphic_pane( 0 ),
       
  3374                               AknLayoutScalable_Avkon::list_double_graphic_pane_vc( 0 ) );
       
  3375         }
       
  3376     else
       
  3377         {
       
  3378         SetupStretchableListL( this,
       
  3379                               AknLayoutScalable_Avkon::list_single_graphic_pane( 0 ),
       
  3380                               AknLayoutScalable_Avkon::list_double_graphic_pane_vc( 0 ) );
       
  3381         }
       
  3382 
       
  3383     SetSeparatorLinePosition( this, EABColumn );
       
  3384 
       
  3385     if ( ShowAllRows( formattedCellData ) )
       
  3386         {
       
  3387         formattedCellData->SetStretchableGraphicSubCellL(
       
  3388             0,
       
  3389             AknLayoutScalable_Avkon::list_double_graphic_pane_g1( 0 ),
       
  3390             AknLayoutScalable_Avkon::list_double_graphic_pane_vc_g1( 0 ) );
       
  3391 
       
  3392         formattedCellData->SetStretchableTextSubCellL(
       
  3393             1,
       
  3394             AknLayoutScalable_Avkon::list_double_graphic_pane_t1( 0 ),
       
  3395             AknLayoutScalable_Avkon::list_double_graphic_pane_vc_t1( 0 ) );
       
  3396 
       
  3397         formattedCellData->SetStretchableTextSubCellL(
       
  3398             2,
       
  3399             AknLayoutScalable_Avkon::list_double_graphic_pane_t2( 0 ),
       
  3400             AknLayoutScalable_Avkon::list_double_graphic_pane_vc_t2( 0 ) );
       
  3401             
       
  3402         formattedCellData->SetStretchableGraphicSubCellL(
       
  3403             3,
       
  3404             AknLayoutScalable_Avkon::list_double_graphic_pane_g3( 0 ),
       
  3405             AknLayoutScalable_Avkon::list_double_graphic_pane_vc_g3( 0 ) );
       
  3406 
       
  3407         formattedCellData->SetStretchableGraphicSubCellL(
       
  3408             4,
       
  3409             AknLayoutScalable_Avkon::list_double_graphic_pane_g2( 1 ),
       
  3410             AknLayoutScalable_Avkon::list_double_graphic_pane_vc_g2( 1 ) );
       
  3411 
       
  3412         // New icon below g1. 
       
  3413         formattedCellData->SetGraphicSubCellL(
       
  3414             5,
       
  3415             AknLayoutScalable_Avkon::list_double_graphic_pane_g4( 0 ) );
       
  3416 
       
  3417         // On default new cell is always drawn but this cell should NOT be drawn!
       
  3418         formattedCellData->SetNotAlwaysDrawnSubCellL( 5, ETrue );
       
  3419             
       
  3420         // Conditional subcells must be added in priority order!
       
  3421         formattedCellData->SetStretchableConditionalSubCellL(
       
  3422             4,
       
  3423             AknLayoutScalable_Avkon::list_double_graphic_pane_t1( 2 ),
       
  3424             AknLayoutScalable_Avkon::list_double_graphic_pane_vc_t2( 2 ), 1, 2 );
       
  3425 
       
  3426         formattedCellData->SetStretchableConditionalSubCellL(
       
  3427             3,
       
  3428             AknLayoutScalable_Avkon::list_double_graphic_pane_t1( 1 ),
       
  3429             AknLayoutScalable_Avkon::list_double_graphic_pane_vc_t2( 1 ), 1, 2 );
       
  3430         }
       
  3431     else
       
  3432         {
       
  3433         formattedCellData->SetStretchableGraphicSubCellL(
       
  3434             0,
       
  3435             AknLayoutScalable_Avkon::list_single_graphic_pane_g1( 0 ),
       
  3436             AknLayoutScalable_Avkon::list_double_graphic_pane_vc_g1( 0 ) );
       
  3437 
       
  3438         formattedCellData->SetStretchableTextSubCellL(
       
  3439             1,
       
  3440             AknLayoutScalable_Avkon::list_single_graphic_pane_t1( 0 ),
       
  3441             AknLayoutScalable_Avkon::list_double_graphic_pane_vc_t1( 0 ) );
       
  3442         }
       
  3443   
       
  3444     itemDrawer->SetItemMarkReverse( ETrue );
       
  3445 
       
  3446     if ( iListBoxFlags & EAknListBoxFlagsMultiselectionCheck )
       
  3447         {
       
  3448         itemDrawer->SetItemMarkPosition( 0 );
       
  3449         itemDrawer->SetItemMarkReplacement( KFirstIconReplacement ); // should not colorskin 'front' checkbox icon
       
  3450         }
       
  3451     else
       
  3452         {
       
  3453         itemDrawer->SetItemMarkPosition( 3 );
       
  3454         itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  3455         }
       
  3456     _AKNTRACE_FUNC_EXIT;
       
  3457     }
       
  3458 
       
  3459 // -----------------------------------------------------------------------------
       
  3460 // CAknDoubleStyleListBox::SizeChanged
       
  3461 // -----------------------------------------------------------------------------
       
  3462 //
       
  3463 EXPORT_C void CAknDoubleStyleListBox::SizeChanged()
       
  3464     {
       
  3465     _AKNTRACE_FUNC_ENTER;
       
  3466     AKNFORMATTEDLISTBOX::SizeChanged();
       
  3467     TRAP_IGNORE( SizeChangedL() );
       
  3468     SetupScrollbarLayout( this, iSBFrame );
       
  3469     UpdateScrollBarThumbs();
       
  3470     _AKNTRACE_FUNC_EXIT;
       
  3471     }
       
  3472 
       
  3473 // -----------------------------------------------------------------------------
       
  3474 // CAknDoubleStyleListBox::SizeChangedL
       
  3475 // -----------------------------------------------------------------------------
       
  3476 //
       
  3477 void CAknDoubleStyleListBox::SizeChangedL()
       
  3478     {
       
  3479     _AKNTRACE_FUNC_ENTER;
       
  3480     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  3481     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
       
  3482     if ( !formattedCellData->SecondRowHidden() )
       
  3483         {
       
  3484         SetupStretchableListL( this,
       
  3485                               AknLayoutScalable_Avkon::list_double_pane( 0 ),
       
  3486                               AknLayoutScalable_Avkon::list_double_pane_vc( 0 ) );
       
  3487         }
       
  3488     else
       
  3489         {
       
  3490         SetupStretchableListL( this,
       
  3491                               AknLayoutScalable_Avkon::list_single_pane( 0 ),
       
  3492                               AknLayoutScalable_Avkon::list_double_pane_vc( 0 ) );
       
  3493         }
       
  3494 
       
  3495     SetSeparatorLinePosition( this, EAColumn );
       
  3496 
       
  3497     if ( ShowAllRows( formattedCellData ) )
       
  3498         {
       
  3499         // Assertion fails in CFormattedCellListBoxData::DrawFormattedSimple if 
       
  3500         // this cell does not exist.
       
  3501         formattedCellData->SetStretchableTextSubCellL( 0,
       
  3502             AknLayoutScalable_Avkon::list_double_pane_t1( 0 ),
       
  3503             AknLayoutScalable_Avkon::list_double_pane_vc_t1( 0 ) );
       
  3504 
       
  3505         formattedCellData->SetStretchableTextSubCellL( 1,
       
  3506             AknLayoutScalable_Avkon::list_double_pane_t1( 0 ),
       
  3507             AknLayoutScalable_Avkon::list_double_pane_vc_t1( 0 ) );
       
  3508 
       
  3509         formattedCellData->SetStretchableTextSubCellL( 2,
       
  3510             AknLayoutScalable_Avkon::list_double_pane_t2( 0 ),
       
  3511             AknLayoutScalable_Avkon::list_double_pane_vc_t2( 0 ) );
       
  3512             
       
  3513         formattedCellData->SetStretchableGraphicSubCellL( 3,
       
  3514             AknLayoutScalable_Avkon::list_double_pane_g1( 0 ),
       
  3515             AknLayoutScalable_Avkon::list_double_pane_vc_g1( 0 ) );
       
  3516 
       
  3517         formattedCellData->SetStretchableGraphicSubCellL( 4,
       
  3518             AknLayoutScalable_Avkon::list_double_pane_g2( 0 ),
       
  3519             AknLayoutScalable_Avkon::list_double_pane_vc_g2( 0 ) );
       
  3520 
       
  3521         // Conditional subcells must be added in priority order!
       
  3522         formattedCellData->SetStretchableConditionalSubCellL( 4,
       
  3523             AknLayoutScalable_Avkon::list_double_pane_t1( 2 ),
       
  3524             AknLayoutScalable_Avkon::list_double_pane_vc_t2( 2 ), 1, 2 );
       
  3525 
       
  3526         formattedCellData->SetStretchableConditionalSubCellL( 3,
       
  3527             AknLayoutScalable_Avkon::list_double_pane_t1( 1 ),
       
  3528             AknLayoutScalable_Avkon::list_double_pane_vc_t2( 1 ), 1, 2 );
       
  3529         }
       
  3530     else
       
  3531         {
       
  3532         // Assertion fails in CFormattedCellListBoxData::DrawFormattedSimple if 
       
  3533         // this cell does not exist.
       
  3534         formattedCellData->SetStretchableTextSubCellL( 0,
       
  3535             AknLayoutScalable_Avkon::list_single_pane_t1( 0 ),
       
  3536             AknLayoutScalable_Avkon::list_double_pane_vc_t1( 0 ) );
       
  3537 
       
  3538         formattedCellData->SetStretchableTextSubCellL( 1,
       
  3539             AknLayoutScalable_Avkon::list_single_pane_t1( 0 ),
       
  3540             AknLayoutScalable_Avkon::list_double_pane_vc_t1( 0 ) );
       
  3541         }        
       
  3542 
       
  3543     itemDrawer->SetItemMarkReverse( ETrue );
       
  3544     itemDrawer->SetItemMarkPosition( 3 );
       
  3545     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  3546     _AKNTRACE_FUNC_EXIT;
       
  3547     }
       
  3548 
       
  3549 // -----------------------------------------------------------------------------
       
  3550 // CAknDoubleNumberStyleListBox::SizeChanged
       
  3551 // -----------------------------------------------------------------------------
       
  3552 //
       
  3553 EXPORT_C void CAknDoubleNumberStyleListBox::SizeChanged() 
       
  3554     {
       
  3555     _AKNTRACE_FUNC_ENTER;
       
  3556     AKNFORMATTEDLISTBOX::SizeChanged();
       
  3557     TRAP_IGNORE( SizeChangedL() );
       
  3558     SetupScrollbarLayout( this, iSBFrame );
       
  3559     UpdateScrollBarThumbs();
       
  3560     _AKNTRACE_FUNC_EXIT;
       
  3561     }
       
  3562 
       
  3563 // -----------------------------------------------------------------------------
       
  3564 // CAknDoubleNumberStyleListBox::SizeChangedL
       
  3565 // -----------------------------------------------------------------------------
       
  3566 //
       
  3567 void CAknDoubleNumberStyleListBox::SizeChangedL()
       
  3568     {
       
  3569     _AKNTRACE_FUNC_ENTER;
       
  3570     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  3571     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
       
  3572     if ( !formattedCellData->SecondRowHidden() )
       
  3573         {
       
  3574         SetupStretchableListL( this,
       
  3575                               AknLayoutScalable_Avkon::list_double_number_pane( 0 ),
       
  3576                               AknLayoutScalable_Avkon::list_double_number_pane_vc( 0 ) );
       
  3577         }
       
  3578     else
       
  3579         {
       
  3580         SetupStretchableListL( this,
       
  3581                               AknLayoutScalable_Avkon::list_single_number_pane( 0 ),
       
  3582                               AknLayoutScalable_Avkon::list_double_number_pane_vc( 0 ) );
       
  3583         }
       
  3584 
       
  3585     SetSeparatorLinePosition( this, EABColumn );
       
  3586     
       
  3587     if ( ShowAllRows( formattedCellData ) )
       
  3588         {
       
  3589         formattedCellData->SetStretchableTextSubCellL( 0,
       
  3590             AknLayoutScalable_Avkon::list_double_number_pane_t1( 0 ),
       
  3591             AknLayoutScalable_Avkon::list_double_number_pane_vc_t1( 0 ) );
       
  3592 
       
  3593         formattedCellData->SetStretchableTextSubCellL( 1,
       
  3594             AknLayoutScalable_Avkon::list_double_number_pane_t2( 0 ),
       
  3595             AknLayoutScalable_Avkon::list_double_number_pane_vc_t2( 0 ) );
       
  3596 
       
  3597         formattedCellData->SetStretchableTextSubCellL( 2,
       
  3598             AknLayoutScalable_Avkon::list_double_number_pane_t3( 0 ),
       
  3599             AknLayoutScalable_Avkon::list_double_number_pane_vc_t3( 0 ) );
       
  3600             
       
  3601         formattedCellData->SetStretchableGraphicSubCellL( 3,
       
  3602             AknLayoutScalable_Avkon::list_double_number_pane_g1( 0 ),
       
  3603             AknLayoutScalable_Avkon::list_double_number_pane_vc_g1( 0 ) );
       
  3604 
       
  3605         formattedCellData->SetStretchableGraphicSubCellL( 4,
       
  3606             AknLayoutScalable_Avkon::list_double_number_pane_g2( 0 ),
       
  3607             AknLayoutScalable_Avkon::list_double_number_pane_vc_g2( 0 ) );
       
  3608 
       
  3609         // Conditional subcells must be added in priority order!
       
  3610         formattedCellData->SetStretchableConditionalSubCellL( 4,
       
  3611             AknLayoutScalable_Avkon::list_double_number_pane_t2( 2 ),
       
  3612             AknLayoutScalable_Avkon::list_double_number_pane_vc_t3( 2 ), 1, 2 );
       
  3613 
       
  3614         formattedCellData->SetStretchableConditionalSubCellL( 3,
       
  3615             AknLayoutScalable_Avkon::list_double_number_pane_t2( 1 ),
       
  3616             AknLayoutScalable_Avkon::list_double_number_pane_vc_t3( 1 ), 1, 2 );
       
  3617         }
       
  3618     else
       
  3619         {
       
  3620         formattedCellData->SetStretchableTextSubCellL( 0,
       
  3621             AknLayoutScalable_Avkon::list_single_number_pane_t2( 0 ),
       
  3622             AknLayoutScalable_Avkon::list_double_number_pane_vc_t1( 0 ) );
       
  3623 
       
  3624         formattedCellData->SetStretchableTextSubCellL( 1,
       
  3625             AknLayoutScalable_Avkon::list_single_number_pane_t1( 0 ),
       
  3626             AknLayoutScalable_Avkon::list_double_number_pane_vc_t2( 0 ) );
       
  3627         }
       
  3628 
       
  3629     itemDrawer->SetItemMarkReverse( ETrue );
       
  3630     itemDrawer->SetItemMarkPosition( 3 );
       
  3631     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  3632     _AKNTRACE_FUNC_EXIT;
       
  3633     }
       
  3634 
       
  3635 // -----------------------------------------------------------------------------
       
  3636 // CAknDoubleTimeStyleListBox::SizeChanged
       
  3637 // -----------------------------------------------------------------------------
       
  3638 //
       
  3639 EXPORT_C void CAknDoubleTimeStyleListBox::SizeChanged() 
       
  3640     {
       
  3641     _AKNTRACE_FUNC_ENTER;
       
  3642     AKNFORMATTEDLISTBOX::SizeChanged();
       
  3643     TRAP_IGNORE( SizeChangedL() );
       
  3644     SetupScrollbarLayout( this, iSBFrame );
       
  3645     UpdateScrollBarThumbs();
       
  3646     _AKNTRACE_FUNC_EXIT;
       
  3647     }
       
  3648 
       
  3649 // -----------------------------------------------------------------------------
       
  3650 // CAknDoubleTimeStyleListBox::SizeChangedL
       
  3651 // -----------------------------------------------------------------------------
       
  3652 //
       
  3653 void CAknDoubleTimeStyleListBox::SizeChangedL()
       
  3654     {
       
  3655     _AKNTRACE_FUNC_ENTER;
       
  3656     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  3657     CFormattedCellListBoxData* d( itemDrawer->FormattedCellData() );
       
  3658 
       
  3659     SetupStretchableListL( this,
       
  3660                           AknLayoutScalable_Avkon::list_double_time_pane( 0 ),
       
  3661                           AknLayoutScalable_Avkon::list_double_time_pane_vc( 0 ) );
       
  3662 
       
  3663     SetSeparatorLinePosition( this, EBCColumn );
       
  3664     
       
  3665     d->SetStretchableTextSubCellL( 0,
       
  3666         AknLayoutScalable_Avkon::list_double_time_pane_t4( 0 ),
       
  3667         AknLayoutScalable_Avkon::list_double_time_pane_vc_t4( 0 ) );
       
  3668 
       
  3669     d->SetStretchableTextSubCellL( 1,
       
  3670         AknLayoutScalable_Avkon::list_double_time_pane_t3( 0 ),
       
  3671         AknLayoutScalable_Avkon::list_double_time_pane_vc_t3( 0 ) );
       
  3672 
       
  3673     d->SetStretchableTextSubCellL( 2,
       
  3674         AknLayoutScalable_Avkon::list_double_time_pane_t1( 0 ),
       
  3675         AknLayoutScalable_Avkon::list_double_time_pane_vc_t1( 4 ) );
       
  3676         
       
  3677     d->SetStretchableTextSubCellL( 3,
       
  3678         AknLayoutScalable_Avkon::list_double_time_pane_t2( 0 ),
       
  3679         AknLayoutScalable_Avkon::list_double_time_pane_vc_t2( 0 ) );
       
  3680 
       
  3681     d->SetStretchableGraphicSubCellL( 4,
       
  3682         AknLayoutScalable_Avkon::list_double_time_pane_g1( 0 ),
       
  3683         AknLayoutScalable_Avkon::list_double_time_pane_vc_g1( 0 ) );
       
  3684 
       
  3685     d->SetStretchableGraphicSubCellL( 5,
       
  3686         AknLayoutScalable_Avkon::list_double_time_pane_g2( 0 ),
       
  3687         AknLayoutScalable_Avkon::list_double_time_pane_vc_g2( 0 ) );
       
  3688 
       
  3689     // Conditional subcells must be added in priority order!
       
  3690     d->SetStretchableConditionalSubCellL( 5,
       
  3691         AknLayoutScalable_Avkon::list_double_time_pane_t1( 2 ),
       
  3692         AknLayoutScalable_Avkon::list_double_time_pane_vc_t2( 2 ), 2, 3 );
       
  3693 
       
  3694     d->SetStretchableConditionalSubCellL( 4,
       
  3695         AknLayoutScalable_Avkon::list_double_time_pane_t1( 1 ),
       
  3696         AknLayoutScalable_Avkon::list_double_time_pane_vc_t2( 1 ), 2, 3 );
       
  3697     _AKNTRACE_FUNC_EXIT;
       
  3698     }
       
  3699     
       
  3700 // -----------------------------------------------------------------------------
       
  3701 // CAknDoubleLargeStyleListBox::SizeChanged
       
  3702 // -----------------------------------------------------------------------------
       
  3703 //
       
  3704 EXPORT_C void CAknDoubleLargeStyleListBox::SizeChanged() 
       
  3705     {
       
  3706     _AKNTRACE_FUNC_ENTER;
       
  3707     AKNFORMATTEDLISTBOX::SizeChanged();
       
  3708 
       
  3709     if ( !ItemDrawer()->FormattedCellData()->SecondRowHidden() )
       
  3710         {
       
  3711         TRAP_IGNORE( SetupStretchableListL( this,
       
  3712             AknLayoutScalable_Avkon::list_double_large_graphic_pane( 0 ),
       
  3713             AknLayoutScalable_Avkon::list_double_large_graphic_pane_vc( 0 ) ) );
       
  3714         }
       
  3715     else
       
  3716         {
       
  3717         TRAP_IGNORE( SetupStretchableListL( this,
       
  3718             AknLayoutScalable_Avkon::list_single_large_graphic_pane( 0, 0 ),
       
  3719             AknLayoutScalable_Avkon::list_double_large_graphic_pane_vc( 0 ) ) );
       
  3720         }
       
  3721                                                 
       
  3722     TRAP_IGNORE( SizeChangedL() );
       
  3723     SetupScrollbarLayout( this, iSBFrame );
       
  3724     UpdateScrollBarThumbs();
       
  3725     _AKNTRACE_FUNC_EXIT;
       
  3726     }
       
  3727 
       
  3728 // -----------------------------------------------------------------------------
       
  3729 // CAknDoubleLargeStyleListBox::SizeChanged
       
  3730 // -----------------------------------------------------------------------------
       
  3731 //
       
  3732 void CAknDoubleLargeStyleListBox::SizeChangedL()
       
  3733     {
       
  3734     _AKNTRACE_FUNC_ENTER;
       
  3735     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  3736     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
       
  3737 
       
  3738     SetSeparatorLinePosition( this, EBCColumn );
       
  3739     
       
  3740     if ( ShowAllRows( formattedCellData ) )
       
  3741         {
       
  3742         formattedCellData->SetStretchableGraphicSubCellL( 0,
       
  3743             AknLayoutScalable_Avkon::list_double_large_graphic_pane_g1( 0 ),
       
  3744             AknLayoutScalable_Avkon::list_double_large_graphic_pane_vc_g1( 0 ) );
       
  3745 
       
  3746         formattedCellData->SetStretchableTextSubCellL( 1,
       
  3747             AknLayoutScalable_Avkon::list_double_large_graphic_pane_t1( 0 ),
       
  3748             AknLayoutScalable_Avkon::list_double_large_graphic_pane_vc_t1( 0 ) );
       
  3749 
       
  3750         formattedCellData->SetStretchableTextSubCellL( 2,
       
  3751             AknLayoutScalable_Avkon::list_double_large_graphic_pane_t2( 0 ),
       
  3752             AknLayoutScalable_Avkon::list_double_large_graphic_pane_vc_t2( 0 ) );
       
  3753             
       
  3754         formattedCellData->SetStretchableGraphicSubCellL( 3,
       
  3755             AknLayoutScalable_Avkon::list_double_large_graphic_pane_g2( 0 ),
       
  3756             AknLayoutScalable_Avkon::list_double_large_graphic_pane_vc_g2( 1 ) );
       
  3757 
       
  3758         formattedCellData->SetStretchableGraphicSubCellL( 4,
       
  3759             AknLayoutScalable_Avkon::list_double_large_graphic_pane_g3( 0 ),
       
  3760             AknLayoutScalable_Avkon::list_double_large_graphic_pane_vc_g3( 0 ) );
       
  3761 
       
  3762         // Following code sets additional information icon cell. This is specified 
       
  3763         // in the LAF data but there's no CR to enable it so the code will be 
       
  3764         // commented out untill there's an official request.
       
  3765         /*formattedCellData->SetStretchableGraphicSubCellL( 5,
       
  3766             AknLayoutScalable_Avkon::list_double_large_graphic_pane_g4( 0 ),
       
  3767             AknLayoutScalable_Avkon::list_double_large_graphic_pane_vc_g4( 0 ) );*/
       
  3768 
       
  3769         // Conditional subcells must be added in priority order!
       
  3770         formattedCellData->SetStretchableConditionalSubCellL( 4,
       
  3771             AknLayoutScalable_Avkon::list_double_large_graphic_pane_t1( 2 ),
       
  3772             AknLayoutScalable_Avkon::list_double_large_graphic_pane_vc_t2( 2 ), 1, 2 );
       
  3773 
       
  3774         formattedCellData->SetStretchableConditionalSubCellL( 3,
       
  3775             AknLayoutScalable_Avkon::list_double_large_graphic_pane_t1( 1 ),
       
  3776             AknLayoutScalable_Avkon::list_double_large_graphic_pane_vc_t2( 1 ), 1, 2 );
       
  3777         }
       
  3778     else
       
  3779         {
       
  3780         formattedCellData->SetStretchableGraphicSubCellL( 0,
       
  3781             AknLayoutScalable_Avkon::list_single_large_graphic_pane_g1( 0 ),
       
  3782             AknLayoutScalable_Avkon::list_double_large_graphic_pane_vc_g1( 0 ) );
       
  3783 
       
  3784         formattedCellData->SetStretchableTextSubCellL( 1,
       
  3785             AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1( 0 ),
       
  3786             AknLayoutScalable_Avkon::list_double_large_graphic_pane_vc_t1( 0 ) );
       
  3787         }
       
  3788         
       
  3789     itemDrawer->SetItemMarkReverse( ETrue );
       
  3790     itemDrawer->SetItemMarkPosition( 3 );
       
  3791     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  3792     _AKNTRACE_FUNC_EXIT;
       
  3793     }
       
  3794     
       
  3795 // -----------------------------------------------------------------------------
       
  3796 // CAknDoubleStyle2ListBox::SizeChanged
       
  3797 // -----------------------------------------------------------------------------
       
  3798 //
       
  3799 EXPORT_C void CAknDoubleStyle2ListBox::SizeChanged()
       
  3800     {
       
  3801     _AKNTRACE_FUNC_ENTER;
       
  3802     AKNFORMATTEDLISTBOX::SizeChanged();
       
  3803     TRAP_IGNORE( SizeChangedL() );
       
  3804     SetupScrollbarLayout( this, iSBFrame );
       
  3805     UpdateScrollBarThumbs();
       
  3806     _AKNTRACE_FUNC_EXIT;    
       
  3807     }
       
  3808     
       
  3809 // -----------------------------------------------------------------------------
       
  3810 // CAknDoubleStyle2ListBox::SizeChangedL
       
  3811 // -----------------------------------------------------------------------------
       
  3812 //
       
  3813 void CAknDoubleStyle2ListBox::SizeChangedL()
       
  3814     {
       
  3815     _AKNTRACE_FUNC_ENTER;
       
  3816     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  3817     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
       
  3818 
       
  3819     SetupStretchableListL( this,
       
  3820                           AknLayoutScalable_Avkon::list_double2_pane( 0 ),
       
  3821                           AknLayoutScalable_Avkon::list_double2_pane_vc( 0 ) );
       
  3822 
       
  3823     SetSeparatorLinePosition( this, EAColumn );
       
  3824     
       
  3825     // Assertion fails in CFormattedCellListBoxData::DrawFormattedSimple if this
       
  3826     // cell does not exist.
       
  3827     formattedCellData->SetStretchableTextSubCellL( 0,
       
  3828         AknLayoutScalable_Avkon::list_double2_pane_t1( 0 ),
       
  3829         AknLayoutScalable_Avkon::list_double2_pane_vc_t1( 0 ) );
       
  3830 
       
  3831     formattedCellData->SetStretchableTextSubCellL( 1,
       
  3832         AknLayoutScalable_Avkon::list_double2_pane_t1( 0 ),
       
  3833         AknLayoutScalable_Avkon::list_double2_pane_vc_t1( 0 ) );
       
  3834 
       
  3835     // This cell is never drawn if the list is stretched but it needs to be
       
  3836     // created because list item's format string contains it.
       
  3837     formattedCellData->SetStretchableTextSubCellL( 2,
       
  3838         AknLayoutScalable_Avkon::list_double2_pane_t2( 0 ),
       
  3839         AknLayoutScalable_Avkon::list_double2_pane_vc_t1( 0 ) );
       
  3840         
       
  3841     formattedCellData->SetStretchableGraphicSubCellL( 3,
       
  3842         AknLayoutScalable_Avkon::list_double2_pane_g1( 0 ),
       
  3843         AknLayoutScalable_Avkon::list_double2_pane_vc_g1( 0 ) );
       
  3844 
       
  3845     formattedCellData->SetStretchableGraphicSubCellL( 4,
       
  3846         AknLayoutScalable_Avkon::list_double2_pane_g2( 0 ),
       
  3847         AknLayoutScalable_Avkon::list_double2_pane_vc_g2( 0 ) );
       
  3848 
       
  3849     // Conditional subcells must be added in priority order!
       
  3850     formattedCellData->SetStretchableConditionalSubCellL( 4,
       
  3851         AknLayoutScalable_Avkon::list_double2_pane_t1( 2 ),
       
  3852         AknLayoutScalable_Avkon::list_double2_pane_vc_t1( 2 ), 1, 1 );
       
  3853 
       
  3854     formattedCellData->SetStretchableConditionalSubCellL( 3,
       
  3855         AknLayoutScalable_Avkon::list_double2_pane_t1( 1 ),
       
  3856         AknLayoutScalable_Avkon::list_double2_pane_vc_t1( 1 ), 1, 1 );
       
  3857 
       
  3858     itemDrawer->SetItemMarkReverse( ETrue );
       
  3859     itemDrawer->SetItemMarkPosition( 3 );
       
  3860     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  3861     _AKNTRACE_FUNC_EXIT;    
       
  3862     }
       
  3863 
       
  3864 // -----------------------------------------------------------------------------
       
  3865 // CAknDouble2GraphicStyleListBox::SizeChanged
       
  3866 // -----------------------------------------------------------------------------
       
  3867 //
       
  3868 EXPORT_C void CAknDouble2GraphicStyleListBox::SizeChanged()
       
  3869     {
       
  3870     _AKNTRACE_FUNC_ENTER;
       
  3871     AKNFORMATTEDLISTBOX::SizeChanged();
       
  3872     TRAP_IGNORE( SizeChangedL() );
       
  3873     SetupScrollbarLayout( this, iSBFrame );
       
  3874     UpdateScrollBarThumbs();
       
  3875     _AKNTRACE_FUNC_EXIT;    
       
  3876     }
       
  3877 
       
  3878 // -----------------------------------------------------------------------------
       
  3879 // CAknDouble2GraphicStyleListBox::SizeChangedL
       
  3880 // -----------------------------------------------------------------------------
       
  3881 //
       
  3882 void CAknDouble2GraphicStyleListBox::SizeChangedL()
       
  3883     {
       
  3884     _AKNTRACE_FUNC_ENTER;
       
  3885     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  3886     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
       
  3887 
       
  3888     SetupStretchableListL( this,
       
  3889                           AknLayoutScalable_Avkon::list_double2_graphic_pane( 0 ),
       
  3890                           AknLayoutScalable_Avkon::list_double2_graphic_pane_vc( 0 ) );
       
  3891 
       
  3892     SetSeparatorLinePosition( this, EABColumn );
       
  3893     
       
  3894     formattedCellData->SetStretchableGraphicSubCellL( 0,
       
  3895         AknLayoutScalable_Avkon::list_double2_graphic_pane_g1( 0 ),
       
  3896         AknLayoutScalable_Avkon::list_double2_graphic_pane_vc_g1( 0 ) );
       
  3897 
       
  3898     formattedCellData->SetStretchableTextSubCellL( 1,
       
  3899         AknLayoutScalable_Avkon::list_double2_graphic_pane_t1( 0 ),
       
  3900         AknLayoutScalable_Avkon::list_double2_graphic_pane_vc_t1( 0 ) );
       
  3901 
       
  3902     // This cell is never drawn if the list is stretched but it needs to be
       
  3903     // created because list item's format string contains it.
       
  3904     formattedCellData->SetStretchableTextSubCellL( 2,
       
  3905         AknLayoutScalable_Avkon::list_double2_graphic_pane_t2( 0 ),
       
  3906         AknLayoutScalable_Avkon::list_double2_graphic_pane_vc_t1( 0 ) );
       
  3907         
       
  3908     formattedCellData->SetStretchableGraphicSubCellL( 3,
       
  3909         AknLayoutScalable_Avkon::list_double2_graphic_pane_g2( 0 ),
       
  3910         AknLayoutScalable_Avkon::list_double2_graphic_pane_vc_g2( 0 ) );
       
  3911 
       
  3912     formattedCellData->SetStretchableGraphicSubCellL( 4,
       
  3913         AknLayoutScalable_Avkon::list_double2_graphic_pane_g3( 0 ),
       
  3914         AknLayoutScalable_Avkon::list_double2_graphic_pane_vc_g3( 0 ) );
       
  3915 
       
  3916     // Conditional subcells must be added in priority order!
       
  3917     formattedCellData->SetStretchableConditionalSubCellL( 4,
       
  3918         AknLayoutScalable_Avkon::list_double2_graphic_pane_t1( 2 ),
       
  3919         AknLayoutScalable_Avkon::list_double2_graphic_pane_vc_t1( 2 ), 1, 1 );
       
  3920 
       
  3921     formattedCellData->SetStretchableConditionalSubCellL( 3,
       
  3922         AknLayoutScalable_Avkon::list_double2_graphic_pane_t1( 1 ),
       
  3923         AknLayoutScalable_Avkon::list_double2_graphic_pane_vc_t1( 1 ), 1, 1 );
       
  3924 
       
  3925     itemDrawer->SetItemMarkReverse( ETrue );
       
  3926 
       
  3927     if ( iListBoxFlags & EAknListBoxFlagsMultiselectionCheck )
       
  3928         {
       
  3929         itemDrawer->SetItemMarkPosition( 0 );
       
  3930         itemDrawer->SetItemMarkReplacement( KFirstIconReplacement ); // should not colorskin 'front' checkbox
       
  3931         }
       
  3932     else
       
  3933         {
       
  3934         itemDrawer->SetItemMarkPosition( 3 );
       
  3935         itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  3936         }
       
  3937     _AKNTRACE_FUNC_EXIT;    
       
  3938     }
       
  3939     
       
  3940 // -----------------------------------------------------------------------------
       
  3941 // CAknDouble2LargeStyleListBox::SizeChanged
       
  3942 // -----------------------------------------------------------------------------
       
  3943 //
       
  3944 EXPORT_C void CAknDouble2LargeStyleListBox::SizeChanged() 
       
  3945     {
       
  3946     _AKNTRACE_FUNC_ENTER;
       
  3947     AKNFORMATTEDLISTBOX::SizeChanged();
       
  3948     TRAP_IGNORE( SizeChangedL() );
       
  3949     SetupScrollbarLayout( this, iSBFrame );
       
  3950     UpdateScrollBarThumbs();
       
  3951     _AKNTRACE_FUNC_EXIT;    
       
  3952     }
       
  3953 
       
  3954 // -----------------------------------------------------------------------------
       
  3955 // CAknDouble2LargeStyleListBox::SizeChangedL
       
  3956 // -----------------------------------------------------------------------------
       
  3957 //
       
  3958 void CAknDouble2LargeStyleListBox::SizeChangedL()
       
  3959     {
       
  3960     _AKNTRACE_FUNC_ENTER;
       
  3961     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  3962     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
       
  3963 
       
  3964     SetupStretchableListL( this,
       
  3965                           AknLayoutScalable_Avkon::list_double2_large_graphic_pane( 0 ),
       
  3966                           AknLayoutScalable_Avkon::list_double2_large_graphic_pane_vc( 0 ) );
       
  3967 
       
  3968     SetSeparatorLinePosition( this, EBCColumn );
       
  3969     
       
  3970     formattedCellData->SetStretchableGraphicSubCellL( 0,
       
  3971         AknLayoutScalable_Avkon::list_double2_large_graphic_pane_g1( 0 ),
       
  3972         AknLayoutScalable_Avkon::list_double2_large_graphic_pane_vc_g1( 0 ) );
       
  3973 
       
  3974     formattedCellData->SetStretchableTextSubCellL( 1,
       
  3975         AknLayoutScalable_Avkon::list_double2_large_graphic_pane_t1( 0 ),
       
  3976         AknLayoutScalable_Avkon::list_double2_large_graphic_pane_vc_t1( 0 ) );
       
  3977 
       
  3978     // This cell is never drawn if the list is stretched but it needs to be
       
  3979     // created because list item's format string contains it.
       
  3980     formattedCellData->SetStretchableTextSubCellL( 2,
       
  3981         AknLayoutScalable_Avkon::list_double2_large_graphic_pane_t2( 0 ),
       
  3982         AknLayoutScalable_Avkon::list_double2_large_graphic_pane_vc_t1( 0 ) );
       
  3983         
       
  3984     formattedCellData->SetStretchableGraphicSubCellL( 3,
       
  3985         AknLayoutScalable_Avkon::list_double2_large_graphic_pane_g2( 0 ),
       
  3986         AknLayoutScalable_Avkon::list_double2_large_graphic_pane_vc_g2( 0 ) );
       
  3987 
       
  3988     formattedCellData->SetStretchableGraphicSubCellL( 4,
       
  3989         AknLayoutScalable_Avkon::list_double2_large_graphic_pane_g3( 0 ),
       
  3990         AknLayoutScalable_Avkon::list_double2_large_graphic_pane_vc_g3( 0 ) );
       
  3991 
       
  3992     // Conditional subcells must be added in priority order!
       
  3993     formattedCellData->SetStretchableConditionalSubCellL( 4,
       
  3994         AknLayoutScalable_Avkon::list_double2_large_graphic_pane_t1( 2 ),
       
  3995         AknLayoutScalable_Avkon::list_double2_large_graphic_pane_vc_t1( 2 ), 1, 1 );
       
  3996 
       
  3997     formattedCellData->SetStretchableConditionalSubCellL( 3,
       
  3998         AknLayoutScalable_Avkon::list_double2_large_graphic_pane_t1( 1 ),
       
  3999         AknLayoutScalable_Avkon::list_double2_large_graphic_pane_vc_t1( 1 ), 1, 1 );
       
  4000 
       
  4001     itemDrawer->SetItemMarkReverse( ETrue );
       
  4002     itemDrawer->SetItemMarkPosition( 3 );
       
  4003     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  4004     _AKNTRACE_FUNC_EXIT;    
       
  4005     }
       
  4006     
       
  4007 // -----------------------------------------------------------------------------
       
  4008 // CAknDouble2GraphicLargeGraphicStyleListBox::SizeChanged
       
  4009 // -----------------------------------------------------------------------------
       
  4010 //
       
  4011 EXPORT_C void CAknDouble2GraphicLargeGraphicStyleListBox::SizeChanged() 
       
  4012     {
       
  4013     _AKNTRACE_FUNC_ENTER;
       
  4014     AKNFORMATTEDLISTBOX::SizeChanged();
       
  4015     TRAP_IGNORE( SizeChangedL() );
       
  4016     SetupScrollbarLayout( this, iSBFrame );
       
  4017     UpdateScrollBarThumbs();
       
  4018     _AKNTRACE_FUNC_EXIT;    
       
  4019     }
       
  4020 
       
  4021 // -----------------------------------------------------------------------------
       
  4022 // CAknDouble2GraphicLargeGraphicStyleListBox::SizeChangedL
       
  4023 // -----------------------------------------------------------------------------
       
  4024 //
       
  4025 void CAknDouble2GraphicLargeGraphicStyleListBox::SizeChangedL()
       
  4026     {
       
  4027     _AKNTRACE_FUNC_ENTER;
       
  4028     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  4029     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
       
  4030 
       
  4031     SetupStretchableListL( this,
       
  4032                           AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane( 0 ),
       
  4033                           AknLayoutScalable_Avkon::list_single_large_graphic_pane( 0, 0 ) );
       
  4034 
       
  4035     
       
  4036     if ( Layout_Meta_Data::IsLandscapeOrientation() &&
       
  4037          Layout_Meta_Data::IsListStretchingEnabled() &&
       
  4038          formattedCellData->StretchingEnabled() )
       
  4039         {
       
  4040         SetSeparatorLinePosition( this, EBCColumn );
       
  4041         }
       
  4042     else
       
  4043         {
       
  4044         SetSeparatorLinePosition( this, EABColumn );
       
  4045         }
       
  4046 
       
  4047     // selection indication
       
  4048     formattedCellData->SetStretchableGraphicSubCellL( 0,
       
  4049         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_g4( 0 ),
       
  4050         AknLayoutScalable_Avkon::list_single_large_graphic_pane_g4_cp2() );
       
  4051         
       
  4052     // thumbnail image
       
  4053     formattedCellData->SetStretchableGraphicSubCellL( 1,
       
  4054         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_g1( 0 ),
       
  4055         AknLayoutScalable_Avkon::list_single_large_graphic_pane_g1( 0 ) );
       
  4056         
       
  4057     // item text 1st line
       
  4058     formattedCellData->SetStretchableTextSubCellL( 2,
       
  4059         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_t1( 0 ),
       
  4060         AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1( 0 ) );
       
  4061         
       
  4062     // item text 2nd line (this is never drawn in stretched layout)
       
  4063     formattedCellData->SetStretchableTextSubCellL( 3,
       
  4064         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_t2( 0 ),
       
  4065         AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1( 0 ) );
       
  4066         
       
  4067     // outer additional icon
       
  4068     formattedCellData->SetStretchableGraphicSubCellL( 4,
       
  4069         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_g2( 0 ),
       
  4070         AknLayoutScalable_Avkon::list_single_large_graphic_pane_g2( 0 ) );
       
  4071         
       
  4072     // inner additional icon
       
  4073     formattedCellData->SetStretchableGraphicSubCellL( 5,
       
  4074         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_g3( 0 ),
       
  4075         AknLayoutScalable_Avkon::list_single_large_graphic_pane_g3( 0 ) );
       
  4076         
       
  4077     // Conditional subcells must be added in priority order!
       
  4078     formattedCellData->SetStretchableConditionalSubCellL( 5,
       
  4079         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_t1( 2 ),
       
  4080         AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1( 2 ), 2, 2 );
       
  4081         
       
  4082     formattedCellData->SetStretchableConditionalSubCellL( 4,
       
  4083         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_t1( 1 ),
       
  4084         AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1( 1 ), 2, 2 );
       
  4085     
       
  4086     itemDrawer->SetItemMarkPosition( 0 );
       
  4087     itemDrawer->SetItemMarkReplacement( KFirstCSIconReplacement );
       
  4088     itemDrawer->SetItemMarkReverse( ETrue );
       
  4089     _AKNTRACE_FUNC_EXIT;    
       
  4090     }
       
  4091     
       
  4092 // -----------------------------------------------------------------------------
       
  4093 // CAknDouble2GraphicLargeStyleListBox::SizeChanged
       
  4094 // -----------------------------------------------------------------------------
       
  4095 //
       
  4096 EXPORT_C void CAknDouble2GraphicLargeStyleListBox::SizeChanged() 
       
  4097     {
       
  4098     _AKNTRACE_FUNC_ENTER;
       
  4099     AKNFORMATTEDLISTBOX::SizeChanged();
       
  4100     TRAP_IGNORE( SizeChangedL() );
       
  4101     SetupScrollbarLayout( this, iSBFrame );
       
  4102     UpdateScrollBarThumbs();
       
  4103     _AKNTRACE_FUNC_EXIT;    
       
  4104     }
       
  4105 
       
  4106 // -----------------------------------------------------------------------------
       
  4107 // CAknDouble2GraphicLargeStyleListBox::SizeChangedL
       
  4108 // -----------------------------------------------------------------------------
       
  4109 //
       
  4110 void CAknDouble2GraphicLargeStyleListBox::SizeChangedL()
       
  4111     {
       
  4112     _AKNTRACE_FUNC_ENTER;
       
  4113     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  4114     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
       
  4115 
       
  4116     SetupStretchableListL( this,
       
  4117                           AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane( 0 ),
       
  4118                           AknLayoutScalable_Avkon::list_single_large_graphic_pane( 0, 0 ) );
       
  4119     
       
  4120     if ( Layout_Meta_Data::IsLandscapeOrientation() &&
       
  4121          Layout_Meta_Data::IsListStretchingEnabled() &&
       
  4122          formattedCellData->StretchingEnabled() )
       
  4123         {
       
  4124         SetSeparatorLinePosition( this, EBCColumn );
       
  4125         }
       
  4126     else
       
  4127         {
       
  4128         SetSeparatorLinePosition( this, EABColumn );
       
  4129         }
       
  4130 
       
  4131     // selection indication
       
  4132     formattedCellData->SetStretchableGraphicSubCellL( 0,
       
  4133         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_g4( 0 ),
       
  4134         AknLayoutScalable_Avkon::list_single_large_graphic_pane_g4_cp2() );
       
  4135         
       
  4136     // thumbnail image
       
  4137     formattedCellData->SetStretchableGraphicSubCellL( 1,
       
  4138         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_g1( 0 ),
       
  4139         AknLayoutScalable_Avkon::list_single_large_graphic_pane_g1( 0 ) );
       
  4140         
       
  4141     // item text 1st line
       
  4142     formattedCellData->SetStretchableTextSubCellL( 2,
       
  4143         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_t1( 0 ),
       
  4144         AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1( 0 ) );
       
  4145         
       
  4146     // item text 2nd line (this is never drawn in stretched layout)
       
  4147     formattedCellData->SetStretchableTextSubCellL( 3,
       
  4148         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_t2( 0 ),
       
  4149         AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1( 0 ) );
       
  4150         
       
  4151     // outer additional icon
       
  4152     formattedCellData->SetStretchableGraphicSubCellL( 4,
       
  4153         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_g2( 0 ),
       
  4154         AknLayoutScalable_Avkon::list_single_large_graphic_pane_g2( 0 ) );
       
  4155         
       
  4156     // inner additional icon
       
  4157     formattedCellData->SetStretchableGraphicSubCellL( 5,
       
  4158         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_g3( 0 ),
       
  4159         AknLayoutScalable_Avkon::list_single_large_graphic_pane_g3( 0 ) );
       
  4160         
       
  4161     // Conditional subcells must be added in priority order!
       
  4162     formattedCellData->SetStretchableConditionalSubCellL( 5,
       
  4163         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_t1( 2 ),
       
  4164         AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1( 2 ), 2, 2 );
       
  4165         
       
  4166     formattedCellData->SetStretchableConditionalSubCellL( 4,
       
  4167         AknLayoutScalable_Avkon::list_double2_graphic_large_graphic_pane_t1( 1 ),
       
  4168         AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1( 1 ), 2, 2 );
       
  4169     
       
  4170     itemDrawer->SetItemMarkPosition( 0 );
       
  4171     itemDrawer->SetItemMarkReplacement( KFirstCSIconReplacement );
       
  4172     itemDrawer->SetItemMarkReverse( ETrue );
       
  4173     _AKNTRACE_FUNC_EXIT;    
       
  4174     }
       
  4175     
       
  4176 // -----------------------------------------------------------------------------
       
  4177 // CAknSettingStyleListBox::SizeChanged
       
  4178 // -----------------------------------------------------------------------------
       
  4179 //
       
  4180 EXPORT_C void CAknSettingStyleListBox::SizeChanged() 
       
  4181     {
       
  4182     _AKNTRACE_FUNC_ENTER;
       
  4183     AKNSETTINGSLISTBOX::SizeChanged();
       
  4184     TRAP_IGNORE( SizeChangedL() );
       
  4185     SetupScrollbarLayout( this, iSBFrame );
       
  4186     UpdateScrollBarThumbs();
       
  4187     _AKNTRACE_FUNC_EXIT;    
       
  4188     }
       
  4189 
       
  4190 // -----------------------------------------------------------------------------
       
  4191 // CAknSettingStyleListBox::SizeChangedL
       
  4192 // -----------------------------------------------------------------------------
       
  4193 //
       
  4194 void CAknSettingStyleListBox::SizeChangedL()
       
  4195     {
       
  4196     _AKNTRACE_FUNC_ENTER;
       
  4197     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  4198     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
       
  4199 
       
  4200     SetupStretchableListL( this,
       
  4201                           AknLayoutScalable_Avkon::list_setting_pane( 0 ),
       
  4202                           AknLayoutScalable_Avkon::list_setting_pane_vc( 0 ),
       
  4203                           EFalse );
       
  4204 
       
  4205     SetSeparatorLinePosition( this, EAColumn );
       
  4206     
       
  4207     // Assertion fails in CFormattedCellListBoxData::DrawFormattedSimple if this
       
  4208     // cell does not exist.
       
  4209     formattedCellData->SetStretchableTextSubCellL( 0,
       
  4210         AknLayoutScalable_Avkon::list_setting_number_pane_t1( 0 ),
       
  4211         AknLayoutScalable_Avkon::list_setting_number_pane_t1( 0 ) );
       
  4212 
       
  4213     formattedCellData->SetStretchableTextSubCellL( 1,
       
  4214         AknLayoutScalable_Avkon::list_setting_pane_t1( 0 ),
       
  4215         AknLayoutScalable_Avkon::list_setting_pane_vc_t1( 0 ) );
       
  4216         
       
  4217     formattedCellData->SetStretchableGraphicSubCellL( 2,
       
  4218         AknLayoutScalable_Avkon::set_value_pane_cp( 0 ),
       
  4219         AknLayoutScalable_Avkon::set_value_pane_cp_vc( 0 ) );
       
  4220         
       
  4221     formattedCellData->SetStretchableTextSubCellL( 3,
       
  4222         TAknWindowComponentLayout::ComposeText( AknLayoutScalable_Avkon::set_value_pane_cp( 0 ), AknLayoutScalable_Avkon::set_value_pane_t1() ),
       
  4223         TAknWindowComponentLayout::ComposeText( AknLayoutScalable_Avkon::set_value_pane_cp_vc( 0 ), AknLayoutScalable_Avkon::set_value_pane_t1() ) );
       
  4224 
       
  4225     formattedCellData->SetStretchableTextSubCellL( 4,
       
  4226         AknLayoutScalable_Avkon::list_setting_pane_t2( 0 ),
       
  4227         AknLayoutScalable_Avkon::list_setting_pane_vc_t2( 0 ) );
       
  4228 
       
  4229     formattedCellData->SetStretchableTextSubCellL( 5,
       
  4230         AknLayoutScalable_Avkon::list_setting_pane_t4( 3 ),
       
  4231         AknLayoutScalable_Avkon::list_single_pane_t1( 0 ) );
       
  4232 
       
  4233     formattedCellData->SetStretchableGraphicSubCellL( 6,
       
  4234         AknLayoutScalable_Avkon::list_setting_pane_g1( 0 ),
       
  4235         AknLayoutScalable_Avkon::list_setting_pane_vc_g1( 0 ) );
       
  4236 
       
  4237     formattedCellData->SetStretchableGraphicSubCellL( 7,
       
  4238         AknLayoutScalable_Avkon::list_setting_pane_g2( 0 ),
       
  4239         AknLayoutScalable_Avkon::list_setting_pane_vc_g2( 0 ) );
       
  4240 
       
  4241     // Conditional subcells must be added in priority order!
       
  4242     formattedCellData->SetStretchableConditionalSubCellL( 7,
       
  4243         AknLayoutScalable_Avkon::list_setting_pane_t1( 2 ),
       
  4244         AknLayoutScalable_Avkon::list_single_pane_t1( 2 ), 1, 5 );
       
  4245 
       
  4246     formattedCellData->SetStretchableConditionalSubCellL( 6,
       
  4247         AknLayoutScalable_Avkon::list_setting_pane_t1( 1 ),
       
  4248         AknLayoutScalable_Avkon::list_single_pane_t1( 1 ), 1, 5 );
       
  4249 
       
  4250     // text colors
       
  4251     CFormattedCellListBoxData::TColors colors;
       
  4252     SetESSTextColor( colors, EAknsCIQsnTextColorsCG7 );
       
  4253     SetESSHighlightedTextColor( colors, EAknsCIQsnTextColorsCG10 );
       
  4254     // support for non skinned case. Bg values are note used in skinned draw.
       
  4255     colors.iBack = AKN_LAF_COLOR( 0 );
       
  4256     colors.iHighlightedBack = AKN_LAF_COLOR( 244 );
       
  4257     
       
  4258     formattedCellData->SetSubCellColorsL( 0, colors );
       
  4259     formattedCellData->SetSubCellColorsL( 1, colors );
       
  4260     formattedCellData->SetSubCellColorsL( 5, colors );
       
  4261 
       
  4262     // color of valuetext
       
  4263     SetESSTextColor( colors, EAknsCIQsnTextColorsCG12 );
       
  4264     SetESSHighlightedTextColor( colors, EAknsCIQsnTextColorsCG12 );
       
  4265     // support for non skinned case. Bg values are note used in skinned draw.
       
  4266     colors.iBack = AKN_LAF_COLOR( 244 ); // light purplish blue
       
  4267     colors.iHighlightedBack = AKN_LAF_COLOR( 243 ); // dark blue
       
  4268     formattedCellData->SetSubCellColorsL( 3, colors );
       
  4269 
       
  4270     // there's no skin id for mandatory setting indication color
       
  4271     colors.iText = AKN_LAF_COLOR( 20 ); // red
       
  4272     colors.iHighlightedText = AKN_LAF_COLOR( 20 );
       
  4273     colors.iBack = AKN_LAF_COLOR( 0 ); // white
       
  4274     colors.iHighlightedBack = AKN_LAF_COLOR( 244 );
       
  4275     formattedCellData->SetSubCellColorsL( 4, colors );
       
  4276     _AKNTRACE_FUNC_EXIT;    
       
  4277     }
       
  4278     
       
  4279 // -----------------------------------------------------------------------------
       
  4280 // CAknSettingNumberStyleListBox::SizeChanged
       
  4281 // -----------------------------------------------------------------------------
       
  4282 //
       
  4283 EXPORT_C void CAknSettingNumberStyleListBox::SizeChanged() 
       
  4284     {
       
  4285     _AKNTRACE_FUNC_ENTER;
       
  4286     AKNSETTINGSLISTBOX::SizeChanged();
       
  4287     TRAP_IGNORE( SizeChangedL() ); 
       
  4288     SetupScrollbarLayout( this, iSBFrame );
       
  4289     UpdateScrollBarThumbs();
       
  4290     _AKNTRACE_FUNC_EXIT;    
       
  4291     }
       
  4292 
       
  4293 // -----------------------------------------------------------------------------
       
  4294 // CAknSettingNumberStyleListBox::SizeChangedL
       
  4295 // -----------------------------------------------------------------------------
       
  4296 //
       
  4297 void CAknSettingNumberStyleListBox::SizeChangedL()
       
  4298     {
       
  4299     _AKNTRACE_FUNC_ENTER;
       
  4300     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  4301     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
       
  4302 
       
  4303     SetupStretchableListL( this,
       
  4304                           AknLayoutScalable_Avkon::list_setting_number_pane( 0 ),
       
  4305                           AknLayoutScalable_Avkon::list_setting_number_pane_vc( 0 ),
       
  4306                           EFalse );
       
  4307 
       
  4308     SetSeparatorLinePosition( this, EABColumn );
       
  4309     
       
  4310     formattedCellData->SetStretchableTextSubCellL( 0,
       
  4311         AknLayoutScalable_Avkon::list_setting_number_pane_t1( 0 ),
       
  4312         AknLayoutScalable_Avkon::list_setting_number_pane_t1( 0 ) );
       
  4313         
       
  4314     formattedCellData->SetNumberCellL( 0, ETrue ); // This will enable locale-specific number conversion
       
  4315 
       
  4316     formattedCellData->SetStretchableTextSubCellL( 1,
       
  4317         AknLayoutScalable_Avkon::list_setting_number_pane_t2( 0 ),
       
  4318         AknLayoutScalable_Avkon::list_setting_number_pane_vc_t2( 0 ) );
       
  4319         
       
  4320     formattedCellData->SetStretchableGraphicSubCellL( 2,
       
  4321         AknLayoutScalable_Avkon::set_value_pane( 0 ),
       
  4322         AknLayoutScalable_Avkon::set_value_pane_vc( 0 ) );
       
  4323 
       
  4324     TAknTextComponentLayout normal = TAknWindowComponentLayout::ComposeText( AknLayoutScalable_Avkon::set_value_pane( 0 ), AknLayoutScalable_Avkon::set_value_pane_t1() );
       
  4325     TAknTextComponentLayout stretched = TAknWindowComponentLayout::ComposeText( AknLayoutScalable_Avkon::set_value_pane_vc( 0 ), AknLayoutScalable_Avkon::set_value_pane_t1() );
       
  4326 
       
  4327     formattedCellData->SetStretchableTextSubCellL( 3,
       
  4328         TAknWindowComponentLayout::ComposeText( AknLayoutScalable_Avkon::set_value_pane( 0 ), AknLayoutScalable_Avkon::set_value_pane_t1() ),
       
  4329         TAknWindowComponentLayout::ComposeText( AknLayoutScalable_Avkon::set_value_pane_vc( 0 ), AknLayoutScalable_Avkon::set_value_pane_t1() ) );
       
  4330 
       
  4331     formattedCellData->SetStretchableTextSubCellL( 4,
       
  4332         AknLayoutScalable_Avkon::list_setting_number_pane_t3( 0 ),
       
  4333         AknLayoutScalable_Avkon::list_setting_number_pane_vc_t3( 0 ) );
       
  4334         
       
  4335     formattedCellData->SetStretchableTextSubCellL( 5,
       
  4336         AknLayoutScalable_Avkon::list_setting_number_pane_t5( 3 ),
       
  4337         AknLayoutScalable_Avkon::list_single_number_pane_t1( 0 ) );
       
  4338 
       
  4339     formattedCellData->SetStretchableGraphicSubCellL( 6,
       
  4340         AknLayoutScalable_Avkon::list_setting_number_pane_g1( 0 ),
       
  4341         AknLayoutScalable_Avkon::list_setting_number_pane_vc_g1( 0 ) );
       
  4342 
       
  4343     formattedCellData->SetStretchableGraphicSubCellL( 7,
       
  4344         AknLayoutScalable_Avkon::list_setting_number_pane_g2( 0 ),
       
  4345         AknLayoutScalable_Avkon::list_setting_number_pane_vc_g2( 0 ) );
       
  4346 
       
  4347     // Conditional subcells must be added in priority order!
       
  4348     formattedCellData->SetStretchableConditionalSubCellL( 7,
       
  4349         AknLayoutScalable_Avkon::list_setting_number_pane_t2( 2 ),
       
  4350         AknLayoutScalable_Avkon::list_single_number_pane_t1( 2 ), 1, 5 );
       
  4351 
       
  4352     formattedCellData->SetStretchableConditionalSubCellL( 6,
       
  4353         AknLayoutScalable_Avkon::list_setting_number_pane_t2( 1 ),
       
  4354         AknLayoutScalable_Avkon::list_single_number_pane_t1( 1 ), 1, 5 );
       
  4355 
       
  4356 
       
  4357     // text colors
       
  4358     CFormattedCellListBoxData::TColors colors;
       
  4359     SetESSTextColor( colors, EAknsCIQsnTextColorsCG7 );
       
  4360     SetESSHighlightedTextColor( colors, EAknsCIQsnTextColorsCG10 );
       
  4361     // support for non skinned case. Bg values are note used in skinned draw.
       
  4362     colors.iBack = AKN_LAF_COLOR( 0 );
       
  4363     colors.iHighlightedBack = AKN_LAF_COLOR( 244 );
       
  4364     
       
  4365     formattedCellData->SetSubCellColorsL( 0, colors );
       
  4366     formattedCellData->SetSubCellColorsL( 1, colors );
       
  4367     formattedCellData->SetSubCellColorsL( 5, colors );
       
  4368 
       
  4369     // color of valuetext
       
  4370     SetESSTextColor( colors, EAknsCIQsnTextColorsCG12 );
       
  4371     SetESSHighlightedTextColor( colors, EAknsCIQsnTextColorsCG12 );
       
  4372     // support for non skinned case. Bg values are note used in skinned draw.
       
  4373     colors.iBack = AKN_LAF_COLOR( 244 ); // light purplish blue
       
  4374     colors.iHighlightedBack = AKN_LAF_COLOR( 243 ); // dark blue
       
  4375     formattedCellData->SetSubCellColorsL( 3, colors );
       
  4376 
       
  4377     // there's no skin id for mandatory setting indication color
       
  4378     colors.iText = AKN_LAF_COLOR( 20 ); // red
       
  4379     colors.iHighlightedText = AKN_LAF_COLOR( 20 );
       
  4380     colors.iBack = AKN_LAF_COLOR( 0 ); // white
       
  4381     colors.iHighlightedBack = AKN_LAF_COLOR( 244 );
       
  4382     formattedCellData->SetSubCellColorsL( 4, colors );
       
  4383     _AKNTRACE_FUNC_EXIT;    
       
  4384     }
       
  4385 
       
  4386 // -----------------------------------------------------------------------------
       
  4387 // CAknFormDoubleStyleListBox::SizeChanged
       
  4388 // -----------------------------------------------------------------------------
       
  4389 //
       
  4390 EXPORT_C void CAknFormDoubleStyleListBox::SizeChanged()
       
  4391     {
       
  4392     _AKNTRACE_FUNC_ENTER;
       
  4393     AKNFORMATTEDLISTBOX::SizeChanged();
       
  4394     TRAP_IGNORE( SizeChangedL() );
       
  4395 
       
  4396     SetupScrollbarLayout( this, iSBFrame );
       
  4397     UpdateScrollBarThumbs();
       
  4398     _AKNTRACE_FUNC_EXIT;    
       
  4399     }
       
  4400 
       
  4401 // -----------------------------------------------------------------------------
       
  4402 // CAknFormDoubleStyleListBox::SizeChangedL
       
  4403 // -----------------------------------------------------------------------------
       
  4404 //
       
  4405 void CAknFormDoubleStyleListBox::SizeChangedL()
       
  4406     {
       
  4407     _AKNTRACE_FUNC_ENTER;
       
  4408     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  4409     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
       
  4410 
       
  4411     SetupStretchableListL( this,
       
  4412                           AknLayoutScalable_Avkon::list_double_heading_pane( 0 ),
       
  4413                           AknLayoutScalable_Avkon::list_double_heading_pane_vc( 0 ) );
       
  4414 
       
  4415     SetSeparatorLinePosition( this, EAColumn );
       
  4416     
       
  4417     // Assertion fails in CFormattedCellListBoxData::DrawFormattedSimple if this
       
  4418     // cell does not exist.
       
  4419     formattedCellData->SetStretchableTextSubCellL( 0,
       
  4420         AknLayoutScalable_Avkon::list_double_heading_pane_t1( 0 ),
       
  4421         AknLayoutScalable_Avkon::list_double_heading_pane_vc_t1( 0 ) );
       
  4422 
       
  4423     formattedCellData->SetStretchableTextSubCellL( 1,
       
  4424         AknLayoutScalable_Avkon::list_double_heading_pane_t1( 0 ),
       
  4425         AknLayoutScalable_Avkon::list_double_heading_pane_vc_t1( 0 ) );
       
  4426 
       
  4427     formattedCellData->SetStretchableTextSubCellL( 2,
       
  4428         AknLayoutScalable_Avkon::list_double_heading_pane_t2( 0 ),
       
  4429         AknLayoutScalable_Avkon::list_double_heading_pane_vc_t2( 0 ) );
       
  4430         
       
  4431     formattedCellData->SetStretchableGraphicSubCellL( 3,
       
  4432         AknLayoutScalable_Avkon::list_double_heading_pane_g1( 0 ),
       
  4433         AknLayoutScalable_Avkon::list_double_heading_pane_vc_g1( 0 ) );
       
  4434 
       
  4435     formattedCellData->SetStretchableGraphicSubCellL( 4,
       
  4436         AknLayoutScalable_Avkon::list_double_heading_pane_g2( 0 ),
       
  4437         AknLayoutScalable_Avkon::list_double_heading_pane_vc_g2( 0 ) );
       
  4438 
       
  4439     // Conditional subcells must be added in priority order!
       
  4440     formattedCellData->SetStretchableConditionalSubCellL( 4,
       
  4441         AknLayoutScalable_Avkon::list_double_heading_pane_t1( 2 ),
       
  4442         AknLayoutScalable_Avkon::list_double_heading_pane_vc_t2( 2 ), 1, 2 );
       
  4443 
       
  4444     formattedCellData->SetStretchableConditionalSubCellL( 3,
       
  4445         AknLayoutScalable_Avkon::list_double_heading_pane_t1( 1 ),
       
  4446         AknLayoutScalable_Avkon::list_double_heading_pane_vc_t2( 1 ), 1, 2 );
       
  4447 
       
  4448     itemDrawer->SetItemMarkReverse( ETrue );
       
  4449     itemDrawer->SetItemMarkPosition( 3 );
       
  4450     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  4451     _AKNTRACE_FUNC_EXIT;    
       
  4452     }
       
  4453 
       
  4454 // -----------------------------------------------------------------------------
       
  4455 // CAknFormDoubleGraphicStyleListBox::SizeChanged
       
  4456 // -----------------------------------------------------------------------------
       
  4457 //
       
  4458 EXPORT_C void CAknFormDoubleGraphicStyleListBox::SizeChanged()
       
  4459     {
       
  4460     _AKNTRACE_FUNC_ENTER;
       
  4461     AKNFORMATTEDLISTBOX::SizeChanged();
       
  4462     TRAP_IGNORE( SizeChangedL() );
       
  4463 
       
  4464     SetupScrollbarLayout( this, iSBFrame );
       
  4465     UpdateScrollBarThumbs();
       
  4466     _AKNTRACE_FUNC_EXIT;    
       
  4467     }
       
  4468 
       
  4469 // -----------------------------------------------------------------------------
       
  4470 // CAknFormDoubleGraphicStyleListBox::SizeChangedL
       
  4471 // -----------------------------------------------------------------------------
       
  4472 //
       
  4473 void CAknFormDoubleGraphicStyleListBox::SizeChangedL()
       
  4474     {
       
  4475     _AKNTRACE_FUNC_ENTER;
       
  4476     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  4477     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
       
  4478 
       
  4479     SetupStretchableListL( this,
       
  4480                           AknLayoutScalable_Avkon::list_double_graphic_heading_pane( 0 ),
       
  4481                           AknLayoutScalable_Avkon::list_double_graphic_heading_pane_vc( 0 ) );
       
  4482 
       
  4483     SetSeparatorLinePosition( this, EABColumn );
       
  4484     
       
  4485     formattedCellData->SetStretchableGraphicSubCellL( 0,
       
  4486         AknLayoutScalable_Avkon::list_double_graphic_heading_pane_g1( 0 ),
       
  4487         AknLayoutScalable_Avkon::list_double_graphic_heading_pane_vc_g1( 0 ) );
       
  4488 
       
  4489     formattedCellData->SetStretchableTextSubCellL( 1,
       
  4490         AknLayoutScalable_Avkon::list_double_graphic_heading_pane_t1( 0 ),
       
  4491         AknLayoutScalable_Avkon::list_double_graphic_heading_pane_vc_t1( 0 ) );
       
  4492 
       
  4493     formattedCellData->SetStretchableTextSubCellL( 2,
       
  4494         AknLayoutScalable_Avkon::list_double_graphic_heading_pane_t2( 0 ),
       
  4495         AknLayoutScalable_Avkon::list_double_graphic_heading_pane_vc_t2( 0 ) );
       
  4496         
       
  4497     formattedCellData->SetStretchableGraphicSubCellL( 3,
       
  4498         AknLayoutScalable_Avkon::list_double_graphic_heading_pane_g2( 0 ),
       
  4499         AknLayoutScalable_Avkon::list_double_graphic_heading_pane_vc_g2( 0 ) );
       
  4500 
       
  4501     formattedCellData->SetStretchableGraphicSubCellL( 4,
       
  4502         AknLayoutScalable_Avkon::list_double_graphic_heading_pane_g3( 0 ),
       
  4503         AknLayoutScalable_Avkon::list_double_graphic_heading_pane_g3( 0 ) );
       
  4504 
       
  4505     // Conditional subcells must be added in priority order!
       
  4506     formattedCellData->SetStretchableConditionalSubCellL( 4,
       
  4507         AknLayoutScalable_Avkon::list_double_graphic_heading_pane_t1( 2 ),
       
  4508         AknLayoutScalable_Avkon::list_double_graphic_heading_pane_vc_t2( 2 ), 1, 2 );
       
  4509 
       
  4510     formattedCellData->SetStretchableConditionalSubCellL( 3,
       
  4511         AknLayoutScalable_Avkon::list_double_graphic_heading_pane_t1( 1 ),
       
  4512         AknLayoutScalable_Avkon::list_double_graphic_heading_pane_vc_t2( 1 ), 1, 2 );
       
  4513 
       
  4514     itemDrawer->SetItemMarkReverse( ETrue );
       
  4515 
       
  4516     if ( iListBoxFlags & EAknListBoxFlagsMultiselectionCheck )
       
  4517         {
       
  4518         itemDrawer->SetItemMarkPosition( 0 );
       
  4519         itemDrawer->SetItemMarkReplacement( KFirstIconReplacement ); // should not colorskin 'front' checkbox
       
  4520         }
       
  4521     else
       
  4522         {
       
  4523         itemDrawer->SetItemMarkPosition( 3 );
       
  4524         itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  4525         }
       
  4526     _AKNTRACE_FUNC_EXIT;    
       
  4527     }
       
  4528 
       
  4529 // -----------------------------------------------------------------------------
       
  4530 // CEikFormattedCellListBox derived popup listboxes.
       
  4531 // Following functions use the new listbox layout system.
       
  4532 // -----------------------------------------------------------------------------
       
  4533 
       
  4534 // -----------------------------------------------------------------------------
       
  4535 // CAknDoubleLargeGraphicPopupMenuStyleListBox::SizeChanged
       
  4536 // -----------------------------------------------------------------------------
       
  4537 //
       
  4538 EXPORT_C void CAknDoubleLargeGraphicPopupMenuStyleListBox::SizeChanged()
       
  4539     {
       
  4540     _AKNTRACE_FUNC_ENTER;
       
  4541     CEikFormattedCellListBox::SizeChanged();
       
  4542     TRAP_IGNORE( SizeChangedL() );
       
  4543     UpdateScrollBarThumbs();
       
  4544     _AKNTRACE_FUNC_EXIT;    
       
  4545     }
       
  4546 
       
  4547 // -----------------------------------------------------------------------------
       
  4548 // CAknDoubleLargeGraphicPopupMenuStyleListBox::SizeChangedL
       
  4549 // -----------------------------------------------------------------------------
       
  4550 //
       
  4551 void CAknDoubleLargeGraphicPopupMenuStyleListBox::SizeChangedL()
       
  4552     {
       
  4553     _AKNTRACE_FUNC_ENTER;
       
  4554     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  4555     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
       
  4556 
       
  4557     SetupCommonPopupListL( this, AknLayoutScalable_Avkon::list_double_large_graphic_pane_cp2( 0 ) );
       
  4558 
       
  4559     formattedCellData->SetGraphicSubCellL( 0,
       
  4560         AknLayoutScalable_Avkon::list_double_large_graphic_pane_g1_cp2( 0 ).LayoutLine() );
       
  4561 
       
  4562     formattedCellData->SetTextSubCellL( 1,
       
  4563         AknLayoutScalable_Avkon::list_double_large_graphic_pane_t1_cp2( 0 ).LayoutLine() );
       
  4564 
       
  4565     formattedCellData->SetTextSubCellL( 2,
       
  4566         AknLayoutScalable_Avkon::list_double_large_graphic_pane_t2_cp2( 0 ).LayoutLine() );
       
  4567 
       
  4568     formattedCellData->SetGraphicSubCellL( 3,
       
  4569         AknLayoutScalable_Avkon::list_double_large_graphic_pane_g2_cp2( 1 ).LayoutLine() );
       
  4570 
       
  4571     formattedCellData->SetGraphicSubCellL( 4,
       
  4572         AknLayoutScalable_Avkon::list_double_large_graphic_pane_g3_cp2().LayoutLine() );
       
  4573 
       
  4574     // Conditional subcells must be added in priority order!
       
  4575     formattedCellData->SetConditionalSubCellL( 4,
       
  4576         AknLayoutScalable_Avkon::list_double_large_graphic_pane_t1_cp2( 2 ).LayoutLine(), 1 );
       
  4577 
       
  4578     formattedCellData->SetConditionalSubCellL( 3,
       
  4579         AknLayoutScalable_Avkon::list_double_large_graphic_pane_t1_cp2( 1 ).LayoutLine(), 1 );
       
  4580 
       
  4581     itemDrawer->SetItemMarkPosition( 3 );
       
  4582     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  4583     itemDrawer->SetItemMarkReverse( ETrue );
       
  4584 
       
  4585     SetESSHighlightedTextColor( itemDrawer );
       
  4586     SetESSTextColor( itemDrawer, EAknsCIQsnTextColorsCG6 );
       
  4587     _AKNTRACE_FUNC_EXIT;    
       
  4588     }
       
  4589 
       
  4590 // -----------------------------------------------------------------------------
       
  4591 // CAknDoublePopupMenuStyleListBox::SizeChanged
       
  4592 // -----------------------------------------------------------------------------
       
  4593 //
       
  4594 EXPORT_C void CAknDoublePopupMenuStyleListBox::SizeChanged() 
       
  4595     {
       
  4596     _AKNTRACE_FUNC_ENTER;
       
  4597     CEikFormattedCellListBox::SizeChanged();
       
  4598     TRAP_IGNORE( SizeChangedL() );
       
  4599     UpdateScrollBarThumbs();
       
  4600     _AKNTRACE_FUNC_EXIT;    
       
  4601     }
       
  4602 
       
  4603 // -----------------------------------------------------------------------------
       
  4604 // CAknDoublePopupMenuStyleListBox::SizeChangedL
       
  4605 // -----------------------------------------------------------------------------
       
  4606 //
       
  4607 void CAknDoublePopupMenuStyleListBox::SizeChangedL()
       
  4608     {
       
  4609     _AKNTRACE_FUNC_ENTER;
       
  4610     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  4611     CFormattedCellListBoxData* formattedCellData = itemDrawer->FormattedCellData();
       
  4612 
       
  4613     SetupCommonPopupListL( this, AknLayoutScalable_Avkon::list_double_pane_cp2( 0 ) );
       
  4614 
       
  4615     formattedCellData->SetTextSubCellL( 0,
       
  4616         AknLayoutScalable_Avkon::list_double_pane_t1_cp2( 0 ).LayoutLine() );
       
  4617 
       
  4618     formattedCellData->SetTextSubCellL( 1,
       
  4619         AknLayoutScalable_Avkon::list_double_pane_t2_cp2( 0 ).LayoutLine() );
       
  4620 
       
  4621     formattedCellData->SetGraphicSubCellL( 2,
       
  4622         AknLayoutScalable_Avkon::list_double_pane_g1_cp2( 1 ).LayoutLine() );
       
  4623 
       
  4624     formattedCellData->SetGraphicSubCellL( 3,
       
  4625         AknLayoutScalable_Avkon::list_double_pane_g2_cp2().LayoutLine() );
       
  4626 
       
  4627     // Conditional subcells must be added in priority order!
       
  4628     formattedCellData->SetConditionalSubCellL( 3,
       
  4629         AknLayoutScalable_Avkon::list_double_pane_t1_cp2( 2 ).LayoutLine(), 0 );
       
  4630 
       
  4631     formattedCellData->SetConditionalSubCellL( 2,
       
  4632         AknLayoutScalable_Avkon::list_double_pane_t1_cp2( 1 ).LayoutLine(), 0 );
       
  4633 
       
  4634     itemDrawer->SetItemMarkPosition( 2 );
       
  4635     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  4636     itemDrawer->SetItemMarkReverse( ETrue );
       
  4637 
       
  4638     SetESSHighlightedTextColor( itemDrawer );
       
  4639     SetESSTextColor( itemDrawer, EAknsCIQsnTextColorsCG6 );
       
  4640     _AKNTRACE_FUNC_EXIT;    
       
  4641     }
       
  4642 
       
  4643 // -----------------------------------------------------------------------------
       
  4644 // CAknDouble2PopupMenuStyleListBox::SizeChanged
       
  4645 // -----------------------------------------------------------------------------
       
  4646 //
       
  4647 EXPORT_C void CAknDouble2PopupMenuStyleListBox::SizeChanged() 
       
  4648     {
       
  4649     _AKNTRACE_FUNC_ENTER;
       
  4650     CEikFormattedCellListBox::SizeChanged();
       
  4651     TRAP_IGNORE( SizeChangedL() );
       
  4652     UpdateScrollBarThumbs();
       
  4653     _AKNTRACE_FUNC_EXIT;    
       
  4654     }
       
  4655 
       
  4656 // -----------------------------------------------------------------------------
       
  4657 // CAknDouble2PopupMenuStyleListBox::SizeChangedL
       
  4658 // -----------------------------------------------------------------------------
       
  4659 //
       
  4660 void CAknDouble2PopupMenuStyleListBox::SizeChangedL()
       
  4661     {
       
  4662     _AKNTRACE_FUNC_ENTER;
       
  4663     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  4664     CFormattedCellListBoxData* formattedCellData = itemDrawer->FormattedCellData();
       
  4665 
       
  4666     SetupCommonPopupListL( this, AknLayoutScalable_Avkon::list_double2_pane_cp2( 0 ) );
       
  4667 
       
  4668     formattedCellData->SetTextSubCellL( 0,
       
  4669         AknLayoutScalable_Avkon::list_double2_pane_t1_cp2( 0 ).LayoutLine() );
       
  4670 
       
  4671     formattedCellData->SetTextSubCellL( 1,
       
  4672         AknLayoutScalable_Avkon::list_double2_pane_t2_cp2( 0 ).LayoutLine() );
       
  4673 
       
  4674     formattedCellData->SetGraphicSubCellL( 2,
       
  4675         AknLayoutScalable_Avkon::list_double2_pane_g1_cp2( 1 ).LayoutLine() );
       
  4676 
       
  4677     formattedCellData->SetGraphicSubCellL( 3,
       
  4678         AknLayoutScalable_Avkon::list_double2_pane_g2_cp2().LayoutLine() );
       
  4679 
       
  4680     // Conditional subcells must be added in priority order!
       
  4681     formattedCellData->SetConditionalSubCellL( 3,
       
  4682         AknLayoutScalable_Avkon::list_double2_pane_t1_cp2( 2 ).LayoutLine(), 0 );
       
  4683 
       
  4684     formattedCellData->SetConditionalSubCellL( 2,
       
  4685         AknLayoutScalable_Avkon::list_double2_pane_t1_cp2( 1 ).LayoutLine(), 0 );
       
  4686 
       
  4687     itemDrawer->SetItemMarkPosition( 2 );
       
  4688     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  4689     itemDrawer->SetItemMarkReverse( ETrue );
       
  4690 
       
  4691     SetESSHighlightedTextColor( itemDrawer );
       
  4692     SetESSTextColor( itemDrawer, EAknsCIQsnTextColorsCG6 );
       
  4693     _AKNTRACE_FUNC_EXIT;    
       
  4694     }
       
  4695 
       
  4696 // -----------------------------------------------------------------------------
       
  4697 // CAknDoubleGraphicPopupMenuStyleListBox::SizeChanged
       
  4698 // -----------------------------------------------------------------------------
       
  4699 //
       
  4700 EXPORT_C void CAknDoubleGraphicPopupMenuStyleListBox::SizeChanged() 
       
  4701     {
       
  4702     _AKNTRACE_FUNC_ENTER;
       
  4703     CEikFormattedCellListBox::SizeChanged();
       
  4704     TRAP_IGNORE( SizeChangedL() );
       
  4705     UpdateScrollBarThumbs();
       
  4706     _AKNTRACE_FUNC_EXIT;    
       
  4707     }
       
  4708 
       
  4709 // -----------------------------------------------------------------------------
       
  4710 // CAknDoubleGraphicPopupMenuStyleListBox::SizeChangedL
       
  4711 // -----------------------------------------------------------------------------
       
  4712 //
       
  4713 void CAknDoubleGraphicPopupMenuStyleListBox::SizeChangedL()
       
  4714     {
       
  4715     _AKNTRACE_FUNC_ENTER;
       
  4716     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  4717     CFormattedCellListBoxData* formattedCellData = itemDrawer->FormattedCellData();
       
  4718 
       
  4719     SetupCommonPopupListL( this, AknLayoutScalable_Avkon::list_double_graphic_pane_cp2( 0 ) );
       
  4720 
       
  4721     formattedCellData->SetGraphicSubCellL( 0,
       
  4722         AknLayoutScalable_Avkon::list_double_graphic_pane_g1_cp2( 0 ).LayoutLine() );
       
  4723 
       
  4724     formattedCellData->SetTextSubCellL( 1,
       
  4725         AknLayoutScalable_Avkon::list_double_graphic_pane_t1_cp2( 0 ).LayoutLine() );
       
  4726 
       
  4727     formattedCellData->SetTextSubCellL( 2,
       
  4728         AknLayoutScalable_Avkon::list_double_graphic_pane_t2_cp2( 0 ).LayoutLine() );
       
  4729 
       
  4730     formattedCellData->SetGraphicSubCellL( 3,
       
  4731         AknLayoutScalable_Avkon::list_double_graphic_pane_g3_cp2().LayoutLine() );
       
  4732 
       
  4733     formattedCellData->SetGraphicSubCellL( 4,
       
  4734         AknLayoutScalable_Avkon::list_double_graphic_pane_g2_cp2( 1 ).LayoutLine() );
       
  4735 
       
  4736     // Conditional subcells must be added in priority order!
       
  4737     formattedCellData->SetConditionalSubCellL( 4,
       
  4738         AknLayoutScalable_Avkon::list_double_graphic_pane_t1_cp2( 2 ).LayoutLine(), 1 );
       
  4739 
       
  4740     formattedCellData->SetConditionalSubCellL( 3,
       
  4741         AknLayoutScalable_Avkon::list_double_graphic_pane_t1_cp2( 1 ).LayoutLine(), 1 );
       
  4742 
       
  4743     itemDrawer->SetItemMarkPosition( 2 );
       
  4744     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  4745     itemDrawer->SetItemMarkReverse( ETrue );
       
  4746 
       
  4747     SetESSHighlightedTextColor( itemDrawer );
       
  4748     SetESSTextColor( itemDrawer, EAknsCIQsnTextColorsCG6 );
       
  4749     _AKNTRACE_FUNC_EXIT;    
       
  4750     }
       
  4751 
       
  4752 // -----------------------------------------------------------------------------
       
  4753 // CAknSingleGraphicHeadingPopupMenuStyleListBox::SizeChanged
       
  4754 // -----------------------------------------------------------------------------
       
  4755 //
       
  4756 EXPORT_C void CAknSingleGraphicHeadingPopupMenuStyleListBox::SizeChanged() 
       
  4757     {
       
  4758     _AKNTRACE_FUNC_ENTER;
       
  4759     CEikFormattedCellListBox::SizeChanged();
       
  4760     TRAP_IGNORE( SizeChangedL() );
       
  4761     UpdateScrollBarThumbs();
       
  4762     _AKNTRACE_FUNC_EXIT;    
       
  4763     }
       
  4764 
       
  4765 // -----------------------------------------------------------------------------
       
  4766 // CAknSingleGraphicHeadingPopupMenuStyleListBox::SizeChangedL
       
  4767 // -----------------------------------------------------------------------------
       
  4768 //
       
  4769 void CAknSingleGraphicHeadingPopupMenuStyleListBox::SizeChangedL()
       
  4770     {
       
  4771     _AKNTRACE_FUNC_ENTER;
       
  4772     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  4773     CFormattedCellListBoxData* formattedCellData = itemDrawer->FormattedCellData();
       
  4774 
       
  4775     SetupCommonPopupListL( this, AknLayoutScalable_Avkon::list_single_graphic_heading_pane_cp2( 0 ) );
       
  4776 
       
  4777     formattedCellData->SetGraphicSubCellL( 0,
       
  4778         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_g1_cp2( 0 ).LayoutLine() );
       
  4779 
       
  4780     formattedCellData->SetTextSubCellL( 1,
       
  4781         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_t2_cp2( 0 ).LayoutLine() );
       
  4782 
       
  4783     formattedCellData->SetTextSubCellL( 2,
       
  4784         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_t1_cp2( 0 ).LayoutLine() );
       
  4785 
       
  4786     formattedCellData->SetGraphicSubCellL( 3,
       
  4787         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_g4_cp2( 1 ).LayoutLine() );
       
  4788 
       
  4789     formattedCellData->SetGraphicSubCellL( 4,
       
  4790         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_g5_cp2().LayoutLine() );
       
  4791 
       
  4792     // Conditional subcells must be added in priority order!
       
  4793     formattedCellData->SetConditionalSubCellL( 4,
       
  4794         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_t1_cp2( 2 ).LayoutLine(), 2 );
       
  4795 
       
  4796     formattedCellData->SetConditionalSubCellL( 3,
       
  4797         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_t1_cp2( 1 ).LayoutLine(), 2 );
       
  4798 
       
  4799     itemDrawer->SetItemMarkPosition( 3 );
       
  4800     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  4801     itemDrawer->SetItemMarkReverse( ETrue );
       
  4802 
       
  4803     SetESSHighlightedTextColor( itemDrawer );
       
  4804     SetESSTextColor( itemDrawer, EAknsCIQsnTextColorsCG6 );
       
  4805     _AKNTRACE_FUNC_EXIT;    
       
  4806     }
       
  4807 
       
  4808 // -----------------------------------------------------------------------------
       
  4809 // CAknSinglePopupMenuStyleListBox::SizeChanged
       
  4810 // -----------------------------------------------------------------------------
       
  4811 //
       
  4812 EXPORT_C void CAknSinglePopupMenuStyleListBox::SizeChanged() 
       
  4813     {
       
  4814     _AKNTRACE_FUNC_ENTER;
       
  4815     CEikFormattedCellListBox::SizeChanged();
       
  4816     TRAP_IGNORE( SizeChangedL() );
       
  4817     UpdateScrollBarThumbs();
       
  4818     _AKNTRACE_FUNC_EXIT;    
       
  4819     }
       
  4820 
       
  4821 // -----------------------------------------------------------------------------
       
  4822 // CAknSinglePopupMenuStyleListBox::SizeChangedL
       
  4823 // -----------------------------------------------------------------------------
       
  4824 //
       
  4825 void CAknSinglePopupMenuStyleListBox::SizeChangedL()
       
  4826     {
       
  4827     _AKNTRACE_FUNC_ENTER;
       
  4828     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  4829     CFormattedCellListBoxData* formattedCellData = itemDrawer->FormattedCellData();
       
  4830 
       
  4831     SetupCommonPopupListL( this, AknLayoutScalable_Avkon::list_single_pane_cp2( 0 ) );
       
  4832 
       
  4833     formattedCellData->SetTextSubCellL( 0,
       
  4834         AknLayoutScalable_Avkon::list_single_pane_t1_cp2( 0 ).LayoutLine() );
       
  4835 
       
  4836     formattedCellData->SetGraphicSubCellL( 1,
       
  4837         AknLayoutScalable_Avkon::list_single_pane_g1_cp2( 1 ).LayoutLine() );
       
  4838 
       
  4839     formattedCellData->SetGraphicSubCellL( 2,
       
  4840         AknLayoutScalable_Avkon::list_single_pane_g2_cp2().LayoutLine() );
       
  4841 
       
  4842     // Conditional subcells must be added in priority order!
       
  4843     formattedCellData->SetConditionalSubCellL( 2,
       
  4844         AknLayoutScalable_Avkon::list_single_pane_t1_cp2( 2 ).LayoutLine(), 0 );
       
  4845 
       
  4846     formattedCellData->SetConditionalSubCellL( 1,
       
  4847         AknLayoutScalable_Avkon::list_single_pane_t1_cp2( 1 ).LayoutLine(), 0 );
       
  4848 
       
  4849     itemDrawer->SetItemMarkPosition( 1 );
       
  4850     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  4851     itemDrawer->SetItemMarkReverse( ETrue );
       
  4852 
       
  4853     SetESSHighlightedTextColor( itemDrawer );
       
  4854     SetESSTextColor( itemDrawer, EAknsCIQsnTextColorsCG6 );
       
  4855     _AKNTRACE_FUNC_EXIT;    
       
  4856     }
       
  4857 
       
  4858 // -----------------------------------------------------------------------------
       
  4859 // CAknSingleGraphicPopupMenuStyleListBox::SizeChanged
       
  4860 // -----------------------------------------------------------------------------
       
  4861 //
       
  4862 EXPORT_C void CAknSingleGraphicPopupMenuStyleListBox::SizeChanged() 
       
  4863     {
       
  4864     _AKNTRACE_FUNC_ENTER;
       
  4865     CEikFormattedCellListBox::SizeChanged();
       
  4866     TRAP_IGNORE( SizeChangedL() );
       
  4867     UpdateScrollBarThumbs();
       
  4868     _AKNTRACE_FUNC_EXIT;    
       
  4869     }
       
  4870 
       
  4871 // -----------------------------------------------------------------------------
       
  4872 // CAknSingleGraphicPopupMenuStyleListBox::SizeChangedL
       
  4873 // -----------------------------------------------------------------------------
       
  4874 //
       
  4875 void CAknSingleGraphicPopupMenuStyleListBox::SizeChangedL()
       
  4876     {
       
  4877     _AKNTRACE_FUNC_ENTER;
       
  4878     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  4879     CFormattedCellListBoxData* formattedCellData = itemDrawer->FormattedCellData();
       
  4880 
       
  4881     SetupCommonPopupListL( this, AknLayoutScalable_Avkon::list_single_graphic_pane_cp2( 0 ) );
       
  4882 
       
  4883     formattedCellData->SetGraphicSubCellL( 0,
       
  4884         AknLayoutScalable_Avkon::list_single_graphic_pane_g1_cp2( 0 ).LayoutLine() );
       
  4885 
       
  4886     formattedCellData->SetTextSubCellL( 1,
       
  4887         AknLayoutScalable_Avkon::list_single_graphic_pane_t1_cp2( 0 ).LayoutLine() );
       
  4888 
       
  4889     formattedCellData->SetGraphicSubCellL( 2,
       
  4890         AknLayoutScalable_Avkon::list_single_graphic_pane_g2_cp2( 1 ).LayoutLine() );
       
  4891 
       
  4892     formattedCellData->SetGraphicSubCellL( 3,
       
  4893         AknLayoutScalable_Avkon::list_single_graphic_pane_g3_cp2().LayoutLine() );
       
  4894 
       
  4895     // Conditional subcells must be added in priority order!
       
  4896     formattedCellData->SetConditionalSubCellL( 3,
       
  4897         AknLayoutScalable_Avkon::list_single_graphic_pane_t1_cp2( 2 ).LayoutLine(), 1 );
       
  4898 
       
  4899     formattedCellData->SetConditionalSubCellL( 2,
       
  4900         AknLayoutScalable_Avkon::list_single_graphic_pane_t1_cp2( 1 ).LayoutLine(), 1 );
       
  4901 
       
  4902     if ( iListBoxFlags & EAknListBoxFlagsMultiselectionCheck )
       
  4903         {
       
  4904         itemDrawer->SetItemMarkPosition( 0 );
       
  4905         itemDrawer->SetItemMarkReplacement( KFirstIconReplacement ); // should not colorskin 'front checkbox'
       
  4906         }
       
  4907     else
       
  4908         {
       
  4909         itemDrawer->SetItemMarkPosition( 2 );
       
  4910         itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  4911         }
       
  4912         
       
  4913     itemDrawer->SetItemMarkReverse( ETrue );
       
  4914 
       
  4915     SetESSHighlightedTextColor( itemDrawer );
       
  4916     SetESSTextColor( itemDrawer, EAknsCIQsnTextColorsCG6 );
       
  4917     _AKNTRACE_FUNC_EXIT;    
       
  4918     }
       
  4919 
       
  4920 // -----------------------------------------------------------------------------
       
  4921 // CAknSingleHeadingPopupMenuStyleListBox::SizeChanged
       
  4922 // -----------------------------------------------------------------------------
       
  4923 //
       
  4924 EXPORT_C void CAknSingleHeadingPopupMenuStyleListBox::SizeChanged() 
       
  4925     {
       
  4926     _AKNTRACE_FUNC_ENTER;
       
  4927     CEikFormattedCellListBox::SizeChanged();
       
  4928     TRAP_IGNORE( SizeChangedL() );
       
  4929     UpdateScrollBarThumbs();
       
  4930     _AKNTRACE_FUNC_EXIT;    
       
  4931     }
       
  4932 
       
  4933 // -----------------------------------------------------------------------------
       
  4934 // CAknSingleHeadingPopupMenuStyleListBox::SizeChangedL
       
  4935 // -----------------------------------------------------------------------------
       
  4936 //
       
  4937 void CAknSingleHeadingPopupMenuStyleListBox::SizeChangedL()
       
  4938     {
       
  4939     _AKNTRACE_FUNC_ENTER;
       
  4940     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  4941     CFormattedCellListBoxData* formattedCellData = itemDrawer->FormattedCellData();
       
  4942 
       
  4943     SetupCommonPopupListL( this, AknLayoutScalable_Avkon::list_single_heading_pane_cp2( 0 ) );
       
  4944 
       
  4945     formattedCellData->SetTextSubCellL( 0,
       
  4946         AknLayoutScalable_Avkon::list_single_heading_pane_t2_cp2( 0 ).LayoutLine() );
       
  4947 
       
  4948     formattedCellData->SetTextSubCellL( 1,
       
  4949         AknLayoutScalable_Avkon::list_single_heading_pane_t1_cp2( 0 ).LayoutLine() );
       
  4950 
       
  4951     formattedCellData->SetGraphicSubCellL( 2,
       
  4952         AknLayoutScalable_Avkon::list_single_heading_pane_g1_cp2( 1 ).LayoutLine() );
       
  4953 
       
  4954     formattedCellData->SetGraphicSubCellL( 3,
       
  4955         AknLayoutScalable_Avkon::list_single_heading_pane_g2_cp2().LayoutLine() );
       
  4956 
       
  4957     // Conditional subcells must be added in priority order!
       
  4958     formattedCellData->SetConditionalSubCellL( 3,
       
  4959         AknLayoutScalable_Avkon::list_single_heading_pane_t1_cp2( 2 ).LayoutLine(), 1 );
       
  4960 
       
  4961     formattedCellData->SetConditionalSubCellL( 2,
       
  4962         AknLayoutScalable_Avkon::list_single_heading_pane_t1_cp2( 1 ).LayoutLine(), 1 );
       
  4963 
       
  4964     if ( iListBoxFlags & EAknListBoxFlagsMultiselectionCheck )
       
  4965         {
       
  4966         itemDrawer->SetItemMarkPosition( 0 );
       
  4967         itemDrawer->SetItemMarkReplacement( KFirstIconReplacement );  // should not colorskin 'front checkbox'
       
  4968         }
       
  4969     else
       
  4970         {
       
  4971         itemDrawer->SetItemMarkPosition( 2 );
       
  4972         itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  4973         }
       
  4974         
       
  4975     itemDrawer->SetItemMarkReverse( ETrue );
       
  4976 
       
  4977     SetESSHighlightedTextColor( itemDrawer );
       
  4978     SetESSTextColor( itemDrawer, EAknsCIQsnTextColorsCG6 );
       
  4979     _AKNTRACE_FUNC_EXIT;    
       
  4980     }
       
  4981 
       
  4982 // -----------------------------------------------------------------------------
       
  4983 // CAknSingle2GraphicPopupMenuStyleListBox::SizeChanged
       
  4984 // -----------------------------------------------------------------------------
       
  4985 //
       
  4986 EXPORT_C void CAknSingle2GraphicPopupMenuStyleListBox::SizeChanged() 
       
  4987     {
       
  4988     _AKNTRACE_FUNC_ENTER;
       
  4989     TRAP_IGNORE( SizeChangedL() );
       
  4990     CEikFormattedCellListBox::SizeChanged();
       
  4991     UpdateScrollBarThumbs();
       
  4992     _AKNTRACE_FUNC_EXIT;
       
  4993     }
       
  4994 
       
  4995 // -----------------------------------------------------------------------------
       
  4996 // CAknSingle2GraphicPopupMenuStyleListBox::SizeChangedL
       
  4997 // -----------------------------------------------------------------------------
       
  4998 //
       
  4999 void CAknSingle2GraphicPopupMenuStyleListBox::SizeChangedL()
       
  5000     {
       
  5001     _AKNTRACE_FUNC_ENTER;
       
  5002     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  5003     CFormattedCellListBoxData* formattedCellData = itemDrawer->FormattedCellData();
       
  5004 
       
  5005     SetupCommonPopupListL( this, AknLayoutScalable_Avkon::list_single_2graphic_pane_cp2( 0 ) );
       
  5006 
       
  5007     formattedCellData->SetGraphicSubCellL( 0,
       
  5008         AknLayoutScalable_Avkon::list_single_2graphic_pane_g4_cp2( 0 ).LayoutLine() );
       
  5009 
       
  5010     formattedCellData->SetGraphicSubCellL( 1,
       
  5011         AknLayoutScalable_Avkon::list_single_2graphic_pane_g1_cp2( 0 ).LayoutLine() );
       
  5012 
       
  5013     formattedCellData->SetTextSubCellL( 2,
       
  5014         AknLayoutScalable_Avkon::list_single_2graphic_pane_t1_cp2( 0 ).LayoutLine() );
       
  5015 
       
  5016     formattedCellData->SetGraphicSubCellL( 3,
       
  5017         AknLayoutScalable_Avkon::list_single_2graphic_pane_g2_cp2( 1 ).LayoutLine() );
       
  5018 
       
  5019     formattedCellData->SetGraphicSubCellL( 4,
       
  5020         AknLayoutScalable_Avkon::list_single_2graphic_pane_g3_cp2().LayoutLine() );
       
  5021 
       
  5022     // Conditional subcells must be added in priority order!
       
  5023     formattedCellData->SetConditionalSubCellL( 4,
       
  5024         AknLayoutScalable_Avkon::list_single_2graphic_pane_t1_cp2( 2 ).LayoutLine(), 2 );
       
  5025 
       
  5026     formattedCellData->SetConditionalSubCellL( 3,
       
  5027         AknLayoutScalable_Avkon::list_single_2graphic_pane_t1_cp2( 1 ).LayoutLine(), 2 );
       
  5028 
       
  5029     itemDrawer->SetItemMarkPosition( 3 );
       
  5030     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  5031     itemDrawer->SetItemMarkReverse( ETrue );
       
  5032 
       
  5033     SetESSHighlightedTextColor( itemDrawer );
       
  5034     SetESSTextColor( itemDrawer, EAknsCIQsnTextColorsCG6 );
       
  5035     _AKNTRACE_FUNC_EXIT;    
       
  5036     }
       
  5037 
       
  5038 // -----------------------------------------------------------------------------
       
  5039 // CEikColumnListBox derivatives.
       
  5040 // Following functions use the new listbox layout system.
       
  5041 // -----------------------------------------------------------------------------
       
  5042 
       
  5043 // -----------------------------------------------------------------------------
       
  5044 // CAknSingleHeadingStyleListBox::SizeChanged
       
  5045 // -----------------------------------------------------------------------------
       
  5046 //
       
  5047 EXPORT_C void CAknSingleHeadingStyleListBox::SizeChanged() 
       
  5048     {
       
  5049     _AKNTRACE_FUNC_ENTER;
       
  5050     AKNCOLUMNLISTBOX::SizeChanged();
       
  5051     TRAP_IGNORE( SizeChangedL() );
       
  5052     SetupScrollbarLayout( this, iSBFrame );
       
  5053     UpdateScrollBarThumbs();
       
  5054     _AKNTRACE_FUNC_EXIT;    
       
  5055     }
       
  5056 
       
  5057 // -----------------------------------------------------------------------------
       
  5058 // CAknSingleHeadingStyleListBox::SizeChangedL
       
  5059 // -----------------------------------------------------------------------------
       
  5060 //
       
  5061 void CAknSingleHeadingStyleListBox::SizeChangedL()
       
  5062     {
       
  5063     _AKNTRACE_FUNC_ENTER;
       
  5064     CColumnListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  5065     CColumnListBoxData* columnData( itemDrawer->ColumnData() );
       
  5066 
       
  5067     SetupStretchableListL( this,
       
  5068                           AknLayoutScalable_Avkon::list_single_heading_pane( 0 ),
       
  5069                           AknLayoutScalable_Avkon::list_single_heading_pane_vc( 0 ) );
       
  5070 
       
  5071     if ( Layout_Meta_Data::IsLandscapeOrientation() &&
       
  5072          Layout_Meta_Data::IsListStretchingEnabled() &&
       
  5073          columnData->StretchingEnabled() )
       
  5074         {
       
  5075         SetSeparatorLinePosition( this, EBCColumnStretched );
       
  5076         }
       
  5077     else
       
  5078         {
       
  5079         SetSeparatorLinePosition( this, EBCColumn );
       
  5080         }
       
  5081     
       
  5082     columnData->SetStretchableTextSubCellL( 0,
       
  5083         AknLayoutScalable_Avkon::list_single_heading_pane_t2( 0 ),
       
  5084         AknLayoutScalable_Avkon::list_single_heading_pane_vc_t2( 0 ) );
       
  5085 
       
  5086     columnData->SetStretchableTextSubCellL( 1,
       
  5087         AknLayoutScalable_Avkon::list_single_heading_pane_t1( 0 ),
       
  5088         AknLayoutScalable_Avkon::list_single_heading_pane_vc_t1( 0 ) );
       
  5089 
       
  5090     columnData->SetStretchableGraphicSubCellL( 2,
       
  5091         AknLayoutScalable_Avkon::list_single_heading_pane_g1( 0 ),
       
  5092         AknLayoutScalable_Avkon::list_single_heading_pane_vc_g1( 0 ) );
       
  5093 
       
  5094     columnData->SetStretchableGraphicSubCellL( 3,
       
  5095         AknLayoutScalable_Avkon::list_single_heading_pane_g2( 0 ),
       
  5096         AknLayoutScalable_Avkon::list_single_heading_pane_g2( 0 ) );
       
  5097 
       
  5098     // Conditional subcells must be added in priority order!
       
  5099     columnData->SetStretchableConditionalSubCellL( 3,
       
  5100         AknLayoutScalable_Avkon::list_single_heading_pane_t1( 2 ),
       
  5101         AknLayoutScalable_Avkon::list_single_heading_pane_vc_t1( 2 ), 1, 1 );
       
  5102 
       
  5103     columnData->SetStretchableConditionalSubCellL( 2,
       
  5104         AknLayoutScalable_Avkon::list_single_heading_pane_t1( 1 ),
       
  5105         AknLayoutScalable_Avkon::list_single_heading_pane_vc_t1( 1 ), 1, 1 );
       
  5106 
       
  5107     itemDrawer->SetItemMarkReverse( ETrue );
       
  5108     itemDrawer->SetItemMarkPosition( 2 );
       
  5109     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  5110     _AKNTRACE_FUNC_EXIT;    
       
  5111     }
       
  5112     
       
  5113 // -----------------------------------------------------------------------------
       
  5114 // CAknSingleNumberHeadingStyleListBox::SizeChanged
       
  5115 // -----------------------------------------------------------------------------
       
  5116 //
       
  5117 EXPORT_C void CAknSingleNumberHeadingStyleListBox::SizeChanged() 
       
  5118     {
       
  5119     _AKNTRACE_FUNC_ENTER;
       
  5120     AKNCOLUMNLISTBOX::SizeChanged();
       
  5121     TRAP_IGNORE( SizeChangedL() );
       
  5122     SetupScrollbarLayout( this, iSBFrame );
       
  5123     UpdateScrollBarThumbs();
       
  5124     _AKNTRACE_FUNC_EXIT;    
       
  5125     }
       
  5126 
       
  5127 // -----------------------------------------------------------------------------
       
  5128 // CAknSingleNumberHeadingStyleListBox::SizeChangedL
       
  5129 // -----------------------------------------------------------------------------
       
  5130 //
       
  5131 void CAknSingleNumberHeadingStyleListBox::SizeChangedL()
       
  5132     {
       
  5133     _AKNTRACE_FUNC_ENTER;
       
  5134     CColumnListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  5135     CColumnListBoxData* columnData( itemDrawer->ColumnData() );
       
  5136 
       
  5137     SetupStretchableListL( this,
       
  5138                           AknLayoutScalable_Avkon::list_single_number_heading_pane( 0 ),
       
  5139                           AknLayoutScalable_Avkon::list_single_number_heading_pane_vc( 0 ) );
       
  5140 
       
  5141     if ( Layout_Meta_Data::IsLandscapeOrientation() &&
       
  5142          Layout_Meta_Data::IsListStretchingEnabled() &&
       
  5143          columnData->StretchingEnabled() )
       
  5144         {
       
  5145         SetSeparatorLinePosition( this, EBCColumnStretched );
       
  5146         }
       
  5147     else
       
  5148         {
       
  5149         SetSeparatorLinePosition( this, EBCColumn );
       
  5150         }
       
  5151     
       
  5152     columnData->SetStretchableTextSubCellL( 0,
       
  5153         AknLayoutScalable_Avkon::list_single_number_heading_pane_t3( 0 ),
       
  5154         AknLayoutScalable_Avkon::list_single_number_heading_pane_vc_t3( 0 ) );
       
  5155 
       
  5156     columnData->SetStretchableTextSubCellL( 1,
       
  5157         AknLayoutScalable_Avkon::list_single_number_heading_pane_t2( 0 ),
       
  5158         AknLayoutScalable_Avkon::list_single_number_heading_pane_vc_t2( 0 ) );
       
  5159 
       
  5160     columnData->SetStretchableTextSubCellL( 2,
       
  5161         AknLayoutScalable_Avkon::list_single_number_heading_pane_t1( 0 ),
       
  5162         AknLayoutScalable_Avkon::list_single_number_heading_pane_vc_t1( 0 ) );
       
  5163 
       
  5164     columnData->SetStretchableGraphicSubCellL( 3,
       
  5165         AknLayoutScalable_Avkon::list_single_number_heading_pane_g1( 0 ),
       
  5166         AknLayoutScalable_Avkon::list_single_number_heading_pane_vc_g1( 0 ) );
       
  5167 
       
  5168     columnData->SetStretchableGraphicSubCellL( 4,
       
  5169         AknLayoutScalable_Avkon::list_single_number_heading_pane_g2( 0 ),
       
  5170         AknLayoutScalable_Avkon::list_single_number_heading_pane_g2( 0 ) );
       
  5171 
       
  5172     // Conditional subcells must be added in priority order!
       
  5173     columnData->SetStretchableConditionalSubCellL( 4,
       
  5174         AknLayoutScalable_Avkon::list_single_number_heading_pane_t1( 2 ),
       
  5175         AknLayoutScalable_Avkon::list_single_number_heading_pane_vc_t1( 2 ), 2, 2 );
       
  5176 
       
  5177     columnData->SetStretchableConditionalSubCellL( 3,
       
  5178         AknLayoutScalable_Avkon::list_single_number_heading_pane_t1( 1 ),
       
  5179         AknLayoutScalable_Avkon::list_single_number_heading_pane_vc_t1( 1 ), 2, 2 );
       
  5180 
       
  5181     itemDrawer->SetItemMarkReverse( ETrue );
       
  5182     itemDrawer->SetItemMarkPosition( 3 );
       
  5183     itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  5184     _AKNTRACE_FUNC_EXIT;    
       
  5185     }
       
  5186     
       
  5187 // -----------------------------------------------------------------------------
       
  5188 // CAknSingleGraphicHeadingStyleListBox::SizeChanged
       
  5189 // -----------------------------------------------------------------------------
       
  5190 //
       
  5191 EXPORT_C void CAknSingleGraphicHeadingStyleListBox::SizeChanged() 
       
  5192     {
       
  5193     _AKNTRACE_FUNC_ENTER;
       
  5194     AKNCOLUMNLISTBOX::SizeChanged();
       
  5195     TRAP_IGNORE( SizeChangedL() );
       
  5196     SetupScrollbarLayout( this, iSBFrame );
       
  5197     UpdateScrollBarThumbs();
       
  5198     _AKNTRACE_FUNC_EXIT;    
       
  5199     }
       
  5200 
       
  5201 // -----------------------------------------------------------------------------
       
  5202 // CAknSingleGraphicHeadingStyleListBox::SizeChangedL
       
  5203 // -----------------------------------------------------------------------------
       
  5204 //
       
  5205 void CAknSingleGraphicHeadingStyleListBox::SizeChangedL()
       
  5206     {
       
  5207     _AKNTRACE_FUNC_ENTER;
       
  5208     CColumnListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  5209     CColumnListBoxData* columnData( itemDrawer->ColumnData() );
       
  5210 
       
  5211     SetupStretchableListL( this,
       
  5212                           AknLayoutScalable_Avkon::list_single_graphic_heading_pane( 0 ),
       
  5213                           AknLayoutScalable_Avkon::list_single_graphic_heading_pane_vc( 0 ) );
       
  5214 
       
  5215     if ( Layout_Meta_Data::IsLandscapeOrientation() &&
       
  5216          Layout_Meta_Data::IsListStretchingEnabled() &&
       
  5217          columnData->StretchingEnabled() )
       
  5218         {
       
  5219         SetSeparatorLinePosition( this, EBCColumnStretched );
       
  5220         }
       
  5221     else
       
  5222         {
       
  5223         SetSeparatorLinePosition( this, EBCColumn );
       
  5224         }
       
  5225     
       
  5226     columnData->SetStretchableGraphicSubCellL( 0,
       
  5227         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_g1( 0 ),
       
  5228         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_vc_g1( 0 ) );
       
  5229 
       
  5230     columnData->SetStretchableTextSubCellL( 1,
       
  5231         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_t2( 0 ),
       
  5232         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_vc_t2( 0 ) );
       
  5233 
       
  5234     columnData->SetStretchableTextSubCellL( 2,
       
  5235         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_t1( 0 ),
       
  5236         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_vc_t1( 0 ) );
       
  5237 
       
  5238     columnData->SetStretchableGraphicSubCellL( 3,
       
  5239         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_g4( 0 ),
       
  5240         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_vc_g4( 0 ) );
       
  5241 
       
  5242     columnData->SetStretchableGraphicSubCellL( 4,
       
  5243         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_g5( 0 ),
       
  5244         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_g5( 0 ) );
       
  5245 
       
  5246     // Conditional subcells must be added in priority order!
       
  5247     columnData->SetStretchableConditionalSubCellL( 4,
       
  5248         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_t1( 2 ),
       
  5249         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_vc_t1( 2 ), 2, 2 );
       
  5250 
       
  5251     columnData->SetStretchableConditionalSubCellL( 3,
       
  5252         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_t1( 1 ),
       
  5253         AknLayoutScalable_Avkon::list_single_graphic_heading_pane_vc_t1( 1 ), 2, 2 );
       
  5254 
       
  5255     itemDrawer->SetItemMarkReverse( ETrue );
       
  5256 
       
  5257     if ( iListBoxFlags & EAknListBoxFlagsMultiselectionCheck )
       
  5258         {
       
  5259         itemDrawer->SetItemMarkPosition( 0 );
       
  5260         itemDrawer->SetItemMarkReplacement( KFirstIconReplacement ); // should not colorskin 'front checkbox'
       
  5261         }
       
  5262     else
       
  5263         {
       
  5264         itemDrawer->SetItemMarkPosition( 3 );
       
  5265         itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  5266         }
       
  5267     _AKNTRACE_FUNC_EXIT;    
       
  5268     }
       
  5269 
       
  5270 
       
  5271 ///---------------------------------------------------------------------------------------------------------------------
       
  5272 EXPORT_C void CAknSingle2GraphicStyleListBox::SizeChanged() 
       
  5273     {
       
  5274     _AKNTRACE_FUNC_ENTER;
       
  5275     AKNCOLUMNLISTBOX::SizeChanged();
       
  5276     TRAP_IGNORE( SizeChangedL() );
       
  5277     SetupScrollbarLayout( this, iSBFrame );
       
  5278     UpdateScrollBarThumbs();
       
  5279     _AKNTRACE_FUNC_EXIT;    
       
  5280     }
       
  5281 
       
  5282 // a java list
       
  5283 // list item string format: "0\t1\tTextLabel\t2\t3"
       
  5284 // where 0,1,2,3 are index to the icon array 
       
  5285 
       
  5286 void CAknSingle2GraphicStyleListBox::SizeChangedL()
       
  5287     {
       
  5288     _AKNTRACE_FUNC_ENTER;
       
  5289     CColumnListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  5290     CColumnListBoxData* d( itemDrawer->ColumnData() );
       
  5291 
       
  5292     SetupListL( this, AknLayoutScalable_Avkon::list_single_2graphic_pane( 0 ) );
       
  5293 
       
  5294     SetSeparatorLinePosition( this, EABColumn );
       
  5295 
       
  5296     d->SetGraphicSubCellL( 0, AknLayoutScalable_Avkon::list_single_2graphic_pane_g4( 0 ) );
       
  5297     d->SetGraphicSubCellL( 1, AknLayoutScalable_Avkon::list_single_2graphic_pane_g1( 0 ) );
       
  5298     d->SetTextSubCellL( 2, AknLayoutScalable_Avkon::list_single_2graphic_pane_t1( 0 ) );
       
  5299     d->SetGraphicSubCellL( 3, AknLayoutScalable_Avkon::list_single_2graphic_pane_g2( 0 ) );
       
  5300     d->SetGraphicSubCellL( 4, AknLayoutScalable_Avkon::list_single_2graphic_pane_g3( 0 ) );
       
  5301 
       
  5302     // Conditional subcells must be added in priority order!
       
  5303     d->SetConditionalSubCellL( 4, AknLayoutScalable_Avkon::list_single_2graphic_pane_t1( 2 ), 2 );
       
  5304     d->SetConditionalSubCellL( 3, AknLayoutScalable_Avkon::list_single_2graphic_pane_t1( 1 ), 2 );
       
  5305     
       
  5306     
       
  5307     if ( iListBoxFlags & EAknListBoxFlagsMultiselectionCheck )
       
  5308         {
       
  5309         itemDrawer->SetItemMarkPosition( 0 );
       
  5310         itemDrawer->SetItemMarkReplacement( KFirstIconReplacement ); // should not colorskin 'front checkbox'
       
  5311         }
       
  5312     else
       
  5313         {
       
  5314         itemDrawer->SetItemMarkPosition( 3 );
       
  5315         itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  5316         }
       
  5317     itemDrawer->SetItemMarkReverse(ETrue);
       
  5318     _AKNTRACE_FUNC_EXIT;    
       
  5319     }
       
  5320 
       
  5321 
       
  5322 EXPORT_C void CAknSingleGraphicStyleListBox::SizeChanged() 
       
  5323     {
       
  5324     _AKNTRACE_FUNC_ENTER;
       
  5325     AKNCOLUMNLISTBOX::SizeChanged();
       
  5326     TRAP_IGNORE( SizeChangedL() );
       
  5327     SetupScrollbarLayout( this, iSBFrame );
       
  5328     UpdateScrollBarThumbs();
       
  5329     _AKNTRACE_FUNC_EXIT;    
       
  5330     }
       
  5331 
       
  5332 // list item string format: "0\tTextLabel\t1\t2"
       
  5333 // where 0,1,2 are index to the icon array 
       
  5334 void CAknSingleGraphicStyleListBox::SizeChangedL()
       
  5335     {
       
  5336     _AKNTRACE_FUNC_ENTER;
       
  5337     CColumnListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  5338     CColumnListBoxData* d( itemDrawer->ColumnData() );
       
  5339     SetupListL( this, AknLayoutScalable_Avkon::list_single_graphic_pane( 0 ) );
       
  5340     SetSeparatorLinePosition( this, EABColumn );
       
  5341 
       
  5342     TAknTextComponentLayout textLayout = AknLayoutScalable_Avkon::list_single_graphic_pane_t1( 0 );
       
  5343 
       
  5344     d->SetGraphicSubCellL( 0, AknLayoutScalable_Avkon::list_single_graphic_pane_g1( 0 ) );
       
  5345     d->SetTextSubCellL( 1, textLayout );
       
  5346 
       
  5347     // This is needed in order to retain compatibility with some applications. Without this call
       
  5348     // the list items are not visible due to incorrect baseline position.
       
  5349     d->SetColumnBaselinePosL(1, AknLayoutUtils::CorrectBaseline(itemDrawer->ItemCellSize().iHeight,
       
  5350                                                                 d->ColumnBaselinePos(1),
       
  5351                                                                 textLayout.Font()));
       
  5352 
       
  5353     d->SetGraphicSubCellL( 2, AknLayoutScalable_Avkon::list_single_graphic_pane_g2( 0 ) );
       
  5354     d->SetGraphicSubCellL( 3, AknLayoutScalable_Avkon::list_single_graphic_pane_g3( 0 ) );
       
  5355 
       
  5356     // Conditional subcells must be added in priority order!
       
  5357     d->SetConditionalSubCellL( 3, AknLayoutScalable_Avkon::list_single_graphic_pane_t1( 2 ), 1 );
       
  5358     d->SetConditionalSubCellL( 2, AknLayoutScalable_Avkon::list_single_graphic_pane_t1( 1 ), 1 );
       
  5359 
       
  5360 
       
  5361 
       
  5362     if ( iListBoxFlags & EAknListBoxFlagsMultiselectionCheck )
       
  5363         {
       
  5364         itemDrawer->SetItemMarkPosition( 0 );
       
  5365         itemDrawer->SetItemMarkReplacement( KFirstIconReplacement ); // should not colorskin 'front checkbox'
       
  5366         itemDrawer->SetItemMarkReverse( ETrue );
       
  5367         }
       
  5368     else
       
  5369         {
       
  5370         itemDrawer->SetItemMarkPosition( 2 );
       
  5371         itemDrawer->SetItemMarkReplacement( KFirstMovingCSIconReplacement );
       
  5372         itemDrawer->SetItemMarkReverse( ETrue );
       
  5373         }
       
  5374     _AKNTRACE_FUNC_EXIT;    
       
  5375     }
       
  5376 
       
  5377 
       
  5378 EXPORT_C void CAknSingleLargeStyleListBox::SizeChanged()
       
  5379     {
       
  5380     _AKNTRACE_FUNC_ENTER;
       
  5381     AKNCOLUMNLISTBOX::SizeChanged();
       
  5382     TRAP_IGNORE( SizeChangedL() );
       
  5383 
       
  5384     SetupScrollbarLayout( this, iSBFrame );
       
  5385     UpdateScrollBarThumbs();
       
  5386     _AKNTRACE_FUNC_EXIT;    
       
  5387     }
       
  5388 
       
  5389 // list item string format: "1\tTextLabel\t0\t0"
       
  5390 void CAknSingleLargeStyleListBox::SizeChangedL()
       
  5391     {
       
  5392     _AKNTRACE_FUNC_ENTER;
       
  5393     CColumnListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  5394     CColumnListBoxData* d( itemDrawer->ColumnData() );
       
  5395     SetupListL( this, AknLayoutScalable_Avkon::list_single_large_graphic_pane( 0, 0 ) );  // TODO - check if different varieties should be used
       
  5396     d->SetGraphicSubCellL( 0, AknLayoutScalable_Avkon::list_single_large_graphic_pane_g1( 0 ) );
       
  5397     d->SetTextSubCellL( 1, AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1( 0 ) );
       
  5398     d->SetGraphicSubCellL( 2, AknLayoutScalable_Avkon::list_single_large_graphic_pane_g2( 0 ) );
       
  5399     d->SetGraphicSubCellL( 3, AknLayoutScalable_Avkon::list_single_large_graphic_pane_g3( 0 ) );
       
  5400 
       
  5401     // Conditional subcells must be added in priority order!
       
  5402     d->SetConditionalSubCellL( 3, AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1( 2 ), 1 );
       
  5403     d->SetConditionalSubCellL( 2, AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1( 1 ), 1 );
       
  5404 
       
  5405 
       
  5406     itemDrawer->SetItemMarkPosition(2);
       
  5407     itemDrawer->SetItemMarkReplacement(KFirstMovingCSIconReplacement);
       
  5408     itemDrawer->SetItemMarkReverse(ETrue);
       
  5409 
       
  5410     SetSeparatorLinePosition(this, EBCColumn);
       
  5411     _AKNTRACE_FUNC_EXIT;    
       
  5412     }
       
  5413 
       
  5414 EXPORT_C void CAknSingleNumberStyleListBox::SizeChanged() 
       
  5415     {
       
  5416     _AKNTRACE_FUNC_ENTER;
       
  5417     AKNCOLUMNLISTBOX::SizeChanged();
       
  5418     TRAP_IGNORE( SizeChangedL() );
       
  5419 
       
  5420     SetupScrollbarLayout( this, iSBFrame );
       
  5421     UpdateScrollBarThumbs();
       
  5422     _AKNTRACE_FUNC_EXIT;    
       
  5423     }
       
  5424 
       
  5425 // list item string format: "2\tTextLabel\t0\t1"
       
  5426 // where 0 and 1 are indexes to icon array
       
  5427 void CAknSingleNumberStyleListBox::SizeChangedL()
       
  5428     {
       
  5429     _AKNTRACE_FUNC_ENTER;
       
  5430     CColumnListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  5431     CColumnListBoxData* d( itemDrawer->ColumnData() );
       
  5432     SetupListL( this, AknLayoutScalable_Avkon::list_single_number_pane( 0 ) );
       
  5433     SetSeparatorLinePosition( this, EABColumn );
       
  5434 
       
  5435     d->SetTextSubCellL( 0, AknLayoutScalable_Avkon::list_single_number_pane_t2( 0 ) );
       
  5436     d->SetTextSubCellL( 1, AknLayoutScalable_Avkon::list_single_number_pane_t1( 0 ) );
       
  5437     d->SetGraphicSubCellL( 2, AknLayoutScalable_Avkon::list_single_number_pane_g1( 0 ) );
       
  5438     d->SetGraphicSubCellL( 3, AknLayoutScalable_Avkon::list_single_number_pane_g2( 0 ) );
       
  5439 
       
  5440     // Conditional subcells must be added in priority order!
       
  5441     d->SetConditionalSubCellL( 3, AknLayoutScalable_Avkon::list_single_number_pane_t1( 2 ), 1 );
       
  5442     d->SetConditionalSubCellL( 2, AknLayoutScalable_Avkon::list_single_number_pane_t1( 1 ), 1 );
       
  5443 
       
  5444     itemDrawer->SetItemMarkPosition(2);
       
  5445     itemDrawer->SetItemMarkReplacement(KFirstMovingCSIconReplacement);
       
  5446     itemDrawer->SetItemMarkReverse(ETrue);
       
  5447     _AKNTRACE_FUNC_EXIT;    
       
  5448     }
       
  5449 
       
  5450 
       
  5451 EXPORT_C void CAknSingleStyleListBox::SizeChanged() 
       
  5452     {
       
  5453     _AKNTRACE_FUNC_ENTER;
       
  5454     AKNCOLUMNLISTBOX::SizeChanged();
       
  5455     TRAP_IGNORE( SizeChangedL() );
       
  5456 
       
  5457     SetupScrollbarLayout( this, iSBFrame );
       
  5458     UpdateScrollBarThumbs();
       
  5459     _AKNTRACE_FUNC_EXIT;    
       
  5460     }
       
  5461 
       
  5462 // list item string format: "\tTextLabel\t0\t1"
       
  5463 void CAknSingleStyleListBox::SizeChangedL()
       
  5464     {
       
  5465     _AKNTRACE_FUNC_ENTER;
       
  5466     CColumnListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  5467     CColumnListBoxData* d( itemDrawer->ColumnData() );
       
  5468     SetupListL( this, AknLayoutScalable_Avkon::list_single_pane( 0 ) );
       
  5469     SetSeparatorLinePosition( this, EAColumn );
       
  5470 
       
  5471     // A-column exists, but there is no layout for it.
       
  5472     // it is never drawn
       
  5473     d->SetTextSubCellL( 1, AknLayoutScalable_Avkon::list_single_pane_t1( 0 ) );
       
  5474     d->SetGraphicSubCellL( 2, AknLayoutScalable_Avkon::list_single_pane_g1( 0 ) );
       
  5475     d->SetGraphicSubCellL( 3, AknLayoutScalable_Avkon::list_single_pane_g2( 0 ) );
       
  5476 
       
  5477     // Conditional subcells must be added in priority order!
       
  5478     d->SetConditionalSubCellL( 3, AknLayoutScalable_Avkon::list_single_pane_t1( 2 ), 1 );
       
  5479     d->SetConditionalSubCellL( 2, AknLayoutScalable_Avkon::list_single_pane_t1( 1 ), 1 );
       
  5480 
       
  5481     itemDrawer->SetItemMarkPosition(2);
       
  5482     itemDrawer->SetItemMarkReplacement(KFirstMovingCSIconReplacement);
       
  5483     itemDrawer->SetItemMarkReverse(ETrue);
       
  5484     _AKNTRACE_FUNC_EXIT;    
       
  5485     }
       
  5486  
       
  5487  
       
  5488 EXPORT_C void CAknFormGraphicStyleListBox::SizeChanged()
       
  5489     {
       
  5490     _AKNTRACE_FUNC_ENTER;
       
  5491     TBool redrawDisabled = iView->RedrawDisabled();
       
  5492     iView->SetDisableRedraw( ETrue );
       
  5493     TRAP_IGNORE( SizeChangedL() );
       
  5494     CEikFormattedCellListBox::SizeChanged();
       
  5495     iView->SetDisableRedraw( redrawDisabled );
       
  5496     _AKNTRACE_FUNC_EXIT;    
       
  5497     }
       
  5498 
       
  5499 //  * list item string format: "1\tShortLabel"
       
  5500 //  * list item string format: "\t\tLongLabel"
       
  5501 void CAknFormGraphicStyleListBox::SizeChangedL()
       
  5502     {
       
  5503     _AKNTRACE_FUNC_ENTER;
       
  5504     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  5505     CFormattedCellListBoxData* d( itemDrawer->FormattedCellData() );
       
  5506     
       
  5507     // setuplist won't work with this, since this is not a mainpane list
       
  5508     SetBorder(TGulBorder::ENone);
       
  5509     d->ResetSLSubCellArray();
       
  5510     
       
  5511     TAknLayoutRect lr;
       
  5512     lr.LayoutRect( TRect( Rect().Size() ),
       
  5513                    AknLayoutScalable_Avkon::list_form_graphic_pane(0) );
       
  5514     TRect itemRect( lr.Rect() );
       
  5515     SetVerticalMargin( itemRect.iTl.iY );
       
  5516     SetHorizontalMargin( itemRect.iTl.iX );
       
  5517     iView->SetItemHeight( itemRect.Height() );
       
  5518     itemDrawer->SetItemCellSize( itemRect.Size() );
       
  5519 
       
  5520 
       
  5521     d->SetGraphicSubCellL( 0, AknLayoutScalable_Avkon::list_form_graphic_pane_g1() );
       
  5522     d->SetTextSubCellL( 1, AknLayoutScalable_Avkon::list_form_graphic_pane_t1( 0 ) );
       
  5523     d->SetTextSubCellL( 2, AknLayoutScalable_Avkon::list_form_graphic_pane_t1( 1 ) );
       
  5524     
       
  5525     itemDrawer->SetItemMarkPosition(0);
       
  5526     itemDrawer->SetItemMarkReplacement(KFirstCSIconReplacement);
       
  5527     itemDrawer->SetItemMarkReverse(ETrue);
       
  5528 
       
  5529     // TODO: check if this could be reduced a bit
       
  5530     CFormattedCellListBoxData::TColors colors;
       
  5531     /* colors can be hardcoded here, because
       
  5532     *  1. They are not available in layouts
       
  5533     *  2. extended color skinning can be used to override hardcoded values
       
  5534     */
       
  5535     colors.iText = AKN_LAF_COLOR(215);            // black
       
  5536     colors.iBack = AKN_LAF_COLOR(0);              // white
       
  5537     colors.iHighlightedText = AKN_LAF_COLOR(0);   // white
       
  5538     colors.iHighlightedBack = AKN_LAF_COLOR(243);  // blue
       
  5539 
       
  5540     if ( AknsUtils::AvkonSkinEnabled() )
       
  5541         {
       
  5542         SetESSHighlightedTextColor( colors, EAknsCIQsnTextColorsCG10 );
       
  5543         SetESSTextColor( colors, EAknsCIQsnTextColorsCG8 );
       
  5544         }
       
  5545     d->SetSubCellColorsL(1, colors);
       
  5546     d->SetSubCellColorsL(2, colors);
       
  5547     _AKNTRACE_FUNC_EXIT;    
       
  5548     }
       
  5549  
       
  5550 EXPORT_C void CAknFormGraphicWideStyleListBox::SizeChanged()
       
  5551         {
       
  5552     _AKNTRACE_FUNC_ENTER;
       
  5553         TBool redrawDisabled = iView->RedrawDisabled();
       
  5554         iView->SetDisableRedraw( ETrue );
       
  5555         TRAP_IGNORE( SizeChangedL() );
       
  5556         CEikFormattedCellListBox::SizeChanged();
       
  5557         iView->SetDisableRedraw( redrawDisabled );
       
  5558     _AKNTRACE_FUNC_EXIT;    
       
  5559         }
       
  5560 
       
  5561 void CAknFormGraphicWideStyleListBox::SizeChangedL()
       
  5562     {
       
  5563     _AKNTRACE_FUNC_ENTER;
       
  5564     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  5565     CFormattedCellListBoxData* d( itemDrawer->FormattedCellData() );
       
  5566     
       
  5567     // setuplist won't work with this, since this is not a mainpane list
       
  5568     SetBorder(TGulBorder::ENone);
       
  5569     d->ResetSLSubCellArray();
       
  5570     
       
  5571     TAknLayoutRect lr;
       
  5572     lr.LayoutRect( TRect( Rect().Size() ),
       
  5573                    AknLayoutScalable_Avkon::list_form_graphic_pane_cp(0) );  // this does not seem to exist in LAF !
       
  5574     TRect itemRect( lr.Rect() );
       
  5575     SetVerticalMargin( itemRect.iTl.iY );
       
  5576     SetHorizontalMargin( itemRect.iTl.iX );
       
  5577     iView->SetItemHeight( itemRect.Height() );
       
  5578     itemDrawer->SetItemCellSize( itemRect.Size() );
       
  5579 
       
  5580     // these are borrowed from other form
       
  5581     d->SetGraphicSubCellL( 0, AknLayoutScalable_Avkon::list_form_graphic_pane_g1() );
       
  5582     d->SetTextSubCellL( 1, AknLayoutScalable_Avkon::list_form_graphic_pane_t1( 0 ) );
       
  5583     d->SetTextSubCellL( 2, AknLayoutScalable_Avkon::list_form_graphic_pane_t1( 1 ) );
       
  5584     
       
  5585     itemDrawer->SetItemMarkPosition(0);
       
  5586     itemDrawer->SetItemMarkReplacement(KFirstCSIconReplacement);
       
  5587     itemDrawer->SetItemMarkReverse(ETrue);
       
  5588 
       
  5589     // TODO: check if this could be reduced a bit
       
  5590     CFormattedCellListBoxData::TColors colors;
       
  5591     /* colors can be hardcoded here, because
       
  5592     *  1. They are not available in layouts
       
  5593     *  2. extended color skinning can be used to override hardcoded values
       
  5594     */
       
  5595     colors.iText = AKN_LAF_COLOR(215);            // black
       
  5596     colors.iBack = AKN_LAF_COLOR(0);              // white
       
  5597     colors.iHighlightedText = AKN_LAF_COLOR(0);   // white
       
  5598     colors.iHighlightedBack = AKN_LAF_COLOR(243);  // blue
       
  5599     
       
  5600     if ( AknsUtils::AvkonSkinEnabled() )
       
  5601         {
       
  5602         SetESSHighlightedTextColor( colors, EAknsCIQsnTextColorsCG10 );
       
  5603         SetESSTextColor( colors, EAknsCIQsnTextColorsCG8 );
       
  5604         }
       
  5605     d->SetSubCellColorsL(1, colors);
       
  5606     d->SetSubCellColorsL(2, colors);
       
  5607     _AKNTRACE_FUNC_EXIT;    
       
  5608     }
       
  5609 
       
  5610 EXPORT_C void CAknSetStyleListBox::SizeChanged()
       
  5611     {
       
  5612     _AKNTRACE_FUNC_ENTER;
       
  5613     CEikFormattedCellListBox::SizeChanged();
       
  5614     TRAP_IGNORE( SizeChangedL() );
       
  5615     _AKNTRACE_FUNC_EXIT;    
       
  5616     }
       
  5617 
       
  5618 
       
  5619 //  * list item string format: "1\tShortLabel"
       
  5620 //  * list item string format: "\t\tLongLabel"
       
  5621 
       
  5622 void CAknSetStyleListBox::SizeChangedL()
       
  5623     {
       
  5624     _AKNTRACE_FUNC_ENTER;
       
  5625     CFormattedCellListBoxItemDrawer *itemDrawer( ItemDrawer() );
       
  5626     CFormattedCellListBoxData* d( itemDrawer->FormattedCellData() );
       
  5627 
       
  5628     // setuplist won't work with this, since this is not a mainpane list
       
  5629     SetBorder(TGulBorder::ENone);
       
  5630     d->ResetSLSubCellArray();
       
  5631     
       
  5632     TAknLayoutRect lr;
       
  5633     lr.LayoutRect( TRect( Rect().Size() ),
       
  5634                    AknLayoutScalable_Avkon::list_set_graphic_pane_copy1( 0 ) );
       
  5635     TRect itemRect( lr.Rect() );
       
  5636     SetVerticalMargin( itemRect.iTl.iY );
       
  5637     SetHorizontalMargin( itemRect.iTl.iX );
       
  5638     SetItemHeightL( itemRect.Height() );
       
  5639     itemDrawer->SetItemCellSize( itemRect.Size() );
       
  5640     
       
  5641     d->SetGraphicSubCellL( 0, AknLayoutScalable_Avkon::list_set_graphic_pane_g1_copy1( 0 ) );
       
  5642     d->SetTextSubCellL( 1, AknLayoutScalable_Avkon::list_set_graphic_pane_t1_copy1( 0 ) );
       
  5643     // long label. No layout exist, but probably not used.
       
  5644     d->SetTextSubCellL( 2, AknLayoutScalable_Avkon::list_set_graphic_pane_t1_copy1( 0 ) );
       
  5645     // protected setting indication. Probably not used.
       
  5646     d->SetGraphicSubCellL( 3, AknLayoutScalable_Avkon::list_set_graphic_pane_g2_copy1( 0 ) );
       
  5647     d->SetConditionalSubCellL( 3, AknLayoutScalable_Avkon::list_set_graphic_pane_t1_copy1( 1 ), 1 );
       
  5648 
       
  5649     itemDrawer->SetItemMarkPosition(0);
       
  5650     itemDrawer->SetItemMarkReplacement( KFirstIconReplacement ); // do not colorskin
       
  5651     itemDrawer->SetItemMarkReverse(ETrue);
       
  5652     
       
  5653     CFormattedCellListBoxData::TColors colors;
       
  5654     colors.iBack = AKN_LAF_COLOR_STATIC(0);
       
  5655     colors.iHighlightedText = AKN_LAF_COLOR_STATIC(0);
       
  5656     colors.iHighlightedBack = AKN_LAF_COLOR_STATIC(243);
       
  5657 
       
  5658     // normal setting page or transparency setting page are all referred to skin text color
       
  5659     //for avoiding highlight background is white error.
       
  5660     colors.iText = AKN_LAF_COLOR_STATIC(215);
       
  5661     if ( AknsUtils::AvkonSkinEnabled() )
       
  5662         {
       
  5663         SetESSHighlightedTextColor( colors, EAknsCIQsnTextColorsCG12 );
       
  5664         SetESSTextColor( colors, EAknsCIQsnTextColorsCG7 );
       
  5665         }
       
  5666     
       
  5667     itemDrawer->FormattedCellData()->SetSubCellColorsL(0, colors);
       
  5668     itemDrawer->FormattedCellData()->SetSubCellColorsL(1, colors);
       
  5669     itemDrawer->FormattedCellData()->SetSubCellColorsL(2, colors);
       
  5670     itemDrawer->SetTextColor(colors.iText);
       
  5671     itemDrawer->SetBackColor(colors.iBack);
       
  5672     itemDrawer->SetHighlightedTextColor(colors.iHighlightedText);
       
  5673     itemDrawer->SetHighlightedBackColor(colors.iHighlightedBack);
       
  5674     _AKNTRACE_FUNC_EXIT;    
       
  5675     }
       
  5676 
       
  5677 CAknSingle2GraphicListBoxItemDrawer::CAknSingle2GraphicListBoxItemDrawer( MTextListBoxModel* aTextListBoxModel,
       
  5678                                                                           const CFont* aFont,
       
  5679                                                                           CColumnListBoxData* aColumnData )
       
  5680     : CColumnListBoxItemDrawer( aTextListBoxModel, aFont, aColumnData),
       
  5681       iMoveIcon( EFalse )
       
  5682     {
       
  5683     }
       
  5684 
       
  5685 CAknSingle2GraphicListBoxItemDrawer::~CAknSingle2GraphicListBoxItemDrawer()
       
  5686     {
       
  5687     }
       
  5688 
       
  5689 void CAknSingle2GraphicListBoxItemDrawer::DrawItemText( TInt aItemIndex,
       
  5690                                                         const TRect& aItemTextRect,
       
  5691                                                         TBool aItemIsCurrent,
       
  5692                                                         TBool aViewIsEmphasized,
       
  5693                                                         TBool aItemIsSelected ) const
       
  5694     {
       
  5695     TInt error;
       
  5696     TRAP( error, if ( iMoveIcon )
       
  5697         {
       
  5698         TPtrC itemText = iModel->ItemText( aItemIndex );
       
  5699         TPtrC columnText;
       
  5700         TextUtils::ColumnText( columnText, 1, &itemText );
       
  5701         CColumnListBoxData* d( ColumnData() );
       
  5702 
       
  5703         d->ResetSLSubCellArray();
       
  5704         d->SetGraphicSubCellL( 0, AknLayoutScalable_Avkon::list_single_2graphic_pane_g4( 0 ) );
       
  5705         d->SetGraphicSubCellL( 1, AknLayoutScalable_Avkon::list_single_2graphic_pane_g1( 0 ) );
       
  5706         d->SetGraphicSubCellL( 3, AknLayoutScalable_Avkon::list_single_2graphic_pane_g2( 0 ) );
       
  5707         d->SetGraphicSubCellL( 4, AknLayoutScalable_Avkon::list_single_2graphic_pane_g3( 0 ) );
       
  5708 
       
  5709         if ( columnText == KNullDesC )
       
  5710             {
       
  5711             // needs own layout - borrow this for now.
       
  5712             d->SetTextSubCellL( 2, AknLayoutScalable_Avkon::list_single_graphic_pane_t1( 0 ) );
       
  5713             d->SetConditionalSubCellL( 4, AknLayoutScalable_Avkon::list_single_graphic_pane_t1( 2 ), 2 );
       
  5714             d->SetConditionalSubCellL( 3, AknLayoutScalable_Avkon::list_single_graphic_pane_t1( 1 ), 2 );
       
  5715             }
       
  5716         else
       
  5717             {
       
  5718             d->SetTextSubCellL( 2, AknLayoutScalable_Avkon::list_single_2graphic_pane_t1( 0 ) );
       
  5719             d->SetConditionalSubCellL( 4, AknLayoutScalable_Avkon::list_single_2graphic_pane_t1( 2 ), 2 );
       
  5720             d->SetConditionalSubCellL( 3, AknLayoutScalable_Avkon::list_single_2graphic_pane_t1( 1 ), 2 );
       
  5721             }
       
  5722         }); // end trap
       
  5723     if ( iMoveIcon && error != KErrNone ) return; // better not crash in draw with hosed layout
       
  5724     CColumnListBoxItemDrawer::DrawItemText( aItemIndex, aItemTextRect, aItemIsCurrent, aViewIsEmphasized, aItemIsSelected );
       
  5725     }
       
  5726 
       
  5727 void CAknSingle2GraphicListBoxItemDrawer::UseEmptyIconSpace( TBool aUse )
       
  5728     {
       
  5729     iMoveIcon = aUse;
       
  5730     }
       
  5731 
       
  5732 EXPORT_C void CAknSingle2GraphicStyleListBox::CreateItemDrawerL()
       
  5733     {
       
  5734     CColumnListBoxData* columnData = CColumnListBoxData::NewL();
       
  5735     CleanupStack::PushL( columnData );
       
  5736     iItemDrawer=new(ELeave) CAknSingle2GraphicListBoxItemDrawer( Model(), iEikonEnv->NormalFont(), columnData );
       
  5737     CleanupStack::Pop();
       
  5738     }
       
  5739 
       
  5740 EXPORT_C void CAknSingle2GraphicStyleListBox::UseEmptyIconSpace( TBool aUse )
       
  5741     {
       
  5742     __ASSERT_ALWAYS( iItemDrawer, Panic( EAknPanicListBoxItemDrawerNotCreated ) );
       
  5743     CAknSingle2GraphicListBoxItemDrawer* d = static_cast<CAknSingle2GraphicListBoxItemDrawer*>(iItemDrawer);
       
  5744     d->UseEmptyIconSpace( aUse );
       
  5745     }
       
  5746 // End of File