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 00032 // FORWARD DECLARATIONS 00033 class CDownloadMgrUiDownloadMenu; 00034 class CDownloadMgrUiUserInteractions; 00035 class CDownloadsListArray; 00036 class CDownloadsListDlg; 00037 class CUserInteractionsUtils; 00038 class CDownloadMgrUiLibRegistry; 00039 class CAsyncEventHandlerArray; 00040 class CAsyncEventHandlerBase; 00041 class CDownloadsListExtension; 00042 00043 // CLASS DECLARATION 00044 00051 NONSHARABLE_CLASS( CDownloadMgrUiDownloadsList ) : 00052 public CDownloadMgrUiBase, 00053 public MHttpDownloadMgrObserver, 00054 public MDownloadsListDlgObserver, 00055 public MAiwNotifyCallback 00056 { 00057 public: // Constructors and destructor 00058 00062 static CDownloadMgrUiDownloadsList* NewL 00063 ( CDownloadMgrUiLibRegistry& aRegistryModel ); 00064 00068 virtual ~CDownloadMgrUiDownloadsList(); 00069 00070 public: // New functions 00071 00072 // ------------------------------------------------------------- 00073 // ************** Download Menu 00074 // ------------------------------------------------------------- 00075 00081 IMPORT_C CDownloadMgrUiDownloadMenu& DownloadMenu() const; 00082 00083 // ------------------------------------------------------------- 00084 // ************** Downloads List 00085 // ------------------------------------------------------------- 00086 00095 IMPORT_C void DisplayDownloadsListL(); 00096 00107 void DisplayDownloadsListL( RHttpDownload& aHighlightDl ); 00108 00114 IMPORT_C void CancelDisplayingDownloadsList(); 00115 00121 IMPORT_C TBool IsVisible() const; 00122 00128 IMPORT_C TInt Count() const; 00129 00133 void DeleteDownloadL( RHttpDownload& aDownload ); 00134 00135 00136 public: // Functions from CDownloadMgrUiBase 00137 00138 IMPORT_C virtual void GetIntAttributeL( const TUint aAttribute, TInt32& aValue ); 00139 IMPORT_C virtual void GetBoolAttributeL( const TUint aAttribute, TBool& aValue ); 00140 IMPORT_C virtual void GetStringAttributeL( const TUint aAttribute, TDes16& aValue ); 00141 IMPORT_C virtual void GetStringAttributeL( const TUint aAttribute, TDes8& aValue ); 00142 IMPORT_C virtual void SetIntAttributeL( const TUint aAttribute, TInt32 aValue ); 00143 IMPORT_C virtual void SetBoolAttributeL( const TUint aAttribute, TBool aValue ); 00144 IMPORT_C virtual void SetStringAttributeL( const TUint aAttribute, const TDesC16& aValue ); 00145 IMPORT_C virtual void SetStringAttributeL( const TUint aAttribute, const TDesC8& aValue ); 00146 00147 protected: // Constructors 00148 00152 CDownloadMgrUiDownloadsList( CDownloadMgrUiLibRegistry& aRegistryModel ); 00153 00157 void ConstructL(); 00158 00159 protected: // New functions 00160 00161 // ------------------------------------------------------------- 00162 // ************** List box utilities 00163 // ------------------------------------------------------------- 00164 00169 void AddDownloadsToListModelL( CDownloadsListArray& aLBModel, 00170 RHttpDownloadMgr& aDownloadMgr ); 00171 00179 TInt AddDownloadToListModelL( CDownloadsListArray& aLBModel, 00180 RHttpDownload& aDownload ); 00181 00182 // ------------------------------------------------------------- 00183 // ************** Responses to download events 00184 // ------------------------------------------------------------- 00185 00186 void NewDownloadCreatedL( RHttpDownload& aDownload ); 00187 void UpdateProgressInfoL( RHttpDownload& aDownload, THttpDownloadEvent aEvent ); 00188 void DownloadPausedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent ); 00189 void DownloadCompletedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent ); 00190 void DownloadFailedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent ); 00191 void PauseableStateChangedL( RHttpDownload& aDownload, TBool aPausable ); 00192 00193 // ------------------------------------------------------------- 00194 // ************** Other utility 00195 // ------------------------------------------------------------- 00196 00197 void HideMenu(); 00198 00199 protected: // Functions from MHttpDownloadMgrObserver 00200 00201 virtual void HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent ); 00202 00203 protected: // Functions from MDownloadsListDlgObserver 00204 00205 virtual void PreLayoutDynInitL( CDownloadsListDlg& aDialog ); 00206 virtual void ProcessCommandL( CDownloadsListDlg& aDialog, TInt aCommandId ); 00207 virtual void DynInitMenuPaneL( CDownloadsListDlg& aDialog, TInt aResourceId, CEikMenuPane* aMenuPane ); 00208 virtual TKeyResponse OfferKeyEventL( CDownloadsListDlg& aDialog, const TKeyEvent& aKeyEvent, TEventCode aType ); 00209 00210 00211 protected: // Function from MAIWNotifyCallback 00212 private: 00213 void AttachAIWInterestL(); 00214 void HandleAIWCommandL(TInt aCommand, RHttpDownload& aDownload); 00215 void InitializeAIWPlugInMenusL( TInt aResourceId, 00216 CEikMenuPane* aMenuPane, 00217 RHttpDownload& aDownload ); 00218 void ProvideInputParametersL( CAiwGenericParamList& aParams, 00219 TInt& /*aCommandOptions*/, 00220 RHttpDownload& aDownload); 00221 00222 private: // Data 00223 00224 CDownloadsListExtension* iExtension; 00225 00226 CUserInteractionsUtils* iUiUtils; 00227 CDownloadMgrUiDownloadMenu* iDownloadMenu; 00228 CAsyncEventHandlerArray* iEventHandlerArray; 00229 CDownloadsListArray* iListModel; 00230 CDownloadsListDlg* iDialog; 00231 TBool iIsVisible; 00232 TBool iIsTimerStarted; 00233 CAiwServiceHandler* iAIWServiceHandler; 00234 00235 private: // Friend classes 00236 00237 friend class CDownloadsListExtension; 00238 }; 00239 00240 #endif /* CDOWNLOADMGRUIDOWNLOADSLIST_H */