SVGElementInstance.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. http://www.w3.org/TR/SVG/struct.html#InterfaceSVGElementInstance
  3. interface SVGElementInstance : EventTarget {
  4. readonly attribute SVGElement correspondingElement;
  5. readonly attribute SVGUseElement correspondingUseElement;
  6. readonly attribute SVGElementInstance parentNode;
  7. readonly attribute SVGElementInstanceList childNodes;
  8. readonly attribute SVGElementInstance firstChild;
  9. readonly attribute SVGElementInstance lastChild;
  10. readonly attribute SVGElementInstance previousSibling;
  11. readonly attribute SVGElementInstance nextSibling;
  12. */
  13. #import "SVGElement.h"
  14. #import "SVGElementInstanceList.h"
  15. @class SVGUseElement;
  16. #import "SVGUseElement.h"
  17. /**
  18. ADDITIONAL IMPLEMENTATION NOTES:
  19. We make the two back-links into the SVG DOM Tree ("correspondingElement" and "correspondingUseElement") weak references to prevent
  20. a retain-cycle.
  21. If you delete parts of the original tree, but don't do anything to update your USE tags / elements, then ... the back-links will
  22. become nil. This seems the most rational, "what you would expect", behaviour.
  23. */
  24. @interface SVGElementInstance : NSObject
  25. /*The corresponding element to which this object is an instance. For example, if a ‘use’ element references a ‘rect’ element, then an SVGElementInstance is created, with its correspondingElement being the SVGRectElement object for the ‘rect’ element. */
  26. @property(nonatomic, weak, readonly) SVGElement* correspondingElement;
  27. /* The corresponding ‘use’ element to which this SVGElementInstance object belongs. When ‘use’ elements are nested (e.g., a ‘use’ references another ‘use’ which references a graphics element such as a ‘rect’), then the correspondingUseElement is the outermost ‘use’ (i.e., the one which indirectly references the ‘rect’, not the one with the direct reference). */
  28. @property(nonatomic, weak, readonly) SVGUseElement* correspondingUseElement;
  29. /* The parent of this SVGElementInstance within the instance tree. All SVGElementInstance objects have a parent except the SVGElementInstance which corresponds to the element which was directly referenced by the ‘use’ element, in which case parentNode is null. */
  30. @property(nonatomic,strong, readonly) SVGElementInstance* parentNode;
  31. /* An SVGElementInstanceList that contains all children of this SVGElementInstance within the instance tree. If there are no children, this is an SVGElementInstanceList containing no entries (i.e., an empty list).
  32. firstChild (readonly SVGElementInstance) */
  33. @property(nonatomic,strong, readonly) SVGElementInstanceList* childNodes;
  34. /* The first child of this SVGElementInstance within the instance tree. If there is no such SVGElementInstance, this returns null. */
  35. @property(nonatomic,strong, readonly) SVGElementInstance* firstChild;
  36. /* The last child of this SVGElementInstance within the instance tree. If there is no such SVGElementInstance, this returns null. */
  37. @property(nonatomic,strong, readonly) SVGElementInstance* lastChild;
  38. /* The SVGElementInstance immediately preceding this SVGElementInstance. If there is no such SVGElementInstance, this returns null. */
  39. @property(nonatomic,strong, readonly) SVGElementInstance* previousSibling;
  40. /* The SVGElementInstance immediately following this SVGElementInstance. If there is no such SVGElementInstance, this returns null. */
  41. @property(nonatomic,strong, readonly) SVGElementInstance* nextSibling;
  42. @end