-rw-r--r-- | core/obex/obexsend.h | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/core/obex/obexsend.h b/core/obex/obexsend.h deleted file mode 100644 index bf901cb..0000000 --- a/core/obex/obexsend.h +++ b/dev/null | |||
@@ -1,125 +0,0 @@ | |||
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 | |||
23 | struct Pair { | ||
24 | Pair(const QString& first = QString::null, | ||
25 | const QString& second = QString::null) | ||
26 | : m_first(first), m_second(second ) { | ||
27 | } | ||
28 | QString first()const{ return m_first; } | ||
29 | QString second()const { return m_second; } | ||
30 | private: | ||
31 | QString m_first; | ||
32 | QString m_second; | ||
33 | }; | ||
34 | class SendWidget : public QWidget{ | ||
35 | Q_OBJECT | ||
36 | public: | ||
37 | SendWidget( QWidget* parent = 0, const char* name = 0); | ||
38 | ~SendWidget(); | ||
39 | |||
40 | QString file()const; | ||
41 | |||
42 | protected: | ||
43 | void closeEvent( QCloseEvent* ); | ||
44 | |||
45 | public slots: | ||
46 | void send( const QString& file, const QString& desc ); | ||
47 | |||
48 | signals: | ||
49 | void done(); | ||
50 | |||
51 | private slots: // QCOP slots | ||
52 | /* IrDa Names*/ | ||
53 | void slotIrDaDevices( const QStringList& ); | ||
54 | /* Bt Names + BD-Addr */ | ||
55 | void slotBTDevices( const QMap<QString, QString>& ); | ||
56 | void slotSelectedDevice( int id, int dev ); | ||
57 | void dispatchIrda( const QCString& str, const QByteArray& ar ); | ||
58 | void dispatchBt( const QCString& str, const QByteArray& ar ); | ||
59 | |||
60 | void slotIrError( int ); | ||
61 | void slotIrSent(bool); | ||
62 | void slotIrTry(unsigned int ); | ||
63 | void slotStartIrda(); | ||
64 | void slotDone(); | ||
65 | private: | ||
66 | void initUI(); | ||
67 | QLabel* m_lblFile; | ||
68 | DeviceBox* m_devBox; | ||
69 | QVBoxLayout* m_lay; | ||
70 | int m_start; | ||
71 | QMap<int, QString> m_irDa; | ||
72 | QMap<int, QString>::Iterator m_irDaIt; | ||
73 | QMap<int, Pair > m_bt; | ||
74 | QString m_file; | ||
75 | Obex* m_obex; | ||
76 | int m_irDeSearch; // search of irda and bt devices | ||
77 | int m_btDeSearch; | ||
78 | }; | ||
79 | class DeviceItem { | ||
80 | public: | ||
81 | DeviceItem( const QString& name = QString::null, | ||
82 | const QString& status = QString::null, int dev = 3, int id = -1); | ||
83 | ~DeviceItem(); | ||
84 | void setStatus( const QString& text ); | ||
85 | |||
86 | QString name()const; | ||
87 | QString status()const; | ||
88 | QString pixmap()const; | ||
89 | int device()const; | ||
90 | int id()const; | ||
91 | QString toString()const; | ||
92 | private: | ||
93 | QString m_name; | ||
94 | QString m_status; | ||
95 | int m_dev; | ||
96 | int m_id; | ||
97 | }; | ||
98 | |||
99 | /* | ||
100 | * The text field which contains the information about sending... | ||
101 | * | ||
102 | */ | ||
103 | class DeviceBox : public QTextBrowser { | ||
104 | Q_OBJECT | ||
105 | public: | ||
106 | enum Device { IrDa, BT, Search, Error }; | ||
107 | DeviceBox( QWidget* parent ); | ||
108 | ~DeviceBox(); | ||
109 | |||
110 | void setSource( const QString& str ); | ||
111 | int addDevice( const QString& name, int dev, | ||
112 | const QString& status = QString::null ); | ||
113 | void removeDevice( int ); | ||
114 | void setStatus( int, const QString& ); | ||
115 | signals: | ||
116 | void selectedDevice( int id, int dev ); | ||
117 | private: | ||
118 | /* returns a id for a device from a device range */ | ||
119 | int idFor (int deviceType ); | ||
120 | QString allText(); | ||
121 | QMap<int, DeviceItem> m_dev; | ||
122 | }; | ||
123 | } | ||
124 | |||
125 | #endif | ||