-rw-r--r-- | core/obex/obexbase.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/core/obex/obexbase.h b/core/obex/obexbase.h new file mode 100644 index 0000000..f65d922 --- a/dev/null +++ b/core/obex/obexbase.h | |||
@@ -0,0 +1,99 @@ | |||
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 basic class for OBEX manipulating classes declaration | ||
30 | */ | ||
31 | #ifndef ObexBase_H | ||
32 | #define ObexBase_H | ||
33 | |||
34 | #include <qobject.h> | ||
35 | |||
36 | namespace Opie {namespace Core {class OProcess;}} | ||
37 | class QCopChannel; | ||
38 | namespace OpieObex { | ||
39 | class ObexBase : public QObject { | ||
40 | Q_OBJECT | ||
41 | public: | ||
42 | /** | ||
43 | * ObexBase constructor look | ||
44 | */ | ||
45 | ObexBase(QObject *parent, const char* name); | ||
46 | /** | ||
47 | * d'tor | ||
48 | */ | ||
49 | virtual ~ObexBase(); | ||
50 | /** | ||
51 | * Starting listening to an interface after enabled by the applet | ||
52 | * a signal gets emitted when received a file | ||
53 | */ | ||
54 | virtual void receive(); | ||
55 | /** | ||
56 | * Send the file | ||
57 | * @param the name of the file | ||
58 | * @param the address of the device | ||
59 | */ | ||
60 | virtual void send(const QString&, const QString&); | ||
61 | /** | ||
62 | * Stop receiving | ||
63 | * @param if true - does nothing if false - stops receiving | ||
64 | */ | ||
65 | virtual void setReceiveEnabled(bool = false); | ||
66 | signals: | ||
67 | /** | ||
68 | * Notify the upper level that we have received the file | ||
69 | * @param path The path to the received file | ||
70 | */ | ||
71 | void receivedFile(const QString& path); | ||
72 | /** | ||
73 | * error signal if the program couldn't be started or the | ||
74 | * the connection timed out | ||
75 | */ | ||
76 | void error(int); | ||
77 | /** | ||
78 | * The current try to receive data | ||
79 | */ | ||
80 | void currentTry(unsigned int); | ||
81 | /** | ||
82 | * signal sent The file got beamed to the remote location | ||
83 | */ | ||
84 | void sent(bool); | ||
85 | void done(bool); | ||
86 | protected: | ||
87 | uint m_count; | ||
88 | QString m_file; | ||
89 | QString m_outp; | ||
90 | QString m_bdaddr; | ||
91 | bool m_receive : 1; | ||
92 | protected slots: | ||
93 | virtual void slotError(); | ||
94 | }; | ||
95 | }; | ||
96 | |||
97 | #endif | ||
98 | //eof | ||
99 | |||