1.1 --- a/epoc32/include/mw/httpdownloadmgrcommon.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/httpdownloadmgrcommon.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,804 @@
1.4 -httpdownloadmgrcommon.h
1.5 +/*
1.6 +* Copyright (c) 2002-2005 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: Common constants used in Download Manager Engine
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +
1.24 +#ifndef HTTPDOWNLOADMGRCOMMON_H
1.25 +#define HTTPDOWNLOADMGRCOMMON_H
1.26 +
1.27 +// INCLUDES
1.28 +#include <e32base.h>
1.29 +
1.30 +// CONSTANTS
1.31 +const TInt KMaxUrlLength = 2048;
1.32 +const TInt KMaxChunkSize = 4096;
1.33 +const TUint KMaxDefAttrLength = 32;
1.34 +const TUint KMaxRealmLength = 128;
1.35 +const TUint KMaxContentTypeLength = 256;
1.36 +const TUint KMaxDispositionTypeLength = 256;
1.37 +const TInt32 KDefaultPort = 80;
1.38 +const TInt32 KDefaultContentLength = -1;
1.39 +const TUint KMaxGeneralHeaderFieldLength = 256;
1.40 +/** Length of a digest hash when represented in hex */
1.41 +const TInt KHashLength = 32;
1.42 +/** Length of a digest hash before converting to hex. */
1.43 +const TInt KRawHashLength = 16;
1.44 +/** Default FOTA package id. Default means no FOTA download! */
1.45 +const TInt32 KDefaultFotaPckgId = -1;
1.46 +/** Non-MediaObject index */
1.47 +const TInt32 KNonMoIndex = 0;
1.48 +/** Index of first media object */
1.49 +const TInt32 KFirstMoIndex = 1;
1.50 +
1.51 +const TInt KColon( ':' );
1.52 +const TInt KSemiColon( ';' );
1.53 +const TInt KQuote( '"' );
1.54 +const TInt KEqual( '=' );
1.55 +
1.56 +_LIT8( KHttpFieldSeparator, "\n");
1.57 +_LIT8( KHttpDispositionTypeAttachment, "attachment");
1.58 +_LIT8( KHttpDispositionTypeInline, "inline");
1.59 +_LIT8( KHttpFileNameParm, "filename");
1.60 +
1.61 +/** OMA DD specific definition */
1.62 +_LIT8( KCodMimeType, "text/x-co-desc" );
1.63 +/** OMA DD specific definition */
1.64 +_LIT8( KDdMimeType, "application/vnd.oma.dd+xml" );
1.65 +/** OMA DD specific definition */
1.66 +_LIT8( KDd2MimeType, "application/vnd.oma.dd2+xml" );
1.67 +_LIT8( KRoapMimeType, "application/vnd.oma.drm.roap-trigger+xml" );
1.68 +
1.69 +/// FOTA Update Package type.
1.70 +_LIT8( KFotaPackageDataType, "application/vnd.nokia.swupd.dp2" );
1.71 +
1.72 +/** OMA DD specific definition */
1.73 +_LIT8( KMultiPartMimeType, "multipart/related" );
1.74 +
1.75 +/** DRM specific MIME type */
1.76 +_LIT8( KDrmMessageMimeType, "application/vnd.oma.drm.message" );
1.77 +/** DRM specific MIME type */
1.78 +_LIT8( KDrmMessageMimeTypeDrmContent, "application/vnd.oma.drm.content" );
1.79 +/** DRM specific MIME type */
1.80 +_LIT8( KDrmMessageMimeTypeDrmDcf, "application/vnd.oma.drm.dcf" );
1.81 +
1.82 +/** DRM specific MIME type */
1.83 +_LIT8( KRoapPduMimeType, "application/vnd.oma.drm.roap-pdu+xml" );
1.84 +
1.85 +/** Enumeration indicating download state.
1.86 + * The download states from EHttpDlMoved are temporary. E.g. download adopt
1.87 + * EHttpDlMoved state, but right after that, it returns to the original
1.88 + * EHttpDlCompleted state.
1.89 + */
1.90 +enum THttpDownloadState
1.91 + {
1.92 + EHttpDlCreated = 1,
1.93 + EHttpDlInprogress,
1.94 + EHttpDlPaused,
1.95 + EHttpDlCompleted,
1.96 + EHttpDlFailed,
1.97 +
1.98 + /// download is moved from one client instance to another one.
1.99 + EHttpDlMoved,
1.100 + /// MMC card or other storage media is removed from the phone.
1.101 + EHttpDlMediaRemoved,
1.102 + /** MMC card or other storage media inserted and
1.103 + * downloaded content file found on it.
1.104 + * If MMC card inserted, but (partially) downloaded content file
1.105 + * is not found on it, download is failed with error reason
1.106 + * EContentFileIntegrity. */
1.107 + EHttpDlMediaInserted,
1.108 + /** Download process can be paused again. This event only occurs after
1.109 + * EHttpDlNonPausable. */
1.110 + EHttpDlPausable,
1.111 + /// Download process cannot be paused, or the content will be lost.
1.112 + EHttpDlNonPausable,
1.113 + /// Download is deleted from another client instance.
1.114 + EHttpDlDeleted,
1.115 + /// Download is started when it's already progressing
1.116 + EHttpDlAlreadyRunning,
1.117 + /// Download is going to be deleted.
1.118 + EHttpDlDeleting,
1.119 + /// Out of network coverage, in case of non-pausable downloads
1.120 + EHttpDlNonPausableNetworkLoss,
1.121 + EHttpDlMultipleMOStarted,
1.122 + EHttpDlMultipleMOCompleted,
1.123 + EHttpDlMultipleMOFailed,
1.124 + /// Internally used download event. Do NOT deal with them
1.125 + EHttpDlCancelTransaction = 128
1.126 + };
1.127 +
1.128 +/** Enumeration indicating download progress state.
1.129 + * These enumarated values usually come with EHttpDlInprogress.
1.130 + * An exception is EHttpContentTypeReceived that pauses the download
1.131 + * until client app accepts and resumes, or deletes/resets it.
1.132 + */
1.133 +enum THttpProgressState
1.134 + {
1.135 + EHttpProgNone = 0,
1.136 +
1.137 + EHttpStarted = 500,
1.138 +
1.139 + EHttpProgCreatingConnection = 1000,
1.140 + EHttpProgConnectionNeeded = 1010,
1.141 + EHttpProgConnected = 1020,
1.142 +
1.143 + EHttpProgConnectionSuspended = 1022,
1.144 +
1.145 + EHttpProgDisconnected = 1030,
1.146 +
1.147 + EHttpProgDownloadStarted = 2000,
1.148 + EHttpContentTypeRequested = EHttpProgDownloadStarted + 20,
1.149 +
1.150 + /** Download status is EHttpDlPaused!
1.151 + * Application can check the received content type here and decide whether
1.152 + * to accept it or not. Call Start again to carry on download, or Delete to
1.153 + * delete this download. */
1.154 + EHttpContentTypeReceived,
1.155 +
1.156 + EHttpProgSubmitIssued = EHttpProgDownloadStarted + 30,
1.157 +
1.158 + EHttpProgResponseHeaderReceived = 2050,
1.159 + EHttpProgResponseBodyReceived,
1.160 + EHttpProgRedirectedPermanently,
1.161 + EHttpProgRedirectedTemporarily,
1.162 + EHttpProgDlNameChanged,
1.163 + EHttpProgContentTypeChanged,
1.164 +
1.165 + /// OMA DD specific progress
1.166 + EHttpProgCodDescriptorDownloaded = 2500,
1.167 + /// OMA DD specific progress
1.168 + EHttpProgCodDownloadStarted,
1.169 + /// Cod is accepted
1.170 + EHttpProgCodDescriptorAccepted,
1.171 + /** Cod Handler downloaded the content, but still needs to continue some
1.172 + * operation. Call Start again to carry on! Download status is
1.173 + * EHttpDlInprogress! */
1.174 + EHttpProgCodLoadEnd,
1.175 + EHttpProgSupportedMultiPart,
1.176 +
1.177 + EHttpProgCodPdAvailable,
1.178 + EHttpProgCodDownloadShouldResume,
1.179 + EHttpProgCodDownloadPause,
1.180 +
1.181 + EHttpProgMovingContentFile = 3000,
1.182 + EHttpProgContentFileMoved,
1.183 +
1.184 + // We have received sufficient HTTP response body to allow us to recognize
1.185 + // content-type from data rather than trust content-type header
1.186 + EHttpContTypeRecognitionAvail,
1.187 +
1.188 + //The state is used for duplicate files .The duplicate file is renamed
1.189 + //and move happens simultaneously
1.190 + EHttpProgContentFileMovedAndDestFNChanged,
1.191 +
1.192 + // Progress event to indicate download is progressively played
1.193 + EHttpDlProgProgressive,
1.194 +
1.195 + // Progress event to indicate download is not progressively played
1.196 + EHttpDlProgNonProgressive
1.197 + };
1.198 +
1.199 +/** Enums to access session level attributes.
1.200 +* Attribute types: string(8/16), TInt32, TBool.
1.201 +* Some of them indicated as read-only. In debug mode if the client
1.202 +* application tries to write such attribute server panics.
1.203 +* In release mode it only returns with KErrArgument.
1.204 +* If not specified other, buffer size is KMaxDefAttrLength.
1.205 +*
1.206 +* Every 8bits string attribute can be queried into 16bits descriptor.
1.207 +* In this case the 8bits buffer is converted into a 16bits one.
1.208 +*/
1.209 +enum THttpDownloadMgrAttrib
1.210 + {
1.211 + EDlMgrAppUid, /**< Unique id of the application
1.212 + * passed in Connect.
1.213 + * (TInt32 - read only) */
1.214 +
1.215 + EDlMgrIap, /**< Internet Access Point
1.216 + * (TInt32 - read/write)
1.217 + * (default: default AP used from CommsDb) */
1.218 +
1.219 + EDlMgrExitAction, /**< See THttpDownloadMgrExitAction
1.220 + * (TInt32 - read/write)
1.221 + * (default: EExitNothing) */
1.222 +
1.223 + EDlMgrSilentMode, /**< No UI interaction in download process
1.224 + * (TBool - read/write)
1.225 + * (default: EFalse)
1.226 + * It is supported only in case of FOTA!!! */
1.227 +
1.228 + EDlMgrMaster, /**< Used if application can be executed in multiple
1.229 + * instances (stand-alone and embedded).
1.230 + * This flag indicates that this instance, while running,
1.231 + * will inherit downloads of all other instances's
1.232 + * when they closed.
1.233 + * Two masters are forbidden in the same time.
1.234 + * (TBool - read/write)
1.235 + * (default: EFalse) */
1.236 +
1.237 + EDlMgrAllDlsInMaster, /**< Returns the number of downloads of the Master
1.238 + * instance of the application
1.239 + * (TInt32 - read-only) */
1.240 +
1.241 + EDlMgrNoMediaDlsInMaster, /**< Returns the number of downloads of the
1.242 + * Master instance, those downloads were stored on a
1.243 + * media, that media is not present in the phone.
1.244 + * (TInt32 - read-only) */
1.245 +
1.246 + EDlMgrConnectionName, /**< Name of the connection to be used to create
1.247 + * connection.
1.248 + * Or on return it is name of connection used by this instance of
1.249 + * download manager. Connection has to be established before this
1.250 + * attribute could be returned. Same as RConnection::Name().
1.251 + * Download Manager automatically connects to network with the
1.252 + * given name.
1.253 + * (String16<KMaxName> - read/write) */
1.254 +
1.255 + EDlMgrAPName, /**< Name of the access point used. Valid only if the IAP id
1.256 + * is known by download manager
1.257 + * (String16 - read-only)
1.258 + * (Not supported on yet!) */
1.259 +
1.260 + EDlMgrNumInprogressDownloads,
1.261 + /**< Number of in-progress downloads of the client.
1.262 + * (TInt32 - read-only) */
1.263 +
1.264 + EDlMgrConnected, /**< Returns ETrue if the session have active connection.
1.265 + * (TBool - read-only) */
1.266 +
1.267 + EDlMgrNoMediaDls, /**< Returns the number of downloads that are
1.268 + * stored on a media that is not present in the phone.
1.269 + * (e.g. MMC that is unplugged) */
1.270 +
1.271 + EDlMgrEnableCookies, /**< Client can specify cookie usage in downloads
1.272 + * via this attribute.
1.273 + * (TBool - read/write)
1.274 + * (default: ETrue) */
1.275 +
1.276 + EDlAutoConnect, /**< Connection is automatically created if not
1.277 + * exists and this attribute is ETrue. If it's EFalse and no
1.278 + * connection, EHttpProgConnectionNeeded is sent to
1.279 + * the client.
1.280 + * (TBool - read/write)
1.281 + * (default: ETrue) */
1.282 + EDlMgrAutoConnect = EDlAutoConnect,
1.283 +
1.284 + EDlMgrFotaDownload, /**< Deprecated! Do not use!!!
1.285 + * Indicates that it is a FOTA download
1.286 + * (TBool - read/write)
1.287 + * (default: EFalse) */
1.288 +
1.289 + EDlMgrCodFolder, /**< Folder to store COD contents
1.290 + * (String16<KMaxPath> - read-only)
1.291 + * (Not supported on yet!) */
1.292 + EDlMgrNumOfClientSideDownload,
1.293 + /**< Number of client side download
1.294 + * (TInt32 - read-only) */
1.295 + EDlMgrHasActiveDownloads,
1.296 + /**< Indicates there are unfinished downloads, particularly
1.297 + * important during re-start of DownloadMgr after failure
1.298 + * of DownloadManager or device */
1.299 + EDlMgrAutoAcceptCod, /**< Tells CODHandler to suppress download confirmation
1.300 + * dialog for user acceptance of COD/OMA downloads */
1.301 +
1.302 + EDlMgrProgressiveDownload /**< Used to control progressiveness
1.303 + * of all downoads in a session
1.304 + * (TBool - read/write)*/
1.305 +
1.306 + };
1.307 +
1.308 +/** Enums to access download specific attributes.
1.309 +* Attribute types: string(8/16), TInt32, TBool.
1.310 +* Some of them indicated as read-only. In debug mode
1.311 +* if the client application tries to write such attribute
1.312 +* server panics. In release mode it only returns with
1.313 +* KErrArgument.
1.314 +* If not specified anyway buffer size is KMaxDefAttrLength.
1.315 +*/
1.316 +enum THttpDownloadAttrib
1.317 + {
1.318 + // Download progress attributes
1.319 + EDlAttrState, /**< See THttpDownloadState
1.320 + * (TInt32 - read-only) */
1.321 +
1.322 + EDlAttrProgressState, /**< See THttpProgressState
1.323 + * (TInt32 - read-only) */
1.324 +
1.325 + EDlAttrUserData, /**< Any user defined data that can fit into 32bits
1.326 + * (TInt32 - read/write) */
1.327 +
1.328 + EDlAttrId, /**< Unique id of the download.
1.329 + * (TInt32 - read-only) */
1.330 +
1.331 + //
1.332 + // Attributes mandatory to issue the request
1.333 + //
1.334 + EDlAttrReqUrl = 100, /**< Requested URL of the content.
1.335 + * (String8<KMaxUrlLength> - read/write */
1.336 +
1.337 + EDlAttrRedirUlr, /**< URL after the last permanent redirection.
1.338 + * When download is created or reseted it's the same
1.339 + * as EDlAttrReqUrl.
1.340 + * (String8<KMaxUrlLength> - read-only) */
1.341 + EDlAttrRedirUrl = EDlAttrRedirUlr,
1.342 +
1.343 + EDlAttrCurrentUrl, /**< Current URL of the content. It's always updated if
1.344 + * transaction redirected (permanently/temporary).
1.345 + * (String8<KMaxUrlLength> - read-only) */
1.346 +
1.347 + EDlAttrName, /**< Name of the download. Generated from URL path.
1.348 + * If URL doesn't contain filename in the path
1.349 + * this name is 'index.html' as per default.
1.350 + * (String16<KMaxPath> - read-only) */
1.351 +
1.352 + EDlAttrPort, /**< Port address of the host
1.353 + * (TInt32 - read/write)
1.354 + * (default: KDefaultPort) */
1.355 +
1.356 + EDlAttrMethod, /**< Do not use it. For internal usage only!!!
1.357 + * (TInt32 - read/write) */
1.358 +
1.359 + EDlAttrRequestHeaderAddon, /**< Client application can specify addition request
1.360 + * header field with this attribute.
1.361 + * Additional header fields cannot override the ones
1.362 + * set by Download Manager!
1.363 + * Format is:
1.364 + * fieldname KColon fieldrawdata [KHttpFieldSeparator fieldname KColon fieldrawdata]
1.365 + * Do not insert whitespaces between fieldname and ":" and fieldrawdata!
1.366 + * Sample format string: "%S%c%S".
1.367 + * (String8 - read/write) */
1.368 +
1.369 + EDlAttrNextBodyData, /**< Returns the next body chunk.
1.370 + * (String8<KMaxChunkSize> - read-only)
1.371 + * (Not supported on v2.8!) */
1.372 +
1.373 + EDlAttrReleaseBodyData, /**< Retrieving attribute releases memory allocated
1.374 + * for body chunk returned in a previous
1.375 + * EDlAttrNextBodyData call.
1.376 + * On return it indicates that that chunk was the last one.
1.377 + * (TBool - read-only)
1.378 + * (Not supported on v2.8!) */
1.379 +
1.380 + EDlAttrRedirected, /**< Indicates that temporary redirection occured.
1.381 + * Pausing this download is dangerous, because on
1.382 + * restart only the original URL, or the last
1.383 + * permenently redirected URL is used. It's not
1.384 + * guaranteed that HTTP server will provide the same
1.385 + * content on restart after a temporary redirection.
1.386 + * (TBool - read-only) */
1.387 +
1.388 + EDlAttrResponseHeader, /**< In continue download, client application can
1.389 + * pass the received response header via this
1.390 + * attribute.
1.391 + * Format is the same as in case of EDlAttrRequestHeaderAddon.
1.392 + * (String8 - write-only. Accepted only if EDlAttrContinue is ETrue) */
1.393 +
1.394 + EDlAttrRequestHeaderAddonLength, /**< Length of the request header add-on,
1.395 + * set by client application.
1.396 + * (TInt - read-only) */
1.397 +
1.398 + //
1.399 + // HTTP/Proxy authentication attributes.
1.400 + // Have to be set when state is EHttpDlPaused/EHttpContentTypeReceived
1.401 + //
1.402 + EDlAttrAuthScheme = 200, /**< Scheme of authentication.
1.403 + * See THttpAuthenticationScheme!
1.404 + * (TInt - read/write. Write is accepted only if EDlAttrContinue is ETrue) */
1.405 +
1.406 + EDlAttrRealm, /**< Realm of the HTTP authentication
1.407 + * (String8<KMaxRealmLength> - read/write.
1.408 + * Write is accepted only if EDlAttrContinue is ETrue) */
1.409 +
1.410 + EDlAttrUsername, /**< User name.
1.411 + * (String8 - read/write) */
1.412 +
1.413 + EDlAttrPassword, /**< Password.
1.414 + * (String8 - write-only) */
1.415 +
1.416 + EDlAttrProxyRealm, /**< Realm of the proxy authentication.
1.417 + * (String8<KMaxRealmLength> - read/write.
1.418 + * Write is accepted only if EDlAttrContinue is ETrue) */
1.419 +
1.420 + EDlAttrProxyUsername, /**< User name for proxy authentication.
1.421 + * (String8 - read/write) */
1.422 +
1.423 + EDlAttrProxyPassword, /**< Password for proxy authentication.
1.424 + * (String8 - write-only) */
1.425 +
1.426 + //
1.427 + // Miscellaneous download attributes
1.428 + //
1.429 + EDlAttrDestFilename, /**< Destination filename. Content will be
1.430 + * moved/renamed here after download completed.
1.431 + * Can be set only before Start and after
1.432 + * download successfully completed.
1.433 + * (String16<KMaxPath> - read/write) */
1.434 +
1.435 + EDlAttrLength, /**< Full size of the content.
1.436 + * (TInt32 - read/write.
1.437 + * Write is accepted only if EDlAttrContinue is ETrue)
1.438 + * (default: KDefaultContentLength - until content size is known) */
1.439 +
1.440 + EDlAttrDownloadedSize, /**< Downloaded size of the content.
1.441 + * (TInt32 - read-only) */
1.442 +
1.443 + EDlAttrNoContentTypeCheck, /**< Content is downloaded w/o content type validation.
1.444 + * (TBool - read/write)
1.445 + * (default: EFalse) */
1.446 +
1.447 + EDlAttrContinueBody, /**< In case of continue download, the client application
1.448 + * can pass already received body data to download manager
1.449 + * via this attribute. Note that if the download is not started this
1.450 + * data is lost, because download manager doesn't persist it until that.
1.451 + * It is because it's actually not surely known what the destination file
1.452 + * size&name until that.
1.453 + * (String8 - write only. Accepted only if EDlAttrContinue is ETrue)
1.454 + * (String16 - write only. Accepted only if EDlAttrContinue is ETrue.
1.455 + * 8bits data stream stored in 16bits descriptor.) */
1.456 +
1.457 + EDlAttrDestRemovable, /**< Indicates that the content file is stored on
1.458 + * a removable media.
1.459 + * (TBool - read-only) */
1.460 +
1.461 + //
1.462 + // Attributes to indicate error occured during download
1.463 + //
1.464 + EDlAttrStatusCode = 500, /**< Status code from response header
1.465 + * (TInt32 - read-only) */
1.466 +
1.467 + EDlAttrErrorId, /**< See THttpDownloadMgrError
1.468 + * (TInt32 - read-only) */
1.469 +
1.470 + EDlAttrGlobalErrorId, /**< Global error id
1.471 + * (TInt32 - read-only) */
1.472 +
1.473 + EDlAttrContentType, /**< Content type from response header
1.474 + * (String8<KMaxContentTypeLength> - read/write.
1.475 + * Write is accepted only if EDlAttrCodDownload is ETrue) */
1.476 +
1.477 + EDlAttrTargetApp, /**< Target app that can open the content
1.478 + * (TInt32 - read/write.
1.479 + * Write is accepted only if EDlAttrContinue is ETrue) */
1.480 +
1.481 + EDlAttrMediaType, /**< Media type from response header. See RFC2616.
1.482 + * (String8<KMaxContentTypeLength> - read-only) */
1.483 + EDlAttrMediaTypeBoundary, /**< Boundary attribute from media type.
1.484 + * (String8<KMaxContentTypeLength> - read-only) */
1.485 +
1.486 + EDlAttrAttachmentFileName,
1.487 +
1.488 + //
1.489 + // Other
1.490 + //
1.491 + EDlAttrDisconnectOnReset = 1000, /**< Automatic disconnection when Reset called.
1.492 + * (TBool - read/write)
1.493 + * (default: ETrue) */
1.494 +
1.495 + EDlAttrDisconnectOnPause, /**< Automatic disconnection when Pause called.
1.496 + * In progress state EHttpContentTypeReceived
1.497 + * download is in paused state but connection is
1.498 + * not closed.
1.499 + * (TBool - read/write)
1.500 + * (default: ETrue) */
1.501 +
1.502 + EDlAttrUnused1,
1.503 +
1.504 + EDlAttrAction, /**< See THttpDownloadMgrAction
1.505 + * (TInt32 - read/write)
1.506 + * (default: ELaunch ) */
1.507 +
1.508 + EDlAttrRestartAction, /**< See THttpRestartActions
1.509 + * (TInt32 - read/write)
1.510 + * (default: ERestartIfExpired ) */
1.511 +
1.512 + EDlAttrNoMedia, /**< ETrue if the media, on which the download is stored, is removed.
1.513 + * A Reset clears this flag.
1.514 + * (TBool - read only) */
1.515 +
1.516 + EDlAttrContinue, /**< Indicates that download was started in
1.517 + * client app but that doesn't handle it.
1.518 + * Download is created with RHttpDownloadMgr::CreateClientSideDownloadL().
1.519 + * (TBool - read-only)
1.520 + * (default: EFalse) */
1.521 +
1.522 + EDlAttrPausable, /**< If EFalse, download cannot be paused, or the
1.523 + * content will be lost.
1.524 + * (TBool - read-only)
1.525 + * (default: ETrue) */
1.526 +
1.527 + EDlAttrHidden, /**< If true download is NOT shows in the download
1.528 + * list or in any way to the user.
1.529 + * (TBool - read/write)
1.530 + * (default: EFalse) */
1.531 +
1.532 + EDlAttrSilent, /**< No progress events sent to the client application.
1.533 + * Only exceptions are:
1.534 + * EHttpDlInprogress - EHttpStarted
1.535 + * EHttpDlCompleted
1.536 + * EHttpDlFailed
1.537 + * (TBool - read/write)
1.538 + * (default: EFalse) */
1.539 +
1.540 + EDlAttrProgressive, /**< Indicates that this is a progressive download.
1.541 + * (TBool - read/write)
1.542 + * (default: EFalse) */
1.543 +
1.544 + EDlAttrFotaPckgId, /**< Fota package ID.
1.545 + * (TInt32 - read/write)
1.546 + * (default: KDefaultFotaPckgId. Default means no FOTA download! ) */
1.547 +
1.548 + EDlAttrDownloadNextUrl, /**< This attribute is not supported from 3.0!
1.549 + * Beginning from 3.0, Download Manager never
1.550 + * downloads the next-uri of OMA/COD downloads
1.551 + * automatically, but forwards the next-uri to the
1.552 + * client via MHttpDownloadMgrNextUriObserver,
1.553 + * then the client can create a new download with
1.554 + * the next-uri it has got, if it wants so. */
1.555 +
1.556 + EDlAttrDownloadUpdatedDDUri,/**< If ETrue, updated DD URI is present in download descriptor.
1.557 + * Start download with updatd DD URI.
1.558 + * (TBool - read/write)
1.559 + * (default: EFalse)
1.560 + */
1.561 +
1.562 + EDlAttrUpdatedDDUri, /**< Updated DD URI.
1.563 + * (String8<KMaxUrlLength> - read/write
1.564 + */
1.565 +
1.566 + EDlAttrDDType, /**< Content type of the descriptor for OMA downloads.
1.567 + * For HTTP this will be content type of the MO
1.568 + * (String8<KMaxContentTypeLength> - read only.
1.569 + */
1.570 +
1.571 + /** Application can set and query raw header
1.572 + * fields and values via these attributes.
1.573 + * (String<KMaxGeneralHeaderFieldLength> - read/write) */
1.574 + EDlAttrHeaderFields = 1500,
1.575 + EDlAttrCharSet = EDlAttrHeaderFields, // Character Set
1.576 + EDlAttrResponseCharSet = EDlAttrCharSet,
1.577 + EDlAttrResponseAge,
1.578 + EDlAttrResponseETag,
1.579 + EDlAttrResponseLocation,
1.580 + EDlAttrResponseRetryAfter,
1.581 + EDlAttrResponseServer,
1.582 + EDlAttrResponseVary,
1.583 +
1.584 + /** Request headers */
1.585 + EDlAttrRequestAccept = 2000,
1.586 + EDlAttrRequestAcceptCharSet,
1.587 + EDlAttrRequestAcceptLanguage,
1.588 + EDlAttrRequestExpect,
1.589 + EDlAttrRequestFrom,
1.590 + EDlAttrRequestHost,
1.591 + EDlAttrRequestMaxForwards,
1.592 + EDlAttrRequestPragma,
1.593 + EDlAttrRequestReferer,
1.594 + EDlAttrRequestUserAgent,
1.595 + EDlAttrRequestVary,
1.596 +
1.597 + /** Entity header fields */
1.598 + EDlAttrEntityAllow = 2500,
1.599 + EDlAttrEntityContentEncoding,
1.600 + EDlAttrEntityContentLanguage,
1.601 + EDlAttrEntityContentLocation,
1.602 + EDlAttrEntityExpires,
1.603 + EDlAttrEntityLastModified,
1.604 +
1.605 + /** General header fields */
1.606 + EDlAttrGeneralCacheControl = 3000,
1.607 + EDlAttrGeneralDate,
1.608 + EDlAttrGeneralPragma,
1.609 + EDlAttrGeneralVia,
1.610 + EDlAttrGeneralWarning,
1.611 +
1.612 + /** Internally used attribute! Do NOT use! */
1.613 + EDlAttrSucceeded = 8192,
1.614 + /** Internally used attribute! Do NOT use! */
1.615 + EDlAttUnused2,
1.616 + /** Internally used attribute! Do NOT use! */
1.617 + EDlAttrFailed,
1.618 +
1.619 + EDlAttrCodDownload, /**< Indicates that it is an OMA DD downlad,
1.620 + * and the content is downloaded by COD Handler.
1.621 + * (TBool - read-only)
1.622 + * (default: EFalse) */
1.623 +
1.624 + /** Internally used attribute! Do NOT use! */
1.625 + EDlAttrHashedMsgBody,
1.626 + /** Internally used attribute! Do NOT use! */
1.627 + EDlAttrDefaultEvent,
1.628 + /** Internally used attribute! Do NOT use! */
1.629 + EDlAttrRedirectedTemporary,
1.630 + /** Internally used attribute! Do NOT use! */
1.631 + EDlAttrRedirectedPermanently,
1.632 + /** Internally used attribute! Do NOT use! */
1.633 + EDlAttrCodDescriptorAccepted,
1.634 + /** Internally used attribute! Do NOT use! */
1.635 + EDlAttrCodLoadEnd,
1.636 +
1.637 + EDlAttrDiskBufferingSize,
1.638 + /**< Indicates how large a buffer (in bytes) to
1.639 + * use when writing this download to disk. A
1.640 + * value of 0 indicates no buffering. */
1.641 +
1.642 + /** Internally used attribute! Do NOT use! */
1.643 + EDlAttrCodPdAvailable, /* This is introduced for OMA 2 (DD2). Indicates that progressive download is available
1.644 + * in case if license element exists in the DD2 this attribute is set when the right obj
1.645 + * is available and the Progressive download element is true.
1.646 + * In case when the license element in not represented this attribute is set if
1.647 + * the Progressive download element is true.
1.648 + */
1.649 +
1.650 + EDlAttrLocalFileName, /* This is introduced for OMA 2 (DD2).
1.651 + * Local filename. Content will be
1.652 + * moved from this location.
1.653 + * This attribute should be set before the client sends the Move command
1.654 + * (String16<KMaxPath> - read/write) */
1.655 +
1.656 + /** Internally used attribute! Do NOT use! */
1.657 +
1.658 + EDlAttrCodPausable, /**< Would update the server about Pausability of COD Download.
1.659 + * This attribute is only used for COD downloads to update pause attibure in server
1.660 + * (TBool - write only)
1.661 + */
1.662 +
1.663 + EDlAttrDdFileName, /** For storing DD File name. */
1.664 + EDlAttrActiveDownload,
1.665 + EDlAttrActivePlayedDownload,
1.666 + EDlAttrNumMediaObjects,
1.667 + EDlAttrMultipleMOLength,/**< specifies total length of all MOs for the download.
1.668 + * (TInt32 - read/write. */
1.669 +
1.670 + EDlAttrMultipleMODownloadedSize, /**< current downloaded size (the sum of downloaded size of all completed MOs. Completed MOs can be successful/failed/paused MOs). .
1.671 + * (TInt32 - read-only) */
1.672 + EDlAttrAlbumName /**< Name of the album. In case of non-album download, this is the download name.
1.673 + * (String16<KMaxPath> - read-only) */
1.674 + };
1.675 +
1.676 +/**
1.677 +* See RFC2616.
1.678 +*/
1.679 +enum THttpMethod
1.680 + {
1.681 + EMethodGET,
1.682 + EMethodPOST,
1.683 + EMethodHEAD
1.684 + };
1.685 +
1.686 +/**
1.687 +* Authentication scheme
1.688 +*/
1.689 +enum THttpAuthenticationScheme
1.690 + {
1.691 + EAuthBasic, ///< Basic authentication scheme
1.692 + EAuthDigest ///< Digest authentication scheme
1.693 + };
1.694 +
1.695 +/**
1.696 +* This attribute specifies what Download Manager do
1.697 +* with the downloads on exit.
1.698 +*/
1.699 +enum THttpDownloadMgrExitAction
1.700 + {
1.701 + EExitNothing, ///< Downloads remain intacted on exit (default).
1.702 + EExitPause, ///< All downloads paused on exit.
1.703 + EExitDelete ///< All downloads deleted on exit.
1.704 + };
1.705 +
1.706 +/**
1.707 +* The action to do when a download completes.
1.708 +*/
1.709 +enum THttpDownloadMgrAction
1.710 + {
1.711 + /**
1.712 + * Do nothing when download completed.
1.713 + */
1.714 + EDoNothing = 0,
1.715 + /**
1.716 + * Automatically move content to the location pointed by EDlAttrDestFilename
1.717 + */
1.718 + EMove = 0x0001,
1.719 + /**
1.720 + * Automatically lauch target application when download
1.721 + * completed. This is the default if not set (default).
1.722 + */
1.723 + ELaunch = 0x0002,
1.724 + /**
1.725 + * Automatically lauch progressive download
1.726 + */
1.727 + EPdLaunch = 0x0004
1.728 + };
1.729 +
1.730 +/**
1.731 +* Restart actions.
1.732 +*/
1.733 +enum THttpRestartActions
1.734 + {
1.735 + ERestartIfExpired, /**< Download content again if content is expired (default). */
1.736 + ERestartNoIfCompleted, /**< (Re)Start completes with EHttpDlCompleted at
1.737 + * once if already completed.
1.738 + * Anyway starts to download the content only if it's
1.739 + * not modified since last partial download.
1.740 + * Restarted anyway. No content update/expiry check. */
1.741 + ERestartForced /**< Forced download. Don't matter if content is
1.742 + * expired, or not. */
1.743 + };
1.744 +
1.745 +/**
1.746 +* Allocated usable error range: -30421 -> -30470 (includes the 1st and last numbers).
1.747 +*/
1.748 +enum THttpDownloadMgrError
1.749 + {
1.750 + ENoError = 0,
1.751 + EGeneral = -30421, ///< Non-download specific error. See global error code.
1.752 + EInternal = -30422, /**< Internal error occured. Most probably a programming error.
1.753 + * (e.g. download that is stored on a media, that is not present
1.754 + * in the phone, cannot be started) */
1.755 + EContentFileIntegrity = -30423, /**< Content file is missing or has different size then
1.756 + * it should be. EDlAttrNoMedia is ETrue if the media, on which
1.757 + * content file was (partially) stored, removed. */
1.758 + EDiskFull = -30424, ///< Not enough disk space for the content
1.759 + EConnectionFailed = -30425, /**< Most probably IAP id was wrong or no network coverage.
1.760 + * For more specific info about the error see EDlAttrGlobalErrorId. */
1.761 + ETransactionFailed = -30426, /**< Error occured in the transaction.
1.762 + * For more specific info about the error see EDlAttrGlobalErrorId. */
1.763 + EMoveFailed = -30427, /**< Moving content file failed.
1.764 + * See EDlAttrGlobalErrorId for specific reason. */
1.765 + EDestFileWriteFailed = -30428, ///< Destination file write failed.
1.766 + EMMCRemoved = -30429, ///< MMC card, where th download is being persisted, removed.
1.767 + EBadUrl = -30430, /**< Download Manager cannot handle this URL:
1.768 + * - it's too long
1.769 + * - malformed. */
1.770 +
1.771 + // Download attributes related error
1.772 +
1.773 + EWrongDestFilename = -30431,
1.774 + ///< Error in destination filename. Most probably not a real filename.
1.775 + EDestFileInUse = -30432,
1.776 + /**< Destination file cannot be opened/created. It's most probably
1.777 + * in use by other app. or download. */
1.778 +
1.779 + //HTTP error case
1.780 +
1.781 + EHttpUnhandled = -30433,
1.782 + /**< Unhandled HTTP error code. See it in
1.783 + * EDlAttrGlobalErrorId. */
1.784 + EHttpAuthenticationFailed = -30434,
1.785 + /**< 401 - Client has to set username/password
1.786 + * and Start download again. */
1.787 + EProxyAuthenticationFailed = -30435,
1.788 + /**< 407 - Client has to set proxy
1.789 + * username/password and Start download again. */
1.790 + EObjectNotFound = -30436,
1.791 + /**< 404 - Object not found. */
1.792 + EPartialContentModified = -30437,
1.793 + /**< 412: partial content cannot be downloaded because
1.794 + * it's already modified.
1.795 + * Call Reset or set THttpRestartActions::ERestartForced */
1.796 +
1.797 + EContentExpired = -30438,
1.798 + /**< Paused content is expired, or content
1.799 + * is modified between two requests.
1.800 + * Call Reset() or see THttpRestartActions. */
1.801 +
1.802 + // miscellaneous errors
1.803 + EHttpRestartFailed = -30450 /**< Resuming progressive download failed. */
1.804 + };
1.805 +
1.806 +#endif // HTTPDOWNLOADMGRCOMMON_H
1.807 +
1.808 +// End of File