00001 #ifndef OPIE_RECEIVE_LAYER_H
00002 #define OPIE_RECEIVE_LAYER_H
00003
00004 #include <qobject.h>
00005
00013 class IOLayer;
00014 class ReceiveLayer : public QObject {
00015 Q_OBJECT
00016 public:
00022 enum Mode {
00023 Ascii = 0l,
00024 Binary
00025 };
00026
00032 enum Features {
00033 Append = 0,
00034 AllowRemoteCommands = 1,
00035 WriteToNull = 2,
00036 Escape = 4,
00037 Rename = 8,
00038 OpenSync = 16,
00039 ProtectExisting = 32,
00040 Resume = 64,
00041 KeepUppercase = 128,
00042 DisableRestrict = 256,
00043 Restricted = 512,
00044 Overwrite = 1024
00045 };
00046
00050 enum Error {
00051 Unknown = 0,
00052 StartError
00053 };
00054
00061 ReceiveLayer( IOLayer* lay, const QString& startDir = QString::null );
00062 virtual ~ReceiveLayer();
00063
00064 public slots:
00069 virtual void receive() = 0;
00070
00075 virtual void receive( const QString& dir ) = 0;
00076
00080 virtual void receive( const QString& dir, Mode, Features );
00081
00085 virtual void cancel();
00086
00087 signals:
00093 void error(int, const QString& );
00094
00103 void progress( const QString& file, int progress, int speed, int hour, int min, int seconds );
00104
00108 void received( const QString& file );
00109
00110 protected:
00111 QString m_curDir;
00112 IOLayer* layer();
00113
00114 QString currentDir()const;
00115 void changeDir( const QString& );
00116 private:
00117 IOLayer* m_layer;
00118
00119 };
00120
00121 #endif