kio Library API Documentation

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:

KIO::SimpleJob KIO::Job QObject KIO::DavJob 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.


Public Methods

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 slotFinished ()
 Called when the slave marks the job as finished.


Protected Methods

virtual void virtual_hook (int id, void *data)

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 951 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 873 of file job.cpp.

References KIO::SlaveInterface::connection(), and KIO::Connection::suspend().

Referenced by KIO::FileCopyJob::slotCanResume().

void TransferJob::resume  
 

Flow control.

Resume data processing from the slave.

Definition at line 880 of file job.cpp.

References KIO::SlaveInterface::connection(), and KIO::Connection::resume().

Referenced by KIO::FileCopyJob::slotCanResume(), KIO::FileCopyJob::slotResult(), and 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(), QMap< QString, QString >::clear(), KURL::isEmpty(), KURL::isMalformed(), permanentRedirection(), and KIO::Job::queryMetaData().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:38 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001