ITreeNode.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //-----------------------------------------------------------------------------
  2. // Verve
  3. // Copyright (C) 2014 - Violent Tulip
  4. //
  5. // Permission is hereby granted, free of charge, to any person obtaining a copy
  6. // of this software and associated documentation files (the "Software"), to
  7. // deal in the Software without restriction, including without limitation the
  8. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9. // sell copies of the Software, and to permit persons to whom the Software is
  10. // furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in
  13. // all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  21. // IN THE SOFTWARE.
  22. //-----------------------------------------------------------------------------
  23. #ifndef _VT_ITREENODE_H_
  24. #define _VT_ITREENODE_H_
  25. //-----------------------------------------------------------------------------
  26. class ITreeNode
  27. {
  28. public:
  29. ITreeNode *mParentNode;
  30. ITreeNode *mChildNode;
  31. ITreeNode *mSiblingPrevNode;
  32. ITreeNode *mSiblingNextNode;
  33. public:
  34. ITreeNode( void ) :
  35. mParentNode( 0 ),
  36. mChildNode( 0 ),
  37. mSiblingPrevNode( 0 ),
  38. mSiblingNextNode( 0 )
  39. {
  40. // Void.
  41. };
  42. virtual ~ITreeNode( void )
  43. {
  44. // Void.
  45. };
  46. virtual void clear( void ) = 0; // Clear the Node.
  47. virtual ITreeNode *getRoot( void ) = 0; // Get Root Node.
  48. virtual ITreeNode *getParent( void ) = 0; // Get Parent Node.
  49. virtual ITreeNode *getChild( void ) = 0; // Get Child Node.
  50. virtual ITreeNode *getLastChild( void ) = 0; // Get Last Child Node.
  51. virtual ITreeNode *getPrevSibling( void ) = 0; // Get Previous Sibling Node.
  52. virtual ITreeNode *getNextSibling( void ) = 0; // Get Next Sibling Node.
  53. virtual void addTo( ITreeNode *pNode ) = 0; // Add Node to target node.
  54. virtual void remove( void ) = 0; // Remove this Node from the tree.
  55. virtual void moveTo( ITreeNode* node ) = 0; // Move to specified Node.
  56. virtual void onAttach( void ) = 0; // Attach Callback.
  57. virtual void onDetach( void ) = 0; // Detach Callback.
  58. virtual bool inTree( void ) = 0; // Is Node in a tree?
  59. };
  60. //-----------------------------------------------------------------------------
  61. #endif // _VT_ITREENODE_H_