CCodDownloadImpl Class Reference

class CCodDownloadImpl : public CActive

Cod Download implementation (behind proxy CCodDownload ).

Inherits from

Public Member Functions
~CCodDownloadImpl ()
IMPORT_C TInt ActiveDownload ()
IMPORT_C TPtrC GetDestFilePath ( TInt )
IMPORT_C TPtrC GetPath ()
IMPORT_C HBufC8 * GetPostResponseUrlL ()
IMPORT_C TPtrC Name ()
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 void Pause ()
IMPORT_C const TCodDownloadProgress & Progress ()
IMPORT_C TBool RemovableMedia ()
IMPORT_C void ServiceFlowL ()
IMPORT_C void SetCodDlAttached (const TBool )
IMPORT_C void SetUserData ( TAny *)
IMPORT_C void StartL (const CAiwGenericParamList *)
IMPORT_C void Stop ()
IMPORT_C TPtrC8 Type ()
IMPORT_C HBufC8 * UpdatedDDUriL ()
IMPORT_C HBufC8 * UpdatedDownloadDataL ()
IMPORT_C HBufC8 * UpdatedTrackDataL ( TInt &)
IMPORT_C TAny * UserData ()
Private Member Functions
CCodDownloadImpl ( CCodDownload &, MCodDownloadObserver &, CEikonEnv *)
void ActivateNextUrlL ()
TBool ConfirmConnectL ()
TInt ConnError ()
void ConstructL (const TDesC8 &, const TDesC8 &, const TDesC8 *, const TDesC16 *)
void ConstructL (const TInt , const TUid , const TDesC8 &, const TDesC8 *, const TDesC16 *)
void ContentTypeChanged ()
void DoCancel ()
TBool DoServiceFlowL ()
void Done ()
void Done ( TInt , TInt )
void DownloadPaused ()
void DownloadResumedPdAvailable ()
void EndConnect ()
void GetRootPathL ( TDes &)
void HandleRoapPostResponseUrlL (const TDesC8 &)
void HandleServerAppExit ( TInt )
void LaunchHelpL (const TDesC &)
void LoadDoneL ()
TBool LoadFailedL ()
TBool LoadOkL ()
void MediaObjectNameChanged ()
TPtrC8 NextUrlAttr ( TBool &)
void PdPlayAvailable ()
void ProgressL ( TInt , TInt )
void ResetProgress ()
TBool RoAcqOkL ()
TBool RoapFailedL ()
TBool RoapOkL ()
void RoapTriggerParsedL (const CRoapData &)
TInt RunError ( TInt )
void RunL ()
void SetActiveDownload ()
void SetConnError ( TInt )
void SetOkL ()
TInt ShowRoapCallback ( TAny *)
void StartCancelL ()
void StartConnect ( TUint32 )
void StartLoadL ( TInt )
void UpdateMediaInfoL ()
void UpdatePausable ( TBool )
void UpdateTrackInfoL ()
TBool UserAuthL (const TDesC &, const TDesC &, TBool , TDes &, TDes &)
void WaitForLicenseL ()
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
enum TState { 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 & aProxy Proxy owning this object.
MCodDownloadObserver & aObserver Observer.
CEikonEnv * aEikEnv Eikon environment or NULL. Can be NULL if download does not require UI functionality.

~CCodDownloadImpl()

IMPORT_C ~CCodDownloadImpl ( ) [virtual]

Destructor.

Member Functions Documentation

ActivateNextUrlL()

void ActivateNextUrlL ( ) [private]

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

ActiveDownload()

IMPORT_C TInt ActiveDownload ( )

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 *)

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

Second phase constructor. Leaves on failure.

Parameters

const TDesC8 & aBuf The descriptor.
const TDesC8 & aType Data type.
const TDesC8 * aMultipartBoundary Multipart boundary or NULL. Required for processing multipart.
const TDesC16 * aMultipartUrl Multipart URL or NULL. Required for processing multipart.

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

void ConstructL ( const TInt aDownloadId,
const TUid aDlUid,
const TDesC8 & aType,
const TDesC8 * aMultipartBoundary,
const TDesC16 * aMultipartUrl
) [private]

Second phase constructor. Leaves on failure.

Parameters

const TInt aDownloadId The download id.
const TUid aDlUid The app uid.
const TDesC8 & aType Data type.
const TDesC8 * aMultipartBoundary Multipart boundary or NULL. Required for processing multipart.
const TDesC16 * aMultipartUrl Multipart URL or NULL. Required for processing multipart.

ContentTypeChanged()

void ContentTypeChanged ( ) [private, virtual]

To update the server about content type.

DoCancel()

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

void Done ( ) [private]

Finished.

Done(TInt, TInt)

void Done ( TInt aStatusCode,
TInt aError
) [private, virtual]

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

Parameters

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

DownloadPaused()

void DownloadPaused ( ) [private, inline, virtual]

To indicate the download is paused

DownloadResumedPdAvailable()

void DownloadResumedPdAvailable ( ) [private, inline, virtual]

To indicate the download is resumed and ready for PD

EndConnect()

void EndConnect ( ) [private, virtual]

Connected.

GetDestFilePath(TInt)

IMPORT_C TPtrC GetDestFilePath ( TInt aMOIndex ) const

Get Destination file name

Parameters

TInt aMOIndex media object index between 1 to 'n'

GetPath()

IMPORT_C TPtrC GetPath ( ) 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 &)

void GetRootPathL ( TDes & aRootPath ) [private, virtual]

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

Parameters

TDes & aRootPath Root path returned here.

HandleRoapPostResponseUrlL(const TDesC8 &)

void HandleRoapPostResponseUrlL ( const TDesC8 & aPrUrl ) [private, virtual]

To handle PostResponseUrlL as part of metering response

Parameters

const TDesC8 & aPrUrl

HandleServerAppExit(TInt)

void HandleServerAppExit ( TInt aReason ) [private]

Embedded document viewing has ended.

Parameters

TInt aReason Exit reason (unused).

LaunchHelpL(const TDesC &)

void LaunchHelpL ( const TDesC & aContext ) [private]

Launch help dialog

Parameters

const TDesC & aContext

LoadDoneL()

void LoadDoneL ( ) [private]

Load done.

LoadFailedL()

TBool LoadFailedL ( ) [private]

Handle failed load.

LoadOkL()

TBool LoadOkL ( ) [private]

Handle successful load.

MediaObjectNameChanged()

void MediaObjectNameChanged ( ) [private, virtual]

To update the server about next media object being downloaded.

Name()

IMPORT_C TPtrC Name ( )

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 & aProxy Proxy owning this object.
const TDesC8 & aBuf The descriptor.
const TDesC8 & aType Descriptor data type.
MCodDownloadObserver & aObserver Observer.
CEikonEnv * aEikEnv Eikon environment or NULL. Can be NULL if download does not require UI functionality.
const TDesC8 * aMultipartBoundary Multipart boundary or NULL. Required for processing multipart.
const TDesC16 * aMultipartUrl Multipart 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 TInt aDownloadId,
const TUid aDlUid,
const TDesC8 & aType,
MCodDownloadObserver & aObserver,
CEikonEnv * aEikEnv,
const TDesC8 * aMultipartBoundary,
const TDesC16 * aMultipartUrl
) [static]

Two-phased constructor. Leaves on failure.

Parameters

CCodDownload & aProxy Proxy owning this object.
const TInt aDownloadId The download id.
const TUid aDlUid The app UID.
const TDesC8 & aType Descriptor data type.
MCodDownloadObserver & aObserver Observer.
CEikonEnv * aEikEnv Eikon environment or NULL. Can be NULL if download does not require UI functionality.
const TDesC8 * aMultipartBoundary Multipart boundary or NULL. Required for processing multipart.
const TDesC16 * aMultipartUrl Multipart URL or NULL. Required for processing multipart.

NextUrlAttr(TBool &)

TPtrC8 NextUrlAttr ( TBool & aBack ) const [private]

Get Next-URL (possibly relative) attribute.

Parameters

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

NextUrlL()

IMPORT_C HBufC8 * NextUrlL ( ) const

Get Next-URL.

Pause()

IMPORT_C void Pause ( )

Pause COD Download.

PdPlayAvailable()

void PdPlayAvailable ( ) [private, virtual]

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

Progress()

IMPORT_C const TCodDownloadProgress & Progress ( ) const

Get progress.

ProgressL(TInt, TInt)

void ProgressL ( TInt aFinalValue,
TInt aCurrentValue
) [private, virtual]

Load progress update.

Parameters

TInt aFinalValue Final progress value.
TInt aCurrentValue Current progress value.

RemovableMedia()

IMPORT_C TBool RemovableMedia ( ) const

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

ResetProgress()

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

void RoapTriggerParsedL ( const CRoapData & aData ) [private, virtual]

ROAP Trigger parsed (success or error).

Parameters

const CRoapData & aData ROAP Trigger data.

RunError(TInt)

TInt RunError ( TInt aError ) [private, virtual]

Handle error.

Parameters

TInt aError Error code.

RunL()

void RunL ( ) [private, virtual]

Outstanding request completed.

ServiceFlowL()

IMPORT_C void ServiceFlowL ( )
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()

void SetActiveDownload ( ) [private, virtual]

SetActive Download

SetCodDlAttached(const TBool)

IMPORT_C void SetCodDlAttached ( const TBool aValue )

Set COD download attached

Parameters

const TBool aValue If equals ETrue - download is attached

SetConnError(TInt)

void SetConnError ( TInt aError ) [private, inline, virtual]

Connection Error return: Connection Error .

Parameters

TInt aError

SetOkL()

void SetOkL ( ) [private]

SetL succeeded.

SetUserData(TAny *)

IMPORT_C void SetUserData ( TAny * aUserData )

Set tansparent user data.

Parameters

TAny * aUserData User data.

ShowRoapCallback(TAny *)

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

Call back function to launch the help

Parameters

TAny * aPtr

StartCancelL()

void StartCancelL ( ) [private, virtual]

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

StartConnect(TUint32)

void StartConnect ( TUint32 aIap ) [private, virtual]

Opening a connection.

Parameters

TUint32 aIap AP to be used for creating the connection.

StartL(const CAiwGenericParamList *)

IMPORT_C void StartL ( const CAiwGenericParamList * aParams )

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

Parameters

const CAiwGenericParamList * aParams Parameters or NULL.

StartLoadL(TInt)

void StartLoadL ( TInt aStatusCode ) [private, virtual]

Starting load (fetch content or error-notify).

Parameters

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

Stop()

IMPORT_C void Stop ( )

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

Type()

IMPORT_C TPtrC8 Type ( ) const

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

UpdateMediaInfoL()

void UpdateMediaInfoL ( ) [private, virtual]

Inform DownloadMgrClntSrv about updated media info return: Connection Error .

UpdatePausable(TBool)

void UpdatePausable ( TBool aPausable ) [private, virtual]

To update the server about whether or not download is pausable

Parameters

TBool aPausable

UpdateTrackInfoL()

void UpdateTrackInfoL ( ) [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,
TBool aProxyAuth,
TDes & aUsername,
TDes & aPassword
) [private, virtual]

Authenticate user.

Parameters

const TDesC & aHost Host.
const TDesC & aRealm Realm.
TBool aProxyAuth ETrue if this is a proxy authentication.
TDes & aUsername Return username here.
TDes & aPassword Return password here.

UserData()

IMPORT_C TAny * UserData ( ) const

Get tansparent user data.

WaitForLicenseL()

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