author | zecke <zecke> | 2002-10-12 01:37:00 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-12 01:37:00 (UTC) |
commit | ff012f0c23a01ed8443514a9f638e4c9d97bbf8d (patch) (side-by-side diff) | |
tree | 07c2046b32ea7af5c4d45ec0072cf7fd68fa8484 | |
parent | b256987cda5449e3abfd3bd4c2d0650530b5a562 (diff) | |
download | opie-ff012f0c23a01ed8443514a9f638e4c9d97bbf8d.zip opie-ff012f0c23a01ed8443514a9f638e4c9d97bbf8d.tar.gz opie-ff012f0c23a01ed8443514a9f638e4c9d97bbf8d.tar.bz2 |
Added a new sendFile method
We still need to talk about it
what I did was sz --help and
grpouped the things into Mode
Ascii/Binary
Features and BlockSize
First of all we need to decide if we want
such configurable filetransfers
And if yes I've to talk to josef how to do
that best.
Not every Protocol supports the values in the
file some support more some less.
I suggest MetaFactory and one more kind of a
'Plugin'
-rw-r--r-- | noncore/apps/opie-console/file_layer.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/file_layer.h b/noncore/apps/opie-console/file_layer.h index bf31540..edb30e1 100644 --- a/noncore/apps/opie-console/file_layer.h +++ b/noncore/apps/opie-console/file_layer.h @@ -1,69 +1,94 @@ #ifndef OPIE_FILE_LAYER_H #define OPIE_FILE_LAYER_H #include <qmap.h> #include "io_layer.h" class QFile; /** * this is the layer for sending files */ class FileTransferLayer : public QObject { Q_OBJECT public: enum Errors{ NotSupported, StartError, NoError, Unknown, Undefined, Incomplete }; + enum Features { + Append = 0, + Twostop = 1, + Escape = 2, + Rename = 4, + FullPath = 8, + SendIfNewer = 16, + SendIfLonger = 32, + Resume = 64 + + }; + enum Mode { + Ascii = 0, + Binary + }; + enum BlockSize { + Block_1k, + Block_4k, + Block_8k + }; /** *the io layer to be used */ FileTransferLayer( IOLayer* ); virtual ~FileTransferLayer(); public slots: + + virtual void sendFile( const QString& file, + Mode mode, BlockSize blk, + Features feat ) {}; + /** * send a file over the layer */ virtual void sendFile( const QString& file ) = 0; virtual void sendFile( const QFile& ) = 0; virtual void cancel() = 0; signals: /** * sent the file */ void sent(); /** * an error occured */ void error( int, const QString& ); /* * @param file The file to send * @param progress the progress made from 0-100 * @param speed Speed in bps * @param hours The hours it take to finish * @param minutes The minutes it takes to finish * @param send The seconds... * */ void progress( const QString& file, int progress, int speed, int hours, int minutes, int seconds ); protected: IOLayer* layer(); private: IOLayer* m_layer; }; #endif |