• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kio/kio
 

kio/kio

  • kio
  • kio
forwardingslavebase.h
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 <tqobject.h>
27 
28 namespace KIO
29 {
30 
31 class ForwardingSlaveBasePrivate;
32 
88 class KIO_EXPORT ForwardingSlaveBase : public TQObject, public SlaveBase
89 {
90 Q_OBJECT
91 public:
92  ForwardingSlaveBase(const TQCString &protocol,
93  const TQCString &poolSocket,
94  const TQCString &appSocket);
95  virtual ~ForwardingSlaveBase();
96 
97  virtual void get(const KURL &url);
98 
99  virtual void put(const KURL &url, int permissions,
100  bool overwrite, bool resume);
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, bool overwrite);
111 
112  virtual void symlink(const TQString &target, const KURL &dest,
113  bool overwrite);
114 
115  virtual void chmod(const KURL &url, int permissions);
116 
117  virtual void copy(const KURL &src, const KURL &dest,
118  int permissions, bool overwrite);
119 
120  virtual void del(const KURL &url, bool isfile);
121 
122 protected:
135  virtual bool rewriteURL(const KURL &url, KURL &newURL)=0;
136 
147  virtual void prepareUDSEntry(KIO::UDSEntry &entry,
148  bool listing=false) const;
149 
154  KURL processedURL() const { return m_processedURL; }
155 
160  KURL requestedURL() const { return m_requestedURL; }
161 
162 private:
163  KURL m_processedURL;
164  KURL m_requestedURL;
165  ForwardingSlaveBasePrivate *d;
166 
167  bool internalRewriteURL(const KURL &url, KURL &newURL);
168 
169  void connectJob(Job *job);
170  void connectSimpleJob(SimpleJob *job);
171  void connectListJob(ListJob *job);
172  void connectTransferJob(TransferJob *job);
173 
174 private slots:
175  // KIO::Job
176  void slotResult(KIO::Job *job);
177  void slotWarning(KIO::Job *job, const TQString &msg);
178  void slotInfoMessage(KIO::Job *job, const TQString &msg);
179  void slotTotalSize(KIO::Job *job, KIO::filesize_t size);
180  void slotProcessedSize(KIO::Job *job, KIO::filesize_t size);
181  void slotSpeed(KIO::Job *job, unsigned long bytesPerSecond);
182 
183  // KIO::SimpleJob subclasses
184  void slotRedirection(KIO::Job *job, const KURL &url);
185 
186  // KIO::ListJob
187  void slotEntries(KIO::Job *job, const KIO::UDSEntryList &entries);
188 
189  // KIO::TransferJob
190  void slotData(KIO::Job *job, const TQByteArray &data);
191  void slotDataReq(KIO::Job *job, TQByteArray &data);
192  void slotMimetype (KIO::Job *job, const TQString &type);
193  void slotCanResume (KIO::Job *job, KIO::filesize_t offset);
194 };
195 
196 }
197 
198 #endif
KIO::ForwardingSlaveBase
This class should be used as a base for ioslaves acting as a forwarder to other ioslaves.
Definition: forwardingslavebase.h:89
KIO::ForwardingSlaveBase::requestedURL
KURL requestedURL() const
Return the URL asked to the ioslave Only access it inside prepareUDSEntry()
Definition: forwardingslavebase.h:160
KIO::ForwardingSlaveBase::processedURL
KURL processedURL() const
Return the URL being processed by the ioslave Only access it inside prepareUDSEntry()
Definition: forwardingslavebase.h:154
KIO::ForwardingSlaveBase::rewriteURL
virtual bool rewriteURL(const KURL &url, KURL &newURL)=0
Rewrite an url to it's forwarded counterpart.
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:68
KIO::ListJob
A ListJob is allows you to get the get the content of a directory.
Definition: jobclasses.h:1392
KIO::SimpleJob
A simple job (one url and one command).
Definition: jobclasses.h:528
KIO::SlaveBase
There are two classes that specifies the protocol between application (job) and kioslave.
Definition: slavebase.h:46
KIO::TransferJob
The transfer job pumps data into and/or out of a Slave.
Definition: jobclasses.h:875
KIO
A namespace for KIO globals.
Definition: authinfo.h:29
KIO::UDSEntry
TQValueList< UDSAtom > UDSEntry
An entry is the list of atoms containing all the information for a file or URL.
Definition: global.h:506
KIO::get
KIO_EXPORT TransferJob * get(const KURL &url, bool reload=false, bool showProgressInfo=true)
Get (a.k.a.
Definition: job.cpp:1220
KIO::symlink
KIO_EXPORT SimpleJob * symlink(const TQString &target, const KURL &dest, bool overwrite, bool showProgressInfo=true)
Create or move a symlink.
Definition: job.cpp:779
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::filesize_t
TQ_ULLONG filesize_t
64-bit file size
Definition: global.h:39
KIO::mimetype
KIO_EXPORT MimetypeJob * mimetype(const KURL &url, bool showProgressInfo=true)
Find mimetype for one file or directory.
Definition: job.cpp:1509
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::del
KIO_EXPORT DeleteJob * del(const KURL &src, bool shred=false, bool showProgressInfo=true)
Delete a file or directory.
Definition: job.cpp:4386
KIO::chmod
KIO_EXPORT ChmodJob * chmod(const KFileItemList &lstItems, int permissions, int mask, TQString newOwner, TQString 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::rename
KIO_EXPORT SimpleJob * rename(const KURL &src, const KURL &dest, bool overwrite)
Rename a file or directory.
Definition: job.cpp:772
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::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::mkdir
KIO_EXPORT SimpleJob * mkdir(const KURL &url, int permissions=-1)
Creates a single directory.
Definition: job.cpp:751

kio/kio

Skip menu "kio/kio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kio/kio

Skip menu "kio/kio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/kio by doxygen 1.9.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |