inc/NPRStationListBox.h
changeset 0 0049171ecffb
equal deleted inserted replaced
-1:000000000000 0:0049171ecffb
       
     1 /*
       
     2  ============================================================================
       
     3  Name	: NPRStationListBox.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 double style list box to show the NPR's station list
       
    19  ============================================================================
       
    20  */
       
    21 
       
    22 #ifndef __NPR_STATION_LIST_BOX_H__
       
    23 #define __NPR_STATION_LIST_BOX_H__
       
    24 
       
    25 #include <coecntrl.h>
       
    26 
       
    27 class MEikCommandObserver;		
       
    28 class CAknDoubleStyle2ListBox;
       
    29 class CEikTextListBox;
       
    30 class CNPRStation;
       
    31 
       
    32 /**
       
    33  * Container class for NPRStationListBox
       
    34  * 
       
    35  * @class	CNPRStationListBox NPRStationListBox.h
       
    36  */
       
    37 class CNPRStationListBox : public CCoeControl
       
    38 	{
       
    39 public: 
       
    40 	enum TControls
       
    41 		{
       
    42 		EListBox,
       
    43 		ELastControl
       
    44 		};
       
    45 	enum TListBoxImages
       
    46 		{
       
    47 		EListBoxFirstUserImageIndex
       
    48 		};
       
    49 public:
       
    50 	static CNPRStationListBox* NewL(const TRect& aRect, const CCoeControl* aParent, MEikCommandObserver* aCommandObserver);
       
    51 	static CNPRStationListBox* NewLC(const TRect& aRect, const CCoeControl* aParent, MEikCommandObserver* aCommandObserver);
       
    52 	virtual ~CNPRStationListBox();
       
    53 
       
    54 public:
       
    55 	void Listen();
       
    56 	// from base class CCoeControl
       
    57 	TInt CountComponentControls() const;
       
    58 	CCoeControl* ComponentControl(TInt aIndex) const;
       
    59 	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
       
    60 	void HandleResourceChange(TInt aType);
       
    61 	static void AddListBoxItemL(CEikTextListBox* aListBox, const TDesC& aString);
       
    62 	static RArray< TInt >* GetSelectedListBoxItemsLC( CEikTextListBox* aListBox);
       
    63 	static void DeleteSelectedListBoxItemsL(CEikTextListBox* aListBox);
       
    64 	CAknDoubleStyle2ListBox* ListBox();
       
    65 	static void CreateListBoxItemL(TDes& aBuffer, const TDesC& aMainText, const TDesC& aSecondaryText);
       
    66 	void AddListBoxResourceArrayItemL(TInt aResourceId);
       
    67 	void SetupListBoxIconsL();
       
    68 	TBool HandleMarkableListCommandL(TInt aCommand);
       
    69 
       
    70 protected:
       
    71 	// from base class CCoeControl
       
    72 	void SizeChanged();
       
    73 
       
    74 private:
       
    75 	void InitializeControlsL();
       
    76 	void LayoutControls();
       
    77 	// from base class CCoeControl
       
    78 	void Draw( const TRect& aRect ) const;
       
    79 
       
    80 private:
       
    81 	// constructors
       
    82 	CNPRStationListBox();
       
    83 	void ConstructL(const TRect& aRect, const CCoeControl* aParent, MEikCommandObserver* aCommandObserver);
       
    84 
       
    85 private: 
       
    86 	CAknDoubleStyle2ListBox* 			iListBox;
       
    87 	const RPointerArray<CNPRStation>* 	iStationArray;
       
    88 	CCoeControl* 						iFocusControl;
       
    89 	MEikCommandObserver* 				iCommandObserver;
       
    90 	};
       
    91 				
       
    92 #endif // __NPR_STATION_LIST_BOX_H__