|
1 /* |
|
2 * Copyright (c) 2005-2006 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: Header for CIRStationsView |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CIRSTATIONSVIEW_H |
|
20 #define CIRSTATIONSVIEW_H |
|
21 |
|
22 #include "irbaseview.h" |
|
23 #include <akntoolbarobserver.h> |
|
24 #include <aknbutton.h> |
|
25 #include "MViewsResponseAndErrorObserver.h" |
|
26 #include "MLogoDownloadObserver.h" |
|
27 |
|
28 class CIRStationsViewContainer; |
|
29 class MLogoDownloadObserver; |
|
30 class MIRActiveNetworkObserver; |
|
31 |
|
32 /** |
|
33 * SearchResults View |
|
34 */ |
|
35 class CIRStationsView : public CIRBaseView, |
|
36 public MAknToolbarObserver, |
|
37 public MViewsResponseAndErrorObserver, |
|
38 public MLogoDownloadObserver, |
|
39 public MIRActiveNetworkObserver |
|
40 { |
|
41 |
|
42 public: //Methods |
|
43 |
|
44 /** |
|
45 * NewL() |
|
46 * Static constructor. |
|
47 */ |
|
48 static CIRStationsView* NewL(); |
|
49 /** |
|
50 * NewLC() |
|
51 * Static constructor. |
|
52 */ |
|
53 static CIRStationsView* NewLC(); |
|
54 |
|
55 /** |
|
56 *~CIRStationsView() |
|
57 * Destructor. |
|
58 */ |
|
59 ~CIRStationsView(); |
|
60 |
|
61 // from base class CAknView |
|
62 /** |
|
63 * From CAknView |
|
64 * |
|
65 * @see CAknView::Id() const |
|
66 */ |
|
67 TUid Id() const; |
|
68 |
|
69 /** |
|
70 * From CAknView |
|
71 * |
|
72 * @see CAknView::HandleCommandL( TInt aCommand ) |
|
73 */ |
|
74 void HandleCommandL( TInt aCommand ); |
|
75 |
|
76 /** |
|
77 * void SetStatusPaneTextL() |
|
78 * Sets the title pane of the search results view |
|
79 */ |
|
80 void SetStatusPaneTextL() const; |
|
81 |
|
82 /** |
|
83 * DynInitMenuPaneL |
|
84 * Dynamically initialises a menu pane |
|
85 */ |
|
86 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); |
|
87 |
|
88 /** |
|
89 * ListenChannelL() |
|
90 * Issues a listen request |
|
91 */ |
|
92 virtual void ListenChannelL(TInt aCurrentIndex); |
|
93 |
|
94 void OfferToolbarEventL(TInt aCommand ); |
|
95 |
|
96 /** |
|
97 * ConstructToolbarL() |
|
98 * Constructs a touch toolbar |
|
99 */ |
|
100 virtual void ConstructToolbarL(); |
|
101 |
|
102 |
|
103 /** |
|
104 * From CAknView |
|
105 * |
|
106 * @see CAknView::HandleForegroundEventL( TBool aForeground ) |
|
107 */ |
|
108 void HandleForegroundEventL( TBool aForeground ); |
|
109 |
|
110 /** |
|
111 * From CAknView |
|
112 */ |
|
113 void HandleStatusPaneSizeChange(); |
|
114 |
|
115 |
|
116 /** |
|
117 * void CIRCategoryView::ResponseL() |
|
118 * Activates the Stations view after getting the IsdsResponse |
|
119 */ |
|
120 void ResponseL( CIRIsdsPreset* aPreset = NULL ); |
|
121 |
|
122 /** |
|
123 * ErrorL() |
|
124 * Handles the errors from Isds |
|
125 */ |
|
126 void ErrorL(); |
|
127 |
|
128 /** |
|
129 * PresetResponseL |
|
130 * Issues a listen request |
|
131 */ |
|
132 void PresetResponseL(CIRIsdsPreset* aPreset); |
|
133 |
|
134 /** |
|
135 * AddToFavouritesL() |
|
136 * Issues a request for adding to favourites |
|
137 */ |
|
138 virtual void AddToFavouritesL(TInt aCurrentIndex,TInt aCommand); |
|
139 |
|
140 /** |
|
141 * DisplayStationInformationL() |
|
142 * Issues a request for Station Info view |
|
143 */ |
|
144 virtual void DisplayStationInformationL(TInt aCurrentIndex,TInt aCommand); |
|
145 |
|
146 /** |
|
147 * PresetLogoDownloadedL() |
|
148 * CallBack Function Returning the Preset With Logo |
|
149 */ |
|
150 void PresetLogoDownloadedL(CIRIsdsPreset* aPreset); |
|
151 |
|
152 /** |
|
153 * PresetLogoDownloadError() |
|
154 * CallBack Function Returning the Preset With no Logo/error while downloading logo |
|
155 */ |
|
156 void PresetLogoDownloadError(CIRIsdsPreset* aPreset); |
|
157 |
|
158 /** |
|
159 * LogoRequestL() |
|
160 * Called by the container of this view |
|
161 */ |
|
162 void LogoRequestL(); |
|
163 /** |
|
164 * LogoRequestL() |
|
165 * Called by the container of this view |
|
166 */ |
|
167 void AdRequestL(); |
|
168 |
|
169 |
|
170 /** |
|
171 * GetFilteredIndex() |
|
172 * Returns the filtered Index |
|
173 */ |
|
174 virtual TInt GetFilteredIndex(); |
|
175 |
|
176 /** |
|
177 * SetLoadingCancelled |
|
178 * Sets iLoadingCancelled to aValue |
|
179 */ |
|
180 void SetLoadingCancelled(TBool aValue); |
|
181 |
|
182 /** |
|
183 * SetActualFilteredItemIndex() |
|
184 * sets the original index of the filtered item |
|
185 */ |
|
186 void SetActualFilteredItemIndex(TInt aIndex); |
|
187 |
|
188 /** |
|
189 * GetActualFilteredItemIndex |
|
190 * Gets the actual index of the station |
|
191 */ |
|
192 TInt GetActualFilteredItemIndex(); |
|
193 /* |
|
194 * GetStationsViewActualIndex() |
|
195 * returns the actual index |
|
196 */ |
|
197 TInt GetStationsViewActualIndex(); |
|
198 /* |
|
199 * GetFirstLaunchFlag() |
|
200 * returns the whether the view is launching for the first time/ |
|
201 * coming back from that has been activated from this view |
|
202 */ |
|
203 virtual TBool GetFirstLaunchFlag() ; |
|
204 /* |
|
205 * SetToolbarItems |
|
206 * Sets the touch tool bar items |
|
207 */ |
|
208 virtual void SetToolbarItems(); |
|
209 |
|
210 // from base class MIRSystemEventObserver |
|
211 void HandleSystemEventL( TIRSystemEventType aEventType ); |
|
212 |
|
213 //from MIRActiveNetworkObserver |
|
214 /** |
|
215 * Notifies all observers whose network request is active |
|
216 * to reissue the request |
|
217 * NotifyActiveNetworkObserversL() |
|
218 */ |
|
219 virtual void NotifyActiveNetworkObserversL(TIRNetworkEvent aEvent); |
|
220 |
|
221 /** |
|
222 * Notifies all observers whose network request is active |
|
223 * to reset the pending request status |
|
224 * ResetPendingRequests() |
|
225 */ |
|
226 void ResetPendingRequests(TBool aValue); |
|
227 protected: //Methods |
|
228 |
|
229 // from base class CAknView |
|
230 /** |
|
231 * From CAknView |
|
232 * |
|
233 * @see CAknView::DoActivateL(const TVwsViewId& aPrevViewId, |
|
234 * TUid aCustomMessageId, |
|
235 * const TDesC8& aCustomMessage) |
|
236 */ |
|
237 void DoActivateL( const TVwsViewId& aPrevViewId,TUid aCustomMessageId, |
|
238 const TDesC8& aCustomMessage ); |
|
239 |
|
240 /** |
|
241 * From CAknView |
|
242 * |
|
243 * @see CAknView::DoDeactivate() |
|
244 */ |
|
245 void DoDeactivate(); |
|
246 |
|
247 |
|
248 public: //Methods |
|
249 |
|
250 /** |
|
251 * ConstructL() |
|
252 * 2nd phase constructor |
|
253 */ |
|
254 void ConstructL(); |
|
255 |
|
256 /** |
|
257 * CIRStationsView() |
|
258 * C++ default constructor. |
|
259 */ |
|
260 CIRStationsView(); |
|
261 |
|
262 private: |
|
263 |
|
264 /* |
|
265 * iLoadingCancelled |
|
266 * Data whether loading has been cancelled |
|
267 */ |
|
268 TBool iLoadingCancelled; |
|
269 |
|
270 /* |
|
271 * iRequestPending |
|
272 * Checks whether an active request is pending |
|
273 */ |
|
274 TBool iRequestPending; |
|
275 |
|
276 /* iListenRequest |
|
277 * Checks whether request is for listen |
|
278 */ |
|
279 TBool iListenRequest; |
|
280 |
|
281 /* |
|
282 * iCallRequestPending |
|
283 * Indicates whether delayed activation of command is required (Call Handling) |
|
284 */ |
|
285 TBool iCallRequestPending; |
|
286 TBool iToolbarVisible; |
|
287 TBool iCommandState; |
|
288 |
|
289 TInt iIndex; |
|
290 TInt iFilteredIndex; |
|
291 |
|
292 /* |
|
293 * iCommand |
|
294 * Command to be executed (view activation) after Preset downloads |
|
295 */ |
|
296 TInt iCommand; |
|
297 |
|
298 TBool iFirstTimeLaunchFlag; |
|
299 |
|
300 /** |
|
301 * iAddToFav |
|
302 * Boolean value to determine if AddToFavorites was issued. |
|
303 */ |
|
304 TBool iAddToFav; |
|
305 |
|
306 |
|
307 /** |
|
308 * iStationDetails |
|
309 * Boolean value to determine if StationDetails request was issued. |
|
310 */ |
|
311 TBool iStationDetails; |
|
312 |
|
313 public: |
|
314 /** |
|
315 * iContainer |
|
316 * Container for this view. |
|
317 */ |
|
318 CIRStationsViewContainer* iContainer; |
|
319 |
|
320 |
|
321 |
|
322 /** |
|
323 * iResultsReqMade |
|
324 * boolean value to know whether the results(topstations/list of channels) |
|
325 * request has made to isds or not |
|
326 */ |
|
327 TBool iResultsReqMade; |
|
328 }; |
|
329 |
|
330 #endif // CIRSTATIONSVIEW_H |
|
331 |
|
332 |