FileTransferList Class Reference

Maintains a global file transfer processing list. More...

#include <filetransferlist.h>

List of all members.

Signals

void onUpdateStatus (QString id)
 This signal is sent when there is updates in file processing.
void onAddTransfer (QString id)
 This signal is sent when a file transfer is added to the list.
void onRemoveTransfer (QString id)
 This signal is sent when a file transfer is removed from the list.

Public Member Functions

void processTransfers ()
 Drives the file transfer processing.
void setProcessingThread (FileTransferProcessingThread *processingThread)
 Sets the file processing thread used.
void addTransfer (FileTransfer *fileTransfer)
 Adds a FileTransfer object to the list.
void removeTransfer (FileTransfer *fileTransfer)
 Remove a FileTransfer object from the list.
FileTransfergetTransfer (int i)
 Return a FileTransfer object from the list.
int getTransferCount ()
 Returns the size of the transfer list.
FileTransfergetTransfer (QString id)
 Return a transfer object with a given id.
void cancelAllTransfers ()
 Cancels all idle transfers.
void updateStatus (QString id, unsigned long transferred, unsigned long totalSize)
 Updates the file transfer statistics of a FileTransfer object.
void pauseProcessing ()
 Pauses all file transfer processing.
void resumeProcessing ()
 Resumes file transfer processing.

Static Public Member Functions

static FileTransferListinstance ()
 Returns the global FileTransferList instance.
static void drop ()
 Shuts down the global FileTransferList instance.

Detailed Description

Maintains a global file transfer processing list.


Member Function Documentation

void FileTransferList::cancelAllTransfers (  ) 

Cancels all idle transfers.

Due to limitiations in the current ARC API active transfers cannot be cancelled. Idle transfers are removed and destroyed from the list.

FileTransfer * FileTransferList::getTransfer ( QString  id  ) 

Return a transfer object with a given id.

Parameters:
id string representing the FileTransfer object.
Returns:
a valid FilaTransfer object if the id of the FileTransfer object is found, otherwise return a null object.
FileTransfer * FileTransferList::getTransfer ( int  i  ) 

Return a FileTransfer object from the list.

Parameters:
i is the position in the list.
Returns:
a valid FileTransfer object. If i is outside the list a null pointer is returned.
void FileTransferList::pauseProcessing (  ) 

Pauses all file transfer processing.

This method pauses transfer processing by pausing the FileTransferProcessingThread thread. Active file processing tasks can't be paused.

void FileTransferList::processTransfers (  ) 

Drives the file transfer processing.

This method checks for idle file transfer objects. If there are slots available, idle tasks are executed. The method is called by the FileTransferProcessingThread.

void FileTransferList::resumeProcessing (  ) 

Resumes file transfer processing.

Resumes file transfer processing by resuming the FileTransferProcessingThread thread.

void FileTransferList::updateStatus ( QString  id,
unsigned long  transferred,
unsigned long  totalSize 
)

Updates the file transfer statistics of a FileTransfer object.

This method is called from the ARC progress callbacks for updating file transfer status. The method is public to be able to be accessed from a static callback and should not be called directly.

Parameters:
id of FileTransfer object.
transferred currently transferred bytes.
totalSize total size of transfer.

The documentation for this class was generated from the following files:
 All Classes Functions Variables

Generated on 19 Feb 2013 for ARC Graphical Clients by  doxygen 1.6.1