author | teknolog |
Mon, 08 Mar 2010 20:07:26 +0000 | |
branch | symbian1 |
changeset 40 | bf37b9711f0a |
parent 32 | 26a3f2dfba08 |
child 36 | e010fc411ddc |
child 49 | 43e204e6ae2e |
child 60 | bbf5c5204844 |
permissions | -rw-r--r-- |
2 | 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 PODCASTSHOWSVIEWH |
|
20 |
#define PODCASTSHOWSVIEWH |
|
21 |
||
22 |
#include <aknview.h> |
|
23 |
#include <aknlists.h> |
|
24 |
#include <eiklbo.h> |
|
25 |
#include <AknToolbarObserver.h> |
|
26 |
#include <AknToolbar.h> |
|
27 |
#include "ShowEngine.h" |
|
28 |
#include "FeedEngine.h" |
|
29 |
#include "PodcastModel.h" |
|
30 |
#include "Podcast.hrh" |
|
31 |
#include "PodcastListView.h" |
|
32 |
#include "Imagehandler.h" |
|
33 |
||
34 |
class CImageHandler; |
|
35 |
||
36 |
class CPodcastShowsView : public CPodcastListView, public MEikListBoxObserver, |
|
37 |
public MFeedEngineObserver, public MShowEngineObserver, public MImageHandlerCallback |
|
38 |
{ |
|
39 |
public: |
|
40 |
static CPodcastShowsView* NewL(CPodcastModel& aPodcastModel); |
|
41 |
static CPodcastShowsView* NewLC(CPodcastModel& aPodcastModel); |
|
42 |
~CPodcastShowsView(); |
|
13 | 43 |
void UpdateToolbar(TBool aVisible=ETrue); |
44 |
||
2 | 45 |
protected: |
46 |
void ConstructL(); |
|
47 |
CPodcastShowsView(CPodcastModel& aPodcastModel); |
|
48 |
||
49 |
/** |
|
50 |
* Returns views id, intended for overriding by sub classes. |
|
51 |
* @return id for this view. |
|
52 |
*/ |
|
53 |
TUid Id() const; |
|
54 |
||
55 |
/** |
|
56 |
* Handles a view activation and passes the message of type |
|
57 |
* @c aCustomMessageId. This function is intended for overriding by |
|
58 |
* sub classes. This function is called by @c AknViewActivatedL(). |
|
59 |
* @param aPrevViewId Specifies the view previously active. |
|
60 |
* @param aCustomMessageId Specifies the message type. |
|
61 |
* @param aCustomMessage The activation message. |
|
62 |
*/ |
|
63 |
void DoActivateL(const TVwsViewId& aPrevViewId, |
|
64 |
TUid aCustomMessageId, |
|
65 |
const TDesC8& aCustomMessage); |
|
66 |
||
67 |
/** |
|
68 |
* View deactivation function intended for overriding by sub classes. |
|
69 |
* This function is called by @c AknViewDeactivated(). |
|
70 |
*/ |
|
71 |
void DoDeactivate(); |
|
72 |
||
73 |
void UpdateListboxItemsL(); |
|
74 |
||
75 |
// From // MEikListBoxObserverClass |
|
76 |
void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); |
|
77 |
// From showengine observer |
|
78 |
void ShowListUpdatedL(); |
|
79 |
void ShowDownloadUpdatedL(TInt aBytesOfCurrentDownload, TInt aBytesTotal); |
|
80 |
void DownloadQueueUpdatedL(TInt aDownloadingShows, TInt aQueuedShows); |
|
81 |
void ShowDownloadFinishedL(TUint aShowUid, TInt aError) ; |
|
82 |
// from MFeedEngineObserver |
|
83 |
void FeedDownloadStartedL(TFeedState aState,TUint aFeedUid); |
|
84 |
void FeedDownloadFinishedL(TFeedState aState,TUint aFeedUid, TInt aError); |
|
85 |
void FeedUpdateAllCompleteL(TFeedState aState); |
|
7 | 86 |
void OpmlParsingComplete(TInt /*aError*/, TUint /*aNumFeedsImported*/) {} |
2 | 87 |
|
88 |
/** |
|
89 |
* Command handling function intended for overriding by sub classes. |
|
90 |
* Default implementation is empty. |
|
91 |
* @param aCommand ID of the command to respond to. |
|
92 |
*/ |
|
93 |
void HandleCommandL(TInt aCommand); |
|
94 |
TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
95 |
||
96 |
void UpdateFeedUpdateStateL(); |
|
97 |
void UpdateShowItemL(TUint aUid, TInt aSizeDownloaded); |
|
98 |
void UpdateShowItemDataL(CShowInfo* aShowInfo,TInt aIndex, TInt aSizeDownloaded = KErrNotFound); |
|
99 |
void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); |
|
100 |
void FormatShowInfoListBoxItemL(CShowInfo& aShowInfo, TInt aSizeDownloaded = 0); |
|
101 |
||
102 |
void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation); |
|
103 |
||
104 |
private: |
|
105 |
void GetShowIcons(CShowInfo* aShowInfo, TInt& aIconIndex); |
|
106 |
void DisplayShowInfoDialogL(); |
|
107 |
/* |
|
108 |
* Called by CImageHandler when an image has been loaded. |
|
109 |
* @param aError Error code given by the CImageHandler or 0 (zero) if the |
|
110 |
* image was loaded successfully. |
|
111 |
*/ |
|
32
26a3f2dfba08
Fix for bug where we always load the feed icon a large number of times
teknolog
parents:
13
diff
changeset
|
112 |
virtual void ImageOperationCompleteL(TInt aError, TUint aHandle); |
5 | 113 |
void HandleSetShowPlayed(TBool aPlayed); |
114 |
void HandleDeleteShow(); |
|
2 | 115 |
void UpdateViewTitleL(); |
116 |
void CreateIconsL(); |
|
117 |
void GetShowErrorText(TDes &aErrorMessage, TInt aErrorCode); |
|
118 |
||
119 |
private: |
|
120 |
||
121 |
CPodcastModel& iPodcastModel; |
|
122 |
TBool iProgressAdded; |
|
123 |
TInt iLastImageHandlerError; |
|
124 |
TBool iSetTitlebarImage; |
|
125 |
}; |
|
126 |
||
127 |
#endif // PODCASTSHOWSVIEWH |
|
128 |
||
129 |