fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/src/AknFepUiAvkonCtrlJapaneseCandidateCellListBoxData.cpp
changeset 36 a7632c26d895
parent 35 0f326f2e628e
child 42 b3eaa440ab06
equal deleted inserted replaced
35:0f326f2e628e 36:a7632c26d895
     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 <aknViewAppUi.h>
       
    31 #include <avkon.hrh>
       
    32 
       
    33 #include <aknPopup.h>
       
    34 #include <AknsDrawUtils.h>
       
    35 
       
    36 #include "AknFepUiInterfacePanic.h"
       
    37 #include "AknFepUIAvkonCtrlJapaneseCandidateCellListBoxData.h" 
       
    38 
       
    39 // ============================ MEMBER FUNCTIONS ===============================
       
    40 
       
    41 // -----------------------------------------------------------------------------
       
    42 // CAknFepUICtrlJapaneseCandidateCellListBoxData::NewL
       
    43 // Two-phased constructor.
       
    44 // -----------------------------------------------------------------------------
       
    45 //
       
    46 CAknFepUICtrlJapaneseCandidateCellListBoxData*
       
    47     CAknFepUICtrlJapaneseCandidateCellListBoxData::NewL()
       
    48     {
       
    49     CAknFepUICtrlJapaneseCandidateCellListBoxData* self =
       
    50             new(ELeave) CAknFepUICtrlJapaneseCandidateCellListBoxData;
       
    51     self->ConstructLD();
       
    52     return self;
       
    53     }
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // CAknFepUICtrlJapaneseCandidateCellListBoxData::Draw
       
    57 // Draw items
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 void CAknFepUICtrlJapaneseCandidateCellListBoxData::Draw(
       
    61         TListItemProperties aProperties,
       
    62         CWindowGc& aGc,
       
    63         const TDesC* aText,
       
    64         const TRect& aRect,
       
    65         TBool aHighlight, 
       
    66         const TColors& aColors) const
       
    67     {
       
    68     const TRect &aItemRect = aRect;
       
    69 
       
    70     DrawDefaultHighlight(aGc, aItemRect, aHighlight);
       
    71 
       
    72     // Draw the actual items.
       
    73     DrawFormatted(aProperties, aGc, aText, aItemRect, aHighlight, aColors);
       
    74 
       
    75     aGc.Reset();
       
    76 
       
    77     }
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CAknFepUICtrlJapaneseCandidateCellListBoxData::DrawDefaultHighlight
       
    81 // Draw highlight item
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 void CAknFepUICtrlJapaneseCandidateCellListBoxData::DrawDefaultHighlight(
       
    85         CWindowGc& aGc,
       
    86         const TRect& aItemRect,
       
    87         TBool aHighlight) const
       
    88     {
       
    89     if (aHighlight)
       
    90         {
       
    91         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
    92         TBool highlightDrawn = EFalse;
       
    93         MAknsControlContext* cc = AknsDrawUtils::ControlContext(Control());
       
    94         if (!cc)
       
    95             {
       
    96             cc = SkinBackgroundContext();
       
    97             }
       
    98         if (cc)
       
    99             {
       
   100             TAknLayoutRect topLeft;
       
   101             topLeft.LayoutRect(aItemRect,
       
   102                                ELayoutEmpty,
       
   103                                1, 1, ELayoutEmpty, ELayoutEmpty, 5, 5);
       
   104 
       
   105             TAknLayoutRect bottomRight;
       
   106             bottomRight.LayoutRect(aItemRect,
       
   107                                    ELayoutEmpty,
       
   108                                    ELayoutEmpty, ELayoutEmpty, 1, 0, 5,5);
       
   109 
       
   110             TRect outerRect =
       
   111                         TRect(topLeft.Rect().iTl, bottomRight.Rect().iBr);
       
   112             TRect innerRect =
       
   113                         TRect(topLeft.Rect().iBr, bottomRight.Rect().iTl);
       
   114             aGc.SetPenStyle(CGraphicsContext::ENullPen);
       
   115 
       
   116             const TAknsItemID* skinHighlightFrameId =
       
   117                                                 &KAknsIIDQsnFrList;
       
   118             const TAknsItemID* skinHighlightFrameCenterId =
       
   119                                                 &KAknsIIDQsnFrListCenter;
       
   120             highlightDrawn = AknsDrawUtils::DrawFrame(
       
   121                                                 skin,
       
   122                                                 aGc,
       
   123                                                 outerRect, innerRect,
       
   124                                                 *skinHighlightFrameId,
       
   125                                                 *skinHighlightFrameCenterId);
       
   126             }
       
   127         
       
   128         if (!highlightDrawn)
       
   129             {
       
   130             TAknLayoutRect highlightshadow;
       
   131             TAknLayoutRect highlight;
       
   132             highlightshadow.LayoutRect(
       
   133                     aItemRect,
       
   134                     AKN_LAYOUT_WINDOW_List_pane_highlight_graphics__various__Line_1(aItemRect));
       
   135             highlight.LayoutRect(
       
   136                     aItemRect,
       
   137                     AKN_LAYOUT_WINDOW_List_pane_highlight_graphics__various__Line_2(aItemRect));
       
   138 
       
   139             highlightshadow.DrawRect(aGc);
       
   140             highlight.DrawRect(aGc);
       
   141             }
       
   142         }
       
   143     }
       
   144 
       
   145 // End of File