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

kget

TransferGroup Class Reference

#include <transfergroup.h>

Inheritance diagram for TransferGroup:

Inheritance graph
[legend]

List of all members.


Detailed Description

class TransferGroup:

This class abstracts the concept of transfer group by means of which the user can sort his transfers into categories. By definition, we want each TransferGroup (transfer group) to be a JobQueue. Moreover this class calculates information such as:

  • the size obtained by the sum of all the transfer's size
  • the size obtained by the sum of all the transfer's processed size
  • the global progress percentage within the group
  • the global speed within the group

Definition at line 38 of file transfergroup.h.


Public Types

enum  GroupChange {
  Gc_None = 0x00000000, Gc_Status = 0x00000001, Gc_TotalSize = 0x00000002, Gc_ProcessedSize = 0x00000004,
  Gc_Percent = 0x00000008, Gc_Speed = 0x00000010
}
typedef int ChangesFlags

Public Member Functions

 TransferGroup (TransferTreeModel *model, Scheduler *scheduler, const QString &name=QString())
virtual ~TransferGroup ()
void setStatus (Status queueStatus)
void append (Transfer *transfer)
void prepend (Transfer *transfer)
void insert (Transfer *transfer, Transfer *after)
void remove (Transfer *transfer)
void move (Transfer *transfer, Transfer *after)
Transfer * findTransfer (const KUrl &src)
Transfer * findTransferByDestination (const KUrl &dest)
Transfer * operator[] (int i) const
void setName (const QString &name)
const QString & name ()
int totalSize () const
int processedSize () const
int percent () const
int speed () const
TransferGroupHandler * handler ()
TransferTreeModel * model ()
void transferChangedEvent (Transfer *transfer)
void save (QDomElement e)
void load (const QDomElement &e)

Member Typedef Documentation

typedef int TransferGroup::ChangesFlags

Definition at line 51 of file transfergroup.h.


Member Enumeration Documentation

enum TransferGroup::GroupChange

Enumerator:
Gc_None 
Gc_Status 
Gc_TotalSize 
Gc_ProcessedSize 
Gc_Percent 
Gc_Speed 

Definition at line 41 of file transfergroup.h.


Constructor & Destructor Documentation

TransferGroup::TransferGroup ( TransferTreeModel *  model,
Scheduler *  scheduler,
const QString &  name = QString() 
)

Definition at line 22 of file transfergroup.cpp.

TransferGroup::~TransferGroup (  )  [virtual]

Definition at line 31 of file transfergroup.cpp.


Member Function Documentation

void TransferGroup::setStatus ( Status  queueStatus  )  [virtual]

This function is reimplemented by JobQueue::setStatus.

Parameters:
queueStatus the new JobQueue status

Reimplemented from JobQueue.

Definition at line 36 of file transfergroup.cpp.

void TransferGroup::append ( Transfer *  transfer  ) 

Appends a new transfer to the list of the transfers.

Parameters:
transfer the transfer to append

Definition at line 43 of file transfergroup.cpp.

void TransferGroup::prepend ( Transfer *  transfer  ) 

Prepends a new transfer to the list of the transfers.

Parameters:
transfer the transfer to prepend

Definition at line 58 of file transfergroup.cpp.

void TransferGroup::insert ( Transfer *  transfer,
Transfer *  after 
)

inserts a transfer to the current group after the given transfer

Parameters:
transfer The transfer to add in the current Group
after The transfer after which to add the transfer

Definition at line 65 of file transfergroup.cpp.

void TransferGroup::remove ( Transfer *  transfer  ) 

Removes the given transfer from the list of the transfers.

Parameters:
transfer the transfer to remove

Definition at line 72 of file transfergroup.cpp.

void TransferGroup::move ( Transfer *  transfer,
Transfer *  after 
)

Moves a transfer in the list.

Parameters:
transfer The transfer to move. Note that this transfer can belong to other groups. In this situation this transfer is deleted from the previous group and moved inside this one.
after The transfer after which we have to move the given one

Definition at line 79 of file transfergroup.cpp.

Transfer * TransferGroup::findTransfer ( const KUrl &  src  ) 

Finds the first transfer with source src.

Parameters:
src the url of the source location
Returns:
the transfer pointer if the transfer has been found. Otherwise it returns 0

Definition at line 97 of file transfergroup.cpp.

Transfer * TransferGroup::findTransferByDestination ( const KUrl &  dest  ) 

Definition at line 111 of file transfergroup.cpp.

Transfer * TransferGroup::operator[] ( int  i  )  const

Returns:
the Job in the queue at the given index i

Reimplemented from JobQueue.

Definition at line 125 of file transfergroup.cpp.

void TransferGroup::setName ( const QString &  name  )  [inline]

Set the group name.

Parameters:
name group name

Definition at line 131 of file transfergroup.h.

const QString& TransferGroup::name (  )  [inline]

Returns:
the group name

Definition at line 136 of file transfergroup.h.

int TransferGroup::totalSize (  )  const [inline]

Returns:
the sum of the sizes of the transfers belonging to this group

Definition at line 142 of file transfergroup.h.

int TransferGroup::processedSize (  )  const [inline]

Returns:
the sum of the processed sizes of the transfers belonging to this group

Definition at line 148 of file transfergroup.h.

int TransferGroup::percent (  )  const [inline]

Returns:
the progress percentage

Definition at line 153 of file transfergroup.h.

int TransferGroup::speed (  )  const [inline]

Returns:
the sum of the download speeds of the running transfers belonging this group

Definition at line 159 of file transfergroup.h.

TransferGroupHandler * TransferGroup::handler (  ) 

Returns:
the handler associated with this group

Definition at line 132 of file transfergroup.cpp.

TransferTreeModel* TransferGroup::model (  )  [inline]

Returns:
the TransferTreeModel that owns this group

Definition at line 169 of file transfergroup.h.

void TransferGroup::transferChangedEvent ( Transfer *  transfer  ) 

Notifies that the given transfer has changed.

Parameters:
transfer The transfer that has changed

Definition at line 141 of file transfergroup.cpp.

void TransferGroup::save ( QDomElement  e  ) 

Saves this group object to the given QDomNode.

Parameters:
n The QDomNode where the group will be saved

Definition at line 147 of file transfergroup.cpp.

void TransferGroup::load ( const QDomElement &  e  ) 

Adds all the groups in the given QDomNode * to the group.

Parameters:
n The QDomNode where the group will look for the transfers to add

Definition at line 165 of file transfergroup.cpp.


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