• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

Public Types | Public Slots | Signals | Public Member Functions | List of all members
TransferHandler Class Reference

#include <transferhandler.h>

Inheritance diagram for TransferHandler:
Inheritance graph
[legend]

Public Types

typedef Transfer::ChangesFlags ChangesFlags
 

Public Slots

virtual void start ()
 
virtual void stop ()
 

Signals

void capabilitiesChanged ()
 
void transferChangedEvent (TransferHandler *transfer, TransferHandler::ChangesFlags flags)
 

Public Member Functions

 TransferHandler (Transfer *parent, Scheduler *scheduler)
 
virtual ~TransferHandler ()
 
QHash< KUrl, QPair< bool, int > > availableMirrors (const KUrl &file) const
 
int averageDownloadSped () const
 
Transfer::Capabilities capabilities () const
 
ChangesFlags changesFlags () const
 
void checkShareRatio ()
 
int columnCount () const
 
QList< QAction * > contextActions ()
 
QVariant data (int column)
 
QString dBusObjectPath ()
 
const KUrl & dest () const
 
KUrl directory () const
 
KIO::filesize_t downloadedSize () const
 
int downloadLimit (Transfer::SpeedLimit limit) const
 
int downloadSpeed () const
 
int elapsedTime () const
 
Job::Error error () const
 
QList< QAction * > factoryActions ()
 
virtual FileModel * fileModel ()
 
QList< KUrl > files () const
 
TransferGroupHandler * group () const
 
bool isSelected () const
 
KGetKJobAdapter * kJobAdapter ()
 
double maximumShareRatio ()
 
int percent () const
 
int remainingTime () const
 
bool repair (const KUrl &file=KUrl())
 
void resolveError (int errorId)
 
void setAvailableMirrors (const KUrl &file, const QHash< KUrl, QPair< bool, int > > &mirrors)
 
bool setDirectory (const KUrl &newDirectory)
 
void setDownloadLimit (int dlLimit, Transfer::SpeedLimit limit)
 
void setMaximumShareRatio (double ratio)
 
void setSelected (bool select)
 
void setUploadLimit (int ulLimit, Transfer::SpeedLimit limit)
 
virtual Signature * signature (const KUrl &file)
 
const KUrl & source () const
 
Job::Status startStatus () const
 
Job::Status status () const
 
QPixmap statusPixmap () const
 
QString statusText () const
 
KIO::filesize_t totalSize () const
 
KIO::filesize_t uploadedSize () const
 
int uploadLimit (Transfer::SpeedLimit limit) const
 
int uploadSpeed () const
 
virtual Verifier * verifier (const KUrl &file)
 
- Public Member Functions inherited from Handler
 Handler (Scheduler *scheduler, QObject *parent)
 
virtual ~Handler ()
 
virtual void start ()=0
 
virtual void stop ()=0
 

Additional Inherited Members

- Protected Attributes inherited from Handler
Scheduler * m_scheduler
 

Detailed Description

Class TransferHandler:

— Overview — This class is the representation of a Transfer object from the views' perspective (proxy pattern). In fact the views never handle directly the Transfer objects themselves (because this would break the model/view policy). As a general rule, all the code strictly related to the views should placed here (and not in the transfer implementation). Here we provide the same api available in the transfer class, but we change the implementation of some methods. Let's give an example about this: The start() function of a specific Transfer (let's say TransferKio) is a low level command that really makes the transfer start and should therefore be executed only by the scheduler. The start() function in this class is implemented in another way, since it requests the scheduler to execute the start command to this specific transfer. At this point the scheduler will evaluate this request and execute, if possible, the start() function directly in the TransferKio.

Definition at line 48 of file transferhandler.h.

Member Typedef Documentation

typedef Transfer::ChangesFlags TransferHandler::ChangesFlags

Definition at line 58 of file transferhandler.h.

Constructor & Destructor Documentation

TransferHandler::TransferHandler ( Transfer *  parent,
Scheduler *  scheduler 
)

Definition at line 29 of file transferhandler.cpp.

TransferHandler::~TransferHandler ( )
virtual

Definition at line 42 of file transferhandler.cpp.

Member Function Documentation

QHash<KUrl, QPair<bool, int> > TransferHandler::availableMirrors ( const KUrl &  file) const
inline

The mirrors that are available bool if it is used, int how many paralell connections are allowed to the mirror.

Parameters
filethe file for which the availableMirrors should be get

Definition at line 123 of file transferhandler.h.

int TransferHandler::averageDownloadSped ( ) const
Returns
the average download speed of the transfer in bytes/sec

Definition at line 111 of file transferhandler.cpp.

Transfer::Capabilities TransferHandler::capabilities ( ) const

Returns the capabilities the Transfer supports.

Definition at line 46 of file transferhandler.cpp.

void TransferHandler::capabilitiesChanged ( )
signal

Emitted when the capabilities of the Transfer change.

Transfer::ChangesFlags TransferHandler::changesFlags ( ) const

Returns the changes flags.

Definition at line 175 of file transferhandler.cpp.

void TransferHandler::checkShareRatio ( )
inline

Recalculate the share ratio.

Definition at line 205 of file transferhandler.h.

int TransferHandler::columnCount ( ) const
inline
Returns
the number of columns associated to the transfer's data

Definition at line 226 of file transferhandler.h.

QList< QAction * > TransferHandler::contextActions ( )
Returns
a list of a actions, which are associated with this TransferHandler

Definition at line 205 of file transferhandler.cpp.

QVariant TransferHandler::data ( int  column)
virtual
Returns
the data associated to this Transfer item. This is necessary to make the interview model/view work

Implements Handler.

Definition at line 121 of file transferhandler.cpp.

QString TransferHandler::dBusObjectPath ( )
inline
Returns
the object path that will be shown in the DBUS interface

Definition at line 262 of file transferhandler.h.

const KUrl& TransferHandler::dest ( ) const
inline
Returns
the dest url

Definition at line 98 of file transferhandler.h.

KUrl TransferHandler::directory ( ) const
inline
Returns
the directory the Transfer will be stored to

Definition at line 108 of file transferhandler.h.

KIO::filesize_t TransferHandler::downloadedSize ( ) const
Returns
the downloaded size of the transfer in bytes

Definition at line 91 of file transferhandler.cpp.

int TransferHandler::downloadLimit ( Transfer::SpeedLimit  limit) const
inline
Returns
the download Limit of the transfer in KiB

Definition at line 189 of file transferhandler.h.

int TransferHandler::downloadSpeed ( ) const
Returns
the download speed of the transfer in bytes/sec

Definition at line 106 of file transferhandler.cpp.

int TransferHandler::elapsedTime ( ) const

Definition at line 76 of file transferhandler.cpp.

Job::Error TransferHandler::error ( ) const
inline

Definition at line 65 of file transferhandler.h.

QList< QAction * > TransferHandler::factoryActions ( )
Returns
a list of the transfer's factory's actions

Definition at line 220 of file transferhandler.cpp.

virtual FileModel* TransferHandler::fileModel ( )
inlinevirtual
Returns
a pointer to the FileModel containing all files of this download

Definition at line 272 of file transferhandler.h.

QList<KUrl> TransferHandler::files ( ) const
inline
Returns
all files of this transfer

Definition at line 103 of file transferhandler.h.

TransferGroupHandler* TransferHandler::group ( ) const
inline
Returns
the transfer's group handler

Definition at line 88 of file transferhandler.h.

bool TransferHandler::isSelected ( ) const
Returns
true if the current transfer is selected
false otherwise

Definition at line 170 of file transferhandler.cpp.

KGetKJobAdapter* TransferHandler::kJobAdapter ( )
inline
Returns
the kJobAdapter object

Definition at line 267 of file transferhandler.h.

double TransferHandler::maximumShareRatio ( )
inline
Returns
the maximum share-ratio

Definition at line 200 of file transferhandler.h.

int TransferHandler::percent ( ) const
Returns
the progress percentage of the transfer

Definition at line 101 of file transferhandler.cpp.

int TransferHandler::remainingTime ( ) const

Definition at line 81 of file transferhandler.cpp.

bool TransferHandler::repair ( const KUrl &  file = KUrl())
inline

Tries to repair file.

Parameters
filethe 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

Definition at line 83 of file transferhandler.h.

void TransferHandler::resolveError ( int  errorId)
inline

Definition at line 70 of file transferhandler.h.

void TransferHandler::setAvailableMirrors ( const KUrl &  file,
const QHash< KUrl, QPair< bool, int > > &  mirrors 
)
inline

Set the mirrors, int the number of paralell connections to the mirror bool if the mirror should be used.

Parameters
filethe file for which the availableMirrors should be set

Definition at line 130 of file transferhandler.h.

bool TransferHandler::setDirectory ( const KUrl &  newDirectory)
inline

Move the download to the new destination.

Parameters
newDirectoryis a directory where the download should be stored
Returns
true if newDestination can be used

Definition at line 115 of file transferhandler.h.

void TransferHandler::setDownloadLimit ( int  dlLimit,
Transfer::SpeedLimit  limit 
)
inline

Set a DownloadLimit for the transfer.

Note
this DownloadLimit is not visible in the GUI
Parameters
dlLimitdownload Limit

Definition at line 179 of file transferhandler.h.

void TransferHandler::setMaximumShareRatio ( double  ratio)
inline

Set the maximum share-ratio.

Parameters
ratiothe new maximum share-ratio

Definition at line 195 of file transferhandler.h.

void TransferHandler::setSelected ( bool  select)

Selects the current transfer.

Selecting transfers means that all the actions executed from the gui will apply also to the current transfer.

Parameters
selectif true the current transfer is selected if false the current transfer is deselected

Definition at line 161 of file transferhandler.cpp.

void TransferHandler::setUploadLimit ( int  ulLimit,
Transfer::SpeedLimit  limit 
)
inline

Set an UploadLimit for the transfer.

Note
this UploadLimit is not visible in the GUI
Parameters
ulLimitupload Limit

Definition at line 172 of file transferhandler.h.

virtual Signature* TransferHandler::signature ( const KUrl &  file)
inlinevirtual
Parameters
filefor which to get the signature
Returns
Signature that allows you to add signatures and verify them

Definition at line 284 of file transferhandler.h.

const KUrl& TransferHandler::source ( ) const
inline
Returns
the source url

Definition at line 93 of file transferhandler.h.

void TransferHandler::start ( )
virtualslot

These are all Job-related functions.

Definition at line 51 of file transferhandler.cpp.

Job::Status TransferHandler::startStatus ( ) const
inline

Definition at line 66 of file transferhandler.h.

Job::Status TransferHandler::status ( ) const
inline

Definition at line 64 of file transferhandler.h.

QPixmap TransferHandler::statusPixmap ( ) const
inline
Returns
a pixmap associated with the current transfer status

Definition at line 215 of file transferhandler.h.

QString TransferHandler::statusText ( ) const
inline
Returns
a string describing the current transfer status

Definition at line 210 of file transferhandler.h.

void TransferHandler::stop ( )
virtualslot

Definition at line 64 of file transferhandler.cpp.

KIO::filesize_t TransferHandler::totalSize ( ) const
Returns
the total size of the transfer in bytes

Definition at line 86 of file transferhandler.cpp.

void TransferHandler::transferChangedEvent ( TransferHandler *  transfer,
TransferHandler::ChangesFlags  flags 
)
signal
KIO::filesize_t TransferHandler::uploadedSize ( ) const
Returns
the uploaded size of the transfer in bytes

Definition at line 96 of file transferhandler.cpp.

int TransferHandler::uploadLimit ( Transfer::SpeedLimit  limit) const
inline
Returns
the upload Limit of the transfer in KiB

Definition at line 184 of file transferhandler.h.

int TransferHandler::uploadSpeed ( ) const
Returns
the upload speed of the transfer in bytes/sec

Definition at line 116 of file transferhandler.cpp.

virtual Verifier* TransferHandler::verifier ( const KUrl &  file)
inlinevirtual
Parameters
filefor which to get the verifier
Returns
Verifier that allows you to add checksums manually verify a file etc.

Definition at line 278 of file transferhandler.h.


The documentation for this class was generated from the following files:
  • transferhandler.h
  • transferhandler.cpp
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.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal