williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@2
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: Supports Download Menu and Downloads List
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
#ifndef CDOWNLOADMGRUIDOWNLOADSLIST_H
|
williamr@2
|
21 |
#define CDOWNLOADMGRUIDOWNLOADSLIST_H
|
williamr@2
|
22 |
|
williamr@2
|
23 |
// INCLUDES
|
williamr@2
|
24 |
#include <CDownloadMgrUiBase.h>
|
williamr@2
|
25 |
#include <DownloadMgrClient.h>
|
williamr@2
|
26 |
#include <HttpDownloadMgrCommon.h>
|
williamr@2
|
27 |
#include <DownloadsListDlgObserver.h>
|
williamr@2
|
28 |
|
williamr@2
|
29 |
#include <AiwServiceHandler.h>
|
williamr@2
|
30 |
#include <AiwCommon.hrh>
|
williamr@2
|
31 |
|
williamr@2
|
32 |
// FORWARD DECLARATIONS
|
williamr@2
|
33 |
class CDownloadMgrUiDownloadMenu;
|
williamr@2
|
34 |
class CDownloadMgrUiUserInteractions;
|
williamr@2
|
35 |
class CDownloadsListArray;
|
williamr@2
|
36 |
class CDownloadsListDlg;
|
williamr@2
|
37 |
class CUserInteractionsUtils;
|
williamr@2
|
38 |
class CDownloadMgrUiLibRegistry;
|
williamr@2
|
39 |
class CAsyncEventHandlerArray;
|
williamr@2
|
40 |
class CAsyncEventHandlerBase;
|
williamr@2
|
41 |
class CDownloadsListExtension;
|
williamr@2
|
42 |
|
williamr@2
|
43 |
// CLASS DECLARATION
|
williamr@2
|
44 |
|
williamr@2
|
45 |
/**
|
williamr@2
|
46 |
* Display list of downloads.
|
williamr@2
|
47 |
*
|
williamr@2
|
48 |
* @lib Download Manager UI Lib
|
williamr@2
|
49 |
* @since Series 60 2.8
|
williamr@2
|
50 |
*/
|
williamr@2
|
51 |
NONSHARABLE_CLASS( CDownloadMgrUiDownloadsList ) :
|
williamr@2
|
52 |
public CDownloadMgrUiBase,
|
williamr@2
|
53 |
public MHttpDownloadMgrObserver,
|
williamr@2
|
54 |
public MDownloadsListDlgObserver,
|
williamr@2
|
55 |
public MAiwNotifyCallback
|
williamr@2
|
56 |
{
|
williamr@2
|
57 |
public: // Constructors and destructor
|
williamr@2
|
58 |
|
williamr@2
|
59 |
/**
|
williamr@2
|
60 |
* Two-phased constructor.
|
williamr@2
|
61 |
*/
|
williamr@2
|
62 |
static CDownloadMgrUiDownloadsList* NewL
|
williamr@2
|
63 |
( CDownloadMgrUiLibRegistry& aRegistryModel );
|
williamr@2
|
64 |
|
williamr@2
|
65 |
/**
|
williamr@2
|
66 |
* Destructor.
|
williamr@2
|
67 |
*/
|
williamr@2
|
68 |
virtual ~CDownloadMgrUiDownloadsList();
|
williamr@2
|
69 |
|
williamr@2
|
70 |
public: // New functions
|
williamr@2
|
71 |
|
williamr@2
|
72 |
// -------------------------------------------------------------
|
williamr@2
|
73 |
// ************** Download Menu
|
williamr@2
|
74 |
// -------------------------------------------------------------
|
williamr@2
|
75 |
|
williamr@2
|
76 |
/**
|
williamr@2
|
77 |
* Access the Download Menu utility.
|
williamr@2
|
78 |
* @since Series 60 2.8
|
williamr@2
|
79 |
* @return -
|
williamr@2
|
80 |
*/
|
williamr@2
|
81 |
IMPORT_C CDownloadMgrUiDownloadMenu& DownloadMenu() const;
|
williamr@2
|
82 |
|
williamr@2
|
83 |
// -------------------------------------------------------------
|
williamr@2
|
84 |
// ************** Downloads List
|
williamr@2
|
85 |
// -------------------------------------------------------------
|
williamr@2
|
86 |
|
williamr@2
|
87 |
/**
|
williamr@2
|
88 |
* Display the list of downloads (the method does not block the scheduler).
|
williamr@2
|
89 |
* It means that this method initializes an active object, that completes
|
williamr@2
|
90 |
* itself and it executes the Downloads List dialog in it's RunL.
|
williamr@2
|
91 |
* Using this method the caller is not blocked by the wait-dialog.
|
williamr@2
|
92 |
* @since Series 60 2.8
|
williamr@2
|
93 |
* @return -
|
williamr@2
|
94 |
*/
|
williamr@2
|
95 |
IMPORT_C void DisplayDownloadsListL();
|
williamr@2
|
96 |
|
williamr@2
|
97 |
/**
|
williamr@2
|
98 |
* Display the list of downloads (the method does not block the scheduler).
|
williamr@2
|
99 |
* It means that this method initializes an active object, that completes
|
williamr@2
|
100 |
* itself and it executes the Downloads List dialog in it's RunL.
|
williamr@2
|
101 |
* Using this method the caller is not blocked by the wait-dialog.
|
williamr@2
|
102 |
* This method is not exported!
|
williamr@2
|
103 |
* @param aHighlightDl This download is highlighted in the list.
|
williamr@2
|
104 |
* @since Series 60 3.0
|
williamr@2
|
105 |
* @return -
|
williamr@2
|
106 |
*/
|
williamr@2
|
107 |
void DisplayDownloadsListL( RHttpDownload& aHighlightDl );
|
williamr@2
|
108 |
|
williamr@2
|
109 |
/**
|
williamr@2
|
110 |
* Cancel displaying the list of downloads.
|
williamr@2
|
111 |
* @since Series 60 2.8
|
williamr@2
|
112 |
* @return -
|
williamr@2
|
113 |
*/
|
williamr@2
|
114 |
IMPORT_C void CancelDisplayingDownloadsList();
|
williamr@2
|
115 |
|
williamr@2
|
116 |
/**
|
williamr@2
|
117 |
* Is the List of Downloads visible?
|
williamr@2
|
118 |
* @since Series 60 2.8
|
williamr@2
|
119 |
* @return ETrue/EFalse
|
williamr@2
|
120 |
*/
|
williamr@2
|
121 |
IMPORT_C TBool IsVisible() const;
|
williamr@2
|
122 |
|
williamr@2
|
123 |
/**
|
williamr@2
|
124 |
* Number of downloads in the List of Downloads.
|
williamr@2
|
125 |
* @since Series 60 2.8
|
williamr@2
|
126 |
* @return TInt
|
williamr@2
|
127 |
*/
|
williamr@2
|
128 |
IMPORT_C TInt Count() const;
|
williamr@2
|
129 |
|
williamr@2
|
130 |
/**
|
williamr@2
|
131 |
* Remove the given download from the list.
|
williamr@2
|
132 |
*/
|
williamr@2
|
133 |
void DeleteDownloadL( RHttpDownload& aDownload );
|
williamr@2
|
134 |
|
williamr@2
|
135 |
/**
|
williamr@2
|
136 |
* Is one of them progressive
|
williamr@2
|
137 |
* @since Series 60 3.2
|
williamr@2
|
138 |
* @return TBool
|
williamr@2
|
139 |
*/
|
williamr@2
|
140 |
TBool IsOneProgressive();
|
williamr@2
|
141 |
|
williamr@2
|
142 |
/**
|
williamr@2
|
143 |
* Is one of them progressive
|
williamr@2
|
144 |
* @since Series 60 3.2
|
williamr@2
|
145 |
* @return TBool
|
williamr@2
|
146 |
*/
|
williamr@2
|
147 |
inline TBool IsProgressiveDownloadEnabled() {return iProgressiveDownload; }
|
williamr@2
|
148 |
|
williamr@2
|
149 |
|
williamr@2
|
150 |
public: // Functions from CDownloadMgrUiBase
|
williamr@2
|
151 |
|
williamr@2
|
152 |
IMPORT_C virtual void GetIntAttributeL( const TUint aAttribute, TInt32& aValue );
|
williamr@2
|
153 |
IMPORT_C virtual void GetBoolAttributeL( const TUint aAttribute, TBool& aValue );
|
williamr@2
|
154 |
IMPORT_C virtual void GetStringAttributeL( const TUint aAttribute, TDes16& aValue );
|
williamr@2
|
155 |
IMPORT_C virtual void GetStringAttributeL( const TUint aAttribute, TDes8& aValue );
|
williamr@2
|
156 |
IMPORT_C virtual void SetIntAttributeL( const TUint aAttribute, TInt32 aValue );
|
williamr@2
|
157 |
IMPORT_C virtual void SetBoolAttributeL( const TUint aAttribute, TBool aValue );
|
williamr@2
|
158 |
IMPORT_C virtual void SetStringAttributeL( const TUint aAttribute, const TDesC16& aValue );
|
williamr@2
|
159 |
IMPORT_C virtual void SetStringAttributeL( const TUint aAttribute, const TDesC8& aValue );
|
williamr@2
|
160 |
|
williamr@2
|
161 |
protected: // Constructors
|
williamr@2
|
162 |
|
williamr@2
|
163 |
/**
|
williamr@2
|
164 |
* C++ default constructor.
|
williamr@2
|
165 |
*/
|
williamr@2
|
166 |
CDownloadMgrUiDownloadsList( CDownloadMgrUiLibRegistry& aRegistryModel );
|
williamr@2
|
167 |
|
williamr@2
|
168 |
/**
|
williamr@2
|
169 |
* By default Symbian 2nd phase constructor is private.
|
williamr@2
|
170 |
*/
|
williamr@2
|
171 |
void ConstructL();
|
williamr@2
|
172 |
|
williamr@2
|
173 |
protected: // New functions
|
williamr@2
|
174 |
|
williamr@2
|
175 |
// -------------------------------------------------------------
|
williamr@2
|
176 |
// ************** List box utilities
|
williamr@2
|
177 |
// -------------------------------------------------------------
|
williamr@2
|
178 |
|
williamr@2
|
179 |
/**
|
williamr@2
|
180 |
* Add downloads to the list residing in aDownloadMgr.
|
williamr@2
|
181 |
* If a given download is already on the list, the list item is only updated.
|
williamr@2
|
182 |
*/
|
williamr@2
|
183 |
void AddDownloadsToListModelL( CDownloadsListArray& aLBModel,
|
williamr@2
|
184 |
RHttpDownloadMgr& aDownloadMgr );
|
williamr@2
|
185 |
|
williamr@2
|
186 |
/**
|
williamr@2
|
187 |
* Add the download to the list.
|
williamr@2
|
188 |
* If the download is already on the list, the list item is only updated.
|
williamr@2
|
189 |
* This method should be used for adding new downloads -
|
williamr@2
|
190 |
* not for updating existing ones.
|
williamr@2
|
191 |
* @return Returns the index relative to zero of the appended or updated item.
|
williamr@2
|
192 |
*/
|
williamr@2
|
193 |
TInt AddDownloadToListModelL( CDownloadsListArray& aLBModel,
|
williamr@2
|
194 |
RHttpDownload& aDownload );
|
williamr@2
|
195 |
|
williamr@2
|
196 |
// -------------------------------------------------------------
|
williamr@2
|
197 |
// ************** Responses to download events
|
williamr@2
|
198 |
// -------------------------------------------------------------
|
williamr@2
|
199 |
|
williamr@2
|
200 |
void NewDownloadCreatedL( RHttpDownload& aDownload );
|
williamr@2
|
201 |
void UpdateProgressInfoL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
|
williamr@2
|
202 |
void DownloadPausedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
|
williamr@2
|
203 |
void DownloadCompletedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
|
williamr@2
|
204 |
void DownloadFailedL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
|
williamr@2
|
205 |
void PauseableStateChangedL( RHttpDownload& aDownload, TBool aPausable );
|
williamr@2
|
206 |
|
williamr@2
|
207 |
// -------------------------------------------------------------
|
williamr@2
|
208 |
// ************** Other utility
|
williamr@2
|
209 |
// -------------------------------------------------------------
|
williamr@2
|
210 |
|
williamr@2
|
211 |
void HideMenu();
|
williamr@2
|
212 |
|
williamr@2
|
213 |
protected: // Functions from MHttpDownloadMgrObserver
|
williamr@2
|
214 |
|
williamr@2
|
215 |
virtual void HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
|
williamr@2
|
216 |
|
williamr@2
|
217 |
protected: // Functions from MDownloadsListDlgObserver
|
williamr@2
|
218 |
|
williamr@2
|
219 |
virtual void PreLayoutDynInitL( CDownloadsListDlg& aDialog );
|
williamr@2
|
220 |
virtual void ProcessCommandL( CDownloadsListDlg& aDialog, TInt aCommandId );
|
williamr@2
|
221 |
virtual void DynInitMenuPaneL( CDownloadsListDlg& aDialog, TInt aResourceId, CEikMenuPane* aMenuPane );
|
williamr@2
|
222 |
virtual TKeyResponse OfferKeyEventL( CDownloadsListDlg& aDialog, const TKeyEvent& aKeyEvent, TEventCode aType );
|
williamr@2
|
223 |
|
williamr@2
|
224 |
|
williamr@2
|
225 |
protected: // Function from MAIWNotifyCallback
|
williamr@2
|
226 |
TInt HandleNotifyL( TInt /*aCmdId*/,
|
williamr@2
|
227 |
TInt /*aEventId*/,
|
williamr@2
|
228 |
CAiwGenericParamList& /*aEventParamList*/,
|
williamr@2
|
229 |
const CAiwGenericParamList& /*aInParamList*/ ){return KErrNone;}
|
williamr@2
|
230 |
private:
|
williamr@2
|
231 |
void AttachAIWInterestL();
|
williamr@2
|
232 |
void HandleAIWCommandL(TInt aCommand, RHttpDownload& aDownload);
|
williamr@2
|
233 |
void InitializeAIWPlugInMenusL( TInt aResourceId,
|
williamr@2
|
234 |
CEikMenuPane* aMenuPane,
|
williamr@2
|
235 |
RHttpDownload& aDownload );
|
williamr@2
|
236 |
void ProvideInputParametersL( CAiwGenericParamList& aParams,
|
williamr@2
|
237 |
TInt& /*aCommandOptions*/,
|
williamr@2
|
238 |
RHttpDownload& aDownload);
|
williamr@2
|
239 |
|
williamr@2
|
240 |
void LaunchFileManagerApplication();
|
williamr@2
|
241 |
|
williamr@2
|
242 |
private: // Data
|
williamr@2
|
243 |
|
williamr@2
|
244 |
CDownloadsListExtension* iExtension; ///< Extension class. Owned.
|
williamr@2
|
245 |
|
williamr@2
|
246 |
CUserInteractionsUtils* iUiUtils; ///< Utility. Owned.
|
williamr@2
|
247 |
CDownloadMgrUiDownloadMenu* iDownloadMenu; ///< Download Menu utility. Owned.
|
williamr@2
|
248 |
CAsyncEventHandlerArray* iEventHandlerArray; ///< Owned.
|
williamr@2
|
249 |
CDownloadsListArray* iListModel; ///< Association array: list item-download. Owned.
|
williamr@2
|
250 |
CDownloadsListDlg* iDialog; ///< Owned. Unused member.
|
williamr@2
|
251 |
TBool iIsVisible; ///< Unused member.
|
williamr@2
|
252 |
TBool iIsTimerStarted;
|
williamr@2
|
253 |
CAiwServiceHandler* iAIWServiceHandler;
|
williamr@2
|
254 |
TBool iProgressiveDownload;
|
williamr@2
|
255 |
|
williamr@2
|
256 |
TBool iIsCancelInProgress;
|
williamr@2
|
257 |
TBool iPlatformSupportsGallery;
|
williamr@2
|
258 |
|
williamr@2
|
259 |
private: // Friend classes
|
williamr@2
|
260 |
|
williamr@2
|
261 |
friend class CDownloadsListExtension;
|
williamr@2
|
262 |
};
|
williamr@2
|
263 |
|
williamr@2
|
264 |
#endif /* CDOWNLOADMGRUIDOWNLOADSLIST_H */
|