inc/NPRStationListBox.h
author John Kern <johnk@symbian.org>
Fri, 24 Jul 2009 06:47:26 -0700
changeset 1 7c64bff801d1
parent 0 0049171ecffb
permissions -rw-r--r--
added new line to header to check hg permissions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
     1
/*
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
     2
 ============================================================================
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
     3
 Name	: NPRStationListBox.h
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
     4
 Author	: Symsource
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
     5
 
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
     6
 Copyright (c) 2009 Symbian Foundation Ltd
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
     7
 This component and the accompanying materials are made available
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
     8
 under the terms of the License "Eclipse Public License v1.0"
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
     9
 which accompanies this distribution, and is available
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    10
 at the URL "http://www.eclipse.org/legal/epl-v10.html".
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    11
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    12
 Initial Contributors:
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    13
 - Symsource
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    14
 
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    15
 Contributors:
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    16
 - Symsource
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    17
 
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    18
 Description : Container for Series60 double style list box to show the NPR's station list
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    19
 ============================================================================
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    20
 */
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    21
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    22
#ifndef __NPR_STATION_LIST_BOX_H__
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    23
#define __NPR_STATION_LIST_BOX_H__
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    24
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    25
#include <coecntrl.h>
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    26
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    27
class MEikCommandObserver;		
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    28
class CAknDoubleStyle2ListBox;
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    29
class CEikTextListBox;
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    30
class CNPRStation;
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    31
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    32
/**
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    33
 * Container class for NPRStationListBox
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    34
 * 
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    35
 * @class	CNPRStationListBox NPRStationListBox.h
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    36
 */
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    37
class CNPRStationListBox : public CCoeControl
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    38
	{
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    39
public: 
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    40
	enum TControls
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    41
		{
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    42
		EListBox,
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    43
		ELastControl
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    44
		};
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    45
	enum TListBoxImages
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    46
		{
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    47
		EListBoxFirstUserImageIndex
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    48
		};
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    49
public:
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    50
	static CNPRStationListBox* NewL(const TRect& aRect, const CCoeControl* aParent, MEikCommandObserver* aCommandObserver);
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    51
	static CNPRStationListBox* NewLC(const TRect& aRect, const CCoeControl* aParent, MEikCommandObserver* aCommandObserver);
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    52
	virtual ~CNPRStationListBox();
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    53
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    54
public:
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    55
	void Listen();
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    56
	// from base class CCoeControl
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    57
	TInt CountComponentControls() const;
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    58
	CCoeControl* ComponentControl(TInt aIndex) const;
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    59
	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    60
	void HandleResourceChange(TInt aType);
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    61
	static void AddListBoxItemL(CEikTextListBox* aListBox, const TDesC& aString);
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    62
	static RArray< TInt >* GetSelectedListBoxItemsLC( CEikTextListBox* aListBox);
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    63
	static void DeleteSelectedListBoxItemsL(CEikTextListBox* aListBox);
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    64
	CAknDoubleStyle2ListBox* ListBox();
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    65
	static void CreateListBoxItemL(TDes& aBuffer, const TDesC& aMainText, const TDesC& aSecondaryText);
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    66
	void AddListBoxResourceArrayItemL(TInt aResourceId);
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    67
	void SetupListBoxIconsL();
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    68
	TBool HandleMarkableListCommandL(TInt aCommand);
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    69
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    70
protected:
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    71
	// from base class CCoeControl
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    72
	void SizeChanged();
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    73
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    74
private:
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    75
	void InitializeControlsL();
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    76
	void LayoutControls();
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    77
	// from base class CCoeControl
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    78
	void Draw( const TRect& aRect ) const;
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    79
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    80
private:
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    81
	// constructors
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    82
	CNPRStationListBox();
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    83
	void ConstructL(const TRect& aRect, const CCoeControl* aParent, MEikCommandObserver* aCommandObserver);
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    84
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    85
private: 
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    86
	CAknDoubleStyle2ListBox* 			iListBox;
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    87
	const RPointerArray<CNPRStation>* 	iStationArray;
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    88
	CCoeControl* 						iFocusControl;
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    89
	MEikCommandObserver* 				iCommandObserver;
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    90
	};
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    91
				
0049171ecffb initial release
tahirm@symbian.org
parents:
diff changeset
    92
#endif // __NPR_STATION_LIST_BOX_H__