|
1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * Container for main view. |
|
16 * Derived from CMceListContainer. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef MCEMAINVIEWLISTCONTAINER_H |
|
23 #define MCEMAINVIEWLISTCONTAINER_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <coecntrl.h> // CCoeControl |
|
27 #include <msvapi.h> |
|
28 |
|
29 #include "mcetemplate.h" |
|
30 #include "MceUtils.h" |
|
31 #include "MceListItem.h" |
|
32 |
|
33 #include <bldvariant.hrh> |
|
34 |
|
35 class CAknDoubleLargeStyleListBox; |
|
36 class CMceMainViewListItemArray; |
|
37 class CMceBitmapResolver; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * Container for main view. |
|
43 */ |
|
44 class CMceMainViewListContainer : |
|
45 public CCoeControl |
|
46 // public CMceListContainer |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 static CMceMainViewListContainer* NewL( |
|
54 const TRect& aRect, |
|
55 CMsvSessionPtr aSession, |
|
56 CMceBitmapResolver& aBitmapResolver, |
|
57 TMsvId aFolderId, |
|
58 TMceListType aListType = EMceListTypeMainView ); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 virtual ~CMceMainViewListContainer(); |
|
64 |
|
65 /** |
|
66 * From CoeControl |
|
67 */ |
|
68 void GetHelpContext(TCoeHelpContext& aContext) const; |
|
69 |
|
70 /** |
|
71 * Returns pointer to listbox. |
|
72 */ |
|
73 inline CAknDoubleLargeStyleListBox* ListBox() const; |
|
74 |
|
75 /** |
|
76 * Returns item array |
|
77 * @return Pointer to list item array |
|
78 */ |
|
79 inline CMceMainViewListItemArray* ListItems() const; |
|
80 |
|
81 /** |
|
82 * Returns list index of the current item |
|
83 * @return Index of the current item |
|
84 */ |
|
85 TInt CurrentItemIndex() const; |
|
86 |
|
87 /** |
|
88 * Tries to find item from the currently opened list and retuns |
|
89 * list index if found. KErrNotFound if not found. |
|
90 * @param aId: item id to be searched |
|
91 * @return List index of the item. |
|
92 */ |
|
93 TInt ItemIndex( TMsvId aId ) const; |
|
94 |
|
95 /** |
|
96 * Sets MSK label according to a focused item |
|
97 * Since 3.2 |
|
98 */ |
|
99 void SetMskL(); |
|
100 |
|
101 /** |
|
102 * Returns message id of the current (=selected) item |
|
103 * @return message id |
|
104 */ |
|
105 TMsvId CurrentItemId() const; |
|
106 |
|
107 /** |
|
108 * Returns mce's info of the current message |
|
109 * @return info |
|
110 */ |
|
111 TMceListItem CurrentItemListItem() const; |
|
112 |
|
113 /** |
|
114 * From CCoeControl |
|
115 */ |
|
116 TInt CountComponentControls() const; |
|
117 |
|
118 /** |
|
119 * From CCoeControl |
|
120 */ |
|
121 CCoeControl* ComponentControl(TInt aIndex) const; |
|
122 |
|
123 /** |
|
124 * From CCoeControl |
|
125 */ |
|
126 void SizeChanged(); |
|
127 |
|
128 /** |
|
129 * From CCoeControl |
|
130 */ |
|
131 virtual TKeyResponse OfferKeyEventL( |
|
132 const TKeyEvent& aKeyEvent, |
|
133 TEventCode aType ); |
|
134 |
|
135 protected: |
|
136 // From CCoeControl |
|
137 void FocusChanged(TDrawNow aDrawNow); |
|
138 |
|
139 private: |
|
140 /** |
|
141 * Constructor. |
|
142 */ |
|
143 CMceMainViewListContainer(); |
|
144 |
|
145 /** |
|
146 * Symbian OS constructor. |
|
147 */ |
|
148 void ConstructL( |
|
149 const TRect& aRect, |
|
150 CMsvSessionPtr aSession, |
|
151 CMceBitmapResolver& aBitmapResolver ); |
|
152 |
|
153 private: // Data |
|
154 CAknDoubleLargeStyleListBox* iListBox; |
|
155 CMceMainViewListItemArray* iListItems; |
|
156 TInt iCurrMskResource; |
|
157 }; |
|
158 |
|
159 #include "MceMainViewListContainer.inl" |
|
160 |
|
161 #endif |
|
162 |
|
163 // End of file |