kget
#include <transfer.h>
|
enum | Capability {
Cap_SpeedLimit = 0x00000001,
Cap_MultipleMirrors = 0x00000002,
Cap_Resuming = 0x00000004,
Cap_Renaming = 0x00000008,
Cap_Moving = 0x00000010,
Cap_FindFilesize = 0x00000020
} |
|
typedef int | ChangesFlags |
|
enum | DeleteOption { DeleteTemporaryFiles = 0x00000001,
DeleteFiles = 0x00000002
} |
|
enum | LogLevel { Log_Info,
Log_Warning,
Log_Error
} |
|
enum | SpeedLimit { VisibleSpeedLimit = 0x01,
InvisibleSpeedLimit = 0x02
} |
|
enum | TransferChange {
Tc_None = 0x00000000,
Tc_Source = 0x00000001,
Tc_FileName = 0x00000002,
Tc_Status = 0x00000004,
Tc_TotalSize = 0x00000008,
Tc_Percent = 0x00000010,
Tc_DownloadSpeed = 0x00000020,
Tc_RemainingTime = 0x00000040,
Tc_UploadSpeed = 0x00000100,
Tc_UploadLimit = 0x00000200,
Tc_DownloadLimit = 0x00000400,
Tc_CanResume = 0x00000800,
Tc_DownloadedSize = 0x00001000,
Tc_UploadedSize = 0x00002000,
Tc_Log = 0x00004000,
Tc_Group = 0x00008000,
Tc_Selection = 0x00010000
} |
|
enum | ErrorType { AutomaticRetry,
ManualSolve,
NotSolveable
} |
|
enum | Policy { Start,
Stop,
None
} |
|
enum | Status {
Running = 0,
Stopped = 2,
Aborted = 3,
Finished = 4,
FinishedKeepAlive = 5,
Moving = 6
} |
|
|
| Transfer (TransferGroup *parent, TransferFactory *factory, Scheduler *scheduler, const KUrl &src, const KUrl &dest, const QDomElement *e=0) |
|
virtual | ~Transfer () |
|
virtual QHash< KUrl, QPair
< bool, int > > | availableMirrors (const KUrl &file) const |
|
int | averageDownloadSpeed () const |
|
Capabilities | capabilities () const |
|
void | checkShareRatio () |
|
void | create () |
|
virtual void | deinit (DeleteOptions options) |
|
const KUrl & | dest () const |
|
void | destroy (DeleteOptions options) |
|
virtual KUrl | directory () const |
|
KIO::filesize_t | downloadedSize () const |
|
int | downloadLimit (SpeedLimit limit) const |
|
int | downloadSpeed () const |
|
virtual int | elapsedTime () const |
|
TransferFactory * | factory () const |
|
virtual FileModel * | fileModel () |
|
virtual QList< KUrl > | files () const |
|
TransferGroup * | group () const |
|
TransferHandler * | handler () |
|
virtual void | init () |
|
bool | isSelected () const |
|
virtual bool | isStalled () const |
|
virtual bool | isWorking () const |
|
virtual void | load (const QDomElement *element) |
|
const QStringList | log () const |
|
double | maximumShareRatio () |
|
TransferTreeModel * | model () |
|
bool | operator< (const Transfer &t2) const |
|
int | percent () const |
|
virtual int | remainingTime () const |
|
virtual bool | repair (const KUrl &file=KUrl()) |
|
virtual void | save (const QDomElement &element) |
|
virtual void | setAvailableMirrors (const KUrl &file, const QHash< KUrl, QPair< bool, int > > &mirrors) |
|
virtual bool | setDirectory (const KUrl &newDirectory) |
|
void | setDownloadLimit (int dlLimit, SpeedLimit limit) |
|
void | setMaximumShareRatio (double ratio) |
|
void | setUploadLimit (int ulLimit, SpeedLimit limit) |
|
virtual Signature * | signature (const KUrl &file) |
|
const KUrl & | source () const |
|
QPixmap | statusPixmap () const |
|
QString | statusText () const |
|
KIO::filesize_t | totalSize () const |
|
KIO::filesize_t | uploadedSize () const |
|
int | uploadLimit (SpeedLimit limit) const |
|
int | uploadSpeed () const |
|
virtual Verifier * | verifier (const KUrl &file) |
|
| Job (Scheduler *scheduler, JobQueue *parent) |
|
virtual | ~Job () |
|
Error | error () const |
|
JobQueue * | jobQueue () |
|
Policy | policy () const |
|
virtual void | resolveError (int errorId) |
|
void | setError (const QString &text, const QPixmap &pixmap, ErrorType type=AutomaticRetry, int errorId=-1) |
|
void | setPolicy (Policy jobPolicy) |
|
void | setStatus (Status jobStatus) |
|
virtual void | start ()=0 |
|
Status | startStatus () const |
|
Status | status () const |
|
virtual void | stop ()=0 |
|
Definition at line 36 of file transfer.h.
Enumerator |
---|
Cap_SpeedLimit |
|
Cap_MultipleMirrors |
|
Cap_Resuming |
|
Cap_Renaming |
|
Cap_Moving |
|
Cap_FindFilesize |
|
Definition at line 70 of file transfer.h.
Enumerator |
---|
DeleteTemporaryFiles |
|
DeleteFiles |
|
Definition at line 94 of file transfer.h.
Enumerator |
---|
Log_Info |
|
Log_Warning |
|
Log_Error |
|
Definition at line 81 of file transfer.h.
Enumerator |
---|
VisibleSpeedLimit |
|
InvisibleSpeedLimit |
|
Definition at line 88 of file transfer.h.
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_Source |
|
Tc_FileName |
|
Tc_Status |
|
Tc_TotalSize |
|
Tc_Percent |
|
Tc_DownloadSpeed |
|
Tc_RemainingTime |
|
Tc_UploadSpeed |
|
Tc_UploadLimit |
|
Tc_DownloadLimit |
|
Tc_CanResume |
|
Tc_DownloadedSize |
|
Tc_UploadedSize |
|
Tc_Log |
|
Tc_Group |
|
Tc_Selection |
|
Definition at line 47 of file transfer.h.
QHash< KUrl, QPair< bool, int > > Transfer::availableMirrors |
( |
const KUrl & |
file | ) |
const |
|
virtual |
The mirrors that are available bool if it is used, int how many paralell connections are allowed to the mirror.
- Parameters
-
file | the file for which the availableMirrors should be get |
Reimplemented in Metalink, TransferMultiSegKio, and AbstractMetalink.
Definition at line 135 of file transfer.cpp.
int Transfer::averageDownloadSpeed |
( |
| ) |
const |
Capabilities Transfer::capabilities |
( |
| ) |
const |
|
inline |
void Transfer::capabilitiesChanged |
( |
| ) |
|
|
signal |
Emitted when the capabilities of the Transfer change.
void Transfer::checkShareRatio |
( |
| ) |
|
void Transfer::create |
( |
| ) |
|
This functions gets called whenever a Transfer gets created.
As opposed to init(), this isn't a virtual function and is not meant to be used in transfer plugins
Definition at line 76 of file transfer.cpp.
virtual void Transfer::deinit |
( |
DeleteOptions |
options | ) |
|
|
inlinevirtual |
This function is called before the deletion of a Transfer In transfer plugins you can put here whatever needs to be deinitialized.
Definition at line 138 of file transfer.h.
const KUrl& Transfer::dest |
( |
| ) |
const |
|
inline |
void Transfer::destroy |
( |
DeleteOptions |
options | ) |
|
This functions gets called whenever a Transfer is going to be deleted.
As opposed to deinit(), this isn't a virtual function and is not meant to be used in transfer plugins
Definition at line 86 of file transfer.cpp.
virtual KUrl Transfer::directory |
( |
| ) |
const |
|
inlinevirtual |
KIO::filesize_t Transfer::downloadedSize |
( |
| ) |
const |
|
inline |
int Transfer::downloadLimit |
( |
SpeedLimit |
limit | ) |
const |
- Returns
- the DownloadLimit, which is invisible in the GUI
Definition at line 176 of file transfer.cpp.
int Transfer::downloadSpeed |
( |
| ) |
const |
|
inline |
int Transfer::elapsedTime |
( |
| ) |
const |
|
virtual |
virtual QList<KUrl> Transfer::files |
( |
| ) |
const |
|
inlinevirtual |
bool Transfer::isSelected |
( |
| ) |
const |
|
inline |
virtual bool Transfer::isStalled |
( |
| ) |
const |
|
inlinevirtual |
virtual bool Transfer::isWorking |
( |
| ) |
const |
|
inlinevirtual |
void Transfer::load |
( |
const QDomElement * |
element | ) |
|
|
virtual |
Loads the transfer's info from the QDomElement.
- Parameters
-
element | The pointer to the QDomNode where info will be loaded from |
Reimplemented in BTTransfer, MetalinkXml, and Metalink.
Definition at line 244 of file transfer.cpp.
const QStringList Transfer::log |
( |
| ) |
const |
double Transfer::maximumShareRatio |
( |
| ) |
|
|
inline |
- Returns
- the maximum share-ratio
Definition at line 235 of file transfer.h.
bool Transfer::operator< |
( |
const Transfer & |
t2 | ) |
const |
Defines the order between transfers.
int Transfer::percent |
( |
| ) |
const |
|
inline |
virtual int Transfer::remainingTime |
( |
| ) |
const |
|
inlinevirtual |
virtual bool Transfer::repair |
( |
const KUrl & |
file = KUrl() | ) |
|
|
inlinevirtual |
Tries to repair file.
- Parameters
-
file | the file of a download that should be repaired, if not defined all files of a download are going to be repaird |
- Returns
- true if a repair started, false if it was not nescessary
Reimplemented in TransferKio, Metalink, TransferMultiSegKio, and AbstractMetalink.
Definition at line 146 of file transfer.h.
void Transfer::save |
( |
const QDomElement & |
element | ) |
|
|
virtual |
Saves this transfer to the given QDomNode.
- Parameters
-
element | The pointer to the QDomNode where the transfer will be saved |
Reimplemented in MetalinkXml, and Metalink.
Definition at line 230 of file transfer.cpp.
virtual void Transfer::setAvailableMirrors |
( |
const KUrl & |
file, |
|
|
const QHash< KUrl, QPair< bool, int > > & |
mirrors |
|
) |
| |
|
inlinevirtual |
Set the mirrors, int the number of paralell connections to the mirror bool if the mirror should be used.
- Parameters
-
file | the file for which the availableMirrors should be set |
Reimplemented in Metalink, TransferMultiSegKio, and AbstractMetalink.
Definition at line 200 of file transfer.h.
void Transfer::setCapabilities |
( |
Capabilities |
capabilities | ) |
|
|
protected |
Sets the capabilities and automatically emits capabilitiesChanged.
Definition at line 68 of file transfer.cpp.
bool Transfer::setDirectory |
( |
const KUrl & |
newDirectory | ) |
|
|
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 156 of file transfer.cpp.
void Transfer::setMaximumShareRatio |
( |
double |
ratio | ) |
|
Set the maximum share-ratio.
- Parameters
-
ratio | the new maximum share-ratio |
Definition at line 184 of file transfer.cpp.
virtual void Transfer::setSpeedLimits |
( |
int |
uploadLimit, |
|
|
int |
downloadLimit |
|
) |
| |
|
inlineprotectedvirtual |
Function used to set the SpeedLimits to the transfer.
Reimplemented in BTTransfer.
Definition at line 353 of file transfer.h.
void Transfer::setStatus |
( |
Job::Status |
jobStatus, |
|
|
const QString & |
text = QString() , |
|
|
const QPixmap & |
pix = QPixmap() |
|
) |
| |
|
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 292 of file transfer.cpp.
void Transfer::setTransferChange |
( |
ChangesFlags |
change, |
|
|
bool |
postEvent = false |
|
) |
| |
|
protectedvirtual |
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 338 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 144 of file transfer.cpp.
virtual Signature* Transfer::signature |
( |
const KUrl & |
file | ) |
|
|
inlinevirtual |
const KUrl& Transfer::source |
( |
| ) |
const |
|
inline |
QPixmap Transfer::statusPixmap |
( |
| ) |
const |
|
inline |
QString Transfer::statusText |
( |
| ) |
const |
|
inline |
KIO::filesize_t Transfer::totalSize |
( |
| ) |
const |
|
inline |
KIO::filesize_t Transfer::uploadedSize |
( |
| ) |
const |
|
inline |
int Transfer::uploadLimit |
( |
SpeedLimit |
limit | ) |
const |
- Returns
- the UploadLimit, which is invisible in the GUI
Definition at line 168 of file transfer.cpp.
int Transfer::uploadSpeed |
( |
| ) |
const |
|
inline |
virtual Verifier* Transfer::verifier |
( |
const KUrl & |
file | ) |
|
|
inlinevirtual |
KIO::filesize_t Transfer::m_downloadedSize |
|
protected |
int Transfer::m_downloadLimit |
|
protected |
int Transfer::m_downloadSpeed |
|
protected |
bool Transfer::m_isSelected |
|
protected |
QStringList Transfer::m_log |
|
protected |
KIO::filesize_t Transfer::m_totalSize |
|
protected |
KIO::filesize_t Transfer::m_uploadedSize |
|
protected |
int Transfer::m_uploadLimit |
|
protected |
int Transfer::m_uploadSpeed |
|
protected |
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:18 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.