Diffstat (limited to 'noncore/settings/networksettings2/irda') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/irda/config.in | 4 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irda.pro | 17 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irdaGUI.ui | 131 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irda_NN.cpp | 59 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irda_NN.h | 44 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irda_NNI.cpp | 30 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irda_NNI.h | 43 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irdadata.h | 18 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irdaedit.cpp | 17 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irdaedit.h | 12 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irdarun.h | 22 |
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 @@ + config NS2IRDA + boolean "opie-networksettings2plugin-irda (set up IRDA)" + default "n" if NS2 + 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 @@ +TEMPLATE = lib +CONFIG += qt warn_on release +DESTDIR = $(OPIEDIR)/plugins/networksettings2 +HEADERS = irda_NN.h \ + irda_NNI.h \ + irdaedit.h +SOURCES = irda_NN.cpp \ + irda_NNI.cpp \ + irdaedit.cpp +INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2 +DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2 +LIBS += -lqpe +INTERFACES = irdaGUI.ui +TARGET = irda +VERSION = 1.0.0 + +include ( $(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 @@ +<!DOCTYPE UI><UI> +<class>IRDAGUI</class> +<widget> + <class>QWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>IRDA_FRM</cstring> + </property> + <property stdset="1"> + <name>geometry</name> + <rect> + <x>0</x> + <y>0</y> + <width>283</width> + <height>199</height> + </rect> + </property> + <property stdset="1"> + <name>caption</name> + <string>IRDA</string> + </property> + <property> + <name>layoutMargin</name> + </property> + <property> + <name>layoutSpacing</name> + </property> + <vbox> + <property stdset="1"> + <name>margin</name> + <number>2</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>2</number> + </property> + <widget> + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout4</cstring> + </property> + <hbox> + <property stdset="1"> + <name>margin</name> + <number>0</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget> + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel4</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Name</string> + </property> + </widget> + <widget> + <class>QLineEdit</class> + <property stdset="1"> + <name>name</name> + <cstring>Name_LE</cstring> + </property> + </widget> + </hbox> + </widget> + <widget> + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel3</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Description</string> + </property> + </widget> + <widget> + <class>QMultiLineEdit</class> + <property stdset="1"> + <name>name</name> + <cstring>Description_LE</cstring> + </property> + </widget> + <widget> + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout5</cstring> + </property> + <hbox> + <property stdset="1"> + <name>margin</name> + <number>0</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget> + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>Automatic_CB</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Start automatically</string> + </property> + </widget> + <widget> + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>Confirm_CB</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Confirm before start</string> + </property> + </widget> + </hbox> + </widget> + </vbox> +</widget> +</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 @@ +#include "irda_NN.h" +#include "irda_NNI.h" + +static const char * IRDANeeds[] = + { 0 + }; + +/** + * Constructor, find all of the possible interfaces + */ +IRDANetNode::IRDANetNode() : ANetNode() { +} + +/** + * Delete any interfaces that we own. + */ +IRDANetNode::~IRDANetNode(){ +} + +const QString IRDANetNode::nodeDescription(){ + return tr("\ +<p>Sets up a infra red serial link.</p>\ +" +); +} + +ANetNodeInstance * IRDANetNode::createInstance( void ) { + return new AIRDA( this ); +} + +const char ** IRDANetNode::needs( void ) { + return IRDANeeds; +} + +const char * IRDANetNode::provides( void ) { + return "line"; +} + +bool IRDANetNode::generateProperFilesFor( + ANetNodeInstance * ) { + return 1; +} + +bool IRDANetNode::hasDataFor( const QString & ) { + return 0; +} + +bool IRDANetNode::generateDataForCommonFile( + SystemFile & , + long , + ANetNodeInstance * ) { + return 1; +} + +extern "C" { +void create_plugin( QList<ANetNode> & PNN ) { + PNN.append( new IRDANetNode() ); +} +} 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 @@ +#ifndef IRDA_NETNODE_H +#define IRDA_NETNODE_H + +#include "netnode.h" + +class AIRDA; + +class IRDANetNode : public ANetNode { + + Q_OBJECT + +public: + + IRDANetNode(); + virtual ~IRDANetNode(); + + virtual const QString pixmapName() + { return "irda"; } + + virtual const QString nodeName() + { return tr("Infrared link"); } + + virtual const QString nodeDescription() ; + + virtual ANetNodeInstance * createInstance( void ); + + virtual const char ** needs( void ); + virtual const char * provides( void ); + + virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); + virtual bool hasDataFor( const QString & S ); + virtual bool generateDataForCommonFile( + SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); + +private: + +}; + +extern "C" +{ + void create_plugin( QList<ANetNode> & PNN ); +}; + +#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 @@ +#include "irdaedit.h" +#include "irda_NNI.h" +#include "irda_NN.h" + +AIRDA::AIRDA( IRDANetNode * PNN ) : ANetNodeInstance( PNN ) { + + GUI = 0; + RT = 0; +} + +void AIRDA::setSpecificAttribute( QString & , QString & ) { +} + +void AIRDA::saveSpecificAttribute( QTextStream & ) { +} + +QWidget * AIRDA::edit( QWidget * parent ) { + GUI = new IRDAEdit( parent ); + GUI->showData( Data ); + return GUI; +} + +QString AIRDA::acceptable( void ) { + return ( GUI ) ? GUI->acceptable( ) : QString(); +} + +void AIRDA::commit( void ) { + if( GUI && GUI->commit( Data ) ) + setModified( 1 ); +} 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 @@ +#ifndef IRDA_H +#define IRDA_H + +#include <netnode.h> +#include "irdadata.h" +#include "irdarun.h" + +class IRDANetNode; +class IRDAEdit; + +class AIRDA : public ANetNodeInstance { + +public : + + AIRDA( IRDANetNode * PNN ); + + QWidget * edit( QWidget * parent ); + QString acceptable( void ); + void commit( void ); + + RuntimeInfo * runtime( void ) + { if( RT == 0 ) + RT = new IRDARun( this, Data ); + return RT; + } + + virtual void * data( void ) + { return (void *)&Data; } + +protected : + + virtual void setSpecificAttribute( QString & Attr, QString & Value ); + virtual void saveSpecificAttribute( QTextStream & TS ); + +private : + + IRDAEdit * GUI; + IRDAData Data; + IRDARun * RT; + +}; + +#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 @@ +#ifndef IRDA_DATA_H +#define IRDA_DATA_H + +#include <qstring.h> + +typedef struct IRDAData { + QString Device; + QString LockFile; + long Speed; + short Parity; + short DataBits; + short StopBits; + bool HardwareControl; + bool SoftwareControl; + +} IRDAData_t; + +#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 @@ +#include <GUIUtils.h> +#include "irdaedit.h" + +IRDAEdit::IRDAEdit( QWidget * Parent ) : IRDAGUI( Parent ){ + +} + +QString IRDAEdit::acceptable( void ) { + return QString(); +} + +bool IRDAEdit::commit( IRDAData & Data ) { + return 0; +} + +void IRDAEdit::showData( IRDAData & Data ) { +} 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 @@ +#include "irdadata.h" +#include "irdaGUI.h" + +class IRDAEdit : public IRDAGUI { + +public : + + IRDAEdit( QWidget * parent ); + QString acceptable( void ); + bool commit( IRDAData & Data ); + void showData( IRDAData & Data ); +}; 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 @@ +#include <asline.h> +#include "irdadata.h" + +class IRDARun : public AsLine { + +public : + + IRDARun( ANetNodeInstance * NNI, + IRDAData & Data ) : AsLine( NNI ) + { } + +protected : + + void detectState( NodeCollection * ) + { } + + bool setState( NodeCollection * , Action_t ) + { return 0; } + + bool canSetState( State_t , Action_t ) + { return 0; } +}; |