CDownloadMgrUiDownloadsList.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : CDownloadMgrUiDownloadsList.h
00004 *  Part of     : Download Manager / UI Lib
00005 *  Interface   : UI Lib, Downloads List
00006 *  Description : Supports Download Menu and Downloads List
00007 *  Version     : -
00008 *
00009 *  Copyright © 2002-2004 Nokia. All rights reserved.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia. All rights are reserved. Copying, including 
00013 *  reproducing, storing, adapting or translating, any 
00014 *  or all of this material requires the prior written consent of 
00015 *  Nokia. This material also contains confidential 
00016 *  information which may not be disclosed to others without the 
00017 *  prior written consent of Nokia.
00018 * ==============================================================================
00019 */
00020 
00021 
00022 #ifndef CDOWNLOADMGRUIDOWNLOADSLIST_H
00023 #define CDOWNLOADMGRUIDOWNLOADSLIST_H
00024 
00025 //  INCLUDES
00026 #include <CDownloadMgrUiBase.h>
00027 #include <DownloadMgrClient.h>
00028 #include <HttpDownloadMgrCommon.h>
00029 #include <DownloadsListDlgObserver.h>
00030 
00031 #include <AiwServiceHandler.h>
00032 #include <AiwCommon.hrh>
00033 
00034 // FORWARD DECLARATIONS
00035 class CDownloadMgrUiDownloadMenu;
00036 class CDownloadMgrUiUserInteractions;
00037 class CDownloadsListArray;
00038 class CDownloadsListDlg;
00039 class CUserInteractionsUtils;
00040 class CDownloadMgrUiLibRegistry;
00041 class CAsyncEventHandlerArray;
00042 class CAsyncEventHandlerBase;
00043 class CDownloadsListExtension;
00044 
00045 // CLASS DECLARATION
00046 
00053 NONSHARABLE_CLASS( CDownloadMgrUiDownloadsList ) : 
00054                                                 public CDownloadMgrUiBase, 
00055                                                 public MHttpDownloadMgrObserver,
00056                                                 public MDownloadsListDlgObserver,
00057                                                 public MAiwNotifyCallback 
00058     {
00059     public:  // Constructors and destructor
00060         
00064         static CDownloadMgrUiDownloadsList* NewL
00065                ( CDownloadMgrUiLibRegistry& aRegistryModel );
00066         
00070         virtual ~CDownloadMgrUiDownloadsList();
00071 
00072     public: // New functions
00073 
00074         // -------------------------------------------------------------
00075         // ************** Download Menu
00076         // -------------------------------------------------------------
00077 
00083         IMPORT_C CDownloadMgrUiDownloadMenu& DownloadMenu() const;
00084 
00085         // -------------------------------------------------------------
00086         // ************** Downloads List
00087         // -------------------------------------------------------------
00088 
00097         IMPORT_C void DisplayDownloadsListL();
00098 
00109         void DisplayDownloadsListL( RHttpDownload& aHighlightDl );
00110 
00116         IMPORT_C void CancelDisplayingDownloadsList();
00117 
00123         IMPORT_C TBool IsVisible() const;
00124 
00130         IMPORT_C TInt Count() const;
00131 
00135         void DeleteDownloadL( RHttpDownload& aDownload );
00136 
00142         TBool IsOneProgressive();
00143         
00149         inline TBool IsProgressiveDownloadEnabled() {return iProgressiveDownload; }
00150         
00151 
00152     public: // Functions from CDownloadMgrUiBase
00153 
00154         IMPORT_C virtual void GetIntAttributeL( const TUint aAttribute, TInt32& aValue );
00155         IMPORT_C virtual void GetBoolAttributeL( const TUint aAttribute, TBool& aValue );
00156         IMPORT_C virtual void GetStringAttributeL( const TUint aAttribute, TDes16& aValue  );
00157         IMPORT_C virtual void GetStringAttributeL( const TUint aAttribute, TDes8& aValue  );
00158         IMPORT_C virtual void SetIntAttributeL( const TUint aAttribute, TInt32 aValue );
00159         IMPORT_C virtual void SetBoolAttributeL( const TUint aAttribute, TBool aValue );
00160         IMPORT_C virtual void SetStringAttributeL( const TUint aAttribute, const TDesC16& aValue );
00161         IMPORT_C virtual void SetStringAttributeL( const TUint aAttribute, const TDesC8& aValue );
00162 
00163     protected: // Constructors
00164 
00168         CDownloadMgrUiDownloadsList( CDownloadMgrUiLibRegistry& aRegistryModel );
00169 
00173         void ConstructL();
00174 
00175     protected: // New functions
00176 
00177         // -------------------------------------------------------------
00178         // ************** List box utilities
00179         // -------------------------------------------------------------
00180 
00185         void AddDownloadsToListModelL( CDownloadsListArray& aLBModel, 
00186                                        RHttpDownloadMgr& aDownloadMgr );
00187 
00195         TInt AddDownloadToListModelL( CDownloadsListArray& aLBModel, 
00196                                       RHttpDownload& aDownload );
00197 
00198         // -------------------------------------------------------------
00199         // ************** Responses to download events
00200         // -------------------------------------------------------------
00201 
00202         void NewDownloadCreatedL( RHttpDownload& aDownload );
00203         void UpdateProgressInfoL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
00204         void DownloadPausedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
00205         void DownloadCompletedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
00206         void DownloadFailedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
00207         void PauseableStateChangedL( RHttpDownload& aDownload, TBool aPausable );
00208 
00209         // -------------------------------------------------------------
00210         // ************** Other utility
00211         // -------------------------------------------------------------
00212 
00213         void HideMenu();
00214 
00215     protected: // Functions from MHttpDownloadMgrObserver
00216 
00217         virtual void HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
00218 
00219     protected: // Functions from MDownloadsListDlgObserver
00220 
00221         virtual void PreLayoutDynInitL( CDownloadsListDlg& aDialog );
00222         virtual void ProcessCommandL( CDownloadsListDlg& aDialog, TInt aCommandId );
00223         virtual void DynInitMenuPaneL( CDownloadsListDlg& aDialog, TInt aResourceId, CEikMenuPane* aMenuPane );
00224         virtual TKeyResponse OfferKeyEventL( CDownloadsListDlg& aDialog, const TKeyEvent& aKeyEvent, TEventCode aType );
00225 
00226 
00227     protected: // Function from MAIWNotifyCallback 
00228         TInt HandleNotifyL( TInt /*aCmdId*/,
00229                             TInt /*aEventId*/,
00230                             CAiwGenericParamList& /*aEventParamList*/,
00231                             const CAiwGenericParamList& /*aInParamList*/ ){return KErrNone;}
00232     private: 
00233         void AttachAIWInterestL();
00234         void HandleAIWCommandL(TInt aCommand, RHttpDownload& aDownload);
00235         void InitializeAIWPlugInMenusL( TInt aResourceId, 
00236                                         CEikMenuPane* aMenuPane,
00237                                         RHttpDownload& aDownload );
00238         void ProvideInputParametersL( CAiwGenericParamList& aParams,
00239                                       TInt& /*aCommandOptions*/,
00240                                       RHttpDownload& aDownload);
00241                                       
00242         void LaunchFileManagerApplicationL();
00243 
00244     private:  // Data
00245         
00246         CDownloadsListExtension*    iExtension; 
00247 
00248         CUserInteractionsUtils*     iUiUtils; 
00249         CDownloadMgrUiDownloadMenu* iDownloadMenu; 
00250         CAsyncEventHandlerArray*    iEventHandlerArray; 
00251         CDownloadsListArray*        iListModel; 
00252         CDownloadsListDlg*          iDialog; 
00253         TBool                       iIsVisible; 
00254                 TBool                                           iIsTimerStarted;
00255                 CAiwServiceHandler* iAIWServiceHandler;
00256                 TBool                                           iProgressiveDownload;
00257                 
00258                 TBool                                           iIsCancelInProgress;
00259                 TBool                       iPlatformSupportsGallery;
00260 
00261     private: // Friend classes
00262 
00263         friend class CDownloadsListExtension;
00264     };
00265 
00266 #endif /* CDOWNLOADMGRUIDOWNLOADSLIST_H */

Copyright © Nokia Corporation 2001-2007
Back to top