nsIDOMRange.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/dom/public/idl/range/nsIDOMRange.idl
  3. */
  4. #ifndef __gen_nsIDOMRange_h__
  5. #define __gen_nsIDOMRange_h__
  6. #ifndef __gen_domstubs_h__
  7. #include "domstubs.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. /* starting interface: nsIDOMRange */
  14. #define NS_IDOMRANGE_IID_STR "a6cf90ce-15b3-11d2-932e-00805f8add32"
  15. #define NS_IDOMRANGE_IID \
  16. {0xa6cf90ce, 0x15b3, 0x11d2, \
  17. { 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 }}
  18. class NS_NO_VTABLE nsIDOMRange : public nsISupports {
  19. public:
  20. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDOMRANGE_IID)
  21. /**
  22. * The nsIDOMRange interface is an interface to a DOM range object.
  23. *
  24. * For more information on this interface please see
  25. * http://www.w3.org/TR/DOM-Level-2-Traversal-Range/
  26. *
  27. * @status FROZEN
  28. */
  29. /* readonly attribute nsIDOMNode startContainer; */
  30. NS_IMETHOD GetStartContainer(nsIDOMNode * *aStartContainer) = 0;
  31. /* readonly attribute long startOffset; */
  32. NS_IMETHOD GetStartOffset(PRInt32 *aStartOffset) = 0;
  33. /* readonly attribute nsIDOMNode endContainer; */
  34. NS_IMETHOD GetEndContainer(nsIDOMNode * *aEndContainer) = 0;
  35. /* readonly attribute long endOffset; */
  36. NS_IMETHOD GetEndOffset(PRInt32 *aEndOffset) = 0;
  37. /* readonly attribute boolean collapsed; */
  38. NS_IMETHOD GetCollapsed(PRBool *aCollapsed) = 0;
  39. /* readonly attribute nsIDOMNode commonAncestorContainer; */
  40. NS_IMETHOD GetCommonAncestorContainer(nsIDOMNode * *aCommonAncestorContainer) = 0;
  41. /* void setStart (in nsIDOMNode refNode, in long offset) raises (RangeException, DOMException); */
  42. NS_IMETHOD SetStart(nsIDOMNode *refNode, PRInt32 offset) = 0;
  43. /* void setEnd (in nsIDOMNode refNode, in long offset) raises (RangeException, DOMException); */
  44. NS_IMETHOD SetEnd(nsIDOMNode *refNode, PRInt32 offset) = 0;
  45. /* void setStartBefore (in nsIDOMNode refNode) raises (RangeException, DOMException); */
  46. NS_IMETHOD SetStartBefore(nsIDOMNode *refNode) = 0;
  47. /* void setStartAfter (in nsIDOMNode refNode) raises (RangeException, DOMException); */
  48. NS_IMETHOD SetStartAfter(nsIDOMNode *refNode) = 0;
  49. /* void setEndBefore (in nsIDOMNode refNode) raises (RangeException, DOMException); */
  50. NS_IMETHOD SetEndBefore(nsIDOMNode *refNode) = 0;
  51. /* void setEndAfter (in nsIDOMNode refNode) raises (RangeException, DOMException); */
  52. NS_IMETHOD SetEndAfter(nsIDOMNode *refNode) = 0;
  53. /* void collapse (in boolean toStart) raises (DOMException); */
  54. NS_IMETHOD Collapse(PRBool toStart) = 0;
  55. /* void selectNode (in nsIDOMNode refNode) raises (RangeException, DOMException); */
  56. NS_IMETHOD SelectNode(nsIDOMNode *refNode) = 0;
  57. /* void selectNodeContents (in nsIDOMNode refNode) raises (RangeException, DOMException); */
  58. NS_IMETHOD SelectNodeContents(nsIDOMNode *refNode) = 0;
  59. enum { START_TO_START = 0U };
  60. enum { START_TO_END = 1U };
  61. enum { END_TO_END = 2U };
  62. enum { END_TO_START = 3U };
  63. /* short compareBoundaryPoints (in unsigned short how, in nsIDOMRange sourceRange) raises (DOMException); */
  64. NS_IMETHOD CompareBoundaryPoints(PRUint16 how, nsIDOMRange *sourceRange, PRInt16 *_retval) = 0;
  65. /* void deleteContents () raises (DOMException); */
  66. NS_IMETHOD DeleteContents(void) = 0;
  67. /* nsIDOMDocumentFragment extractContents () raises (DOMException); */
  68. NS_IMETHOD ExtractContents(nsIDOMDocumentFragment **_retval) = 0;
  69. /* nsIDOMDocumentFragment cloneContents () raises (DOMException); */
  70. NS_IMETHOD CloneContents(nsIDOMDocumentFragment **_retval) = 0;
  71. /* void insertNode (in nsIDOMNode newNode) raises (DOMException, RangeException); */
  72. NS_IMETHOD InsertNode(nsIDOMNode *newNode) = 0;
  73. /* void surroundContents (in nsIDOMNode newParent) raises (DOMException, RangeException); */
  74. NS_IMETHOD SurroundContents(nsIDOMNode *newParent) = 0;
  75. /* nsIDOMRange cloneRange () raises (DOMException); */
  76. NS_IMETHOD CloneRange(nsIDOMRange **_retval) = 0;
  77. /* DOMString toString () raises (DOMException); */
  78. NS_IMETHOD ToString(nsAString & _retval) = 0;
  79. /* void detach () raises (DOMException); */
  80. NS_IMETHOD Detach(void) = 0;
  81. };
  82. /* Use this macro when declaring classes that implement this interface. */
  83. #define NS_DECL_NSIDOMRANGE \
  84. NS_IMETHOD GetStartContainer(nsIDOMNode * *aStartContainer); \
  85. NS_IMETHOD GetStartOffset(PRInt32 *aStartOffset); \
  86. NS_IMETHOD GetEndContainer(nsIDOMNode * *aEndContainer); \
  87. NS_IMETHOD GetEndOffset(PRInt32 *aEndOffset); \
  88. NS_IMETHOD GetCollapsed(PRBool *aCollapsed); \
  89. NS_IMETHOD GetCommonAncestorContainer(nsIDOMNode * *aCommonAncestorContainer); \
  90. NS_IMETHOD SetStart(nsIDOMNode *refNode, PRInt32 offset); \
  91. NS_IMETHOD SetEnd(nsIDOMNode *refNode, PRInt32 offset); \
  92. NS_IMETHOD SetStartBefore(nsIDOMNode *refNode); \
  93. NS_IMETHOD SetStartAfter(nsIDOMNode *refNode); \
  94. NS_IMETHOD SetEndBefore(nsIDOMNode *refNode); \
  95. NS_IMETHOD SetEndAfter(nsIDOMNode *refNode); \
  96. NS_IMETHOD Collapse(PRBool toStart); \
  97. NS_IMETHOD SelectNode(nsIDOMNode *refNode); \
  98. NS_IMETHOD SelectNodeContents(nsIDOMNode *refNode); \
  99. NS_IMETHOD CompareBoundaryPoints(PRUint16 how, nsIDOMRange *sourceRange, PRInt16 *_retval); \
  100. NS_IMETHOD DeleteContents(void); \
  101. NS_IMETHOD ExtractContents(nsIDOMDocumentFragment **_retval); \
  102. NS_IMETHOD CloneContents(nsIDOMDocumentFragment **_retval); \
  103. NS_IMETHOD InsertNode(nsIDOMNode *newNode); \
  104. NS_IMETHOD SurroundContents(nsIDOMNode *newParent); \
  105. NS_IMETHOD CloneRange(nsIDOMRange **_retval); \
  106. NS_IMETHOD ToString(nsAString & _retval); \
  107. NS_IMETHOD Detach(void);
  108. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  109. #define NS_FORWARD_NSIDOMRANGE(_to) \
  110. NS_IMETHOD GetStartContainer(nsIDOMNode * *aStartContainer) { return _to GetStartContainer(aStartContainer); } \
  111. NS_IMETHOD GetStartOffset(PRInt32 *aStartOffset) { return _to GetStartOffset(aStartOffset); } \
  112. NS_IMETHOD GetEndContainer(nsIDOMNode * *aEndContainer) { return _to GetEndContainer(aEndContainer); } \
  113. NS_IMETHOD GetEndOffset(PRInt32 *aEndOffset) { return _to GetEndOffset(aEndOffset); } \
  114. NS_IMETHOD GetCollapsed(PRBool *aCollapsed) { return _to GetCollapsed(aCollapsed); } \
  115. NS_IMETHOD GetCommonAncestorContainer(nsIDOMNode * *aCommonAncestorContainer) { return _to GetCommonAncestorContainer(aCommonAncestorContainer); } \
  116. NS_IMETHOD SetStart(nsIDOMNode *refNode, PRInt32 offset) { return _to SetStart(refNode, offset); } \
  117. NS_IMETHOD SetEnd(nsIDOMNode *refNode, PRInt32 offset) { return _to SetEnd(refNode, offset); } \
  118. NS_IMETHOD SetStartBefore(nsIDOMNode *refNode) { return _to SetStartBefore(refNode); } \
  119. NS_IMETHOD SetStartAfter(nsIDOMNode *refNode) { return _to SetStartAfter(refNode); } \
  120. NS_IMETHOD SetEndBefore(nsIDOMNode *refNode) { return _to SetEndBefore(refNode); } \
  121. NS_IMETHOD SetEndAfter(nsIDOMNode *refNode) { return _to SetEndAfter(refNode); } \
  122. NS_IMETHOD Collapse(PRBool toStart) { return _to Collapse(toStart); } \
  123. NS_IMETHOD SelectNode(nsIDOMNode *refNode) { return _to SelectNode(refNode); } \
  124. NS_IMETHOD SelectNodeContents(nsIDOMNode *refNode) { return _to SelectNodeContents(refNode); } \
  125. NS_IMETHOD CompareBoundaryPoints(PRUint16 how, nsIDOMRange *sourceRange, PRInt16 *_retval) { return _to CompareBoundaryPoints(how, sourceRange, _retval); } \
  126. NS_IMETHOD DeleteContents(void) { return _to DeleteContents(); } \
  127. NS_IMETHOD ExtractContents(nsIDOMDocumentFragment **_retval) { return _to ExtractContents(_retval); } \
  128. NS_IMETHOD CloneContents(nsIDOMDocumentFragment **_retval) { return _to CloneContents(_retval); } \
  129. NS_IMETHOD InsertNode(nsIDOMNode *newNode) { return _to InsertNode(newNode); } \
  130. NS_IMETHOD SurroundContents(nsIDOMNode *newParent) { return _to SurroundContents(newParent); } \
  131. NS_IMETHOD CloneRange(nsIDOMRange **_retval) { return _to CloneRange(_retval); } \
  132. NS_IMETHOD ToString(nsAString & _retval) { return _to ToString(_retval); } \
  133. NS_IMETHOD Detach(void) { return _to Detach(); }
  134. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  135. #define NS_FORWARD_SAFE_NSIDOMRANGE(_to) \
  136. NS_IMETHOD GetStartContainer(nsIDOMNode * *aStartContainer) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStartContainer(aStartContainer); } \
  137. NS_IMETHOD GetStartOffset(PRInt32 *aStartOffset) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStartOffset(aStartOffset); } \
  138. NS_IMETHOD GetEndContainer(nsIDOMNode * *aEndContainer) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEndContainer(aEndContainer); } \
  139. NS_IMETHOD GetEndOffset(PRInt32 *aEndOffset) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEndOffset(aEndOffset); } \
  140. NS_IMETHOD GetCollapsed(PRBool *aCollapsed) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCollapsed(aCollapsed); } \
  141. NS_IMETHOD GetCommonAncestorContainer(nsIDOMNode * *aCommonAncestorContainer) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCommonAncestorContainer(aCommonAncestorContainer); } \
  142. NS_IMETHOD SetStart(nsIDOMNode *refNode, PRInt32 offset) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetStart(refNode, offset); } \
  143. NS_IMETHOD SetEnd(nsIDOMNode *refNode, PRInt32 offset) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetEnd(refNode, offset); } \
  144. NS_IMETHOD SetStartBefore(nsIDOMNode *refNode) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetStartBefore(refNode); } \
  145. NS_IMETHOD SetStartAfter(nsIDOMNode *refNode) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetStartAfter(refNode); } \
  146. NS_IMETHOD SetEndBefore(nsIDOMNode *refNode) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetEndBefore(refNode); } \
  147. NS_IMETHOD SetEndAfter(nsIDOMNode *refNode) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetEndAfter(refNode); } \
  148. NS_IMETHOD Collapse(PRBool toStart) { return !_to ? NS_ERROR_NULL_POINTER : _to->Collapse(toStart); } \
  149. NS_IMETHOD SelectNode(nsIDOMNode *refNode) { return !_to ? NS_ERROR_NULL_POINTER : _to->SelectNode(refNode); } \
  150. NS_IMETHOD SelectNodeContents(nsIDOMNode *refNode) { return !_to ? NS_ERROR_NULL_POINTER : _to->SelectNodeContents(refNode); } \
  151. NS_IMETHOD CompareBoundaryPoints(PRUint16 how, nsIDOMRange *sourceRange, PRInt16 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CompareBoundaryPoints(how, sourceRange, _retval); } \
  152. NS_IMETHOD DeleteContents(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteContents(); } \
  153. NS_IMETHOD ExtractContents(nsIDOMDocumentFragment **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ExtractContents(_retval); } \
  154. NS_IMETHOD CloneContents(nsIDOMDocumentFragment **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CloneContents(_retval); } \
  155. NS_IMETHOD InsertNode(nsIDOMNode *newNode) { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertNode(newNode); } \
  156. NS_IMETHOD SurroundContents(nsIDOMNode *newParent) { return !_to ? NS_ERROR_NULL_POINTER : _to->SurroundContents(newParent); } \
  157. NS_IMETHOD CloneRange(nsIDOMRange **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CloneRange(_retval); } \
  158. NS_IMETHOD ToString(nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ToString(_retval); } \
  159. NS_IMETHOD Detach(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Detach(); }
  160. #if 0
  161. /* Use the code below as a template for the implementation class for this interface. */
  162. /* Header file */
  163. class nsDOMRange : public nsIDOMRange
  164. {
  165. public:
  166. NS_DECL_ISUPPORTS
  167. NS_DECL_NSIDOMRANGE
  168. nsDOMRange();
  169. private:
  170. ~nsDOMRange();
  171. protected:
  172. /* additional members */
  173. };
  174. /* Implementation file */
  175. NS_IMPL_ISUPPORTS1(nsDOMRange, nsIDOMRange)
  176. nsDOMRange::nsDOMRange()
  177. {
  178. /* member initializers and constructor code */
  179. }
  180. nsDOMRange::~nsDOMRange()
  181. {
  182. /* destructor code */
  183. }
  184. /* readonly attribute nsIDOMNode startContainer; */
  185. NS_IMETHODIMP nsDOMRange::GetStartContainer(nsIDOMNode * *aStartContainer)
  186. {
  187. return NS_ERROR_NOT_IMPLEMENTED;
  188. }
  189. /* readonly attribute long startOffset; */
  190. NS_IMETHODIMP nsDOMRange::GetStartOffset(PRInt32 *aStartOffset)
  191. {
  192. return NS_ERROR_NOT_IMPLEMENTED;
  193. }
  194. /* readonly attribute nsIDOMNode endContainer; */
  195. NS_IMETHODIMP nsDOMRange::GetEndContainer(nsIDOMNode * *aEndContainer)
  196. {
  197. return NS_ERROR_NOT_IMPLEMENTED;
  198. }
  199. /* readonly attribute long endOffset; */
  200. NS_IMETHODIMP nsDOMRange::GetEndOffset(PRInt32 *aEndOffset)
  201. {
  202. return NS_ERROR_NOT_IMPLEMENTED;
  203. }
  204. /* readonly attribute boolean collapsed; */
  205. NS_IMETHODIMP nsDOMRange::GetCollapsed(PRBool *aCollapsed)
  206. {
  207. return NS_ERROR_NOT_IMPLEMENTED;
  208. }
  209. /* readonly attribute nsIDOMNode commonAncestorContainer; */
  210. NS_IMETHODIMP nsDOMRange::GetCommonAncestorContainer(nsIDOMNode * *aCommonAncestorContainer)
  211. {
  212. return NS_ERROR_NOT_IMPLEMENTED;
  213. }
  214. /* void setStart (in nsIDOMNode refNode, in long offset) raises (RangeException, DOMException); */
  215. NS_IMETHODIMP nsDOMRange::SetStart(nsIDOMNode *refNode, PRInt32 offset)
  216. {
  217. return NS_ERROR_NOT_IMPLEMENTED;
  218. }
  219. /* void setEnd (in nsIDOMNode refNode, in long offset) raises (RangeException, DOMException); */
  220. NS_IMETHODIMP nsDOMRange::SetEnd(nsIDOMNode *refNode, PRInt32 offset)
  221. {
  222. return NS_ERROR_NOT_IMPLEMENTED;
  223. }
  224. /* void setStartBefore (in nsIDOMNode refNode) raises (RangeException, DOMException); */
  225. NS_IMETHODIMP nsDOMRange::SetStartBefore(nsIDOMNode *refNode)
  226. {
  227. return NS_ERROR_NOT_IMPLEMENTED;
  228. }
  229. /* void setStartAfter (in nsIDOMNode refNode) raises (RangeException, DOMException); */
  230. NS_IMETHODIMP nsDOMRange::SetStartAfter(nsIDOMNode *refNode)
  231. {
  232. return NS_ERROR_NOT_IMPLEMENTED;
  233. }
  234. /* void setEndBefore (in nsIDOMNode refNode) raises (RangeException, DOMException); */
  235. NS_IMETHODIMP nsDOMRange::SetEndBefore(nsIDOMNode *refNode)
  236. {
  237. return NS_ERROR_NOT_IMPLEMENTED;
  238. }
  239. /* void setEndAfter (in nsIDOMNode refNode) raises (RangeException, DOMException); */
  240. NS_IMETHODIMP nsDOMRange::SetEndAfter(nsIDOMNode *refNode)
  241. {
  242. return NS_ERROR_NOT_IMPLEMENTED;
  243. }
  244. /* void collapse (in boolean toStart) raises (DOMException); */
  245. NS_IMETHODIMP nsDOMRange::Collapse(PRBool toStart)
  246. {
  247. return NS_ERROR_NOT_IMPLEMENTED;
  248. }
  249. /* void selectNode (in nsIDOMNode refNode) raises (RangeException, DOMException); */
  250. NS_IMETHODIMP nsDOMRange::SelectNode(nsIDOMNode *refNode)
  251. {
  252. return NS_ERROR_NOT_IMPLEMENTED;
  253. }
  254. /* void selectNodeContents (in nsIDOMNode refNode) raises (RangeException, DOMException); */
  255. NS_IMETHODIMP nsDOMRange::SelectNodeContents(nsIDOMNode *refNode)
  256. {
  257. return NS_ERROR_NOT_IMPLEMENTED;
  258. }
  259. /* short compareBoundaryPoints (in unsigned short how, in nsIDOMRange sourceRange) raises (DOMException); */
  260. NS_IMETHODIMP nsDOMRange::CompareBoundaryPoints(PRUint16 how, nsIDOMRange *sourceRange, PRInt16 *_retval)
  261. {
  262. return NS_ERROR_NOT_IMPLEMENTED;
  263. }
  264. /* void deleteContents () raises (DOMException); */
  265. NS_IMETHODIMP nsDOMRange::DeleteContents()
  266. {
  267. return NS_ERROR_NOT_IMPLEMENTED;
  268. }
  269. /* nsIDOMDocumentFragment extractContents () raises (DOMException); */
  270. NS_IMETHODIMP nsDOMRange::ExtractContents(nsIDOMDocumentFragment **_retval)
  271. {
  272. return NS_ERROR_NOT_IMPLEMENTED;
  273. }
  274. /* nsIDOMDocumentFragment cloneContents () raises (DOMException); */
  275. NS_IMETHODIMP nsDOMRange::CloneContents(nsIDOMDocumentFragment **_retval)
  276. {
  277. return NS_ERROR_NOT_IMPLEMENTED;
  278. }
  279. /* void insertNode (in nsIDOMNode newNode) raises (DOMException, RangeException); */
  280. NS_IMETHODIMP nsDOMRange::InsertNode(nsIDOMNode *newNode)
  281. {
  282. return NS_ERROR_NOT_IMPLEMENTED;
  283. }
  284. /* void surroundContents (in nsIDOMNode newParent) raises (DOMException, RangeException); */
  285. NS_IMETHODIMP nsDOMRange::SurroundContents(nsIDOMNode *newParent)
  286. {
  287. return NS_ERROR_NOT_IMPLEMENTED;
  288. }
  289. /* nsIDOMRange cloneRange () raises (DOMException); */
  290. NS_IMETHODIMP nsDOMRange::CloneRange(nsIDOMRange **_retval)
  291. {
  292. return NS_ERROR_NOT_IMPLEMENTED;
  293. }
  294. /* DOMString toString () raises (DOMException); */
  295. NS_IMETHODIMP nsDOMRange::ToString(nsAString & _retval)
  296. {
  297. return NS_ERROR_NOT_IMPLEMENTED;
  298. }
  299. /* void detach () raises (DOMException); */
  300. NS_IMETHODIMP nsDOMRange::Detach()
  301. {
  302. return NS_ERROR_NOT_IMPLEMENTED;
  303. }
  304. /* End of implementation class template. */
  305. #endif
  306. #endif /* __gen_nsIDOMRange_h__ */