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 void AddObserverL ( MHttpDownloadMgrObserver &)
IMPORT_C void Close ()
IMPORT_C void ConnectL ( 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 TInt DeleteAll ()
IMPORT_C TInt Disconnect ()
IMPORT_C RHttpDownload * FindDownload (const TDesC8 &, const TDesC8 &)
IMPORT_C TInt GetBoolAttribute (const TUint , TBool &)
IMPORT_C TInt GetIntAttribute (const TUint , TInt32 &)
IMPORT_C TInt GetStringAttribute (const TUint , TDes16 &)
IMPORT_C TInt GetStringAttribute (const TUint , TDes8 &)
TBool IsNewDownloadPossible ()
IMPORT_C TInt PauseAll ()
IMPORT_C void RemoveObserver ( MHttpDownloadMgrObserver &)
IMPORT_C TInt ResetAll ()
IMPORT_C TInt SetBoolAttribute (const TUint , TBool )
IMPORT_C TInt SetDefaultBoolAttribute (const TUint , TBool )
IMPORT_C TInt SetDefaultIntAttribute (const TUint , TInt32 )
IMPORT_C TInt SetDefaultStringAttribute (const TUint , const TDesC16 &)
IMPORT_C TInt SetDefaultStringAttribute (const TUint , const TDesC8 &)
IMPORT_C TInt SetIntAttribute (const TUint , TInt32 )
IMPORT_C void SetNextUriObserver ( MHttpDownloadMgrNextUriObserver *)
IMPORT_C TInt SetStringAttribute (const TUint , const TDesC16 &)
IMPORT_C TInt SetStringAttribute (const TUint , const TDesC8 &)
IMPORT_C TInt StartAll ()
IMPORT_C TVersion Version ()
Protected Member Functions
RHttpDownload & AddToArrayL ( RHttpDownload *)
void HandleDMgrEventL ( RHttpDownload &, THttpDownloadEvent )
Private Member Functions
void AttachL ( TDes8 &)
void BroadcastEvent ( RHttpDownload &, THttpDownloadEvent )
void CancelSessionEventNotification ()
void CloseDownload ( RHttpDownload *)
void DecrementEventPriorityFlag ()
void DoConnectL ( TUid , MHttpDownloadMgrObserver &, TBool )
RHttpDownload * DoFindDownloadL (const TDesC8 &, const TDesC8 &)
void DoHandleSessionEventL ( TInt , THttpDownloadEvent )
void DoSetDefaultAttributeL (const TUint , TInt32 )
void DoSetDefaultAttributeL (const TUint , TBool )
void DoSetDefaultAttributeL (const TUint , const TDesC8 &)
void DoSetDefaultAttributeL (const TUint , const TDesC16 &)
RHttpDownload & DownloadFromHandleL ( TUint )
TInt EventPriorityFlag ()
TInt FindInArray ( RHttpDownload *, TInt &)
TInt FindObserver ( MHttpDownloadMgrObserver &, TInt &)
void HandleSessionEventL ( TInt , THttpDownloadEvent )
void IncrementEventPriorityFlag ()
void InitializeL ( TUid , MHttpDownloadMgrObserver &, TBool )
TBool IsEventBroadcasting ()
MHttpDownloadMgrNextUriObserver * NextUriObserver ()
TInt NumberOfClientSideDownload ( TInt32 &)
HBufC8 * PackedDefaultAttributesLC ()
void RemoveFromArray ( RHttpDownload *)
TInt SessionId ()
void StartSessionEventNotification (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_C RHttpDownloadMgr ( )

C++ default constructor.

Member Functions Documentation

AddObserverL(MHttpDownloadMgrObserver &)

IMPORT_C void AddObserverL ( MHttpDownloadMgrObserver & aObserver )

Adds client to the observer list.

Parameters

MHttpDownloadMgrObserver & aObserver Observer.

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 * aElement Download subsession.

AttachL(TDes8 &)

void AttachL ( TDes8 & aBuf ) [private]

Attach client to the session.

Parameters

TDes8 & aBuf Buffer to the subsession IDs.

BroadcastEvent(RHttpDownload &, THttpDownloadEvent)

void BroadcastEvent ( RHttpDownload & aDownload,
THttpDownloadEvent aEvent
) [private]

Broadcasts an event.

Parameters

RHttpDownload & aDownload The download with which the event occured.
THttpDownloadEvent aEvent Event type.

CancelSessionEventNotification()

void CancelSessionEventNotification ( ) [private]

Cancels session's event notification.

Close()

IMPORT_C void Close ( )

Closes download manager session.

CloseDownload(RHttpDownload *)

void CloseDownload ( RHttpDownload * aElement ) [private]

Close a download subsession.

Parameters

RHttpDownload * aElement Download subsession.

ConnectL(TUid, MHttpDownloadMgrObserver &, TBool)

IMPORT_C void ConnectL ( TUid aAppUid,
MHttpDownloadMgrObserver & aObserver,
TBool aMaster
)

Creates a download manager session.

Parameters

TUid aAppUid Client application's UID.
MHttpDownloadMgrObserver & aObserver Observer
TBool aMaster Indicates whether (if ETrue) this instance inherints all downloads of other instances. (stand-alone app flag).

CreateClientSideDownloadL(TInt, TBool &)

IMPORT_C RHttpDownload & CreateClientSideDownloadL ( TInt aHttpTransaction,
TBool & aResult
)

Creates a new download in client side.

Parameters

TInt aHttpTransaction http transaction.
TBool & aResult The 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 & aUrl The url from the COD is downloaded.
const TDesC8 & aBuf The COD descriptor.
const TDesC8 & aMimeType The mimetype.
CEikonEnv * aEikEnv Eikon environment or NULL. Can be NULL if download does not require UI functionality.
TBool & aResult The 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 & aUrl The url to be downloaded.
TBool & aResult The 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 & aUrl The 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()

void DecrementEventPriorityFlag ( ) [private]

Decrements the event priority flag

DeleteAll()

IMPORT_C TInt DeleteAll ( )

Deletes all downloads.

Disconnect()

IMPORT_C TInt Disconnect ( )

Disconnect the http connection and pauses all downloads.

DoConnectL(TUid, MHttpDownloadMgrObserver &, TBool)

void DoConnectL ( TUid aAppUid,
MHttpDownloadMgrObserver & aObserver,
TBool aMaster
) [private]

Creates a download manager session.

Parameters

TUid aAppUid Client application's UID.
MHttpDownloadMgrObserver & aObserver Observer
TBool aMaster Indicates 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)

void DoHandleSessionEventL ( TInt aHandle,
THttpDownloadEvent aEvent
) [private]

Do-Indicates the session's event.

Parameters

TInt aHandle Unique identifier of server side subsession.
THttpDownloadEvent aEvent Event type.

DoSetDefaultAttributeL(const TUint, TInt32)

void DoSetDefaultAttributeL ( const TUint aAttribute,
TInt32 aValue
) [private]

Sets the default value for the TInt32 attribute.

Parameters

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

DoSetDefaultAttributeL(const TUint, TBool)

void DoSetDefaultAttributeL ( const TUint aAttribute,
TBool aValue
) [private]

Sets the default value for the TBool attribute.

Parameters

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

DoSetDefaultAttributeL(const TUint, const TDesC8 &)

void DoSetDefaultAttributeL ( const TUint aAttribute,
const TDesC8 & aValue
) [private]

Sets the default value for the TDesC8 attribute.

Parameters

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

DoSetDefaultAttributeL(const TUint, const TDesC16 &)

void DoSetDefaultAttributeL ( const TUint aAttribute,
const TDesC16 & aValue
) [private]

Sets the default value for the TDesC16 attribute.

Parameters

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

DownloadFromHandleL(TUint)

RHttpDownload & DownloadFromHandleL ( TUint aHandle ) [private]

Returns a reference to the download identified by a handle.

Parameters

TUint aHandle Handle 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 & aUrl given URL
const TDesC8 & aMsgBody Message body from post operation

FindInArray(RHttpDownload *, TInt &)

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

Finds the download in the list.

Parameters

RHttpDownload * aElement Download subsession.
TInt & aIndex Index of the element found.

FindObserver(MHttpDownloadMgrObserver &, TInt &)

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

Finds observer based on index.

Parameters

MHttpDownloadMgrObserver & aObserver Observer found.
TInt & aIndex Index.

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.

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.

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.

HandleDMgrEventL(RHttpDownload &, THttpDownloadEvent)

void HandleDMgrEventL ( RHttpDownload & aDownload,
THttpDownloadEvent aEvent
) [protected]

Indicates an event.

Parameters

RHttpDownload & aDownload The download with which the event occured.
THttpDownloadEvent aEvent Event type.

HandleSessionEventL(TInt, THttpDownloadEvent)

void HandleSessionEventL ( TInt aHandle,
THttpDownloadEvent aEvent
) [private]

Indicates the session's event.

Parameters

TInt aHandle Unique identifier of server side subsession.
THttpDownloadEvent aEvent Event type.

IncrementEventPriorityFlag()

void IncrementEventPriorityFlag ( ) [private]

Increments the event priority flas

InitializeL(TUid, MHttpDownloadMgrObserver &, TBool)

void InitializeL ( TUid aAppUid,
MHttpDownloadMgrObserver & aObserver,
TBool aMaster
) [private]

Initializes the download manager session.

Parameters

TUid aAppUid Client app's UID.
MHttpDownloadMgrObserver & aObserver Observer to add to the observer list.
TBool aMaster Indicates 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 & aValue Num of client side download

PackedDefaultAttributesLC()

HBufC8 * PackedDefaultAttributesLC ( ) [private]

Packes the default values of the attributes.

PauseAll()

IMPORT_C TInt PauseAll ( )

Pauses all downloads.

RemoveFromArray(RHttpDownload *)

void RemoveFromArray ( RHttpDownload * aElement ) [private]

Removes the download from the list.

Parameters

RHttpDownload * aElement Download subsession.

RemoveObserver(MHttpDownloadMgrObserver &)

IMPORT_C void RemoveObserver ( MHttpDownloadMgrObserver & aObserver )

Removes client from the observer list.

Parameters

MHttpDownloadMgrObserver & aObserver Observer.

ResetAll()

IMPORT_C TInt ResetAll ( )

Resets all downloads.

SessionId()

TInt SessionId ( ) const [private]

Returns the session id

SetBoolAttribute(const TUint, TBool)

IMPORT_C TInt SetBoolAttribute ( const TUint aAttribute,
TBool aValue
)

Sets the value for a TBool attribute.

Parameters

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

SetDefaultBoolAttribute(const TUint, TBool)

IMPORT_C TInt SetDefaultBoolAttribute ( const TUint aAttribute,
TBool aValue
)

Sets the value for the default TBool attribute.

Parameters

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

SetDefaultIntAttribute(const TUint, TInt32)

IMPORT_C TInt SetDefaultIntAttribute ( const TUint aAttribute,
TInt32 aValue
)

Sets the value for the default TInt attribute.

Parameters

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

SetDefaultStringAttribute(const TUint, const TDesC16 &)

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

Sets the value for the default TDesC attribute.

Parameters

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

SetDefaultStringAttribute(const TUint, const TDesC8 &)

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

Sets the value for the default TDesC8 attribute.

Parameters

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

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.

SetNextUriObserver(MHttpDownloadMgrNextUriObserver *)

IMPORT_C void SetNextUriObserver ( MHttpDownloadMgrNextUriObserver * aObserver )

Set next uri observer.

Parameters

MHttpDownloadMgrNextUriObserver * aObserver Observer.

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.

StartAll()

IMPORT_C TInt StartAll ( )

Resumes all downloads.

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

void StartSessionEventNotification ( 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 & aStatus Handler's request status.

Version()

IMPORT_C TVersion Version ( ) 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]