1/* 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#ifndef DO_NO_IMPORTS 27import "oaidl.idl"; 28import "ocidl.idl"; 29import "DOMCore.idl"; 30#endif 31 32interface IDOMNode; 33interface IDOMDocumentFragment; 34 35typedef enum _WebSelectionAffinity { 36 WebSelectionAffinityUpstream = 0, 37 WebSelectionAffinityDownstream = 1 38} WebSelectionAffinity; 39 40enum { 41 // 42 // DOM range exception codes 43 // 44 DOM_BAD_BOUNDARYPOINTS_ERR = 1, 45 DOM_INVALID_NODE_TYPE_ERR = 2, 46}; 47 48enum { 49 // 50 // DOM Range comparison codes 51 // 52 DOM_START_TO_START = 0, 53 DOM_START_TO_END = 1, 54 DOM_END_TO_END = 2, 55 DOM_END_TO_START = 3, 56}; 57 58/* 59 @interface DOMRange : DOMObject 60*/ 61[ 62 object, 63 oleautomation, 64 uuid(2F33E42C-0B39-48b3-B7B6-E910CDB325AD), 65 pointer_default(unique) 66] 67interface IDOMRange : IDOMObject 68{ 69 /* 70 - (DOMNode *)startContainer; 71 */ 72 HRESULT startContainer([out, retval] IDOMNode** node); 73 74 /* 75 - (int)startOffset; 76 */ 77 HRESULT startOffset([out, retval] int* offset); 78 79 /* 80 - (DOMNode *)endContainer; 81 */ 82 HRESULT endContainer([out, retval] IDOMNode** node); 83 84 /* 85 - (int)endOffset; 86 */ 87 HRESULT endOffset([out, retval] int* offset); 88 89 /* 90 - (BOOL)collapsed; 91 */ 92 HRESULT collapsed([out, retval] BOOL* result); 93 94 /* 95 - (DOMNode *)commonAncestorContainer; 96 */ 97 HRESULT commonAncestorContainer([out, retval] IDOMNode** container); 98 99 /* 100 - (void)setStart:(DOMNode *)refNode :(int)offset; 101 */ 102 HRESULT setStart([in] IDOMNode* refNode, [in] int offset); 103 104 /* 105 - (void)setEnd:(DOMNode *)refNode :(int)offset; 106 */ 107 HRESULT setEnd([in] IDOMNode* refNode, [in] int offset); 108 109 /* 110 - (void)setStartBefore:(DOMNode *)refNode; 111 */ 112 HRESULT setStartBefore([in] IDOMNode* refNode); 113 114 /* 115 - (void)setStartAfter:(DOMNode *)refNode; 116 */ 117 HRESULT setStartAfter([in] IDOMNode* refNode); 118 119 /* 120 - (void)setEndBefore:(DOMNode *)refNode; 121 */ 122 HRESULT setEndBefore([in] IDOMNode* refNode); 123 124 /* 125 - (void)setEndAfter:(DOMNode *)refNode; 126 */ 127 HRESULT setEndAfter([in] IDOMNode* refNode); 128 129 /* 130 - (void)collapse:(BOOL)toStart; 131 */ 132 HRESULT collapse([in] BOOL toStart); 133 134 /* 135 - (void)selectNode:(DOMNode *)refNode; 136 */ 137 HRESULT selectNode([in] IDOMNode* refNode); 138 139 /* 140 - (void)selectNodeContents:(DOMNode *)refNode; 141 */ 142 HRESULT selectNodeContents([in] IDOMNode* refNode); 143 144 /* 145 - (short)compareBoundaryPoints:(unsigned short)how :(DOMRange *)sourceRange; 146 */ 147 HRESULT compareBoundaryPoints([in] unsigned short how, [in] IDOMRange* sourceRange); 148 149 /* 150 - (void)deleteContents; 151 */ 152 HRESULT deleteContents(); 153 154 /* 155 - (DOMDocumentFragment *)extractContents; 156 */ 157 HRESULT extractContents([out, retval] IDOMDocumentFragment** fragment); 158 159 /* 160 - (DOMDocumentFragment *)cloneContents; 161 */ 162 HRESULT cloneContents([out, retval] IDOMDocumentFragment** fragment); 163 164 /* 165 - (void)insertNode:(DOMNode *)newNode; 166 */ 167 HRESULT insertNode([in] IDOMNode* newNode); 168 169 /* 170 - (void)surroundContents:(DOMNode *)newParent; 171 */ 172 HRESULT surroundContents([in] IDOMNode* newParent); 173 174 /* 175 - (DOMRange *)cloneRange; 176 */ 177 HRESULT cloneRange([out, retval] IDOMRange** range); 178 179 /* 180 - (NSString *)toString; 181 */ 182 HRESULT toString([out, retval] BSTR* str); 183 184 /* 185 - (void)detach; 186 */ 187 HRESULT detach(); 188} 189