application/inc/PodcastQueueView.h
changeset 2 29cda98b007e
child 4 be243543a361
equal deleted inserted replaced
1:5f8e5adbbed9 2:29cda98b007e
       
     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 PODCASTQUEUEVIEWH
       
    20 #define PODCASTQUEUEVIEWH 
       
    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 
       
    33 class CPodcastQueueView : public CPodcastListView, public MEikListBoxObserver, 
       
    34 	public MFeedEngineObserver, public MShowEngineObserver
       
    35 	{
       
    36 public: 
       
    37 	static CPodcastQueueView* NewL(CPodcastModel& aPodcastModel);
       
    38 	static CPodcastQueueView* NewLC(CPodcastModel& aPodcastModel);
       
    39 	~CPodcastQueueView();
       
    40 protected:
       
    41 	void ConstructL();
       
    42 	CPodcastQueueView(CPodcastModel& aPodcastModel);
       
    43 
       
    44 	/**
       
    45 	 * Returns views id, intended for overriding by sub classes.
       
    46 	 * @return id for this view.
       
    47 	 */
       
    48 	TUid Id() const;
       
    49 
       
    50 	/** 
       
    51 	 * Handles a view activation and passes the message of type 
       
    52 	 * @c aCustomMessageId. This function is intended for overriding by 
       
    53 	 * sub classes. This function is called by @c AknViewActivatedL().
       
    54 	 * @param aPrevViewId Specifies the view previously active.
       
    55 	 * @param aCustomMessageId Specifies the message type.
       
    56 	 * @param aCustomMessage The activation message.
       
    57 	 */
       
    58 	void DoActivateL(const TVwsViewId& aPrevViewId,
       
    59 			TUid aCustomMessageId,
       
    60 			const TDesC8& aCustomMessage);
       
    61 
       
    62 	/** 
       
    63 	 * View deactivation function intended for overriding by sub classes. 
       
    64 	 * This function is called by @c AknViewDeactivated().
       
    65 	 */
       
    66 	void DoDeactivate();
       
    67 
       
    68 	void UpdateListboxItemsL();
       
    69 
       
    70 	// From // MEikListBoxObserverClass
       
    71 	void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
    72 	// From showengine observer
       
    73 	void ShowListUpdatedL();  	
       
    74 	void ShowDownloadUpdatedL(TInt aBytesOfCurrentDownload, TInt aBytesTotal);	
       
    75 	void DownloadQueueUpdatedL(TInt aDownloadingShows, TInt aQueuedShows);
       
    76 	void ShowDownloadFinishedL(TUint aShowUid, TInt aError) ;
       
    77 	// from MFeedEngineObserver
       
    78 	void FeedDownloadStartedL(TFeedState aState,TUint aFeedUid);
       
    79 	void FeedDownloadFinishedL(TFeedState aState,TUint aFeedUid, 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 	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
    90 
       
    91 	void UpdateFeedUpdateStateL();
       
    92 	void UpdateShowItemL(TUint aUid, TInt aSizeDownloaded);
       
    93 	void UpdateShowItemDataL(CShowInfo* aShowInfo,TInt aIndex, TInt aSizeDownloaded = KErrNotFound);
       
    94 	void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
       
    95 	void FormatShowInfoListBoxItemL(CShowInfo& aShowInfo, TInt aSizeDownloaded = 0);
       
    96 
       
    97 	void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation);
       
    98 
       
    99 private:
       
   100 	void GetShowIcons(CShowInfo* aShowInfo, TInt& aIconIndex);
       
   101 	void UpdateToolbar();
       
   102 
       
   103 	
       
   104 private:
       
   105 	
       
   106 	CPodcastModel& iPodcastModel;
       
   107 	TBool iProgressAdded;	
       
   108 	TInt iLastImageHandlerError;
       
   109 	TBool iSetTitlebarImage;
       
   110 	};
       
   111 
       
   112 #endif // PODCASTSHOWSVIEWH
       
   113 
       
   114