|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Base class definitions for AppMng2 list view containers |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_APPMNGR2LISTCONTAINER_H |
|
20 #define C_APPMNGR2LISTCONTAINER_H |
|
21 |
|
22 #include <coecntrl.h> // CCoeControl |
|
23 #include <eiklbo.h> // MEikListBoxObserver |
|
24 |
|
25 class CAppMngr2Model; |
|
26 class CAppMngr2InfoBase; |
|
27 class CAppMngr2ListView; |
|
28 class CAknDoubleLargeStyleListBox; |
|
29 class CTextListBoxModel; |
|
30 class CGulIcon; |
|
31 |
|
32 |
|
33 class CAppMngr2ListContainer : public CCoeControl, public MEikListBoxObserver |
|
34 { |
|
35 public: // constructor and destructor |
|
36 CAppMngr2ListContainer( CAppMngr2ListView& aView ); |
|
37 ~CAppMngr2ListContainer(); |
|
38 |
|
39 public: // from CCoeControl |
|
40 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
41 void HandleResourceChange( TInt aType ); |
|
42 void SizeChanged(); |
|
43 TInt CountComponentControls() const; |
|
44 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
45 |
|
46 public: // from MEikListBoxObserver |
|
47 void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); |
|
48 |
|
49 public: // new functions |
|
50 TBool IsListEmpty() const; |
|
51 void HandleGenericCommandL( TInt aCommand ); |
|
52 void RefreshL( TBool aPreserveSelectedItem, TBool& aSelectedItemChanged, |
|
53 TInt aMoreRefreshesExpected ); |
|
54 virtual CAppMngr2InfoBase& CurrentItem() const = 0; |
|
55 virtual TInt ListEmptyTextResourceId() const = 0; |
|
56 |
|
57 protected: // new functions |
|
58 virtual TInt ItemCount() const = 0; |
|
59 virtual CAppMngr2InfoBase& ItemInfo( TInt aIndex ) = 0; |
|
60 void ConstructL( const TRect& aRect ); |
|
61 CAppMngr2Model& Model() const; |
|
62 |
|
63 private: // new functions |
|
64 void LoadIconsL(); |
|
65 void CreateItemArrayL(); |
|
66 void PopulateItemArrayL(); |
|
67 void DeleteItemSpecificIcons( CArrayPtr<CGulIcon>& aIconArray ); |
|
68 void SetEmptyTextL( TInt aMoreRefreshesExpected ); |
|
69 |
|
70 protected: // data |
|
71 CAppMngr2ListView& iView; |
|
72 CAknDoubleLargeStyleListBox* iListBox; |
|
73 CDesCArrayFlat* iItemArray; |
|
74 TInt iItemSpecificIcons; |
|
75 }; |
|
76 |
|
77 #endif // C_APPMNGR2LISTCONTAINER_H |
|
78 |