emailcontacts/remotecontactlookup/engine/inc/cpbkxrclsearchresultlistbox.h
branchRCL_3
changeset 12 4ce476e64c59
parent 11 0396474f30f5
child 13 8592a65ad3fb
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
     1 /*
       
     2 * Copyright (c) 2007 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:  Definition of the class CPbkxRclSearchResultListBox.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBKXRCLSEARCHRESULTLISTBOX_H
       
    20 #define CPBKXRCLSEARCHRESULTLISTBOX_H
       
    21 
       
    22 #include <aknlists.h>
       
    23 #include <eikclb.h>
       
    24 
       
    25 ////////////////////////////////////////////////////////////////////////////
       
    26 // CPbkxRclSearchResultListBox
       
    27 ////////////////////////////////////////////////////////////////////////////
       
    28 
       
    29 /**
       
    30 * Listbox for search result dialog.
       
    31 */
       
    32 class CPbkxRclSearchResultListBox : public CAknSingleStyleListBox
       
    33     {
       
    34 public: // constructor and destructor
       
    35 
       
    36     /**
       
    37     * Constructor.
       
    38     */
       
    39     CPbkxRclSearchResultListBox();
       
    40 
       
    41     /**
       
    42     * Destructor.
       
    43     */
       
    44     virtual ~CPbkxRclSearchResultListBox();
       
    45 
       
    46 protected: // methods from base classes
       
    47 
       
    48     /**
       
    49     * Creates item drawer for the listbox.
       
    50     */
       
    51     virtual void CreateItemDrawerL();
       
    52     
       
    53     /**
       
    54     * Creates view for the listbox.
       
    55     */
       
    56     virtual CListBoxView* MakeViewClassInstanceL();
       
    57     };
       
    58 
       
    59 ////////////////////////////////////////////////////////////////////////////
       
    60 // CPbkxRclSearchResultItemDrawer
       
    61 ////////////////////////////////////////////////////////////////////////////
       
    62 
       
    63 /**
       
    64 * Item drawer for search result listbox.
       
    65 */
       
    66 class CPbkxRclSearchResultItemDrawer : public CColumnListBoxItemDrawer
       
    67     {
       
    68 public: // constructor and destructor
       
    69 
       
    70     /**
       
    71     * Constructor.
       
    72     *
       
    73     * @param aTextListBoxModel Listbox model.
       
    74     * @param aFont Used font.
       
    75     * @param aColumnData Data class.
       
    76     */
       
    77     CPbkxRclSearchResultItemDrawer(
       
    78         MTextListBoxModel* aTextListBoxModel, 
       
    79         const CFont* aFont, 
       
    80         CColumnListBoxData* aColumnData );
       
    81 
       
    82     /**
       
    83     * Destructor.
       
    84     */
       
    85     virtual ~CPbkxRclSearchResultItemDrawer();
       
    86 
       
    87 public: // new methods
       
    88 
       
    89     /**
       
    90     * Sets highlighted text color.
       
    91     *
       
    92     * @param aColor Color.
       
    93     */
       
    94     void SetHighlightColor( TRgb aColor );
       
    95 
       
    96     /**
       
    97     * Sets normal text color.
       
    98     *
       
    99     * @param aColor Color.
       
   100     */
       
   101     void SetColor( TRgb aColor );
       
   102 
       
   103     /**
       
   104     * Reset color settings.
       
   105     *
       
   106     * @param aHighlightColor ETrue if highlight is reset, EFalse for normal.
       
   107     */
       
   108     void ResetColors( TBool aHighlightColor = EFalse );
       
   109 
       
   110 public: // from base classes
       
   111 
       
   112     /**
       
   113     * Draws item text.
       
   114     *
       
   115     * @param aItemIndex Item index.
       
   116     * @param aItemTextRect Item text rect.
       
   117     * @param aItemIsCurrent
       
   118     * @param aViewIsEmphasized
       
   119     * @param aItemIsSelected
       
   120     */
       
   121     virtual void DrawItemText(
       
   122         TInt aItemIndex,
       
   123         const TRect& aItemTextRect,
       
   124         TBool aItemIsCurrent,
       
   125         TBool aViewIsEmphasized, 
       
   126         TBool aItemIsSelected ) const;
       
   127 
       
   128 private: // data
       
   129 
       
   130     enum TColors
       
   131         {
       
   132         EColorSet = 0x1,
       
   133         EHighlighColorSet = 0x2
       
   134         };
       
   135 
       
   136     // Normal text color.
       
   137     TRgb iColor;
       
   138     
       
   139     // Highlighted text color.
       
   140     TRgb iHighlightColor;
       
   141     
       
   142     // Flag indicating that colors are set.
       
   143     TInt iColorsSet;
       
   144     
       
   145     };
       
   146 
       
   147 ////////////////////////////////////////////////////////////////////////////
       
   148 // CPbkxRclSearchResultListView
       
   149 ////////////////////////////////////////////////////////////////////////////
       
   150 
       
   151 /**
       
   152 * View for search result listbox.
       
   153 */
       
   154 class CPbkxRclSearchResultListView: public CAknColumnListBoxView 
       
   155     {
       
   156 protected:
       
   157     // From CListBoxView
       
   158     
       
   159     /**
       
   160      * Called when drawing empty list
       
   161      * 
       
   162      * @param aClientRect Not used.
       
   163      */
       
   164     void DrawEmptyList(const TRect &aClientRect) const;  
       
   165     };
       
   166 #endif
       
   167 
       
   168