summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/irda
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/irda') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/irda/config.in4
-rw-r--r--noncore/settings/networksettings2/irda/irda.pro17
-rw-r--r--noncore/settings/networksettings2/irda/irdaGUI.ui131
-rw-r--r--noncore/settings/networksettings2/irda/irda_NN.cpp59
-rw-r--r--noncore/settings/networksettings2/irda/irda_NN.h44
-rw-r--r--noncore/settings/networksettings2/irda/irda_NNI.cpp30
-rw-r--r--noncore/settings/networksettings2/irda/irda_NNI.h43
-rw-r--r--noncore/settings/networksettings2/irda/irdadata.h18
-rw-r--r--noncore/settings/networksettings2/irda/irdaedit.cpp17
-rw-r--r--noncore/settings/networksettings2/irda/irdaedit.h12
-rw-r--r--noncore/settings/networksettings2/irda/irdarun.h22
11 files changed, 397 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/irda/config.in b/noncore/settings/networksettings2/irda/config.in
new file mode 100644
index 0000000..997cf55
--- a/dev/null
+++ b/noncore/settings/networksettings2/irda/config.in
@@ -0,0 +1,4 @@
1 config NS2IRDA
2 boolean "opie-networksettings2plugin-irda (set up IRDA)"
3 default "n" if NS2
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE
diff --git a/noncore/settings/networksettings2/irda/irda.pro b/noncore/settings/networksettings2/irda/irda.pro
new file mode 100644
index 0000000..a7573b8
--- a/dev/null
+++ b/noncore/settings/networksettings2/irda/irda.pro
@@ -0,0 +1,17 @@
1TEMPLATE = lib
2CONFIG += qt warn_on release
3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = irda_NN.h \
5 irda_NNI.h \
6 irdaedit.h
7 SOURCES = irda_NN.cpp \
8 irda_NNI.cpp \
9 irdaedit.cpp
10 INCLUDEPATH+= $(OPIEDIR)/include ../ ../networksettings2
11 DEPENDPATH+= $(OPIEDIR)/include ../ ../networksettings2
12LIBS += -lqpe
13 INTERFACES= irdaGUI.ui
14 TARGET = irda
15 VERSION = 1.0.0
16
17include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/networksettings2/irda/irdaGUI.ui b/noncore/settings/networksettings2/irda/irdaGUI.ui
new file mode 100644
index 0000000..f8a7020
--- a/dev/null
+++ b/noncore/settings/networksettings2/irda/irdaGUI.ui
@@ -0,0 +1,131 @@
1<!DOCTYPE UI><UI>
2<class>IRDAGUI</class>
3<widget>
4 <class>QWidget</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>IRDA_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>IRDA</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/irda/irda_NN.cpp b/noncore/settings/networksettings2/irda/irda_NN.cpp
new file mode 100644
index 0000000..3b9c938
--- a/dev/null
+++ b/noncore/settings/networksettings2/irda/irda_NN.cpp
@@ -0,0 +1,59 @@
1#include "irda_NN.h"
2#include "irda_NNI.h"
3
4static const char * IRDANeeds[] =
5 { 0
6 };
7
8/**
9 * Constructor, find all of the possible interfaces
10 */
11IRDANetNode::IRDANetNode() : ANetNode() {
12}
13
14/**
15 * Delete any interfaces that we own.
16 */
17IRDANetNode::~IRDANetNode(){
18}
19
20const QString IRDANetNode::nodeDescription(){
21 return tr("\
22<p>Sets up a infra red serial link.</p>\
23"
24);
25}
26
27ANetNodeInstance * IRDANetNode::createInstance( void ) {
28 return new AIRDA( this );
29}
30
31const char ** IRDANetNode::needs( void ) {
32 return IRDANeeds;
33}
34
35const char * IRDANetNode::provides( void ) {
36 return "line";
37}
38
39bool IRDANetNode::generateProperFilesFor(
40 ANetNodeInstance * ) {
41 return 1;
42}
43
44bool IRDANetNode::hasDataFor( const QString & ) {
45 return 0;
46}
47
48bool IRDANetNode::generateDataForCommonFile(
49 SystemFile & ,
50 long ,
51 ANetNodeInstance * ) {
52 return 1;
53}
54
55extern "C" {
56void create_plugin( QList<ANetNode> & PNN ) {
57 PNN.append( new IRDANetNode() );
58}
59}
diff --git a/noncore/settings/networksettings2/irda/irda_NN.h b/noncore/settings/networksettings2/irda/irda_NN.h
new file mode 100644
index 0000000..82811a4
--- a/dev/null
+++ b/noncore/settings/networksettings2/irda/irda_NN.h
@@ -0,0 +1,44 @@
1#ifndef IRDA_NETNODE_H
2#define IRDA_NETNODE_H
3
4#include "netnode.h"
5
6class AIRDA;
7
8class IRDANetNode : public ANetNode {
9
10 Q_OBJECT
11
12public:
13
14 IRDANetNode();
15 virtual ~IRDANetNode();
16
17 virtual const QString pixmapName()
18 { return "irda"; }
19
20 virtual const QString nodeName()
21 { return tr("Infrared link"); }
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
35private:
36
37};
38
39extern "C"
40{
41 void create_plugin( QList<ANetNode> & PNN );
42};
43
44#endif
diff --git a/noncore/settings/networksettings2/irda/irda_NNI.cpp b/noncore/settings/networksettings2/irda/irda_NNI.cpp
new file mode 100644
index 0000000..78d6ff9
--- a/dev/null
+++ b/noncore/settings/networksettings2/irda/irda_NNI.cpp
@@ -0,0 +1,30 @@
1#include "irdaedit.h"
2#include "irda_NNI.h"
3#include "irda_NN.h"
4
5AIRDA::AIRDA( IRDANetNode * PNN ) : ANetNodeInstance( PNN ) {
6
7 GUI = 0;
8 RT = 0;
9}
10
11void AIRDA::setSpecificAttribute( QString & , QString & ) {
12}
13
14void AIRDA::saveSpecificAttribute( QTextStream & ) {
15}
16
17QWidget * AIRDA::edit( QWidget * parent ) {
18 GUI = new IRDAEdit( parent );
19 GUI->showData( Data );
20 return GUI;
21}
22
23QString AIRDA::acceptable( void ) {
24 return ( GUI ) ? GUI->acceptable( ) : QString();
25}
26
27void AIRDA::commit( void ) {
28 if( GUI && GUI->commit( Data ) )
29 setModified( 1 );
30}
diff --git a/noncore/settings/networksettings2/irda/irda_NNI.h b/noncore/settings/networksettings2/irda/irda_NNI.h
new file mode 100644
index 0000000..c2d6875
--- a/dev/null
+++ b/noncore/settings/networksettings2/irda/irda_NNI.h
@@ -0,0 +1,43 @@
1#ifndef IRDA_H
2#define IRDA_H
3
4#include <netnode.h>
5#include "irdadata.h"
6#include "irdarun.h"
7
8class IRDANetNode;
9class IRDAEdit;
10
11class AIRDA : public ANetNodeInstance {
12
13public :
14
15 AIRDA( IRDANetNode * 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 IRDARun( this, Data );
24 return RT;
25 }
26
27 virtual void * data( void )
28 { return (void *)&Data; }
29
30protected :
31
32 virtual void setSpecificAttribute( QString & Attr, QString & Value );
33 virtual void saveSpecificAttribute( QTextStream & TS );
34
35private :
36
37 IRDAEdit * GUI;
38 IRDAData Data;
39 IRDARun * RT;
40
41};
42
43#endif
diff --git a/noncore/settings/networksettings2/irda/irdadata.h b/noncore/settings/networksettings2/irda/irdadata.h
new file mode 100644
index 0000000..c3c683e
--- a/dev/null
+++ b/noncore/settings/networksettings2/irda/irdadata.h
@@ -0,0 +1,18 @@
1#ifndef IRDA_DATA_H
2#define IRDA_DATA_H
3
4#include <qstring.h>
5
6typedef struct IRDAData {
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} IRDAData_t;
17
18#endif
diff --git a/noncore/settings/networksettings2/irda/irdaedit.cpp b/noncore/settings/networksettings2/irda/irdaedit.cpp
new file mode 100644
index 0000000..2dfdce5
--- a/dev/null
+++ b/noncore/settings/networksettings2/irda/irdaedit.cpp
@@ -0,0 +1,17 @@
1#include <GUIUtils.h>
2#include "irdaedit.h"
3
4IRDAEdit::IRDAEdit( QWidget * Parent ) : IRDAGUI( Parent ){
5
6}
7
8QString IRDAEdit::acceptable( void ) {
9 return QString();
10}
11
12bool IRDAEdit::commit( IRDAData & Data ) {
13 return 0;
14}
15
16void IRDAEdit::showData( IRDAData & Data ) {
17}
diff --git a/noncore/settings/networksettings2/irda/irdaedit.h b/noncore/settings/networksettings2/irda/irdaedit.h
new file mode 100644
index 0000000..5131126
--- a/dev/null
+++ b/noncore/settings/networksettings2/irda/irdaedit.h
@@ -0,0 +1,12 @@
1#include "irdadata.h"
2#include "irdaGUI.h"
3
4class IRDAEdit : public IRDAGUI {
5
6public :
7
8 IRDAEdit( QWidget * parent );
9 QString acceptable( void );
10 bool commit( IRDAData & Data );
11 void showData( IRDAData & Data );
12};
diff --git a/noncore/settings/networksettings2/irda/irdarun.h b/noncore/settings/networksettings2/irda/irdarun.h
new file mode 100644
index 0000000..adc9c24
--- a/dev/null
+++ b/noncore/settings/networksettings2/irda/irdarun.h
@@ -0,0 +1,22 @@
1#include <asline.h>
2#include "irdadata.h"
3
4class IRDARun : public AsLine {
5
6public :
7
8 IRDARun( ANetNodeInstance * NNI,
9 IRDAData & Data ) : AsLine( NNI )
10 { }
11
12protected :
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};