KIO
forwardingslavebase.h
Go to the documentation of this file.
00001 /* This file is part of the KDE project 00002 Copyright (c) 2004 Kevin Ottens <ervin@ipsquad.net> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef _FORWARDING_SLAVE_BASE_H_ 00021 #define _FORWARDING_SLAVE_BASE_H_ 00022 00023 #include <kio/slavebase.h> 00024 #include <kio/jobclasses.h> 00025 00026 #include <QtCore/QObject> 00027 #include <QtCore/QEventLoop> 00028 00029 namespace KIO 00030 { 00031 00032 class ForwardingSlaveBasePrivate; 00033 00088 class KIO_EXPORT ForwardingSlaveBase : public QObject, public SlaveBase 00089 { 00090 Q_OBJECT 00091 public: 00092 ForwardingSlaveBase(const QByteArray &protocol, 00093 const QByteArray &poolSocket, 00094 const QByteArray &appSocket); 00095 virtual ~ForwardingSlaveBase(); 00096 00097 virtual void get(const KUrl &url); 00098 00099 virtual void put(const KUrl &url, int permissions, 00100 JobFlags flags); 00101 00102 virtual void stat(const KUrl &url); 00103 00104 virtual void mimetype(const KUrl &url); 00105 00106 virtual void listDir(const KUrl &url); 00107 00108 virtual void mkdir(const KUrl &url, int permissions); 00109 00110 virtual void rename(const KUrl &src, const KUrl &dest, JobFlags flags); 00111 00112 virtual void symlink(const QString &target, const KUrl &dest, 00113 JobFlags flags); 00114 00115 virtual void chmod(const KUrl &url, int permissions); 00116 00117 virtual void setModificationTime(const KUrl& url, const QDateTime& mtime); 00118 00119 virtual void copy(const KUrl &src, const KUrl &dest, 00120 int permissions, JobFlags flags); 00121 00122 virtual void del(const KUrl &url, bool isfile); 00123 00124 protected: 00137 virtual bool rewriteUrl(const KUrl &url, KUrl &newURL)=0; 00138 00149 virtual void prepareUDSEntry(KIO::UDSEntry &entry, 00150 bool listing=false) const; 00151 00156 KUrl processedUrl() const; 00157 00162 KUrl requestedUrl() const; 00163 00164 private: 00165 // KIO::Job 00166 Q_PRIVATE_SLOT(d, void _k_slotResult(KJob *job)) 00167 Q_PRIVATE_SLOT(d, void _k_slotWarning(KJob *job, const QString &msg)) 00168 Q_PRIVATE_SLOT(d, void _k_slotInfoMessage(KJob *job, const QString &msg)) 00169 Q_PRIVATE_SLOT(d, void _k_slotTotalSize(KJob *job, qulonglong size)) 00170 Q_PRIVATE_SLOT(d, void _k_slotProcessedSize(KJob *job, qulonglong size)) 00171 Q_PRIVATE_SLOT(d, void _k_slotSpeed(KJob *job, unsigned long bytesPerSecond)) 00172 00173 // KIO::SimpleJob subclasses 00174 Q_PRIVATE_SLOT(d, void _k_slotRedirection(KIO::Job *job, const KUrl &url)) 00175 00176 // KIO::ListJob 00177 Q_PRIVATE_SLOT(d, void _k_slotEntries(KIO::Job *job, const KIO::UDSEntryList &entries)) 00178 00179 // KIO::TransferJob 00180 Q_PRIVATE_SLOT(d, void _k_slotData(KIO::Job *job, const QByteArray &data)) 00181 Q_PRIVATE_SLOT(d, void _k_slotDataReq(KIO::Job *job, QByteArray &data)) 00182 Q_PRIVATE_SLOT(d, void _k_slotMimetype (KIO::Job *job, const QString &type)) 00183 Q_PRIVATE_SLOT(d, void _k_slotCanResume (KIO::Job *job, KIO::filesize_t offset)) 00184 00185 friend class ForwardingSlaveBasePrivate; 00186 ForwardingSlaveBasePrivate *const d; 00187 }; 00188 00189 } 00190 00191 #endif
KDE 4.6 API Reference