emailuis/emailui/inc/ncspopuplistbox.h
branchRCL_3
changeset 13 8592a65ad3fb
parent 10 f5907b1a1053
child 14 b13141f05c3d
equal deleted inserted replaced
12:4ce476e64c59 13:8592a65ad3fb
    25 #include <aknlists.h>
    25 #include <aknlists.h>
    26 #include "FreestyleEmailUiContactHandlerObserver.h"
    26 #include "FreestyleEmailUiContactHandlerObserver.h"
    27 
    27 
    28 // FORWARD DECLARATION
    28 // FORWARD DECLARATION
    29 class CNcsEmailAddressObject;
    29 class CNcsEmailAddressObject;
    30 class CAknsBasicBackgroundControlContext;
    30 class CAknsFrameBackgroundControlContext;
    31 class CFSEmailUiContactHandler;
    31 class CFSEmailUiContactHandler;
    32 class CFSMailBox;
    32 class CFSMailBox;
    33 class CNcsHeaderContainer;
    33 class CNcsHeaderContainer;
    34 class CFSEmailUiLayoutHandler;
    34 class CFSEmailUiLayoutHandler;
    35 class CFreestyleEmailUiAppUi; //<cmail>
    35 class CFreestyleEmailUiAppUi; //<cmail>
    39 /**
    39 /**
    40 *  CNcsPopupListBox
    40 *  CNcsPopupListBox
    41 */
    41 */
    42 class CNcsPopupListBox : public CEikTextListBox, 
    42 class CNcsPopupListBox : public CEikTextListBox, 
    43                          public MEikListBoxObserver,
    43                          public MEikListBoxObserver,
    44 						 public MFSEmailUiContactHandlerObserver
    44                          public MFSEmailUiContactHandlerObserver
    45     {
    45     {
    46 public: // Constructors and destructor
    46 public: // Constructors and destructor
    47 
    47 
    48 		/*
    48 		/*
    49 		* @param aMailBox reference to current mailbox item
    49 		* @param aMailBox reference to current mailbox item
    50 		*/
    50 		*/
    51     static CNcsPopupListBox* NewL( const CCoeControl* aParent, CFSMailBox& aMailBox, 
    51     static CNcsPopupListBox* NewL( const CCoeControl* aParent, CFSMailBox& aMailBox, 
    52                                    CNcsHeaderContainer& aHeaderContainer,
    52                                    CNcsHeaderContainer& aHeaderContainer,
    53                                    TBool aRemoteLookupSupported );
    53                                    TBool aRemoteLookupSupported );
    54 
    54 
    55       
       
    56     /*
    55     /*
    57     * @param aMailBox reference to current mailbox item
    56     * @param aMailBox reference to current mailbox item
    58     */
    57     */
    59     void ConstructL( const CCoeControl* aParent );
    58     void ConstructL( const CCoeControl* aParent );
    60         
       
    61 
    59 
    62     /*
    60     /*
    63     * 
    61     * 
    64     *
    62     *
    65     * @param aText
    63     * @param aText
    70     virtual ~CNcsPopupListBox();
    68     virtual ~CNcsPopupListBox();
    71 
    69 
    72 public: // from CEikTextListBox
    70 public: // from CEikTextListBox
    73 
    71 
    74     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
    72     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
    75         
    73 
    76     virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
    74     TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
    77         
    75 
    78     void SizeChanged();
    76     void SizeChanged();
       
    77     void HandleResourceChange( TInt aType );
       
    78     void HandlePointerEventL( const TPointerEvent& aPointerEvent );
    79 
    79 
    80 public: // from MEikListBoxObserver
    80 public: // from MEikListBoxObserver
    81 
    81 
    82     void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
    82     void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
    83 
    83 
    84 public: // from MFSEmailUiContactHandlerObserver
    84 public: // from MFSEmailUiContactHandlerObserver
    85 	
    85 
    86     void OperationCompleteL( TContactHandlerCmd aCmd, 
    86     void OperationCompleteL( TContactHandlerCmd aCmd, 
    87     						const RPointerArray<CFSEmailUiClsItem>& aMatchingItems );
    87         const RPointerArray<CFSEmailUiClsItem>& aMatchingItems );
    88     void OperationErrorL( TContactHandlerCmd aCmd, TInt aError );
    88     void OperationErrorL( TContactHandlerCmd aCmd, TInt aError );
    89  
       
    90 
    89 
    91 public: // new methods for the header container
    90 public: // new methods for the header container
    92  		
    91 
    93     /*
    92     /*
    94     * 
    93     * 
    95     * @param aText
    94     * @param aText
    96     */
    95     */
    97     void SetSearchTextL( const TDesC& aText );
    96     void SetSearchTextL( const TDesC& aText );
   141     CFSEmailUiLayoutHandler& LayoutHandler() const;
   140     CFSEmailUiLayoutHandler& LayoutHandler() const;
   142     
   141     
   143 private: // to populate new list
   142 private: // to populate new list
   144     
   143     
   145     void SetListItemsFromArrayL();
   144     void SetListItemsFromArrayL();
   146  		
   145 
   147     TInt RoundToItemHeight(const TInt aPopupHeight) const;
   146     TInt RoundToItemHeight(const TInt aPopupHeight) const;
   148     
   147     
   149     void SetPopupHeight();
   148     void SetPopupHeight();
   150  
   149  
   151     void SetScrollBarVisibilityL();
   150     void SetScrollBarVisibilityL();
   162  
   161  
   163     void CreateTextArrayAndSetToTheListboxL( const TBool& aResetIfExists );
   162     void CreateTextArrayAndSetToTheListboxL( const TBool& aResetIfExists );
   164 
   163 
   165 private:
   164 private:
   166 
   165 
   167     CNcsPopupListBox( CNcsHeaderContainer& aHeaderContainer, TBool aRemoteLookupSupported, 
   166     CNcsPopupListBox( CNcsHeaderContainer& aHeaderContainer,
   168     				  CFSMailBox& aMailbox );
   167         TBool aRemoteLookupSupported, CFSMailBox& aMailbox );
   169 
   168 
   170     virtual void CreateItemDrawerL();
   169     virtual void CreateItemDrawerL();
   171 
   170 
   172     void UpdateListL();
   171     void UpdateListL();
   173     
   172 
       
   173     void UpdateTextColors();
       
   174 
       
   175     // From CCoeControl.
       
   176     void Draw( const TRect& aRect ) const;
       
   177 
   174 private: // data
   178 private: // data
   175 
   179 
   176 	CNcsHeaderContainer&				iHeaderContainer;
   180     CNcsHeaderContainer&				iHeaderContainer;
   177 	
   181 
   178     CAknsBasicBackgroundControlContext* iBaseBackroundContext;
   182     CAknsFrameBackgroundControlContext* iBackgroundContext;
   179    
   183 
   180     RPointerArray<CFSEmailUiClsItem>	iMatchingItems;
   184     RPointerArray<CFSEmailUiClsItem>	iMatchingItems;
   181        
   185 
   182     CFSEmailUiContactHandler*			iContactHandler; // Owned
   186     CFSEmailUiContactHandler*			iContactHandler; // Owned
   183     CFSMailBox& 						iMailBox;
   187     CFSMailBox& 						iMailBox;
   184 
   188 
   185     TRect								iPopupMaxRect;
   189     TRect								iPopupMaxRect;
   186     
   190