javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlistboxlistsitemdrawer.cpp
branchRCL_3
changeset 19 04becd199f91
child 23 98ccebc37403
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*******************************************************************************
       
     2  * Copyright (c) 2007, 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved. This program and the accompanying materials
       
     4  * are made available under the terms of the Eclipse Public License v1.0
       
     5  * which accompanies this distribution, and is available at
       
     6  * http://www.eclipse.org/legal/epl-v10.html
       
     7  *
       
     8  * Contributors:
       
     9  *     Nokia Corporation - S60 implementation
       
    10  *******************************************************************************/
       
    11 
       
    12 
       
    13 #include "swtlistboxlistsitemdrawer.h"
       
    14 
       
    15 // ---------------------------------------------------------------------------
       
    16 // CSwtColumnListBoxItemDrawer::CSwtColumnListBoxItemDrawer
       
    17 // ---------------------------------------------------------------------------
       
    18 //
       
    19 CSwtColumnListBoxItemDrawer::CSwtColumnListBoxItemDrawer(
       
    20     MTextListBoxModel* aTextListBoxModel, const CFont* aFont,
       
    21     CColumnListBoxData* aListBoxData, CEikListBox* /*aOwner*/)
       
    22         : CColumnListBoxItemDrawer(aTextListBoxModel, aFont, aListBoxData)
       
    23 {
       
    24 }
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // CSwtColumnListBoxItemDrawer::~CSwtColumnListBoxItemDrawer
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 CSwtColumnListBoxItemDrawer::~CSwtColumnListBoxItemDrawer()
       
    31 {
       
    32 }
       
    33 
       
    34 // ---------------------------------------------------------------------------
       
    35 // CSwtSingleHeadingStyleListBoxItemDrawer::
       
    36 //      CSwtSingleHeadingStyleListBoxItemDrawer
       
    37 // ---------------------------------------------------------------------------
       
    38 //
       
    39 CSwtSingleHeadingStyleListBoxItemDrawer::CSwtSingleHeadingStyleListBoxItemDrawer(
       
    40     MTextListBoxModel* aTextListBoxModel, const CFont* aFont,
       
    41     CColumnListBoxData* aListBoxData, CEikListBox* /*aOwner*/)
       
    42         : CSingleHeadingStyleItemDrawer(aTextListBoxModel, aFont, aListBoxData)
       
    43 {
       
    44 }
       
    45 
       
    46 // ---------------------------------------------------------------------------
       
    47 // CSwtColumnListBoxItemDrawer::~CSwtColumnListBoxItemDrawer
       
    48 // ---------------------------------------------------------------------------
       
    49 //
       
    50 CSwtSingleHeadingStyleListBoxItemDrawer::~CSwtSingleHeadingStyleListBoxItemDrawer()
       
    51 {
       
    52 }
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 // CSwtFormattedCellListBoxItemDrawer::CSwtFormattedCellListBoxItemDrawer
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 CSwtFormattedCellListBoxItemDrawer::CSwtFormattedCellListBoxItemDrawer(
       
    59     MTextListBoxModel* aTextListBoxModel, const CFont* aFont,
       
    60     CFormattedCellListBoxData* aListBoxData, CEikListBox* /*aOwner*/)
       
    61         : CFormattedCellListBoxItemDrawer(aTextListBoxModel, aFont, aListBoxData)
       
    62 {
       
    63 }
       
    64 
       
    65 // ---------------------------------------------------------------------------
       
    66 // CSwtColumnListBoxItemDrawer::~CSwtColumnListBoxItemDrawer
       
    67 // ---------------------------------------------------------------------------
       
    68 //
       
    69 CSwtFormattedCellListBoxItemDrawer::~CSwtFormattedCellListBoxItemDrawer()
       
    70 {
       
    71 }
       
    72 
       
    73 // ---------------------------------------------------------------------------
       
    74 // CSwtDoubleLargeStyleItemDrawer::CSwtDoubleLargeStyleItemDrawer
       
    75 // ---------------------------------------------------------------------------
       
    76 //
       
    77 CSwtDoubleLargeStyleItemDrawer::CSwtDoubleLargeStyleItemDrawer(
       
    78     MTextListBoxModel* aTextListBoxModel, const CFont* aFont,
       
    79     CFormattedCellListBoxData* aListBoxData, CEikListBox* aOwner)
       
    80         : CDoubleLargeStyleItemDrawer(aTextListBoxModel, aFont, aListBoxData,
       
    81                                       aOwner)
       
    82 {
       
    83 }
       
    84 
       
    85 // ---------------------------------------------------------------------------
       
    86 // CSwtColumnListBoxItemDrawer::~CSwtColumnListBoxItemDrawer
       
    87 // ---------------------------------------------------------------------------
       
    88 //
       
    89 CSwtDoubleLargeStyleItemDrawer::~CSwtDoubleLargeStyleItemDrawer()
       
    90 {
       
    91 }
       
    92 
       
    93 // ---------------------------------------------------------------------------
       
    94 // CSwtColumnListBoxItemDrawer::DrawItemText
       
    95 // ---------------------------------------------------------------------------
       
    96 //
       
    97 void CSwtColumnListBoxItemDrawer::DrawItemText(TInt aItemIndex,
       
    98         const TRect& aItemTextRect,
       
    99         TBool aItemIsCurrent,
       
   100         TBool aViewIsEmphasized,
       
   101         TBool aItemIsSelected) const
       
   102 {
       
   103     BeginClipping(iGc);
       
   104     CColumnListBoxItemDrawer::DrawItemText(aItemIndex, aItemTextRect,
       
   105             aItemIsCurrent, aViewIsEmphasized, aItemIsSelected);
       
   106     EndClipping(iGc);
       
   107 }
       
   108 
       
   109 // ---------------------------------------------------------------------------
       
   110 // CSwtSingleHeadingStyleListBoxItemDrawer::DrawItemText
       
   111 // ---------------------------------------------------------------------------
       
   112 //
       
   113 void CSwtSingleHeadingStyleListBoxItemDrawer::DrawItemText(TInt aItemIndex,
       
   114         const TRect& aItemTextRect,
       
   115         TBool aItemIsCurrent,
       
   116         TBool aViewIsEmphasized,
       
   117         TBool aItemIsSelected) const
       
   118 {
       
   119     BeginClipping(iGc);
       
   120     CSingleHeadingStyleItemDrawer::DrawItemText(aItemIndex, aItemTextRect,
       
   121             aItemIsCurrent, aViewIsEmphasized, aItemIsSelected);
       
   122     EndClipping(iGc);
       
   123 }
       
   124 
       
   125 // ---------------------------------------------------------------------------
       
   126 // CSwtFormattedCellListBoxItemDrawer::DrawItemText
       
   127 // ---------------------------------------------------------------------------
       
   128 //
       
   129 void CSwtFormattedCellListBoxItemDrawer::DrawItemText(TInt aItemIndex,
       
   130         const TRect& aItemTextRect,
       
   131         TBool aItemIsCurrent,
       
   132         TBool aViewIsEmphasized,
       
   133         TBool aItemIsSelected) const
       
   134 {
       
   135     BeginClipping(iGc);
       
   136     CFormattedCellListBoxItemDrawer::DrawItemText(aItemIndex, aItemTextRect,
       
   137             aItemIsCurrent, aViewIsEmphasized, aItemIsSelected);
       
   138     EndClipping(iGc);
       
   139 }
       
   140 
       
   141 // ---------------------------------------------------------------------------
       
   142 // CSwtDoubleLargeStyleItemDrawer::DrawItemText
       
   143 // ---------------------------------------------------------------------------
       
   144 //
       
   145 void CSwtDoubleLargeStyleItemDrawer::DrawItemText(TInt aItemIndex,
       
   146         const TRect& aItemTextRect,
       
   147         TBool aItemIsCurrent,
       
   148         TBool aViewIsEmphasized,
       
   149         TBool aItemIsSelected) const
       
   150 {
       
   151     BeginClipping(iGc);
       
   152     CDoubleLargeStyleItemDrawer::DrawItemText(aItemIndex, aItemTextRect,
       
   153             aItemIsCurrent, aViewIsEmphasized, aItemIsSelected);
       
   154     EndClipping(iGc);
       
   155 }
       
   156 // ---------------------------------------------------------------------------
       
   157 // ASwtListBoxItemDrawerBase::SetCustomClippingRect
       
   158 // ---------------------------------------------------------------------------
       
   159 //
       
   160 void ASwtListBoxItemDrawerBase::SetCustomClippingRect(
       
   161     const TRect& aRect)
       
   162 {
       
   163     if (aRect.IsNormalized())
       
   164     {
       
   165         iCustomClippingRect = aRect;
       
   166     }
       
   167     else
       
   168     {
       
   169         iCustomClippingRect = TRect::EUninitialized;
       
   170     }
       
   171 }
       
   172 
       
   173 // ---------------------------------------------------------------------------
       
   174 // ASwtListBoxItemDrawerBase::BeginClipping
       
   175 // ---------------------------------------------------------------------------
       
   176 //
       
   177 void ASwtListBoxItemDrawerBase::BeginClipping(CWindowGc* aGc) const
       
   178 {
       
   179     if (iCustomClippingRect != TRect::EUninitialized)
       
   180     {
       
   181         aGc->SetClippingRect(iCustomClippingRect);
       
   182     }
       
   183 }
       
   184 
       
   185 // ---------------------------------------------------------------------------
       
   186 // ASwtListBoxItemDrawerBase::EndClipping
       
   187 // ---------------------------------------------------------------------------
       
   188 //
       
   189 void ASwtListBoxItemDrawerBase::EndClipping(CWindowGc* aGc) const
       
   190 {
       
   191     if (iCustomClippingRect != TRect::EUninitialized)
       
   192     {
       
   193         aGc->CancelClippingRect();
       
   194     }
       
   195 }