.TH "KIO::TransferJob" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KIO::TransferJob \- The transfer job pumps data into and/or out of a Slave.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <jobclasses.h>\fP
.PP
Inherits \fBKIO::SimpleJob\fP.
.PP
Inherited by \fBKIO::DavJob\fP, \fBKIO::MimetypeJob\fP, \fBKIO::MultiGetJob\fP, \fBKIO::StoredTransferJob\fP, and PostErrorJob.
.PP
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBdata\fP (\fBKIO::Job\fP *job, const \fBQByteArray\fP &data)"
.br
.ti -1c
.RI "void \fBdataReq\fP (\fBKIO::Job\fP *job, \fBQByteArray\fP &data)"
.br
.ti -1c
.RI "void \fBredirection\fP (\fBKIO::Job\fP *job, const \fBKURL\fP &url)"
.br
.ti -1c
.RI "void \fBpermanentRedirection\fP (\fBKIO::Job\fP *job, const \fBKURL\fP &fromUrl, const \fBKURL\fP &toUrl)"
.br
.ti -1c
.RI "void \fBmimetype\fP (\fBKIO::Job\fP *job, const \fBQString\fP &type)"
.br
.ti -1c
.RI "void \fBcanResume\fP (\fBKIO::Job\fP *job, \fBKIO::filesize_t\fP offset)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBTransferJob\fP (const \fBKURL\fP &url, int command, const \fBQByteArray\fP &packedArgs, const \fBQByteArray\fP &_staticData, bool showProgressInfo)"
.br
.ti -1c
.RI "virtual void \fBstart\fP (Slave *slave)"
.br
.ti -1c
.RI "virtual void \fBslotResult\fP (\fBKIO::Job\fP *job)"
.br
.ti -1c
.RI "void \fBsuspend\fP ()"
.br
.ti -1c
.RI "void \fBresume\fP ()"
.br
.ti -1c
.RI "bool \fBisSuspended\fP () const "
.br
.ti -1c
.RI "bool \fBisErrorPage\fP () const "
.br
.ti -1c
.RI "void \fBsetAsyncDataEnabled\fP (bool enabled)"
.br
.ti -1c
.RI "void \fBsendAsyncData\fP (const \fBQByteArray\fP &data)"
.br
.ti -1c
.RI "void \fBsetReportDataSent\fP (bool enabled)"
.br
.ti -1c
.RI "bool \fBreportDataSent\fP ()"
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "virtual void \fBslotRedirection\fP (const \fBKURL\fP &url)"
.br
.ti -1c
.RI "virtual void \fBslotFinished\fP ()"
.br
.ti -1c
.RI "virtual void \fBslotData\fP (const \fBQByteArray\fP &data)"
.br
.ti -1c
.RI "virtual void \fBslotDataReq\fP ()"
.br
.ti -1c
.RI "virtual void \fBslotMimetype\fP (const \fBQString\fP &mimetype)"
.br
.ti -1c
.RI "virtual void \fBslotNeedSubURLData\fP ()"
.br
.ti -1c
.RI "virtual void \fBslotSubURLData\fP (\fBKIO::Job\fP *, const \fBQByteArray\fP &)"
.br
.ti -1c
.RI "virtual void \fBslotMetaData\fP (const \fBKIO::MetaData\fP &_metaData)"
.br
.ti -1c
.RI "void \fBslotErrorPage\fP ()"
.br
.ti -1c
.RI "void \fBslotCanResume\fP (\fBKIO::filesize_t\fP offset)"
.br
.ti -1c
.RI "void \fBslotPostRedirection\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "bool \fBm_suspended\fP"
.br
.ti -1c
.RI "bool \fBm_errorPage\fP"
.br
.ti -1c
.RI "\fBQByteArray\fP \fBstaticData\fP"
.br
.ti -1c
.RI "\fBKURL\fP \fBm_redirectionURL\fP"
.br
.ti -1c
.RI "\fBKURL::List\fP \fBm_redirectionList\fP"
.br
.ti -1c
.RI "\fBQString\fP \fBm_mimetype\fP"
.br
.ti -1c
.RI "\fBTransferJob\fP * \fBm_subJob\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
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. 
.PP
Definition at line 834 of file jobclasses.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "TransferJob::TransferJob (const \fBKURL\fP & url, int command, const \fBQByteArray\fP & packedArgs, const \fBQByteArray\fP & _staticData, bool showProgressInfo)"
.PP
Do not create a \fBTransferJob\fP. 
.PP
Use \fBKIO::get()\fP or \fBKIO::put()\fP instead. 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP the url to get or put 
.br
\fIcommand\fP the command to issue 
.br
\fIpackedArgs\fP the arguments 
.br
\fI_staticData\fP additional data to transmit (e.g. in a HTTP Post) 
.br
\fIshowProgressInfo\fP true to show progress information to the user
.RE
.PP

.PP
Definition at line 857 of file job.cpp.
.PP
References Observer::self(), and Observer::slotTransferring().
.SH "Member Function Documentation"
.PP 
.SS "void TransferJob::slotResult (\fBKIO::Job\fP * job)\fC [virtual]\fP"
.PP
Called when m_subJob finishes. 
.PP
\fBParameters:\fP
.RS 4
\fIjob\fP the job that finished 
.RE
.PP

.PP
Reimplemented from \fBKIO::Job\fP.
.PP
Definition at line 1139 of file job.cpp.
.PP
References KIO::Job::emitResult(), KIO::Job::error(), KIO::Job::removeSubjob(), and resume().
.SS "void TransferJob::suspend ()"
.PP
Flow control. 
.PP
Suspend data processing from the slave. 
.PP
Definition at line 1056 of file job.cpp.
.SS "void TransferJob::resume ()"
.PP
Flow control. 
.PP
Resume data processing from the slave. 
.PP
Definition at line 1063 of file job.cpp.
.PP
Referenced by slotResult().
.SS "bool KIO::TransferJob::isSuspended () const\fC [inline]\fP"
.PP
Flow control. 
.PP
\fBReturns:\fP
.RS 4
true if the job is suspended 
.RE
.PP

.PP
Definition at line 880 of file jobclasses.h.
.SS "bool KIO::TransferJob::isErrorPage () const\fC [inline]\fP"
.PP
Checks whether we got an error page. 
.PP
This currently only happens with HTTP urls. Call this from your slot connected to \fBresult()\fP.
.PP
\fBReturns:\fP
.RS 4
true if we got an (HTML) error page from the server instead of what we asked for. 
.RE
.PP

.PP
Definition at line 890 of file jobclasses.h.
.SS "void TransferJob::setAsyncDataEnabled (bool enabled)"
.PP
Enable the async data mode. 
.PP
When async data is enabled, data should be provided to the job by calling \fBsendAsyncData()\fP instead of returning data in the \fBdataReq()\fP signal. 
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 969 of file job.cpp.
.SS "void TransferJob::sendAsyncData (const \fBQByteArray\fP & data)"
.PP
Provide data to the job when async data is enabled. 
.PP
Should be called exactly once after receiving a dataReq signal Sending an empty block indicates end of data. 
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 977 of file job.cpp.
.PP
References KIO::Job::emitPercent(), KIO::Job::getProcessedSize(), KIO::Job::processedSize(), KIO::Job::setProcessedSize(), and KIO::SimpleJob::slotTotalSize().
.SS "void TransferJob::setReportDataSent (bool enabled)"
.PP
When enabled, the job reports the amount of data that has been sent, instead of the amount of data that that has been received. 
.PP
\fBSee also:\fP
.RS 4
\fBslotProcessedSize\fP 
.PP
\fBslotSpeed\fP 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 997 of file job.cpp.
.SS "bool TransferJob::reportDataSent ()"
.PP
Returns whether the job reports the amount of data that has been sent (true), or whether the job reports the amount of data that has been received (false) 
.PP
\fBSince:\fP
.RS 4
3.2. 
.RE
.PP

.PP
Definition at line 1005 of file job.cpp.
.SS "void KIO::TransferJob::data (\fBKIO::Job\fP * job, const \fBQByteArray\fP & data)\fC [signal]\fP"
.PP
Data from the slave has arrived. 
.PP
\fBParameters:\fP
.RS 4
\fIjob\fP the job that emitted this signal 
.br
\fIdata\fP data received from the slave.
.RE
.PP
End of data (EOD) has been reached if data.size() == 0, however, you should not be certain of data.size() == 0 ever happening (e.g. in case of an error), so you should rely on \fBresult()\fP instead. 
.SS "void KIO::TransferJob::dataReq (\fBKIO::Job\fP * job, \fBQByteArray\fP & data)\fC [signal]\fP"
.PP
Request for data. 
.PP
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)
.PP
\fBParameters:\fP
.RS 4
\fIjob\fP the job that emitted this signal 
.br
\fIdata\fP buffer to fill with data to send to the slave. An empty buffer indicates end of data. (EOD) 
.RE
.PP

.PP
Referenced by KIO::StoredTransferJob::StoredTransferJob().
.SS "void KIO::TransferJob::redirection (\fBKIO::Job\fP * job, const \fBKURL\fP & url)\fC [signal]\fP"
.PP
Signals a redirection. 
.PP
Use to update the URL shown to the user. The redirection itself is handled internally. 
.PP
\fBParameters:\fP
.RS 4
\fIjob\fP the job that emitted this signal 
.br
\fIurl\fP the new URL 
.RE
.PP

.SS "void KIO::TransferJob::permanentRedirection (\fBKIO::Job\fP * job, const \fBKURL\fP & fromUrl, const \fBKURL\fP & toUrl)\fC [signal]\fP"
.PP
Signals a permanent redirection. 
.PP
The redirection itself is handled internally. 
.PP
\fBParameters:\fP
.RS 4
\fIjob\fP the job that emitted this signal 
.br
\fIfromUrl\fP the original URL 
.br
\fItoUrl\fP the new URL 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Referenced by KIO::MimetypeJob::slotFinished(), and slotFinished().
.SS "void KIO::TransferJob::mimetype (\fBKIO::Job\fP * job, const \fBQString\fP & type)\fC [signal]\fP"
.PP
Mimetype determined. 
.PP
\fBParameters:\fP
.RS 4
\fIjob\fP the job that emitted this signal 
.br
\fItype\fP the mime type 
.RE
.PP

.PP
Referenced by KIO::MimetypeJob::slotFinished().
.SS "void TransferJob::slotFinished ()\fC [protected, virtual, slot]\fP"
.PP
Called when the slave marks the job as finished. 
.PP
Reimplemented from \fBKIO::SimpleJob\fP.
.PP
Reimplemented in \fBKIO::DavJob\fP, \fBKIO::MultiGetJob\fP, and \fBKIO::MimetypeJob\fP.
.PP
Definition at line 908 of file job.cpp.
.PP
References KIO::Job::addMetaData(), QMap::clear(), KIO::Scheduler::doJob(), KURL::isEmpty(), KURL::isValid(), permanentRedirection(), KIO::Job::queryMetaData(), and KIO::SimpleJob::slotFinished().
.PP
Referenced by KIO::MultiGetJob::slotFinished(), and KIO::MimetypeJob::slotFinished().
.SS "void TransferJob::slotMetaData (const \fBKIO::MetaData\fP & _metaData)\fC [protected, virtual, slot]\fP"
.PP
\fBMetaData\fP from the slave is received. 
.PP
\fBParameters:\fP
.RS 4
\fI_metaData\fP the meta data 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBmetaData()\fP 
.RE
.PP

.PP
Reimplemented from \fBKIO::SimpleJob\fP.
.PP
Definition at line 1124 of file job.cpp.
.PP
References KIO::SimpleJob::slotMetaData().

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
