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 user interaction dialogs for downloads
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
#ifndef CDOWNLOADMGRUIUSERINTERACTIONS_H
|
williamr@2
|
21 |
#define CDOWNLOADMGRUIUSERINTERACTIONS_H
|
williamr@2
|
22 |
|
williamr@2
|
23 |
// INCLUDES
|
williamr@4
|
24 |
#include <cdownloadmgruibase.h>
|
williamr@4
|
25 |
#include <downloadmgrclient.h>
|
williamr@2
|
26 |
#include <vwsdef.h>
|
williamr@2
|
27 |
|
williamr@2
|
28 |
// CONSTANTS
|
williamr@2
|
29 |
_LIT8( KDrmInnerContentTypesToLaunch, "application/java-archive application/x-java-archive x-epoc/x-sisx-app application/x-pip" );
|
williamr@2
|
30 |
_LIT8( KSisxApplication, "x-epoc/x-sisx-app application/vnd.symbian.install x-epoc/x-app268436505" );
|
williamr@2
|
31 |
_LIT8( KPipApplication, "application/x-pip" );
|
williamr@2
|
32 |
_LIT8( KWidgetMimeType, "application/x-nokia-widget" );
|
williamr@2
|
33 |
_LIT8( KSharingConfig, "application/isf.sharing.config" );
|
williamr@2
|
34 |
|
williamr@2
|
35 |
// DATA TYPES
|
williamr@2
|
36 |
enum TClientAppExitType
|
williamr@2
|
37 |
{
|
williamr@2
|
38 |
ETerminatedByUser,
|
williamr@2
|
39 |
ETerminatedBySystem
|
williamr@2
|
40 |
};
|
williamr@2
|
41 |
|
williamr@2
|
42 |
// FORWARD DECLARATIONS
|
williamr@2
|
43 |
class CUserInteractionsUtils;
|
williamr@2
|
44 |
class CDownloadMgrUiLibRegistry;
|
williamr@2
|
45 |
class CAsyncEventHandlerArray;
|
williamr@2
|
46 |
class CEikAppUi;
|
williamr@2
|
47 |
class CUserInteractionsExtension;
|
williamr@2
|
48 |
|
williamr@2
|
49 |
// CLASS DECLARATION
|
williamr@2
|
50 |
|
williamr@2
|
51 |
/**
|
williamr@2
|
52 |
* The User Interactions supports the followings:
|
williamr@2
|
53 |
* - User confirmation when content-type header arrives
|
williamr@2
|
54 |
* - Handling completed downloads
|
williamr@2
|
55 |
* - Querying HTTP authentication credentials
|
williamr@2
|
56 |
* - Querying proxy authentication credentials
|
williamr@2
|
57 |
* - Error notification
|
williamr@2
|
58 |
* - Client App termination by the User
|
williamr@2
|
59 |
*
|
williamr@2
|
60 |
* @lib Download Manager UI Lib
|
williamr@2
|
61 |
* @since Series 60 2.8
|
williamr@2
|
62 |
*/
|
williamr@2
|
63 |
NONSHARABLE_CLASS( CDownloadMgrUiUserInteractions ) :
|
williamr@2
|
64 |
public CDownloadMgrUiBase,
|
williamr@2
|
65 |
public MHttpDownloadMgrObserver
|
williamr@2
|
66 |
{
|
williamr@2
|
67 |
public: // Constructors and destructor
|
williamr@2
|
68 |
|
williamr@2
|
69 |
/**
|
williamr@2
|
70 |
* Two-phased constructor.
|
williamr@2
|
71 |
*/
|
williamr@2
|
72 |
static CDownloadMgrUiUserInteractions* NewL
|
williamr@2
|
73 |
( CDownloadMgrUiLibRegistry& aRegistryModel );
|
williamr@2
|
74 |
|
williamr@2
|
75 |
/**
|
williamr@2
|
76 |
* Destructor.
|
williamr@2
|
77 |
*/
|
williamr@2
|
78 |
virtual ~CDownloadMgrUiUserInteractions();
|
williamr@2
|
79 |
|
williamr@2
|
80 |
public: // New functions
|
williamr@2
|
81 |
|
williamr@2
|
82 |
/**
|
williamr@2
|
83 |
* Client Apps can call this function before exiting the application.
|
williamr@2
|
84 |
* It should be called when the user terminates the application.
|
williamr@2
|
85 |
* It opens a confirmation query.
|
williamr@2
|
86 |
* @return OK to exit? True/False. It is only a suggested value!
|
williamr@2
|
87 |
*/
|
williamr@2
|
88 |
IMPORT_C TBool OkToExitL();
|
williamr@2
|
89 |
|
williamr@2
|
90 |
/**
|
williamr@2
|
91 |
* Client Apps can call this function in the App UI's destructor.
|
williamr@2
|
92 |
* It has been made non-leavable, so it can be called without TRAP.
|
williamr@2
|
93 |
* It initializes Grouped Soft Notifications, if necessary.
|
williamr@2
|
94 |
* @param aAppUi Reference to the actual App UI.
|
williamr@2
|
95 |
* @param aExitType Exit type when this function is called.
|
williamr@2
|
96 |
* Only ETerminatedBySystem is supported.
|
williamr@2
|
97 |
* @param aViewId View ID of the view where to switch in case user chooses
|
williamr@2
|
98 |
* accept softkey in the soft notification.
|
williamr@2
|
99 |
* @param aCustomMessageId Custom message ID.
|
williamr@2
|
100 |
* @param aViewActivationMsg Custom message sent to the view in
|
williamr@2
|
101 |
* the view activation process.
|
williamr@2
|
102 |
* @return Error code or KErrNone.
|
williamr@2
|
103 |
*/
|
williamr@2
|
104 |
IMPORT_C TInt PrepareToExit( CEikAppUi& aAppUi,
|
williamr@2
|
105 |
TClientAppExitType aExitType,
|
williamr@2
|
106 |
TVwsViewId aViewId,
|
williamr@2
|
107 |
TUid aCustomMessageId,
|
williamr@2
|
108 |
const TDesC8& aViewActivationMsg );
|
williamr@2
|
109 |
|
williamr@2
|
110 |
/**
|
williamr@2
|
111 |
* Client Apps can call this function in the App UI's destructor.
|
williamr@2
|
112 |
* It has been made non-leavable, so it can be called without TRAP.
|
williamr@2
|
113 |
* It initializes Grouped Soft Notifications, if necessary.
|
williamr@2
|
114 |
* @param aAppUid 3rd UID of the application.
|
williamr@2
|
115 |
* @param aViewId View ID that needs to be activated.
|
williamr@2
|
116 |
* @param aCustomMessageId Custom message ID.
|
williamr@2
|
117 |
* @return Error code or KErrNone.
|
williamr@2
|
118 |
*/
|
williamr@2
|
119 |
IMPORT_C TInt PrepareToExit( TUint32 aAppUid,
|
williamr@2
|
120 |
TUint32 aViewId,
|
williamr@2
|
121 |
TUint32 aCustomMessageId );
|
williamr@2
|
122 |
|
williamr@2
|
123 |
/**
|
williamr@2
|
124 |
* Currently it supports handling completed download.
|
williamr@2
|
125 |
* COD download is deleted, otherwise normal behaviour, that
|
williamr@2
|
126 |
* depends on EDlAttrAction (EDoNothing/EMove/ELaunch).
|
williamr@2
|
127 |
* @param aDownload The actual download
|
williamr@2
|
128 |
* @return -
|
williamr@2
|
129 |
*/
|
williamr@2
|
130 |
IMPORT_C void HandleDownloadL( RHttpDownload& aDownload );
|
williamr@2
|
131 |
|
williamr@2
|
132 |
/**
|
williamr@2
|
133 |
* The number of download confirmations being shown.
|
williamr@2
|
134 |
* @return Non-negative integer value.
|
williamr@2
|
135 |
*/
|
williamr@2
|
136 |
TInt DownloadConfirmationsShown() const;
|
williamr@2
|
137 |
|
williamr@2
|
138 |
/**
|
williamr@2
|
139 |
* Ask if a handler or something uses the UI, so
|
williamr@2
|
140 |
* others should postpone their tasks that require UI.
|
williamr@2
|
141 |
* @return yes/no.
|
williamr@2
|
142 |
*/
|
williamr@2
|
143 |
TBool IsUiBusy() const;
|
williamr@2
|
144 |
|
williamr@2
|
145 |
/**
|
williamr@2
|
146 |
* Is a Cod ServiceFlow running?
|
williamr@2
|
147 |
* @return yes/no.
|
williamr@2
|
148 |
*/
|
williamr@2
|
149 |
TBool IsCodServiceFlowRunning() const;
|
williamr@2
|
150 |
|
williamr@2
|
151 |
/**
|
williamr@2
|
152 |
* Is Cod ServiceFlow running of the given download?
|
williamr@2
|
153 |
* @param aDownload The download in question.
|
williamr@2
|
154 |
* @return yes/no.
|
williamr@2
|
155 |
*/
|
williamr@2
|
156 |
TBool IsCodServiceFlowRunning( RHttpDownload& aDownload ) const;
|
williamr@2
|
157 |
|
williamr@2
|
158 |
/**
|
williamr@2
|
159 |
* Is a Cod ServiceFlow running?
|
williamr@2
|
160 |
* LEAVing version.
|
williamr@2
|
161 |
* @return yes/no.
|
williamr@2
|
162 |
*/
|
williamr@2
|
163 |
TBool IsCodServiceFlowRunningL() const;
|
williamr@2
|
164 |
|
williamr@2
|
165 |
/**
|
williamr@2
|
166 |
* Is Cod ServiceFlow running of the given download?
|
williamr@2
|
167 |
* LEAVing version.
|
williamr@2
|
168 |
* @param aDownload The download in question.
|
williamr@2
|
169 |
* @return yes/no.
|
williamr@2
|
170 |
*/
|
williamr@2
|
171 |
TBool IsCodServiceFlowRunningL( RHttpDownload& aDownload ) const;
|
williamr@2
|
172 |
|
williamr@2
|
173 |
/**
|
williamr@2
|
174 |
* Postpone handling the given COD download. The download is placed to a
|
williamr@2
|
175 |
* LIFO queue, and SetHandlerRunning( EFalse ) handles (restarts) the first
|
williamr@2
|
176 |
* download in it.
|
williamr@2
|
177 |
* @param aDownload The download to be postponed.
|
williamr@2
|
178 |
*/
|
williamr@2
|
179 |
void PostponeCodHandlingL( RHttpDownload& aDownload );
|
williamr@2
|
180 |
|
williamr@2
|
181 |
/**
|
williamr@2
|
182 |
* Check if the given download is postponed.
|
williamr@2
|
183 |
* @param aDownload The download in question.
|
williamr@2
|
184 |
* @return true/false.
|
williamr@2
|
185 |
*/
|
williamr@2
|
186 |
TBool IsPostponed( RHttpDownload& aDownload ) const;
|
williamr@2
|
187 |
|
williamr@2
|
188 |
/**
|
williamr@2
|
189 |
* Schedule a postponed download for running.
|
williamr@2
|
190 |
*/
|
williamr@2
|
191 |
void SchedulePostponedDownloadL();
|
williamr@4
|
192 |
|
williamr@4
|
193 |
/**
|
williamr@4
|
194 |
* To Set the flag when progressive play is Launched
|
williamr@4
|
195 |
*/
|
williamr@4
|
196 |
inline void SetProgressiveDownloadLaunched( TBool aProgressiveDownloadLaunched ) {iProgressiveDownloadLaunched = aProgressiveDownloadLaunched; }
|
williamr@2
|
197 |
|
williamr@2
|
198 |
public: // Functions from CDownloadMgrUiBase
|
williamr@2
|
199 |
|
williamr@2
|
200 |
/// Attribute enumerations.
|
williamr@2
|
201 |
enum TDownloadMgrUiUserInteractionsAttr
|
williamr@2
|
202 |
{
|
williamr@2
|
203 |
EAttrSuppressDownloadConfirmation ///< TBool, default: EFalse
|
williamr@2
|
204 |
};
|
williamr@2
|
205 |
|
williamr@2
|
206 |
IMPORT_C virtual void GetIntAttributeL( const TUint aAttribute, TInt32& aValue );
|
williamr@2
|
207 |
IMPORT_C virtual void GetBoolAttributeL( const TUint aAttribute, TBool& aValue );
|
williamr@2
|
208 |
IMPORT_C virtual void GetStringAttributeL( const TUint aAttribute, TDes16& aValue );
|
williamr@2
|
209 |
IMPORT_C virtual void GetStringAttributeL( const TUint aAttribute, TDes8& aValue );
|
williamr@2
|
210 |
IMPORT_C virtual void SetIntAttributeL( const TUint aAttribute, TInt32 aValue );
|
williamr@2
|
211 |
IMPORT_C virtual void SetBoolAttributeL( const TUint aAttribute, TBool aValue );
|
williamr@2
|
212 |
IMPORT_C virtual void SetStringAttributeL( const TUint aAttribute, const TDesC16& aValue );
|
williamr@2
|
213 |
IMPORT_C virtual void SetStringAttributeL( const TUint aAttribute, const TDesC8& aValue );
|
williamr@2
|
214 |
|
williamr@2
|
215 |
protected: // Constructors
|
williamr@2
|
216 |
|
williamr@2
|
217 |
/**
|
williamr@2
|
218 |
* C++ default constructor.
|
williamr@2
|
219 |
*/
|
williamr@2
|
220 |
CDownloadMgrUiUserInteractions( CDownloadMgrUiLibRegistry& aRegistryModel );
|
williamr@2
|
221 |
|
williamr@2
|
222 |
/**
|
williamr@2
|
223 |
* By default Symbian 2nd phase constructor is private.
|
williamr@2
|
224 |
*/
|
williamr@2
|
225 |
void ConstructL();
|
williamr@2
|
226 |
|
williamr@2
|
227 |
protected: // New functions
|
williamr@2
|
228 |
|
williamr@2
|
229 |
// Event handler functions
|
williamr@2
|
230 |
|
williamr@2
|
231 |
/**
|
williamr@2
|
232 |
* Wraps DoHandleCompletionWithQueryL() to ensure that only one instance
|
williamr@2
|
233 |
* of the dialog is displayed at any point in time.
|
williamr@2
|
234 |
* @param aDownload The actual download
|
williamr@2
|
235 |
* @return void
|
williamr@2
|
236 |
*/
|
williamr@2
|
237 |
void HandleCompletionWithQueryL( RHttpDownload& aDownload,
|
williamr@2
|
238 |
TBool aIsUiBusy,
|
williamr@2
|
239 |
TBool aIsSupported,
|
williamr@2
|
240 |
TBool aIsDrm,
|
williamr@2
|
241 |
TBool aDrmRightsOnPhone );
|
williamr@2
|
242 |
/**
|
williamr@2
|
243 |
* Handle download completion with query (wait) dialog.
|
williamr@2
|
244 |
* @param aDownload The actual download
|
williamr@2
|
245 |
* @return -
|
williamr@2
|
246 |
*/
|
williamr@2
|
247 |
void DoHandleCompletionWithQueryL( RHttpDownload& aDownload,
|
williamr@2
|
248 |
TBool aIsUiBusy,
|
williamr@2
|
249 |
TBool aIsSupported,
|
williamr@2
|
250 |
TBool aIsDrm,
|
williamr@2
|
251 |
TBool aDrmRightsOnPhone );
|
williamr@2
|
252 |
|
williamr@2
|
253 |
/**
|
williamr@2
|
254 |
* Leaving version of PrepareToExit().
|
williamr@2
|
255 |
* @return None.
|
williamr@2
|
256 |
*/
|
williamr@2
|
257 |
void PrepareToExitL( CEikAppUi* aAppUi,
|
williamr@2
|
258 |
TClientAppExitType aExitType,
|
williamr@2
|
259 |
TVwsViewId aViewId,
|
williamr@2
|
260 |
TUid aCustomMessageId,
|
williamr@2
|
261 |
const TDesC8& aViewActivationMsg );
|
williamr@2
|
262 |
|
williamr@2
|
263 |
/**
|
williamr@2
|
264 |
* Is a stand-alone instance running from the very same application?
|
williamr@2
|
265 |
* @return True/False.
|
williamr@2
|
266 |
*/
|
williamr@2
|
267 |
TBool IsStandAloneAppRunning();
|
williamr@2
|
268 |
|
williamr@2
|
269 |
/**
|
williamr@2
|
270 |
* Delete Event Handler(s) showing download confirmation query.
|
williamr@2
|
271 |
* @param aDownload The actual download.
|
williamr@2
|
272 |
*/
|
williamr@2
|
273 |
void DeleteEventHandlerShowingDlConfirmation( RHttpDownload& aDownload );
|
williamr@2
|
274 |
|
williamr@2
|
275 |
/**
|
williamr@2
|
276 |
* Delete Event Handler(s) belonging to the given download.
|
williamr@2
|
277 |
* @param aDownload The actual download.
|
williamr@2
|
278 |
*/
|
williamr@2
|
279 |
void DeleteEventHandlers( RHttpDownload& aDownload );
|
williamr@2
|
280 |
|
williamr@2
|
281 |
/**
|
williamr@2
|
282 |
* Handle completed normal download (not COD or OMA, not DRM).
|
williamr@2
|
283 |
* @param aDownload The actual download
|
williamr@2
|
284 |
* @return -
|
williamr@2
|
285 |
*/
|
williamr@2
|
286 |
void HandleNormalDownloadL( RHttpDownload& aDownload );
|
williamr@2
|
287 |
|
williamr@2
|
288 |
/**
|
williamr@2
|
289 |
* Check if the download is COD.
|
williamr@2
|
290 |
* @param aDownload The actual download
|
williamr@2
|
291 |
* @return ETrue/EFalse
|
williamr@2
|
292 |
*/
|
williamr@2
|
293 |
TBool CodDownloadL( RHttpDownload& aDownload ) const;
|
williamr@2
|
294 |
|
williamr@2
|
295 |
protected: // Functions from MHttpDownloadMgrObserver
|
williamr@2
|
296 |
|
williamr@2
|
297 |
virtual void HandleDMgrEventL( RHttpDownload& aDownload,
|
williamr@2
|
298 |
THttpDownloadEvent aEvent );
|
williamr@2
|
299 |
|
williamr@2
|
300 |
private: // Data
|
williamr@2
|
301 |
|
williamr@2
|
302 |
CUserInteractionsExtension* iExtension; ///< Extension class, Owned.
|
williamr@2
|
303 |
|
williamr@2
|
304 |
CUserInteractionsUtils* iUiUtils; /**< Owned. Should be only one
|
williamr@2
|
305 |
instance in the UILib! */
|
williamr@2
|
306 |
CAsyncEventHandlerArray* iEventHandlerArray; ///< Owned.
|
williamr@2
|
307 |
|
williamr@2
|
308 |
TBool iDlgActive;
|
williamr@4
|
309 |
|
williamr@4
|
310 |
TBool iProgressiveDownloadLaunched;
|
williamr@2
|
311 |
|
williamr@2
|
312 |
private: // Friend classes
|
williamr@2
|
313 |
|
williamr@2
|
314 |
friend class CUserInteractionsExtension;
|
williamr@2
|
315 |
};
|
williamr@2
|
316 |
|
williamr@2
|
317 |
#endif /* CDOWNLOADMGRUIUSERINTERACTIONS_H */
|