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 
00144     public: // Functions from CDownloadMgrUiBase
00145 
00146         IMPORT_C virtual void GetIntAttributeL( const TUint aAttribute, TInt32& aValue );
00147         IMPORT_C virtual void GetBoolAttributeL( const TUint aAttribute, TBool& aValue );
00148         IMPORT_C virtual void GetStringAttributeL( const TUint aAttribute, TDes16& aValue  );
00149         IMPORT_C virtual void GetStringAttributeL( const TUint aAttribute, TDes8& aValue  );
00150         IMPORT_C virtual void SetIntAttributeL( const TUint aAttribute, TInt32 aValue );
00151         IMPORT_C virtual void SetBoolAttributeL( const TUint aAttribute, TBool aValue );
00152         IMPORT_C virtual void SetStringAttributeL( const TUint aAttribute, const TDesC16& aValue );
00153         IMPORT_C virtual void SetStringAttributeL( const TUint aAttribute, const TDesC8& aValue );
00154 
00155     protected: // Constructors
00156 
00160         CDownloadMgrUiDownloadsList( CDownloadMgrUiLibRegistry& aRegistryModel );
00161 
00165         void ConstructL();
00166 
00167     protected: // New functions
00168 
00169         // -------------------------------------------------------------
00170         // ************** List box utilities
00171         // -------------------------------------------------------------
00172 
00177         void AddDownloadsToListModelL( CDownloadsListArray& aLBModel, 
00178                                        RHttpDownloadMgr& aDownloadMgr );
00179 
00187         TInt AddDownloadToListModelL( CDownloadsListArray& aLBModel, 
00188                                       RHttpDownload& aDownload );
00189 
00190         // -------------------------------------------------------------
00191         // ************** Responses to download events
00192         // -------------------------------------------------------------
00193 
00194         void NewDownloadCreatedL( RHttpDownload& aDownload );
00195         void UpdateProgressInfoL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
00196         void DownloadPausedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
00197         void DownloadCompletedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
00198         void DownloadFailedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
00199         void PauseableStateChangedL( RHttpDownload& aDownload, TBool aPausable );
00200 
00201         // -------------------------------------------------------------
00202         // ************** Other utility
00203         // -------------------------------------------------------------
00204 
00205         void HideMenu();
00206 
00207     protected: // Functions from MHttpDownloadMgrObserver
00208 
00209         virtual void HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
00210 
00211     protected: // Functions from MDownloadsListDlgObserver
00212 
00213         virtual void PreLayoutDynInitL( CDownloadsListDlg& aDialog );
00214         virtual void ProcessCommandL( CDownloadsListDlg& aDialog, TInt aCommandId );
00215         virtual void DynInitMenuPaneL( CDownloadsListDlg& aDialog, TInt aResourceId, CEikMenuPane* aMenuPane );
00216         virtual TKeyResponse OfferKeyEventL( CDownloadsListDlg& aDialog, const TKeyEvent& aKeyEvent, TEventCode aType );
00217 
00218 
00219     protected: // Function from MAIWNotifyCallback 
00220         TInt HandleNotifyL( TInt /*aCmdId*/,
00221                             TInt /*aEventId*/,
00222                             CAiwGenericParamList& /*aEventParamList*/,
00223                             const CAiwGenericParamList& /*aInParamList*/ ){return KErrNone;}
00224     private: 
00225         void AttachAIWInterestL();
00226         void HandleAIWCommandL(TInt aCommand, RHttpDownload& aDownload);
00227         void InitializeAIWPlugInMenusL( TInt aResourceId, 
00228                                         CEikMenuPane* aMenuPane,
00229                                         RHttpDownload& aDownload );
00230         void ProvideInputParametersL( CAiwGenericParamList& aParams,
00231                                       TInt& /*aCommandOptions*/,
00232                                       RHttpDownload& aDownload);
00233 
00234     private:  // Data
00235         
00236         CDownloadsListExtension*    iExtension; 
00237 
00238         CUserInteractionsUtils*     iUiUtils; 
00239         CDownloadMgrUiDownloadMenu* iDownloadMenu; 
00240         CAsyncEventHandlerArray*    iEventHandlerArray; 
00241         CDownloadsListArray*        iListModel; 
00242         CDownloadsListDlg*          iDialog; 
00243         TBool                       iIsVisible; 
00244                 TBool                                           iIsTimerStarted;
00245                 CAiwServiceHandler* iAIWServiceHandler;
00246 
00247     private: // Friend classes
00248 
00249         friend class CDownloadsListExtension;
00250     };
00251 
00252 #endif /* CDOWNLOADMGRUIDOWNLOADSLIST_H */

Copyright © Nokia Corporation 2001-2008
Back to top