00001 #ifndef OPIE_FILE_LAYER_H
00002 #define OPIE_FILE_LAYER_H
00003
00004 #include <qmap.h>
00005
00006 #include "io_layer.h"
00007
00008 class QFile;
00012 class FileTransferLayer : public QObject {
00013 Q_OBJECT
00014
00015 public:
00016 enum Errors{
00017 NotSupported,
00018 StartError,
00019 NoError,
00020 Unknown,
00021 Undefined,
00022 Incomplete
00023 };
00024 enum Features {
00025 Append = 0,
00026 Twostop = 1,
00027 Escape = 2,
00028 Rename = 4,
00029 FullPath = 8,
00030 SendIfNewer = 16,
00031 SendIfLonger = 32,
00032 Resume = 64
00033
00034 };
00035 enum Mode {
00036 Ascii = 0,
00037 Binary
00038 };
00039 enum BlockSize {
00040 Block_1k,
00041 Block_4k,
00042 Block_8k
00043 };
00047 FileTransferLayer( IOLayer* );
00048 virtual ~FileTransferLayer();
00049
00050 public slots:
00051
00052 virtual void sendFile( const QString&,
00053 Mode, BlockSize,
00054 Features ) {};
00055
00059 virtual void sendFile( const QString& file ) = 0;
00060 virtual void sendFile( const QFile& ) = 0;
00061 virtual void cancel() = 0;
00062
00063 signals:
00067 void sent();
00068
00073 void error( int, const QString& );
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 void progress( const QString& file, int progress, int speed, int hours, int minutes, int seconds );
00085
00086 protected:
00087 IOLayer* layer();
00088
00089 private:
00090 IOLayer* m_layer;
00091
00092 };
00093
00094 #endif