-rw-r--r-- | core/obex/obexsend.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/core/obex/obexsend.h b/core/obex/obexsend.h new file mode 100644 index 0000000..fd819bc --- a/dev/null +++ b/core/obex/obexsend.h | |||
@@ -0,0 +1,99 @@ | |||
1 | #ifndef OPIE_OBEX_SEND_WIDGET_H | ||
2 | #define OPIE_OBEX_SEND_WIDGET_H | ||
3 | |||
4 | #include <qstring.h> | ||
5 | #include <qstringlist.h> | ||
6 | #include <qwidget.h> | ||
7 | #include <qvbox.h> | ||
8 | #include <qmap.h> | ||
9 | #include <qtextbrowser.h> | ||
10 | |||
11 | class QLabel; | ||
12 | class QVBoxLayout; | ||
13 | /** | ||
14 | * This is the new sending widget for Obex | ||
15 | * It will attemp to smart and be able to send | ||
16 | * it to multiple devices. | ||
17 | * It'll support BT + IrDa | ||
18 | */ | ||
19 | namespace OpieObex { | ||
20 | class DeviceBox; | ||
21 | class Obex; | ||
22 | class SendWidget : public QWidget{ | ||
23 | Q_OBJECT | ||
24 | public: | ||
25 | SendWidget( QWidget* parent = 0, const char* name = 0); | ||
26 | ~SendWidget(); | ||
27 | |||
28 | QString file()const; | ||
29 | |||
30 | public slots: | ||
31 | void send( const QString& file, const QString& desc ); | ||
32 | |||
33 | signals: | ||
34 | void done(); | ||
35 | |||
36 | private slots: // QCOP slots | ||
37 | /* IrDa Names*/ | ||
38 | void slotIrDaDevices( const QStringList& ); | ||
39 | /* Bt Names + BD-Addr */ | ||
40 | void slotBTDevices( const QMap<QString, QString>& ); | ||
41 | void slotSelectedDevice( const QString& name, int dev ); | ||
42 | void dispatchIrda( const QCString& str, const QByteArray& ar ); | ||
43 | void dispatchBt( const QCString& str, const QByteArray& ar ); | ||
44 | |||
45 | void slotIrError( int ); | ||
46 | void slotIrSent(bool); | ||
47 | void slotIrTry(unsigned int ); | ||
48 | void slotStartIrda(); | ||
49 | void slotDone(); | ||
50 | private: | ||
51 | void initUI(); | ||
52 | QLabel* m_lblFile; | ||
53 | DeviceBox* m_devBox; | ||
54 | QVBoxLayout* m_lay; | ||
55 | int m_start; | ||
56 | QStringList m_irDa; | ||
57 | QMap<QString, QString> m_bt; | ||
58 | QString m_file; | ||
59 | Obex* m_obex; | ||
60 | }; | ||
61 | class DeviceItem { | ||
62 | public: | ||
63 | DeviceItem( const QString& name = QString::null, | ||
64 | const QString& status = QString::null, int dev = 3); | ||
65 | ~DeviceItem(); | ||
66 | void setStatus( const QString& text ); | ||
67 | |||
68 | QString name()const; | ||
69 | QString status()const; | ||
70 | QString pixmap()const; | ||
71 | int device()const; | ||
72 | QString toString()const; | ||
73 | private: | ||
74 | QString m_name; | ||
75 | QString m_status; | ||
76 | int m_dev; | ||
77 | }; | ||
78 | class DeviceBox : public QTextBrowser { | ||
79 | Q_OBJECT | ||
80 | public: | ||
81 | enum Device { IrDa, BT, Search, Error }; | ||
82 | DeviceBox( QWidget* parent ); | ||
83 | ~DeviceBox(); | ||
84 | |||
85 | void setSource( const QString& str ); | ||
86 | void addDevice( const QString& name, int dev, | ||
87 | const QString& status = QString::null ); | ||
88 | void removeDevice( const QString& name ); | ||
89 | void setStatus( const QString& name, const QString& ); | ||
90 | signals: | ||
91 | void selectedDevice( const QString& name, int dev ); | ||
92 | private: | ||
93 | QMap<QString, DeviceItem> m_dev; | ||
94 | QStringList m_devices; | ||
95 | |||
96 | }; | ||
97 | } | ||
98 | |||
99 | #endif | ||