summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/vpn
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/vpn') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/vpn/config.in4
-rw-r--r--noncore/settings/networksettings2/vpn/vpn.pro18
-rw-r--r--noncore/settings/networksettings2/vpn/vpnGUI.cpp76
-rw-r--r--noncore/settings/networksettings2/vpn/vpnGUI.h43
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NN.cpp61
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NN.h44
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NNI.cpp30
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NNI.h43
-rw-r--r--noncore/settings/networksettings2/vpn/vpndata.h16
-rw-r--r--noncore/settings/networksettings2/vpn/vpnedit.cpp18
-rw-r--r--noncore/settings/networksettings2/vpn/vpnedit.h12
-rw-r--r--noncore/settings/networksettings2/vpn/vpnrun.cpp6
-rw-r--r--noncore/settings/networksettings2/vpn/vpnrun.h30
13 files changed, 401 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/vpn/config.in b/noncore/settings/networksettings2/vpn/config.in
new file mode 100644
index 0000000..796f996
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/config.in
@@ -0,0 +1,4 @@
1 config NS2VPN
2 boolean "opie-networksettings2plugin-vpn (set up VPN)"
3 default "n" if NS2
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE
diff --git a/noncore/settings/networksettings2/vpn/vpn.pro b/noncore/settings/networksettings2/vpn/vpn.pro
new file mode 100644
index 0000000..81b4d08
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpn.pro
@@ -0,0 +1,18 @@
1TEMPLATE = lib
2CONFIG += qt warn_on release
3DESTDIR = $(OPIEDIR)/plugins/networksettings2
4 HEADERS = vpn_NN.h \
5 vpn_NNI.h \
6 vpnedit.h
7 SOURCES = vpn_NN.cpp \
8 vpn_NNI.cpp \
9 vpnedit.cpp \
10 vpnrun.cpp
11 INCLUDEPATH+= $(OPIEDIR)/include ../ ../networksettings2
12 DEPENDPATH+= $(OPIEDIR)/include ../ ../networksettings2
13LIBS += -lqpe
14 INTERFACES= vpnGUI.ui
15 TARGET = vpn
16 VERSION = 1.0.0
17
18include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/networksettings2/vpn/vpnGUI.cpp b/noncore/settings/networksettings2/vpn/vpnGUI.cpp
new file mode 100644
index 0000000..708c92b
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpnGUI.cpp
@@ -0,0 +1,76 @@
1/****************************************************************************
2** Form implementation generated from reading ui file 'vpnGUI.ui'
3**
4** Created: Tue Mar 30 02:42:53 2004
5** by: The User Interface Compiler (uic)
6**
7** WARNING! All changes made in this file will be lost!
8****************************************************************************/
9#include "vpnGUI.h"
10
11#include <qcheckbox.h>
12#include <qlabel.h>
13#include <qlineedit.h>
14#include <qmultilineedit.h>
15#include <qpushbutton.h>
16#include <qlayout.h>
17#include <qvariant.h>
18#include <qtooltip.h>
19#include <qwhatsthis.h>
20
21/*
22 * Constructs a VPNGUI which is a child of 'parent', with the
23 * name 'name' and widget flags set to 'f'
24 */
25VPNGUI::VPNGUI( QWidget* parent, const char* name, WFlags fl )
26 : QWidget( parent, name, fl )
27{
28 if ( !name )
29 setName( "VPN_FRM" );
30 resize( 283, 199 );
31 setCaption( tr( "VPN" ) );
32 VPN_FRMLayout = new QVBoxLayout( this );
33 VPN_FRMLayout->setSpacing( 2 );
34 VPN_FRMLayout->setMargin( 2 );
35
36 Layout4 = new QHBoxLayout;
37 Layout4->setSpacing( 6 );
38 Layout4->setMargin( 0 );
39
40 TextLabel4 = new QLabel( this, "TextLabel4" );
41 TextLabel4->setText( tr( "Name" ) );
42 Layout4->addWidget( TextLabel4 );
43
44 Name_LE = new QLineEdit( this, "Name_LE" );
45 Layout4->addWidget( Name_LE );
46 VPN_FRMLayout->addLayout( Layout4 );
47
48 TextLabel3 = new QLabel( this, "TextLabel3" );
49 TextLabel3->setText( tr( "Description" ) );
50 VPN_FRMLayout->addWidget( TextLabel3 );
51
52 Description_LE = new QMultiLineEdit( this, "Description_LE" );
53 VPN_FRMLayout->addWidget( Description_LE );
54
55 Layout5 = new QHBoxLayout;
56 Layout5->setSpacing( 6 );
57 Layout5->setMargin( 0 );
58
59 Automatic_CB = new QCheckBox( this, "Automatic_CB" );
60 Automatic_CB->setText( tr( "Start automatically" ) );
61 Layout5->addWidget( Automatic_CB );
62
63 Confirm_CB = new QCheckBox( this, "Confirm_CB" );
64 Confirm_CB->setText( tr( "Confirm before start" ) );
65 Layout5->addWidget( Confirm_CB );
66 VPN_FRMLayout->addLayout( Layout5 );
67}
68
69/*
70 * Destroys the object and frees any allocated resources
71 */
72VPNGUI::~VPNGUI()
73{
74 // no need to delete child widgets, Qt does it all for us
75}
76
diff --git a/noncore/settings/networksettings2/vpn/vpnGUI.h b/noncore/settings/networksettings2/vpn/vpnGUI.h
new file mode 100644
index 0000000..fcc3e54
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpnGUI.h
@@ -0,0 +1,43 @@
1/****************************************************************************
2** Form interface generated from reading ui file 'vpnGUI.ui'
3**
4** Created: Tue Mar 30 02:42:50 2004
5** by: The User Interface Compiler (uic)
6**
7** WARNING! All changes made in this file will be lost!
8****************************************************************************/
9#ifndef VPN_FRM_H
10#define VPN_FRM_H
11
12#include <qvariant.h>
13#include <qwidget.h>
14class QVBoxLayout;
15class QHBoxLayout;
16class QGridLayout;
17class QCheckBox;
18class QLabel;
19class QLineEdit;
20class QMultiLineEdit;
21
22class VPNGUI : public QWidget
23{
24 Q_OBJECT
25
26public:
27 VPNGUI( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
28 ~VPNGUI();
29
30 QLabel* TextLabel4;
31 QLineEdit* Name_LE;
32 QLabel* TextLabel3;
33 QMultiLineEdit* Description_LE;
34 QCheckBox* Automatic_CB;
35 QCheckBox* Confirm_CB;
36
37protected:
38 QVBoxLayout* VPN_FRMLayout;
39 QHBoxLayout* Layout4;
40 QHBoxLayout* Layout5;
41};
42
43#endif // VPN_FRM_H
diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.cpp b/noncore/settings/networksettings2/vpn/vpn_NN.cpp
new file mode 100644
index 0000000..c800929
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpn_NN.cpp
@@ -0,0 +1,61 @@
1#include "vpn_NN.h"
2#include "vpn_NNI.h"
3
4static const char * VPNNeeds[] =
5 { "connection",
6 0
7 };
8
9/**
10 * Constructor, find all of the possible interfaces
11 */
12VPNNetNode::VPNNetNode() : ANetNode() {
13}
14
15/**
16 * Delete any interfaces that we own.
17 */
18VPNNetNode::~VPNNetNode(){
19}
20
21const QString VPNNetNode::nodeDescription(){
22 return tr("\
23<p>Configure private IP connection.</p>\
24<p>Defines Secure tunnels over non secure IP sessions</p>\
25"
26);
27}
28
29ANetNodeInstance * VPNNetNode::createInstance( void ) {
30 return new AVPN( this );
31}
32
33const char ** VPNNetNode::needs( void ) {
34 return VPNNeeds;
35}
36
37const char * VPNNetNode::provides( void ) {
38 return "connection";
39}
40
41bool VPNNetNode::generateProperFilesFor(
42 ANetNodeInstance * ) {
43 return 1;
44}
45
46bool VPNNetNode::hasDataFor( const QString & ) {
47 return 0;
48}
49
50bool VPNNetNode::generateDataForCommonFile(
51 SystemFile & ,
52 long,
53 ANetNodeInstance * ) {
54 return 1;
55}
56
57extern "C" {
58void create_plugin( QList<ANetNode> & PNN ) {
59 PNN.append( new VPNNetNode() );
60}
61}
diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.h b/noncore/settings/networksettings2/vpn/vpn_NN.h
new file mode 100644
index 0000000..5718961
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpn_NN.h
@@ -0,0 +1,44 @@
1#ifndef VPN_NETNODE_H
2#define VPN_NETNODE_H
3
4#include "netnode.h"
5
6class AVPN;
7
8class VPNNetNode : public ANetNode{
9
10 Q_OBJECT
11
12public:
13
14 VPNNetNode();
15 virtual ~VPNNetNode();
16
17 virtual const QString pixmapName()
18 { return "vpn"; }
19
20 virtual const QString nodeName()
21 { return tr("VPN Connection"); }
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/vpn/vpn_NNI.cpp b/noncore/settings/networksettings2/vpn/vpn_NNI.cpp
new file mode 100644
index 0000000..6c20aeb
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpn_NNI.cpp
@@ -0,0 +1,30 @@
1#include "vpnedit.h"
2#include "vpn_NNI.h"
3#include "vpn_NN.h"
4
5AVPN::AVPN( VPNNetNode * PNN ) : ANetNodeInstance( PNN ) {
6 GUI = 0;
7 RT = 0;
8}
9
10void AVPN::setSpecificAttribute( QString & , QString & ) {
11}
12
13void AVPN::saveSpecificAttribute( QTextStream & ) {
14}
15
16QWidget * AVPN::edit( QWidget * parent ) {
17 GUI = new VPNEdit( parent );
18 GUI->showData( Data );
19 return GUI;
20}
21
22QString AVPN::acceptable( void ) {
23 return ( GUI ) ? GUI->acceptable( ) : QString();
24}
25
26void AVPN::commit( void ) {
27 if( GUI && GUI->commit( Data ) )
28 setModified( 1 );
29}
30
diff --git a/noncore/settings/networksettings2/vpn/vpn_NNI.h b/noncore/settings/networksettings2/vpn/vpn_NNI.h
new file mode 100644
index 0000000..31ce0d6
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpn_NNI.h
@@ -0,0 +1,43 @@
1#ifndef VPN_H
2#define VPN_H
3
4#include <netnode.h>
5#include "vpndata.h"
6#include "vpnrun.h"
7
8class VPNNetNode;
9class VPNEdit;
10
11class AVPN : public ANetNodeInstance {
12
13public :
14
15 AVPN( VPNNetNode * 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 VPNRun( 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 VPNEdit * GUI;
38 VPNData Data;
39 VPNRun * RT;
40
41};
42
43#endif
diff --git a/noncore/settings/networksettings2/vpn/vpndata.h b/noncore/settings/networksettings2/vpn/vpndata.h
new file mode 100644
index 0000000..5c986aa
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpndata.h
@@ -0,0 +1,16 @@
1#ifndef VPN_DATA_H
2#define VPN_DATA_H
3
4#include <qstring.h>
5typedef struct VPNData {
6 QString Device;
7 QString LockFile;
8 long Speed;
9 short Parity;
10 short DataBits;
11 short StopBits;
12 bool HardwareControl;
13 bool SoftwareControl;
14} VPNData_t;
15
16#endif
diff --git a/noncore/settings/networksettings2/vpn/vpnedit.cpp b/noncore/settings/networksettings2/vpn/vpnedit.cpp
new file mode 100644
index 0000000..f336394
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpnedit.cpp
@@ -0,0 +1,18 @@
1#include <GUIUtils.h>
2#include "vpnedit.h"
3
4
5VPNEdit::VPNEdit( QWidget * Parent ) : VPNGUI( Parent ){
6
7}
8
9QString VPNEdit::acceptable( void ) {
10 return QString();
11}
12
13void VPNEdit::showData( VPNData_t & Data ) {
14}
15
16bool VPNEdit::commit( VPNData_t & Data ) {
17 return 0;
18}
diff --git a/noncore/settings/networksettings2/vpn/vpnedit.h b/noncore/settings/networksettings2/vpn/vpnedit.h
new file mode 100644
index 0000000..76480cd
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpnedit.h
@@ -0,0 +1,12 @@
1#include "vpndata.h"
2#include "vpnGUI.h"
3
4class VPNEdit : public VPNGUI {
5
6public :
7
8 VPNEdit( QWidget * parent );
9 QString acceptable( void );
10 bool commit( VPNData_t & Data );
11 void showData( VPNData_t & Data );
12};
diff --git a/noncore/settings/networksettings2/vpn/vpnrun.cpp b/noncore/settings/networksettings2/vpn/vpnrun.cpp
new file mode 100644
index 0000000..ab2966c
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpnrun.cpp
@@ -0,0 +1,6 @@
1#include "vpnrun.h"
2
3bool VPNRun::handlesInterface( const QString & ) {
4 // to be figured out
5 return 0;
6}
diff --git a/noncore/settings/networksettings2/vpn/vpnrun.h b/noncore/settings/networksettings2/vpn/vpnrun.h
new file mode 100644
index 0000000..c221fd0
--- a/dev/null
+++ b/noncore/settings/networksettings2/vpn/vpnrun.h
@@ -0,0 +1,30 @@
1#ifndef VPNRUN_H
2#define VPNRUN_H
3
4#include <asconnection.h>
5#include "vpndata.h"
6
7class VPNRun : public AsConnection {
8
9public :
10
11 VPNRun( ANetNodeInstance * NNI, VPNData & Data ) :
12 AsConnection( NNI )
13 { }
14
15protected :
16
17 void detectState( NodeCollection * )
18 { }
19
20 bool setState( NodeCollection *, Action_t )
21 { return 0; }
22
23 bool canSetState( State_t, Action_t )
24 { return 0; }
25
26 bool handlesInterface( const QString & I );
27
28};
29
30#endif