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
void Close ()
IMPORT_C TInt Delete ()
IMPORT_C TInt GetBoolAttribute (const TUint , TBool &)
IMPORT_C TInt GetBoolAttribute (const TUint , const TInt32 &, TBool &)
IMPORT_C TInt GetFileHandleAttribute ( RFile &)
IMPORT_C TInt GetIntAttribute (const TUint , TInt32 &)
IMPORT_C TInt GetIntAttribute (const TUint , const TInt32 &, TInt32 &)
TInt GetProductDownloadedSize ()
IMPORT_C TInt GetStringAttribute (const TUint , TDes16 &)
IMPORT_C TInt GetStringAttribute (const TUint , TDes8 &)
IMPORT_C TInt GetStringAttribute (const TUint , const TInt32 &, TDes16 &)
IMPORT_C TInt GetStringAttribute (const TUint , const TInt32 &, TDes8 &)
TBool IsClosed ()
IMPORT_C TInt Move ()
IMPORT_C TInt Pause ()
IMPORT_C TInt Reset ()
void ResumeCodDownloadL ()
IMPORT_C TInt SetBoolAttribute (const TUint , TBool )
IMPORT_C TInt SetDownloadDataAttribute (const TDesC8 &)
IMPORT_C TInt SetFileHandleAttribute ( RFile &)
IMPORT_C TInt SetIntAttribute (const TUint , TInt32 )
IMPORT_C TInt SetStringAttribute (const TUint , const TDesC16 &)
IMPORT_C TInt SetStringAttribute (const TUint , const TDesC8 &)
IMPORT_C TInt SetStringAttribute (const TUint , const TInt32 &, const TDesC16 &)
IMPORT_C TInt SetTrackDataAttribute (const TInt , const TDesC8 &)
IMPORT_C TInt Start ()
Private Member Functions
RHttpDownload ( RHttpDownloadMgr *)
TInt32 ActiveMoIndex ()
void AttachL ( TInt )
void AttachToDownloadL (const TInt32 )
void BufferAttributesL ()
void CancelEventNotification ()
TBool CheckContentTypeAndCreateCodDownloadL ()
void CloseSubSession ()
void CreateL (const TDesC8 &, const TPtr8 )
void DeleteTransaction ()
void DoStartCodL ()
void DoStartL ()
TInt EventPriorityFlag ()
void InitCodDownloadL (const TDesC8 &, const TDesC8 &, CEikonEnv *)
void InitPausedCodDownloadL (const TUid )
TBool IsClientSideDownload ()
TBool IsDeleteCodWhenDone ()
TBool IsDownload ( TInt )
TBool IsDownloadL (const TUriParser8 &, const TDesC8 &)
TBool IsToBeDeleted ()
void SaveDownloadInfoL ()
void SetCodInProgress ( TCodProgressState )
void SetDefaultAttributesL (const TDesC8 &)
void SetEventType ( THttpDownloadState )
void SetHttpTransactionL ( TInt )
TInt SetOnError ( TInt , THttpDownloadMgrError )
void StartEventNotification ( TDes8 &, TDes8 &, TDes8 &, TRequestStatus &)
void StopWaitingAS ()
void UnpackEventAttribL (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
enum TCodProgressState { 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)

void AttachL ( TInt aHandle ) [private]

Attaches subsession to the server subsession by handle.

Parameters

TInt aHandle A handle which identifies the server subsession.

AttachToDownloadL(const TInt32)

void AttachToDownloadL ( const TInt32 aDlId ) [private]

Attach to an existing download.

Parameters

const TInt32 aDlId Download ID.

BufferAttributesL()

void BufferAttributesL ( ) [private]

Buffers attributes which need when a client deletes download.

CancelEventNotification()

void CancelEventNotification ( ) [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()

void Close ( )

Closes download subsession.

CloseSubSession()

void CloseSubSession ( ) [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)

void CreateL ( const TDesC8 & aUrl,
const TPtr8 aPackedAttribs
) [private]

Creates download subsession.

Parameters

const TDesC8 & aUrl The url to be downloaded.
const TPtr8 aPackedAttribs

Delete()

IMPORT_C TInt Delete ( )

Deletes downloading.

DeleteTransaction()

void DeleteTransaction ( ) [private]

Delete http transaction.

DoStartCodL()

void DoStartCodL ( ) [private]

Starts COD download.

DoStartL()

void DoStartL ( ) [private]

Starts downloading.

EventPriorityFlag()

TInt EventPriorityFlag ( ) const [private]

Returns the the event priority flag from session

GetBoolAttribute(const TUint, TBool &)

IMPORT_C TInt GetBoolAttribute ( const TUint aAttribute,
TBool & aValue
)

Gets the value for a TBool attribute.

Parameters

const TUint aAttribute Identifies the attribute to be retrived.
TBool & aValue On completion, contains the requested TBool attribute.

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

IMPORT_C TInt GetBoolAttribute ( const TUint aAttribute,
const TInt32 & aMoIndex,
TBool & aValue
)

Gets the value for a TBool attribute.

Parameters

const TUint aAttribute Identifies the attribute to be retrived.
const TInt32 & aMoIndex Identifies the media object index.
TBool & aValue On completion, contains the requested TBool attribute.

GetFileHandleAttribute(RFile &)

IMPORT_C TInt GetFileHandleAttribute ( RFile & aFile )

Gets the download's destination file's handle.

Parameters

RFile & aFile RFile that adopts file handle from download.

GetIntAttribute(const TUint, TInt32 &)

IMPORT_C TInt GetIntAttribute ( const TUint aAttribute,
TInt32 & aValue
)

Gets the value for a TInt attribute.

Parameters

const TUint aAttribute Identifies the attribute to be retrived.
TInt32 & aValue On completion, contains the requested TInt attribute.

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

IMPORT_C TInt GetIntAttribute ( const TUint aAttribute,
const TInt32 & aMoIndex,
TInt32 & aValue
)

Gets the value for a TInt attribute.

Parameters

const TUint aAttribute Identifies the attribute to be retrived.
const TInt32 & aMoIndex Identifies the media object index.
TInt32 & aValue On completion, contains the requested TInt attribute.

GetProductDownloadedSize()

TInt GetProductDownloadedSize ( )

Get Downloaded Size of product.

GetStringAttribute(const TUint, TDes16 &)

IMPORT_C TInt GetStringAttribute ( const TUint aAttribute,
TDes16 & aValue
)

Gets the value for a TDes16 attribute.

Parameters

const TUint aAttribute Identifies the attribute to be retrived.
TDes16 & aValue On completion, contains the requested TDes16 attribute.

GetStringAttribute(const TUint, TDes8 &)

IMPORT_C TInt GetStringAttribute ( const TUint aAttribute,
TDes8 & aValue
)

Gets the value for a TDes8 attribute.

Parameters

const TUint aAttribute Identifies the attribute to be retrived.
TDes8 & aValue On completion, contains the requested TDes8 attribute.

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

IMPORT_C TInt GetStringAttribute ( const TUint aAttribute,
const TInt32 & aMoIndex,
TDes16 & aValue
)

Gets the value for a TDes16 attribute.

Parameters

const TUint aAttribute Identifies the attribute to be retrived.
const TInt32 & aMoIndex Identifies the media object index.
TDes16 & aValue On completion, contains the requested TDes16 attribute.

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

IMPORT_C TInt GetStringAttribute ( const TUint aAttribute,
const TInt32 & aMoIndex,
TDes8 & aValue
)

Gets the value for a TDes8 attribute.

Parameters

const TUint aAttribute Identifies the attribute to be retrived.
const TInt32 & aMoIndex Identifies the media object index.
TDes8 & aValue On completion, contains the requested TDes8 attribute.

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

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

Initialize OMA DD download.

Parameters

const TDesC8 & aBuf The descriptor.
const TDesC8 & aMimeType
CEikonEnv * aEikEnv Eikon 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)

void InitPausedCodDownloadL ( const TUid aAppUid ) [private]

Initialize paused OMA DD download.

Parameters

const TUid aAppUid App 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 ( TInt aHandle ) [private]

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

Parameters

TInt aHandle Handle.

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 & aParsedReqUrl given URL
const TDesC8 & aMsgBody Message body from post operation

IsToBeDeleted()

TBool IsToBeDeleted ( ) [private]

Tells that download should be deleted.

Move()

IMPORT_C TInt Move ( )

Moves downloaded content to the previously specified location

Pause()

IMPORT_C TInt Pause ( )

Pauses downloading.

Reset()

IMPORT_C TInt Reset ( )

Resets downloading.

ResumeCodDownloadL()

void ResumeCodDownloadL ( )

Resume COD download.

SaveDownloadInfoL()

void SaveDownloadInfoL ( ) [private]

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

SetBoolAttribute(const TUint, TBool)

IMPORT_C TInt SetBoolAttribute ( const TUint aAttribute,
TBool aValue
)

Sets the value for a TDesC attribute.

Parameters

const TUint aAttribute Identifies the attribute to be set.
TBool aValue The value to be set.

SetCodInProgress(TCodProgressState)

void SetCodInProgress ( TCodProgressState aVal ) [private]

Sets COD in progress flag.

Parameters

TCodProgressState aVal

SetDefaultAttributesL(const TDesC8 &)

void SetDefaultAttributesL ( const TDesC8 & aPackedAttribs ) [private]

Sets the default value for the attributes.

Parameters

const TDesC8 & aPackedAttribs

SetDownloadDataAttribute(const TDesC8 &)

IMPORT_C TInt SetDownloadDataAttribute ( const TDesC8 & aValue )

Sets the download data (media information).

Parameters

const TDesC8 & aValue The value to be set.

SetEventType(THttpDownloadState)

void SetEventType ( THttpDownloadState aEventType ) [private]

Sets event type.

Parameters

THttpDownloadState aEventType

SetFileHandleAttribute(RFile &)

IMPORT_C TInt SetFileHandleAttribute ( RFile & aFile )

Sets the download's destination file handle.

Parameters

RFile & aFile RFile to be transfered to server.

SetHttpTransactionL(TInt)

void SetHttpTransactionL ( TInt aHttpTransaction ) [private]

Sets http transaction.

Parameters

TInt aHttpTransaction

SetIntAttribute(const TUint, TInt32)

IMPORT_C TInt SetIntAttribute ( const TUint aAttribute,
TInt32 aValue
)

Sets the value for a TInt attribute.

Parameters

const TUint aAttribute Identifies the attribute to be set.
TInt32 aValue The value to be set.

SetOnError(TInt, THttpDownloadMgrError)

TInt SetOnError ( TInt aError,
THttpDownloadMgrError aDlError = EGeneral
) [private]

Sets the error value.

Parameters

TInt aError
THttpDownloadMgrError aDlError = EGeneral

SetStringAttribute(const TUint, const TDesC16 &)

IMPORT_C TInt SetStringAttribute ( const TUint aAttribute,
const TDesC16 & aValue
)

Sets the value for a TDesC attribute.

Parameters

const TUint aAttribute Identifies the attribute to be set.
const TDesC16 & aValue The value to be set.

SetStringAttribute(const TUint, const TDesC8 &)

IMPORT_C TInt SetStringAttribute ( const TUint aAttribute,
const TDesC8 & aValue
)

Sets the value for a TDesC8 attribute.

Parameters

const TUint aAttribute Identifies the attribute to be set.
const TDesC8 & aValue The value to be set.

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

IMPORT_C TInt SetStringAttribute ( const TUint aAttribute,
const TInt32 & aMoIndex,
const TDesC16 & aValue
)

Sets the value for a TDesC attribute.

Parameters

const TUint aAttribute Identifies the attribute to be set.
const TInt32 & aMoIndex Identifies the media object index.
const TDesC16 & aValue The value to be set.

SetTrackDataAttribute(const TInt, const TDesC8 &)

IMPORT_C TInt SetTrackDataAttribute ( const TInt aIndex,
const TDesC8 & aValue
)

Sets the download data (media information).

Parameters

const TInt aIndex
const TDesC8 & aValue The value to be set.

Start()

IMPORT_C TInt Start ( )

Starts downloading.

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

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

Start event notification.

Parameters

TDes8 & aDownloadState State.
TDes8 & aProgressState Progress.
TDes8 & aEventAttrib Packed attribs
TRequestStatus & aStatus Handler's request status.

StopWaitingAS()

void StopWaitingAS ( ) [private]

To stop waiting loop of AS

UnpackEventAttribL(const TDesC8 &)

void UnpackEventAttribL ( const TDesC8 & aPack ) [private]

Unpack event attribute package.

Parameters

const TDesC8 & aPack Packed 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]