OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 typedef unsigned SetSelectionOptions; // Union of values in SetSelectionOpti
on and EUserTriggered | 82 typedef unsigned SetSelectionOptions; // Union of values in SetSelectionOpti
on and EUserTriggered |
83 static inline EUserTriggered selectionOptionsToUserTriggered(SetSelectionOpt
ions options) | 83 static inline EUserTriggered selectionOptionsToUserTriggered(SetSelectionOpt
ions options) |
84 { | 84 { |
85 return static_cast<EUserTriggered>(options & UserTriggered); | 85 return static_cast<EUserTriggered>(options & UserTriggered); |
86 } | 86 } |
87 | 87 |
88 enum DirectoinalOption { | 88 enum DirectoinalOption { |
89 NonDirectional, | 89 NonDirectional, |
90 Directional | 90 Directional |
91 }; | 91 }; |
| 92 enum UpdateAppearanceOption { |
| 93 None, |
| 94 ResetCaretBlink |
| 95 }; |
92 | 96 |
93 Element* rootEditableElement() const { return m_selection.rootEditableElemen
t(); } | 97 Element* rootEditableElement() const { return m_selection.rootEditableElemen
t(); } |
94 Element* rootEditableElementOrDocumentElement() const; | 98 Element* rootEditableElementOrDocumentElement() const; |
95 ContainerNode* rootEditableElementOrTreeScopeRootNode() const; | 99 ContainerNode* rootEditableElementOrTreeScopeRootNode() const; |
96 | 100 |
97 bool hasEditableStyle() const { return m_selection.hasEditableStyle(); } | 101 bool hasEditableStyle() const { return m_selection.hasEditableStyle(); } |
98 bool isContentEditable() const { return m_selection.isContentEditable(); } | 102 bool isContentEditable() const { return m_selection.isContentEditable(); } |
99 bool isContentRichlyEditable() const { return m_selection.isContentRichlyEdi
table(); } | 103 bool isContentRichlyEditable() const { return m_selection.isContentRichlyEdi
table(); } |
100 | 104 |
101 void moveTo(const VisiblePosition&, EUserTriggered = NotUserTriggered, Curso
rAlignOnScroll = AlignCursorOnScrollIfNeeded); | 105 void moveTo(const VisiblePosition&, EUserTriggered = NotUserTriggered, Curso
rAlignOnScroll = AlignCursorOnScrollIfNeeded); |
(...skipping 30 matching lines...) Expand all Loading... |
132 void setExtent(const VisiblePosition&, EUserTriggered = NotUserTriggered); | 136 void setExtent(const VisiblePosition&, EUserTriggered = NotUserTriggered); |
133 | 137 |
134 Position base() const { return m_selection.base(); } | 138 Position base() const { return m_selection.base(); } |
135 Position extent() const { return m_selection.extent(); } | 139 Position extent() const { return m_selection.extent(); } |
136 Position start() const { return m_selection.start(); } | 140 Position start() const { return m_selection.start(); } |
137 Position end() const { return m_selection.end(); } | 141 Position end() const { return m_selection.end(); } |
138 | 142 |
139 // Return the renderer that is responsible for painting the caret (in the se
lection start node) | 143 // Return the renderer that is responsible for painting the caret (in the se
lection start node) |
140 RenderBlock* caretRenderer() const; | 144 RenderBlock* caretRenderer() const; |
141 | 145 |
142 // Caret rect local to the caret's renderer | 146 // Update caret rect local to the caret's renderer |
143 LayoutRect localCaretRect(); | 147 void updateLocalCaretRect(); |
144 LayoutRect localCaretRectWithoutUpdateForTesting() const { return CaretBase:
:localCaretRectWithoutUpdate(); } | 148 LayoutRect localCaretRectWithoutUpdateForTesting() const { return CaretBase:
:localCaretRectWithoutUpdate(); } |
145 | 149 |
146 // Bounds of (possibly transformed) caret in absolute coords | 150 // Bounds of (possibly transformed) caret in absolute coords |
147 IntRect absoluteCaretBounds(); | 151 IntRect absoluteCaretBounds(); |
148 void setCaretRectNeedsUpdate() { CaretBase::setCaretRectNeedsUpdate(); } | 152 void setCaretRectNeedsUpdate() { CaretBase::setCaretRectNeedsUpdate(); } |
149 | 153 |
150 void didChangeFocus(); | 154 void didChangeFocus(); |
151 void willBeModified(EAlteration, SelectionDirection); | 155 void willBeModified(EAlteration, SelectionDirection); |
152 | 156 |
153 bool isNone() const { return m_selection.isNone(); } | 157 bool isNone() const { return m_selection.isNone(); } |
(...skipping 23 matching lines...) Expand all Loading... |
177 void setCaretBlinkingSuspended(bool suspended) { m_isCaretBlinkingSuspended
= suspended; } | 181 void setCaretBlinkingSuspended(bool suspended) { m_isCaretBlinkingSuspended
= suspended; } |
178 bool isCaretBlinkingSuspended() const { return m_isCaretBlinkingSuspended; } | 182 bool isCaretBlinkingSuspended() const { return m_isCaretBlinkingSuspended; } |
179 | 183 |
180 // Focus | 184 // Focus |
181 void setFocused(bool); | 185 void setFocused(bool); |
182 bool isFocused() const { return m_focused; } | 186 bool isFocused() const { return m_focused; } |
183 bool isFocusedAndActive() const; | 187 bool isFocusedAndActive() const; |
184 void pageActivationChanged(); | 188 void pageActivationChanged(); |
185 | 189 |
186 // Painting. | 190 // Painting. |
187 void updateAppearance(); | 191 void updateAppearance(UpdateAppearanceOption = None); |
188 | 192 |
189 void updateSecureKeyboardEntryIfActive(); | 193 void updateSecureKeyboardEntryIfActive(); |
190 | 194 |
191 #ifndef NDEBUG | 195 #ifndef NDEBUG |
192 void formatForDebugger(char* buffer, unsigned length) const; | 196 void formatForDebugger(char* buffer, unsigned length) const; |
193 void showTreeForThis() const; | 197 void showTreeForThis() const; |
194 #endif | 198 #endif |
195 | 199 |
196 enum EndPointsAdjustmentMode { AdjustEndpointsAtBidiBoundary, DoNotAdjsutEnd
points }; | 200 enum EndPointsAdjustmentMode { AdjustEndpointsAtBidiBoundary, DoNotAdjsutEnd
points }; |
197 void setNonDirectionalSelectionIfNeeded(const VisibleSelection&, TextGranula
rity, EndPointsAdjustmentMode = DoNotAdjsutEndpoints); | 201 void setNonDirectionalSelectionIfNeeded(const VisibleSelection&, TextGranula
rity, EndPointsAdjustmentMode = DoNotAdjsutEndpoints); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 } | 313 } |
310 } // namespace blink | 314 } // namespace blink |
311 | 315 |
312 #ifndef NDEBUG | 316 #ifndef NDEBUG |
313 // Outside the WebCore namespace for ease of invocation from gdb. | 317 // Outside the WebCore namespace for ease of invocation from gdb. |
314 void showTree(const blink::FrameSelection&); | 318 void showTree(const blink::FrameSelection&); |
315 void showTree(const blink::FrameSelection*); | 319 void showTree(const blink::FrameSelection*); |
316 #endif | 320 #endif |
317 | 321 |
318 #endif // FrameSelection_h | 322 #endif // FrameSelection_h |
OLD | NEW |