00001 #ifndef OPIE_FILE_TRANSFER_H 00002 #define OPIE_FILE_TRANSFER_H 00003 00004 #include <sys/types.h> 00005 00006 #include <opie2/oprocess.h> 00007 00008 #include <qfile.h> 00009 #include <qstringlist.h> 00010 00011 #include "file_layer.h" 00012 00013 class QSocketNotifier; 00014 class FileTransferControl; 00015 class FileTransfer : public FileTransferLayer{ 00016 Q_OBJECT 00017 friend class FileTransferControl; 00018 public: 00019 enum Type { 00020 SZ = 0, 00021 SX, 00022 SY 00023 }; 00024 FileTransfer( Type t, IOLayer* ); 00025 ~FileTransfer(); 00026 00027 void sendFile( const QString& file ); 00028 void sendFile( const QFile& ); 00029 void cancel(); 00030 00031 private slots: 00032 void setupChild(); 00033 void slotRead(); 00034 void slotProgress( const QStringList& ); 00035 void slotExec(); 00036 private: 00037 Type m_type; 00038 pid_t m_pid; 00039 int m_fd; 00040 int m_prog; 00041 int m_info[2]; 00042 int m_comm[2]; 00043 int m_term[2]; 00044 QString m_file; 00045 QSocketNotifier *m_not; 00046 QSocketNotifier* m_proc; 00047 }; 00048 00049 #endif
1.4.2