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

tdeio/tdeio

  • tdeio
  • tdeio
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 <tdeconfigbase.h>
25 #include <tdeio/global.h>
26 #include <tdeio/authinfo.h>
27 
28 class DCOPClient;
29 class KRemoteEncoding;
30 
31 namespace TDEIO {
32 
33 class Connection;
34 class SlaveBasePrivate;
35 
45 class TDEIO_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( TDEIO::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( TDEIO::filesize_t _bytes );
180  void processedSize( TDEIO::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  TDEConfigBase* 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 tdeio_file but also tdeio_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 
523  virtual void localURL( const KURL& remoteURL );
524 
528  int connectTimeout();
529 
533  int proxyConnectTimeout();
534 
539  int responseTimeout();
540 
545  int readTimeout();
546 
561  void setTimeoutSpecialCommand(int timeout, const TQByteArray &data=TQByteArray());
562 
566  static void sigsegv_handler(int);
570  static void sigpipe_handler(int);
571 
573  // Dispatching (internal)
575 
579  virtual bool dispatch();
583  virtual void dispatch( int command, const TQByteArray &data );
584 
593  int readData( TQByteArray &buffer );
594 
606  void listEntry( const UDSEntry& _entry, bool ready);
607 
612  void connectSlave(const TQString& path);
613  void disconnectSlave();
614 
664  bool openPassDlg( TDEIO::AuthInfo& info, const TQString &errorMsg );
665 
670  bool openPassDlg( TDEIO::AuthInfo& info );
671 
699  bool checkCachedAuthentication( AuthInfo& info );
700 
707  bool cacheAuthentication( const AuthInfo& info );
708 
713  bool pingCacheDaemon() const;
714 
721  TQString createAuthCacheKey( const KURL& url );
722 
730  void sendAuthenticationKey( const TQCString& gKey, const TQCString& key, bool keep );
731 
740  void delCachedAuthentication( const TQString& key );
741 
746  void setMultipleAuthCaching( bool ) {};
747 
752  bool multipleAuthCaching() const { return false; }
753 
772  bool requestNetwork(const TQString& host = TQString::null);
773 
787  void dropNetwork(const TQString& host = TQString::null);
788 
793  DCOPClient *dcopClient();
794 
799  int waitForAnswer( int expected1, int expected2, TQByteArray & data, int * pCmd = 0 );
800 
804  void sendMetaData();
805 
809  TQCString mProtocol;
810 
811  Connection * m_pConnection;
812 
813  MetaData mOutgoingMetaData;
814  MetaData mIncomingMetaData;
815 
822  bool wasKilled() const;
823 
828  void setKillFlag();
829 
830 protected:
831  UDSEntryList pendingListEntries;
832  uint listEntryCurrentSize;
833  long listEntry_sec, listEntry_usec;
834  Connection *appconn;
835  TQString mPoolSocket;
836  TQString mAppSocket;
837  bool mConnectedToApp;
838  static long s_seqNr;
839  virtual void virtual_hook( int id, void* data );
840 
841 private:
842  SlaveBasePrivate *d;
843 };
844 
845 }
846 
847 #endif

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
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.