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
@@ -18,24 +18,27 @@ public :
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};
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,28 +1,23 @@
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 )
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
@@ -18,24 +18,27 @@ public :
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
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
@@ -40,40 +40,37 @@ const 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
@@ -99,29 +96,28 @@ const 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
@@ -19,29 +19,31 @@ public:
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();
@@ -52,28 +54,26 @@ public:
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