RHttpDownload Class Reference

class RHttpDownload : public RSubSessionBase

Creates a download manager subsession and performs operations on it

-
Since
Series 60 2.8

Inherits from

Public Member Functions
voidClose()
IMPORT_C TIntDelete()
IMPORT_C TIntGetBoolAttribute(const TUint, TBool &)
IMPORT_C TIntGetBoolAttribute(const TUint, const TInt32 &, TBool &)
IMPORT_C TIntGetFileHandleAttribute(RFile &)
IMPORT_C TIntGetIntAttribute(const TUint, TInt32 &)
IMPORT_C TIntGetIntAttribute(const TUint, const TInt32 &, TInt32 &)
TInt GetProductDownloadedSize()
IMPORT_C TIntGetStringAttribute(const TUint, TDes16 &)
IMPORT_C TIntGetStringAttribute(const TUint, TDes8 &)
IMPORT_C TIntGetStringAttribute(const TUint, const TInt32 &, TDes16 &)
IMPORT_C TIntGetStringAttribute(const TUint, const TInt32 &, TDes8 &)
TBool IsClosed()
IMPORT_C TIntMove()
IMPORT_C TIntPause()
IMPORT_C TIntReset()
voidResumeCodDownloadL()
IMPORT_C TIntSetBoolAttribute(const TUint, TBool)
IMPORT_C TIntSetDownloadDataAttribute(const TDesC8 &)
IMPORT_C TIntSetFileHandleAttribute(RFile &)
IMPORT_C TIntSetIntAttribute(const TUint, TInt32)
IMPORT_C TIntSetStringAttribute(const TUint, const TDesC16 &)
IMPORT_C TIntSetStringAttribute(const TUint, const TDesC8 &)
IMPORT_C TIntSetStringAttribute(const TUint, const TInt32 &, const TDesC16 &)
IMPORT_C TIntSetTrackDataAttribute(const TInt, const TDesC8 &)
IMPORT_C TIntStart()
Private Member Functions
RHttpDownload(RHttpDownloadMgr *)
TInt32 ActiveMoIndex()
voidAttachL(TInt)
voidAttachToDownloadL(const TInt32)
voidBufferAttributesL()
voidCancelEventNotification()
TBool CheckContentTypeAndCreateCodDownloadL()
voidCloseSubSession()
voidCreateL(const TDesC8 &, const TPtr8)
voidDeleteTransaction()
voidDoStartCodL()
voidDoStartL()
TInt EventPriorityFlag()
voidInitCodDownloadL(const TDesC8 &, const TDesC8 &, CEikonEnv *)
voidInitPausedCodDownloadL(const TUid)
TBool IsClientSideDownload()
TBool IsDeleteCodWhenDone()
TBool IsDownload(TInt)
TBool IsDownloadL(const TUriParser8 &, const TDesC8 &)
TBool IsToBeDeleted()
voidSaveDownloadInfoL()
voidSetCodInProgress(TCodProgressState)
voidSetDefaultAttributesL(const TDesC8 &)
voidSetEventType(THttpDownloadState)
voidSetHttpTransactionL(TInt)
TInt SetOnError(TInt, THttpDownloadMgrError)
voidStartEventNotification(TDes8 &, TDes8 &, TDes8 &, TRequestStatus &)
voidStopWaitingAS()
voidUnpackEventAttribL(const TDesC8 &)
Inherited Functions
RSubSessionBase::CloseSubSession(TInt)
RSubSessionBase::CreateAutoCloseSubSession(RSessionBase &,TInt,const TIpcArgs &)
RSubSessionBase::CreateSubSession(const RSessionBase &,TInt)
RSubSessionBase::CreateSubSession(const RSessionBase &,TInt,const TIpcArgs &)
RSubSessionBase::RSubSessionBase()
RSubSessionBase::Send(TInt)const
RSubSessionBase::Send(TInt,const TIpcArgs &)const
RSubSessionBase::SendReceive(TInt)const
RSubSessionBase::SendReceive(TInt,TRequestStatus &)const
RSubSessionBase::SendReceive(TInt,const TIpcArgs &)const
RSubSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSubSessionBase::Session()const
RSubSessionBase::SubSessionHandle()const
Public Member Enumerations
enumTCodProgressState { ENotActive, EPaused, EInProgress }
Private Attributes
TBool iASReady
TBool iClientSideDownload
TBool iClosed
TBool iClosedSubSession
CCodDownload *iCodDownload
CCodObserver *iCodObserver
CRHttpDlExtension *iDlExtension
CDownloadMgrHandler *iDownloadHandler
RHttpDownloadMgr *iDownloadMgr
CRHttpDownloadExtension *iExtension
TInt iHandle
RHTTPTransaction *iHttpTransaction
CTransactionObserver *iTransactionObserver
CActiveSchedulerWait *iWait

Constructor & Destructor Documentation

RHttpDownload(RHttpDownloadMgr *)

RHttpDownload(RHttpDownloadMgr *aServer)[private]

C++ default constructor.

Parameters

RHttpDownloadMgr * aServer

Member Functions Documentation

ActiveMoIndex()

TInt32 ActiveMoIndex()const [private]

Sets COD in progress flag.

AttachL(TInt)

voidAttachL(TIntaHandle)[private]

Attaches subsession to the server subsession by handle.

Parameters

TInt aHandleA handle which identifies the server subsession.

AttachToDownloadL(const TInt32)

voidAttachToDownloadL(const TInt32aDlId)[private]

Attach to an existing download.

Parameters

const TInt32 aDlIdDownload ID.

BufferAttributesL()

voidBufferAttributesL()[private]

Buffers attributes which need when a client deletes download.

CancelEventNotification()

voidCancelEventNotification()[private]

Cancels event notification.

CheckContentTypeAndCreateCodDownloadL()

TBool CheckContentTypeAndCreateCodDownloadL()[private]

Checks the mime type of a completed content. Creates a cod download if it is considered as OMA DD. The return value is the result of the checking. Leaves in case of failure.

Close()

voidClose()

Closes download subsession.

CloseSubSession()

voidCloseSubSession()[private]

Closes download subsession. This is called internally to close the sub session when the download is completed. Only the subsession will be closed but retains the RHttpDownload object.

CreateL(const TDesC8 &, const TPtr8)

voidCreateL(const TDesC8 &aUrl,
const TPtr8aPackedAttribs
)[private]

Creates download subsession.

Parameters

const TDesC8 & aUrlThe url to be downloaded.
const TPtr8 aPackedAttribs

Delete()

IMPORT_C TIntDelete()

Deletes downloading.

DeleteTransaction()

voidDeleteTransaction()[private]

Delete http transaction.

DoStartCodL()

voidDoStartCodL()[private]

Starts COD download.

DoStartL()

voidDoStartL()[private]

Starts downloading.

EventPriorityFlag()

TInt EventPriorityFlag()const [private]

Returns the the event priority flag from session

GetBoolAttribute(const TUint, TBool &)

IMPORT_C TIntGetBoolAttribute(const TUintaAttribute,
TBool &aValue
)

Gets the value for a TBool attribute.

Parameters

const TUint aAttributeIdentifies the attribute to be retrived.
TBool & aValueOn completion, contains the requested TBool attribute.

GetBoolAttribute(const TUint, const TInt32 &, TBool &)

IMPORT_C TIntGetBoolAttribute(const TUintaAttribute,
const TInt32 &aMoIndex,
TBool &aValue
)

Gets the value for a TBool attribute.

Parameters

const TUint aAttributeIdentifies the attribute to be retrived.
const TInt32 & aMoIndexIdentifies the media object index.
TBool & aValueOn completion, contains the requested TBool attribute.

GetFileHandleAttribute(RFile &)

IMPORT_C TIntGetFileHandleAttribute(RFile &aFile)

Gets the download's destination file's handle.

Parameters

RFile & aFileRFile that adopts file handle from download.

GetIntAttribute(const TUint, TInt32 &)

IMPORT_C TIntGetIntAttribute(const TUintaAttribute,
TInt32 &aValue
)

Gets the value for a TInt attribute.

Parameters

const TUint aAttributeIdentifies the attribute to be retrived.
TInt32 & aValueOn completion, contains the requested TInt attribute.

GetIntAttribute(const TUint, const TInt32 &, TInt32 &)

IMPORT_C TIntGetIntAttribute(const TUintaAttribute,
const TInt32 &aMoIndex,
TInt32 &aValue
)

Gets the value for a TInt attribute.

Parameters

const TUint aAttributeIdentifies the attribute to be retrived.
const TInt32 & aMoIndexIdentifies the media object index.
TInt32 & aValueOn completion, contains the requested TInt attribute.

GetProductDownloadedSize()

TInt GetProductDownloadedSize()

Get Downloaded Size of product.

GetStringAttribute(const TUint, TDes16 &)

IMPORT_C TIntGetStringAttribute(const TUintaAttribute,
TDes16 &aValue
)

Gets the value for a TDes16 attribute.

Parameters

const TUint aAttributeIdentifies the attribute to be retrived.
TDes16 & aValueOn completion, contains the requested TDes16 attribute.

GetStringAttribute(const TUint, TDes8 &)

IMPORT_C TIntGetStringAttribute(const TUintaAttribute,
TDes8 &aValue
)

Gets the value for a TDes8 attribute.

Parameters

const TUint aAttributeIdentifies the attribute to be retrived.
TDes8 & aValueOn completion, contains the requested TDes8 attribute.

GetStringAttribute(const TUint, const TInt32 &, TDes16 &)

IMPORT_C TIntGetStringAttribute(const TUintaAttribute,
const TInt32 &aMoIndex,
TDes16 &aValue
)

Gets the value for a TDes16 attribute.

Parameters

const TUint aAttributeIdentifies the attribute to be retrived.
const TInt32 & aMoIndexIdentifies the media object index.
TDes16 & aValueOn completion, contains the requested TDes16 attribute.

GetStringAttribute(const TUint, const TInt32 &, TDes8 &)

IMPORT_C TIntGetStringAttribute(const TUintaAttribute,
const TInt32 &aMoIndex,
TDes8 &aValue
)

Gets the value for a TDes8 attribute.

Parameters

const TUint aAttributeIdentifies the attribute to be retrived.
const TInt32 & aMoIndexIdentifies the media object index.
TDes8 & aValueOn completion, contains the requested TDes8 attribute.

InitCodDownloadL(const TDesC8 &, const TDesC8 &, CEikonEnv *)

voidInitCodDownloadL(const TDesC8 &aBuf,
const TDesC8 &aMimeType,
CEikonEnv *aEikEnv
)[private]

Initialize OMA DD download.

Parameters

const TDesC8 & aBufThe descriptor.
const TDesC8 & aMimeType
CEikonEnv * aEikEnvEikon environment or NULL. Can be NULL if download does not require UI functionality. If download needs UI but NULL is passed here, the download fails with EFailedPermanent KErrCancel.

InitPausedCodDownloadL(const TUid)

voidInitPausedCodDownloadL(const TUidaAppUid)[private]

Initialize paused OMA DD download.

Parameters

const TUid aAppUidApp UID of the client.

IsClientSideDownload()

TBool IsClientSideDownload()const [private]

True if it is a client side download

IsClosed()

TBool IsClosed()[inline]

Indicates whether the download is closed.

IsDeleteCodWhenDone()

TBool IsDeleteCodWhenDone()const [private]

ETrue if download should be deleted on COD completion.

IsDownload(TInt)

TBool IsDownload(TIntaHandle)[private]

Returns true if the handle is equals with the stored one.

Parameters

TInt aHandleHandle.

IsDownloadL(const TUriParser8 &, const TDesC8 &)

TBool IsDownloadL(const TUriParser8 &aParsedReqUrl,
const TDesC8 &aMsgBody
)[private]
Returns true if the params belongs to this download.
Since
2.8

Parameters

const TUriParser8 & aParsedReqUrlgiven URL
const TDesC8 & aMsgBodyMessage body from post operation

IsToBeDeleted()

TBool IsToBeDeleted()[private]

Tells that download should be deleted.

Move()

IMPORT_C TIntMove()

Moves downloaded content to the previously specified location

Pause()

IMPORT_C TIntPause()

Pauses downloading.

Reset()

IMPORT_C TIntReset()

Resets downloading.

ResumeCodDownloadL()

voidResumeCodDownloadL()

Resume COD download.

SaveDownloadInfoL()

voidSaveDownloadInfoL()[private]

This is called internally to save the downloaded subsession before closing the subsession

SetBoolAttribute(const TUint, TBool)

IMPORT_C TIntSetBoolAttribute(const TUintaAttribute,
TBoolaValue
)

Sets the value for a TDesC attribute.

Parameters

const TUint aAttributeIdentifies the attribute to be set.
TBool aValueThe value to be set.

SetCodInProgress(TCodProgressState)

voidSetCodInProgress(TCodProgressStateaVal)[private]

Sets COD in progress flag.

Parameters

TCodProgressState aVal

SetDefaultAttributesL(const TDesC8 &)

voidSetDefaultAttributesL(const TDesC8 &aPackedAttribs)[private]

Sets the default value for the attributes.

Parameters

const TDesC8 & aPackedAttribs

SetDownloadDataAttribute(const TDesC8 &)

IMPORT_C TIntSetDownloadDataAttribute(const TDesC8 &aValue)

Sets the download data (media information).

Parameters

const TDesC8 & aValueThe value to be set.

SetEventType(THttpDownloadState)

voidSetEventType(THttpDownloadStateaEventType)[private]

Sets event type.

Parameters

THttpDownloadState aEventType

SetFileHandleAttribute(RFile &)

IMPORT_C TIntSetFileHandleAttribute(RFile &aFile)

Sets the download's destination file handle.

Parameters

RFile & aFileRFile to be transfered to server.

SetHttpTransactionL(TInt)

voidSetHttpTransactionL(TIntaHttpTransaction)[private]

Sets http transaction.

Parameters

TInt aHttpTransaction

SetIntAttribute(const TUint, TInt32)

IMPORT_C TIntSetIntAttribute(const TUintaAttribute,
TInt32aValue
)

Sets the value for a TInt attribute.

Parameters

const TUint aAttributeIdentifies the attribute to be set.
TInt32 aValueThe value to be set.

SetOnError(TInt, THttpDownloadMgrError)

TInt SetOnError(TIntaError,
THttpDownloadMgrErroraDlError = EGeneral
)[private]

Sets the error value.

Parameters

TInt aError
THttpDownloadMgrError aDlError = EGeneral

SetStringAttribute(const TUint, const TDesC16 &)

IMPORT_C TIntSetStringAttribute(const TUintaAttribute,
const TDesC16 &aValue
)

Sets the value for a TDesC attribute.

Parameters

const TUint aAttributeIdentifies the attribute to be set.
const TDesC16 & aValueThe value to be set.

SetStringAttribute(const TUint, const TDesC8 &)

IMPORT_C TIntSetStringAttribute(const TUintaAttribute,
const TDesC8 &aValue
)

Sets the value for a TDesC8 attribute.

Parameters

const TUint aAttributeIdentifies the attribute to be set.
const TDesC8 & aValueThe value to be set.

SetStringAttribute(const TUint, const TInt32 &, const TDesC16 &)

IMPORT_C TIntSetStringAttribute(const TUintaAttribute,
const TInt32 &aMoIndex,
const TDesC16 &aValue
)

Sets the value for a TDesC attribute.

Parameters

const TUint aAttributeIdentifies the attribute to be set.
const TInt32 & aMoIndexIdentifies the media object index.
const TDesC16 & aValueThe value to be set.

SetTrackDataAttribute(const TInt, const TDesC8 &)

IMPORT_C TIntSetTrackDataAttribute(const TIntaIndex,
const TDesC8 &aValue
)

Sets the download data (media information).

Parameters

const TInt aIndex
const TDesC8 & aValueThe value to be set.

Start()

IMPORT_C TIntStart()

Starts downloading.

StartEventNotification(TDes8 &, TDes8 &, TDes8 &, TRequestStatus &)

voidStartEventNotification(TDes8 &aDownloadState,
TDes8 &aProgressState,
TDes8 &aEventAttrib,
TRequestStatus &aStatus
)[private]

Start event notification.

Parameters

TDes8 & aDownloadStateState.
TDes8 & aProgressStateProgress.
TDes8 & aEventAttribPacked attribs
TRequestStatus & aStatusHandler's request status.

StopWaitingAS()

voidStopWaitingAS()[private]

To stop waiting loop of AS

UnpackEventAttribL(const TDesC8 &)

voidUnpackEventAttribL(const TDesC8 &aPack)[private]

Unpack event attribute package.

Parameters

const TDesC8 & aPackPacked attributes.

Member Enumerations Documentation

Enum TCodProgressState

Cod download progress states

Enumerators

ENotActive
EPaused
EInProgress

Member Data Documentation

TBool iASReady

TBool iASReady[private]

TBool iClientSideDownload

TBool iClientSideDownload[private]

TBool iClosed

TBool iClosed[private]

TBool iClosedSubSession

TBool iClosedSubSession[private]

CCodDownload * iCodDownload

CCodDownload *iCodDownload[private]

CCodObserver * iCodObserver

CCodObserver *iCodObserver[private]

CRHttpDlExtension * iDlExtension

CRHttpDlExtension *iDlExtension[private]

CDownloadMgrHandler * iDownloadHandler

CDownloadMgrHandler *iDownloadHandler[private]

RHttpDownloadMgr * iDownloadMgr

RHttpDownloadMgr *iDownloadMgr[private]

CRHttpDownloadExtension * iExtension

CRHttpDownloadExtension *iExtension[private]

TInt iHandle

TInt iHandle[private]

RHTTPTransaction * iHttpTransaction

RHTTPTransaction *iHttpTransaction[private]

CTransactionObserver * iTransactionObserver

CTransactionObserver *iTransactionObserver[private]

CActiveSchedulerWait * iWait

CActiveSchedulerWait *iWait[private]