|
1 /* |
|
2 =============================================================================================== |
|
3 Name : NPRListBox.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 large style list box to show the NPR's main options |
|
19 =============================================================================================== |
|
20 */ |
|
21 |
|
22 #ifndef NPR_LIST_BOX_H |
|
23 #define NPR_LIST_BOX_H |
|
24 |
|
25 #include <coecntrl.h> |
|
26 #include <akniconutils.h> |
|
27 #include <gulicon.h> |
|
28 |
|
29 class MEikCommandObserver; |
|
30 class CAknSingleLargeStyleListBox; |
|
31 class CEikTextListBox; |
|
32 |
|
33 |
|
34 class CNPRListBox : public CCoeControl |
|
35 { |
|
36 public: |
|
37 enum TControls |
|
38 { |
|
39 EListBox, |
|
40 ELastControl |
|
41 }; |
|
42 enum TListBoxImages |
|
43 { |
|
44 EListBoxNpr_0xeeb0e481Qgn_menu_nprIndex = 0, |
|
45 EListBoxFirstUserImageIndex |
|
46 }; |
|
47 public: |
|
48 static CNPRListBox* NewL(const TRect& aRect, const CCoeControl* aParent, MEikCommandObserver* aCommandObserver ); |
|
49 static CNPRListBox* NewLC(const TRect& aRect, const CCoeControl* aParent, MEikCommandObserver* aCommandObserver ); |
|
50 virtual ~CNPRListBox(); |
|
51 |
|
52 public: |
|
53 void SendNewsQueryL(); |
|
54 // from base class CCoeControl |
|
55 TInt CountComponentControls() const; |
|
56 CCoeControl* ComponentControl(TInt aIndex) const; |
|
57 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
58 void HandleResourceChange(TInt aType); |
|
59 |
|
60 protected: |
|
61 // from base class CCoeControl |
|
62 void SizeChanged(); |
|
63 |
|
64 public: |
|
65 TInt CurrentItemIndex(); |
|
66 static void AddListBoxItemL(CEikTextListBox* aListBox, const TDesC& aString); |
|
67 static RArray< TInt >* GetSelectedListBoxItemsLC(CEikTextListBox* aListBox); |
|
68 static void DeleteSelectedListBoxItemsL(CEikTextListBox* aListBox); |
|
69 CAknSingleLargeStyleListBox* ListBox(); |
|
70 static void CreateListBoxItemL(TDes& aBuffer, TInt aIconIndex, const TDesC& aMainText); |
|
71 void AddListBoxResourceArrayItemL(TInt aResourceId, TInt aIconIndex); |
|
72 void SetupListBoxIconsL(); |
|
73 static CGulIcon* LoadAndScaleIconL(const TDesC& aFileName, TInt aBitmapId, TInt aMaskId, TSize* aSize, TScaleMode aScaleMode ); |
|
74 TBool HandleMarkableListCommandL( TInt aCommand ); |
|
75 |
|
76 private: |
|
77 void InitializeControlsL(); |
|
78 void LayoutControls(); |
|
79 |
|
80 // from base class CCoeControl |
|
81 void Draw(const TRect& aRect) const; |
|
82 |
|
83 private: |
|
84 // constructors |
|
85 CNPRListBox(); |
|
86 void ConstructL(const TRect& aRect, const CCoeControl* aParent, MEikCommandObserver* aCommandObserver); |
|
87 |
|
88 private: |
|
89 CCoeControl* iFocusControl; |
|
90 MEikCommandObserver* iCommandObserver; |
|
91 CAknSingleLargeStyleListBox* iListBox; |
|
92 }; |
|
93 |
|
94 #endif // NPR_LIST_BOX_H |