summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/filetransfer.h
blob: 3b79cda0fe010e149cf2b0f13f05a7bef549ae7c (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
#ifndef OPIE_FILE_TRANSFER_H
#define OPIE_FILE_TRANSFER_H

#include <sys/types.h>

#include <opie2/oprocess.h>

#include <qfile.h>
#include <qstringlist.h>

#include "file_layer.h"

class QSocketNotifier;
class FileTransferControl;
class FileTransfer : public FileTransferLayer{
    Q_OBJECT
    friend class FileTransferControl;
public:
    enum Type {
        SZ = 0,
        SX,
        SY
    };
    FileTransfer( Type t, IOLayer* );
    ~FileTransfer();

    void sendFile( const QString& file );
    void sendFile( const QFile& );
    void cancel();

private slots:
    void setupChild();
    void slotRead();
    void slotProgress( const QStringList& );
    void slotExec();
private:
    Type m_type;
    pid_t m_pid;
    int m_fd;
    int m_prog;
    int m_info[2];
    int m_comm[2];
    int m_term[2];
    QString m_file;
    QSocketNotifier *m_not;
    QSocketNotifier* m_proc;
};

#endif