-rw-r--r-- | core/obex/btobex.h | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/core/obex/btobex.h b/core/obex/btobex.h index 9c1ab70..7e91c06 100644 --- a/core/obex/btobex.h +++ b/core/obex/btobex.h | |||
@@ -1,90 +1,118 @@ | |||
1 | /* | ||
2 | =. This file is part of the OPIE Project | ||
3 | .=l. Copyright (c) 2002 Maximilian Reiss <max.reiss@gmx.de> | ||
4 | .>+-= | ||
5 | _;:, .> :=|. This library is free software; you can | ||
6 | .> <, > . <= redistribute it and/or modify it under | ||
7 | :=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
8 | .="- .-=="i, .._ License as published by the Free Software | ||
9 | - . .-<_> .<> Foundation; version 2 of the License. | ||
10 | ._= =} : | ||
11 | .%+i> _;_. | ||
12 | .i_,=:_. -<s. This library is distributed in the hope that | ||
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
14 | : .. .:, . . . without even the implied warranty of | ||
15 | =_ + =;=| MERCHANTABILITY or FITNESS FOR A | ||
16 | _.=:. : :=>: PARTICULAR PURPOSE. See the GNU | ||
17 | ..}^=.= = ; Library General Public License for more | ||
18 | ++= -. . .: details. | ||
19 | : = ...= . :.=- | ||
20 | -. .:....=;==+<; You should have received a copy of the GNU | ||
21 | -_. . . )=. = Library General Public License along with | ||
22 | -- :-= this library; see the file COPYING.LIB. | ||
23 | If not, write to the Free Software Foundation, | ||
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | |||
27 | */ | ||
28 | /* | ||
29 | * The Bluetooth OBEX manipulating class declaration | ||
30 | */ | ||
1 | 31 | ||
2 | 32 | ||
3 | #ifndef OpieBtObex_H | 33 | #ifndef OpieBtObex_H |
4 | #define OpieBtObex_H | 34 | #define OpieBtObex_H |
5 | 35 | ||
36 | #include "obexbase.h" | ||
6 | #include <qobject.h> | 37 | #include <qobject.h> |
7 | #include <services.h> | 38 | #include <services.h> |
8 | #include <manager.h> | 39 | #include <manager.h> |
9 | #include <obexpush.h> | 40 | #include <obexpush.h> |
41 | #include "obexserver.h" | ||
10 | 42 | ||
11 | namespace Opie {namespace Core {class OProcess;}} | 43 | namespace Opie {namespace Core {class OProcess;}} |
12 | class QCopChannel; | 44 | class QCopChannel; |
13 | using namespace OpieTooth; | 45 | using namespace OpieTooth; |
14 | namespace OpieObex { | 46 | namespace OpieObex { |
15 | // Maybe this should be derved from Obex. | 47 | // Maybe this should be derved from Obex. |
16 | class BtObex : public QObject { | 48 | class BtObex : public ObexBase { |
17 | Q_OBJECT | 49 | Q_OBJECT |
18 | public: | 50 | public: |
19 | /** | 51 | /** |
20 | * BtObex c'tor look | 52 | * BtObex c'tor look |
21 | */ | 53 | */ |
22 | BtObex( QObject *parent, const char* name); | 54 | BtObex( QObject *parent, const char* name); |
23 | /** | 55 | /** |
24 | * d'tor | 56 | * d'tor |
25 | */ | 57 | */ |
26 | ~BtObex(); | 58 | ~BtObex(); |
27 | 59 | ||
28 | /** TODO mbhaynie -- Maybe opd would be a better way to receive. | 60 | /** TODO mbhaynie -- Maybe opd would be a better way to receive. |
29 | * Starting listening to Bluetooth after enabled by the applet | 61 | * Starting listening to Bluetooth after enabled by the applet |
30 | * a signal gets emitted when received a file | 62 | * a signal gets emitted when received a file |
31 | */ | 63 | */ |
32 | void receive(); | 64 | void receive(); |
33 | void send( const QString&, const QString& ); | 65 | void send( const QString&, const QString& ); |
34 | void setReceiveEnabled( bool = false ); | 66 | void setReceiveEnabled( bool = false ); |
35 | signals: | 67 | signals: |
36 | 68 | ||
37 | /** | 69 | /** |
38 | * a signal | 70 | * a signal |
39 | * @param path The path to the received file | 71 | * @param path The path to the received file |
40 | */ | 72 | */ |
41 | void receivedFile( const QString& path); | 73 | void receivedFile( const QString& path); |
42 | /** | 74 | /** |
43 | * error signal if the program couldn't be started or the | 75 | * error signal if the program couldn't be started or the |
44 | * the connection timed out | 76 | * the connection timed out |
45 | */ | 77 | */ |
46 | void error( int ); | 78 | void error( int ); |
47 | /** | 79 | /** |
48 | * The current try to receive data | 80 | * The current try to receive data |
49 | */ | 81 | */ |
50 | void currentTry(unsigned int); | 82 | void currentTry(unsigned int); |
51 | /** | 83 | /** |
52 | * signal sent The file got beamed to the remote location | 84 | * signal sent The file got beamed to the remote location |
53 | */ | 85 | */ |
54 | void sent(bool); | 86 | void sent(bool); |
55 | void done(bool); | 87 | void done(bool); |
56 | 88 | ||
57 | private: | 89 | private: |
58 | uint m_count; | ||
59 | QString m_file; | ||
60 | QString m_outp; | ||
61 | QString m_bdaddr; | ||
62 | int m_port; | 90 | int m_port; |
63 | ObexPush* m_send; | 91 | ObexPush* m_send; |
64 | Opie::Core::OProcess *m_rec; | ||
65 | bool m_receive : 1; | 92 | bool m_receive : 1; |
66 | OpieTooth::Manager* btManager; | 93 | OpieTooth::Manager* btManager; |
67 | void shutDownReceive(); | 94 | void shutDownReceive(); |
95 | ObexServer* m_rec; | ||
68 | 96 | ||
69 | private slots: | 97 | private slots: |
70 | 98 | ||
71 | // Push process slots | 99 | // Push process slots |
72 | void slotPushStatus(QCString&); | 100 | void slotPushStatus(QCString&); |
73 | void slotPushComplete(int); | 101 | void slotPushComplete(int); |
74 | void slotPushError(int); | 102 | void slotPushError(int); |
75 | 103 | ||
76 | // the process exited | 104 | // the process exited |
77 | void slotExited(Opie::Core::OProcess*) ; | 105 | void slotExited(Opie::Core::OProcess*) ; |
78 | void slotStdOut(Opie::Core::OProcess*, char*, int); | 106 | void slotStdOut(Opie::Core::OProcess*, char*, int); |
79 | void slotError(); | 107 | void slotError(); |
80 | void slotFoundServices(const QString&, Services::ValueList); | 108 | void slotFoundServices(const QString&, Services::ValueList); |
81 | 109 | ||
82 | private: | 110 | private: |
83 | void sendNow(); | 111 | void sendNow(); |
84 | QString parseOut(); | 112 | QString parseOut(); |
85 | void received(); | 113 | void received(); |
86 | }; | 114 | }; |
87 | }; | 115 | }; |
88 | 116 | ||
89 | 117 | ||
90 | #endif | 118 | #endif |