CHttpTransferBase Class Reference
class CHttpTransferBase : public CActive
|
Base class of the downloader and uploader classes. Handles filequeue.
httptransfer.lib
-
Since
-
S60 v3.2
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
()
|
Constructor & Destructor Documentation
CHttpTransferBase()
CHttpTransferBase
|
(
|
)
|
[protected]
|
~CHttpTransferBase()
~CHttpTransferBase
|
(
|
)
|
[virtual]
|
Member Functions Documentation
ActivateNewTransferRequest()
void
|
ActivateNewTransferRequest
|
(
|
)
|
|
CancelAll()
IMPORT_C void
|
CancelAll
|
(
|
)
|
|
Deletes all the instances of CHttpFiles in iFileQueue. Also cancels all the on-going transfers.
CancelTransfer(TAny *)
IMPORT_C
TInt
|
CancelTransfer
|
(
|
TAny
*
|
aKey
|
)
|
|
Deletes the corresponding instance of
CHttpFile
in iFileQueue or stops the corresponding transfer.
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
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
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.
GetPropertyL(TAny *, THttpPropertyType)
InsertFileIntoWaitQueueL(TAny *, const TDesC &, const TDesC8 &)
IMPORT_C void
|
InsertFileIntoWaitQueueL
|
(
|
TAny
*
|
aKey,
|
|
const
TDesC
&
|
aTargetPath,
|
|
const
TDesC8
&
|
aUri
|
|
)
|
|
Adds file into wait queue
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
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.
Parameters
TAny
* aKey
|
Key of the file
|
NextFile()
Returns and removes the last item from iFileQueue and sets it to iProcessedFile.
ProcessNextFileL()
void
|
ProcessNextFileL
|
(
|
)
|
|
Processes the next file in the queue
RunError(TInt)
Handles leave which occurs in RunL
RunL()
Handles request completion event.
SetHeaderL(TAny *, const TDesC8 &, const TDesC8 &)
IMPORT_C void
|
SetHeaderL
|
(
|
TAny
*
|
aKey,
|
|
const
TDesC8
&
|
aFieldName,
|
|
const
TDesC8
&
|
aFieldValue
|
|
)
|
|
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 &)
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
Parameters
TAny
* aKey
|
Identifier of the downloaded file
|
TrackProgress(TAny *, TBool)
Switch the tracking of the duration on/off.
Parameters
TAny
* aKey
|
Key corresponding the process
|
TBool
aValue
|
Value of the flag
|
WorkerCompleted()
Call back for workers to inform when they are ready
Member Enumerations Documentation
Enum THttpPropertyType
This enum is used in SetProperty to recognize the action
Member Data Documentation
CHttpTransferWorker * iActiveWorker
Worker which is being processed
TUint
iBufferSize
TUint
|
iBufferSize
|
[protected]
|
buffer size, configurable
RPointerArray< CHttpFile > iFileQueue
Pointerarray which contains the files
MHttpTransferObserver * iObserver
Pointer to the transfer observer Not own.
TUint
iParallelTransfers
TUint
|
iParallelTransfers
|
[protected]
|
Number of parallel transfers
RPointerArray< CHttpFile > iWaitQueue
Queue for the waiting files
RPointerArray< CHttpTransferWorker > iWorkerArray
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.