Diffstat (limited to 'noncore/settings/networksettings2/networksettings2/netnode.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings2/netnode.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.h b/noncore/settings/networksettings2/networksettings2/netnode.h index 0ecd64e..56333c5 100644 --- a/noncore/settings/networksettings2/networksettings2/netnode.h +++ b/noncore/settings/networksettings2/networksettings2/netnode.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <qtextstream.h> | 4 | #include <qtextstream.h> |
5 | #include <qlist.h> | 5 | #include <qlist.h> |
6 | #include <qdict.h> | ||
6 | #include <qpixmap.h> | 7 | #include <qpixmap.h> |
7 | #include <qobject.h> | 8 | #include <qobject.h> |
8 | #include <time.h> | 9 | #include <time.h> |
@@ -358,4 +359,82 @@ private : | |||
358 | 359 | ||
359 | }; | 360 | }; |
360 | 361 | ||
362 | // | ||
363 | // special node that is used to remember entries for plugins | ||
364 | // that seem missing. This way we never loose data | ||
365 | // | ||
366 | |||
367 | class FakeNetNode : public ANetNode { | ||
368 | |||
369 | public: | ||
370 | |||
371 | FakeNetNode( ) { }; | ||
372 | virtual ~FakeNetNode(){}; | ||
373 | |||
374 | const QString pixmapName() | ||
375 | { return QString(""); } | ||
376 | const QString nodeName() | ||
377 | { return QString("Fake node" ); } | ||
378 | const QString nodeDescription() | ||
379 | { return QString("Fake node" ); } | ||
380 | ANetNodeInstance * createInstance( void ); | ||
381 | const char * provides( void ) | ||
382 | { return ""; } | ||
383 | virtual const char ** needs( void ) | ||
384 | { return 0; } | ||
385 | virtual bool generateProperFilesFor( ANetNodeInstance * ) | ||
386 | { return 0; } | ||
387 | virtual bool hasDataFor( const QString & ) | ||
388 | { return 0; } | ||
389 | virtual bool generateDataForCommonFile( | ||
390 | SystemFile & , long , ANetNodeInstance * ) | ||
391 | {return 1; } | ||
392 | |||
393 | private : | ||
394 | |||
395 | }; | ||
396 | |||
397 | class FakeNetNodeInstance : public ANetNodeInstance { | ||
398 | |||
399 | public: | ||
400 | |||
401 | FakeNetNodeInstance( ANetNode * NN ) : | ||
402 | ANetNodeInstance( NN ), ValAttrPairs() { } | ||
403 | virtual ~FakeNetNodeInstance( void ) { } | ||
404 | |||
405 | virtual RuntimeInfo * runtime( void ) | ||
406 | { return 0; } | ||
407 | |||
408 | // create edit widget under parent | ||
409 | virtual QWidget * edit( QWidget * ) | ||
410 | { return 0; } | ||
411 | // is given data acceptable | ||
412 | virtual QString acceptable( void ) | ||
413 | { return QString(""); } | ||
414 | |||
415 | // get data from GUI and store in node | ||
416 | virtual void commit( void ) {} | ||
417 | |||
418 | // get next node | ||
419 | ANetNodeInstance * nextNode() | ||
420 | { return 0; } | ||
421 | // return NetNode this is an instance of | ||
422 | |||
423 | // intialize am instance of a net node | ||
424 | void initialize( void ){} | ||
425 | |||
426 | // returns node specific data -> only useful for 'buddy' | ||
427 | virtual void * data( void ) | ||
428 | { return 0; } | ||
429 | |||
430 | protected : | ||
431 | |||
432 | virtual void setSpecificAttribute( QString & , QString & ); | ||
433 | virtual void saveSpecificAttribute( QTextStream & ); | ||
434 | |||
435 | QDict<QString> ValAttrPairs; | ||
436 | }; | ||
437 | |||
438 | extern FakeNetNode * FakeNode; | ||
439 | |||
361 | #endif | 440 | #endif |