Document.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. // Document.h
  3. NOT a Cocoa / Apple document,
  4. NOT an SVG document,
  5. BUT INSTEAD: a DOM document (blame w3.org for the too-generic name).
  6. Required for SVG-DOM
  7. c.f.:
  8. http://www.w3.org/TR/DOM-Level-2-Core/core.html#i-Document
  9. interface Document : Node {
  10. readonly attribute DocumentType doctype;
  11. readonly attribute DOMImplementation implementation;
  12. readonly attribute Element documentElement;
  13. Element createElement(in DOMString tagName)
  14. raises(DOMException);
  15. DocumentFragment createDocumentFragment();
  16. Text createTextNode(in DOMString data);
  17. Comment createComment(in DOMString data);
  18. CDATASection createCDATASection(in DOMString data)
  19. raises(DOMException);
  20. ProcessingInstruction createProcessingInstruction(in DOMString target,
  21. in DOMString data)
  22. raises(DOMException);
  23. Attr createAttribute(in DOMString name)
  24. raises(DOMException);
  25. EntityReference createEntityReference(in DOMString name)
  26. raises(DOMException);
  27. NodeList getElementsByTagName(in DOMString tagname);
  28. // Introduced in DOM Level 2:
  29. Node importNode(in Node importedNode,
  30. in boolean deep)
  31. raises(DOMException);
  32. // Introduced in DOM Level 2:
  33. Element createElementNS(in DOMString namespaceURI,
  34. in DOMString qualifiedName)
  35. raises(DOMException);
  36. // Introduced in DOM Level 2:
  37. Attr createAttributeNS(in DOMString namespaceURI,
  38. in DOMString qualifiedName)
  39. raises(DOMException);
  40. // Introduced in DOM Level 2:
  41. NodeList getElementsByTagNameNS(in DOMString namespaceURI,
  42. in DOMString localName);
  43. // Introduced in DOM Level 2:
  44. Element getElementById(in DOMString elementId);
  45. };
  46. */
  47. #import <Foundation/Foundation.h>
  48. /** ObjectiveC won't allow this: @class Node; */
  49. #import "Node.h"
  50. @class Element;
  51. #import "Element.h"
  52. //@class Comment;
  53. #import "Comment.h"
  54. @class CDATASection;
  55. #import "CDATASection.h"
  56. @class DocumentFragment;
  57. #import "DocumentFragment.h"
  58. @class EntityReference;
  59. #import "EntityReference.h"
  60. @class NodeList;
  61. #import "NodeList.h"
  62. @class ProcessingInstruction;
  63. #import "ProcessingInstruction.h"
  64. @class DocumentType;
  65. #import "DocumentType.h"
  66. @class AppleSucksDOMImplementation;
  67. #import "AppleSucksDOMImplementation.h"
  68. @interface Document : Node
  69. @property(nonatomic,strong,readonly) DocumentType* doctype;
  70. @property(nonatomic,strong,readonly) AppleSucksDOMImplementation* implementation;
  71. @property(nonatomic,strong,readonly) Element* documentElement;
  72. -(Element*) createElement:(NSString*) tagName __attribute__((ns_returns_retained));
  73. -(DocumentFragment*) createDocumentFragment __attribute__((ns_returns_retained));
  74. -(Text*) createTextNode:(NSString*) data __attribute__((ns_returns_retained));
  75. -(Comment*) createComment:(NSString*) data __attribute__((ns_returns_retained));
  76. -(CDATASection*) createCDATASection:(NSString*) data __attribute__((ns_returns_retained));
  77. -(ProcessingInstruction*) createProcessingInstruction:(NSString*) target data:(NSString*) data __attribute__((ns_returns_retained));
  78. -(Attr*) createAttribute:(NSString*) data __attribute__((ns_returns_retained));
  79. -(EntityReference*) createEntityReference:(NSString*) data __attribute__((ns_returns_retained));
  80. -(NodeList*) getElementsByTagName:(NSString*) data;
  81. // Introduced in DOM Level 2:
  82. -(Node*) importNode:(Node*) importedNode deep:(BOOL) deep;
  83. // Introduced in DOM Level 2:
  84. -(Element*) createElementNS:(NSString*) namespaceURI qualifiedName:(NSString*) qualifiedName __attribute__((ns_returns_retained));
  85. // Introduced in DOM Level 2:
  86. -(Attr*) createAttributeNS:(NSString*) namespaceURI qualifiedName:(NSString*) qualifiedName;
  87. // Introduced in DOM Level 2:
  88. -(NodeList*) getElementsByTagNameNS:(NSString*) namespaceURI localName:(NSString*) localName;
  89. // Introduced in DOM Level 2:
  90. -(Element*) getElementById:(NSString*) elementId;
  91. @end