inc/NPRSearchStationListBox.h
changeset 0 0049171ecffb
equal deleted inserted replaced
-1:000000000000 0:0049171ecffb
       
     1 /*
       
     2  ===================================================================================================
       
     3  Name	: NPRSearchStationListBox.h
       
     4  Author	: Symsource
       
     5  
       
     6  Copyright (c) 2009 Symbian Foundation Ltd
       
     7  This component and the accompanying materials are made available
       
     8  under the terms of the License "Eclipse Public License v1.0"
       
     9  which accompanies this distribution, and is available
       
    10  at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    11 
       
    12  Initial Contributors:
       
    13  - Symsource
       
    14  
       
    15  Contributors:
       
    16  - Symsource
       
    17  
       
    18  Description : Container for Series60 single style list box to show the NPR's station search options
       
    19  ===================================================================================================
       
    20  */
       
    21 
       
    22 #ifndef __NPR_SEARCH_STATION_LISTBOX_H__
       
    23 #define __NPR_SEARCH_STATION_LISTBOX_H__
       
    24 
       
    25 #include <coecntrl.h>		
       
    26 class MEikCommandObserver;		
       
    27 class CAknSingleLargeStyleListBox;
       
    28 class CEikTextListBox;
       
    29 
       
    30 _LIT(KNPRZipQuery, "zip=%S");
       
    31 _LIT(KNPRCurrentLocationZip, "94102");//San Francisco ZIP codes
       
    32 
       
    33 
       
    34 /**
       
    35  * Container class for NPRSearchStationListBox
       
    36  * 
       
    37  * @class	CNPRSearchStationListBox NPRSearchStationListBox.h
       
    38  */
       
    39 class CNPRSearchStationListBox : public CCoeControl
       
    40 	{
       
    41 public: 
       
    42 	enum TControls
       
    43 		{
       
    44 		EListBox,
       
    45 		ELastControl
       
    46 		};
       
    47 	
       
    48 	enum TListBoxImages
       
    49 		{
       
    50 		EListBoxFirstUserImageIndex
       
    51 		};
       
    52 public:
       
    53 	static CNPRSearchStationListBox* NewL(const TRect& aRect, const CCoeControl* aParent, MEikCommandObserver* aCommandObserver);
       
    54 	static CNPRSearchStationListBox* NewLC(const TRect& aRect, const CCoeControl* aParent, MEikCommandObserver* aCommandObserver);
       
    55 	virtual ~CNPRSearchStationListBox();
       
    56 
       
    57 public:
       
    58 	TInt CurrentItemIndex();
       
    59 	void SendStationQueryL();
       
    60 	
       
    61 	// from base class CCoeControl
       
    62 	TInt CountComponentControls() const;
       
    63 	CCoeControl* ComponentControl(TInt aIndex) const;
       
    64 	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
       
    65 	void HandleResourceChange(TInt aType);
       
    66 
       
    67 	static void AddListBoxItemL(CEikTextListBox* aListBox, const TDesC& aString);
       
    68 	static RArray< TInt >* GetSelectedListBoxItemsLC(CEikTextListBox* aListBox);
       
    69 	static void DeleteSelectedListBoxItemsL(CEikTextListBox* aListBox);
       
    70 	CAknSingleStyleListBox* ListBox();
       
    71 	static void CreateListBoxItemL(TDes& aBuffer, TInt aIconIndex, const TDesC& aMainText);
       
    72 	void AddListBoxResourceArrayItemL(TInt aResourceId, TInt aIconIndex);
       
    73 	void SetupListBoxIconsL();
       
    74 	TBool HandleMarkableListCommandL(TInt aCommand);
       
    75 	
       
    76 protected:
       
    77 	// from base class CCoeControl
       
    78 	void SizeChanged();
       
    79 
       
    80 private:
       
    81 	// from base class CCoeControl
       
    82 	void Draw(const TRect& aRect) const;
       
    83 
       
    84 private:
       
    85 	void InitializeControlsL();
       
    86 	void LayoutControls();
       
    87 	
       
    88 private:
       
    89 	// constructors
       
    90 	CNPRSearchStationListBox();
       
    91 	void ConstructL(const TRect& aRect, const CCoeControl* aParent, MEikCommandObserver* aCommandObserver);
       
    92 
       
    93 private: 
       
    94 	CAknSingleStyleListBox* iListBox;
       
    95 	CCoeControl* iFocusControl;
       
    96 	MEikCommandObserver* iCommandObserver;
       
    97 	};
       
    98 				
       
    99 #endif // __NPR_SEARCH_STATION_LISTBOX_H__