/PSTreeGraphView/PSTreeGraphModelNode.h

https://code.google.com/ · C Header · 48 lines · 10 code · 20 blank · 18 comment · 0 complexity · 039b410837d694481460ea6a3519f2f0 MD5 · raw file

  1. //
  2. // PSTreeGraphModelNode.h
  3. // PSTreeGraphView
  4. //
  5. // Created by Ed Preston on 7/25/10.
  6. // Copyright 2010 Preston Software. All rights reserved.
  7. //
  8. //
  9. // This is a port of the sample code from Max OS X to iOS (iPad).
  10. //
  11. // WWDC 2010 Session 141, “Crafting Custom Cocoa Views”
  12. //
  13. #import <Foundation/Foundation.h>
  14. /// The model nodes used with a TreeGraph are required to conform to the this protocol,
  15. /// which enables the TreeGraph to navigate the model tree to find related nodes.
  16. @protocol PSTreeGraphModelNode <NSObject>
  17. @required
  18. /// The model node's parent node, or nil if it doesn't have a parent node.
  19. - (id <PSTreeGraphModelNode> )parentModelNode;
  20. /// The model node's child nodes. If the node has no children, this should return an
  21. /// empty array ([NSArray array]), not nil.
  22. - (NSArray *) childModelNodes;
  23. @end
  24. @protocol PSTreeGraphDelegate <NSObject>
  25. @required
  26. /// The delegate will configure the nodeView with the modelNode provided.
  27. - (void) configureNodeView:(UIView *)nodeView withModelNode:(id <PSTreeGraphModelNode> )modelNode;
  28. @end