• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • kio
forwardingslavebase.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (c) 2004 Kevin Ottens <ervin@ipsquad.net>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef _FORWARDING_SLAVE_BASE_H_
21#define _FORWARDING_SLAVE_BASE_H_
22
23#include <kio/slavebase.h>
24#include <kio/jobclasses.h>
25
26#include <QtCore/QObject>
27#include <QtCore/QEventLoop>
28
29namespace KIO
30{
31
32class ForwardingSlaveBasePrivate;
33
88class KIO_EXPORT ForwardingSlaveBase : public QObject, public SlaveBase
89{
90Q_OBJECT
91public:
92 ForwardingSlaveBase(const QByteArray &protocol,
93 const QByteArray &poolSocket,
94 const QByteArray &appSocket);
95 virtual ~ForwardingSlaveBase();
96
97 virtual void get(const KUrl &url);
98
99 virtual void put(const KUrl &url, int permissions,
100 JobFlags flags);
101
102 virtual void stat(const KUrl &url);
103
104 virtual void mimetype(const KUrl &url);
105
106 virtual void listDir(const KUrl &url);
107
108 virtual void mkdir(const KUrl &url, int permissions);
109
110 virtual void rename(const KUrl &src, const KUrl &dest, JobFlags flags);
111
112 virtual void symlink(const QString &target, const KUrl &dest,
113 JobFlags flags);
114
115 virtual void chmod(const KUrl &url, int permissions);
116
117 virtual void setModificationTime(const KUrl& url, const QDateTime& mtime);
118
119 virtual void copy(const KUrl &src, const KUrl &dest,
120 int permissions, JobFlags flags);
121
122 virtual void del(const KUrl &url, bool isfile);
123
124protected:
137 virtual bool rewriteUrl(const KUrl &url, KUrl &newURL)=0;
138
149 virtual void prepareUDSEntry(KIO::UDSEntry &entry,
150 bool listing=false) const;
151
156 KUrl processedUrl() const;
157
162 KUrl requestedUrl() const;
163
164private:
165 // KIO::Job
166 Q_PRIVATE_SLOT(d, void _k_slotResult(KJob *job))
167 Q_PRIVATE_SLOT(d, void _k_slotWarning(KJob *job, const QString &msg))
168 Q_PRIVATE_SLOT(d, void _k_slotInfoMessage(KJob *job, const QString &msg))
169 Q_PRIVATE_SLOT(d, void _k_slotTotalSize(KJob *job, qulonglong size))
170 Q_PRIVATE_SLOT(d, void _k_slotProcessedSize(KJob *job, qulonglong size))
171 Q_PRIVATE_SLOT(d, void _k_slotSpeed(KJob *job, unsigned long bytesPerSecond))
172
173 // KIO::SimpleJob subclasses
174 Q_PRIVATE_SLOT(d, void _k_slotRedirection(KIO::Job *job, const KUrl &url))
175
176 // KIO::ListJob
177 Q_PRIVATE_SLOT(d, void _k_slotEntries(KIO::Job *job, const KIO::UDSEntryList &entries))
178
179 // KIO::TransferJob
180 Q_PRIVATE_SLOT(d, void _k_slotData(KIO::Job *job, const QByteArray &data))
181 Q_PRIVATE_SLOT(d, void _k_slotDataReq(KIO::Job *job, QByteArray &data))
182 Q_PRIVATE_SLOT(d, void _k_slotMimetype (KIO::Job *job, const QString &type))
183 Q_PRIVATE_SLOT(d, void _k_slotCanResume (KIO::Job *job, KIO::filesize_t offset))
184
185 friend class ForwardingSlaveBasePrivate;
186 ForwardingSlaveBasePrivate *const d;
187};
188
189}
190
191#endif
KIO::ForwardingSlaveBase::requestedUrl
KUrl requestedUrl() const
Return the URL asked to the ioslave Only access it inside prepareUDSEntry()
Definition forwardingslavebase.cpp:163
KIO::ForwardingSlaveBase::rewriteUrl
virtual bool rewriteUrl(const KUrl &url, KUrl &newURL)=0
Rewrite an url to its forwarded counterpart.
KIO::ForwardingSlaveBase::chmod
virtual void chmod(const KUrl &url, int permissions)
Change permissions on url The slave emits ERR_DOES_NOT_EXIST or ERR_CANNOT_CHMOD.
Definition forwardingslavebase.cpp:320
KIO::ForwardingSlaveBase::ForwardingSlaveBasePrivate
friend class ForwardingSlaveBasePrivate
Definition forwardingslavebase.h:185
KIO::ForwardingSlaveBase::rename
virtual void rename(const KUrl &src, const KUrl &dest, JobFlags flags)
Rename oldname into newname.
Definition forwardingslavebase.cpp:278
KIO::ForwardingSlaveBase::mkdir
virtual void mkdir(const KUrl &url, int permissions)
Create a directory.
Definition forwardingslavebase.cpp:260
KIO::ForwardingSlaveBase::del
virtual void del(const KUrl &url, bool isfile)
Delete a file or directory.
Definition forwardingslavebase.cpp:381
KIO::ForwardingSlaveBase::copy
virtual void copy(const KUrl &src, const KUrl &dest, int permissions, JobFlags flags)
Copy src into dest.
Definition forwardingslavebase.cpp:356
KIO::ForwardingSlaveBase::stat
virtual void stat(const KUrl &url)
Finds all details for one file or directory.
Definition forwardingslavebase.cpp:206
KIO::ForwardingSlaveBase::listDir
virtual void listDir(const KUrl &url)
Lists the contents of url.
Definition forwardingslavebase.cpp:242
KIO::ForwardingSlaveBase::processedUrl
KUrl processedUrl() const
Return the URL being processed by the ioslave Only access it inside prepareUDSEntry()
Definition forwardingslavebase.cpp:158
KIO::ForwardingSlaveBase::put
virtual void put(const KUrl &url, int permissions, JobFlags flags)
put, i.e.
Definition forwardingslavebase.cpp:186
KIO::ForwardingSlaveBase::setModificationTime
virtual void setModificationTime(const KUrl &url, const QDateTime &mtime)
Sets the modification time for @url For instance this is what CopyJob uses to set mtime on dirs at th...
Definition forwardingslavebase.cpp:338
KIO::ForwardingSlaveBase::symlink
virtual void symlink(const QString &target, const KUrl &dest, JobFlags flags)
Creates a symbolic link named dest, pointing to target, which may be a relative or an absolute path.
Definition forwardingslavebase.cpp:301
KIO::ForwardingSlaveBase::prepareUDSEntry
virtual void prepareUDSEntry(KIO::UDSEntry &entry, bool listing=false) const
Allow to modify a UDSEntry before it's sent to the ioslave endpoint.
Definition forwardingslavebase.cpp:105
KIO::ForwardingSlaveBase::ForwardingSlaveBase
ForwardingSlaveBase(const QByteArray &protocol, const QByteArray &poolSocket, const QByteArray &appSocket)
Definition forwardingslavebase.cpp:73
KIO::ForwardingSlaveBase::mimetype
virtual void mimetype(const KUrl &url)
Finds mimetype for one file or directory.
Definition forwardingslavebase.cpp:224
KIO::ForwardingSlaveBase::get
virtual void get(const KUrl &url)
get, aka read.
Definition forwardingslavebase.cpp:168
KIO::Job
The base class for all jobs.
Definition jobclasses.h:94
KIO::SlaveBase::SlaveBase
SlaveBase(const QByteArray &protocol, const QByteArray &pool_socket, const QByteArray &app_socket)
Definition slavebase.cpp:179
KIO::SlaveBase::data
void data(const QByteArray &data)
Sends data in the slave to the job (i.e.
Definition slavebase.cpp:398
KIO::UDSEntry
Universal Directory Service.
Definition udsentry.h:59
KJob
KUrl
QObject
jobclasses.h
KIO
A namespace for KIO globals.
Definition kbookmarkmenu.h:55
KIO::UDSEntryList
QList< UDSEntry > UDSEntryList
A directory listing is a list of UDSEntry instances.
Definition udsentry.h:294
KIO::filesize_t
qulonglong filesize_t
64-bit file size
Definition global.h:57
slavebase.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal