|
1 /* |
|
2 * Copyright (c) 2005 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 the License "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: A container to browse a feed's topics. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef FEEDS_TOPIC_CONTAINER_H |
|
20 #define FEEDS_TOPIC_CONTAINER_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <coecntrl.h> |
|
25 #include <coemop.h> |
|
26 #include <eiklbo.h> |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // MACROS |
|
31 |
|
32 // DATA TYPES |
|
33 |
|
34 // FUNCTION PROTOTYPES |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class CAknSingleGraphicStyleListBox; |
|
38 class CAknNavigationDecorator; |
|
39 class CItem; |
|
40 class CFeedsEntity; |
|
41 class CFeedsTopicView; |
|
42 class MApiProvider; |
|
43 |
|
44 // CLASS DECLARATION |
|
45 |
|
46 |
|
47 /** |
|
48 * A container to browse a feed's topics. |
|
49 * @lib FeedsEngine.lib |
|
50 * @since 3.0 |
|
51 */ |
|
52 class CFeedsTopicContainer: public CCoeControl, public MEikListBoxObserver |
|
53 { |
|
54 public: |
|
55 /** |
|
56 * Two-phased constructor. |
|
57 */ |
|
58 static CFeedsTopicContainer* NewL( |
|
59 CFeedsTopicView* aView, |
|
60 MApiProvider& aApiProvider, |
|
61 const TRect& aRect); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 virtual ~CFeedsTopicContainer(); |
|
67 |
|
68 |
|
69 public: // From CoeControl |
|
70 /** |
|
71 * Handles key event. |
|
72 * |
|
73 * @param aKeyEvent The key event. |
|
74 * @param aType The type of the event. |
|
75 * @return Indicates whether the key event was used by this control or not |
|
76 */ |
|
77 virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
78 |
|
79 #ifdef __SERIES60_HELP |
|
80 /** |
|
81 * Get help context for the control. |
|
82 * |
|
83 * @since ? |
|
84 * @param aContext The context that is filled in. |
|
85 * @return None. |
|
86 */ |
|
87 void virtual GetHelpContext(TCoeHelpContext& aContext) const; |
|
88 #endif // __SERIES60_HELP |
|
89 |
|
90 |
|
91 protected: // From CoeControl |
|
92 /** |
|
93 * Called by framework when the view size is changed. |
|
94 * |
|
95 * @since ? |
|
96 * @return void. |
|
97 */ |
|
98 virtual void SizeChanged(); |
|
99 |
|
100 /** |
|
101 * Called by the framework when a display resource changes (i.e. skin or layout). |
|
102 * |
|
103 * @since ? |
|
104 * @return void. |
|
105 */ |
|
106 virtual void HandleResourceChange(TInt aType); |
|
107 |
|
108 /** |
|
109 * Returns number of components. |
|
110 * |
|
111 * @since ? |
|
112 * @return Number of component controls. |
|
113 */ |
|
114 virtual TInt CountComponentControls() const; |
|
115 |
|
116 /** |
|
117 * Returns pointer to particular component. |
|
118 * |
|
119 * @since ? |
|
120 * @param aIndex Index whose control's pointer has to returned. |
|
121 * @return Pointer to component control |
|
122 */ |
|
123 virtual CCoeControl* ComponentControl(TInt aIndex) const; |
|
124 |
|
125 |
|
126 public: // MEikListBoxObserver |
|
127 /** |
|
128 * Processes key events from the listbox. |
|
129 * |
|
130 * @since ? |
|
131 * @param aListBox Listbox being observed. |
|
132 * @param aEventType Event observed. |
|
133 * @return void |
|
134 */ |
|
135 virtual void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); |
|
136 |
|
137 |
|
138 public: // New methods. |
|
139 /** |
|
140 * Sets the current feed |
|
141 * |
|
142 * @since 3.0 |
|
143 * @param aFeed The new feed. |
|
144 * @param aIndex The inital items to select. |
|
145 * @return Void |
|
146 */ |
|
147 void SetCurrentFeedL(const CFeedsEntity& aFeed, TInt aIndex); |
|
148 |
|
149 /** |
|
150 * Returns the index of the current item. |
|
151 * |
|
152 * @since 3.0 |
|
153 * @return The index of the current item. |
|
154 */ |
|
155 TInt CurrentIndex() const; |
|
156 |
|
157 /** |
|
158 * Returns the number of items. |
|
159 * |
|
160 * @since 3.0 |
|
161 * @return The the current item. |
|
162 */ |
|
163 TInt ItemCount() const; |
|
164 |
|
165 /** |
|
166 * Update the view's title. |
|
167 * |
|
168 * @since 3.0 |
|
169 * @return void. |
|
170 */ |
|
171 void UpdateTitleL(); |
|
172 |
|
173 /** |
|
174 * Handles selections and open commands |
|
175 * |
|
176 * @since 3.0 |
|
177 * @return void |
|
178 */ |
|
179 void HandleOpenL(void); |
|
180 |
|
181 /** |
|
182 * Handles updating the current Feed. |
|
183 * |
|
184 * @since 3.1 |
|
185 * @return void |
|
186 */ |
|
187 void HandleUpdateFeedL(void); |
|
188 |
|
189 /** |
|
190 * Clears the navigation pane. |
|
191 * |
|
192 * @since 3.1 |
|
193 * @return void |
|
194 */ |
|
195 void ClearNavigationPane(); |
|
196 |
|
197 |
|
198 private: |
|
199 /** |
|
200 * C++ default constructor. |
|
201 */ |
|
202 CFeedsTopicContainer |
|
203 ( CFeedsTopicView* aView, |
|
204 MApiProvider& aApiProvider ); |
|
205 |
|
206 |
|
207 /** |
|
208 * By default Symbian 2nd phase constructor is private. |
|
209 */ |
|
210 void ConstructL(const TRect& aRect); |
|
211 |
|
212 /** |
|
213 * Inits the container. |
|
214 * |
|
215 * @since 3.0 |
|
216 * @param aRect The drawing rect. |
|
217 * @return void |
|
218 */ |
|
219 void InitContainerL(const TRect& aRect); |
|
220 |
|
221 /** |
|
222 * Inits the array of needed icons. |
|
223 * |
|
224 * @since 3.0 |
|
225 * @return void. |
|
226 */ |
|
227 void InitIconArrayL(); |
|
228 |
|
229 /** |
|
230 * Loads and appends an icon to the icon array.. |
|
231 * |
|
232 * @since 3.0 |
|
233 * @param aIcons The icon array. |
|
234 * @param aID Item ID of the masked bitmap to be created. |
|
235 * @param aFilename Filename to be used to construct the item, |
|
236 * if no matching item was found in the currently active skin. |
|
237 * @param aFileBitmapId ID of the bitmap in the file. |
|
238 * Used only if no matching item was found in the currently |
|
239 * active skin. |
|
240 * @param aFileMaskId ID of the mask in the file. |
|
241 * Used only if no matching item was found in the currently |
|
242 * active skin. |
|
243 * @return void. |
|
244 */ |
|
245 void AppendIconL(CArrayPtr<CGulIcon>* aIcons, const TAknsItemID& aID, |
|
246 const TDesC& aFilename, const TInt aFileBitmapId, const TInt aFileMaskId); |
|
247 |
|
248 /** |
|
249 * Sets the list-box's values. |
|
250 * |
|
251 * @since 3.0 |
|
252 * @return void |
|
253 */ |
|
254 void UpdateListBoxL(); |
|
255 |
|
256 /** |
|
257 * Handles the changes needed to the Navigation Pane. |
|
258 * |
|
259 * @since 3.1 |
|
260 * @return void |
|
261 */ |
|
262 void UpdateNavigationPaneL(); |
|
263 |
|
264 public: // Friends |
|
265 friend class CFeedsTopicView; |
|
266 |
|
267 protected: |
|
268 CFeedsTopicView* iView; // not owned |
|
269 MApiProvider& iApiProvider; // not owned |
|
270 CAknSingleGraphicStyleListBox* iListBox; |
|
271 CDesCArraySeg* iListBoxRows; |
|
272 CAknNavigationDecorator* iNaviDecorator; |
|
273 |
|
274 const CFeedsEntity* iFeed; |
|
275 }; |
|
276 |
|
277 #endif // FEEDS_TOPIC_CONTAINER_H |
|
278 |
|
279 // End of File |