summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/networksettings2/netnode.h
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/networksettings2/netnode.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.h69
1 files changed, 36 insertions, 33 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.h b/noncore/settings/networksettings2/networksettings2/netnode.h
index 151d546..8aebdc0 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.h
+++ b/noncore/settings/networksettings2/networksettings2/netnode.h
@@ -17,3 +17,3 @@ class AsDevice;
17class AsLine; 17class AsLine;
18class AsConnection; 18class AsNetworkSetup;
19class AsFullSetup; 19class AsFullSetup;
@@ -25,3 +25,3 @@ class ANetNode;
25class ANetNodeInstance; 25class ANetNodeInstance;
26class NodeCollection; 26class NetworkSetup;
27class QTextStream; 27class QTextStream;
@@ -41,6 +41,6 @@ typedef enum State {
41 Unknown = 1, 41 Unknown = 1,
42 // if connection cannot be established e.g. because 42 // if networkSetup cannot be established e.g. because
43 // the hardware is not available 43 // the hardware is not available
44 Unavailable = 2, 44 Unavailable = 2,
45 // if the connection cannot be establishec but NOT 45 // if the networkSetup cannot be establishec but NOT
46 // because it is physically impossible but because 46 // because it is physically impossible but because
@@ -48,9 +48,9 @@ typedef enum State {
48 Disabled = 3, 48 Disabled = 3,
49 // if connection is available to is currently down 49 // if networkSetup is available to is currently down
50 // i.e. the corresponding hardware is not activated 50 // i.e. the corresponding hardware is not activated
51 Off = 4, 51 Off = 4,
52 // if connection is available to be used (i.e. the 52 // if networkSetup is available to be used (i.e. the
53 // devices if fully ready to be used 53 // devices if fully ready to be used
54 Available = 5, 54 Available = 5,
55 // if connection is being used 55 // if networkSetup is being used
56 IsUp = 6 56 IsUp = 6
@@ -67,5 +67,5 @@ typedef enum Action {
67 Deactivate = 3, 67 Deactivate = 3,
68 // bring the connection up -> to IsUp 68 // bring the networkSetup up -> to IsUp
69 Up = 4, 69 Up = 4,
70 // bring the connection down -> to Available 70 // bring the networkSetup down -> to Available
71 Down = 5 71 Down = 5
@@ -93,3 +93,3 @@ public:
93 93
94 // does this Node provide a Connection 94 // does this Node provide a NetworkSetup
95 bool isToplevel( void ); 95 bool isToplevel( void );
@@ -247,6 +247,6 @@ public:
247 247
248 inline void setConnection( NodeCollection * NC ) 248 inline void setNetworkSetup( NetworkSetup * NC )
249 { Connection = NC; } 249 { TheNetworkSetup = NC; }
250 inline NodeCollection * connection( void ) 250 inline NetworkSetup * networkSetup( void )
251 { return Connection; } 251 { return TheNetworkSetup; }
252 252
@@ -317,4 +317,4 @@ protected :
317 ANetNode * NodeType; 317 ANetNode * NodeType;
318 // connection to which this node belongs to 318 // networkSetup to which this node belongs to
319 NodeCollection * Connection; 319 NetworkSetup * TheNetworkSetup;
320 QString Description; 320 QString Description;
@@ -380,3 +380,3 @@ public :
380 // 380 //
381 // methods to be overloaded by connection capable 381 // methods to be overloaded by networkSetup capable
382 // runtimes 382 // runtimes
@@ -477,4 +477,4 @@ public :
477 477
478 inline NodeCollection * nodeCollection() 478 inline NetworkSetup * networkSetup()
479 { return NNI->connection(); } 479 { return NNI->networkSetup(); }
480 480
@@ -482,3 +482,3 @@ public :
482 // public API to set the state 482 // public API to set the state
483 virtual QString setState( NodeCollection * NC, 483 virtual QString setState( NetworkSetup * NC,
484 Action_t A, 484 Action_t A,
@@ -499,3 +499,3 @@ protected :
499 // set state of this node (private API) 499 // set state of this node (private API)
500 virtual QString setMyState( NodeCollection * NC, 500 virtual QString setMyState( NetworkSetup * NC,
501 Action_t A, 501 Action_t A,
@@ -503,3 +503,3 @@ protected :
503 503
504 // connection this runtime info belongs to 504 // networkSetup this runtime info belongs to
505 ANetNodeInstance * NNI; 505 ANetNodeInstance * NNI;
@@ -507,3 +507,3 @@ protected :
507 507
508class NodeCollection : public QList<ANetNodeInstance> { 508class NetworkSetup : public QList<ANetNodeInstance> {
509 509
@@ -511,5 +511,8 @@ public :
511 511
512 NodeCollection( void ); 512 NetworkSetup( void );
513 NodeCollection( QTextStream & TS, bool & Dangling ); 513 NetworkSetup( QTextStream & TS, bool & Dangling );
514 ~NodeCollection( void ); 514 ~NetworkSetup( void );
515
516 // copy settings from NC to this
517 void copyFrom( const NetworkSetup & NC );
515 518
@@ -545,11 +548,11 @@ public :
545 inline void assignInterface( InterfaceInfo * NI ) { 548 inline void assignInterface( InterfaceInfo * NI ) {
546 if( NI == 0 ) { 549 // cleanup previous
547 if( AssignedInterface ) { 550 if( AssignedInterface ) {
548 AssignedInterface->assignConnection( 0 ); 551 AssignedInterface->assignToNetworkSetup( 0 );
549 } 552 }
553 if( NI ) {
554 // assign new
555 NI->assignToNetworkSetup( this );
550 } 556 }
551 AssignedInterface = NI; 557 AssignedInterface = NI;
552 if( AssignedInterface ) {
553 AssignedInterface->assignConnection( this );
554 }
555 } 558 }
@@ -579,3 +582,3 @@ public :
579 582
580 // makes sure that all items in the connection point to 583 // makes sure that all items in the networkSetup point to
581 // that connectoin 584 // that connectoin
@@ -621,3 +624,3 @@ private :
621 624
622 // state of this connection 625 // state of this networkSetup
623 State_t CurrentState; 626 State_t CurrentState;