httpdownloadmgrcommon.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name        : HttpDownloadMgrCommon.h
00004 *  Part of     : Download Manager Engine
00005 *  Interface   : Download Manager Engine API
00006 *  Description : Common constants used in Download Manager Engine
00007 *  Version     : %version: bh1s60#1.1.11.2.4 %
00008 *
00009 *  Copyright © 2002-2005 Nokia.  All rights reserved.
00010 *  This material, including documentation and any related computer
00011 *  programs, is protected by copyright controlled by Nokia.  All
00012 *  rights are reserved.  Copying, including reproducing, storing,
00013 *  adapting or translating, any or all of this material requires the
00014 *  prior written consent of Nokia.  This material also contains
00015 *  confidential information which may not be disclosed to others
00016 *  without the prior written consent of Nokia.
00017 * ============================================================================
00018 * Template version: 4.0
00019 */
00020 
00021 
00022 #ifndef HTTPDOWNLOADMGRCOMMON_H
00023 #define HTTPDOWNLOADMGRCOMMON_H
00024 
00025 //  INCLUDES
00026 #include <e32base.h>
00027 
00028 // CONSTANTS
00029 const TInt KMaxUrlLength = 2048;
00030 const TInt KMaxChunkSize = 4096;
00031 const TUint KMaxDefAttrLength = 32;
00032 const TUint KMaxRealmLength = 128;
00033 const TUint KMaxContentTypeLength = 256;
00034 const TUint KMaxDispositionTypeLength = 256;
00035 const TInt32 KDefaultPort = 80;
00036 const TInt32 KDefaultContentLength = -1;
00037 const TUint KMaxGeneralHeaderFieldLength = 256;
00039 const TInt KHashLength = 32;
00041 const TInt KRawHashLength = 16;
00043 const TInt32 KDefaultFotaPckgId = -1;
00044 
00045 const TInt KColon( ':' );
00046 const TInt KSemiColon( ';' );
00047 const TInt KQuote( '"' );
00048 const TInt KEqual( '=' );
00049 
00050 _LIT8( KHttpFieldSeparator, "\n");
00051 _LIT8( KHttpDispositionTypeAttachment, "attachment");
00052 _LIT8( KHttpDispositionTypeInline, "inline");
00053 _LIT8( KHttpFileNameParm, "filename");
00054 
00056 _LIT8( KCodMimeType, "text/x-co-desc" );
00058 _LIT8( KDdMimeType, "application/vnd.oma.dd+xml" );
00060 _LIT8( KDd2MimeType, "application/vnd.oma.dd2+xml" );
00061 _LIT8( KRoapMimeType, "application/vnd.oma.drm.roap-trigger+xml" );
00063 _LIT8( KMultiPartMimeType, "multipart/related" );
00064 
00066 _LIT8( KDrmMessageMimeType, "application/vnd.oma.drm.message" );
00068 _LIT8( KDrmMessageMimeTypeDrmContent, "application/vnd.oma.drm.content" );
00070 _LIT8( KDrmMessageMimeTypeDrmDcf, "application/vnd.oma.drm.dcf" );
00071 
00077 enum THttpDownloadState
00078     {
00079     EHttpDlCreated = 1,
00080     EHttpDlInprogress,
00081     EHttpDlPaused,
00082     EHttpDlCompleted,
00083     EHttpDlFailed,
00084 
00086     EHttpDlMoved,
00088     EHttpDlMediaRemoved,
00094     EHttpDlMediaInserted,
00097     EHttpDlPausable,
00099     EHttpDlNonPausable,
00101     EHttpDlDeleted,
00103     EHttpDlAlreadyRunning,
00105     EHttpDlDeleting,
00107     EHttpDlNonPausableNetworkLoss,
00109     EHttpDlCancelTransaction = 128
00110     };
00111 
00117 enum THttpProgressState
00118     {
00119     EHttpProgNone = 0,
00120 
00121     EHttpStarted = 500,
00122 
00123     EHttpProgCreatingConnection = 1000,
00124     EHttpProgConnectionNeeded = 1010,
00125     EHttpProgConnected = 1020,
00126 
00127     EHttpProgConnectionSuspended = 1022,
00128 
00129     EHttpProgDisconnected = 1030,
00130 
00131     EHttpProgDownloadStarted = 2000,
00132     EHttpContentTypeRequested = EHttpProgDownloadStarted + 20,
00133 
00138     EHttpContentTypeReceived,
00139 
00140     EHttpProgSubmitIssued = EHttpProgDownloadStarted + 30,
00141 
00142     EHttpProgResponseHeaderReceived = 2050,
00143     EHttpProgResponseBodyReceived,
00144     EHttpProgRedirectedPermanently,
00145     EHttpProgRedirectedTemporarily,
00146     EHttpProgDlNameChanged,
00147     EHttpProgContentTypeChanged,
00148 
00150     EHttpProgCodDescriptorDownloaded = 2500,
00152     EHttpProgCodDownloadStarted,
00154     EHttpProgCodDescriptorAccepted,
00158     EHttpProgCodLoadEnd,
00159     EHttpProgSupportedMultiPart,
00160     
00161     EHttpProgCodPdAvailable,
00162 
00163     EHttpProgMovingContentFile = 3000,
00164     EHttpProgContentFileMoved,
00165 
00166     // We have received sufficient HTTP response body to allow us to recognize 
00167     // content-type from data rather than trust content-type header
00168     EHttpContTypeRecognitionAvail,
00169     
00170     //The state is used for duplicate files .The duplicate file is renamed
00171         //and move happens simultaneously
00172         EHttpProgContentFileMovedAndDestFNChanged     
00173     };
00174 
00185 enum THttpDownloadMgrAttrib
00186     {
00187     EDlMgrAppUid,    
00191     EDlMgrIap,          
00195     EDlMgrExitAction,  
00199     EDlMgrSilentMode,       
00204     EDlMgrMaster,           
00213     EDlMgrAllDlsInMaster,   
00217     EDlMgrNoMediaDlsInMaster, 
00222     EDlMgrConnectionName,   
00231     EDlMgrAPName,   
00236     EDlMgrNumInprogressDownloads,  
00240     EDlMgrConnected,  
00243     EDlMgrNoMediaDls, 
00247     EDlMgrEnableCookies,  
00252     EDlAutoConnect,    
00258     EDlMgrAutoConnect = EDlAutoConnect,
00259 
00260     EDlMgrFotaDownload,   
00265     EDlMgrCodFolder,    
00268     EDlMgrNumOfClientSideDownload,    
00271     EDlMgrHasActiveDownloads,
00275     EDlMgrAutoAcceptCod     
00278     };
00279 
00288 enum THttpDownloadAttrib
00289     {
00290     // Download progress attributes
00291     EDlAttrState,           
00294     EDlAttrProgressState,   
00297     EDlAttrUserData,    
00300     EDlAttrId,         
00303     //
00304     // Attributes mandatory to issue the request
00305     //
00306     EDlAttrReqUrl = 100,    
00309     EDlAttrRedirUlr,        
00313     EDlAttrRedirUrl = EDlAttrRedirUlr,
00314 
00315     EDlAttrCurrentUrl,      
00319     EDlAttrName,   
00324     EDlAttrPort,      
00328     EDlAttrMethod,          
00331     EDlAttrRequestHeaderAddon,  
00341     EDlAttrNextBodyData,    
00345     EDlAttrReleaseBodyData, 
00352     EDlAttrRedirected,      
00360     EDlAttrResponseHeader,  
00366     EDlAttrRequestHeaderAddonLength, 
00370     //
00371     // HTTP/Proxy authentication attributes.
00372     // Have to be set when state is EHttpDlPaused/EHttpContentTypeReceived
00373     //
00374     EDlAttrAuthScheme = 200,  
00378     EDlAttrRealm,           
00382     EDlAttrUsername,        
00385     EDlAttrPassword,        
00388     EDlAttrProxyRealm,      
00392     EDlAttrProxyUsername,   
00395     EDlAttrProxyPassword,   
00398     //
00399     // Miscellaneous download attributes
00400     //
00401     EDlAttrDestFilename,    
00407     EDlAttrLength,          
00412     EDlAttrDownloadedSize,  
00415     EDlAttrNoContentTypeCheck,  
00419     EDlAttrContinueBody,    
00429         EDlAttrDestRemovable,   
00433     //
00434     // Attributes to indicate error occured during download
00435     //
00436     EDlAttrStatusCode = 500, 
00439     EDlAttrErrorId, 
00442     EDlAttrGlobalErrorId,   
00445     EDlAttrContentType,     
00449     EDlAttrTargetApp,       
00453     EDlAttrMediaType,       
00455     EDlAttrMediaTypeBoundary, 
00458         EDlAttrAttachmentFileName,
00459 
00460     //
00461     // Other 
00462     //
00463     EDlAttrDisconnectOnReset = 1000, 
00467     EDlAttrDisconnectOnPause,   
00474     EDlAttrUnused1, 
00475 
00476     EDlAttrAction,   
00480     EDlAttrRestartAction,   
00484     EDlAttrNoMedia,   
00488     EDlAttrContinue,  
00494     EDlAttrPausable,  
00499     EDlAttrHidden,      
00504     EDlAttrSilent,    
00512     EDlAttrProgressive,     
00516     EDlAttrFotaPckgId,      
00520     EDlAttrDownloadNextUrl, 
00531     EDlAttrHeaderFields     = 1500,
00532     EDlAttrCharSet          = EDlAttrHeaderFields, // Character Set
00533     EDlAttrResponseCharSet  = EDlAttrCharSet,
00534     EDlAttrResponseAge,
00535     EDlAttrResponseETag,
00536     EDlAttrResponseLocation,
00537     EDlAttrResponseRetryAfter,
00538     EDlAttrResponseServer,
00539     EDlAttrResponseVary,
00540 
00542     EDlAttrRequestAccept = 2000,
00543     EDlAttrRequestAcceptCharSet,
00544     EDlAttrRequestAcceptLanguage,
00545     EDlAttrRequestExpect,
00546     EDlAttrRequestFrom,
00547     EDlAttrRequestHost,
00548     EDlAttrRequestMaxForwards,
00549     EDlAttrRequestPragma,
00550     EDlAttrRequestReferer,
00551     EDlAttrRequestUserAgent,
00552     EDlAttrRequestVary,
00553 
00555     EDlAttrEntityAllow = 2500,
00556     EDlAttrEntityContentEncoding,
00557     EDlAttrEntityContentLanguage,
00558     EDlAttrEntityContentLocation,
00559     EDlAttrEntityExpires,
00560     EDlAttrEntityLastModified,
00561 
00563     EDlAttrGeneralCacheControl = 3000,
00564     EDlAttrGeneralDate,
00565     EDlAttrGeneralPragma,
00566     EDlAttrGeneralVia,
00567     EDlAttrGeneralWarning,
00568 
00570     EDlAttrSucceeded = 8192,
00572     EDlAttUnused2,
00574     EDlAttrFailed,
00575     
00576     EDlAttrCodDownload,    
00582     EDlAttrHashedMsgBody, 
00584     EDlAttrDefaultEvent,
00586     EDlAttrRedirectedTemporary,
00588     EDlAttrRedirectedPermanently,
00590     EDlAttrCodDescriptorAccepted,
00592     EDlAttrCodLoadEnd,
00593 
00594     EDlAttrDiskBufferingSize,
00600         EDlAttrCodPdAvailable,  /* This is introduced for OMA 2 (DD2). Indicates that progressive download is available 
00601                                                         * in case if license element exists in the DD2 this attribute is set when the right obj
00602                                                         * is available and the Progressive download element is true.
00603                                                         * In case when the license element in not represented this attribute is set if
00604                                                         * the Progressive download element is true.
00605                                                         */
00606 
00607         EDlAttrLocalFileName   /* This is introduced for OMA 2 (DD2).
00608                             * Local filename. Content will be 
00609                             * moved from this location.
00610                             * This attribute should be set before the client sends the Move command
00611                             * (String16<KMaxPath> - read/write) */                                                 
00612     };
00613 
00617 enum THttpMethod
00618     {
00619     EMethodGET,     
00620     EMethodPOST,
00621     EMethodHEAD
00622     };
00623 
00627 enum THttpAuthenticationScheme
00628     {
00629     EAuthBasic,                 
00630     EAuthDigest                
00631     };
00632 
00637 enum THttpDownloadMgrExitAction
00638     {
00639     EExitNothing,              
00640     EExitPause,                
00641     EExitDelete                 
00642     };
00643 
00647 enum THttpDownloadMgrAction
00648     {
00652     EDoNothing  = 0,
00656     EMove           = 0x0001,
00661     ELaunch         = 0x0002,
00665     EPdLaunch         = 0x0004  
00666     };
00667 
00671 enum THttpRestartActions
00672     {
00673     ERestartIfExpired,    
00674     ERestartNoIfCompleted,  
00679     ERestartForced         
00681     };
00682 
00686 enum THttpDownloadMgrError
00687     {
00688     ENoError = 0,
00689     EGeneral = -30421,  
00690     EInternal = -30422,  
00693     EContentFileIntegrity = -30423, 
00696     EDiskFull = -30424,  
00697     EConnectionFailed = -30425,    
00699     ETransactionFailed = -30426,    
00701     EMoveFailed = -30427,  
00703     EDestFileWriteFailed = -30428,  
00704     EMMCRemoved = -30429,  
00705     EBadUrl = -30430,   
00709     // Download attributes related error
00710 
00711     EWrongDestFilename = -30431,    
00713     EDestFileInUse = -30432,        
00717     //HTTP error case
00718 
00719     EHttpUnhandled = -30433,   
00722     EHttpAuthenticationFailed = -30434,  
00725     EProxyAuthenticationFailed = -30435, 
00728     EObjectNotFound = -30436,    
00730     EPartialContentModified = -30437,    
00735     EContentExpired = -30438,       
00740     // miscellaneous errors
00741     EHttpRestartFailed  = -30450    
00742     };
00743 
00744 // HTTPDOWNLOADMGRCOMMON_H   
00745 #endif
00746 
00747 // End of File

Copyright © Nokia Corporation 2001-2008
Back to top