|
1 /* |
|
2 * Copyright (c) 2007-2010 Sebastian Brannstrom, Lars Persson, EmbedDev AB |
|
3 * |
|
4 * All rights reserved. |
|
5 * This component and the accompanying materials are made available |
|
6 * under the terms of the License "Eclipse Public License v1.0" |
|
7 * which accompanies this distribution, and is available |
|
8 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 * |
|
10 * Initial Contributors: |
|
11 * EmbedDev AB - initial contribution. |
|
12 * |
|
13 * Contributors: |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef PODCASTFEEDVIEWH |
|
20 #define PODCASTFEEDVIEWH |
|
21 |
|
22 #include "FeedEngine.h" |
|
23 #include "PodcastListView.h" |
|
24 #include "ImageHandler.h" |
|
25 |
|
26 class CPodcastFeedViewUpdater; |
|
27 |
|
28 enum TOpmlState { |
|
29 EOpmlIdle, |
|
30 EOpmlImporting, |
|
31 EOpmlSearching |
|
32 }; |
|
33 |
|
34 class CPodcastFeedView : public CPodcastListView, public MEikListBoxObserver, |
|
35 public MFeedEngineObserver, public MImageHandlerCallback |
|
36 { |
|
37 public: |
|
38 static CPodcastFeedView* NewL(CPodcastModel& aPodcastModel); |
|
39 static CPodcastFeedView* NewLC(CPodcastModel& aPodcastModel); |
|
40 ~CPodcastFeedView(); |
|
41 void UpdateItemL(TInt aIndex); |
|
42 void CheckResumeDownload(); |
|
43 |
|
44 protected: |
|
45 void ConstructL(); |
|
46 CPodcastFeedView(CPodcastModel& aPodcastModel); |
|
47 |
|
48 /** |
|
49 * Returns views id, intended for overriding by sub classes. |
|
50 * @return id for this view. |
|
51 */ |
|
52 TUid Id() const; |
|
53 |
|
54 /** |
|
55 * Handles a view activation and passes the message of type |
|
56 * @c aCustomMessageId. This function is intended for overriding by |
|
57 * sub classes. This function is called by @c AknViewActivatedL(). |
|
58 * @param aPrevViewId Specifies the view previously active. |
|
59 * @param aCustomMessageId Specifies the message type. |
|
60 * @param aCustomMessage The activation message. |
|
61 */ |
|
62 void DoActivateL(const TVwsViewId& aPrevViewId, |
|
63 TUid aCustomMessageId, |
|
64 const TDesC8& aCustomMessage); |
|
65 |
|
66 /** |
|
67 * View deactivation function intended for overriding by sub classes. |
|
68 * This function is called by @c AknViewDeactivated(). |
|
69 */ |
|
70 void DoDeactivate(); |
|
71 |
|
72 |
|
73 // From // MEikListBoxObserverClass |
|
74 void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); |
|
75 void UpdateListboxItemsL(); |
|
76 |
|
77 // from MFeedEngineObserver |
|
78 void FeedDownloadStartedL(TFeedState aState,TUint aFeedUid); |
|
79 void FeedDownloadFinishedL(TFeedState aState,TUint aFeeidUid, TInt aError); |
|
80 void FeedUpdateAllCompleteL(TFeedState aState); |
|
81 void OpmlParsingComplete(TUint aNumFeedsImported); |
|
82 |
|
83 /** |
|
84 * Command handling function intended for overriding by sub classes. |
|
85 * Default implementation is empty. |
|
86 * @param aCommand ID of the command to respond to. |
|
87 */ |
|
88 void HandleCommandL(TInt aCommand); |
|
89 void FeedInfoUpdatedL(TUint aFeedUid); |
|
90 void UpdateFeedInfoDataL(CFeedInfo* aFeedInfo, TInt aIndex, TBool aIsUpdating = EFalse); |
|
91 void UpdateFeedInfoStatusL(TUint aFeedUid, TBool aIsUpdating = EFalse); |
|
92 |
|
93 void UpdateToolbar(); |
|
94 // from MProgressDialogCallback |
|
95 void DialogDismissedL(TInt aButtonId); |
|
96 |
|
97 // from MImageHandlerCallback |
|
98 void ImageOperationCompleteL(TInt aError); |
|
99 private: |
|
100 void FormatFeedInfoListBoxItemL(CFeedInfo& aFeedInfo, TBool aIsUpdating = EFalse); |
|
101 void HandleAddFeedL(); |
|
102 void HandleEditFeedL(); |
|
103 void HandleRemoveFeedL(); |
|
104 void HandleImportFeedsL(); |
|
105 void HandleExportFeedsL(); |
|
106 void HandleUpdateFeedL(); |
|
107 |
|
108 private: |
|
109 CPodcastModel& iPodcastModel; |
|
110 TBool iUpdatingAllRunning; |
|
111 HBufC* iFeedsFormat; |
|
112 HBufC* iNeverUpdated; |
|
113 CPodcastFeedViewUpdater* iUpdater; |
|
114 TBool iFirstActivateAfterLaunch; |
|
115 TOpmlState iOpmlState; |
|
116 }; |
|
117 |
|
118 #endif // PODCASTFEEDVIEWH |