| # kio Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KIO::TransferJob Class Reference

The transfer job pumps data into and/or out of a Slave. More...

`#include <jobclasses.h>`

Inheritance diagram for KIO::TransferJob:

[legend]
Collaboration diagram for KIO::TransferJob:

[legend]
List of all members.

## Signals
void | data (KIO::Job *, const QByteArray &data)
| Data from the slave has arrived.
void | dataReq (KIO::Job *, QByteArray &data)
| Request for data.
void | redirection (KIO::Job *, const KURL &url)
| Signals a redirection.
void | permanentRedirection (KIO::Job *, const KURL &fromUrl, const KURL &toUrl)
| Signals a permanent redirection.
void | mimetype (KIO::Job *, const QString &type)
| Mimetype determined.
void | canResume (KIO::Job *, KIO::filesize_t offset)
## Public Member Functions
| TransferJob (const KURL &url, int command, const QByteArray &packedArgs, const QByteArray &_staticData, bool showProgressInfo)
virtual void | start (Slave *slave)
virtual void | slotResult (KIO::Job *job)
| Called when m_subJob finishes.
void | suspend ()
| Flow control.
void | resume ()
| Flow control.
bool | isSuspended () const
| Flow control.
bool | isErrorPage () const
## Protected Slots
virtual void | slotRedirection (const KURL &url)
virtual void | slotFinished ()
| Called when the slave marks the job as finished.
virtual void | slotData (const QByteArray &data)
virtual void | slotDataReq ()
virtual void | slotMimetype (const QString &mimetype)
virtual void | slotNeedSubURLData ()
virtual void | slotSubURLData (KIO::Job *, const QByteArray &)
void | slotErrorPage ()
void | slotCanResume (KIO::filesize_t offset)
## Protected Member Functions
virtual void | virtual_hook (int id, void *data)
## Protected Attributes
bool | m_suspended
bool | m_errorPage
QByteArray | staticData
KURL | m_redirectionURL
KURL::List | m_redirectionList
QString | m_mimetype
TransferJob * | m_subJob

## Detailed Description

The transfer job pumps data into and/or out of a Slave.

Data is sent to the slave on request of the slave (dataReq). If data coming from the slave can not be handled, the reading of data from the slave should be suspended.

Definition at line 565 of file jobclasses.h.

## Member Function Documentation

void TransferJob::slotResult | ( | KIO::Job * | job | ) | `[virtual]`

| Called when m_subJob finishes. Reimplemented from KIO::Job. Definition at line 950 of file job.cpp. References KIO::Job::emitResult(), KIO::Job::error(), KIO::Job::errorText(), QPtrList< Job >::remove(), and resume().

void TransferJob::suspend | ( |  | ) |

| Flow control. Suspend data processing from the slave. Definition at line 872 of file job.cpp.

void TransferJob::resume | ( |  | ) |

| Flow control. Resume data processing from the slave. Definition at line 879 of file job.cpp. Referenced by slotResult().

bool KIO::TransferJob::isSuspended | ( |  | ) | const`[inline]`

| Flow control. Returns true if the job is suspended. Definition at line 594 of file jobclasses.h.

bool KIO::TransferJob::isErrorPage | ( |  | ) | const`[inline]`

| Returns: true if we got an (HTML) error page from the server instead of what we asked for. This currently only happens with HTTP urls. Call this from your slot connected to result(). Definition at line 602 of file jobclasses.h.

void KIO::TransferJob::data | ( | KIO::Job * | ,
|  | const QByteArray & | data
| ) | `[signal]`

  | Data from the slave has arrived. Parameters:
  data | data received from the slave. End of data (EOD) has been reached if data.size() == 0

void KIO::TransferJob::dataReq | ( | KIO::Job * | ,
|  | QByteArray & | data
| ) | `[signal]`

  | Request for data. Please note, that you shouldn't put too large chunks of data in it as this requires copies within the frame work, so you should rather split the data you want to pass here in reasonable chunks (about 1MB maximum) Parameters:
  data | buffer to fill with data to send to the slave. An empty buffer indicates end of data. (EOD)

void KIO::TransferJob::redirection | ( | KIO::Job * | ,
|  | const KURL & | url
| ) | `[signal]`

| Signals a redirection. Use to update the URL shown to the user. The redirection itself is handled internally.

void KIO::TransferJob::permanentRedirection | ( | KIO::Job * | ,
|  | const KURL & | fromUrl,
|  | const KURL & | toUrl
| ) | `[signal]`

| Signals a permanent redirection. The redirection itself is handled internally. Since: 3.1 Referenced by slotFinished().

void KIO::TransferJob::mimetype | ( | KIO::Job * | ,
|  | const QString & | type
| ) | `[signal]`

| Mimetype determined.

void TransferJob::slotFinished | ( |  | ) | `[protected, virtual, slot]`

| Called when the slave marks the job as finished. Reimplemented from KIO::SimpleJob. Reimplemented in KIO::DavJob. Definition at line 776 of file job.cpp. References KIO::Job::addMetaData(), KURL::isEmpty(), KURL::isMalformed(), permanentRedirection(), and KIO::Job::queryMetaData().

The documentation for this class was generated from the following files:

- jobclasses.h
- job.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:25:51 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001