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

kio/kio

  • kio
  • kio
slavebase.h
1 /*
2  Copyright (C) 2000 David Faure <faure@kde.org>
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 __slavebase_h
21 #define __slavebase_h
22 
23 #include <kurl.h>
24 #include <kconfigbase.h>
25 #include <kio/global.h>
26 #include <kio/authinfo.h>
27 
28 class DCOPClient;
29 class KRemoteEncoding;
30 
31 namespace KIO {
32 
33 class Connection;
34 class SlaveBasePrivate;
35 
45 class KIO_EXPORT SlaveBase
46 {
47 public:
48  SlaveBase( const TQCString &protocol, const TQCString &pool_socket, const TQCString &app_socket);
49  virtual ~SlaveBase();
50 
55  void exit();
56 
60  void dispatchLoop();
61 
65  void setConnection( Connection* connection ) { m_pConnection = connection; }
69  Connection *connection() const { return m_pConnection; }
70 
71 
73  // Message Signals to send to the job
75 
84  void data( const TQByteArray &data );
85 
90  void dataReq( );
91 
109  void error( int _errid, const TQString &_text );
110 
114  void connected();
115 
120  void finished();
121 
125  void needSubURLData();
126 
133  void slaveStatus(const TQString &host, bool connected);
134 
141  void statEntry( const UDSEntry& _entry );
142 
148  void listEntries( const UDSEntryList& _entry );
149 
157  bool canResume( KIO::filesize_t offset );
158 
159  /*
160  * Call this at the beginning of get(), if the "resume" metadata was set
161  * and resuming is implemented by this protocol.
162  */
163  void canResume();
164 
166  // Info Signals to send to the job
168 
174  void totalSize( KIO::filesize_t _bytes );
180  void processedSize( KIO::filesize_t _bytes );
181 
193  void processedPercent( float percent );
194 
200  void speed( unsigned long _bytes_per_second );
201 
206  void redirection( const KURL &_url );
207 
213  void errorPage();
214 
219  void mimeType( const TQString &_type );
220 
224  void warning( const TQString &msg );
225 
230  void infoMessage( const TQString &msg );
231 
232  enum MessageBoxType { QuestionYesNo = 1, WarningYesNo = 2, WarningContinueCancel = 3, WarningYesNoCancel = 4, Information = 5, SSLMessageBox = 6 };
233 
247  int messageBox( MessageBoxType type, const TQString &text,
248  const TQString &caption = TQString::null,
249  const TQString &buttonYes = TQString::null,
250  const TQString &buttonNo = TQString::null );
251 
268  int messageBox( const TQString &text, MessageBoxType type,
269  const TQString &caption = TQString::null,
270  const TQString &buttonYes = TQString::null,
271  const TQString &buttonNo = TQString::null,
272  const TQString &dontAskAgainName = TQString::null );
273 
278  void setMetaData(const TQString &key, const TQString &value);
279 
285  bool hasMetaData(const TQString &key) const;
286 
291  TQString metaData(const TQString &key) const;
292 
298  bool hasMetaData(const TQString &key);
299 
304  TQString metaData(const TQString &key);
305 
311  MetaData allMetaData() const { return mIncomingMetaData; }
312 
320  KConfigBase* config();
321 
328  KRemoteEncoding* remoteEncoding();
329 
330 
332  // Commands sent by the job, the slave has to
333  // override what it wants to implement
335 
347  virtual void setHost(const TQString& host, int port, const TQString& user, const TQString& pass);
348 
352  virtual void setSubURL(const KURL&url);
353 
363  virtual void openConnection();
364 
373  virtual void closeConnection();
374 
381  virtual void get( const KURL& url );
382 
398  virtual void put( const KURL& url, int permissions, bool overwrite, bool resume );
399 
405  virtual void stat( const KURL& url );
406 
419  virtual void mimetype( const KURL& url );
420 
428  virtual void listDir( const KURL& url );
429 
437  virtual void mkdir( const KURL&url, int permissions );
438 
447  virtual void rename( const KURL& src, const KURL& dest, bool overwrite );
448 
456  virtual void symlink( const TQString& target, const KURL& dest, bool overwrite );
457 
462  virtual void chmod( const KURL& url, int permissions );
463 
474  virtual void copy( const KURL &src, const KURL &dest, int permissions, bool overwrite );
475 
482  virtual void del( const KURL &url, bool isfile);
483 
484  // TODO KDE4: add setLinkDest() or something, to modify symlink targets.
485  // Will be used for kio_file but also kio_remote (#97129)
486 
495  virtual void special( const TQByteArray & data );
496 
504  virtual void multiGet( const TQByteArray & data );
505 
510  virtual void slave_status();
511 
516  virtual void reparseConfiguration();
517 
518 
522  int connectTimeout();
523 
527  int proxyConnectTimeout();
528 
533  int responseTimeout();
534 
539  int readTimeout();
540 
555  void setTimeoutSpecialCommand(int timeout, const TQByteArray &data=TQByteArray());
556 
560  static void sigsegv_handler(int);
564  static void sigpipe_handler(int);
565 
567  // Dispatching (internal)
569 
573  virtual bool dispatch();
577  virtual void dispatch( int command, const TQByteArray &data );
578 
587  int readData( TQByteArray &buffer );
588 
600  void listEntry( const UDSEntry& _entry, bool ready);
601 
606  void connectSlave(const TQString& path);
607  void disconnectSlave();
608 
658  bool openPassDlg( KIO::AuthInfo& info, const TQString &errorMsg );
659 
664  bool openPassDlg( KIO::AuthInfo& info );
665 
693  bool checkCachedAuthentication( AuthInfo& info );
694 
701  bool cacheAuthentication( const AuthInfo& info );
702 
707  bool pingCacheDaemon() const;
708 
715  TQString createAuthCacheKey( const KURL& url );
716 
724  void sendAuthenticationKey( const TQCString& gKey, const TQCString& key, bool keep );
725 
734  void delCachedAuthentication( const TQString& key );
735 
740  void setMultipleAuthCaching( bool ) {};
741 
746  bool multipleAuthCaching() const { return false; }
747 
766  bool requestNetwork(const TQString& host = TQString::null);
767 
781  void dropNetwork(const TQString& host = TQString::null);
782 
787  DCOPClient *dcopClient();
788 
793  int waitForAnswer( int expected1, int expected2, TQByteArray & data, int * pCmd = 0 );
794 
798  void sendMetaData();
799 
803  TQCString mProtocol;
804 
805  Connection * m_pConnection;
806 
807  MetaData mOutgoingMetaData;
808  MetaData mIncomingMetaData;
809 
816  bool wasKilled() const;
817 
822  void setKillFlag();
823 
824 protected:
825  UDSEntryList pendingListEntries;
826  uint listEntryCurrentSize;
827  long listEntry_sec, listEntry_usec;
828  Connection *appconn;
829  TQString mPoolSocket;
830  TQString mAppSocket;
831  bool mConnectedToApp;
832  static long s_seqNr;
833  virtual void virtual_hook( int id, void* data );
834 
835 private:
836  SlaveBasePrivate *d;
837 };
838 
839 }
840 
841 #endif
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::SlaveBase::setMultipleAuthCaching
void setMultipleAuthCaching(bool)
Definition: slavebase.h:740
KIO
A namespace for KIO globals.
Definition: authinfo.h:29
KRemoteEncoding
Allows encoding and decoding properly remote filenames into Unicode.
Definition: kremoteencoding.h:44
KIO::AuthInfo
This class is intended to make it easier to prompt for, cache and retrieve authorization information...
Definition: authinfo.h:51
KIO::MetaData
MetaData is a simple map of key/value strings.
Definition: global.h:514
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::mimetype
KIO_EXPORT MimetypeJob * mimetype(const KURL &url, bool showProgressInfo=true)
Find mimetype for one file or directory.
Definition: job.cpp:1509
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::special
KIO_EXPORT SimpleJob * special(const KURL &url, const TQByteArray &data, bool showProgressInfo=true)
Execute any command that is specific to one slave (protocol).
Definition: job.cpp:786
KIO::SlaveBase
There are two classes that specifies the protocol between application (job) and kioslave.
Definition: slavebase.h:45
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::Connection
This class provides a simple means for IPC between two applications via a pipe.
Definition: connection.h:49
KIO::SlaveBase::multipleAuthCaching
bool multipleAuthCaching() const
Definition: slavebase.h:746
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::rename
KIO_EXPORT SimpleJob * rename(const KURL &src, const KURL &dest, bool overwrite)
Rename a file or directory.
Definition: job.cpp:772
KIO::filesize_t
TQ_ULLONG filesize_t
64-bit file size
Definition: global.h:39
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::del
KIO_EXPORT DeleteJob * del(const KURL &src, bool shred=false, bool showProgressInfo=true)
Delete a file or directory.
Definition: job.cpp:4386
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::SlaveBase::mProtocol
TQCString mProtocol
Name of the protocol supported by this slave.
Definition: slavebase.h:803
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.8.13
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |