OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) | 3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) |
4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) | 4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) |
5 * (C) 2001 Peter Kelly (pmk@post.com) | 5 * (C) 2001 Peter Kelly (pmk@post.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 short comparePoint(Node* refNode, int offset, ExceptionState&) const; | 72 short comparePoint(Node* refNode, int offset, ExceptionState&) const; |
73 enum CompareResults { NODE_BEFORE, NODE_AFTER, NODE_BEFORE_AND_AFTER, NODE_I
NSIDE }; | 73 enum CompareResults { NODE_BEFORE, NODE_AFTER, NODE_BEFORE_AND_AFTER, NODE_I
NSIDE }; |
74 CompareResults compareNode(Node* refNode, ExceptionState&) const; | 74 CompareResults compareNode(Node* refNode, ExceptionState&) const; |
75 enum CompareHow { START_TO_START, START_TO_END, END_TO_END, END_TO_START }; | 75 enum CompareHow { START_TO_START, START_TO_END, END_TO_END, END_TO_START }; |
76 short compareBoundaryPoints(CompareHow, const Range* sourceRange, ExceptionS
tate&) const; | 76 short compareBoundaryPoints(CompareHow, const Range* sourceRange, ExceptionS
tate&) const; |
77 static short compareBoundaryPoints(Node* containerA, int offsetA, Node* cont
ainerB, int offsetB, ExceptionState&); | 77 static short compareBoundaryPoints(Node* containerA, int offsetA, Node* cont
ainerB, int offsetB, ExceptionState&); |
78 static short compareBoundaryPoints(const RangeBoundaryPoint& boundaryA, cons
t RangeBoundaryPoint& boundaryB, ExceptionState&); | 78 static short compareBoundaryPoints(const RangeBoundaryPoint& boundaryA, cons
t RangeBoundaryPoint& boundaryB, ExceptionState&); |
79 bool boundaryPointsValid() const; | 79 bool boundaryPointsValid() const; |
80 bool intersectsNode(Node* refNode, ExceptionState&); | 80 bool intersectsNode(Node* refNode, ExceptionState&); |
81 void deleteContents(ExceptionState&); | 81 void deleteContents(ExceptionState&); |
82 PassRefPtrWillBeRawPtr<DocumentFragment> extractContents(ExceptionState&); | 82 PassRefPtr<DocumentFragment> extractContents(ExceptionState&); |
83 PassRefPtrWillBeRawPtr<DocumentFragment> cloneContents(ExceptionState&); | 83 PassRefPtr<DocumentFragment> cloneContents(ExceptionState&); |
84 void insertNode(PassRefPtr<Node>, ExceptionState&); | 84 void insertNode(PassRefPtr<Node>, ExceptionState&); |
85 String toString() const; | 85 String toString() const; |
86 | 86 |
87 String toHTML() const; | 87 String toHTML() const; |
88 String text() const; | 88 String text() const; |
89 | 89 |
90 PassRefPtrWillBeRawPtr<DocumentFragment> createContextualFragment(const Stri
ng& html, ExceptionState&); | 90 PassRefPtr<DocumentFragment> createContextualFragment(const String& html, Ex
ceptionState&); |
91 | 91 |
92 void detach(); | 92 void detach(); |
93 PassRefPtrWillBeRawPtr<Range> cloneRange() const; | 93 PassRefPtrWillBeRawPtr<Range> cloneRange() const; |
94 | 94 |
95 void setStartAfter(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); | 95 void setStartAfter(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); |
96 void setEndBefore(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); | 96 void setEndBefore(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); |
97 void setEndAfter(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); | 97 void setEndAfter(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); |
98 void selectNode(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); | 98 void selectNode(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); |
99 void selectNodeContents(Node*, ExceptionState&); | 99 void selectNodeContents(Node*, ExceptionState&); |
100 void surroundContents(PassRefPtr<Node>, ExceptionState&); | 100 void surroundContents(PassRefPtr<Node>, ExceptionState&); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 explicit Range(Document&); | 152 explicit Range(Document&); |
153 Range(Document&, Node* startContainer, int startOffset, Node* endContainer,
int endOffset); | 153 Range(Document&, Node* startContainer, int startOffset, Node* endContainer,
int endOffset); |
154 | 154 |
155 void setDocument(Document&); | 155 void setDocument(Document&); |
156 | 156 |
157 Node* checkNodeWOffset(Node*, int offset, ExceptionState&) const; | 157 Node* checkNodeWOffset(Node*, int offset, ExceptionState&) const; |
158 void checkNodeBA(Node*, ExceptionState&) const; | 158 void checkNodeBA(Node*, ExceptionState&) const; |
159 void checkDeleteExtract(ExceptionState&); | 159 void checkDeleteExtract(ExceptionState&); |
160 | 160 |
161 enum ActionType { DELETE_CONTENTS, EXTRACT_CONTENTS, CLONE_CONTENTS }; | 161 enum ActionType { DELETE_CONTENTS, EXTRACT_CONTENTS, CLONE_CONTENTS }; |
162 PassRefPtrWillBeRawPtr<DocumentFragment> processContents(ActionType, Excepti
onState&); | 162 PassRefPtr<DocumentFragment> processContents(ActionType, ExceptionState&); |
163 static PassRefPtr<Node> processContentsBetweenOffsets(ActionType, PassRefPtr
WillBeRawPtr<DocumentFragment>, Node*, unsigned startOffset, unsigned endOffset,
ExceptionState&); | 163 static PassRefPtr<Node> processContentsBetweenOffsets(ActionType, PassRefPtr
<DocumentFragment>, Node*, unsigned startOffset, unsigned endOffset, ExceptionSt
ate&); |
164 static void processNodes(ActionType, Vector<RefPtr<Node> >&, PassRefPtr<Node
> oldContainer, PassRefPtr<Node> newContainer, ExceptionState&); | 164 static void processNodes(ActionType, Vector<RefPtr<Node> >&, PassRefPtr<Node
> oldContainer, PassRefPtr<Node> newContainer, ExceptionState&); |
165 enum ContentsProcessDirection { ProcessContentsForward, ProcessContentsBackw
ard }; | 165 enum ContentsProcessDirection { ProcessContentsForward, ProcessContentsBackw
ard }; |
166 static PassRefPtr<Node> processAncestorsAndTheirSiblings(ActionType, Node* c
ontainer, ContentsProcessDirection, PassRefPtr<Node> clonedContainer, Node* comm
onRoot, ExceptionState&); | 166 static PassRefPtr<Node> processAncestorsAndTheirSiblings(ActionType, Node* c
ontainer, ContentsProcessDirection, PassRefPtr<Node> clonedContainer, Node* comm
onRoot, ExceptionState&); |
167 | 167 |
168 RefPtr<Document> m_ownerDocument; // Cannot be null. | 168 RefPtr<Document> m_ownerDocument; // Cannot be null. |
169 RangeBoundaryPoint m_start; | 169 RangeBoundaryPoint m_start; |
170 RangeBoundaryPoint m_end; | 170 RangeBoundaryPoint m_end; |
171 }; | 171 }; |
172 | 172 |
173 PassRefPtrWillBeRawPtr<Range> rangeOfContents(Node*); | 173 PassRefPtrWillBeRawPtr<Range> rangeOfContents(Node*); |
174 | 174 |
175 bool areRangesEqual(const Range*, const Range*); | 175 bool areRangesEqual(const Range*, const Range*); |
176 | 176 |
177 } // namespace | 177 } // namespace |
178 | 178 |
179 #ifndef NDEBUG | 179 #ifndef NDEBUG |
180 // Outside the WebCore namespace for ease of invocation from gdb. | 180 // Outside the WebCore namespace for ease of invocation from gdb. |
181 void showTree(const WebCore::Range*); | 181 void showTree(const WebCore::Range*); |
182 #endif | 182 #endif |
183 | 183 |
184 #endif | 184 #endif |
OLD | NEW |