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

KIO

  • sources
  • kde-4.14
  • kdelibs
  • 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 
29 namespace KIO
30 {
31 
32 class ForwardingSlaveBasePrivate;
33 
88 class KIO_EXPORT ForwardingSlaveBase : public QObject, public SlaveBase
89 {
90 Q_OBJECT
91 public:
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 
124 protected:
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 
164 private:
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::filesize_t
qulonglong filesize_t
64-bit file size
Definition: global.h:57
KIO::put
TransferJob * put(const KUrl &url, int permissions, JobFlags flags=DefaultFlags)
Put (a.k.a.
Definition: job.cpp:1700
QByteArray
KIO::UDSEntry
Universal Directory Service.
Definition: udsentry.h:58
KIO::mimetype
MimetypeJob * mimetype(const KUrl &url, JobFlags flags=DefaultFlags)
Find mimetype for one file or directory.
Definition: job.cpp:1856
KIO::mkdir
SimpleJob * mkdir(const KUrl &url, int permissions=-1)
Creates a single directory.
Definition: job.cpp:697
KIO::stat
StatJob * stat(const KUrl &url, JobFlags flags=DefaultFlags)
Find all details for one file or directory.
Definition: job.cpp:924
KIO::ForwardingSlaveBase
This class should be used as a base for ioslaves acting as a forwarder to other ioslaves.
Definition: forwardingslavebase.h:88
KUrl
KIO::listDir
ListJob * listDir(const KUrl &url, JobFlags flags=DefaultFlags, bool includeHidden=true)
List the contents of url, which is assumed to be a directory.
Definition: job.cpp:2735
KIO::SlaveBase
There are two classes that specifies the protocol between application (job) and kioslave.
Definition: slavebase.h:50
KIO::rename
SimpleJob * rename(const KUrl &src, const KUrl &dest, JobFlags flags=DefaultFlags)
Rename a file or directory.
Definition: job.cpp:731
QObject
QString
QList< UDSEntry >
KIO::symlink
SimpleJob * symlink(const QString &target, const KUrl &dest, JobFlags flags=DefaultFlags)
Create or move a symlink.
Definition: job.cpp:738
KIO::chmod
ChmodJob * chmod(const KFileItemList &lstItems, int permissions, int mask, const QString &newOwner, const QString &newGroup, bool recursive, JobFlags flags=DefaultFlags)
Creates a job that changes permissions/ownership on several files or directories, optionally recursiv...
Definition: chmodjob.cpp:268
KIO::setModificationTime
SimpleJob * setModificationTime(const KUrl &url, const QDateTime &mtime)
Changes the modification time on a file or directory.
Definition: job.cpp:724
KIO::del
DeleteJob * del(const KUrl &src, JobFlags flags=DefaultFlags)
Delete a file or directory.
Definition: deletejob.cpp:492
jobclasses.h
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:94
KIO::copy
CopyJob * copy(const KUrl &src, const KUrl &dest, JobFlags flags=DefaultFlags)
Copy a file or directory src into the destination dest, which can be a file (including the final file...
Definition: copyjob.cpp:2164
slavebase.h
KJob
QDateTime
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:52 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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