kget
Transfer Class Reference
#include <transfer.h>

Detailed Description
Definition at line 33 of file transfer.h.
Public Types | |
| typedef int | ChangesFlags |
| enum | LogLevel { info, warning, error } |
| enum | SpeedLimit { VisibleSpeedLimit = 0x01, InvisibleSpeedLimit = 0x02 } |
| enum | TransferChange { Tc_None = 0x00000000, Tc_FileName = 0x00000001, Tc_Status = 0x00000002, Tc_TotalSize = 0x00000004, Tc_Percent = 0x00000008, Tc_DownloadSpeed = 0x00000010, Tc_UploadSpeed = 0x00000016, Tc_UploadLimit = 0x00000100, Tc_DownloadLimit = 0x00000200, Tc_CanResume = 0x00000400, Tc_DownloadedSize = 0x00000800, Tc_UploadedSize = 0x00001000, Tc_Log = 0x00002000, Tc_Group = 0x00004000, Tc_Selection = 0x00006000 } |
Public Member Functions | |
| void | checkShareRatio () |
| virtual void | delayTimerEvent () |
| const KUrl & | dest () const |
| KIO::filesize_t | downloadedSize () const |
| int | downloadLimit (SpeedLimit limit) const |
| int | downloadSpeed () const |
| virtual int | elapsedTime () const |
| TransferFactory * | factory () const |
| TransferGroup * | group () const |
| TransferHandler * | handler () |
| bool | isSelected () const |
| const QStringList | log () const |
| double | maximumShareRatio () |
| TransferTreeModel * | model () |
| bool | operator< (const Transfer &t2) const |
| int | percent () const |
| virtual int | remainingTime () const |
| virtual void | save (const QDomElement &element) |
| virtual void | setDelay (int seconds) |
| void | setDownloadLimit (int dlLimit, SpeedLimit limit) |
| void | setLog (const QString &message, LogLevel level=info) |
| void | setMaximumShareRatio (double ratio) |
| void | setUploadLimit (int ulLimit, SpeedLimit limit) |
| const KUrl & | source () const |
| QPixmap | statusPixmap () const |
| QString | statusText () const |
| virtual bool | supportsSpeedLimits () const |
| KIO::filesize_t | totalSize () const |
| Transfer (TransferGroup *parent, TransferFactory *factory, Scheduler *scheduler, const KUrl &src, const KUrl &dest, const QDomElement *e=0) | |
| KIO::filesize_t | uploadedSize () const |
| int | uploadLimit (SpeedLimit limit) const |
| int | uploadSpeed () const |
| virtual | ~Transfer () |
Protected Member Functions | |
| virtual void | load (const QDomElement &e) |
| virtual void | setSpeedLimits (int uploadLimit, int downloadLimit) |
| void | setStatus (Job::Status jobStatus, const QString &text, const QPixmap &pix) |
| virtual void | setTransferChange (ChangesFlags change, bool postEvent=false) |
Protected Attributes | |
| KUrl | m_dest |
| KIO::filesize_t | m_downloadedSize |
| int | m_downloadLimit |
| int | m_downloadSpeed |
| bool | m_isSelected |
| QStringList | m_log |
| int | m_percent |
| KUrl | m_source |
| KIO::filesize_t | m_totalSize |
| KIO::filesize_t | m_uploadedSize |
| int | m_uploadLimit |
| int | m_uploadSpeed |
Member Typedef Documentation
| typedef int Transfer::ChangesFlags |
Definition at line 77 of file transfer.h.
Member Enumeration Documentation
| enum Transfer::LogLevel |
| enum Transfer::SpeedLimit |
Here we define the flags that should be shared by all the transfers.
A transfer should also be able to define additional flags, in the future.
- Enumerator:
-
Tc_None Tc_FileName Tc_Status Tc_TotalSize Tc_Percent Tc_DownloadSpeed Tc_UploadSpeed Tc_UploadLimit Tc_DownloadLimit Tc_CanResume Tc_DownloadedSize Tc_UploadedSize Tc_Log Tc_Group Tc_Selection
Definition at line 44 of file transfer.h.
Constructor & Destructor Documentation
| Transfer::Transfer | ( | TransferGroup * | parent, | |
| TransferFactory * | factory, | |||
| Scheduler * | scheduler, | |||
| const KUrl & | src, | |||
| const KUrl & | dest, | |||
| const QDomElement * | e = 0 | |||
| ) |
Definition at line 30 of file transfer.cpp.
| Transfer::~Transfer | ( | ) | [virtual] |
Definition at line 53 of file transfer.cpp.
Member Function Documentation
| void Transfer::checkShareRatio | ( | ) |
| void Transfer::delayTimerEvent | ( | ) | [virtual] |
| const KUrl& Transfer::dest | ( | ) | const [inline] |
Definition at line 86 of file transfer.h.
| KIO::filesize_t Transfer::downloadedSize | ( | ) | const [inline] |
Definition at line 90 of file transfer.h.
| int Transfer::downloadLimit | ( | SpeedLimit | limit | ) | const |
- Returns:
- the DownloadLimit, which is invisible in the GUI
Definition at line 101 of file transfer.cpp.
| int Transfer::downloadSpeed | ( | ) | const [inline] |
Definition at line 96 of file transfer.h.
| int Transfer::elapsedTime | ( | ) | const [virtual] |
| TransferFactory* Transfer::factory | ( | ) | const [inline] |
| TransferGroup* Transfer::group | ( | ) | const [inline] |
| TransferHandler * Transfer::handler | ( | ) |
| bool Transfer::isSelected | ( | ) | const [inline] |
Definition at line 148 of file transfer.h.
| void Transfer::load | ( | const QDomElement & | e | ) | [protected, virtual] |
Reimplemented in ContentFetch, TransferKio, metalink, and transferMultiSegKio.
Definition at line 185 of file transfer.cpp.
| const QStringList Transfer::log | ( | ) | const |
Transfer history.
| double Transfer::maximumShareRatio | ( | ) | [inline] |
| TransferTreeModel * Transfer::model | ( | ) |
| bool Transfer::operator< | ( | const Transfer & | t2 | ) | const |
Defines the order between transfers.
| int Transfer::percent | ( | ) | const [inline] |
Definition at line 95 of file transfer.h.
| virtual int Transfer::remainingTime | ( | ) | const [inline, virtual] |
| void Transfer::save | ( | const QDomElement & | element | ) | [virtual] |
Saves this transfer to the given QDomNode.
- Parameters:
-
n The pointer to the QDomNode where the transfer will be saved
- Returns:
- The created QDomElement
Reimplemented in ContentFetch, TransferKio, metalink, and transferMultiSegKio.
Definition at line 171 of file transfer.cpp.
| void Transfer::setDelay | ( | int | seconds | ) | [virtual] |
| void Transfer::setDownloadLimit | ( | int | dlLimit, | |
| SpeedLimit | limit | |||
| ) |
Set the Transfer's UploadLimit, which are displayed in the GUI.
- Note:
- this is not displayed in any GUI, use setVisibleDownloadLimit(int) instead
- Parameters:
-
visibleUlLimit upload Limit
Definition at line 81 of file transfer.cpp.
| void Transfer::setMaximumShareRatio | ( | double | ratio | ) |
Set the maximum share-ratio.
- Parameters:
-
ratio the new maximum share-ratio
Definition at line 109 of file transfer.cpp.
| virtual void Transfer::setSpeedLimits | ( | int | uploadLimit, | |
| int | downloadLimit | |||
| ) | [inline, protected, virtual] |
Function used to set the SpeedLimits to the transfer.
Reimplemented in BTTransfer.
Definition at line 227 of file transfer.h.
| void Transfer::setStatus | ( | Job::Status | jobStatus, | |
| const QString & | text, | |||
| const QPixmap & | pix | |||
| ) | [protected] |
Sets the Job status to jobStatus, the status text to text and the status pixmap to pix.
It's important to call job::setStatus AFTER having changed the icon or the text or whatever. This because this function also notifies about this change the scheduler which could also decide to change it another time as well. For example if a job status is set to Aborted, the scheduler could mark it to Delayed. This could trigger another icon or text change which would be the right one since the status of the Job has changed. If we set the icon or text after calling setStatus(), we can overwrite the last icon or text change.
Definition at line 229 of file transfer.cpp.
| void Transfer::setTransferChange | ( | ChangesFlags | change, | |
| bool | postEvent = false | |||
| ) | [protected, virtual] |
Makes the TransferHandler associated with this transfer know that a change in this transfer has occurred.
- Parameters:
-
change,: the TransferChange flags to be set
Definition at line 264 of file transfer.cpp.
| void Transfer::setUploadLimit | ( | int | ulLimit, | |
| SpeedLimit | limit | |||
| ) |
Set the Transfer's UploadLimit.
- Note:
- this is not displayed in any GUI, use setVisibleUploadLimit(int) instead
- Parameters:
-
visibleUlLimit upload Limit
Definition at line 69 of file transfer.cpp.
| const KUrl& Transfer::source | ( | ) | const [inline] |
Definition at line 85 of file transfer.h.
| QPixmap Transfer::statusPixmap | ( | ) | const [inline] |
Definition at line 93 of file transfer.h.
| QString Transfer::statusText | ( | ) | const [inline] |
Definition at line 92 of file transfer.h.
| virtual bool Transfer::supportsSpeedLimits | ( | ) | const [inline, virtual] |
| KIO::filesize_t Transfer::totalSize | ( | ) | const [inline] |
Definition at line 89 of file transfer.h.
| KIO::filesize_t Transfer::uploadedSize | ( | ) | const [inline] |
Definition at line 91 of file transfer.h.
| int Transfer::uploadLimit | ( | SpeedLimit | limit | ) | const |
| int Transfer::uploadSpeed | ( | ) | const [inline] |
Definition at line 97 of file transfer.h.
Member Data Documentation
KUrl Transfer::m_dest [protected] |
Definition at line 231 of file transfer.h.
KIO::filesize_t Transfer::m_downloadedSize [protected] |
Definition at line 235 of file transfer.h.
int Transfer::m_downloadLimit [protected] |
Definition at line 242 of file transfer.h.
int Transfer::m_downloadSpeed [protected] |
Definition at line 238 of file transfer.h.
bool Transfer::m_isSelected [protected] |
Definition at line 244 of file transfer.h.
QStringList Transfer::m_log [protected] |
Definition at line 233 of file transfer.h.
int Transfer::m_percent [protected] |
Definition at line 237 of file transfer.h.
KUrl Transfer::m_source [protected] |
Definition at line 230 of file transfer.h.
KIO::filesize_t Transfer::m_totalSize [protected] |
Definition at line 234 of file transfer.h.
KIO::filesize_t Transfer::m_uploadedSize [protected] |
Definition at line 236 of file transfer.h.
int Transfer::m_uploadLimit [protected] |
Definition at line 241 of file transfer.h.
int Transfer::m_uploadSpeed [protected] |
Definition at line 239 of file transfer.h.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference