home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / include / qftp.h < prev    next >
C/C++ Source or Header  |  2001-10-11  |  3KB  |  111 lines

  1. /****************************************************************************
  2. ** $Id:  qt/qftp.h   3.0.0   edited Sep 3 16:56 $
  3. **
  4. ** Definition of QFtp class.
  5. **
  6. ** Created : 970521
  7. **
  8. ** Copyright (C) 1997-2000 Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of the network module of the Qt GUI Toolkit.
  11. **
  12. ** This file may be distributed under the terms of the Q Public License
  13. ** as defined by Trolltech AS of Norway and appearing in the file
  14. ** LICENSE.QPL included in the packaging of this file.
  15. **
  16. ** This file may be distributed and/or modified under the terms of the
  17. ** GNU General Public License version 2 as published by the Free Software
  18. ** Foundation and appearing in the file LICENSE.GPL included in the
  19. ** packaging of this file.
  20. **
  21. ** Licensees holding valid Qt Enterprise Edition licenses may use this
  22. ** file in accordance with the Qt Commercial License Agreement provided
  23. ** with the Software.
  24. **
  25. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  26. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  27. **
  28. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
  29. **   information about Qt Commercial License Agreements.
  30. ** See http://www.trolltech.com/qpl/ for QPL licensing information.
  31. ** See http://www.trolltech.com/gpl/ for GPL licensing information.
  32. **
  33. ** Contact info@trolltech.com if any conditions of this licensing are
  34. ** not clear to you.
  35. **
  36. **********************************************************************/
  37.  
  38. #ifndef QFTP_H
  39. #define QFTP_H
  40.  
  41. #ifndef QT_H
  42. #include "qstring.h" // char*->QString conversion
  43. #include "qurlinfo.h"
  44. #include "qnetworkprotocol.h"
  45. #endif // QT_H
  46.  
  47. #if !defined( QT_MODULE_NETWORK ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_NETWORK )
  48. #define QM_EXPORT_FTP
  49. #else
  50. #define QM_EXPORT_FTP Q_EXPORT
  51. #endif
  52.  
  53. #ifndef QT_NO_NETWORKPROTOCOL_FTP
  54.  
  55.  
  56. class QSocket;
  57.  
  58.  
  59. class QM_EXPORT_FTP QFtp : public QNetworkProtocol
  60. {
  61.     Q_OBJECT
  62.  
  63. public:
  64.     QFtp();
  65.     virtual ~QFtp();
  66.     int supportedOperations() const;
  67.  
  68. protected:
  69.     void parseDir( const QString &buffer, QUrlInfo &info );
  70.     void operationListChildren( QNetworkOperation *op );
  71.     void operationMkDir( QNetworkOperation *op );
  72.     void operationRemove( QNetworkOperation *op );
  73.     void operationRename( QNetworkOperation *op );
  74.     void operationGet( QNetworkOperation *op );
  75.     void operationPut( QNetworkOperation *op );
  76.  
  77.     QSocket *commandSocket, *dataSocket;
  78.     bool connectionReady, passiveMode;
  79.     int getTotalSize, getDoneSize;
  80.     bool startGetOnFail;
  81.     int putToWrite, putWritten;
  82.     bool errorInListChildren;
  83.  
  84. private:
  85.     bool checkConnection( QNetworkOperation *op );
  86.     void close();
  87.     void reinitCommandSocket();
  88.     void okButTryLater( int code, const QCString &data );
  89.     void okGoOn( int code, const QCString &data );
  90.     void okButNeedMoreInfo( int code, const QCString &data );
  91.     void errorForNow( int code, const QCString &data );
  92.     void errorForgetIt( int code, const QCString &data );
  93.  
  94. protected slots:
  95.     void hostFound();
  96.     void connected();
  97.     void closed();
  98.     void readyRead();
  99.     void dataHostFound();
  100.     void dataConnected();
  101.     void dataClosed();
  102.     void dataReadyRead();
  103.     void dataBytesWritten( int nbytes );
  104.     void error( int );
  105.  
  106. };
  107.  
  108. #endif // QT_NO_NETWORKPROTOCOL_FTP
  109.  
  110. #endif // QFTP_H
  111.