Diffstat (limited to 'noncore/settings/networksettings2/bluetooth') (more/less context) (show whitespace changes)
18 files changed, 768 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth.pro b/noncore/settings/networksettings2/bluetooth/bluetooth.pro new file mode 100644 index 0000000..180bda9 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetooth.pro | |||
@@ -0,0 +1,21 @@ | |||
1 | TEMPLATE = lib | ||
2 | CONFIG += qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/plugins/networksettings2 | ||
4 | HEADERS = bluetooth_NN.h \ | ||
5 | bluetoothBNEP_NNI.h \ | ||
6 | bluetoothRFCOMM_NNI.h \ | ||
7 | bluetoothBNEPedit.h \ | ||
8 | bluetoothRFCOMMedit.h | ||
9 | SOURCES = bluetooth_NN.cpp \ | ||
10 | bluetoothBNEP_NNI.cpp \ | ||
11 | bluetoothRFCOMM_NNI.cpp \ | ||
12 | bluetoothBNEPedit.cpp \ | ||
13 | bluetoothRFCOMMedit.cpp | ||
14 | INCLUDEPATH+= $(OPIEDIR)/include ../ ../networksettings2 | ||
15 | DEPENDPATH+= $(OPIEDIR)/include ../ ../networksettings2 | ||
16 | LIBS += -lqpe | ||
17 | INTERFACES= bluetoothBNEPGUI.ui bluetoothRFCOMMGUI.ui | ||
18 | TARGET = bluetooth | ||
19 | VERSION = 1.0.0 | ||
20 | |||
21 | include ( $(OPIEDIR)/include.pro ) | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPGUI.ui b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPGUI.ui new file mode 100644 index 0000000..ddb5ddd --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPGUI.ui | |||
@@ -0,0 +1,131 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>BluetoothBNEPGUI</class> | ||
3 | <widget> | ||
4 | <class>QWidget</class> | ||
5 | <property stdset="1"> | ||
6 | <name>name</name> | ||
7 | <cstring>BluetoothBNEP_FRM</cstring> | ||
8 | </property> | ||
9 | <property stdset="1"> | ||
10 | <name>geometry</name> | ||
11 | <rect> | ||
12 | <x>0</x> | ||
13 | <y>0</y> | ||
14 | <width>283</width> | ||
15 | <height>199</height> | ||
16 | </rect> | ||
17 | </property> | ||
18 | <property stdset="1"> | ||
19 | <name>caption</name> | ||
20 | <string>Bluetooth-bnep</string> | ||
21 | </property> | ||
22 | <property> | ||
23 | <name>layoutMargin</name> | ||
24 | </property> | ||
25 | <property> | ||
26 | <name>layoutSpacing</name> | ||
27 | </property> | ||
28 | <vbox> | ||
29 | <property stdset="1"> | ||
30 | <name>margin</name> | ||
31 | <number>2</number> | ||
32 | </property> | ||
33 | <property stdset="1"> | ||
34 | <name>spacing</name> | ||
35 | <number>2</number> | ||
36 | </property> | ||
37 | <widget> | ||
38 | <class>QLayoutWidget</class> | ||
39 | <property stdset="1"> | ||
40 | <name>name</name> | ||
41 | <cstring>Layout4</cstring> | ||
42 | </property> | ||
43 | <hbox> | ||
44 | <property stdset="1"> | ||
45 | <name>margin</name> | ||
46 | <number>0</number> | ||
47 | </property> | ||
48 | <property stdset="1"> | ||
49 | <name>spacing</name> | ||
50 | <number>6</number> | ||
51 | </property> | ||
52 | <widget> | ||
53 | <class>QLabel</class> | ||
54 | <property stdset="1"> | ||
55 | <name>name</name> | ||
56 | <cstring>TextLabel4</cstring> | ||
57 | </property> | ||
58 | <property stdset="1"> | ||
59 | <name>text</name> | ||
60 | <string>Name</string> | ||
61 | </property> | ||
62 | </widget> | ||
63 | <widget> | ||
64 | <class>QLineEdit</class> | ||
65 | <property stdset="1"> | ||
66 | <name>name</name> | ||
67 | <cstring>Name_LE</cstring> | ||
68 | </property> | ||
69 | </widget> | ||
70 | </hbox> | ||
71 | </widget> | ||
72 | <widget> | ||
73 | <class>QLabel</class> | ||
74 | <property stdset="1"> | ||
75 | <name>name</name> | ||
76 | <cstring>TextLabel3</cstring> | ||
77 | </property> | ||
78 | <property stdset="1"> | ||
79 | <name>text</name> | ||
80 | <string>Description</string> | ||
81 | </property> | ||
82 | </widget> | ||
83 | <widget> | ||
84 | <class>QMultiLineEdit</class> | ||
85 | <property stdset="1"> | ||
86 | <name>name</name> | ||
87 | <cstring>Description_LE</cstring> | ||
88 | </property> | ||
89 | </widget> | ||
90 | <widget> | ||
91 | <class>QLayoutWidget</class> | ||
92 | <property stdset="1"> | ||
93 | <name>name</name> | ||
94 | <cstring>Layout5</cstring> | ||
95 | </property> | ||
96 | <hbox> | ||
97 | <property stdset="1"> | ||
98 | <name>margin</name> | ||
99 | <number>0</number> | ||
100 | </property> | ||
101 | <property stdset="1"> | ||
102 | <name>spacing</name> | ||
103 | <number>6</number> | ||
104 | </property> | ||
105 | <widget> | ||
106 | <class>QCheckBox</class> | ||
107 | <property stdset="1"> | ||
108 | <name>name</name> | ||
109 | <cstring>Automatic_CB</cstring> | ||
110 | </property> | ||
111 | <property stdset="1"> | ||
112 | <name>text</name> | ||
113 | <string>Start automatically</string> | ||
114 | </property> | ||
115 | </widget> | ||
116 | <widget> | ||
117 | <class>QCheckBox</class> | ||
118 | <property stdset="1"> | ||
119 | <name>name</name> | ||
120 | <cstring>Confirm_CB</cstring> | ||
121 | </property> | ||
122 | <property stdset="1"> | ||
123 | <name>text</name> | ||
124 | <string>Confirm before start</string> | ||
125 | </property> | ||
126 | </widget> | ||
127 | </hbox> | ||
128 | </widget> | ||
129 | </vbox> | ||
130 | </widget> | ||
131 | </UI> | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.cpp new file mode 100644 index 0000000..1743c1d --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.cpp | |||
@@ -0,0 +1,29 @@ | |||
1 | #include "bluetoothBNEPedit.h" | ||
2 | #include "bluetoothBNEP_NNI.h" | ||
3 | #include "bluetooth_NN.h" | ||
4 | |||
5 | ABluetoothBNEP::ABluetoothBNEP( BluetoothBNEPNetNode * PNN ) : ANetNodeInstance( PNN ) { | ||
6 | GUI = 0; | ||
7 | RT = 0; | ||
8 | } | ||
9 | |||
10 | void ABluetoothBNEP::setSpecificAttribute( QString & , QString & ) { | ||
11 | } | ||
12 | |||
13 | void ABluetoothBNEP::saveSpecificAttribute( QTextStream & ) { | ||
14 | } | ||
15 | |||
16 | QWidget * ABluetoothBNEP::edit( QWidget * parent ) { | ||
17 | GUI = new BluetoothBNEPEdit( parent ); | ||
18 | GUI->showData( Data ); | ||
19 | return GUI; | ||
20 | } | ||
21 | |||
22 | QString ABluetoothBNEP::acceptable( void ) { | ||
23 | return ( GUI ) ? GUI->acceptable( ) : QString(); | ||
24 | } | ||
25 | |||
26 | void ABluetoothBNEP::commit( void ) { | ||
27 | if( GUI && GUI->commit( Data ) ) | ||
28 | setModified( 1 ); | ||
29 | } | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h new file mode 100644 index 0000000..a21f574 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h | |||
@@ -0,0 +1,43 @@ | |||
1 | #ifndef BLUETOOTHBNEP_H | ||
2 | #define BLUETOOTHBNEP_H | ||
3 | |||
4 | #include <netnode.h> | ||
5 | #include "bluetoothBNEPdata.h" | ||
6 | #include "bluetoothBNEPrun.h" | ||
7 | |||
8 | class BluetoothBNEPNetNode; | ||
9 | class BluetoothBNEPEdit; | ||
10 | |||
11 | class ABluetoothBNEP : public ANetNodeInstance { | ||
12 | |||
13 | public : | ||
14 | |||
15 | ABluetoothBNEP( BluetoothBNEPNetNode * PNN ); | ||
16 | |||
17 | QWidget * edit( QWidget * parent ); | ||
18 | QString acceptable( void ); | ||
19 | void commit( void ); | ||
20 | |||
21 | RuntimeInfo * runtime( void ) | ||
22 | { if( RT == 0 ) | ||
23 | RT = new BluetoothBNEPRun( this, Data ); | ||
24 | return RT; | ||
25 | } | ||
26 | |||
27 | virtual void * data( void ) | ||
28 | { return (void *)&Data; } | ||
29 | |||
30 | protected : | ||
31 | |||
32 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | ||
33 | virtual void saveSpecificAttribute( QTextStream & TS ); | ||
34 | |||
35 | private : | ||
36 | |||
37 | BluetoothBNEPEdit * GUI; | ||
38 | BluetoothBNEPData Data; | ||
39 | BluetoothBNEPRun * RT; | ||
40 | |||
41 | }; | ||
42 | |||
43 | #endif | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPdata.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPdata.h new file mode 100644 index 0000000..037b7b1 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPdata.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef BLUETOOTHBNEP_DATA_H | ||
2 | #define BLUETOOTHBNEP_DATA_H | ||
3 | |||
4 | typedef struct BluetoothBNEPData { | ||
5 | long x; | ||
6 | } BluetoothBNEPData_t; | ||
7 | |||
8 | #endif | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.cpp new file mode 100644 index 0000000..a27f1a7 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.cpp | |||
@@ -0,0 +1,18 @@ | |||
1 | #include <GUIUtils.h> | ||
2 | #include "bluetoothBNEPedit.h" | ||
3 | |||
4 | |||
5 | BluetoothBNEPEdit::BluetoothBNEPEdit( QWidget * Parent ) : BluetoothBNEPGUI( Parent ){ | ||
6 | |||
7 | } | ||
8 | |||
9 | QString BluetoothBNEPEdit::acceptable( void ) { | ||
10 | return QString(); | ||
11 | } | ||
12 | |||
13 | bool BluetoothBNEPEdit::commit( BluetoothBNEPData & Data ) { | ||
14 | return 0; | ||
15 | } | ||
16 | |||
17 | void BluetoothBNEPEdit::showData( BluetoothBNEPData & Data ) { | ||
18 | } | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.h new file mode 100644 index 0000000..d546f1e --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #include "bluetoothBNEPdata.h" | ||
2 | #include "bluetoothBNEPGUI.h" | ||
3 | |||
4 | class BluetoothBNEPEdit : public BluetoothBNEPGUI { | ||
5 | |||
6 | public : | ||
7 | |||
8 | BluetoothBNEPEdit( QWidget * parent ); | ||
9 | |||
10 | QString acceptable( void ); | ||
11 | bool commit( BluetoothBNEPData & Data ); | ||
12 | void showData( BluetoothBNEPData & Data ); | ||
13 | }; | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h new file mode 100644 index 0000000..e65b378 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #include <asdevice.h> | ||
2 | #include "bluetoothBNEPdata.h" | ||
3 | |||
4 | class BluetoothBNEPRun : public AsDevice { | ||
5 | |||
6 | public : | ||
7 | |||
8 | BluetoothBNEPRun( ANetNodeInstance * NNI, | ||
9 | BluetoothBNEPData & Data ) : AsDevice( NNI ) | ||
10 | { } | ||
11 | |||
12 | virtual long count( void ) | ||
13 | { return 3; } | ||
14 | virtual QString genNic( long nr ) | ||
15 | { QString S; return S.sprintf( "bnep%ld", nr ); } | ||
16 | virtual AsDevice * device( void ) | ||
17 | { return asDevice(); } | ||
18 | |||
19 | protected : | ||
20 | |||
21 | void detectState( NodeCollection * ) | ||
22 | { } | ||
23 | |||
24 | bool setState( NodeCollection * , Action_t ) | ||
25 | { return 0; } | ||
26 | |||
27 | bool canSetState( State_t , Action_t ) | ||
28 | { return 0; } | ||
29 | |||
30 | bool handlesInterface( const QString & ) | ||
31 | { return 0; } | ||
32 | }; | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMGUI.ui b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMGUI.ui new file mode 100644 index 0000000..2754a70 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMGUI.ui | |||
@@ -0,0 +1,131 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>BluetoothRFCOMMGUI</class> | ||
3 | <widget> | ||
4 | <class>QWidget</class> | ||
5 | <property stdset="1"> | ||
6 | <name>name</name> | ||
7 | <cstring>BluetoothRFCOMM_FRM</cstring> | ||
8 | </property> | ||
9 | <property stdset="1"> | ||
10 | <name>geometry</name> | ||
11 | <rect> | ||
12 | <x>0</x> | ||
13 | <y>0</y> | ||
14 | <width>283</width> | ||
15 | <height>199</height> | ||
16 | </rect> | ||
17 | </property> | ||
18 | <property stdset="1"> | ||
19 | <name>caption</name> | ||
20 | <string>Bluetooth-rfcomm</string> | ||
21 | </property> | ||
22 | <property> | ||
23 | <name>layoutMargin</name> | ||
24 | </property> | ||
25 | <property> | ||
26 | <name>layoutSpacing</name> | ||
27 | </property> | ||
28 | <vbox> | ||
29 | <property stdset="1"> | ||
30 | <name>margin</name> | ||
31 | <number>2</number> | ||
32 | </property> | ||
33 | <property stdset="1"> | ||
34 | <name>spacing</name> | ||
35 | <number>2</number> | ||
36 | </property> | ||
37 | <widget> | ||
38 | <class>QLayoutWidget</class> | ||
39 | <property stdset="1"> | ||
40 | <name>name</name> | ||
41 | <cstring>Layout4</cstring> | ||
42 | </property> | ||
43 | <hbox> | ||
44 | <property stdset="1"> | ||
45 | <name>margin</name> | ||
46 | <number>0</number> | ||
47 | </property> | ||
48 | <property stdset="1"> | ||
49 | <name>spacing</name> | ||
50 | <number>6</number> | ||
51 | </property> | ||
52 | <widget> | ||
53 | <class>QLabel</class> | ||
54 | <property stdset="1"> | ||
55 | <name>name</name> | ||
56 | <cstring>TextLabel4</cstring> | ||
57 | </property> | ||
58 | <property stdset="1"> | ||
59 | <name>text</name> | ||
60 | <string>Name</string> | ||
61 | </property> | ||
62 | </widget> | ||
63 | <widget> | ||
64 | <class>QLineEdit</class> | ||
65 | <property stdset="1"> | ||
66 | <name>name</name> | ||
67 | <cstring>Name_LE</cstring> | ||
68 | </property> | ||
69 | </widget> | ||
70 | </hbox> | ||
71 | </widget> | ||
72 | <widget> | ||
73 | <class>QLabel</class> | ||
74 | <property stdset="1"> | ||
75 | <name>name</name> | ||
76 | <cstring>TextLabel3</cstring> | ||
77 | </property> | ||
78 | <property stdset="1"> | ||
79 | <name>text</name> | ||
80 | <string>Description</string> | ||
81 | </property> | ||
82 | </widget> | ||
83 | <widget> | ||
84 | <class>QMultiLineEdit</class> | ||
85 | <property stdset="1"> | ||
86 | <name>name</name> | ||
87 | <cstring>Description_LE</cstring> | ||
88 | </property> | ||
89 | </widget> | ||
90 | <widget> | ||
91 | <class>QLayoutWidget</class> | ||
92 | <property stdset="1"> | ||
93 | <name>name</name> | ||
94 | <cstring>Layout5</cstring> | ||
95 | </property> | ||
96 | <hbox> | ||
97 | <property stdset="1"> | ||
98 | <name>margin</name> | ||
99 | <number>0</number> | ||
100 | </property> | ||
101 | <property stdset="1"> | ||
102 | <name>spacing</name> | ||
103 | <number>6</number> | ||
104 | </property> | ||
105 | <widget> | ||
106 | <class>QCheckBox</class> | ||
107 | <property stdset="1"> | ||
108 | <name>name</name> | ||
109 | <cstring>Automatic_CB</cstring> | ||
110 | </property> | ||
111 | <property stdset="1"> | ||
112 | <name>text</name> | ||
113 | <string>Start automatically</string> | ||
114 | </property> | ||
115 | </widget> | ||
116 | <widget> | ||
117 | <class>QCheckBox</class> | ||
118 | <property stdset="1"> | ||
119 | <name>name</name> | ||
120 | <cstring>Confirm_CB</cstring> | ||
121 | </property> | ||
122 | <property stdset="1"> | ||
123 | <name>text</name> | ||
124 | <string>Confirm before start</string> | ||
125 | </property> | ||
126 | </widget> | ||
127 | </hbox> | ||
128 | </widget> | ||
129 | </vbox> | ||
130 | </widget> | ||
131 | </UI> | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp new file mode 100644 index 0000000..7ec8288 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp | |||
@@ -0,0 +1,30 @@ | |||
1 | #include "bluetoothRFCOMMedit.h" | ||
2 | #include "bluetoothRFCOMM_NNI.h" | ||
3 | #include "bluetooth_NN.h" | ||
4 | |||
5 | ABluetoothRFCOMM::ABluetoothRFCOMM( BluetoothRFCOMMNetNode * PNN ) : ANetNodeInstance( PNN ) { | ||
6 | GUI = 0; | ||
7 | RT = 0; | ||
8 | } | ||
9 | |||
10 | void ABluetoothRFCOMM::setSpecificAttribute( QString & , QString & ) { | ||
11 | } | ||
12 | |||
13 | void ABluetoothRFCOMM::saveSpecificAttribute( QTextStream & ) { | ||
14 | } | ||
15 | |||
16 | |||
17 | QWidget * ABluetoothRFCOMM::edit( QWidget * parent ) { | ||
18 | GUI = new BluetoothRFCOMMEdit( parent ); | ||
19 | GUI->showData( Data ); | ||
20 | return GUI; | ||
21 | } | ||
22 | |||
23 | QString ABluetoothRFCOMM::acceptable( void ) { | ||
24 | return ( GUI ) ? GUI->acceptable( ) : QString(); | ||
25 | } | ||
26 | |||
27 | void ABluetoothRFCOMM::commit( void ) { | ||
28 | if( GUI->commit( Data ) ) | ||
29 | setModified( 1 ); | ||
30 | } | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h new file mode 100644 index 0000000..4dd508d --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h | |||
@@ -0,0 +1,42 @@ | |||
1 | #ifndef BLUETOOTHRFCOMM_H | ||
2 | #define BLUETOOTHRFCOMM_H | ||
3 | |||
4 | #include <netnode.h> | ||
5 | #include "bluetoothRFCOMMdata.h" | ||
6 | #include "bluetoothRFCOMMrun.h" | ||
7 | |||
8 | class BluetoothRFCOMMNetNode; | ||
9 | class BluetoothRFCOMMEdit; | ||
10 | |||
11 | class ABluetoothRFCOMM : public ANetNodeInstance { | ||
12 | |||
13 | public : | ||
14 | |||
15 | ABluetoothRFCOMM( BluetoothRFCOMMNetNode * PNN ); | ||
16 | |||
17 | QWidget * edit( QWidget * parent ); | ||
18 | QString acceptable( void ); | ||
19 | void commit( void ); | ||
20 | |||
21 | RuntimeInfo * runtime( void ) | ||
22 | { if( RT ) | ||
23 | RT = new BluetoothRFCOMMRun( this, Data ); | ||
24 | return RT; | ||
25 | } | ||
26 | |||
27 | virtual void * data( void ) | ||
28 | { return (void *)&Data; } | ||
29 | |||
30 | protected : | ||
31 | |||
32 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | ||
33 | virtual void saveSpecificAttribute( QTextStream & TS ); | ||
34 | |||
35 | private : | ||
36 | |||
37 | BluetoothRFCOMMEdit * GUI; | ||
38 | BluetoothRFCOMMData Data; | ||
39 | BluetoothRFCOMMRun * RT; | ||
40 | }; | ||
41 | |||
42 | #endif | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMdata.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMdata.h new file mode 100644 index 0000000..18f0d38 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMdata.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef BLUETOOTHRFCOMM_DATA_H | ||
2 | #define BLUETOOTHRFCOMM_DATA_H | ||
3 | |||
4 | #include <qstring.h> | ||
5 | |||
6 | typedef struct BluetoothRFCOMMData { | ||
7 | QString Device; | ||
8 | QString LockFile; | ||
9 | long Speed; | ||
10 | short Parity; | ||
11 | short DataBits; | ||
12 | short StopBits; | ||
13 | bool HardwareControl; | ||
14 | bool SoftwareControl; | ||
15 | |||
16 | } BluetoothRFCOMMData_t; | ||
17 | |||
18 | #endif | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.cpp new file mode 100644 index 0000000..d3ddab4 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.cpp | |||
@@ -0,0 +1,18 @@ | |||
1 | #include <GUIUtils.h> | ||
2 | #include "bluetoothRFCOMMedit.h" | ||
3 | |||
4 | BluetoothRFCOMMEdit::BluetoothRFCOMMEdit( QWidget * Parent ) : | ||
5 | BluetoothRFCOMMGUI( Parent ){ | ||
6 | |||
7 | } | ||
8 | |||
9 | QString BluetoothRFCOMMEdit::acceptable( void ) { | ||
10 | return QString(); | ||
11 | } | ||
12 | |||
13 | void BluetoothRFCOMMEdit::showData( BluetoothRFCOMMData & Data ) { | ||
14 | } | ||
15 | |||
16 | bool BluetoothRFCOMMEdit::commit( BluetoothRFCOMMData & Data ) { | ||
17 | return 0; | ||
18 | } | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h new file mode 100644 index 0000000..14a6d64 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #include "bluetoothRFCOMMdata.h" | ||
2 | #include "bluetoothRFCOMMGUI.h" | ||
3 | |||
4 | class BluetoothRFCOMMEdit : public BluetoothRFCOMMGUI { | ||
5 | |||
6 | public : | ||
7 | |||
8 | BluetoothRFCOMMEdit( QWidget * parent ); | ||
9 | |||
10 | QString acceptable( void ); | ||
11 | void showData( BluetoothRFCOMMData & Data ); | ||
12 | bool commit( BluetoothRFCOMMData & Data ); | ||
13 | }; | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h new file mode 100644 index 0000000..87116e2 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #include <asline.h> | ||
2 | #include "bluetoothRFCOMMdata.h" | ||
3 | |||
4 | class BluetoothRFCOMMRun : public AsLine { | ||
5 | |||
6 | public : | ||
7 | |||
8 | BluetoothRFCOMMRun( ANetNodeInstance * NNI, | ||
9 | BluetoothRFCOMMData & Data ) : AsLine( NNI ) | ||
10 | { } | ||
11 | |||
12 | protected : | ||
13 | |||
14 | void detectState( NodeCollection * ) | ||
15 | { } | ||
16 | |||
17 | bool setState( NodeCollection * , Action_t ) | ||
18 | { return 0; } | ||
19 | |||
20 | bool canSetState( State_t , Action_t ) | ||
21 | { return 0; } | ||
22 | }; | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp new file mode 100644 index 0000000..91be153 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp | |||
@@ -0,0 +1,120 @@ | |||
1 | #include "bluetooth_NN.h" | ||
2 | #include "bluetoothBNEP_NNI.h" | ||
3 | #include "bluetoothRFCOMM_NNI.h" | ||
4 | |||
5 | // | ||
6 | // | ||
7 | // BLUETOOTH PAN/NAP node | ||
8 | // | ||
9 | // | ||
10 | |||
11 | static const char * BluetoothBNEPNeeds[] = | ||
12 | { 0 | ||
13 | }; | ||
14 | |||
15 | /** | ||
16 | * Constructor, find all of the possible interfaces | ||
17 | */ | ||
18 | BluetoothBNEPNetNode::BluetoothBNEPNetNode() : ANetNode() { | ||
19 | } | ||
20 | |||
21 | /** | ||
22 | * Delete any interfaces that we own. | ||
23 | */ | ||
24 | BluetoothBNEPNetNode::~BluetoothBNEPNetNode(){ | ||
25 | } | ||
26 | |||
27 | const QString BluetoothBNEPNetNode::nodeDescription(){ | ||
28 | return tr("\ | ||
29 | <p>Sets up a bluetooth link using the bluetooth Network profile.</p>\ | ||
30 | <p>Use this to connect two computing devices.</p>\ | ||
31 | " | ||
32 | ); | ||
33 | } | ||
34 | |||
35 | ANetNodeInstance * BluetoothBNEPNetNode::createInstance( void ) { | ||
36 | return new ABluetoothBNEP( this ); | ||
37 | } | ||
38 | |||
39 | const char ** BluetoothBNEPNetNode::needs( void ) { | ||
40 | return BluetoothBNEPNeeds; | ||
41 | } | ||
42 | |||
43 | const char * BluetoothBNEPNetNode::provides( void ) { | ||
44 | return "device"; | ||
45 | } | ||
46 | |||
47 | bool BluetoothBNEPNetNode::generateProperFilesFor( | ||
48 | ANetNodeInstance * ) { | ||
49 | return 1; | ||
50 | } | ||
51 | |||
52 | bool BluetoothBNEPNetNode::hasDataFor( const QString & ) { | ||
53 | return 0; | ||
54 | } | ||
55 | |||
56 | bool BluetoothBNEPNetNode::generateDataForCommonFile( | ||
57 | SystemFile & , | ||
58 | long , | ||
59 | ANetNodeInstance * ) { | ||
60 | return 1; | ||
61 | } | ||
62 | |||
63 | // | ||
64 | // | ||
65 | // BLUETOOTH PAN/NAP node | ||
66 | // | ||
67 | // | ||
68 | |||
69 | static const char * BluetoothRFCOMMNeeds[] = | ||
70 | { 0 | ||
71 | }; | ||
72 | |||
73 | BluetoothRFCOMMNetNode::BluetoothRFCOMMNetNode() : ANetNode() { | ||
74 | } | ||
75 | |||
76 | BluetoothRFCOMMNetNode::~BluetoothRFCOMMNetNode(){ | ||
77 | } | ||
78 | |||
79 | const QString BluetoothRFCOMMNetNode::nodeDescription(){ | ||
80 | return tr("\ | ||
81 | <p>Sets up a bluetooth link using the bluetooth serial profile.</p>\ | ||
82 | <p>Use this to connect to a GSM.</p>\ | ||
83 | " | ||
84 | ); | ||
85 | } | ||
86 | |||
87 | ANetNodeInstance * BluetoothRFCOMMNetNode::createInstance( void ) { | ||
88 | return new ABluetoothRFCOMM( this ); | ||
89 | } | ||
90 | |||
91 | const char ** BluetoothRFCOMMNetNode::needs( void ) { | ||
92 | return BluetoothRFCOMMNeeds; | ||
93 | } | ||
94 | |||
95 | const char * BluetoothRFCOMMNetNode::provides( void ) { | ||
96 | return "line"; | ||
97 | } | ||
98 | |||
99 | bool BluetoothRFCOMMNetNode::generateProperFilesFor( | ||
100 | ANetNodeInstance * ) { | ||
101 | return 0; | ||
102 | } | ||
103 | |||
104 | bool BluetoothRFCOMMNetNode::hasDataFor( const QString & ) { | ||
105 | return 0; | ||
106 | } | ||
107 | |||
108 | bool BluetoothRFCOMMNetNode::generateDataForCommonFile( | ||
109 | SystemFile & , | ||
110 | long, | ||
111 | ANetNodeInstance * ) { | ||
112 | return 0; | ||
113 | } | ||
114 | |||
115 | extern "C" { | ||
116 | void create_plugin( QList<ANetNode> & PNN ) { | ||
117 | PNN.append( new BluetoothBNEPNetNode() ); | ||
118 | PNN.append( new BluetoothRFCOMMNetNode() ); | ||
119 | } | ||
120 | } | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h new file mode 100644 index 0000000..ee346f0 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h | |||
@@ -0,0 +1,75 @@ | |||
1 | #ifndef BLUETOOTH_NETNODE_H | ||
2 | #define BLUETOOTH_NETNODE_H | ||
3 | |||
4 | #include "netnode.h" | ||
5 | |||
6 | class ABluetoothBNEP; | ||
7 | |||
8 | class BluetoothBNEPNetNode : public ANetNode { | ||
9 | |||
10 | Q_OBJECT | ||
11 | |||
12 | public: | ||
13 | |||
14 | BluetoothBNEPNetNode(); | ||
15 | virtual ~BluetoothBNEPNetNode(); | ||
16 | |||
17 | virtual const QString pixmapName() | ||
18 | { return "bluetooth"; } | ||
19 | |||
20 | virtual const QString nodeName() | ||
21 | { return tr("Bluetooth PAN/NAP"); } | ||
22 | |||
23 | virtual const QString nodeDescription() ; | ||
24 | |||
25 | virtual ANetNodeInstance * createInstance( void ); | ||
26 | |||
27 | virtual const char ** needs( void ); | ||
28 | virtual const char * provides( void ); | ||
29 | |||
30 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); | ||
31 | virtual bool hasDataFor( const QString & S ); | ||
32 | virtual bool generateDataForCommonFile( | ||
33 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | ||
34 | |||
35 | private: | ||
36 | |||
37 | }; | ||
38 | |||
39 | class BluetoothRFCOMMNetNode : public ANetNode { | ||
40 | |||
41 | Q_OBJECT | ||
42 | |||
43 | public: | ||
44 | |||
45 | BluetoothRFCOMMNetNode(); | ||
46 | virtual ~BluetoothRFCOMMNetNode(); | ||
47 | |||
48 | virtual const QString pixmapName() | ||
49 | { return "bluetooth"; } | ||
50 | |||
51 | virtual const QString nodeName() | ||
52 | { return tr("Bluetooth serial link"); } | ||
53 | |||
54 | virtual const QString nodeDescription() ; | ||
55 | |||
56 | virtual ANetNodeInstance * createInstance( void ); | ||
57 | |||
58 | virtual const char ** needs( void ); | ||
59 | virtual const char * provides( void ); | ||
60 | |||
61 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); | ||
62 | virtual bool hasDataFor( const QString & S ); | ||
63 | virtual bool generateDataForCommonFile( | ||
64 | SystemFile & SF, long, ANetNodeInstance * NNI ); | ||
65 | |||
66 | private: | ||
67 | |||
68 | }; | ||
69 | |||
70 | extern "C" | ||
71 | { | ||
72 | void create_plugin( QList<ANetNode> & PNN ); | ||
73 | }; | ||
74 | |||
75 | #endif | ||
diff --git a/noncore/settings/networksettings2/bluetooth/config.in b/noncore/settings/networksettings2/bluetooth/config.in new file mode 100644 index 0000000..2b527cc --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/config.in | |||
@@ -0,0 +1,4 @@ | |||
1 | config NS2BT | ||
2 | boolean "opie-networksettings2plugin-bluetooth (set up BLUETOOTH)" | ||
3 | default "n" if NS2 | ||
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE | ||