TuiNode.hpp   TuiNode.hpp 
skipping to change at line 16 skipping to change at line 16
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _TUINODE_HPP_ #ifndef _TUINODE_HPP_
#define _TUINODE_HPP_ 1 #define _TUINODE_HPP_ 1
#include <QObject> #include <QObject>
#include <QString> #include <QString>
#include <QList>
//! @struct TuiNodeResponse //! @struct TuiNodeResponse
//! A TuiNodeResponse contains a flag, "accepted" if a keystroke was accept ed //! A TuiNodeResponse contains a flag, "accepted" if a keystroke was accept ed
//! And a link to a node, should the key action have prompted a change in t he //! And a link to a node, should the key action have prompted a change in t he
//! current node used by the menu system. //! current node used by the menu system.
typedef struct typedef struct
{ {
bool accepted; bool accepted;
class TuiNode* newNode; class TuiNode* newNode;
} TuiNodeResponse; } TuiNodeResponse;
skipping to change at line 55 skipping to change at line 56
//! Create a TuiNode //! Create a TuiNode
//! @param text the text to display for this node //! @param text the text to display for this node
//! @param parent the node for the parent menu item //! @param parent the node for the parent menu item
//! @param prev the previous node in the current menu (typically //! @param prev the previous node in the current menu (typically
//! shares the same parent) //! shares the same parent)
TuiNode(const QString& text, TuiNode* parent=NULL, TuiNode* prev=NUL L); TuiNode(const QString& text, TuiNode* parent=NULL, TuiNode* prev=NUL L);
virtual TuiNodeResponse handleKey(int key); virtual TuiNodeResponse handleKey(int key);
virtual TuiNodeResponse navigation(int key); virtual TuiNodeResponse navigation(int key);
virtual QString getDisplayText(); virtual QString getDisplayText();
virtual TuiNode* getParentNode() {return parentNode;} virtual TuiNode* getParentNode() {return parentNode;}
virtual void setParentNode(TuiNode* n) {parentNode=n;} virtual void setParentNode(TuiNode* n) {parentNode=n; updateNodeNumb er();}
virtual TuiNode* getChildNode() {return childNode;} virtual TuiNode* getChildNode() {return childNode;}
virtual void setChildNode(TuiNode* n) {childNode=n;} virtual void setChildNode(TuiNode* n) {childNode=n;}
virtual TuiNode* getPrevNode() {return prevNode;} virtual TuiNode* getPrevNode() {return prevNode;}
virtual void setPrevNode(TuiNode* n) {prevNode=n;} virtual void setPrevNode(TuiNode* n) {prevNode=n; updateNodeNumber() ;}
virtual TuiNode* getNextNode() {return nextNode;} virtual TuiNode* getNextNode() {return nextNode;}
virtual void setNextNode(TuiNode* n) {nextNode=n;} virtual void setNextNode(TuiNode* n) {nextNode=n;}
//! Set prevNode to the last of the chain of nextNode-s.
//! Call for the first node of a menu after all others have been add
ed.
virtual void loopToTheLast();
int getNodeNumber() {return nodeNumber;}
QList<int> getAncestorsNumbers() {return ancestorsNumbers;}
protected: protected:
TuiNode* parentNode; TuiNode* parentNode;
TuiNode* childNode; TuiNode* childNode;
TuiNode* prevNode; TuiNode* prevNode;
TuiNode* nextNode; TuiNode* nextNode;
//! Text of the prefix containing the hierarchical node number.
QString prefixText;
QString displayText; QString displayText;
//! Number of the node in the current menu.
//! Automatically set to 1 if there is no prevNode.
int nodeNumber;
//! Contains the numbers of the parent nodes in the hierarchy.
//! The last element is the number of the node in the current menu.
QList<int> ancestorsNumbers;
//! Updates nodeNumber, ancestorNumbers and prefixText.
void updateNodeNumber();
}; };
#endif /* _TUINODE_HPP_ */ #endif /* _TUINODE_HPP_ */
 End of changes. 7 change blocks. 
3 lines changed or deleted 21 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/