RHttpDownloadMgr Class Reference

class RHttpDownloadMgr : public RSessionBase

Creates a download manager session and performs operations on it

-
Since
Series 60 2.8

Inherits from

Public Member Functions
RHttpDownloadMgr()
IMPORT_C voidAddObserverL(MHttpDownloadMgrObserver &)
IMPORT_C voidClose()
IMPORT_C voidConnectL(TUid, MHttpDownloadMgrObserver &, TBool)
IMPORT_C RHttpDownload &CreateClientSideDownloadL(TInt, TBool &)
IMPORT_C RHttpDownload &CreateCodDownloadL(const TDesC8 &, const TDesC8 &, const TDesC8 &, CEikonEnv *, TBool &)
IMPORT_C RHttpDownload &CreateDownloadL(const TDesC8 &, TBool &)
IMPORT_C RHttpDownload &CreateDownloadL(const TDesC8 &)
IMPORT_C const CDownloadArray &CurrentDownloads()
IMPORT_C TIntDeleteAll()
IMPORT_C TIntDisconnect()
IMPORT_C RHttpDownload *FindDownload(const TDesC8 &, const TDesC8 &)
IMPORT_C TIntGetBoolAttribute(const TUint, TBool &)
IMPORT_C TIntGetIntAttribute(const TUint, TInt32 &)
IMPORT_C TIntGetStringAttribute(const TUint, TDes16 &)
IMPORT_C TIntGetStringAttribute(const TUint, TDes8 &)
TBool IsNewDownloadPossible()
IMPORT_C TIntPauseAll()
IMPORT_C voidRemoveObserver(MHttpDownloadMgrObserver &)
IMPORT_C TIntResetAll()
IMPORT_C TIntSetBoolAttribute(const TUint, TBool)
IMPORT_C TIntSetDefaultBoolAttribute(const TUint, TBool)
IMPORT_C TIntSetDefaultIntAttribute(const TUint, TInt32)
IMPORT_C TIntSetDefaultStringAttribute(const TUint, const TDesC16 &)
IMPORT_C TIntSetDefaultStringAttribute(const TUint, const TDesC8 &)
IMPORT_C TIntSetIntAttribute(const TUint, TInt32)
IMPORT_C voidSetNextUriObserver(MHttpDownloadMgrNextUriObserver *)
IMPORT_C TIntSetStringAttribute(const TUint, const TDesC16 &)
IMPORT_C TIntSetStringAttribute(const TUint, const TDesC8 &)
IMPORT_C TIntStartAll()
IMPORT_C TVersionVersion()
Protected Member Functions
RHttpDownload &AddToArrayL(RHttpDownload *)
voidHandleDMgrEventL(RHttpDownload &, THttpDownloadEvent)
Private Member Functions
voidAttachL(TDes8 &)
voidBroadcastEvent(RHttpDownload &, THttpDownloadEvent)
voidCancelSessionEventNotification()
voidCloseDownload(RHttpDownload *)
voidDecrementEventPriorityFlag()
voidDoConnectL(TUid, MHttpDownloadMgrObserver &, TBool)
RHttpDownload *DoFindDownloadL(const TDesC8 &, const TDesC8 &)
voidDoHandleSessionEventL(TInt, THttpDownloadEvent)
voidDoSetDefaultAttributeL(const TUint, TInt32)
voidDoSetDefaultAttributeL(const TUint, TBool)
voidDoSetDefaultAttributeL(const TUint, const TDesC8 &)
voidDoSetDefaultAttributeL(const TUint, const TDesC16 &)
RHttpDownload &DownloadFromHandleL(TUint)
TInt EventPriorityFlag()
TInt FindInArray(RHttpDownload *, TInt &)
TInt FindObserver(MHttpDownloadMgrObserver &, TInt &)
voidHandleSessionEventL(TInt, THttpDownloadEvent)
voidIncrementEventPriorityFlag()
voidInitializeL(TUid, MHttpDownloadMgrObserver &, TBool)
TBool IsEventBroadcasting()
MHttpDownloadMgrNextUriObserver *NextUriObserver()
TInt NumberOfClientSideDownload(TInt32 &)
HBufC8 *PackedDefaultAttributesLC()
voidRemoveFromArray(RHttpDownload *)
TInt SessionId()
voidStartSessionEventNotification(const TDesC8 &, const TDesC8 &, const TDesC8 &, TRequestStatus &)
Inherited Functions
RHandleBase::Attributes()const
RHandleBase::BTraceId()const
RHandleBase::DoExtendedClose()
RHandleBase::Duplicate(const RThread &,TOwnerType)
RHandleBase::FullName()const
RHandleBase::FullName(TDes &)const
RHandleBase::Handle()const
RHandleBase::HandleInfo(THandleInfo *)
RHandleBase::Name()const
RHandleBase::NotifyDestruction(TRequestStatus &)
RHandleBase::Open(const TFindHandleBase &,TOwnerType)
RHandleBase::OpenByName(const TDesC &,TOwnerType,TInt)
RHandleBase::RHandleBase()
RHandleBase::RHandleBase(TInt)
RHandleBase::SetHandle(TInt)
RHandleBase::SetHandleNC(TInt)
RSessionBase::CreateSession(RServer2,const TVersion &)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TRequestStatus *)
RSessionBase::Open(RMessagePtr2,TInt,TOwnerType)
RSessionBase::Open(RMessagePtr2,TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Open(TInt,TOwnerType)
RSessionBase::Open(TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Send(TInt)const
RSessionBase::Send(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt)const
RSessionBase::SendReceive(TInt,TRequestStatus &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSessionBase::SetReturnedHandle(TInt)
RSessionBase::SetReturnedHandle(TInt,RHandleBase &)
RSessionBase::SetReturnedHandle(TInt,const TSecurityPolicy &)
RSessionBase::ShareAuto()
RSessionBase::ShareProtected()
Inherited Enumerations
RHandleBase:TAttributes
RSessionBase:TAttachMode
Private Attributes
TUid iAppUid
CArrayPtrFlat< CDefaultAttrib > *iDefaultAttribs
CDownloadArray *iDownloadArray
CRHttpDownloadMgrExtension *iExtension
CDownloadMgrHandler *iManagerHandler
CDownloadMgrObserver *iObservers
Inherited Attributes
RHandleBase::iHandle

Constructor & Destructor Documentation

RHttpDownloadMgr()

IMPORT_CRHttpDownloadMgr()

C++ default constructor.

Member Functions Documentation

AddObserverL(MHttpDownloadMgrObserver &)

IMPORT_C voidAddObserverL(MHttpDownloadMgrObserver &aObserver)

Adds client to the observer list.

Parameters

MHttpDownloadMgrObserver & aObserverObserver.

AddToArrayL(RHttpDownload *)

RHttpDownload &AddToArrayL(RHttpDownload *aElement)[protected]

Adds the created download to the list. If it is already added, then it will do nothing.

Parameters

RHttpDownload * aElementDownload subsession.

AttachL(TDes8 &)

voidAttachL(TDes8 &aBuf)[private]

Attach client to the session.

Parameters

TDes8 & aBufBuffer to the subsession IDs.

BroadcastEvent(RHttpDownload &, THttpDownloadEvent)

voidBroadcastEvent(RHttpDownload &aDownload,
THttpDownloadEventaEvent
)[private]

Broadcasts an event.

Parameters

RHttpDownload & aDownloadThe download with which the event occured.
THttpDownloadEvent aEventEvent type.

CancelSessionEventNotification()

voidCancelSessionEventNotification()[private]

Cancels session's event notification.

Close()

IMPORT_C voidClose()

Closes download manager session.

CloseDownload(RHttpDownload *)

voidCloseDownload(RHttpDownload *aElement)[private]

Close a download subsession.

Parameters

RHttpDownload * aElementDownload subsession.

ConnectL(TUid, MHttpDownloadMgrObserver &, TBool)

IMPORT_C voidConnectL(TUidaAppUid,
MHttpDownloadMgrObserver &aObserver,
TBoolaMaster
)

Creates a download manager session.

Parameters

TUid aAppUidClient application's UID.
MHttpDownloadMgrObserver & aObserverObserver
TBool aMasterIndicates whether (if ETrue) this instance inherints all downloads of other instances. (stand-alone app flag).

CreateClientSideDownloadL(TInt, TBool &)

IMPORT_C RHttpDownload &CreateClientSideDownloadL(TIntaHttpTransaction,
TBool &aResult
)

Creates a new download in client side.

Parameters

TInt aHttpTransactionhttp transaction.
TBool & aResultThe result is true if the download is created. If the URL is already being downloaded the seult is false.

CreateCodDownloadL(const TDesC8 &, const TDesC8 &, const TDesC8 &, CEikonEnv *, TBool &)

IMPORT_C RHttpDownload &CreateCodDownloadL(const TDesC8 &aUrl,
const TDesC8 &aBuf,
const TDesC8 &aMimeType,
CEikonEnv *aEikEnv,
TBool &aResult
)

Creates a new download subsession for COD.

Parameters

const TDesC8 & aUrlThe url from the COD is downloaded.
const TDesC8 & aBufThe COD descriptor.
const TDesC8 & aMimeTypeThe mimetype.
CEikonEnv * aEikEnvEikon environment or NULL. Can be NULL if download does not require UI functionality.
TBool & aResultThe result is true if the download is created. If the URL is already being downloaded the seult is false.

CreateDownloadL(const TDesC8 &, TBool &)

IMPORT_C RHttpDownload &CreateDownloadL(const TDesC8 &aUrl,
TBool &aResult
)

Creates a new download subsession.

Parameters

const TDesC8 & aUrlThe url to be downloaded.
TBool & aResultThe result is true if the download is created. If the URL is already being downloaded the seult is false.

CreateDownloadL(const TDesC8 &)

IMPORT_C RHttpDownload &CreateDownloadL(const TDesC8 &aUrl)

Creates a new download subsession. It creates a new one even if the URL is already beeing downloaded.

Parameters

const TDesC8 & aUrlThe url to be downloaded. If the URL is already being downloaded the seult is false.

CurrentDownloads()

IMPORT_C const CDownloadArray &CurrentDownloads()const

Returns a list of the current downloads.

DecrementEventPriorityFlag()

voidDecrementEventPriorityFlag()[private]

Decrements the event priority flag

DeleteAll()

IMPORT_C TIntDeleteAll()

Deletes all downloads.

Disconnect()

IMPORT_C TIntDisconnect()

Disconnect the http connection and pauses all downloads.

DoConnectL(TUid, MHttpDownloadMgrObserver &, TBool)

voidDoConnectL(TUidaAppUid,
MHttpDownloadMgrObserver &aObserver,
TBoolaMaster
)[private]

Creates a download manager session.

Parameters

TUid aAppUidClient application's UID.
MHttpDownloadMgrObserver & aObserverObserver
TBool aMasterIndicates whether (if ETrue) this instance inherints all downloads of other instances. (stand-alone app flag).

DoFindDownloadL(const TDesC8 &, const TDesC8 &)

RHttpDownload *DoFindDownloadL(const TDesC8 &aUrl,
const TDesC8 &aMsgBody
)[private]

Leave version of FindDownload

Parameters

const TDesC8 & aUrl
const TDesC8 & aMsgBody

DoHandleSessionEventL(TInt, THttpDownloadEvent)

voidDoHandleSessionEventL(TIntaHandle,
THttpDownloadEventaEvent
)[private]

Do-Indicates the session's event.

Parameters

TInt aHandleUnique identifier of server side subsession.
THttpDownloadEvent aEventEvent type.

DoSetDefaultAttributeL(const TUint, TInt32)

voidDoSetDefaultAttributeL(const TUintaAttribute,
TInt32aValue
)[private]

Sets the default value for the TInt32 attribute.

Parameters

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

DoSetDefaultAttributeL(const TUint, TBool)

voidDoSetDefaultAttributeL(const TUintaAttribute,
TBoolaValue
)[private]

Sets the default value for the TBool attribute.

Parameters

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

DoSetDefaultAttributeL(const TUint, const TDesC8 &)

voidDoSetDefaultAttributeL(const TUintaAttribute,
const TDesC8 &aValue
)[private]

Sets the default value for the TDesC8 attribute.

Parameters

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

DoSetDefaultAttributeL(const TUint, const TDesC16 &)

voidDoSetDefaultAttributeL(const TUintaAttribute,
const TDesC16 &aValue
)[private]

Sets the default value for the TDesC16 attribute.

Parameters

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

DownloadFromHandleL(TUint)

RHttpDownload &DownloadFromHandleL(TUintaHandle)[private]

Returns a reference to the download identified by a handle.

Parameters

TUint aHandleHandle identifier.

EventPriorityFlag()

TInt EventPriorityFlag()const [private]

Broadcast deleting event.

FindDownload(const TDesC8 &, const TDesC8 &)

IMPORT_C RHttpDownload *FindDownload(const TDesC8 &aUrl,
const TDesC8 &aMsgBody
)
Finds if the download is already created
Since
2.8

Parameters

const TDesC8 & aUrlgiven URL
const TDesC8 & aMsgBodyMessage body from post operation

FindInArray(RHttpDownload *, TInt &)

TInt FindInArray(RHttpDownload *aElement,
TInt &aIndex
)const [private]

Finds the download in the list.

Parameters

RHttpDownload * aElementDownload subsession.
TInt & aIndexIndex of the element found.

FindObserver(MHttpDownloadMgrObserver &, TInt &)

TInt FindObserver(MHttpDownloadMgrObserver &aObserver,
TInt &aIndex
)const [private]

Finds observer based on index.

Parameters

MHttpDownloadMgrObserver & aObserverObserver found.
TInt & aIndexIndex.

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.

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.

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.

HandleDMgrEventL(RHttpDownload &, THttpDownloadEvent)

voidHandleDMgrEventL(RHttpDownload &aDownload,
THttpDownloadEventaEvent
)[protected]

Indicates an event.

Parameters

RHttpDownload & aDownloadThe download with which the event occured.
THttpDownloadEvent aEventEvent type.

HandleSessionEventL(TInt, THttpDownloadEvent)

voidHandleSessionEventL(TIntaHandle,
THttpDownloadEventaEvent
)[private]

Indicates the session's event.

Parameters

TInt aHandleUnique identifier of server side subsession.
THttpDownloadEvent aEventEvent type.

IncrementEventPriorityFlag()

voidIncrementEventPriorityFlag()[private]

Increments the event priority flas

InitializeL(TUid, MHttpDownloadMgrObserver &, TBool)

voidInitializeL(TUidaAppUid,
MHttpDownloadMgrObserver &aObserver,
TBoolaMaster
)[private]

Initializes the download manager session.

Parameters

TUid aAppUidClient app's UID.
MHttpDownloadMgrObserver & aObserverObserver to add to the observer list.
TBool aMasterIndicates whether (if ETrue) this instance inherints all downloads of other instances. (stand-alone app flag).

IsEventBroadcasting()

TBool IsEventBroadcasting()[private]

Tells that event is being broadcasted.

IsNewDownloadPossible()

TBool IsNewDownloadPossible()

Checks for possibility of a new donload

NextUriObserver()

MHttpDownloadMgrNextUriObserver *NextUriObserver()const [private]

Returns the next uri observer from the extension calss.

NumberOfClientSideDownload(TInt32 &)

TInt NumberOfClientSideDownload(TInt32 &aValue)[private]

Gets the number of client side download.

Parameters

TInt32 & aValueNum of client side download

PackedDefaultAttributesLC()

HBufC8 *PackedDefaultAttributesLC()[private]

Packes the default values of the attributes.

PauseAll()

IMPORT_C TIntPauseAll()

Pauses all downloads.

RemoveFromArray(RHttpDownload *)

voidRemoveFromArray(RHttpDownload *aElement)[private]

Removes the download from the list.

Parameters

RHttpDownload * aElementDownload subsession.

RemoveObserver(MHttpDownloadMgrObserver &)

IMPORT_C voidRemoveObserver(MHttpDownloadMgrObserver &aObserver)

Removes client from the observer list.

Parameters

MHttpDownloadMgrObserver & aObserverObserver.

ResetAll()

IMPORT_C TIntResetAll()

Resets all downloads.

SessionId()

TInt SessionId()const [private]

Returns the session id

SetBoolAttribute(const TUint, TBool)

IMPORT_C TIntSetBoolAttribute(const TUintaAttribute,
TBoolaValue
)

Sets the value for a TBool attribute.

Parameters

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

SetDefaultBoolAttribute(const TUint, TBool)

IMPORT_C TIntSetDefaultBoolAttribute(const TUintaAttribute,
TBoolaValue
)

Sets the value for the default TBool attribute.

Parameters

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

SetDefaultIntAttribute(const TUint, TInt32)

IMPORT_C TIntSetDefaultIntAttribute(const TUintaAttribute,
TInt32aValue
)

Sets the value for the default TInt attribute.

Parameters

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

SetDefaultStringAttribute(const TUint, const TDesC16 &)

IMPORT_C TIntSetDefaultStringAttribute(const TUintaAttribute,
const TDesC16 &aValue
)

Sets the value for the default TDesC attribute.

Parameters

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

SetDefaultStringAttribute(const TUint, const TDesC8 &)

IMPORT_C TIntSetDefaultStringAttribute(const TUintaAttribute,
const TDesC8 &aValue
)

Sets the value for the default TDesC8 attribute.

Parameters

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

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.

SetNextUriObserver(MHttpDownloadMgrNextUriObserver *)

IMPORT_C voidSetNextUriObserver(MHttpDownloadMgrNextUriObserver *aObserver)

Set next uri observer.

Parameters

MHttpDownloadMgrNextUriObserver * aObserverObserver.

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.

StartAll()

IMPORT_C TIntStartAll()

Resumes all downloads.

StartSessionEventNotification(const TDesC8 &, const TDesC8 &, const TDesC8 &, TRequestStatus &)

voidStartSessionEventNotification(const TDesC8 &aDownloadState,
const TDesC8 &aProgressState,
const TDesC8 &aHandle,
TRequestStatus &aStatus
)[private]

Start session's event notification.

Parameters

const TDesC8 & aDownloadState
const TDesC8 & aProgressState
const TDesC8 & aHandle
TRequestStatus & aStatusHandler's request status.

Version()

IMPORT_C TVersionVersion()const

Gives version information.

Member Data Documentation

TUid iAppUid

TUid iAppUid[private]

CArrayPtrFlat< CDefaultAttrib > * iDefaultAttribs

CArrayPtrFlat< CDefaultAttrib > *iDefaultAttribs[private]

CDownloadArray * iDownloadArray

CDownloadArray *iDownloadArray[private]

CRHttpDownloadMgrExtension * iExtension

CRHttpDownloadMgrExtension *iExtension[private]

CDownloadMgrHandler * iManagerHandler

CDownloadMgrHandler *iManagerHandler[private]

CDownloadMgrObserver * iObservers

CDownloadMgrObserver *iObservers[private]