-rw-r--r-- | core/obex/obexsend.h | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/core/obex/obexsend.h b/core/obex/obexsend.h index fd819bc..02100f7 100644 --- a/core/obex/obexsend.h +++ b/core/obex/obexsend.h | |||
@@ -20,4 +20,16 @@ namespace OpieObex { | |||
20 | class DeviceBox; | 20 | class DeviceBox; |
21 | class Obex; | 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 | }; | ||
22 | class SendWidget : public QWidget{ | 34 | class SendWidget : public QWidget{ |
23 | Q_OBJECT | 35 | Q_OBJECT |
@@ -39,5 +51,5 @@ namespace OpieObex { | |||
39 | /* Bt Names + BD-Addr */ | 51 | /* Bt Names + BD-Addr */ |
40 | void slotBTDevices( const QMap<QString, QString>& ); | 52 | void slotBTDevices( const QMap<QString, QString>& ); |
41 | void slotSelectedDevice( const QString& name, int dev ); | 53 | void slotSelectedDevice( int id, int dev ); |
42 | void dispatchIrda( const QCString& str, const QByteArray& ar ); | 54 | void dispatchIrda( const QCString& str, const QByteArray& ar ); |
43 | void dispatchBt( const QCString& str, const QByteArray& ar ); | 55 | void dispatchBt( const QCString& str, const QByteArray& ar ); |
@@ -54,13 +66,16 @@ namespace OpieObex { | |||
54 | QVBoxLayout* m_lay; | 66 | QVBoxLayout* m_lay; |
55 | int m_start; | 67 | int m_start; |
56 | QStringList m_irDa; | 68 | QMap<int, QString> m_irDa; |
57 | QMap<QString, QString> m_bt; | 69 | QMap<int, QString>::Iterator m_irDaIt; |
70 | QMap<int, Pair > m_bt; | ||
58 | QString m_file; | 71 | QString m_file; |
59 | Obex* m_obex; | 72 | Obex* m_obex; |
73 | int m_irDeSearch; // search of irda and bt devices | ||
74 | int m_btDeSearch; | ||
60 | }; | 75 | }; |
61 | class DeviceItem { | 76 | class DeviceItem { |
62 | public: | 77 | public: |
63 | DeviceItem( const QString& name = QString::null, | 78 | DeviceItem( const QString& name = QString::null, |
64 | const QString& status = QString::null, int dev = 3); | 79 | const QString& status = QString::null, int dev = 3, int id = -1); |
65 | ~DeviceItem(); | 80 | ~DeviceItem(); |
66 | void setStatus( const QString& text ); | 81 | void setStatus( const QString& text ); |
@@ -70,4 +85,5 @@ namespace OpieObex { | |||
70 | QString pixmap()const; | 85 | QString pixmap()const; |
71 | int device()const; | 86 | int device()const; |
87 | int id()const; | ||
72 | QString toString()const; | 88 | QString toString()const; |
73 | private: | 89 | private: |
@@ -75,5 +91,11 @@ namespace OpieObex { | |||
75 | QString m_status; | 91 | QString m_status; |
76 | int m_dev; | 92 | int m_dev; |
93 | int m_id; | ||
77 | }; | 94 | }; |
95 | |||
96 | /* | ||
97 | * The text field which contains the information about sending... | ||
98 | * | ||
99 | */ | ||
78 | class DeviceBox : public QTextBrowser { | 100 | class DeviceBox : public QTextBrowser { |
79 | Q_OBJECT | 101 | Q_OBJECT |
@@ -84,14 +106,15 @@ namespace OpieObex { | |||
84 | 106 | ||
85 | void setSource( const QString& str ); | 107 | void setSource( const QString& str ); |
86 | void addDevice( const QString& name, int dev, | 108 | int addDevice( const QString& name, int dev, |
87 | const QString& status = QString::null ); | 109 | const QString& status = QString::null ); |
88 | void removeDevice( const QString& name ); | 110 | void removeDevice( int ); |
89 | void setStatus( const QString& name, const QString& ); | 111 | void setStatus( int, const QString& ); |
90 | signals: | 112 | signals: |
91 | void selectedDevice( const QString& name, int dev ); | 113 | void selectedDevice( int id, int dev ); |
92 | private: | 114 | private: |
93 | QMap<QString, DeviceItem> m_dev; | 115 | /* returns a id for a device from a device range */ |
94 | QStringList m_devices; | 116 | int idFor (int deviceType ); |
95 | 117 | QString allText(); | |
118 | QMap<int, DeviceItem> m_dev; | ||
96 | }; | 119 | }; |
97 | } | 120 | } |