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()
voidActivateNewTransferRequest()
IMPORT_C voidCancelAll()
IMPORT_C TIntCancelTransfer(TAny *)
voidDoCancel()
IMPORT_C const HBufC *GetPropertyL(TAny *, THttpPropertyType)
IMPORT_C voidInsertFileIntoWaitQueueL(TAny *, const TDesC &, const TDesC8 &)
IMPORT_C voidInsertFileIntoWaitQueueL(TAny *, const RFile &, const TDesC8 &)
IMPORT_C voidMoveToTransferQueueL(TAny *)
voidProcessNextFileL()
TInt RunError(TInt)
voidRunL()
IMPORT_C voidSetHeaderL(TAny *, const TDesC8 &, const TDesC8 &)
IMPORT_C voidSetPropertyL(TAny *, THttpPropertyType, const TDesC &)
IMPORT_C voidStartTransferL(TAny *)
IMPORT_C TIntTrackProgress(TAny *, TBool)
voidWorkerCompleted()
Protected Member Functions
CHttpTransferBase()
voidCreateAndQueueHttpFileL(const TDesC8 &, const TDesC &, TAny *)
voidCreateAndQueueHttpFileL(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
enumTHttpPropertyType { 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()

voidActivateNewTransferRequest()

Activates new request

Since
S60 v3.2

CancelAll()

IMPORT_C voidCancelAll()

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

Since
S60 v3.2

CancelTransfer(TAny *)

IMPORT_C TIntCancelTransfer(TAny *aKey)

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

Since
S60 v3.2

Parameters

TAny * aKeyKey corresponding the process

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

voidCreateAndQueueHttpFileL(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 & aUriUri of the downloaded object
const TDesC & aTargetPathLocal path of the object
TAny * aKeyIdentifier of the object

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

voidCreateAndQueueHttpFileL(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 & aUriUri of the downloaded object
const RFile & aFileHandleHandle to the file on disk
TAny * aKeyIdentifier of the object

DoCancel()

voidDoCancel()[virtual]

Cancels outstanding request.

Since
S60 v3.2

GetPropertyL(TAny *, THttpPropertyType)

IMPORT_C const HBufC *GetPropertyL(TAny *aKey,
THttpPropertyTypeaProperty
)

Gets a property

Since
S60 v3.2

Parameters

TAny * aKeyKey of the file property concerns
THttpPropertyType aPropertyId of the property

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

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

Adds file into wait queue

Since
S60 v3.2

Parameters

TAny * aKeyKey of the file
const TDesC & aTargetPath
const TDesC8 & aUriUri of the file

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

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

Adds file into wait queue

Since
S60 v3.2

Parameters

TAny * aKeyKey of the file
const RFile & aFileHandleHandle to the file
const TDesC8 & aUriUri of the file

MoveToTransferQueueL(TAny *)

IMPORT_C voidMoveToTransferQueueL(TAny *aKey)

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

Since
S60 v3.2

Parameters

TAny * aKeyKey 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()

voidProcessNextFileL()

Processes the next file in the queue

Since
S60 v3.2

RunError(TInt)

TInt RunError(TIntaError)[virtual]

Handles leave which occurs in RunL

Since
S60 v3.2

Parameters

TInt aErrorError code

RunL()

voidRunL()[virtual]

Handles request completion event.

Since
S60 v3.2

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

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

Sets a header

Since
S60 v3.2

Parameters

TAny * aKeythe file identifier
const TDesC8 & aFieldNameThe field name, e.g. 'Accept'
const TDesC8 & aFieldValueThe field value. e.g. 'text/plain'

SetPropertyL(TAny *, THttpPropertyType, const TDesC &)

IMPORT_C voidSetPropertyL(TAny *aKey,
THttpPropertyTypeaProperty,
const TDesC &aValue
)

Sets property

Since
S60 v3.2

Parameters

TAny * aKeyKey of the file property concerns
THttpPropertyType aPropertyId of the property to be changed
const TDesC & aValueValue of the property

StartTransferL(TAny *)

IMPORT_C voidStartTransferL(TAny *aKey)

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

Since
S60 v3.2

Parameters

TAny * aKeyIdentifier of the downloaded file

TrackProgress(TAny *, TBool)

IMPORT_C TIntTrackProgress(TAny *aKey,
TBoolaValue
)

Switch the tracking of the duration on/off.

Since
S60 v3.2

Parameters

TAny * aKeyKey corresponding the process
TBool aValueValue of the flag

WorkerCompleted()

voidWorkerCompleted()

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.