epoc32/include/mw/httpdownloadmgrcommon.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 httpdownloadmgrcommon.h
     1 /*
       
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Common constants used in Download Manager Engine
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef HTTPDOWNLOADMGRCOMMON_H
       
    21 #define HTTPDOWNLOADMGRCOMMON_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 // CONSTANTS
       
    27 const TInt KMaxUrlLength = 2048;
       
    28 const TInt KMaxChunkSize = 4096;
       
    29 const TUint KMaxDefAttrLength = 32;
       
    30 const TUint KMaxRealmLength = 128;
       
    31 const TUint KMaxContentTypeLength = 256;
       
    32 const TUint KMaxDispositionTypeLength = 256;
       
    33 const TInt32 KDefaultPort = 80;
       
    34 const TInt32 KDefaultContentLength = -1;
       
    35 const TUint KMaxGeneralHeaderFieldLength = 256;
       
    36 /**  Length of a digest hash when represented in hex */
       
    37 const TInt KHashLength = 32;
       
    38 /**  Length of a digest hash before converting to hex. */
       
    39 const TInt KRawHashLength = 16;
       
    40 /**  Default FOTA package id. Default means no FOTA download! */
       
    41 const TInt32 KDefaultFotaPckgId = -1;
       
    42 /**  Non-MediaObject index */
       
    43 const TInt32 KNonMoIndex = 0;
       
    44 /**  Index of first media object */
       
    45 const TInt32 KFirstMoIndex = 1;
       
    46 
       
    47 const TInt KColon( ':' );
       
    48 const TInt KSemiColon( ';' );
       
    49 const TInt KQuote( '"' );
       
    50 const TInt KEqual( '=' );
       
    51 
       
    52 _LIT8( KHttpFieldSeparator, "\n");
       
    53 _LIT8( KHttpDispositionTypeAttachment, "attachment");
       
    54 _LIT8( KHttpDispositionTypeInline, "inline");
       
    55 _LIT8( KHttpFileNameParm, "filename");
       
    56 
       
    57 /**  OMA DD specific definition */
       
    58 _LIT8( KCodMimeType, "text/x-co-desc" );
       
    59 /**  OMA DD specific definition */
       
    60 _LIT8( KDdMimeType, "application/vnd.oma.dd+xml" );
       
    61 /**  OMA DD specific definition */
       
    62 _LIT8( KDd2MimeType, "application/vnd.oma.dd2+xml" );
       
    63 _LIT8( KRoapMimeType, "application/vnd.oma.drm.roap-trigger+xml" );
       
    64 
       
    65 /// FOTA Update Package type.
       
    66 _LIT8( KFotaPackageDataType, "application/vnd.nokia.swupd.dp2" );
       
    67 
       
    68 /**  OMA DD specific definition */
       
    69 _LIT8( KMultiPartMimeType, "multipart/related" );
       
    70 
       
    71 /**  DRM specific MIME type */
       
    72 _LIT8( KDrmMessageMimeType, "application/vnd.oma.drm.message" );
       
    73 /**  DRM specific MIME type */
       
    74 _LIT8( KDrmMessageMimeTypeDrmContent, "application/vnd.oma.drm.content" );
       
    75 /**  DRM specific MIME type */
       
    76 _LIT8( KDrmMessageMimeTypeDrmDcf, "application/vnd.oma.drm.dcf" );
       
    77 
       
    78 /**  DRM specific MIME type */
       
    79 _LIT8( KRoapPduMimeType, "application/vnd.oma.drm.roap-pdu+xml" );
       
    80 
       
    81 /**  Enumeration indicating download state. 
       
    82  * The download states from EHttpDlMoved are temporary. E.g. download adopt 
       
    83  * EHttpDlMoved state, but right after that, it returns to the original 
       
    84  * EHttpDlCompleted state.
       
    85  */
       
    86 enum THttpDownloadState
       
    87     {
       
    88     EHttpDlCreated = 1,
       
    89     EHttpDlInprogress,
       
    90     EHttpDlPaused,
       
    91     EHttpDlCompleted,
       
    92     EHttpDlFailed,
       
    93 
       
    94     /// download is moved from one client instance to another one.
       
    95     EHttpDlMoved,
       
    96     /// MMC card or other storage media is removed from the phone.
       
    97     EHttpDlMediaRemoved,
       
    98     /** MMC card or other storage media inserted and 
       
    99     * downloaded content file found on it. 
       
   100     * If MMC card inserted, but (partially) downloaded content file 
       
   101     * is not found on it, download is failed with error reason
       
   102     * EContentFileIntegrity. */
       
   103     EHttpDlMediaInserted,
       
   104     /** Download process can be paused again. This event only occurs after
       
   105     * EHttpDlNonPausable. */
       
   106     EHttpDlPausable,
       
   107     /// Download process cannot be paused, or the content will be lost.
       
   108     EHttpDlNonPausable,
       
   109     /// Download is deleted from another client instance.
       
   110     EHttpDlDeleted,
       
   111     /// Download is started when it's already progressing
       
   112     EHttpDlAlreadyRunning,
       
   113     /// Download is going to be deleted.
       
   114     EHttpDlDeleting,
       
   115     /// Out of network coverage, in case of non-pausable downloads
       
   116     EHttpDlNonPausableNetworkLoss,
       
   117     EHttpDlMultipleMOStarted,
       
   118     EHttpDlMultipleMOCompleted,
       
   119     EHttpDlMultipleMOFailed,
       
   120     /// Internally used download event. Do NOT deal with them
       
   121     EHttpDlCancelTransaction = 128
       
   122     };
       
   123 
       
   124 /**  Enumeration indicating download progress state. 
       
   125  * These enumarated values usually come with EHttpDlInprogress.
       
   126  * An exception is EHttpContentTypeReceived that pauses the download 
       
   127  * until client app accepts and resumes, or deletes/resets it.
       
   128  */
       
   129 enum THttpProgressState
       
   130     {
       
   131     EHttpProgNone = 0,
       
   132 
       
   133     EHttpStarted = 500,
       
   134 
       
   135     EHttpProgCreatingConnection = 1000,
       
   136     EHttpProgConnectionNeeded = 1010,
       
   137     EHttpProgConnected = 1020,
       
   138 
       
   139     EHttpProgConnectionSuspended = 1022,
       
   140 
       
   141     EHttpProgDisconnected = 1030,
       
   142 
       
   143     EHttpProgDownloadStarted = 2000,
       
   144     EHttpContentTypeRequested = EHttpProgDownloadStarted + 20,
       
   145 
       
   146     /**  Download status is EHttpDlPaused!
       
   147     * Application can check the received content type here and decide whether 
       
   148     * to accept it or not. Call Start again to carry on download, or Delete to 
       
   149     * delete this download. */
       
   150     EHttpContentTypeReceived,
       
   151 
       
   152     EHttpProgSubmitIssued = EHttpProgDownloadStarted + 30,
       
   153 
       
   154     EHttpProgResponseHeaderReceived = 2050,
       
   155     EHttpProgResponseBodyReceived,
       
   156     EHttpProgRedirectedPermanently,
       
   157     EHttpProgRedirectedTemporarily,
       
   158     EHttpProgDlNameChanged,
       
   159     EHttpProgContentTypeChanged,
       
   160 
       
   161     /// OMA DD specific progress
       
   162     EHttpProgCodDescriptorDownloaded = 2500,
       
   163     /// OMA DD specific progress
       
   164     EHttpProgCodDownloadStarted,
       
   165     /// Cod is accepted
       
   166     EHttpProgCodDescriptorAccepted,
       
   167     /**  Cod Handler downloaded the content, but still needs to continue some 
       
   168     * operation. Call Start again to carry on! Download status is 
       
   169     * EHttpDlInprogress! */
       
   170     EHttpProgCodLoadEnd,
       
   171     EHttpProgSupportedMultiPart,
       
   172     
       
   173     EHttpProgCodPdAvailable,
       
   174     EHttpProgCodDownloadShouldResume,
       
   175     EHttpProgCodDownloadPause,
       
   176 
       
   177     EHttpProgMovingContentFile = 3000,
       
   178     EHttpProgContentFileMoved,
       
   179 
       
   180     // We have received sufficient HTTP response body to allow us to recognize 
       
   181     // content-type from data rather than trust content-type header
       
   182     EHttpContTypeRecognitionAvail,
       
   183     
       
   184     //The state is used for duplicate files .The duplicate file is renamed
       
   185  	//and move happens simultaneously
       
   186  	EHttpProgContentFileMovedAndDestFNChanged,
       
   187  	
       
   188  	// Progress event to indicate download is progressively played
       
   189     EHttpDlProgProgressive,
       
   190     
       
   191     // Progress event to indicate download is not progressively played
       
   192     EHttpDlProgNonProgressive
       
   193     };
       
   194 
       
   195 /**  Enums to access session level attributes.
       
   196 * Attribute types: string(8/16), TInt32, TBool.
       
   197 * Some of them indicated as read-only. In debug mode if the client 
       
   198 * application tries to write such attribute server panics. 
       
   199 * In release mode it only returns with KErrArgument.
       
   200 * If not specified other, buffer size is KMaxDefAttrLength.
       
   201 *
       
   202 * Every 8bits string attribute can be queried into 16bits descriptor.
       
   203 * In this case the 8bits buffer is converted into a 16bits one.
       
   204 */
       
   205 enum THttpDownloadMgrAttrib
       
   206     {
       
   207     EDlMgrAppUid,    /**<  Unique id of the application
       
   208                             * passed in Connect.
       
   209                             * (TInt32 - read only) */
       
   210 
       
   211     EDlMgrIap,          /**<  Internet Access Point
       
   212                             * (TInt32 - read/write)
       
   213                             * (default: default AP used from CommsDb) */
       
   214 
       
   215     EDlMgrExitAction,  /**<  See THttpDownloadMgrExitAction
       
   216                             * (TInt32 - read/write)
       
   217                             * (default: EExitNothing) */
       
   218 
       
   219     EDlMgrSilentMode,       /**<  No UI interaction in download process
       
   220                             * (TBool - read/write)
       
   221                             * (default: EFalse)
       
   222                             * It is supported only in case of FOTA!!! */
       
   223 
       
   224     EDlMgrMaster,           /**<  Used if application can be executed in multiple
       
   225                             * instances (stand-alone and embedded).
       
   226                             * This flag indicates that this instance, while running, 
       
   227                             * will inherit downloads of all other instances's 
       
   228                             * when they closed.
       
   229                             * Two masters are forbidden in the same time.
       
   230                             * (TBool - read/write)
       
   231                             * (default: EFalse) */
       
   232 
       
   233     EDlMgrAllDlsInMaster,   /**<  Returns the number of downloads of the Master
       
   234                             * instance of the application
       
   235                             * (TInt32 - read-only) */
       
   236 
       
   237     EDlMgrNoMediaDlsInMaster, /**<  Returns the number of downloads of the 
       
   238                             * Master instance, those downloads were stored on a 
       
   239                             * media, that media is not present in the phone.
       
   240                             * (TInt32 - read-only) */
       
   241 
       
   242     EDlMgrConnectionName,   /**<  Name of the connection to be used to create 
       
   243                             * connection.
       
   244                             * Or on return it is name of connection used by this instance of
       
   245                             * download manager. Connection has to be established before this
       
   246                             * attribute could be returned. Same as RConnection::Name().
       
   247                             * Download Manager automatically connects to network with the 
       
   248                             * given name.
       
   249                             * (String16<KMaxName> - read/write) */
       
   250 
       
   251     EDlMgrAPName,   /**<  Name of the access point used. Valid only if the IAP id
       
   252                             * is known by download manager
       
   253                             * (String16 - read-only)
       
   254                             * (Not supported on yet!) */
       
   255 
       
   256     EDlMgrNumInprogressDownloads,  
       
   257                                 /**<  Number of in-progress downloads of the client.
       
   258                                 * (TInt32 - read-only) */
       
   259 
       
   260     EDlMgrConnected,  /**<  Returns ETrue if the session have active connection.
       
   261                             * (TBool - read-only) */
       
   262 
       
   263     EDlMgrNoMediaDls, /**<  Returns the number of downloads that are 
       
   264                             * stored on a media that is not present in the phone. 
       
   265                             * (e.g. MMC that is unplugged) */
       
   266 
       
   267     EDlMgrEnableCookies,  /**<  Client can specify cookie usage in downloads 
       
   268                             * via this attribute.
       
   269                             * (TBool - read/write)
       
   270                             * (default: ETrue) */
       
   271 
       
   272     EDlAutoConnect,    /**<  Connection is automatically created if not 
       
   273                             * exists and this attribute is ETrue. If it's EFalse and no 
       
   274                             * connection, EHttpProgConnectionNeeded is sent to 
       
   275                             * the client.
       
   276                             * (TBool - read/write)
       
   277                             * (default: ETrue) */
       
   278     EDlMgrAutoConnect = EDlAutoConnect,
       
   279 
       
   280     EDlMgrFotaDownload,   /**<  Deprecated! Do not use!!!
       
   281                             * Indicates that it is a FOTA download
       
   282                             * (TBool - read/write)
       
   283                             * (default: EFalse) */
       
   284 
       
   285     EDlMgrCodFolder,    /**<  Folder to store COD contents
       
   286                             * (String16<KMaxPath> - read-only)
       
   287                             * (Not supported on yet!) */
       
   288     EDlMgrNumOfClientSideDownload,    
       
   289                             /**<  Number of client side download
       
   290                             * (TInt32 - read-only) */
       
   291     EDlMgrHasActiveDownloads,
       
   292                             /**< Indicates there are unfinished downloads, particularly
       
   293                               * important during re-start of DownloadMgr after failure
       
   294                               * of DownloadManager or device */
       
   295     EDlMgrAutoAcceptCod,     /**< Tells CODHandler to suppress download confirmation
       
   296                               * dialog for user acceptance of COD/OMA downloads */
       
   297                               
       
   298     EDlMgrProgressiveDownload /**<  Used to control progressiveness
       
   299     							 * of all downoads in a session
       
   300                             	 * (TBool - read/write)*/                              
       
   301 
       
   302     };
       
   303 
       
   304 /**  Enums to access download specific attributes.
       
   305 * Attribute types: string(8/16), TInt32, TBool.
       
   306 * Some of them indicated as read-only. In debug mode
       
   307 * if the client application tries to write such attribute
       
   308 * server panics. In release mode it only returns with
       
   309 * KErrArgument.
       
   310 * If not specified anyway buffer size is KMaxDefAttrLength.
       
   311 */
       
   312 enum THttpDownloadAttrib
       
   313     {
       
   314     // Download progress attributes
       
   315     EDlAttrState,           /**<  See THttpDownloadState 
       
   316                             * (TInt32 - read-only) */
       
   317 
       
   318     EDlAttrProgressState,   /**<  See THttpProgressState 
       
   319                             * (TInt32 - read-only) */
       
   320 
       
   321     EDlAttrUserData,    /**<  Any user defined data that can fit into 32bits
       
   322                             * (TInt32 - read/write) */
       
   323 
       
   324     EDlAttrId,         /**<  Unique id of the download.
       
   325                             * (TInt32 - read-only) */
       
   326 
       
   327     //
       
   328     // Attributes mandatory to issue the request
       
   329     //
       
   330     EDlAttrReqUrl = 100,    /**<  Requested URL of the content.
       
   331                             * (String8<KMaxUrlLength> - read/write */
       
   332 
       
   333     EDlAttrRedirUlr,        /**<  URL after the last permanent redirection.
       
   334                             * When download is created or reseted it's the same
       
   335                             * as EDlAttrReqUrl.
       
   336                             * (String8<KMaxUrlLength> - read-only) */
       
   337     EDlAttrRedirUrl = EDlAttrRedirUlr,
       
   338 
       
   339     EDlAttrCurrentUrl,      /**<  Current URL of the content. It's always updated if
       
   340                             * transaction redirected (permanently/temporary).
       
   341                             * (String8<KMaxUrlLength> - read-only) */
       
   342 
       
   343     EDlAttrName,   /**<  Name of the download. Generated from URL path.
       
   344                             * If URL doesn't contain filename in the path 
       
   345                             * this name is 'index.html' as per default. 
       
   346                             * (String16<KMaxPath> - read-only) */
       
   347 
       
   348     EDlAttrPort,      /**<  Port address of the host 
       
   349                             * (TInt32 - read/write)
       
   350                             * (default: KDefaultPort) */
       
   351 
       
   352     EDlAttrMethod,          /**<  Do not use it. For internal usage only!!!
       
   353                             * (TInt32 - read/write) */
       
   354 
       
   355     EDlAttrRequestHeaderAddon,  /**<  Client application can specify addition request
       
   356                             * header field with this attribute.
       
   357                             * Additional header fields cannot override the ones
       
   358                             * set by Download Manager!
       
   359                             * Format is:
       
   360         * fieldname KColon fieldrawdata [KHttpFieldSeparator fieldname KColon fieldrawdata]
       
   361         * Do not insert whitespaces between fieldname and ":" and fieldrawdata!
       
   362                             * Sample format string: "%S%c%S".
       
   363                             * (String8 - read/write) */
       
   364 
       
   365     EDlAttrNextBodyData,    /**<  Returns the next body chunk.
       
   366                             * (String8<KMaxChunkSize> - read-only)
       
   367                             * (Not supported on v2.8!) */
       
   368 
       
   369     EDlAttrReleaseBodyData, /**<  Retrieving attribute releases memory allocated 
       
   370                             * for body chunk returned in a previous 
       
   371                             * EDlAttrNextBodyData call.
       
   372                             * On return it indicates that that chunk was the last one.
       
   373                             * (TBool - read-only)
       
   374                             * (Not supported on v2.8!) */
       
   375 
       
   376     EDlAttrRedirected,      /**<  Indicates that temporary redirection occured. 
       
   377                             * Pausing this download is dangerous, because on 
       
   378                             * restart only the original URL, or the last 
       
   379                             * permenently redirected URL is used. It's not 
       
   380                             * guaranteed that HTTP server will provide the same 
       
   381                             * content on restart after a temporary redirection.
       
   382                             * (TBool - read-only) */
       
   383 
       
   384     EDlAttrResponseHeader,  /**<  In continue download, client application can 
       
   385                             * pass the received response header via this 
       
   386                             * attribute.
       
   387                             * Format is the same as in case of EDlAttrRequestHeaderAddon.
       
   388                             * (String8 - write-only. Accepted only if EDlAttrContinue is ETrue) */
       
   389 
       
   390     EDlAttrRequestHeaderAddonLength, /**<  Length of the request header add-on, 
       
   391                             * set by client application.
       
   392                             * (TInt - read-only) */
       
   393 
       
   394     //
       
   395     // HTTP/Proxy authentication attributes.
       
   396     // Have to be set when state is EHttpDlPaused/EHttpContentTypeReceived
       
   397     //
       
   398     EDlAttrAuthScheme = 200,  /**<  Scheme of authentication. 
       
   399                             * See THttpAuthenticationScheme!
       
   400                             * (TInt - read/write. Write is accepted only if EDlAttrContinue is ETrue) */
       
   401 
       
   402     EDlAttrRealm,           /**<  Realm of the HTTP authentication
       
   403                             * (String8<KMaxRealmLength> - read/write. 
       
   404                             * Write is accepted only if EDlAttrContinue is ETrue) */
       
   405 
       
   406     EDlAttrUsername,        /**<  User name.
       
   407                             * (String8 - read/write) */
       
   408 
       
   409     EDlAttrPassword,        /**<  Password.
       
   410                             * (String8 - write-only) */
       
   411 
       
   412     EDlAttrProxyRealm,      /**<  Realm of the proxy authentication.
       
   413                             * (String8<KMaxRealmLength> - read/write. 
       
   414                             * Write is accepted only if EDlAttrContinue is ETrue) */
       
   415 
       
   416     EDlAttrProxyUsername,   /**<  User name for proxy authentication.
       
   417                             * (String8 - read/write) */
       
   418 
       
   419     EDlAttrProxyPassword,   /**<  Password for proxy authentication.
       
   420                             * (String8 - write-only) */
       
   421 
       
   422     //
       
   423     // Miscellaneous download attributes
       
   424     //
       
   425     EDlAttrDestFilename,    /**<  Destination filename. Content will be 
       
   426                             * moved/renamed here after download completed.
       
   427                             * Can be set only before Start and after
       
   428                             * download successfully completed.
       
   429                             * (String16<KMaxPath> - read/write) */
       
   430 
       
   431     EDlAttrLength,          /**<  Full size of the content.
       
   432                             * (TInt32 - read/write. 
       
   433                             * Write is accepted only if EDlAttrContinue is ETrue)
       
   434                             * (default: KDefaultContentLength - until content size is known) */
       
   435 
       
   436     EDlAttrDownloadedSize,  /**<  Downloaded size of the content.
       
   437                             * (TInt32 - read-only) */
       
   438     
       
   439     EDlAttrNoContentTypeCheck,  /**<  Content is downloaded w/o content type validation.
       
   440                             * (TBool - read/write)
       
   441                             * (default: EFalse) */
       
   442 
       
   443     EDlAttrContinueBody,    /**<  In case of continue download, the client application
       
   444                             * can pass already received body data to download manager 
       
   445                             * via this attribute. Note that if the download is not started this
       
   446                             * data is lost, because download manager doesn't persist it until that.
       
   447                             * It is because it's actually not surely known what the destination file 
       
   448                             * size&name until that.
       
   449                             * (String8 - write only. Accepted only if EDlAttrContinue is ETrue)
       
   450                             * (String16 - write only. Accepted only if EDlAttrContinue is ETrue. 
       
   451                             * 8bits data stream stored in 16bits descriptor.) */
       
   452 
       
   453 	EDlAttrDestRemovable,	/**<  Indicates that the content file is stored on 
       
   454 	                    * a removable media.
       
   455 	                    * (TBool - read-only) */
       
   456 
       
   457     //
       
   458     // Attributes to indicate error occured during download
       
   459     //
       
   460     EDlAttrStatusCode = 500, /**<  Status code from response header
       
   461                             * (TInt32 - read-only) */
       
   462 
       
   463     EDlAttrErrorId, /**<  See THttpDownloadMgrError
       
   464                             * (TInt32 - read-only) */
       
   465 
       
   466     EDlAttrGlobalErrorId,   /**<  Global error id
       
   467                             * (TInt32 - read-only) */
       
   468 
       
   469     EDlAttrContentType,     /**<  Content type from response header
       
   470                             * (String8<KMaxContentTypeLength> - read/write. 
       
   471                             * Write is accepted only if EDlAttrCodDownload is ETrue) */
       
   472 
       
   473     EDlAttrTargetApp,       /**<  Target app that can open the content
       
   474                             * (TInt32 - read/write. 
       
   475                             * Write is accepted only if EDlAttrContinue is ETrue) */
       
   476 
       
   477     EDlAttrMediaType,       /**<  Media type from response header. See RFC2616.
       
   478                             * (String8<KMaxContentTypeLength> - read-only) */
       
   479     EDlAttrMediaTypeBoundary, /**<  Boundary attribute from media type.
       
   480                             * (String8<KMaxContentTypeLength> - read-only) */
       
   481 
       
   482 	EDlAttrAttachmentFileName,
       
   483 
       
   484     //
       
   485     // Other 
       
   486     //
       
   487     EDlAttrDisconnectOnReset = 1000, /**<  Automatic disconnection when Reset called.
       
   488                             * (TBool - read/write)
       
   489                             * (default: ETrue) */
       
   490 
       
   491     EDlAttrDisconnectOnPause,   /**<  Automatic disconnection when Pause called.
       
   492                             * In progress state EHttpContentTypeReceived
       
   493                             * download is in paused state but connection is
       
   494                             * not closed.
       
   495                             * (TBool - read/write)
       
   496                             * (default: ETrue) */
       
   497 
       
   498     EDlAttrUnused1, 
       
   499 
       
   500     EDlAttrAction,   /**<  See THttpDownloadMgrAction
       
   501                             * (TInt32 - read/write)
       
   502                             * (default: ELaunch ) */
       
   503 
       
   504     EDlAttrRestartAction,   /**<  See THttpRestartActions
       
   505                             * (TInt32 - read/write)
       
   506                             * (default: ERestartIfExpired ) */
       
   507 
       
   508     EDlAttrNoMedia,   /**<  ETrue if the media, on which the download is stored, is removed.
       
   509                             * A Reset clears this flag.
       
   510                             * (TBool - read only) */
       
   511 
       
   512     EDlAttrContinue,  /**<  Indicates that download was started in 
       
   513                             * client app but that doesn't handle it. 
       
   514                             * Download is created with RHttpDownloadMgr::CreateClientSideDownloadL().
       
   515                             * (TBool - read-only)
       
   516                             * (default: EFalse) */
       
   517 
       
   518     EDlAttrPausable,  /**<  If EFalse, download cannot be paused, or the 
       
   519                             * content will be lost.
       
   520                             * (TBool - read-only)
       
   521                             * (default: ETrue) */
       
   522 
       
   523     EDlAttrHidden,      /**<  If true download is NOT shows in the download 
       
   524                             * list or in any way to the user.
       
   525                             * (TBool - read/write)
       
   526                             * (default: EFalse) */
       
   527 
       
   528     EDlAttrSilent,    /**<  No progress events sent to the client application. 
       
   529                             * Only exceptions are:
       
   530                             * EHttpDlInprogress - EHttpStarted
       
   531                             * EHttpDlCompleted
       
   532                             * EHttpDlFailed
       
   533                             * (TBool - read/write)
       
   534                             * (default: EFalse) */
       
   535 
       
   536     EDlAttrProgressive,     /**<  Indicates that this is a progressive download.
       
   537                             * (TBool - read/write)
       
   538                             * (default: EFalse) */
       
   539                             
       
   540     EDlAttrFotaPckgId,      /**<  Fota package ID.
       
   541                             * (TInt32 - read/write)
       
   542                             * (default: KDefaultFotaPckgId. Default means no FOTA download! ) */
       
   543                             
       
   544     EDlAttrDownloadNextUrl, /**<  This attribute is not supported from 3.0!
       
   545                             * Beginning from 3.0, Download Manager never 
       
   546                             * downloads the next-uri of OMA/COD downloads 
       
   547                             * automatically, but forwards the next-uri to the 
       
   548                             * client via MHttpDownloadMgrNextUriObserver, 
       
   549                             * then the client can create a new download with 
       
   550                             * the next-uri it has got, if it wants so. */
       
   551                             
       
   552     EDlAttrDownloadUpdatedDDUri,/**<  If ETrue, updated DD URI is present in download descriptor.
       
   553                                 * Start download with updatd DD URI.
       
   554                                 * (TBool - read/write) 
       
   555                                 * (default: EFalse)
       
   556                                 */
       
   557     
       
   558     EDlAttrUpdatedDDUri,    /**<  Updated DD URI.
       
   559                             * (String8<KMaxUrlLength> - read/write
       
   560                             */                           
       
   561                             
       
   562     EDlAttrDDType,          /**<  Content type of the descriptor for OMA downloads. 
       
   563                             * For HTTP this will be content type of the MO
       
   564                             * (String8<KMaxContentTypeLength> - read only. 
       
   565                             */                            
       
   566 
       
   567    /**  Application can set and query raw header 
       
   568     * fields and values via these attributes.
       
   569     * (String<KMaxGeneralHeaderFieldLength> - read/write) */
       
   570     EDlAttrHeaderFields     = 1500,
       
   571     EDlAttrCharSet          = EDlAttrHeaderFields, // Character Set
       
   572     EDlAttrResponseCharSet  = EDlAttrCharSet,
       
   573     EDlAttrResponseAge,
       
   574     EDlAttrResponseETag,
       
   575     EDlAttrResponseLocation,
       
   576     EDlAttrResponseRetryAfter,
       
   577     EDlAttrResponseServer,
       
   578     EDlAttrResponseVary,
       
   579 
       
   580     /**  Request headers */
       
   581     EDlAttrRequestAccept = 2000,
       
   582     EDlAttrRequestAcceptCharSet,
       
   583     EDlAttrRequestAcceptLanguage,
       
   584     EDlAttrRequestExpect,
       
   585     EDlAttrRequestFrom,
       
   586     EDlAttrRequestHost,
       
   587     EDlAttrRequestMaxForwards,
       
   588     EDlAttrRequestPragma,
       
   589     EDlAttrRequestReferer,
       
   590     EDlAttrRequestUserAgent,
       
   591     EDlAttrRequestVary,
       
   592 
       
   593     /**  Entity header fields */
       
   594     EDlAttrEntityAllow = 2500,
       
   595     EDlAttrEntityContentEncoding,
       
   596     EDlAttrEntityContentLanguage,
       
   597     EDlAttrEntityContentLocation,
       
   598     EDlAttrEntityExpires,
       
   599     EDlAttrEntityLastModified,
       
   600 
       
   601     /**  General header fields */
       
   602     EDlAttrGeneralCacheControl = 3000,
       
   603     EDlAttrGeneralDate,
       
   604     EDlAttrGeneralPragma,
       
   605     EDlAttrGeneralVia,
       
   606     EDlAttrGeneralWarning,
       
   607 
       
   608     /**  Internally used attribute! Do NOT use! */
       
   609     EDlAttrSucceeded = 8192,
       
   610     /**  Internally used attribute! Do NOT use! */
       
   611     EDlAttUnused2,
       
   612     /**  Internally used attribute! Do NOT use! */
       
   613     EDlAttrFailed,
       
   614     
       
   615     EDlAttrCodDownload,    /**<  Indicates that it is an OMA DD downlad, 
       
   616                             * and the content is downloaded by COD Handler. 
       
   617                             * (TBool - read-only)
       
   618                             * (default: EFalse) */
       
   619 
       
   620     /**  Internally used attribute! Do NOT use! */
       
   621     EDlAttrHashedMsgBody, 
       
   622     /**  Internally used attribute! Do NOT use! */
       
   623     EDlAttrDefaultEvent,
       
   624     /**  Internally used attribute! Do NOT use! */
       
   625     EDlAttrRedirectedTemporary,
       
   626     /**  Internally used attribute! Do NOT use! */
       
   627     EDlAttrRedirectedPermanently,
       
   628     /**  Internally used attribute! Do NOT use! */
       
   629     EDlAttrCodDescriptorAccepted,
       
   630     /**  Internally used attribute! Do NOT use! */
       
   631     EDlAttrCodLoadEnd,
       
   632 
       
   633     EDlAttrDiskBufferingSize,
       
   634                                /**< Indicates how large a buffer (in bytes) to
       
   635                                  * use when writing this download to disk.  A
       
   636                                  * value of 0 indicates no buffering. */
       
   637 
       
   638     /**  Internally used attribute! Do NOT use! */                                 
       
   639 	EDlAttrCodPdAvailable,  /* This is introduced for OMA 2 (DD2). Indicates that progressive download is available 
       
   640 							* in case if license element exists in the DD2 this attribute is set when the right obj
       
   641 							* is available and the Progressive download element is true.
       
   642 							* In case when the license element in not represented this attribute is set if
       
   643 							* the Progressive download element is true.
       
   644 							*/
       
   645 
       
   646 	EDlAttrLocalFileName,   /* This is introduced for OMA 2 (DD2).
       
   647                             * Local filename. Content will be 
       
   648                             * moved from this location.
       
   649                             * This attribute should be set before the client sends the Move command
       
   650                             * (String16<KMaxPath> - read/write) */		
       
   651 
       
   652     /**  Internally used attribute! Do NOT use! */                                 
       
   653 
       
   654     EDlAttrCodPausable,     /**<  Would update the server about Pausability of COD Download. 
       
   655                             * This attribute is only used for COD downloads to update pause attibure in server
       
   656                             * (TBool - write only) 
       
   657                             */                               				   
       
   658 	
       
   659 	EDlAttrDdFileName,		/** For storing DD File name. */
       
   660     EDlAttrActiveDownload,
       
   661 	EDlAttrActivePlayedDownload,
       
   662 	EDlAttrNumMediaObjects,
       
   663     EDlAttrMultipleMOLength,/**<  specifies total length of all MOs for the download.
       
   664                             * (TInt32 - read/write. */
       
   665 
       
   666     EDlAttrMultipleMODownloadedSize, /**<  current downloaded size (the sum of downloaded size of all completed MOs. Completed MOs can be successful/failed/paused MOs). .
       
   667                             * (TInt32 - read-only) */
       
   668     EDlAttrAlbumName        /**<  Name of the album. In case of non-album download, this is the download name.
       
   669                             * (String16<KMaxPath> - read-only) */
       
   670     };
       
   671 
       
   672 /**  
       
   673 *  See RFC2616.
       
   674 */
       
   675 enum THttpMethod
       
   676     {
       
   677     EMethodGET,     
       
   678     EMethodPOST,
       
   679     EMethodHEAD
       
   680     };
       
   681 
       
   682 /**  
       
   683 *  Authentication scheme
       
   684 */
       
   685 enum THttpAuthenticationScheme
       
   686     {
       
   687     EAuthBasic,                 ///< Basic authentication scheme
       
   688     EAuthDigest                ///< Digest authentication scheme
       
   689     };
       
   690 
       
   691 /**
       
   692 *  This attribute specifies what Download Manager do
       
   693 *  with the downloads on exit.
       
   694 */
       
   695 enum THttpDownloadMgrExitAction
       
   696     {
       
   697     EExitNothing,              ///< Downloads remain intacted on exit (default).
       
   698     EExitPause,                ///< All downloads paused on exit.
       
   699     EExitDelete                 ///< All downloads deleted on exit.
       
   700     };
       
   701 
       
   702 /**
       
   703 *  The action to do when a download completes.
       
   704 */
       
   705 enum THttpDownloadMgrAction
       
   706     {
       
   707     /**
       
   708      * Do nothing when download completed.
       
   709      */
       
   710     EDoNothing  = 0,
       
   711     /**
       
   712      * Automatically move content to the location pointed by EDlAttrDestFilename 
       
   713      */
       
   714     EMove           = 0x0001,
       
   715     /**
       
   716      * Automatically lauch target application when download
       
   717      * completed. This is the default if not set (default).
       
   718      */
       
   719     ELaunch         = 0x0002,
       
   720     /**
       
   721      * Automatically lauch progressive download 
       
   722      */
       
   723     EPdLaunch         = 0x0004  
       
   724     };
       
   725 
       
   726 /**
       
   727 *  Restart actions.
       
   728 */
       
   729 enum THttpRestartActions
       
   730     {
       
   731     ERestartIfExpired,    /**< Download content again if content is expired (default). */
       
   732     ERestartNoIfCompleted,  /**< (Re)Start completes with EHttpDlCompleted at 
       
   733                                     * once if already completed. 
       
   734                                     * Anyway starts to download the content only if it's 
       
   735                                     * not modified since last partial download.
       
   736                                     * Restarted anyway. No content update/expiry check. */
       
   737     ERestartForced         /**< Forced download. Don't matter if content is 
       
   738                                     * expired, or not. */
       
   739     };
       
   740 
       
   741 /**
       
   742 *  Allocated usable error range: -30421 -> -30470 (includes the 1st and last numbers).
       
   743 */
       
   744 enum THttpDownloadMgrError
       
   745     {
       
   746     ENoError = 0,
       
   747     EGeneral = -30421,  ///< Non-download specific error. See global error code.
       
   748     EInternal = -30422,  /**< Internal error occured. Most probably a programming error.
       
   749                                     * (e.g. download that is stored on a media, that is not present
       
   750                                     * in the phone, cannot be started) */
       
   751     EContentFileIntegrity = -30423, /**< Content file is missing or has different size then 
       
   752                                     * it should be. EDlAttrNoMedia is ETrue if the media, on which
       
   753                                     * content file was (partially) stored, removed. */
       
   754     EDiskFull = -30424,  ///< Not enough disk space for the content
       
   755     EConnectionFailed = -30425,    /**< Most probably IAP id was wrong or no network coverage.
       
   756                                     * For more specific info about the error see EDlAttrGlobalErrorId. */
       
   757     ETransactionFailed = -30426,    /**< Error occured in the transaction. 
       
   758                                     * For more specific info about the error see EDlAttrGlobalErrorId. */
       
   759     EMoveFailed = -30427,  /**< Moving content file failed. 
       
   760                                     * See EDlAttrGlobalErrorId for specific reason. */
       
   761     EDestFileWriteFailed = -30428,  ///< Destination file write failed.
       
   762     EMMCRemoved = -30429,  ///< MMC card, where th download is being persisted, removed.
       
   763     EBadUrl = -30430,   /**<  Download Manager cannot handle this URL:
       
   764                                     * - it's too long
       
   765                                     * - malformed. */
       
   766 
       
   767     // Download attributes related error
       
   768 
       
   769     EWrongDestFilename = -30431,    
       
   770                                     ///< Error in destination filename. Most probably not a real filename.
       
   771     EDestFileInUse = -30432,        
       
   772                                     /**< Destination file cannot be opened/created. It's most probably
       
   773                                     * in use by other app. or download. */
       
   774 
       
   775     //HTTP error case
       
   776 
       
   777     EHttpUnhandled = -30433,   
       
   778                                     /**< Unhandled HTTP error code. See it in 
       
   779                                     * EDlAttrGlobalErrorId. */
       
   780     EHttpAuthenticationFailed = -30434,  
       
   781                                     /**< 401 - Client has to set username/password 
       
   782                                     * and Start download again. */
       
   783     EProxyAuthenticationFailed = -30435, 
       
   784                                     /**< 407 - Client has to set proxy 
       
   785                                     * username/password and Start download again. */
       
   786     EObjectNotFound = -30436,    
       
   787                                     /**< 404 - Object not found. */
       
   788     EPartialContentModified = -30437,    
       
   789                                     /**< 412: partial content cannot be downloaded because
       
   790                                     * it's already modified. 
       
   791                                     * Call Reset or set THttpRestartActions::ERestartForced */
       
   792 
       
   793     EContentExpired = -30438,       
       
   794                                     /**< Paused content is expired, or content 
       
   795                                     * is modified between two requests.
       
   796                                     * Call Reset() or see THttpRestartActions. */
       
   797                                     
       
   798     // miscellaneous errors
       
   799     EHttpRestartFailed  = -30450    /**<  Resuming progressive download failed. */
       
   800     };
       
   801 
       
   802 #endif      // HTTPDOWNLOADMGRCOMMON_H   
       
   803 
       
   804 // End of File