summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/networksettings2/netnode.h
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings2/networksettings2/netnode.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.h92
1 files changed, 8 insertions, 84 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.h b/noncore/settings/networksettings2/networksettings2/netnode.h
index 9681c6e..6ec9ef6 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.h
+++ b/noncore/settings/networksettings2/networksettings2/netnode.h
@@ -106,35 +106,43 @@ public:
{ return strcmp( provides(), "fullsetup") == 0 ; }
// generate NIC name based on instance nr
// only relevant if node instances are devices
virtual QString genNic( long )
{ return QString(""); }
// max number of instances for this node type
// only relevant if node instances are devices
virtual long instanceCount( void )
{ return 1; }
+ // set the value of an attribute
+ void setAttribute( QString & Attr, QString & Value ) ;
+ void saveAttributes( QTextStream & TS ) ;
+
// compiled references to 'needed' NetNodes -> needs list
void setAlternatives( NetNodeList * Alt )
{ Alternatives = Alt; }
NetNodeList & alternatives( void )
{ return *Alternatives; }
protected :
NetNodeList * Alternatives;
private :
+
+ virtual void setSpecificAttribute( QString & , QString & ) = 0;
+ virtual void saveSpecificAttribute( QTextStream & ) = 0;
+
};
class ANetNodeInstance : public QObject {
public:
ANetNodeInstance( ANetNode * NN ) : QObject()
{ IsModified=0; NodeType = NN; IsNew = TRUE; }
virtual ~ANetNodeInstance( void ) { }
virtual RuntimeInfo * runtime( void ) = 0;
@@ -369,97 +377,13 @@ private :
State_t CurrentState;
QString Name;
// true if this collection was just created (and not
// loaded from file
bool IsNew;
// index in listbox
int Index;
bool IsModified;
};
-//
-// special node that is used to remember entries for plugins
-// that seem missing. This way we never loose data
-//
-
-class FakeNetNode : public ANetNode {
-
-public:
-
- FakeNetNode( ) { };
- virtual ~FakeNetNode(){};
-
- const QString pixmapName()
- { return QString(""); }
- const QString nodeName()
- { return QString("Fake node" ); }
- const QString nodeDescription()
- { return QString("Fake node" ); }
- ANetNodeInstance * createInstance( void );
- const char * provides( void )
- { return ""; }
- virtual const char ** needs( void )
- { return 0; }
- virtual bool generateProperFilesFor( ANetNodeInstance * )
- { return 0; }
- virtual bool hasDataFor( const QString & )
- { return 0; }
- virtual bool generateDeviceDataForCommonFile(
- SystemFile & , long )
- {return 1; }
-
-private :
-
-};
-
-class FakeNetNodeInstance : public ANetNodeInstance {
-
-public:
-
- FakeNetNodeInstance( ANetNode * NN ) :
- ANetNodeInstance( NN ), ValAttrPairs() { }
- virtual ~FakeNetNodeInstance( void ) { }
-
- virtual RuntimeInfo * runtime( void )
- { return 0; }
-
- // create edit widget under parent
- virtual QWidget * edit( QWidget * )
- { return 0; }
- // is given data acceptable
- virtual QString acceptable( void )
- { return QString(""); }
-
- // get data from GUI and store in node
- virtual void commit( void ) {}
-
- // get next node
- ANetNodeInstance * nextNode()
- { return 0; }
- // return NetNode this is an instance of
-
- // intialize am instance of a net node
- void initialize( void ){}
-
- // returns node specific data -> only useful for 'buddy'
- virtual void * data( void )
- { return 0; }
-
- virtual bool hasDataFor( const QString & )
- { return 0; }
-
- virtual bool generateDataForCommonFile( SystemFile & , long )
- { return 1; }
-
-protected :
-
- virtual void setSpecificAttribute( QString & , QString & );
- virtual void saveSpecificAttribute( QTextStream & );
-
- QDict<QString> ValAttrPairs;
-};
-
-extern FakeNetNode * FakeNode;
-
#endif