| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 Element* rootEditableElement() const { return m_selection.rootEditableElemen
t(); } | 96 Element* rootEditableElement() const { return m_selection.rootEditableElemen
t(); } |
| 97 Element* rootEditableElementOrDocumentElement() const; | 97 Element* rootEditableElementOrDocumentElement() const; |
| 98 ContainerNode* rootEditableElementOrTreeScopeRootNode() const; | 98 ContainerNode* rootEditableElementOrTreeScopeRootNode() const; |
| 99 | 99 |
| 100 bool hasEditableStyle() const { return m_selection.hasEditableStyle(); } | 100 bool hasEditableStyle() const { return m_selection.hasEditableStyle(); } |
| 101 bool isContentEditable() const { return m_selection.isContentEditable(); } | 101 bool isContentEditable() const { return m_selection.isContentEditable(); } |
| 102 bool isContentRichlyEditable() const { return m_selection.isContentRichlyEdi
table(); } | 102 bool isContentRichlyEditable() const { return m_selection.isContentRichlyEdi
table(); } |
| 103 | 103 |
| 104 void moveTo(const VisiblePosition&, EUserTriggered = NotUserTriggered, Curso
rAlignOnScroll = AlignCursorOnScrollIfNeeded); | 104 void moveTo(const VisiblePosition&, EUserTriggered = NotUserTriggered, Curso
rAlignOnScroll = AlignCursorOnScrollIfNeeded); |
| 105 void moveTo(const VisiblePosition&, const VisiblePosition&, EUserTriggered =
NotUserTriggered); | 105 void moveTo(const VisiblePosition&, const VisiblePosition&, EUserTriggered =
NotUserTriggered); |
| 106 void moveTo(const Position&, EAffinity, EUserTriggered = NotUserTriggered); | 106 void moveTo(const Position&, TextAffinity, EUserTriggered = NotUserTriggered
); |
| 107 | 107 |
| 108 const VisibleSelection& selection() const { return m_selection; } | 108 const VisibleSelection& selection() const { return m_selection; } |
| 109 void setSelection(const VisibleSelection&, SetSelectionOptions = CloseTyping
| ClearTypingStyle, CursorAlignOnScroll = AlignCursorOnScrollIfNeeded, TextGran
ularity = CharacterGranularity); | 109 void setSelection(const VisibleSelection&, SetSelectionOptions = CloseTyping
| ClearTypingStyle, CursorAlignOnScroll = AlignCursorOnScrollIfNeeded, TextGran
ularity = CharacterGranularity); |
| 110 void setSelection(const VisibleSelection& selection, TextGranularity granula
rity) { setSelection(selection, CloseTyping | ClearTypingStyle, AlignCursorOnScr
ollIfNeeded, granularity); } | 110 void setSelection(const VisibleSelection& selection, TextGranularity granula
rity) { setSelection(selection, CloseTyping | ClearTypingStyle, AlignCursorOnScr
ollIfNeeded, granularity); } |
| 111 // TODO(yosin) We should get rid of |Range| version of |setSelectedRagne()| | 111 // TODO(yosin) We should get rid of |Range| version of |setSelectedRagne()| |
| 112 // for Oilpan. | 112 // for Oilpan. |
| 113 bool setSelectedRange(Range*, EAffinity, DirectionalOption = NonDirectional,
SetSelectionOptions = CloseTyping | ClearTypingStyle); | 113 bool setSelectedRange(Range*, TextAffinity, DirectionalOption = NonDirection
al, SetSelectionOptions = CloseTyping | ClearTypingStyle); |
| 114 bool setSelectedRange(const EphemeralRange&, EAffinity, DirectionalOption =
NonDirectional, SetSelectionOptions = CloseTyping | ClearTypingStyle); | 114 bool setSelectedRange(const EphemeralRange&, TextAffinity, DirectionalOption
= NonDirectional, SetSelectionOptions = CloseTyping | ClearTypingStyle); |
| 115 void selectAll(); | 115 void selectAll(); |
| 116 void clear(); | 116 void clear(); |
| 117 void prepareForDestruction(); | 117 void prepareForDestruction(); |
| 118 | 118 |
| 119 // Call this after doing user-triggered selections to make it easy to delete
the frame you entirely selected. | 119 // Call this after doing user-triggered selections to make it easy to delete
the frame you entirely selected. |
| 120 void selectFrameElementInParentIfFullySelected(); | 120 void selectFrameElementInParentIfFullySelected(); |
| 121 | 121 |
| 122 bool contains(const LayoutPoint&); | 122 bool contains(const LayoutPoint&); |
| 123 | 123 |
| 124 SelectionType selectionType() const { return m_selection.selectionType(); } | 124 SelectionType selectionType() const { return m_selection.selectionType(); } |
| 125 | 125 |
| 126 EAffinity affinity() const { return m_selection.affinity(); } | 126 TextAffinity affinity() const { return m_selection.affinity(); } |
| 127 | 127 |
| 128 bool modify(EAlteration, SelectionDirection, TextGranularity, EUserTriggered
= NotUserTriggered); | 128 bool modify(EAlteration, SelectionDirection, TextGranularity, EUserTriggered
= NotUserTriggered); |
| 129 enum VerticalDirection { DirectionUp, DirectionDown }; | 129 enum VerticalDirection { DirectionUp, DirectionDown }; |
| 130 bool modify(EAlteration, unsigned verticalDistance, VerticalDirection, EUser
Triggered = NotUserTriggered, CursorAlignOnScroll = AlignCursorOnScrollIfNeeded)
; | 130 bool modify(EAlteration, unsigned verticalDistance, VerticalDirection, EUser
Triggered = NotUserTriggered, CursorAlignOnScroll = AlignCursorOnScrollIfNeeded)
; |
| 131 | 131 |
| 132 // Moves the selection extent based on the selection granularity strategy. | 132 // Moves the selection extent based on the selection granularity strategy. |
| 133 // This function does not allow the selection to collapse. If the new | 133 // This function does not allow the selection to collapse. If the new |
| 134 // extent is resolved to the same position as the current base, this | 134 // extent is resolved to the same position as the current base, this |
| 135 // function will do nothing. | 135 // function will do nothing. |
| 136 void moveRangeSelectionExtent(const IntPoint&); | 136 void moveRangeSelectionExtent(const IntPoint&); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 339 } |
| 340 } // namespace blink | 340 } // namespace blink |
| 341 | 341 |
| 342 #ifndef NDEBUG | 342 #ifndef NDEBUG |
| 343 // Outside the WebCore namespace for ease of invocation from gdb. | 343 // Outside the WebCore namespace for ease of invocation from gdb. |
| 344 void showTree(const blink::FrameSelection&); | 344 void showTree(const blink::FrameSelection&); |
| 345 void showTree(const blink::FrameSelection*); | 345 void showTree(const blink::FrameSelection*); |
| 346 #endif | 346 #endif |
| 347 | 347 |
| 348 #endif // FrameSelection_h | 348 #endif // FrameSelection_h |
| OLD | NEW |