meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncspopuplistbox.h
branchRCL_3
changeset 33 da5135c61bad
parent 0 8466d47a6819
equal deleted inserted replaced
32:a3a1ae9acec6 33:da5135c61bad
     1 /*
     1 /*
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    17 
    17 
    18 #ifndef CESMRNCSPOPUPLISTBOX_H
    18 #ifndef CESMRNCSPOPUPLISTBOX_H
    19 #define CESMRNCSPOPUPLISTBOX_H
    19 #define CESMRNCSPOPUPLISTBOX_H
    20 
    20 
    21 // INCLUDES
    21 // INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <fbs.h>
    22 #include <aknlists.h>
    24 #include <aknlists.h>
       
    25 
    23 #include "mesmrcontacthandlerobserver.h"
    26 #include "mesmrcontacthandlerobserver.h"
    24 
    27 
    25 // FORWARD DECLARATIONS
    28 // FORWARD DECLARATIONS
    26 class CESMRNcsEmailAddressObject;
    29 class CESMRNcsEmailAddressObject;
    27 class CAknsBasicBackgroundControlContext;
    30 class CAknsBasicBackgroundControlContext;
    28 class CESMRContactHandler;
    31 class CESMRContactHandler;
    29 class CFSMailBox;
    32 class CFSMailBox;
    30 class CESMRLayoutManager;
       
    31 
    33 
    32 // CLASS DECLARATION
    34 // CLASS DECLARATION
    33 
    35 
    34 /**
    36 /**
    35  *  CESMRNcsPopupListBox is the litbox that is displayed when user types
    37  *  CESMRNcsPopupListBox is the litbox that is displayed when user types
   116 
   118 
   117     /**
   119     /**
   118      * @return iRMLUItemPosition value;
   120      * @return iRMLUItemPosition value;
   119      */
   121      */
   120     TInt RMLUItemPosition() const;
   122     TInt RMLUItemPosition() const;
   121 
       
   122     /**
       
   123      * Initialise skin/theme/laf support and set layoutmanager to be used by the list
       
   124      * @param aLayout LayoutManager to be used by the list
       
   125      */
       
   126     void Initialise(CESMRLayoutManager* aLayout);
       
   127     
   123     
   128 private: // Implementation
   124 private: // Implementation
   129     enum TRemoteLookupItemMoveDirection
   125     enum TRemoteLookupItemMoveDirection
   130         {
   126         {
   131         ERemoteLookupItemUp,
   127         ERemoteLookupItemUp,
   132         ERemoteLookupItemDown
   128         ERemoteLookupItemDown
   133         };
   129         };
   134     void SetListItemsFromArrayL();
   130     void SetListItemsFromArrayL();
   135     void SetPopupHeightL();
   131     void SetPopupHeightL();
   136     void SetRemoteLookupItemFirstToTheListL();
   132     void SetRemoteLookupItemLastToTheListL();
   137     void MoveRemoteLookupItemL( TRemoteLookupItemMoveDirection aDirection );
       
   138     void CreateTextArrayAndSetToTheListboxL();
   133     void CreateTextArrayAndSetToTheListboxL();
   139 
   134 
   140 private:
   135 private:
   141     CESMRNcsPopupListBox( CESMRContactHandler& aContactHandler );
   136     CESMRNcsPopupListBox( CESMRContactHandler& aContactHandler );
   142     virtual void CreateItemDrawerL();
   137     virtual void CreateItemDrawerL();
   143     
   138     
   144 private: // data
   139 private: // data
   145     CAknsBasicBackgroundControlContext* iBaseBackroundContext;//own
   140     CAknsBasicBackgroundControlContext* iBaseBackroundContext; //own
   146     RPointerArray<CESMRClsItem>         iMatchingArray; //own
   141     RPointerArray<CESMRClsItem>         iMatchingArray; //own
   147     CDesCArray*                         iItemTextsArray;//own
   142     CDesCArray*                         iItemTextsArray;//own
   148     HBufC*                              iCurrentSearchText;//own
   143     HBufC*                              iCurrentSearchText;//own
   149     CFSMailBox*                         iMailBox;//not own
   144     CFSMailBox*                         iMailBox;//not own
   150     CESMRContactHandler&                iContactHandler;//not own
   145     CESMRContactHandler&                iContactHandler;//not own
   166      * Constructor
   161      * Constructor
   167      * @param aListBox reference to the list box where the object is located
   162      * @param aListBox reference to the list box where the object is located
   168      */
   163      */
   169     CESMRNcsListItemDrawer( CESMRNcsPopupListBox& aListBox );
   164     CESMRNcsListItemDrawer( CESMRNcsPopupListBox& aListBox );
   170 
   165 
   171     void SetLayoutManager( CESMRLayoutManager* aLayout );
       
   172 
       
   173 private: // from CListItemDrawer
   166 private: // from CListItemDrawer
   174     void DrawActualItem( TInt aItemIndex, const TRect& aActualItemRect,
   167     void DrawActualItem( TInt aItemIndex, const TRect& aActualItemRect,
   175                          TBool aItemIsCurrent, TBool aViewIsEmphasized,
   168                          TBool aItemIsCurrent, TBool aViewIsEmphasized,
   176                          TBool aViewIsDimmed, TBool aItemIsSelected ) const;
   169                          TBool aViewIsDimmed, TBool aItemIsSelected ) const;
   177 
   170 
   178 private:
   171 private:
   179     void DoDrawActualItemL( TInt aItemIndex, const TRect& aActualItemRect,
   172     void DoDrawActualItemL( TInt aItemIndex, const TRect& aActualItemRect,
   180                             TBool aItemIsCurrent, TBool aViewIsEmphasized,
   173                             TBool aItemIsCurrent, TBool aViewIsEmphasized,
   181                             TBool aViewIsDimmed, TBool aItemIsSelected ) const;
   174                             TBool aViewIsDimmed, TBool aItemIsSelected ) const;
       
   175     
   182     void DrawPartOfItem( const TRect& aItemRect, const CFont& aFont,
   176     void DrawPartOfItem( const TRect& aItemRect, const CFont& aFont,
   183                          TInt aStartPos, TInt aLength, const TDesC& aDes,
   177                          TInt aStartPos, TInt aLength, const TDesC& aDes,
   184                          TBool aUnderlined, TInt aBaseline ) const;
   178                          TBool aUnderlined, TInt aBaseline ) const;
   185     
   179     
       
   180 private: // Implementation
       
   181     void DrawPopUpBackGroundL( const TRect& aActualItemRect ) const;
       
   182     void DrawPopUpSelectorL( const TRect& aActualItemRect ) const;
       
   183     void DrawPopUpTextL( TInt aItemIndex, const TRect& aActualItemRect ) const;
       
   184     
   186 private: //data
   185 private: //data
   187     CESMRNcsPopupListBox&               iListBox;
   186     
   188     CESMRLayoutManager*                 iLayout;//not own
   187     CESMRNcsPopupListBox&   iListBox;
   189     };
   188     };
   190 
   189 
   191 
   190 
   192 #endif // CESMRNCSPOPUPLISTBOX_H
   191 #endif // CESMRNCSPOPUPLISTBOX_H
   193 
   192