14
14
* You should have received a copy of the GNU General Public License
15
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
19
19
#ifndef _TUINODE_HPP_
52
53
virtual TuiNodeResponse navigation(int key);
53
54
virtual QString getDisplayText();
54
55
virtual TuiNode* getParentNode() {return parentNode;}
55
virtual void setParentNode(TuiNode* n) {parentNode=n;}
56
virtual void setParentNode(TuiNode* n) {parentNode=n; updateNodeNumber();}
56
57
virtual TuiNode* getChildNode() {return childNode;}
57
58
virtual void setChildNode(TuiNode* n) {childNode=n;}
58
59
virtual TuiNode* getPrevNode() {return prevNode;}
59
virtual void setPrevNode(TuiNode* n) {prevNode=n;}
60
virtual void setPrevNode(TuiNode* n) {prevNode=n; updateNodeNumber();}
60
61
virtual TuiNode* getNextNode() {return nextNode;}
61
62
virtual void setNextNode(TuiNode* n) {nextNode=n;}
63
//! Set prevNode to the last of the chain of nextNode-s.
64
//! Call for the first node of a menu after all others have been added.
65
virtual void loopToTheLast();
67
int getNodeNumber() {return nodeNumber;}
68
QList<int> getAncestorsNumbers() {return ancestorsNumbers;}
64
71
TuiNode* parentNode;
65
72
TuiNode* childNode;
75
//! Text of the prefix containing the hierarchical node number.
68
77
QString displayText;
78
//! Number of the node in the current menu.
79
//! Automatically set to 1 if there is no prevNode.
81
//! Contains the numbers of the parent nodes in the hierarchy.
82
//! The last element is the number of the node in the current menu.
83
QList<int> ancestorsNumbers;
84
//! Updates nodeNumber, ancestorNumbers and prefixText.
85
void updateNodeNumber();
71
88
#endif /* _TUINODE_HPP_ */