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

kget

Transfer Class Reference

#include <transfer.h>

Inheritance diagram for Transfer:

Inheritance graph
[legend]

List of all members.


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

Enumerator:
info 
warning 
error 

Definition at line 65 of file transfer.h.

enum Transfer::SpeedLimit

Enumerator:
VisibleSpeedLimit 
InvisibleSpeedLimit 

Definition at line 72 of file transfer.h.

enum Transfer::TransferChange

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 (  ) 

Recalculate the share ratio.

Definition at line 115 of file transfer.cpp.

void Transfer::delayTimerEvent (  )  [virtual]

Implements Job.

Definition at line 135 of file transfer.cpp.

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]

Implements Job.

Reimplemented in BTTransfer.

Definition at line 61 of file transfer.cpp.

TransferFactory* Transfer::factory (  )  const [inline]

Returns:
a pointer to the TransferFactory object

Definition at line 183 of file transfer.h.

TransferGroup* Transfer::group (  )  const [inline]

The owner group.

Definition at line 168 of file transfer.h.

TransferHandler * Transfer::handler (  ) 

Returns:
the associated TransferHandler

Definition at line 158 of file transfer.cpp.

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]

Returns:
the maximum share-ratio

Definition at line 136 of file transfer.h.

TransferTreeModel * Transfer::model (  ) 

Returns:
the TransferTreeModel that owns this group

Definition at line 166 of file transfer.cpp.

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]

Implements Job.

Reimplemented in BTTransfer.

Definition at line 98 of file transfer.h.

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]

Implements Job.

Definition at line 126 of file transfer.cpp.

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::setLog ( const QString &  message,
LogLevel  level = info 
)

Set Transfer history.

Definition at line 142 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]

Reimplemented in BTTransfer.

Definition at line 101 of file transfer.h.

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

Returns:
the UploadLimit, which is invisible in the GUI

Definition at line 93 of file transfer.cpp.

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:
  • transfer.h
  • transfer.cpp

kget

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

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal