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