Stellarium 0.15.2
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
TuiNode Class Reference

TuiNode objects are linked together in a network of nodes to form the structure of a menu which may be navigated using the cursor keys. More...

#include <TuiNode.hpp>

+ Inheritance diagram for TuiNode:
+ Collaboration diagram for TuiNode:

Public Member Functions

 TuiNode (const QString &text, TuiNode *parent=NULL, TuiNode *prev=NULL)
 Create a TuiNode. More...
 
virtual TuiNodeResponse handleKey (int key)
 
virtual TuiNodeResponse navigation (int key)
 
virtual QString getDisplayText ()
 
virtual TuiNodegetParentNode ()
 
virtual void setParentNode (TuiNode *n)
 
virtual TuiNodegetChildNode ()
 
virtual void setChildNode (TuiNode *n)
 This also takes ownership of the child through OObject->setParent. More...
 
virtual TuiNodegetPrevNode ()
 
virtual void setPrevNode (TuiNode *n)
 
virtual TuiNodegetNextNode ()
 
virtual void setNextNode (TuiNode *n)
 
virtual void loopToTheLast ()
 Set prevNode to the last of the chain of nextNode-s. More...
 
int getNodeNumber ()
 
QList< int > getAncestorsNumbers ()
 

Protected Member Functions

void updateNodeNumber ()
 Updates nodeNumber, ancestorNumbers and prefixText. More...
 

Protected Attributes

TuiNodeparentNode
 
TuiNodechildNode
 
TuiNodeprevNode
 
TuiNodenextNode
 
QString prefixText
 Text of the prefix containing the hierarchical node number. More...
 
QString displayText
 
int nodeNumber
 Number of the node in the current menu. More...
 
QList< int > ancestorsNumbers
 Contains the numbers of the parent nodes in the hierarchy. More...
 

Detailed Description

TuiNode objects are linked together in a network of nodes to form the structure of a menu which may be navigated using the cursor keys.

Each node has a single line of text which will be displayed when a node is active. Depending on the sub-class for a particular node, it may be used to edit data of one sort of another.

Definition at line 42 of file TuiNode.hpp.

Constructor & Destructor Documentation

TuiNode::TuiNode ( const QString &  text,
TuiNode parent = NULL,
TuiNode prev = NULL 
)

Create a TuiNode.

Parameters
textthe text to display for this node
parentthe node for the parent menu item
prevthe previous node in the current menu (typically shares the same parent)

Member Function Documentation

virtual void TuiNode::loopToTheLast ( )
virtual

Set prevNode to the last of the chain of nextNode-s.

Call for the first node of a menu after all others have been added.

virtual void TuiNode::setChildNode ( TuiNode n)
inlinevirtual

This also takes ownership of the child through OObject->setParent.

Definition at line 59 of file TuiNode.hpp.

void TuiNode::updateNodeNumber ( )
protected

Updates nodeNumber, ancestorNumbers and prefixText.

Member Data Documentation

QList<int> TuiNode::ancestorsNumbers
protected

Contains the numbers of the parent nodes in the hierarchy.

The last element is the number of the node in the current menu.

Definition at line 84 of file TuiNode.hpp.

int TuiNode::nodeNumber
protected

Number of the node in the current menu.

Automatically set to 1 if there is no prevNode.

Definition at line 81 of file TuiNode.hpp.

QString TuiNode::prefixText
protected

Text of the prefix containing the hierarchical node number.

Definition at line 77 of file TuiNode.hpp.


The documentation for this class was generated from the following file: