summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/lib/obexpush.h
blob: 81476436ad94acba95834d883dd70d7d35c8400a (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
65
66
67
68
69
70
71
72
73
74
75
76
77
/* $Id$ */
/* OBEX push functions declarations */
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
#ifndef _OBEXPUSH_H_
#define _OBEXPUSH_H_
#include <qobject.h>
#include <qstring.h>
#include "services.h"
#include <opie2/oprocess.h>
namespace OpieTooth {
    class ObexPush : public QObject {
        Q_OBJECT
    public:
        /**
         * Constructor which creates an object
         */
        ObexPush();
        
        /**
         * Public destructor
         */
        ~ObexPush();
        
        /**
         * Function that sends a file
         * @param mac destination device MAC address
         * @param port service port number
         * @param src source file name
         * @param dst destination file name
         * @return 0 on success, -1 on error, 1 if sending process is running
         */
        int send(QString& mac, int port, QString& src, QString& dst);

        /**
         * @return true if it's sending and false otherwise
         */
         bool isSending() { return pushProc->isRunning(); }
    signals:
        /**
         * Informs that the sending process has completed
         * @param status the finish status
         */
        void sendComplete(int);

        /**
         * Informs that the sending process has finished with error
         * @param status the finish status
         */
        void sendError(int);
        
        /**
         * Informs that we have a string status update
         * @param str status string
         */
        void status(QCString&);
    protected slots:
        void slotPushOut(Opie::Core::OProcess*, char*, int);
        void slotPushErr(Opie::Core::OProcess*, char*, int);
        void slotPushExited(Opie::Core::OProcess* proc);
    protected:
        /**
         * Function makes a notification from slotPushOut and slotPushErr
         */
        void notifyInfo(Opie::Core::OProcess*, char*, int);
    protected:
        Opie::Core::OProcess* pushProc; //The push process
    };
};
#endif
//eof