fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/src/AknFepUiAvkonCtrlJapaneseCandidateListboxView.cpp
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c) 2002-2004 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:            Candidate list
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 // INCLUDE FILES
       
    30 #include <eikdef.h>
       
    31 
       
    32 #include <aknViewAppUi.h>
       
    33 #include <avkon.hrh>
       
    34 #include <aknPopup.h>
       
    35 #include <aknlists.h>
       
    36 
       
    37 #include "AknFepUiInterfacePanic.h"
       
    38 #include "AknFepUIAvkonCtrlJapaneseCandidateListboxView.h" 
       
    39 
       
    40 // ============================ MEMBER FUNCTIONS ===============================
       
    41 
       
    42 #define ITEM_EXISTS_BEGIN TInt no_of_items__ = iModel->NumberOfItems()
       
    43 #define ITEM_EXISTS(x) (((x) > -1) && ((x) < no_of_items__))
       
    44 
       
    45 #define ITEM_EXISTS_ONCE(x) (((x) > -1) && ((x) < iModel->NumberOfItems()))
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // CAknFepUICtrlJapaneseCandidateListboxView::Draw
       
    49 // Drawing listbox
       
    50 // -----------------------------------------------------------------------------
       
    51 //
       
    52 void CAknFepUICtrlJapaneseCandidateListboxView::Draw(
       
    53         const TRect* /*aClipRect*/) const
       
    54     {
       
    55     if (RedrawDisabled() || !IsVisible())
       
    56         return;
       
    57 
       
    58     if (iModel->NumberOfItems() > 0)
       
    59         {
       
    60         TInt firstPotentialItemIndex = iTopItemIndex;
       
    61         TInt lastPotentialItemIndex =
       
    62             iTopItemIndex + NumberOfItemsThatFitInRect(iViewRect) - 1;
       
    63         TInt i;
       
    64         ITEM_EXISTS_BEGIN;
       
    65         for (i = firstPotentialItemIndex; i <= lastPotentialItemIndex; i++)
       
    66             {
       
    67             if (ITEM_EXISTS(i))
       
    68                 {
       
    69                 DrawItem(i);
       
    70                 }
       
    71             else
       
    72                 {
       
    73                 break;
       
    74                 }
       
    75             }
       
    76         }
       
    77     } 
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CAknFepUICtrlJapaneseCandidateListboxView::DrawItem
       
    81 // Drawing item of index appointed with an argument
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 void CAknFepUICtrlJapaneseCandidateListboxView::DrawItem(
       
    85         TInt aItemIndex) const
       
    86     {
       
    87     if (RedrawDisabled() || !IsVisible())
       
    88         {
       
    89         return;
       
    90         }
       
    91 
       
    92     if (((aItemIndex > -1) && (aItemIndex < iModel->NumberOfItems()))
       
    93         && ItemIsVisible(aItemIndex))
       
    94         {
       
    95         iItemDrawer->DrawItem(
       
    96             aItemIndex,
       
    97             ItemPos(aItemIndex),
       
    98             ItemIsSelected(aItemIndex),
       
    99             (aItemIndex == iCurrentItemIndex),
       
   100             (iFlags & EEmphasized) > 0,
       
   101             (iFlags & EDimmed) > 0);
       
   102         }
       
   103     }
       
   104 
       
   105 // End of File