]>
git.saurik.com Git - iphone-api.git/blob - WebCore/htmlediting.h
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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.
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.
29 #include <wtf/Forward.h>
30 #include "HTMLNames.h"
42 class VisiblePosition
;
44 Position
rangeCompliantEquivalent(const Position
&);
45 Position
rangeCompliantEquivalent(const VisiblePosition
&);
46 int maxDeepOffset(const Node
*);
47 bool isAtomicNode(const Node
*);
48 bool editingIgnoresContent(const Node
*);
49 bool canHaveChildrenForEditing(const Node
*);
50 Node
* highestEditableRoot(const Position
&);
51 VisiblePosition
firstEditablePositionAfterPositionInRoot(const Position
&, Node
*);
52 VisiblePosition
lastEditablePositionBeforePositionInRoot(const Position
&, Node
*);
53 int comparePositions(const Position
&, const Position
&);
54 Node
* lowestEditableAncestor(Node
*);
55 bool isContentEditable(const Node
*);
56 Position
nextCandidate(const Position
&);
57 Position
nextVisuallyDistinctCandidate(const Position
&);
58 Position
previousCandidate(const Position
&);
59 Position
previousVisuallyDistinctCandidate(const Position
&);
60 bool isEditablePosition(const Position
&);
61 bool isRichlyEditablePosition(const Position
&);
62 Element
* editableRootForPosition(const Position
&);
63 bool isBlock(const Node
*);
64 Node
* enclosingBlock(Node
*);
66 String
stringWithRebalancedWhitespace(const String
&, bool, bool);
67 const String
& nonBreakingSpaceString();
69 //------------------------------------------------------------------------------------------
71 Position
positionBeforeNode(const Node
*);
72 Position
positionAfterNode(const Node
*);
74 PassRefPtr
<Range
> avoidIntersectionWithNode(const Range
*, Node
*);
75 Selection
avoidIntersectionWithNode(const Selection
&, Node
*);
77 bool isSpecialElement(const Node
*);
78 bool validBlockTag(const String
&);
80 PassRefPtr
<HTMLElement
> createDefaultParagraphElement(Document
*);
81 PassRefPtr
<HTMLElement
> createBreakElement(Document
*);
82 PassRefPtr
<HTMLElement
> createOrderedListElement(Document
*);
83 PassRefPtr
<HTMLElement
> createUnorderedListElement(Document
*);
84 PassRefPtr
<HTMLElement
> createListItemElement(Document
*);
85 PassRefPtr
<HTMLElement
> createHTMLElement(Document
*, const QualifiedName
&);
86 PassRefPtr
<HTMLElement
> createHTMLElement(Document
*, const AtomicString
&);
88 bool isTabSpanNode(const Node
*);
89 bool isTabSpanTextNode(const Node
*);
90 Node
* tabSpanNode(const Node
*);
91 Position
positionBeforeTabSpan(const Position
&);
92 PassRefPtr
<Element
> createTabSpanElement(Document
*);
93 PassRefPtr
<Element
> createTabSpanElement(Document
*, PassRefPtr
<Node
> tabTextNode
);
94 PassRefPtr
<Element
> createTabSpanElement(Document
*, const String
& tabText
);
96 bool isNodeRendered(const Node
*);
97 bool isMailBlockquote(const Node
*);
98 Node
* nearestMailBlockquote(const Node
*);
99 unsigned numEnclosingMailBlockquotes(const Position
&);
100 int caretMinOffset(const Node
*);
101 int caretMaxOffset(const Node
*);
103 //------------------------------------------------------------------------------------------
105 bool isTableStructureNode(const Node
*);
106 PassRefPtr
<Element
> createBlockPlaceholderElement(Document
*);
108 bool isFirstVisiblePositionInSpecialElement(const Position
&);
109 Position
positionBeforeContainingSpecialElement(const Position
&, Node
** containingSpecialElement
=0);
110 bool isLastVisiblePositionInSpecialElement(const Position
&);
111 Position
positionAfterContainingSpecialElement(const Position
&, Node
** containingSpecialElement
=0);
112 Position
positionOutsideContainingSpecialElement(const Position
&, Node
** containingSpecialElement
=0);
113 Node
* isLastPositionBeforeTable(const VisiblePosition
&);
114 Node
* isFirstPositionAfterTable(const VisiblePosition
&);
116 Node
* enclosingNodeWithTag(const Position
&, const QualifiedName
&);
117 Node
* enclosingNodeOfType(const Position
&, bool (*nodeIsOfType
)(const Node
*), bool onlyReturnEditableNodes
= true);
118 Node
* highestEnclosingNodeOfType(const Position
&, bool (*nodeIsOfType
)(const Node
*));
119 Node
* enclosingTableCell(const Position
&);
120 Node
* enclosingEmptyListItem(const VisiblePosition
&);
121 Node
* enclosingAnchorElement(const Position
&);
122 bool isListElement(Node
*);
123 HTMLElement
* enclosingList(Node
*);
124 HTMLElement
* outermostEnclosingList(Node
*);
125 Node
* enclosingListChild(Node
*);
126 Node
* highestAncestor(Node
*);
127 bool isTableElement(Node
*);
128 bool isTableCell(const Node
*);
130 bool lineBreakExistsAtPosition(const Position
&);
131 bool lineBreakExistsAtVisiblePosition(const VisiblePosition
&);
133 Selection
selectionForParagraphIteration(const Selection
&);
135 int indexForVisiblePosition(VisiblePosition
&);