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 CIRHistoryListView |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 /* --------------------------------------------------------------------------- |
|
20 * Version history: |
|
21 * Template version: |
|
22 * <ccm_history> |
|
23 * |
|
24 * Ref: |
|
25 * Implemented SongHistory changes for channelwise songs |
|
26 * |
|
27 * </ccm_history> |
|
28 * ============================================================================ |
|
29 */ |
|
30 |
|
31 #ifndef IRHISTORYLISTVIEW_H |
|
32 #define IRHISTORYLISTVIEW_H |
|
33 |
|
34 |
|
35 |
|
36 #include <e32cmn.h> |
|
37 |
|
38 //For Touch Toolbar for find in shop |
|
39 #include <akntoolbarobserver.h> |
|
40 #include <aknbutton.h> |
|
41 #ifdef MUSICSHOP_AVAILABLE |
|
42 #include <MusicStoreUidConstants.h> //For Find in Shop |
|
43 #include <mpxfindinmusicshopcommon.h> //For Find in Shop |
|
44 #endif |
|
45 #include "irbaseview.h" |
|
46 #include "IRHistoryListContainer.h" |
|
47 #include "UINotifyHandler.h" |
|
48 #include "irdialoglauncher.h" |
|
49 #include "IRActiveNetworkObserver.h" |
|
50 |
|
51 class CIRHistoryListContainer; |
|
52 class MSongHistoryUINotifyHandler; |
|
53 class CIRSongHistoryEngine; |
|
54 class CIRDialogLauncher; |
|
55 class MIRActiveNetworkObserver; |
|
56 |
|
57 class CMPXFindInMShop; //For Find in Shop |
|
58 |
|
59 class CIRHistoryListView : public CIRBaseView, |
|
60 public MSongHistoryUINotifyHandler, |
|
61 public MAknToolbarObserver, |
|
62 public MIRActiveNetworkObserver |
|
63 { |
|
64 |
|
65 public: |
|
66 |
|
67 /** |
|
68 * Static constructor NewLC(). |
|
69 */ |
|
70 static CIRHistoryListView* NewLC(); |
|
71 /** |
|
72 * Static constructor NewL(). |
|
73 */ |
|
74 static CIRHistoryListView* NewL(); |
|
75 |
|
76 /** |
|
77 * Destructor. |
|
78 */ |
|
79 ~CIRHistoryListView(); |
|
80 |
|
81 //MSongHistoryUINotifyHandler functions |
|
82 /** |
|
83 * NextSongReceivedL() |
|
84 * Adds the currently playing song to the history's array. |
|
85 */ |
|
86 |
|
87 void NextSongReceivedL( const TDesC& aSongName, const TDesC& sArtistName, |
|
88 const TDesC& aChannelName, const TDesC& aChannelUrl ); |
|
89 |
|
90 /** |
|
91 * ChannelChangedL( ). |
|
92 * Moves the currently playing channel to the top. |
|
93 */ |
|
94 void ChannelChangedL( const TDesC& aSongName, const TDesC& sArtistName, |
|
95 const TDesC& aChannelName, const TDesC& aChannelUrl ); |
|
96 |
|
97 /** |
|
98 * RemoveSongEntry(). |
|
99 * Removes the oldest song from History array. |
|
100 */ |
|
101 TInt RemoveSongEntry( const TDesC& /*aSongName*/, const TDesC& /*aArtistName*/, |
|
102 const TDesC& /*aChannelName*/, const TDesC& /*aChannelUrl*/ ); |
|
103 |
|
104 /** |
|
105 * RemoveChannelEntry(). |
|
106 * Not in use now! |
|
107 */ |
|
108 TInt RemoveChannelEntry( const TDesC& aSongName, const TDesC& aArtistName, |
|
109 const TDesC& aChannelName, const TDesC& aChannelUrl ); |
|
110 |
|
111 /** |
|
112 * NotifyDataChangeToUIError(). |
|
113 * Notification to UI of any error Conditions. |
|
114 */ |
|
115 void NotifyDataChangeToUIError(TInt /*aError*/); |
|
116 |
|
117 /** |
|
118 * ClearSongHistoryItemL(). |
|
119 * Clears the Song History List Array |
|
120 */ |
|
121 void ClearSongHistoryItemL(); |
|
122 |
|
123 /** |
|
124 * GetAllListL(). |
|
125 * Getting the stored List from the History Db. |
|
126 */ |
|
127 void GetAllListL(); |
|
128 |
|
129 /** |
|
130 * Id(). |
|
131 */ |
|
132 TUid Id() const; |
|
133 |
|
134 /** |
|
135 * From CAknView |
|
136 * |
|
137 * @see CAknView::HandleCommandL( TInt aCommand ) |
|
138 */ |
|
139 void HandleCommandL( TInt aCommand ); |
|
140 |
|
141 /** |
|
142 * DynInitMenuPaneL() |
|
143 * For Dynamic Handling of the Menu Pane |
|
144 */ |
|
145 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); |
|
146 |
|
147 /** |
|
148 * HandleMetaDataReceived() |
|
149 * Handling the Metadata Receving |
|
150 */ |
|
151 void HandleMetaDataReceived( const CIRMetaData& aMetaData ); |
|
152 |
|
153 /** |
|
154 * For Touch Toolbar |
|
155 * Handles the Dynamic changes on the toolBar |
|
156 */ |
|
157 void DynInitToolbarL(TInt aResourceId, CAknToolbar* aToolbar ); |
|
158 /** |
|
159 * OfferToolbarEventL() |
|
160 * Handles any event on the Touch ToolBar |
|
161 */ |
|
162 void OfferToolbarEventL( TInt aCommand ); |
|
163 /** |
|
164 * For ConstructToolbarL(); |
|
165 * Constructs the Touch ToolBar |
|
166 */ |
|
167 void ConstructToolbarL(); |
|
168 |
|
169 /** |
|
170 * To Launch Find in Shop Option |
|
171 * LaunchMusicShopL(); |
|
172 */ |
|
173 void LaunchMusicShopL(); |
|
174 |
|
175 /** |
|
176 * To Launch Find in Shop Option |
|
177 * DoFindInMusicShopL() |
|
178 */ |
|
179 void DoFindInMusicShopL( const TDesC& aSongName, |
|
180 const TDesC& aArtistName, |
|
181 const TDesC& aAlbumName ); |
|
182 |
|
183 /** |
|
184 * To Launch Find in Shop Option when selected from the toolbar |
|
185 * FindInShopOption() |
|
186 */ |
|
187 void FindInShopOptionL(); |
|
188 |
|
189 /** |
|
190 * From CAknView |
|
191 * |
|
192 * @see CAknView::HandleForegroundEventL( TBool aForeground ) |
|
193 */ |
|
194 void HandleForegroundEventL( TBool aForeground ); |
|
195 |
|
196 /** |
|
197 * Get the FindInShop Instance is null or not. |
|
198 * GetFindInShopInstance() |
|
199 */ |
|
200 TBool GetFindInShopInstance(); |
|
201 // from base class MIRSystemEventObserver |
|
202 void HandleSystemEventL( TIRSystemEventType aEventType ); |
|
203 |
|
204 /** |
|
205 * Refreshes the view on synchronisation. |
|
206 * RefreshHistoryL() |
|
207 */ |
|
208 void RefreshHistoryL(); |
|
209 |
|
210 /** |
|
211 * Gets the History's engine instance. |
|
212 * HistoryEngineInstance() |
|
213 */ |
|
214 CIRSongHistoryEngine* HistoryEngineInstance() ; |
|
215 |
|
216 protected: |
|
217 |
|
218 |
|
219 /** |
|
220 * From CAknView |
|
221 * |
|
222 * @see CAknView::DoActivateL(const TVwsViewId& aPrevViewId, |
|
223 * TUid aCustomMessageId, |
|
224 * const TDesC8& aCustomMessage) |
|
225 */ |
|
226 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
227 TUid aCustomMessageId, |
|
228 const TDesC8& aCustomMessage ); |
|
229 |
|
230 /** |
|
231 * From CAknView |
|
232 * |
|
233 * @see CAknView::DoDeactivate() |
|
234 */ |
|
235 void DoDeactivate(); |
|
236 |
|
237 /** |
|
238 * From CAknView |
|
239 * |
|
240 * @see CAknView::HandleStatusPaneSizeChange() |
|
241 */ |
|
242 void HandleStatusPaneSizeChange(); |
|
243 |
|
244 |
|
245 private: |
|
246 |
|
247 /** |
|
248 * 2nd phase constructor |
|
249 */ |
|
250 void ConstructL(); |
|
251 |
|
252 /** |
|
253 * C++ default constructor. |
|
254 */ |
|
255 CIRHistoryListView(); |
|
256 |
|
257 |
|
258 public: |
|
259 //from MIRActiveNetworkObserver |
|
260 /** |
|
261 * Notifies all observers whose network request is active |
|
262 * to reissue the request |
|
263 * NotifyActiveNetworkObserversL() |
|
264 */ |
|
265 void NotifyActiveNetworkObserversL(TIRNetworkEvent aEvent); |
|
266 |
|
267 /** |
|
268 * Notifies all observers whose network request is active |
|
269 * to reset the pending request status |
|
270 * ResetPendingRequests() |
|
271 */ |
|
272 void ResetPendingRequests(TBool aValue); |
|
273 |
|
274 |
|
275 private: // Data |
|
276 |
|
277 /** |
|
278 * Container for this view. |
|
279 */ |
|
280 CIRHistoryListContainer* iContainer; |
|
281 |
|
282 /** |
|
283 * View Id of the previous view. |
|
284 */ |
|
285 TVwsViewId iPrevViewId; |
|
286 |
|
287 /** |
|
288 * RPointerArray of CIRSongHistoryInfo |
|
289 */ |
|
290 RPointerArray<CIRSongHistoryInfo> iHistoryDataArr; |
|
291 |
|
292 /** |
|
293 * Pointer to CIRSongHistoryEngine |
|
294 */ |
|
295 CIRSongHistoryEngine* iHistoryEngine; |
|
296 |
|
297 |
|
298 /** |
|
299 * For Find in Music Shop |
|
300 * |
|
301 */ |
|
302 CMPXFindInMShop* iMPXFindInShop; //For Find in Shop |
|
303 |
|
304 /* |
|
305 * iRequestPending |
|
306 * Checks whether an active request is pending |
|
307 */ |
|
308 TBool iRequestPending; |
|
309 /* |
|
310 * iAddToFav |
|
311 * Checks whether request is for adding to favorites |
|
312 */ |
|
313 TBool iAddToFav; |
|
314 |
|
315 /* iListenRequest |
|
316 * Checks whether request is for listen |
|
317 */ |
|
318 TBool iListenRequest; |
|
319 |
|
320 /* |
|
321 * iCallRequestPending |
|
322 * Indicates whether delayed activation of command is required (Call Handling) |
|
323 */ |
|
324 TBool iCallRequestPending; |
|
325 /* |
|
326 * iCommand |
|
327 * Command to be executed (view activation) after Preset downloads |
|
328 */ |
|
329 TInt iCommand; |
|
330 |
|
331 |
|
332 }; |
|
333 |
|
334 #endif // IRHISTORYLISTVIEW_H |
|
335 |
|
336 |
|