CHttpTransferBase Class Reference

class CHttpTransferBase : public CActive

Base class of the downloader and uploader classes. Handles filequeue.

httptransfer.lib
Since
S60 v3.2

Inherits from

Public Member Functions
~CHttpTransferBase ()
void ActivateNewTransferRequest ()
IMPORT_C void CancelAll ()
IMPORT_C TInt CancelTransfer ( TAny *)
void DoCancel ()
IMPORT_C const HBufC * GetPropertyL ( TAny *, THttpPropertyType )
IMPORT_C void InsertFileIntoWaitQueueL ( TAny *, const TDesC &, const TDesC8 &)
IMPORT_C void InsertFileIntoWaitQueueL ( TAny *, const RFile &, const TDesC8 &)
IMPORT_C void MoveToTransferQueueL ( TAny *)
void ProcessNextFileL ()
TInt RunError ( TInt )
void RunL ()
IMPORT_C void SetHeaderL ( TAny *, const TDesC8 &, const TDesC8 &)
IMPORT_C void SetPropertyL ( TAny *, THttpPropertyType , const TDesC &)
IMPORT_C void StartTransferL ( TAny *)
IMPORT_C TInt TrackProgress ( TAny *, TBool )
void WorkerCompleted ()
Protected Member Functions
CHttpTransferBase ()
void CreateAndQueueHttpFileL (const TDesC8 &, const TDesC &, TAny *)
void CreateAndQueueHttpFileL (const TDesC8 &, const RFile &, TAny *)
CHttpFile * NextFile ()
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()
Public Member Enumerations
enum THttpPropertyType { ETargetURI , ETargetPath }
Inherited Enumerations
CActive:TPriority
Protected Attributes
CHttpTransferWorker * iActiveWorker
TUint iBufferSize
RPointerArray < CHttpFile > iFileQueue
TUint iIAPId
MHttpTransferObserver * iObserver
TUint iParallelTransfers
RPointerArray < CHttpFile > iWaitQueue
RPointerArray < CHttpTransferWorker > iWorkerArray
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CHttpTransferBase()

CHttpTransferBase ( ) [protected]

Default constructor

Since
S60 v3.2

~CHttpTransferBase()

~CHttpTransferBase ( ) [virtual]

Virtual destructor

Since
S60 v3.2

Member Functions Documentation

ActivateNewTransferRequest()

void ActivateNewTransferRequest ( )

Activates new request

Since
S60 v3.2

CancelAll()

IMPORT_C void CancelAll ( )

Deletes all the instances of CHttpFiles in iFileQueue. Also cancels all the on-going transfers.

Since
S60 v3.2

CancelTransfer(TAny *)

IMPORT_C TInt CancelTransfer ( TAny * aKey )

Deletes the corresponding instance of CHttpFile in iFileQueue or stops the corresponding transfer.

Since
S60 v3.2

Parameters

TAny * aKey Key corresponding the process

CreateAndQueueHttpFileL(const TDesC8 &, const TDesC &, TAny *)

void CreateAndQueueHttpFileL ( const TDesC8 & aUri,
const TDesC & aTargetPath,
TAny * aKey
) [protected]

Creates new CHttpFile object and adds it to the iFileQueue

Since
S60 v3.2

Parameters

const TDesC8 & aUri Uri of the downloaded object
const TDesC & aTargetPath Local path of the object
TAny * aKey Identifier of the object

CreateAndQueueHttpFileL(const TDesC8 &, const RFile &, TAny *)

void CreateAndQueueHttpFileL ( const TDesC8 & aUri,
const RFile & aFileHandle,
TAny * aKey
) [protected]

Creates new CHttpFile object and adds it to the iFileQueue

Since
S60 v3.2

Parameters

const TDesC8 & aUri Uri of the downloaded object
const RFile & aFileHandle Handle to the file on disk
TAny * aKey Identifier of the object

DoCancel()

void DoCancel ( ) [virtual]

Cancels outstanding request.

Since
S60 v3.2

GetPropertyL(TAny *, THttpPropertyType)

IMPORT_C const HBufC * GetPropertyL ( TAny * aKey,
THttpPropertyType aProperty
)

Gets a property

Since
S60 v3.2

Parameters

TAny * aKey Key of the file property concerns
THttpPropertyType aProperty Id of the property

InsertFileIntoWaitQueueL(TAny *, const TDesC &, const TDesC8 &)

IMPORT_C void InsertFileIntoWaitQueueL ( TAny * aKey,
const TDesC & aTargetPath,
const TDesC8 & aUri
)

Adds file into wait queue

Since
S60 v3.2

Parameters

TAny * aKey Key of the file
const TDesC & aTargetPath
const TDesC8 & aUri Uri of the file

InsertFileIntoWaitQueueL(TAny *, const RFile &, const TDesC8 &)

IMPORT_C void InsertFileIntoWaitQueueL ( TAny * aKey,
const RFile & aFileHandle,
const TDesC8 & aUri
)

Adds file into wait queue

Since
S60 v3.2

Parameters

TAny * aKey Key of the file
const RFile & aFileHandle Handle to the file
const TDesC8 & aUri Uri of the file

MoveToTransferQueueL(TAny *)

IMPORT_C void MoveToTransferQueueL ( TAny * aKey )

Moves the file to file queue from wait queue. Starts also the transfer.

Since
S60 v3.2

Parameters

TAny * aKey Key of the file

NextFile()

CHttpFile * NextFile ( ) [protected]

Returns and removes the last item from iFileQueue and sets it to iProcessedFile.

Since
S60 v3.2

ProcessNextFileL()

void ProcessNextFileL ( )

Processes the next file in the queue

Since
S60 v3.2

RunError(TInt)

TInt RunError ( TInt aError ) [virtual]

Handles leave which occurs in RunL

Since
S60 v3.2

Parameters

TInt aError Error code

RunL()

void RunL ( ) [virtual]

Handles request completion event.

Since
S60 v3.2

SetHeaderL(TAny *, const TDesC8 &, const TDesC8 &)

IMPORT_C void SetHeaderL ( TAny * aKey,
const TDesC8 & aFieldName,
const TDesC8 & aFieldValue
)

Sets a header

Since
S60 v3.2

Parameters

TAny * aKey the file identifier
const TDesC8 & aFieldName The field name, e.g. 'Accept'
const TDesC8 & aFieldValue The field value. e.g. 'text/plain'

SetPropertyL(TAny *, THttpPropertyType, const TDesC &)

IMPORT_C void SetPropertyL ( TAny * aKey,
THttpPropertyType aProperty,
const TDesC & aValue
)

Sets property

Since
S60 v3.2

Parameters

TAny * aKey Key of the file property concerns
THttpPropertyType aProperty Id of the property to be changed
const TDesC & aValue Value of the property

StartTransferL(TAny *)

IMPORT_C void StartTransferL ( TAny * aKey )

Starts the transfer of the file. Leaves if aKey is invalid

Since
S60 v3.2

Parameters

TAny * aKey Identifier of the downloaded file

TrackProgress(TAny *, TBool)

IMPORT_C TInt TrackProgress ( TAny * aKey,
TBool aValue
)

Switch the tracking of the duration on/off.

Since
S60 v3.2

Parameters

TAny * aKey Key corresponding the process
TBool aValue Value of the flag

WorkerCompleted()

void WorkerCompleted ( )

Call back for workers to inform when they are ready

Since
S60 v3.2

Member Enumerations Documentation

Enum THttpPropertyType

This enum is used in SetProperty to recognize the action

Since
S60 v3.2

Enumerators

ETargetURI
ETargetPath

Member Data Documentation

CHttpTransferWorker * iActiveWorker

CHttpTransferWorker * iActiveWorker [protected]

Worker which is being processed

TUint iBufferSize

TUint iBufferSize [protected]

buffer size, configurable

RPointerArray< CHttpFile > iFileQueue

RPointerArray < CHttpFile > iFileQueue [protected]

Pointerarray which contains the files

TUint iIAPId

TUint iIAPId [protected]

IAP id

MHttpTransferObserver * iObserver

MHttpTransferObserver * iObserver [protected]

Pointer to the transfer observer Not own.

TUint iParallelTransfers

TUint iParallelTransfers [protected]

Number of parallel transfers

RPointerArray< CHttpFile > iWaitQueue

RPointerArray < CHttpFile > iWaitQueue [protected]

Queue for the waiting files

RPointerArray< CHttpTransferWorker > iWorkerArray

RPointerArray < CHttpTransferWorker > iWorkerArray [protected]

Array of worker classes.