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

tdeio/tdeio

  • tdeio
  • tdeio
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 <tdeio/slavebase.h>
24 #include <tdeio/jobclasses.h>
25 
26 #include <tqobject.h>
27 
28 namespace TDEIO
29 {
30 
31 class ForwardingSlaveBasePrivate;
32 
88 class TDEIO_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  virtual void localURL(const KURL& remoteURL);
123 
124 protected:
137  virtual bool rewriteURL(const KURL &url, KURL &newURL)=0;
138 
149  virtual void prepareUDSEntry(TDEIO::UDSEntry &entry,
150  bool listing=false) const;
151 
156  KURL processedURL() const { return m_processedURL; }
157 
162  KURL requestedURL() const { return m_requestedURL; }
163 
164 private:
165  KURL m_processedURL;
166  KURL m_requestedURL;
167  ForwardingSlaveBasePrivate *d;
168 
169  bool internalRewriteURL(const KURL &url, KURL &newURL);
170 
171  void connectJob(Job *job);
172  void connectSimpleJob(SimpleJob *job);
173  void connectListJob(ListJob *job);
174  void connectTransferJob(TransferJob *job);
175  void connectLocalURLJob(LocalURLJob *job);
176 
177 private slots:
178  // TDEIO::Job
179  void slotResult(TDEIO::Job *job);
180  void slotWarning(TDEIO::Job *job, const TQString &msg);
181  void slotInfoMessage(TDEIO::Job *job, const TQString &msg);
182  void slotTotalSize(TDEIO::Job *job, TDEIO::filesize_t size);
183  void slotProcessedSize(TDEIO::Job *job, TDEIO::filesize_t size);
184  void slotSpeed(TDEIO::Job *job, unsigned long bytesPerSecond);
185 
186  // TDEIO::SimpleJob subclasses
187  void slotRedirection(TDEIO::Job *job, const KURL &url);
188 
189  // TDEIO::ListJob
190  void slotEntries(TDEIO::Job *job, const TDEIO::UDSEntryList &entries);
191 
192  // TDEIO::TransferJob
193  void slotData(TDEIO::Job *job, const TQByteArray &data);
194  void slotDataReq(TDEIO::Job *job, TQByteArray &data);
195  void slotMimetype (TDEIO::Job *job, const TQString &type);
196  void slotCanResume (TDEIO::Job *job, TDEIO::filesize_t offset);
197 
198  // TDEIO::LocalURLJob
199  void slotLocalURL(TDEIO::LocalURLJob *, const KURL&, bool);
200 };
201 
202 }
203 
204 #endif
TDEIO::chmod
TDEIO_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
TDEIO::UDSEntry
TQValueList< UDSAtom > UDSEntry
An entry is the list of atoms containing all the information for a file or URL.
Definition: global.h:507
TDEIO::SlaveBase
There are two classes that specifies the protocol between application (job) and tdeioslave.
Definition: slavebase.h:45
TDEIO::filesize_t
TQ_ULLONG filesize_t
64-bit file size
Definition: global.h:39
TDEIO::del
TDEIO_EXPORT DeleteJob * del(const KURL &src, bool shred=false, bool showProgressInfo=true)
Delete a file or directory.
Definition: job.cpp:4421
TDEIO
A namespace for TDEIO globals.
Definition: authinfo.h:29
TDEIO::Job
The base class for all jobs.
Definition: jobclasses.h:67
TDEIO::copy
TDEIO_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:3921
TDEIO::localURL
TDEIO_EXPORT LocalURLJob * localURL(const KURL &remoteUrl)
Retrieve local URL if available.
Definition: job.cpp:841
TDEIO::ForwardingSlaveBase::processedURL
KURL processedURL() const
Return the URL being processed by the ioslave Only access it inside prepareUDSEntry() ...
Definition: forwardingslavebase.h:156
TDEIO::stat
TDEIO_EXPORT StatJob * stat(const KURL &url, bool showProgressInfo=true)
Find all details for one file or directory.
Definition: job.cpp:921
TDEIO::mimetype
TDEIO_EXPORT MimetypeJob * mimetype(const KURL &url, bool showProgressInfo=true)
Find mimetype for one file or directory.
Definition: job.cpp:1544
TDEIO::LocalURLJob
A TDEIO job that finds a local URL.
Definition: jobclasses.h:1865
TDEIO::ForwardingSlaveBase
This class should be used as a base for ioslaves acting as a forwarder to other ioslaves.
Definition: forwardingslavebase.h:88
TDEIO::SimpleJob
A simple job (one url and one command).
Definition: jobclasses.h:527
TDEIO::symlink
TDEIO_EXPORT SimpleJob * symlink(const TQString &target, const KURL &dest, bool overwrite, bool showProgressInfo=true)
Create or move a symlink.
Definition: job.cpp:779
TDEIO::ListJob
A ListJob is allows you to get the get the content of a directory.
Definition: jobclasses.h:1391
TDEIO::ForwardingSlaveBase::requestedURL
KURL requestedURL() const
Return the URL asked to the ioslave Only access it inside prepareUDSEntry()
Definition: forwardingslavebase.h:162
TDEIO::put
TDEIO_EXPORT TransferJob * put(const KURL &url, int permissions, bool overwrite, bool resume, bool showProgressInfo=true)
Put (a.k.a.
Definition: job.cpp:1415
TDEIO::rename
TDEIO_EXPORT SimpleJob * rename(const KURL &src, const KURL &dest, bool overwrite)
Rename a file or directory.
Definition: job.cpp:772
TDEIO::mkdir
TDEIO_EXPORT SimpleJob * mkdir(const KURL &url, int permissions=-1)
Creates a single directory.
Definition: job.cpp:751
TDEIO::listDir
TDEIO_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:2187
TDEIO::TransferJob
The transfer job pumps data into and/or out of a Slave.
Definition: jobclasses.h:874

tdeio/tdeio

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

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.8.8
This website is maintained by Timothy Pearson.