Diffstat (limited to 'noncore/net/opietooth/lib/obexpush.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/lib/obexpush.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/noncore/net/opietooth/lib/obexpush.h b/noncore/net/opietooth/lib/obexpush.h new file mode 100644 index 0000000..8147643 --- a/dev/null +++ b/noncore/net/opietooth/lib/obexpush.h | |||
@@ -0,0 +1,77 @@ | |||
1 | /* $Id$ */ | ||
2 | /* OBEX push functions declarations */ | ||
3 | /*************************************************************************** | ||
4 | * * | ||
5 | * This program is free software; you can redistribute it and/or modify * | ||
6 | * it under the terms of the GNU General Public License as published by * | ||
7 | * the Free Software Foundation; either version 2 of the License, or * | ||
8 | * (at your option) any later version. * | ||
9 | * * | ||
10 | ***************************************************************************/ | ||
11 | #ifndef _OBEXPUSH_H_ | ||
12 | #define _OBEXPUSH_H_ | ||
13 | #include <qobject.h> | ||
14 | #include <qstring.h> | ||
15 | #include "services.h" | ||
16 | #include <opie2/oprocess.h> | ||
17 | namespace OpieTooth { | ||
18 | class ObexPush : public QObject { | ||
19 | Q_OBJECT | ||
20 | public: | ||
21 | /** | ||
22 | * Constructor which creates an object | ||
23 | */ | ||
24 | ObexPush(); | ||
25 | |||
26 | /** | ||
27 | * Public destructor | ||
28 | */ | ||
29 | ~ObexPush(); | ||
30 | |||
31 | /** | ||
32 | * Function that sends a file | ||
33 | * @param mac destination device MAC address | ||
34 | * @param port service port number | ||
35 | * @param src source file name | ||
36 | * @param dst destination file name | ||
37 | * @return 0 on success, -1 on error, 1 if sending process is running | ||
38 | */ | ||
39 | int send(QString& mac, int port, QString& src, QString& dst); | ||
40 | |||
41 | /** | ||
42 | * @return true if it's sending and false otherwise | ||
43 | */ | ||
44 | bool isSending() { return pushProc->isRunning(); } | ||
45 | signals: | ||
46 | /** | ||
47 | * Informs that the sending process has completed | ||
48 | * @param status the finish status | ||
49 | */ | ||
50 | void sendComplete(int); | ||
51 | |||
52 | /** | ||
53 | * Informs that the sending process has finished with error | ||
54 | * @param status the finish status | ||
55 | */ | ||
56 | void sendError(int); | ||
57 | |||
58 | /** | ||
59 | * Informs that we have a string status update | ||
60 | * @param str status string | ||
61 | */ | ||
62 | void status(QCString&); | ||
63 | protected slots: | ||
64 | void slotPushOut(Opie::Core::OProcess*, char*, int); | ||
65 | void slotPushErr(Opie::Core::OProcess*, char*, int); | ||
66 | void slotPushExited(Opie::Core::OProcess* proc); | ||
67 | protected: | ||
68 | /** | ||
69 | * Function makes a notification from slotPushOut and slotPushErr | ||
70 | */ | ||
71 | void notifyInfo(Opie::Core::OProcess*, char*, int); | ||
72 | protected: | ||
73 | Opie::Core::OProcess* pushProc; //The push process | ||
74 | }; | ||
75 | }; | ||
76 | #endif | ||
77 | //eof | ||