summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/file_layer.h
blob: cfa149e58c4225687908c9a4efe4692642297661 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef OPIE_FILE_LAYER_H
#define OPIE_FILE_LAYER_H

#include "io_layer.h"
#include <opie/oprocess.h>

class QFile;
/**
 * this is the layer for sending files
 */
class FileTransferLayer : public QObject {

    Q_OBJECT

public:
    /**
     *the io layer to be used
     */
    FileTransferLayer( IOLayer* );
    virtual ~FileTransferLayer();

public slots:
    /**
     * send a file over the layer
     */
    virtual void sendFile( const QString& file ) = 0;
    virtual void sendFile( const QFile& ) = 0;

private slots:
    void SzRecievedStdout(OProcess *, char *, int);
    void SzRecievedStderr(OProcess *, char *, int);
    void recievedStdin(QByteArray &);

signals:
    /**
     * sent the file
     */
    void sent();

    /**
     * an error occured
     */

    void error( int, const QString& );

    /*
     * 100 == done
     *
     */
    void progress( const QString& file, int progress );

protected:
    IOLayer* layer();

private:
    IOLayer* m_layer;
    OProcess *proc;

};

#endif