forwardingslavebase.h
/* This file is part of the KDE project
Copyright (c) 2004 Kevin Ottens <ervin ipsquad net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _FORWARDING_SLAVE_BASE_H_
#define _FORWARDING_SLAVE_BASE_H_
#include <kio/slavebase.h>
#include <kio/jobclasses.h>
#include <qobject.h>
namespace KIO
{
class ForwardingSlaveBasePrivate;
class KIO_EXPORT ForwardingSlaveBase : public QObject, public SlaveBase
{
Q_OBJECT
public:
ForwardingSlaveBase(const QCString &protocol,
const QCString &poolSocket,
const QCString &appSocket);
virtual ~ForwardingSlaveBase();
virtual void get(const KURL &url);
virtual void put(const KURL &url, int permissions,
bool overwrite, bool resume);
virtual void stat(const KURL &url);
virtual void mimetype(const KURL &url);
virtual void listDir(const KURL &url);
virtual void mkdir(const KURL &url, int permissions);
virtual void rename(const KURL &src, const KURL &dest, bool overwrite);
virtual void symlink(const QString &target, const KURL &dest,
bool overwrite);
virtual void chmod(const KURL &url, int permissions);
virtual void copy(const KURL &src, const KURL &dest,
int permissions, bool overwrite);
virtual void del(const KURL &url, bool isfile);
protected:
virtual bool rewriteURL(const KURL &url, KURL &newURL)=0;
virtual void prepareUDSEntry(KIO::UDSEntry &entry,
bool listing=false) const;
KURL processedURL() const { return m_processedURL; }
KURL requestedURL() const { return m_requestedURL; }
private:
KURL m_processedURL;
KURL m_requestedURL;
ForwardingSlaveBasePrivate *d;
bool internalRewriteURL(const KURL &url, KURL &newURL);
void connectJob(Job *job);
void connectSimpleJob(SimpleJob *job);
void connectListJob(ListJob *job);
void connectTransferJob(TransferJob *job);
private slots:
// KIO::Job
void slotResult(KIO::Job *job);
void slotWarning(KIO::Job *job, const QString &msg);
void slotInfoMessage(KIO::Job *job, const QString &msg);
void slotTotalSize(KIO::Job *job, KIO::filesize_t size);
void slotProcessedSize(KIO::Job *job, KIO::filesize_t size);
void slotSpeed(KIO::Job *job, unsigned long bytesPerSecond);
// KIO::SimpleJob subclasses
void slotRedirection(KIO::Job *job, const KURL &url);
// KIO::ListJob
void slotEntries(KIO::Job *job, const KIO::UDSEntryList &entries);
// KIO::TransferJob
void slotData(KIO::Job *job, const QByteArray &data);
void slotDataReq(KIO::Job *job, QByteArray &data);
void slotMimetype (KIO::Job *job, const QString &type);
void slotCanResume (KIO::Job *job, KIO::filesize_t offset);
};
}
#endif
KIO::put
KIO_EXPORT TransferJob * put(const KURL &url, int permissions, bool overwrite, bool resume, bool showProgressInfo=true)
Put (a.k.a.
Definition: job.cpp:1380
KIO::ForwardingSlaveBase::requestedURL
KURL requestedURL() const
Return the URL asked to the ioslave Only access it inside prepareUDSEntry()
Definition: forwardingslavebase.h:160
KIO::symlink
KIO_EXPORT SimpleJob * symlink(const QString &target, const KURL &dest, bool overwrite, bool showProgressInfo=true)
Create or move a symlink.
Definition: job.cpp:779
KIO::ListJob
A ListJob is allows you to get the get the content of a directory.
Definition: jobclasses.h:1392
KIO::ForwardingSlaveBase
This class should be used as a base for ioslaves acting as a forwarder to other ioslaves.
Definition: forwardingslavebase.h:88
KIO::listDir
KIO_EXPORT ListJob * listDir(const KURL &url, bool showProgressInfo=true, bool includeHidden=true)
List the contents of url, which is assumed to be a directory.
Definition: job.cpp:2152
KIO::mimetype
KIO_EXPORT MimetypeJob * mimetype(const KURL &url, bool showProgressInfo=true)
Find mimetype for one file or directory.
Definition: job.cpp:1509
KIO::chmod
KIO_EXPORT ChmodJob * chmod(const KFileItemList &lstItems, int permissions, int mask, QString newOwner, QString newGroup, bool recursive, bool showProgressInfo=true)
Creates a job that changes permissions/ownership on several files or directories, optionally recursiv...
Definition: chmodjob.cpp:230
KIO::SlaveBase
There are two classes that specifies the protocol between application (job) and kioslave.
Definition: slavebase.h:45
KIO::ForwardingSlaveBase::processedURL
KURL processedURL() const
Return the URL being processed by the ioslave Only access it inside prepareUDSEntry() ...
Definition: forwardingslavebase.h:154
KIO::copy
KIO_EXPORT CopyJob * copy(const KURL &src, const KURL &dest, bool showProgressInfo=true)
Copy a file or directory src into the destination dest, which can be a file (including the final file...
Definition: job.cpp:3886
KIO::rename
KIO_EXPORT SimpleJob * rename(const KURL &src, const KURL &dest, bool overwrite)
Rename a file or directory.
Definition: job.cpp:772
KIO::filesize_t
Q_ULLONG filesize_t
64-bit file size
Definition: global.h:39
KIO::stat
KIO_EXPORT StatJob * stat(const KURL &url, bool showProgressInfo=true)
Find all details for one file or directory.
Definition: job.cpp:886
KIO::del
KIO_EXPORT DeleteJob * del(const KURL &src, bool shred=false, bool showProgressInfo=true)
Delete a file or directory.
Definition: job.cpp:4386
KIO::UDSEntry
QValueList< UDSAtom > UDSEntry
An entry is the list of atoms containing all the informations for a file or URL.
Definition: global.h:504
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:68
KIO::TransferJob
The transfer job pumps data into and/or out of a Slave.
Definition: jobclasses.h:875
KIO::mkdir
KIO_EXPORT SimpleJob * mkdir(const KURL &url, int permissions=-1)
Creates a single directory.
Definition: job.cpp:751
KIO::SimpleJob
A simple job (one url and one command).
Definition: jobclasses.h:528

KDE Home | KDE Accessibility Home | Description of Access Keys