Diffstat (limited to 'noncore/settings/networksettings2/networksettings2/netnode.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings2/netnode.h | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.h b/noncore/settings/networksettings2/networksettings2/netnode.h index f4a5e30..9681c6e 100644 --- a/noncore/settings/networksettings2/networksettings2/netnode.h +++ b/noncore/settings/networksettings2/networksettings2/netnode.h | |||
@@ -92,26 +92,32 @@ public: | |||
92 | virtual const char ** needs( void ) = 0; | 92 | virtual const char ** needs( void ) = 0; |
93 | 93 | ||
94 | // generate files specific for this node (if any) | 94 | // generate files specific for this node (if any) |
95 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ) = 0; | 95 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ) = 0; |
96 | // return TRUE if this node has data to be inserted in systemfile | 96 | // return TRUE if this node has data to be inserted in systemfile |
97 | // with name S | 97 | // with name S |
98 | virtual bool hasDataFor( const QString & S, bool DeviceSpecific ) = 0; | 98 | virtual bool hasDataFor( const QString & S ) = 0; |
99 | // generate data specific for a profile and for the system file S | ||
100 | // called only IF data was needed | ||
101 | virtual bool generateDataForCommonFile( | ||
102 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ) = 0; | ||
103 | // generate data specific for the device for the system file S | 99 | // generate data specific for the device for the system file S |
104 | // called only IF data was needed | 100 | // called only IF data was needed |
105 | virtual bool generateDeviceDataForCommonFile( | 101 | virtual bool generateDeviceDataForCommonFile( |
106 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ) = 0; | 102 | SystemFile & SF, long DevNr ) = 0; |
107 | 103 | ||
108 | // does this Node provide a Connection | 104 | // does this Node provide a Connection |
109 | bool isToplevel( void ) | 105 | bool isToplevel( void ) |
110 | { return strcmp( provides(), "fullsetup") == 0 ; } | 106 | { return strcmp( provides(), "fullsetup") == 0 ; } |
111 | 107 | ||
108 | // generate NIC name based on instance nr | ||
109 | // only relevant if node instances are devices | ||
110 | virtual QString genNic( long ) | ||
111 | { return QString(""); } | ||
112 | |||
113 | // max number of instances for this node type | ||
114 | // only relevant if node instances are devices | ||
115 | virtual long instanceCount( void ) | ||
116 | { return 1; } | ||
117 | |||
112 | // compiled references to 'needed' NetNodes -> needs list | 118 | // compiled references to 'needed' NetNodes -> needs list |
113 | void setAlternatives( NetNodeList * Alt ) | 119 | void setAlternatives( NetNodeList * Alt ) |
114 | { Alternatives = Alt; } | 120 | { Alternatives = Alt; } |
115 | NetNodeList & alternatives( void ) | 121 | NetNodeList & alternatives( void ) |
116 | { return *Alternatives; } | 122 | { return *Alternatives; } |
117 | 123 | ||
@@ -151,13 +157,13 @@ public: | |||
151 | // get data from GUI and store in node | 157 | // get data from GUI and store in node |
152 | virtual void commit( void ) = 0; | 158 | virtual void commit( void ) = 0; |
153 | 159 | ||
154 | // get next node | 160 | // get next node |
155 | ANetNodeInstance * nextNode(); | 161 | ANetNodeInstance * nextNode(); |
156 | // return NetNode this is an instance of | 162 | // return NetNode this is an instance of |
157 | ANetNode * netNode( void ) | 163 | ANetNode * nodeClass( void ) |
158 | { return NodeType; } | 164 | { return NodeType; } |
159 | 165 | ||
160 | // intialize am instance of a net node | 166 | // intialize am instance of a net node |
161 | void initialize( void ); | 167 | void initialize( void ); |
162 | 168 | ||
163 | // set the value of an attribute | 169 | // set the value of an attribute |
@@ -191,12 +197,21 @@ public: | |||
191 | const char ** needs( void ) | 197 | const char ** needs( void ) |
192 | { return NodeType->needs(); } | 198 | { return NodeType->needs(); } |
193 | 199 | ||
194 | // returns node specific data -> only useful for 'buddy' | 200 | // returns node specific data -> only useful for 'buddy' |
195 | virtual void * data( void ) = 0; | 201 | virtual void * data( void ) = 0; |
196 | 202 | ||
203 | // return TRUE if this node has data to be inserted in systemfile | ||
204 | // with name S | ||
205 | virtual bool hasDataFor( const QString & S ) = 0; | ||
206 | |||
207 | // generate data specific for a profile and for the system file S | ||
208 | // called only IF data was needed | ||
209 | virtual bool generateDataForCommonFile( | ||
210 | SystemFile & SF, long DevNr ) = 0; | ||
211 | |||
197 | protected : | 212 | protected : |
198 | 213 | ||
199 | virtual void setSpecificAttribute( QString & , QString & ) = 0; | 214 | virtual void setSpecificAttribute( QString & , QString & ) = 0; |
200 | virtual void saveSpecificAttribute( QTextStream & ) = 0; | 215 | virtual void saveSpecificAttribute( QTextStream & ) = 0; |
201 | 216 | ||
202 | ANetNode * NodeType; | 217 | ANetNode * NodeType; |
@@ -217,19 +232,19 @@ class RuntimeInfo : public QObject { | |||
217 | public : | 232 | public : |
218 | 233 | ||
219 | RuntimeInfo( ANetNodeInstance * TheNNI ) | 234 | RuntimeInfo( ANetNodeInstance * TheNNI ) |
220 | { NNI = TheNNI; } | 235 | { NNI = TheNNI; } |
221 | 236 | ||
222 | // downcast implemented by specify runtime classes | 237 | // downcast implemented by specify runtime classes |
223 | AsDevice * asDevice( void ) | 238 | virtual AsDevice * asDevice( void ) |
224 | { return 0; } | 239 | { return 0; } |
225 | AsConnection * asConnection( void ) | 240 | virtual AsConnection * asConnection( void ) |
226 | { return 0; } | 241 | { return 0; } |
227 | AsLine * asLine( void ) | 242 | virtual AsLine * asLine( void ) |
228 | { return 0; } | 243 | { return 0; } |
229 | AsFullSetup * asFullSetup( void ) | 244 | virtual AsFullSetup * asFullSetup( void ) |
230 | { return 0; } | 245 | { return 0; } |
231 | 246 | ||
232 | // does this node handles this interface e.g.eth0 | 247 | // does this node handles this interface e.g.eth0 |
233 | // recurse deeper if this node cannot answer that question | 248 | // recurse deeper if this node cannot answer that question |
234 | virtual bool handlesInterface( const QString & ) | 249 | virtual bool handlesInterface( const QString & ) |
235 | { return 0; } | 250 | { return 0; } |
@@ -385,19 +400,16 @@ public: | |||
385 | const char * provides( void ) | 400 | const char * provides( void ) |
386 | { return ""; } | 401 | { return ""; } |
387 | virtual const char ** needs( void ) | 402 | virtual const char ** needs( void ) |
388 | { return 0; } | 403 | { return 0; } |
389 | virtual bool generateProperFilesFor( ANetNodeInstance * ) | 404 | virtual bool generateProperFilesFor( ANetNodeInstance * ) |
390 | { return 0; } | 405 | { return 0; } |
391 | virtual bool hasDataFor( const QString &, bool DS ) | 406 | virtual bool hasDataFor( const QString & ) |
392 | { return 0; } | 407 | { return 0; } |
393 | virtual bool generateDataForCommonFile( | ||
394 | SystemFile & , long , ANetNodeInstance * ) | ||
395 | {return 1; } | ||
396 | virtual bool generateDeviceDataForCommonFile( | 408 | virtual bool generateDeviceDataForCommonFile( |
397 | SystemFile & , long , ANetNodeInstance * ) | 409 | SystemFile & , long ) |
398 | {return 1; } | 410 | {return 1; } |
399 | 411 | ||
400 | private : | 412 | private : |
401 | 413 | ||
402 | }; | 414 | }; |
403 | 415 | ||
@@ -431,12 +443,18 @@ public: | |||
431 | void initialize( void ){} | 443 | void initialize( void ){} |
432 | 444 | ||
433 | // returns node specific data -> only useful for 'buddy' | 445 | // returns node specific data -> only useful for 'buddy' |
434 | virtual void * data( void ) | 446 | virtual void * data( void ) |
435 | { return 0; } | 447 | { return 0; } |
436 | 448 | ||
449 | virtual bool hasDataFor( const QString & ) | ||
450 | { return 0; } | ||
451 | |||
452 | virtual bool generateDataForCommonFile( SystemFile & , long ) | ||
453 | { return 1; } | ||
454 | |||
437 | protected : | 455 | protected : |
438 | 456 | ||
439 | virtual void setSpecificAttribute( QString & , QString & ); | 457 | virtual void setSpecificAttribute( QString & , QString & ); |
440 | virtual void saveSpecificAttribute( QTextStream & ); | 458 | virtual void saveSpecificAttribute( QTextStream & ); |
441 | 459 | ||
442 | QDict<QString> ValAttrPairs; | 460 | QDict<QString> ValAttrPairs; |