1.1 --- a/epoc32/include/mw/cdownloadmgruidownloadslist.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/cdownloadmgruidownloadslist.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,264 @@
1.4 -cdownloadmgruidownloadslist.h
1.5 +/*
1.6 +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* under the terms of the License "Eclipse Public License v1.0"
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description: Supports Download Menu and Downloads List
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +
1.24 +#ifndef CDOWNLOADMGRUIDOWNLOADSLIST_H
1.25 +#define CDOWNLOADMGRUIDOWNLOADSLIST_H
1.26 +
1.27 +// INCLUDES
1.28 +#include <CDownloadMgrUiBase.h>
1.29 +#include <DownloadMgrClient.h>
1.30 +#include <HttpDownloadMgrCommon.h>
1.31 +#include <DownloadsListDlgObserver.h>
1.32 +
1.33 +#include <AiwServiceHandler.h>
1.34 +#include <AiwCommon.hrh>
1.35 +
1.36 +// FORWARD DECLARATIONS
1.37 +class CDownloadMgrUiDownloadMenu;
1.38 +class CDownloadMgrUiUserInteractions;
1.39 +class CDownloadsListArray;
1.40 +class CDownloadsListDlg;
1.41 +class CUserInteractionsUtils;
1.42 +class CDownloadMgrUiLibRegistry;
1.43 +class CAsyncEventHandlerArray;
1.44 +class CAsyncEventHandlerBase;
1.45 +class CDownloadsListExtension;
1.46 +
1.47 +// CLASS DECLARATION
1.48 +
1.49 +/**
1.50 +* Display list of downloads.
1.51 +*
1.52 +* @lib Download Manager UI Lib
1.53 +* @since Series 60 2.8
1.54 +*/
1.55 +NONSHARABLE_CLASS( CDownloadMgrUiDownloadsList ) :
1.56 + public CDownloadMgrUiBase,
1.57 + public MHttpDownloadMgrObserver,
1.58 + public MDownloadsListDlgObserver,
1.59 + public MAiwNotifyCallback
1.60 + {
1.61 + public: // Constructors and destructor
1.62 +
1.63 + /**
1.64 + * Two-phased constructor.
1.65 + */
1.66 + static CDownloadMgrUiDownloadsList* NewL
1.67 + ( CDownloadMgrUiLibRegistry& aRegistryModel );
1.68 +
1.69 + /**
1.70 + * Destructor.
1.71 + */
1.72 + virtual ~CDownloadMgrUiDownloadsList();
1.73 +
1.74 + public: // New functions
1.75 +
1.76 + // -------------------------------------------------------------
1.77 + // ************** Download Menu
1.78 + // -------------------------------------------------------------
1.79 +
1.80 + /**
1.81 + * Access the Download Menu utility.
1.82 + * @since Series 60 2.8
1.83 + * @return -
1.84 + */
1.85 + IMPORT_C CDownloadMgrUiDownloadMenu& DownloadMenu() const;
1.86 +
1.87 + // -------------------------------------------------------------
1.88 + // ************** Downloads List
1.89 + // -------------------------------------------------------------
1.90 +
1.91 + /**
1.92 + * Display the list of downloads (the method does not block the scheduler).
1.93 + * It means that this method initializes an active object, that completes
1.94 + * itself and it executes the Downloads List dialog in it's RunL.
1.95 + * Using this method the caller is not blocked by the wait-dialog.
1.96 + * @since Series 60 2.8
1.97 + * @return -
1.98 + */
1.99 + IMPORT_C void DisplayDownloadsListL();
1.100 +
1.101 + /**
1.102 + * Display the list of downloads (the method does not block the scheduler).
1.103 + * It means that this method initializes an active object, that completes
1.104 + * itself and it executes the Downloads List dialog in it's RunL.
1.105 + * Using this method the caller is not blocked by the wait-dialog.
1.106 + * This method is not exported!
1.107 + * @param aHighlightDl This download is highlighted in the list.
1.108 + * @since Series 60 3.0
1.109 + * @return -
1.110 + */
1.111 + void DisplayDownloadsListL( RHttpDownload& aHighlightDl );
1.112 +
1.113 + /**
1.114 + * Cancel displaying the list of downloads.
1.115 + * @since Series 60 2.8
1.116 + * @return -
1.117 + */
1.118 + IMPORT_C void CancelDisplayingDownloadsList();
1.119 +
1.120 + /**
1.121 + * Is the List of Downloads visible?
1.122 + * @since Series 60 2.8
1.123 + * @return ETrue/EFalse
1.124 + */
1.125 + IMPORT_C TBool IsVisible() const;
1.126 +
1.127 + /**
1.128 + * Number of downloads in the List of Downloads.
1.129 + * @since Series 60 2.8
1.130 + * @return TInt
1.131 + */
1.132 + IMPORT_C TInt Count() const;
1.133 +
1.134 + /**
1.135 + * Remove the given download from the list.
1.136 + */
1.137 + void DeleteDownloadL( RHttpDownload& aDownload );
1.138 +
1.139 + /**
1.140 + * Is one of them progressive
1.141 + * @since Series 60 3.2
1.142 + * @return TBool
1.143 + */
1.144 + TBool IsOneProgressive();
1.145 +
1.146 + /**
1.147 + * Is one of them progressive
1.148 + * @since Series 60 3.2
1.149 + * @return TBool
1.150 + */
1.151 + inline TBool IsProgressiveDownloadEnabled() {return iProgressiveDownload; }
1.152 +
1.153 +
1.154 + public: // Functions from CDownloadMgrUiBase
1.155 +
1.156 + IMPORT_C virtual void GetIntAttributeL( const TUint aAttribute, TInt32& aValue );
1.157 + IMPORT_C virtual void GetBoolAttributeL( const TUint aAttribute, TBool& aValue );
1.158 + IMPORT_C virtual void GetStringAttributeL( const TUint aAttribute, TDes16& aValue );
1.159 + IMPORT_C virtual void GetStringAttributeL( const TUint aAttribute, TDes8& aValue );
1.160 + IMPORT_C virtual void SetIntAttributeL( const TUint aAttribute, TInt32 aValue );
1.161 + IMPORT_C virtual void SetBoolAttributeL( const TUint aAttribute, TBool aValue );
1.162 + IMPORT_C virtual void SetStringAttributeL( const TUint aAttribute, const TDesC16& aValue );
1.163 + IMPORT_C virtual void SetStringAttributeL( const TUint aAttribute, const TDesC8& aValue );
1.164 +
1.165 + protected: // Constructors
1.166 +
1.167 + /**
1.168 + * C++ default constructor.
1.169 + */
1.170 + CDownloadMgrUiDownloadsList( CDownloadMgrUiLibRegistry& aRegistryModel );
1.171 +
1.172 + /**
1.173 + * By default Symbian 2nd phase constructor is private.
1.174 + */
1.175 + void ConstructL();
1.176 +
1.177 + protected: // New functions
1.178 +
1.179 + // -------------------------------------------------------------
1.180 + // ************** List box utilities
1.181 + // -------------------------------------------------------------
1.182 +
1.183 + /**
1.184 + * Add downloads to the list residing in aDownloadMgr.
1.185 + * If a given download is already on the list, the list item is only updated.
1.186 + */
1.187 + void AddDownloadsToListModelL( CDownloadsListArray& aLBModel,
1.188 + RHttpDownloadMgr& aDownloadMgr );
1.189 +
1.190 + /**
1.191 + * Add the download to the list.
1.192 + * If the download is already on the list, the list item is only updated.
1.193 + * This method should be used for adding new downloads -
1.194 + * not for updating existing ones.
1.195 + * @return Returns the index relative to zero of the appended or updated item.
1.196 + */
1.197 + TInt AddDownloadToListModelL( CDownloadsListArray& aLBModel,
1.198 + RHttpDownload& aDownload );
1.199 +
1.200 + // -------------------------------------------------------------
1.201 + // ************** Responses to download events
1.202 + // -------------------------------------------------------------
1.203 +
1.204 + void NewDownloadCreatedL( RHttpDownload& aDownload );
1.205 + void UpdateProgressInfoL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
1.206 + void DownloadPausedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
1.207 + void DownloadCompletedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
1.208 + void DownloadFailedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
1.209 + void PauseableStateChangedL( RHttpDownload& aDownload, TBool aPausable );
1.210 +
1.211 + // -------------------------------------------------------------
1.212 + // ************** Other utility
1.213 + // -------------------------------------------------------------
1.214 +
1.215 + void HideMenu();
1.216 +
1.217 + protected: // Functions from MHttpDownloadMgrObserver
1.218 +
1.219 + virtual void HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
1.220 +
1.221 + protected: // Functions from MDownloadsListDlgObserver
1.222 +
1.223 + virtual void PreLayoutDynInitL( CDownloadsListDlg& aDialog );
1.224 + virtual void ProcessCommandL( CDownloadsListDlg& aDialog, TInt aCommandId );
1.225 + virtual void DynInitMenuPaneL( CDownloadsListDlg& aDialog, TInt aResourceId, CEikMenuPane* aMenuPane );
1.226 + virtual TKeyResponse OfferKeyEventL( CDownloadsListDlg& aDialog, const TKeyEvent& aKeyEvent, TEventCode aType );
1.227 +
1.228 +
1.229 + protected: // Function from MAIWNotifyCallback
1.230 + TInt HandleNotifyL( TInt /*aCmdId*/,
1.231 + TInt /*aEventId*/,
1.232 + CAiwGenericParamList& /*aEventParamList*/,
1.233 + const CAiwGenericParamList& /*aInParamList*/ ){return KErrNone;}
1.234 + private:
1.235 + void AttachAIWInterestL();
1.236 + void HandleAIWCommandL(TInt aCommand, RHttpDownload& aDownload);
1.237 + void InitializeAIWPlugInMenusL( TInt aResourceId,
1.238 + CEikMenuPane* aMenuPane,
1.239 + RHttpDownload& aDownload );
1.240 + void ProvideInputParametersL( CAiwGenericParamList& aParams,
1.241 + TInt& /*aCommandOptions*/,
1.242 + RHttpDownload& aDownload);
1.243 +
1.244 + void LaunchFileManagerApplication();
1.245 +
1.246 + private: // Data
1.247 +
1.248 + CDownloadsListExtension* iExtension; ///< Extension class. Owned.
1.249 +
1.250 + CUserInteractionsUtils* iUiUtils; ///< Utility. Owned.
1.251 + CDownloadMgrUiDownloadMenu* iDownloadMenu; ///< Download Menu utility. Owned.
1.252 + CAsyncEventHandlerArray* iEventHandlerArray; ///< Owned.
1.253 + CDownloadsListArray* iListModel; ///< Association array: list item-download. Owned.
1.254 + CDownloadsListDlg* iDialog; ///< Owned. Unused member.
1.255 + TBool iIsVisible; ///< Unused member.
1.256 + TBool iIsTimerStarted;
1.257 + CAiwServiceHandler* iAIWServiceHandler;
1.258 + TBool iProgressiveDownload;
1.259 +
1.260 + TBool iIsCancelInProgress;
1.261 + TBool iPlatformSupportsGallery;
1.262 +
1.263 + private: // Friend classes
1.264 +
1.265 + friend class CDownloadsListExtension;
1.266 + };
1.267 +
1.268 +#endif /* CDOWNLOADMGRUIDOWNLOADSLIST_H */