• Skip to content
  • Skip to link menu
KDE 4.0 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 31 of file transfer.h.


Public Types

enum  TransferChange {
  Tc_None = 0x00000000, Tc_Status = 0x00000001, Tc_CanResume = 0x00000002, Tc_TotalSize = 0x00000004,
  Tc_ProcessedSize = 0x00000008, Tc_Percent = 0x00000010, Tc_Speed = 0x00000020, Tc_Log = 0x00000040,
  Tc_Group = 0x00000080, Tc_Selection = 0x00000100
}
enum  LogLevel { info, warning, error }
typedef int ChangesFlags

Public Member Functions

 Transfer (TransferGroup *parent, TransferFactory *factory, Scheduler *scheduler, const KUrl &src, const KUrl &dest, const QDomElement *e=0)
virtual ~Transfer ()
const KUrl & source () const
const KUrl & dest () const
KIO::filesize_t totalSize () const
KIO::filesize_t processedSize () const
QString statusText () const
QPixmap statusPixmap () const
int percent () const
int speed () const
virtual void setDelay (int seconds)
virtual void delayTimerEvent ()
bool isSelected () const
const QStringList log () const
void setLog (const QString &message, LogLevel level=info)
bool operator< (const Transfer &t2) const
TransferGroup * group () const
TransferHandler * handler ()
TransferTreeModel * model ()
TransferFactory * factory () const
virtual void save (const QDomElement &element)

Protected Member Functions

virtual void load (const QDomElement &e)
void setStatus (Job::Status jobStatus, const QString &text, const QPixmap &pix)
virtual void setTransferChange (ChangesFlags change, bool postEvent=false)

Protected Attributes

KUrl m_source
KUrl m_dest
QStringList m_log
KIO::filesize_t m_totalSize
KIO::filesize_t m_processedSize
int m_percent
int m_speed
bool m_isSelected

Friends

class TransferHandler
class TransferTreeModel

Member Typedef Documentation

typedef int Transfer::ChangesFlags

Definition at line 62 of file transfer.h.


Member Enumeration Documentation

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_Status 
Tc_CanResume 
Tc_TotalSize 
Tc_ProcessedSize 
Tc_Percent 
Tc_Speed 
Tc_Log 
Tc_Group 
Tc_Selection 

Definition at line 42 of file transfer.h.

enum Transfer::LogLevel

Enumerator:
info 
warning 
error 

Definition at line 56 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 24 of file transfer.cpp.

Transfer::~Transfer (  )  [virtual]

Definition at line 42 of file transfer.cpp.


Member Function Documentation

const KUrl& Transfer::source (  )  const [inline]

Definition at line 70 of file transfer.h.

const KUrl& Transfer::dest (  )  const [inline]

Definition at line 71 of file transfer.h.

KIO::filesize_t Transfer::totalSize (  )  const [inline]

Reimplemented in BTTransfer.

Definition at line 74 of file transfer.h.

KIO::filesize_t Transfer::processedSize (  )  const [inline]

Reimplemented in BTTransfer.

Definition at line 75 of file transfer.h.

QString Transfer::statusText (  )  const [inline]

Definition at line 76 of file transfer.h.

QPixmap Transfer::statusPixmap (  )  const [inline]

Definition at line 77 of file transfer.h.

int Transfer::percent (  )  const [inline]

Reimplemented in BTTransfer.

Definition at line 79 of file transfer.h.

int Transfer::speed (  )  const [inline]

Definition at line 80 of file transfer.h.

void Transfer::setDelay ( int  seconds  )  [virtual]

Implements Job.

Definition at line 50 of file transfer.cpp.

void Transfer::delayTimerEvent (  )  [virtual]

Implements Job.

Definition at line 59 of file transfer.cpp.

bool Transfer::isSelected (  )  const [inline]

Definition at line 87 of file transfer.h.

const QStringList Transfer::log (  )  const

Transfer history.

void Transfer::setLog ( const QString &  message,
LogLevel  level = info 
)

Set Transfer history.

Definition at line 66 of file transfer.cpp.

bool Transfer::operator< ( const Transfer &  t2  )  const

Defines the order between transfers.

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

The owner group.

Definition at line 107 of file transfer.h.

TransferHandler * Transfer::handler (  ) 

Returns:
the associated TransferHandler

Definition at line 82 of file transfer.cpp.

TransferTreeModel * Transfer::model (  ) 

Returns:
the TransferTreeModel that owns this group

Definition at line 90 of file transfer.cpp.

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

Returns:
a pointer to the TransferFactory object

Definition at line 122 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 BTTransfer, TransferKio, metalink, and transferMultiSegKio.

Definition at line 95 of file transfer.cpp.

void Transfer::load ( const QDomElement &  e  )  [protected, virtual]

Reimplemented in BTTransfer, TransferKio, metalink, and transferMultiSegKio.

Definition at line 104 of file transfer.cpp.

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 127 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 150 of file transfer.cpp.


Friends And Related Function Documentation

friend class TransferHandler [friend]

Definition at line 33 of file transfer.h.

friend class TransferTreeModel [friend]

Definition at line 34 of file transfer.h.


Member Data Documentation

KUrl Transfer::m_source [protected]

Definition at line 151 of file transfer.h.

KUrl Transfer::m_dest [protected]

Definition at line 152 of file transfer.h.

QStringList Transfer::m_log [protected]

Definition at line 154 of file transfer.h.

KIO::filesize_t Transfer::m_totalSize [protected]

Definition at line 155 of file transfer.h.

KIO::filesize_t Transfer::m_processedSize [protected]

Definition at line 156 of file transfer.h.

int Transfer::m_percent [protected]

Definition at line 157 of file transfer.h.

int Transfer::m_speed [protected]

Definition at line 158 of file transfer.h.

bool Transfer::m_isSelected [protected]

Definition at line 160 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

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