summaryrefslogtreecommitdiff
path: root/core/obex/receiver.h
blob: a10ea135b84d854092d77813a39e5a6178f658fd (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
62
63
64
#ifndef OPIE_OBEX_RECEIVER_H
#define OPIE_OBEX_RECEIVER_H

#include <qobject.h>
#include <qvbox.h>
#include <qstring.h>

//Receiver type
typedef enum _RecType {
    REC_IRDA = 0, 
    REC_BLUETOOTH = 1
} RecType;

class QLabel;
class QTextView;
namespace OpieObex {
    class ObexBase;
    class OtherHandler;
    class Receiver : public QObject {
        Q_OBJECT
    public:
        enum { Datebook , AddressBook, Other };
        Receiver(RecType type);
        ~Receiver();

    private:
        void handleAddr(const QString& );
        void handleDateTodo(const QString& );
        void handleOther(const QString& );
        /* will alter the file name */
        int checkFile( QString& file );
        bool testDateTodo(const QString& file);
        bool testAddressbook(const QString& file);
        /* called by checkFile */
        void tidyUp( QString& file, const QString& ending );

    private slots:
        void slotReceived( const QString& );

    private:
        ObexBase* m_obex; //IR obex
    };

    class OtherHandler : public QVBox {
        Q_OBJECT
    public:
        OtherHandler();
        ~OtherHandler();

        void handle( const QString& file );
    private slots:
        void accept();
        void deny();
    private:
        QString targetName( const QString& file );
        void copy( const QString& src, const QString& dest );
        QLabel* m_na;
        QTextView* m_view;
        QString m_file;
    };
}


#endif