CCodDownloadImpl Class Reference

class CCodDownloadImpl : public CActive

Cod Download implementation (behind proxy CCodDownload).

Inherits from

Public Member Functions
~CCodDownloadImpl()
IMPORT_C TIntActiveDownload()
IMPORT_C TPtrCGetDestFilePath(TInt)
IMPORT_C TPtrCGetPath()
IMPORT_C HBufC8 *GetPostResponseUrlL()
IMPORT_C TPtrCName()
IMPORT_C CCodDownloadImpl *NewL(CCodDownload &, const TDesC8 &, const TDesC8 &, MCodDownloadObserver &, CEikonEnv *, const TDesC8 *, const TDesC16 *)
IMPORT_C CCodDownloadImpl *NewL(CCodDownload &, const TInt, const TUid, const TDesC8 &, MCodDownloadObserver &, CEikonEnv *, const TDesC8 *, const TDesC16 *)
IMPORT_C HBufC8 *NextUrlL()
IMPORT_C voidPause()
IMPORT_C const TCodDownloadProgress &Progress()
IMPORT_C TBoolRemovableMedia()
IMPORT_C voidServiceFlowL()
IMPORT_C voidSetCodDlAttached(const TBool)
IMPORT_C voidSetUserData(TAny *)
IMPORT_C voidStartL(const CAiwGenericParamList *)
IMPORT_C voidStop()
IMPORT_C TPtrC8Type()
IMPORT_C HBufC8 *UpdatedDDUriL()
IMPORT_C HBufC8 *UpdatedDownloadDataL()
IMPORT_C HBufC8 *UpdatedTrackDataL(TInt &)
IMPORT_C TAny *UserData()
Private Member Functions
CCodDownloadImpl(CCodDownload &, MCodDownloadObserver &, CEikonEnv *)
voidActivateNextUrlL()
TBool ConfirmConnectL()
TInt ConnError()
voidConstructL(const TDesC8 &, const TDesC8 &, const TDesC8 *, const TDesC16 *)
voidConstructL(const TInt, const TUid, const TDesC8 &, const TDesC8 *, const TDesC16 *)
voidContentTypeChanged()
voidDoCancel()
TBool DoServiceFlowL()
voidDone()
voidDone(TInt, TInt)
voidDownloadPaused()
voidDownloadResumedPdAvailable()
voidEndConnect()
voidGetRootPathL(TDes &)
voidHandleRoapPostResponseUrlL(const TDesC8 &)
voidHandleServerAppExit(TInt)
voidLaunchHelpL(const TDesC &)
voidLoadDoneL()
TBool LoadFailedL()
TBool LoadOkL()
voidMediaObjectNameChanged()
TPtrC8 NextUrlAttr(TBool &)
voidPdPlayAvailable()
voidProgressL(TInt, TInt)
voidResetProgress()
TBool RoAcqOkL()
TBool RoapFailedL()
TBool RoapOkL()
voidRoapTriggerParsedL(const CRoapData &)
TInt RunError(TInt)
voidRunL()
voidSetActiveDownload()
voidSetConnError(TInt)
voidSetOkL()
TInt ShowRoapCallback(TAny *)
voidStartCancelL()
voidStartConnect(TUint32)
voidStartLoadL(TInt)
voidUpdateMediaInfoL()
voidUpdatePausable(TBool)
voidUpdateTrackInfoL()
TBool UserAuthL(const TDesC &, const TDesC &, TBool, TDes &, TDes &)
voidWaitForLicenseL()
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Member Enumerations
enumTState { EInit, ESet, ELoad, ELoadDone, EServiceFlow }
Inherited Enumerations
CActive:TPriority
Private Attributes
TUid iAppUId
TBool iAttached
TBool iAutoAccept
HBufC8 *iBuf
TBool iCod
TInt iConnError
TPtrC8 iDescriptor
CDocumentHandler *iDocHandler
CAiwGenericParamList *iDocParams
TUint32 iDownloadId
TBool iDownloadPaused
CEikonEnv *iEikEnv
CCodEngBase *iEng
CErrorUI *iErrorUi
TBool iFota
RFs iFs
MCodDownloadObserver &iObserver
CAiwGenericParamList *iParams
RPointerArray< CBodyPart >iParts
HBufC8 *iPostResponseURL
TCodDownloadProgress iProgress
CCodDownload &iProxy
TBool iRoap
TBool iSilentMode
TState iState
TBool iSuppressLaunch
TBool iSuppressNextUrl
CCodUiResource *iUiResource
TAny *iUserData
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CCodDownloadImpl(CCodDownload &, MCodDownloadObserver &, CEikonEnv *)

CCodDownloadImpl(CCodDownload &aProxy,
MCodDownloadObserver &aObserver,
CEikonEnv *aEikEnv
)[private, inline]

Constructor.

Parameters

CCodDownload & aProxyProxy owning this object.
MCodDownloadObserver & aObserverObserver.
CEikonEnv * aEikEnvEikon environment or NULL. Can be NULL if download does not require UI functionality.

~CCodDownloadImpl()

IMPORT_C~CCodDownloadImpl()[virtual]

Destructor.

Member Functions Documentation

ActivateNextUrlL()

voidActivateNextUrlL()[private]

Service flow: launch browser and (optionally) activate Next-URL, if exists.

ActiveDownload()

IMPORT_C TIntActiveDownload()

Currently active COD download

ConfirmConnectL()

TBool ConfirmConnectL()[private, virtual]

Get confirmation for creating network connection.

ConnError()

TInt ConnError()[private, inline, virtual]

Connection Error return: Connection Error .

ConstructL(const TDesC8 &, const TDesC8 &, const TDesC8 *, const TDesC16 *)

voidConstructL(const TDesC8 &aBuf,
const TDesC8 &aType,
const TDesC8 *aMultipartBoundary,
const TDesC16 *aMultipartUrl
)[private]

Second phase constructor. Leaves on failure.

Parameters

const TDesC8 & aBufThe descriptor.
const TDesC8 & aTypeData type.
const TDesC8 * aMultipartBoundaryMultipart boundary or NULL. Required for processing multipart.
const TDesC16 * aMultipartUrlMultipart URL or NULL. Required for processing multipart.

ConstructL(const TInt, const TUid, const TDesC8 &, const TDesC8 *, const TDesC16 *)

voidConstructL(const TIntaDownloadId,
const TUidaDlUid,
const TDesC8 &aType,
const TDesC8 *aMultipartBoundary,
const TDesC16 *aMultipartUrl
)[private]

Second phase constructor. Leaves on failure.

Parameters

const TInt aDownloadIdThe download id.
const TUid aDlUidThe app uid.
const TDesC8 & aTypeData type.
const TDesC8 * aMultipartBoundaryMultipart boundary or NULL. Required for processing multipart.
const TDesC16 * aMultipartUrlMultipart URL or NULL. Required for processing multipart.

ContentTypeChanged()

voidContentTypeChanged()[private, virtual]

To update the server about content type.

DoCancel()

voidDoCancel()[private, virtual]

Cancel protocol implementation.

DoServiceFlowL()

TBool DoServiceFlowL()[private]
Perform service flow after a successful or failed download. This consists of zero, one or both of
  • launching dwonloaded content

  • activating Next-URL. Load may also be retried.

Done()

voidDone()[private]

Finished.

Done(TInt, TInt)

voidDone(TIntaStatusCode,
TIntaError
)[private, virtual]

Processing ended. Note that if processing does not include loading, this method can be called without a preceding StartLoadL call.

Parameters

TInt aStatusCodeHTTP status code (aError mapped to HTTP status code).
TInt aErrorError code of result. (The Set(), Accept() or Reject() request to CodEng will also complete with this value.)

DownloadPaused()

voidDownloadPaused()[private, inline, virtual]

To indicate the download is paused

DownloadResumedPdAvailable()

voidDownloadResumedPdAvailable()[private, inline, virtual]

To indicate the download is resumed and ready for PD

EndConnect()

voidEndConnect()[private, virtual]

Connected.

GetDestFilePath(TInt)

IMPORT_C TPtrCGetDestFilePath(TIntaMOIndex)const

Get Destination file name

Parameters

TInt aMOIndexmedia object index between 1 to 'n'

GetPath()

IMPORT_C TPtrCGetPath()const

Get path of saved content (or empty string). Available only after successful download.

GetPostResponseUrlL()

IMPORT_C HBufC8 *GetPostResponseUrlL()const

Get PostResponse-URL.

GetRootPathL(TDes &)

voidGetRootPathL(TDes &aRootPath)[private, virtual]

Get download root path. Leave with KErrCancel if query is cancelled.

Parameters

TDes & aRootPathRoot path returned here.

HandleRoapPostResponseUrlL(const TDesC8 &)

voidHandleRoapPostResponseUrlL(const TDesC8 &aPrUrl)[private, virtual]

To handle PostResponseUrlL as part of metering response

Parameters

const TDesC8 & aPrUrl

HandleServerAppExit(TInt)

voidHandleServerAppExit(TIntaReason)[private]

Embedded document viewing has ended.

Parameters

TInt aReasonExit reason (unused).

LaunchHelpL(const TDesC &)

voidLaunchHelpL(const TDesC &aContext)[private]

Launch help dialog

Parameters

const TDesC & aContext

LoadDoneL()

voidLoadDoneL()[private]

Load done.

LoadFailedL()

TBool LoadFailedL()[private]

Handle failed load.

LoadOkL()

TBool LoadOkL()[private]

Handle successful load.

MediaObjectNameChanged()

voidMediaObjectNameChanged()[private, virtual]

To update the server about next media object being downloaded.

Name()

IMPORT_C TPtrCName()

Get name attribute. This may be empty string, if attribute is empty or not available. Do not store pointer (data may change as download proceeds).

NewL(CCodDownload &, const TDesC8 &, const TDesC8 &, MCodDownloadObserver &, CEikonEnv *, const TDesC8 *, const TDesC16 *)

IMPORT_C CCodDownloadImpl *NewL(CCodDownload &aProxy,
const TDesC8 &aBuf,
const TDesC8 &aType,
MCodDownloadObserver &aObserver,
CEikonEnv *aEikEnv,
const TDesC8 *aMultipartBoundary,
const TDesC16 *aMultipartUrl
)[static]

Two-phased constructor. Leaves on failure.

Parameters

CCodDownload & aProxyProxy owning this object.
const TDesC8 & aBufThe descriptor.
const TDesC8 & aTypeDescriptor data type.
MCodDownloadObserver & aObserverObserver.
CEikonEnv * aEikEnvEikon environment or NULL. Can be NULL if download does not require UI functionality.
const TDesC8 * aMultipartBoundaryMultipart boundary or NULL. Required for processing multipart.
const TDesC16 * aMultipartUrlMultipart URL or NULL. Required for processing multipart.

NewL(CCodDownload &, const TInt, const TUid, const TDesC8 &, MCodDownloadObserver &, CEikonEnv *, const TDesC8 *, const TDesC16 *)

IMPORT_C CCodDownloadImpl *NewL(CCodDownload &aProxy,
const TIntaDownloadId,
const TUidaDlUid,
const TDesC8 &aType,
MCodDownloadObserver &aObserver,
CEikonEnv *aEikEnv,
const TDesC8 *aMultipartBoundary,
const TDesC16 *aMultipartUrl
)[static]

Two-phased constructor. Leaves on failure.

Parameters

CCodDownload & aProxyProxy owning this object.
const TInt aDownloadIdThe download id.
const TUid aDlUidThe app UID.
const TDesC8 & aTypeDescriptor data type.
MCodDownloadObserver & aObserverObserver.
CEikonEnv * aEikEnvEikon environment or NULL. Can be NULL if download does not require UI functionality.
const TDesC8 * aMultipartBoundaryMultipart boundary or NULL. Required for processing multipart.
const TDesC16 * aMultipartUrlMultipart URL or NULL. Required for processing multipart.

NextUrlAttr(TBool &)

TPtrC8 NextUrlAttr(TBool &aBack)const [private]

Get Next-URL (possibly relative) attribute.

Parameters

TBool & aBackEtrue is returned here if Next-URL is 'back'.

NextUrlL()

IMPORT_C HBufC8 *NextUrlL()const

Get Next-URL.

Pause()

IMPORT_C voidPause()

Pause COD Download.

PdPlayAvailable()

voidPdPlayAvailable()[private, virtual]

Progresive download "Play" is available return: Connection Error .

Progress()

IMPORT_C const TCodDownloadProgress &Progress()const

Get progress.

ProgressL(TInt, TInt)

voidProgressL(TIntaFinalValue,
TIntaCurrentValue
)[private, virtual]

Load progress update.

Parameters

TInt aFinalValueFinal progress value.
TInt aCurrentValueCurrent progress value.

RemovableMedia()

IMPORT_C TBoolRemovableMedia()const

Check if downloading to removable media. Available after EAccept event.

ResetProgress()

voidResetProgress()[private, inline]

Reset progress.

RoAcqOkL()

TBool RoAcqOkL()[private]

Handle successful RoAcq ROAP.

RoapFailedL()

TBool RoapFailedL()[private]

Handle failed ROAP.

RoapOkL()

TBool RoapOkL()[private]

Handle successful ROAP.

RoapTriggerParsedL(const CRoapData &)

voidRoapTriggerParsedL(const CRoapData &aData)[private, virtual]

ROAP Trigger parsed (success or error).

Parameters

const CRoapData & aDataROAP Trigger data.

RunError(TInt)

TInt RunError(TIntaError)[private, virtual]

Handle error.

Parameters

TInt aErrorError code.

RunL()

voidRunL()[private, virtual]

Outstanding request completed.

ServiceFlowL()

IMPORT_C voidServiceFlowL()
Perform service flow after a successful or failed download. This consists of zero, one or both of
  • launching dwonloaded content

  • activating Next-URL. Load may also be retried. Call this in response to EEndLoad event.

SetActiveDownload()

voidSetActiveDownload()[private, virtual]

SetActive Download

SetCodDlAttached(const TBool)

IMPORT_C voidSetCodDlAttached(const TBoolaValue)

Set COD download attached

Parameters

const TBool aValueIf equals ETrue - download is attached

SetConnError(TInt)

voidSetConnError(TIntaError)[private, inline, virtual]

Connection Error return: Connection Error .

Parameters

TInt aError

SetOkL()

voidSetOkL()[private]

SetL succeeded.

SetUserData(TAny *)

IMPORT_C voidSetUserData(TAny *aUserData)

Set tansparent user data.

Parameters

TAny * aUserDataUser data.

ShowRoapCallback(TAny *)

TInt ShowRoapCallback(TAny *aPtr)[private, static]

Call back function to launch the help

Parameters

TAny * aPtr

StartCancelL()

voidStartCancelL()[private, virtual]

Cancelling content load started. Not called if cancelling error report.

StartConnect(TUint32)

voidStartConnect(TUint32aIap)[private, virtual]

Opening a connection.

Parameters

TUint32 aIapAP to be used for creating the connection.

StartL(const CAiwGenericParamList *)

IMPORT_C voidStartL(const CAiwGenericParamList *aParams)

Start download. Panics if already active. Restart is OK for completed downloads.

Parameters

const CAiwGenericParamList * aParamsParameters or NULL.

StartLoadL(TInt)

voidStartLoadL(TIntaStatusCode)[private, virtual]

Starting load (fetch content or error-notify).

Parameters

TInt aStatusCodeHTTP status code.900 (Success) indicates start of content load.Other values indicate start of error report.

Stop()

IMPORT_C voidStop()

Stop (cancel) download. Safe to call in any state. Some processing still follows (e.g. install-notify).

Type()

IMPORT_C TPtrC8Type()const

Get data type of content (or empty string: type may not be available).

UpdateMediaInfoL()

voidUpdateMediaInfoL()[private, virtual]

Inform DownloadMgrClntSrv about updated media info return: Connection Error .

UpdatePausable(TBool)

voidUpdatePausable(TBoolaPausable)[private, virtual]

To update the server about whether or not download is pausable

Parameters

TBool aPausable

UpdateTrackInfoL()

voidUpdateTrackInfoL()[private, virtual]

Inform DownloadMgrClntSrv about updated track return: Connection Error .

UpdatedDDUriL()

IMPORT_C HBufC8 *UpdatedDDUriL()const

Get updated DD URi

UpdatedDownloadDataL()

IMPORT_C HBufC8 *UpdatedDownloadDataL()const

Set the CodData stream descriptor.

UpdatedTrackDataL(TInt &)

IMPORT_C HBufC8 *UpdatedTrackDataL(TInt &aValue)const

Set the stream descriptor for single mediaq object (track).

Parameters

TInt & aValue

UserAuthL(const TDesC &, const TDesC &, TBool, TDes &, TDes &)

TBool UserAuthL(const TDesC &aHost,
const TDesC &aRealm,
TBoolaProxyAuth,
TDes &aUsername,
TDes &aPassword
)[private, virtual]

Authenticate user.

Parameters

const TDesC & aHostHost.
const TDesC & aRealmRealm.
TBool aProxyAuthETrue if this is a proxy authentication.
TDes & aUsernameReturn username here.
TDes & aPasswordReturn password here.

UserData()

IMPORT_C TAny *UserData()const

Get tansparent user data.

WaitForLicenseL()

voidWaitForLicenseL()[private, virtual]

Displays Info message "Waiting for license"

Member Enumerations Documentation

Enum TState

Enumerators

EInit
ESet
ELoad
ELoadDone
EServiceFlow

Member Data Documentation

TUid iAppUId

TUid iAppUId[private]

TBool iAttached

TBool iAttached[private]

TBool iAutoAccept

TBool iAutoAccept[private]

HBufC8 * iBuf

HBufC8 *iBuf[private]

TBool iCod

TBool iCod[private]

TInt iConnError

TInt iConnError[private]

TPtrC8 iDescriptor

TPtrC8 iDescriptor[private]

CDocumentHandler * iDocHandler

CDocumentHandler *iDocHandler[private]

CAiwGenericParamList * iDocParams

CAiwGenericParamList *iDocParams[private]

TUint32 iDownloadId

TUint32 iDownloadId[private]

TBool iDownloadPaused

TBool iDownloadPaused[private]

CEikonEnv * iEikEnv

CEikonEnv *iEikEnv[private]

CCodEngBase * iEng

CCodEngBase *iEng[private]

CErrorUI * iErrorUi

CErrorUI *iErrorUi[private]

TBool iFota

TBool iFota[private]

RFs iFs

RFs iFs[private]

MCodDownloadObserver & iObserver

MCodDownloadObserver &iObserver[private]

CAiwGenericParamList * iParams

CAiwGenericParamList *iParams[private]

RPointerArray< CBodyPart > iParts

RPointerArray< CBodyPart >iParts[private]

HBufC8 * iPostResponseURL

HBufC8 *iPostResponseURL[private]

TCodDownloadProgress iProgress

TCodDownloadProgress iProgress[private]

CCodDownload & iProxy

CCodDownload &iProxy[private]

TBool iRoap

TBool iRoap[private]

TBool iSilentMode

TBool iSilentMode[private]

TState iState

TState iState[private]

TBool iSuppressLaunch

TBool iSuppressLaunch[private]

TBool iSuppressNextUrl

TBool iSuppressNextUrl[private]

CCodUiResource * iUiResource

CCodUiResource *iUiResource[private]

TAny * iUserData

TAny *iUserData[private]