00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef CDOWNLOADMGRUIDOWNLOADSLIST_H
00023 #define CDOWNLOADMGRUIDOWNLOADSLIST_H
00024
00025
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
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
00046
00053 NONSHARABLE_CLASS( CDownloadMgrUiDownloadsList ) :
00054 public CDownloadMgrUiBase,
00055 public MHttpDownloadMgrObserver,
00056 public MDownloadsListDlgObserver,
00057 public MAiwNotifyCallback
00058 {
00059 public:
00060
00064 static CDownloadMgrUiDownloadsList* NewL
00065 ( CDownloadMgrUiLibRegistry& aRegistryModel );
00066
00070 virtual ~CDownloadMgrUiDownloadsList();
00071
00072 public:
00073
00074
00075
00076
00077
00083 IMPORT_C CDownloadMgrUiDownloadMenu& DownloadMenu() const;
00084
00085
00086
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:
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:
00164
00168 CDownloadMgrUiDownloadsList( CDownloadMgrUiLibRegistry& aRegistryModel );
00169
00173 void ConstructL();
00174
00175 protected:
00176
00177
00178
00179
00180
00185 void AddDownloadsToListModelL( CDownloadsListArray& aLBModel,
00186 RHttpDownloadMgr& aDownloadMgr );
00187
00195 TInt AddDownloadToListModelL( CDownloadsListArray& aLBModel,
00196 RHttpDownload& aDownload );
00197
00198
00199
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
00211
00212
00213 void HideMenu();
00214
00215 protected:
00216
00217 virtual void HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
00218
00219 protected:
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:
00228 TInt HandleNotifyL( TInt ,
00229 TInt ,
00230 CAiwGenericParamList& ,
00231 const CAiwGenericParamList& ){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& ,
00240 RHttpDownload& aDownload);
00241
00242 void LaunchFileManagerApplicationL();
00243
00244 private:
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:
00262
00263 friend class CDownloadsListExtension;
00264 };
00265
00266 #endif