author | zecke <zecke> | 2002-10-13 15:31:12 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-13 15:31:12 (UTC) |
commit | 6a9726437a59cf3b18bf57d6e20fb2dfaaa2fc34 (patch) (unidiff) | |
tree | 14fa6710ef6d80fa213250a97f13253eb88a80cd /noncore/apps/opie-console/receive_layer.h | |
parent | 5db679753dac04095a2fa4b03297785ed4ba4030 (diff) | |
download | opie-6a9726437a59cf3b18bf57d6e20fb2dfaaa2fc34.zip opie-6a9726437a59cf3b18bf57d6e20fb2dfaaa2fc34.tar.gz opie-6a9726437a59cf3b18bf57d6e20fb2dfaaa2fc34.tar.bz2 |
Move some stuff in filetransfer around
make pid == 0 after a finished process.
Introduce the FileReceive class
it does not parse progress though
Diffstat (limited to 'noncore/apps/opie-console/receive_layer.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/receive_layer.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/noncore/apps/opie-console/receive_layer.h b/noncore/apps/opie-console/receive_layer.h index 0cfe16d..157c7e5 100644 --- a/noncore/apps/opie-console/receive_layer.h +++ b/noncore/apps/opie-console/receive_layer.h | |||
@@ -24,90 +24,98 @@ public: | |||
24 | Binary | 24 | Binary |
25 | }; | 25 | }; |
26 | 26 | ||
27 | /** | 27 | /** |
28 | * What features to use | 28 | * What features to use |
29 | * DISCUSS IT!!!! | 29 | * DISCUSS IT!!!! |
30 | * see rz --help for more info | 30 | * see rz --help for more info |
31 | */ | 31 | */ |
32 | enum Features { | 32 | enum Features { |
33 | Append = 0, | 33 | Append = 0, |
34 | AllowRemoteCommands = 1, | 34 | AllowRemoteCommands = 1, |
35 | WriteToNull = 2, | 35 | WriteToNull = 2, |
36 | Escape = 4, | 36 | Escape = 4, |
37 | Rename = 8, | 37 | Rename = 8, |
38 | OpenSync = 16, | 38 | OpenSync = 16, |
39 | ProtectExisting = 32, | 39 | ProtectExisting = 32, |
40 | Resume = 64, | 40 | Resume = 64, |
41 | KeepUppercase = 128, | 41 | KeepUppercase = 128, |
42 | DisableRestrict = 256, | 42 | DisableRestrict = 256, |
43 | Restricted = 512, | 43 | Restricted = 512, |
44 | Overwrite = 1024 | 44 | Overwrite = 1024 |
45 | }; | 45 | }; |
46 | 46 | ||
47 | /** | 47 | /** |
48 | * which protocol to use? | 48 | * Error codes |
49 | */ | 49 | */ |
50 | enum Type{ | 50 | enum Error { |
51 | SZ = 0, | 51 | Unknown = 0, |
52 | SX, | 52 | StartError |
53 | SY | ||
54 | }; | 53 | }; |
55 | 54 | ||
56 | /** | 55 | /** |
57 | * C'tor constructs an new Object | 56 | * C'tor constructs an new Object |
58 | * @param lay The Layer to be used | 57 | * @param lay The Layer to be used |
59 | * @param t The Type | 58 | * @param t The Type |
60 | * @param startDir In which dir should files be received? | 59 | * @param startDir In which dir should files be received? |
61 | */ | 60 | */ |
62 | ReceiveLayer( IOLayer* lay, Type t, const QString& startDir = QString::null ); | 61 | ReceiveLayer( IOLayer* lay, const QString& startDir = QString::null ); |
63 | virtual ~ReceiveLayer(); | 62 | virtual ~ReceiveLayer(); |
64 | 63 | ||
65 | public slots: | 64 | public slots: |
66 | /** | 65 | /** |
67 | * start receiving in current dir | 66 | * start receiving in current dir |
68 | * with protocol from the c'tor | 67 | * with protocol from the c'tor |
69 | */ | 68 | */ |
70 | virtual void receive() = 0; | 69 | virtual void receive() = 0; |
71 | 70 | ||
72 | /** | 71 | /** |
73 | * start to receive in dir with type | 72 | * start to receive in dir with type |
74 | * from the c'tor | 73 | * from the c'tor |
75 | */ | 74 | */ |
76 | virtual void receive( const QString& dir ) = 0; | 75 | virtual void receive( const QString& dir ) = 0; |
77 | 76 | ||
78 | /** | 77 | /** |
79 | * advanced method with features and Mode | 78 | * advanced method with features and Mode |
80 | */ | 79 | */ |
81 | virtual void receive( const QString& dir, Mode, Features ) {} | 80 | virtual void receive( const QString& dir, Mode, Features ); |
82 | 81 | ||
83 | /** | 82 | /** |
84 | * cancel receive | 83 | * cancel receive |
85 | */ | 84 | */ |
86 | virtual void cancel(); | 85 | virtual void cancel(); |
87 | 86 | ||
88 | signals: | 87 | signals: |
89 | /** | 88 | /** |
90 | * error happend | 89 | * error happend |
91 | * error code as int | 90 | * error code as int |
92 | * and a QString for UI translated string | 91 | * and a QString for UI translated string |
93 | */ | 92 | */ |
94 | void error(int, const QString& ); | 93 | void error(int, const QString& ); |
95 | 94 | ||
96 | /** | 95 | /** |
97 | * progress | 96 | * progress |
98 | * @param file The completed path to the file which is received | 97 | * @param file The completed path to the file which is received |
99 | * @param speed the speed in bps | 98 | * @param speed the speed in bps |
100 | * @param hour The hours remaining | 99 | * @param hour The hours remaining |
101 | * @param minutes The miniutes remaining | 100 | * @param minutes The miniutes remaining |
102 | * @param seconds The seconds remaining | 101 | * @param seconds The seconds remaining |
103 | */ | 102 | */ |
104 | void progress( const QString& file, int progress, int speed, int hour, int min, int seconds ); | 103 | void progress( const QString& file, int progress, int speed, int hour, int min, int seconds ); |
105 | 104 | ||
106 | /** | 105 | /** |
107 | * completely received a file | 106 | * completely received a file |
108 | */ | 107 | */ |
109 | void received( const QString& file ); | 108 | void received( const QString& file ); |
110 | 109 | ||
110 | protected: | ||
111 | QString m_curDir; | ||
112 | IOLayer* layer(); | ||
113 | /* from a variable set from the outside */ | ||
114 | QString currentDir()const; | ||
115 | void changeDir( const QString& ); | ||
116 | private: | ||
117 | IOLayer* m_layer; | ||
118 | |||
111 | }; | 119 | }; |
112 | 120 | ||
113 | #endif | 121 | #endif |