summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/bluetooth
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/bluetooth') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h3
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h5
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h3
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp24
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetooth_NN.h16
5 files changed, 24 insertions, 27 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h
index a21f574..bb3e7e7 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h
@@ -6,38 +6,41 @@
6#include "bluetoothBNEPrun.h" 6#include "bluetoothBNEPrun.h"
7 7
8class BluetoothBNEPNetNode; 8class BluetoothBNEPNetNode;
9class BluetoothBNEPEdit; 9class BluetoothBNEPEdit;
10 10
11class ABluetoothBNEP : public ANetNodeInstance { 11class ABluetoothBNEP : public ANetNodeInstance {
12 12
13public : 13public :
14 14
15 ABluetoothBNEP( BluetoothBNEPNetNode * PNN ); 15 ABluetoothBNEP( BluetoothBNEPNetNode * PNN );
16 16
17 QWidget * edit( QWidget * parent ); 17 QWidget * edit( QWidget * parent );
18 QString acceptable( void ); 18 QString acceptable( void );
19 void commit( void ); 19 void commit( void );
20 20
21 RuntimeInfo * runtime( void ) 21 RuntimeInfo * runtime( void )
22 { if( RT == 0 ) 22 { if( RT == 0 )
23 RT = new BluetoothBNEPRun( this, Data ); 23 RT = new BluetoothBNEPRun( this, Data );
24 return RT; 24 return RT;
25 } 25 }
26 26
27 virtual void * data( void ) 27 virtual void * data( void )
28 { return (void *)&Data; } 28 { return (void *)&Data; }
29 29
30 virtual bool hasDataFor( const QString & S );
31 virtual bool generateDataForCommonFile( SystemFile & SF, long );
32
30protected : 33protected :
31 34
32 virtual void setSpecificAttribute( QString & Attr, QString & Value ); 35 virtual void setSpecificAttribute( QString & Attr, QString & Value );
33 virtual void saveSpecificAttribute( QTextStream & TS ); 36 virtual void saveSpecificAttribute( QTextStream & TS );
34 37
35private : 38private :
36 39
37 BluetoothBNEPEdit * GUI; 40 BluetoothBNEPEdit * GUI;
38 BluetoothBNEPData Data; 41 BluetoothBNEPData Data;
39 BluetoothBNEPRun * RT; 42 BluetoothBNEPRun * RT;
40 43
41}; 44};
42 45
43#endif 46#endif
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
index 347da0c..4a773cd 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
@@ -1,36 +1,31 @@
1#include <asdevice.h> 1#include <asdevice.h>
2#include "bluetoothBNEPdata.h" 2#include "bluetoothBNEPdata.h"
3 3
4class BluetoothBNEPRun : public AsDevice { 4class BluetoothBNEPRun : public AsDevice {
5 5
6public : 6public :
7 7
8 BluetoothBNEPRun( ANetNodeInstance * NNI, 8 BluetoothBNEPRun( ANetNodeInstance * NNI,
9 BluetoothBNEPData & Data ) : AsDevice( NNI ) 9 BluetoothBNEPData & Data ) : AsDevice( NNI )
10 { } 10 { }
11 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
17 virtual AsDevice * asDevice( void ) 12 virtual AsDevice * asDevice( void )
18 { return (AsDevice *)this; } 13 { return (AsDevice *)this; }
19 14
20 virtual AsDevice * device( void ) 15 virtual AsDevice * device( void )
21 { return asDevice(); } 16 { return asDevice(); }
22 17
23protected : 18protected :
24 19
25 void detectState( NodeCollection * ) 20 void detectState( NodeCollection * )
26 { } 21 { }
27 22
28 bool setState( NodeCollection * , Action_t ) 23 bool setState( NodeCollection * , Action_t )
29 { return 0; } 24 { return 0; }
30 25
31 bool canSetState( State_t , Action_t ) 26 bool canSetState( State_t , Action_t )
32 { return 0; } 27 { return 0; }
33 28
34 bool handlesInterface( const QString & ) 29 bool handlesInterface( const QString & )
35 { return 0; } 30 { return 0; }
36}; 31};
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h
index 57ff95e..97bd29c 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h
@@ -6,37 +6,40 @@
6#include "bluetoothRFCOMMrun.h" 6#include "bluetoothRFCOMMrun.h"
7 7
8class BluetoothRFCOMMNetNode; 8class BluetoothRFCOMMNetNode;
9class BluetoothRFCOMMEdit; 9class BluetoothRFCOMMEdit;
10 10
11class ABluetoothRFCOMM : public ANetNodeInstance { 11class ABluetoothRFCOMM : public ANetNodeInstance {
12 12
13public : 13public :
14 14
15 ABluetoothRFCOMM( BluetoothRFCOMMNetNode * PNN ); 15 ABluetoothRFCOMM( BluetoothRFCOMMNetNode * PNN );
16 16
17 QWidget * edit( QWidget * parent ); 17 QWidget * edit( QWidget * parent );
18 QString acceptable( void ); 18 QString acceptable( void );
19 void commit( void ); 19 void commit( void );
20 20
21 RuntimeInfo * runtime( void ) 21 RuntimeInfo * runtime( void )
22 { if( RT == 0 ) 22 { if( RT == 0 )
23 RT = new BluetoothRFCOMMRun( this, Data ); 23 RT = new BluetoothRFCOMMRun( this, Data );
24 return RT; 24 return RT;
25 } 25 }
26 26
27 virtual void * data( void ) 27 virtual void * data( void )
28 { return (void *)&Data; } 28 { return (void *)&Data; }
29 29
30 virtual bool hasDataFor( const QString & S );
31 virtual bool generateDataForCommonFile( SystemFile & SF, long );
32
30protected : 33protected :
31 34
32 virtual void setSpecificAttribute( QString & Attr, QString & Value ); 35 virtual void setSpecificAttribute( QString & Attr, QString & Value );
33 virtual void saveSpecificAttribute( QTextStream & TS ); 36 virtual void saveSpecificAttribute( QTextStream & TS );
34 37
35private : 38private :
36 39
37 BluetoothRFCOMMEdit * GUI; 40 BluetoothRFCOMMEdit * GUI;
38 BluetoothRFCOMMData Data; 41 BluetoothRFCOMMData Data;
39 BluetoothRFCOMMRun * RT; 42 BluetoothRFCOMMRun * RT;
40}; 43};
41 44
42#endif 45#endif
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp
index 47272c4..3d1aa69 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp
+++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp
@@ -28,100 +28,96 @@ const QString BluetoothBNEPNetNode::nodeDescription(){
28 return tr("\ 28 return tr("\
29<p>Sets up a bluetooth link using the bluetooth Network profile.</p>\ 29<p>Sets up a bluetooth link using the bluetooth Network profile.</p>\
30<p>Use this to connect two computing devices.</p>\ 30<p>Use this to connect two computing devices.</p>\
31" 31"
32); 32);
33} 33}
34 34
35ANetNodeInstance * BluetoothBNEPNetNode::createInstance( void ) { 35ANetNodeInstance * BluetoothBNEPNetNode::createInstance( void ) {
36 return new ABluetoothBNEP( this ); 36 return new ABluetoothBNEP( this );
37} 37}
38 38
39const char ** BluetoothBNEPNetNode::needs( void ) { 39const char ** BluetoothBNEPNetNode::needs( void ) {
40 return BluetoothBNEPNeeds; 40 return BluetoothBNEPNeeds;
41} 41}
42 42
43const char * BluetoothBNEPNetNode::provides( void ) { 43const char * BluetoothBNEPNetNode::provides( void ) {
44 return "device"; 44 return "device";
45} 45}
46 46
47bool BluetoothBNEPNetNode::generateProperFilesFor( 47bool BluetoothBNEPNetNode::generateProperFilesFor(
48 ANetNodeInstance * ) { 48 ANetNodeInstance * ) {
49 return 1; 49 return 1;
50} 50}
51 51
52bool BluetoothBNEPNetNode::hasDataFor( const QString & S, bool DS ) { 52bool BluetoothBNEPNetNode::hasDataFor( const QString & S ) {
53 return DS && S == "interfaces"; 53 return S == "interfaces";
54} 54}
55 55
56bool BluetoothBNEPNetNode::generateDataForCommonFile( 56bool BluetoothBNEPNetNode::generateDeviceDataForCommonFile(
57 SystemFile & , 57 SystemFile & ,
58 long , 58 long ) {
59 ANetNodeInstance * ) {
60 return 1; 59 return 1;
61} 60}
62 61
63bool BluetoothBNEPNetNode::generateDeviceDataForCommonFile( 62QString BluetoothBNEPNetNode::genNic( long nr ) {
64 SystemFile & , 63 QString S;
65 long , 64 return S.sprintf( "bnep%ld", nr );
66 ANetNodeInstance * ) {
67 return 1;
68} 65}
69 66
70// 67//
71// 68//
72// BLUETOOTH PAN/NAP node 69// BLUETOOTH PAN/NAP node
73// 70//
74// 71//
75 72
76static const char * BluetoothRFCOMMNeeds[] = 73static const char * BluetoothRFCOMMNeeds[] =
77 { 0 74 { 0
78 }; 75 };
79 76
80BluetoothRFCOMMNetNode::BluetoothRFCOMMNetNode() : ANetNode() { 77BluetoothRFCOMMNetNode::BluetoothRFCOMMNetNode() : ANetNode() {
81} 78}
82 79
83BluetoothRFCOMMNetNode::~BluetoothRFCOMMNetNode(){ 80BluetoothRFCOMMNetNode::~BluetoothRFCOMMNetNode(){
84} 81}
85 82
86const QString BluetoothRFCOMMNetNode::nodeDescription(){ 83const QString BluetoothRFCOMMNetNode::nodeDescription(){
87 return tr("\ 84 return tr("\
88<p>Sets up a bluetooth link using the bluetooth serial profile.</p>\ 85<p>Sets up a bluetooth link using the bluetooth serial profile.</p>\
89<p>Use this to connect to a GSM.</p>\ 86<p>Use this to connect to a GSM.</p>\
90" 87"
91); 88);
92} 89}
93 90
94ANetNodeInstance * BluetoothRFCOMMNetNode::createInstance( void ) { 91ANetNodeInstance * BluetoothRFCOMMNetNode::createInstance( void ) {
95 return new ABluetoothRFCOMM( this ); 92 return new ABluetoothRFCOMM( this );
96} 93}
97 94
98const char ** BluetoothRFCOMMNetNode::needs( void ) { 95const char ** BluetoothRFCOMMNetNode::needs( void ) {
99 return BluetoothRFCOMMNeeds; 96 return BluetoothRFCOMMNeeds;
100} 97}
101 98
102const char * BluetoothRFCOMMNetNode::provides( void ) { 99const char * BluetoothRFCOMMNetNode::provides( void ) {
103 return "line"; 100 return "line";
104} 101}
105 102
106bool BluetoothRFCOMMNetNode::generateProperFilesFor( 103bool BluetoothRFCOMMNetNode::generateProperFilesFor(
107 ANetNodeInstance * ) { 104 ANetNodeInstance * ) {
108 return 0; 105 return 0;
109} 106}
110 107
111bool BluetoothRFCOMMNetNode::hasDataFor( const QString &, bool ) { 108bool BluetoothRFCOMMNetNode::hasDataFor( const QString & ) {
112 return 0; 109 return 0;
113} 110}
114 111
115bool BluetoothRFCOMMNetNode::generateDataForCommonFile( 112bool BluetoothRFCOMMNetNode::generateDeviceDataForCommonFile(
116 SystemFile & , 113 SystemFile & ,
117 long, 114 long ) {
118 ANetNodeInstance * ) {
119 return 0; 115 return 0;
120} 116}
121 117
122extern "C" { 118extern "C" {
123void create_plugin( QList<ANetNode> & PNN ) { 119void create_plugin( QList<ANetNode> & PNN ) {
124 PNN.append( new BluetoothBNEPNetNode() ); 120 PNN.append( new BluetoothBNEPNetNode() );
125 PNN.append( new BluetoothRFCOMMNetNode() ); 121 PNN.append( new BluetoothRFCOMMNetNode() );
126} 122}
127} 123}
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
index d72b0d4..5cd6c52 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
@@ -7,73 +7,73 @@ class ABluetoothBNEP;
7 7
8class BluetoothBNEPNetNode : public ANetNode { 8class BluetoothBNEPNetNode : public ANetNode {
9 9
10 Q_OBJECT 10 Q_OBJECT
11 11
12public: 12public:
13 13
14 BluetoothBNEPNetNode(); 14 BluetoothBNEPNetNode();
15 virtual ~BluetoothBNEPNetNode(); 15 virtual ~BluetoothBNEPNetNode();
16 16
17 virtual const QString pixmapName() 17 virtual const QString pixmapName()
18 { return "Devices/bluetooth"; } 18 { return "Devices/bluetooth"; }
19 19
20 virtual const QString nodeName() 20 virtual const QString nodeName()
21 { return tr("Bluetooth PAN/NAP"); } 21 { return tr("Bluetooth PAN/NAP"); }
22 22
23 virtual const QString nodeDescription() ; 23 virtual const QString nodeDescription() ;
24 24
25 virtual ANetNodeInstance * createInstance( void ); 25 virtual ANetNodeInstance * createInstance( void );
26 26
27 virtual const char ** needs( void ); 27 virtual const char ** needs( void );
28 virtual const char * provides( void ); 28 virtual const char * provides( void );
29 29
30 virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); 30 virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
31 virtual bool hasDataFor( const QString & S, bool DS ); 31 virtual bool hasDataFor( const QString & S );
32 virtual bool generateDataForCommonFile(
33 SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
34 virtual bool generateDeviceDataForCommonFile( 32 virtual bool generateDeviceDataForCommonFile(
35 SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); 33 SystemFile & , long DevNr );
34
35 virtual long instanceCount( void )
36 { return 7; }
37 virtual QString genNic( long );
36 38
37private: 39private:
38 40
39}; 41};
40 42
41class BluetoothRFCOMMNetNode : public ANetNode { 43class BluetoothRFCOMMNetNode : public ANetNode {
42 44
43 Q_OBJECT 45 Q_OBJECT
44 46
45public: 47public:
46 48
47 BluetoothRFCOMMNetNode(); 49 BluetoothRFCOMMNetNode();
48 virtual ~BluetoothRFCOMMNetNode(); 50 virtual ~BluetoothRFCOMMNetNode();
49 51
50 virtual const QString pixmapName() 52 virtual const QString pixmapName()
51 { return "Devices/bluetooth"; } 53 { return "Devices/bluetooth"; }
52 54
53 virtual const QString nodeName() 55 virtual const QString nodeName()
54 { return tr("Bluetooth serial link"); } 56 { return tr("Bluetooth serial link"); }
55 57
56 virtual const QString nodeDescription() ; 58 virtual const QString nodeDescription() ;
57 59
58 virtual ANetNodeInstance * createInstance( void ); 60 virtual ANetNodeInstance * createInstance( void );
59 61
60 virtual const char ** needs( void ); 62 virtual const char ** needs( void );
61 virtual const char * provides( void ); 63 virtual const char * provides( void );
62 64
63 virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); 65 virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
64 virtual bool hasDataFor( const QString & S, bool ); 66 virtual bool hasDataFor( const QString & S );
65 virtual bool generateDataForCommonFile(
66 SystemFile & SF, long, ANetNodeInstance * NNI );
67 virtual bool generateDeviceDataForCommonFile( 67 virtual bool generateDeviceDataForCommonFile(
68 SystemFile & SF, long, ANetNodeInstance * NNI ); 68 SystemFile & , long );
69 69
70private: 70private:
71 71
72}; 72};
73 73
74extern "C" 74extern "C"
75{ 75{
76 void create_plugin( QList<ANetNode> & PNN ); 76 void create_plugin( QList<ANetNode> & PNN );
77}; 77};
78 78
79#endif 79#endif