| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004 Apple Computer, 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 12 matching lines...) Expand all Loading... |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef VisibleSelection_h | 26 #ifndef VisibleSelection_h |
| 27 #define VisibleSelection_h | 27 #define VisibleSelection_h |
| 28 | 28 |
| 29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
| 30 #include "core/editing/SelectionType.h" | 30 #include "core/editing/SelectionType.h" |
| 31 #include "core/editing/TextGranularity.h" | 31 #include "core/editing/TextGranularity.h" |
| 32 #include "core/editing/VisiblePosition.h" | 32 #include "core/editing/VisiblePosition.h" |
| 33 #include "core/editing/VisibleUnits.h" |
| 33 | 34 |
| 34 namespace blink { | 35 namespace blink { |
| 35 | 36 |
| 36 class LayoutPoint; | 37 class LayoutPoint; |
| 37 | 38 |
| 38 const EAffinity SEL_DEFAULT_AFFINITY = DOWNSTREAM; | 39 const EAffinity SEL_DEFAULT_AFFINITY = DOWNSTREAM; |
| 39 enum SelectionDirection { DirectionForward, DirectionBackward, DirectionRight, D
irectionLeft }; | 40 enum SelectionDirection { DirectionForward, DirectionBackward, DirectionRight, D
irectionLeft }; |
| 40 | 41 |
| 41 class CORE_EXPORT VisibleSelection { | 42 class CORE_EXPORT VisibleSelection { |
| 42 DISALLOW_ALLOCATION(); | 43 DISALLOW_ALLOCATION(); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 DECLARE_TRACE(); | 139 DECLARE_TRACE(); |
| 139 | 140 |
| 140 void validatePositionsIfNeeded(); | 141 void validatePositionsIfNeeded(); |
| 141 | 142 |
| 142 #ifndef NDEBUG | 143 #ifndef NDEBUG |
| 143 void debugPosition() const; | 144 void debugPosition() const; |
| 144 void formatForDebugger(char* buffer, unsigned length) const; | 145 void formatForDebugger(char* buffer, unsigned length) const; |
| 145 void showTreeForThis() const; | 146 void showTreeForThis() const; |
| 146 #endif | 147 #endif |
| 147 | 148 |
| 148 void setStartRespectingGranularity(TextGranularity); | 149 void setStartRespectingGranularity(TextGranularity, EWordSide = RightWordIfO
nBoundary); |
| 149 void setEndRespectingGranularity(TextGranularity); | 150 void setEndRespectingGranularity(TextGranularity, EWordSide = RightWordIfOnB
oundary); |
| 150 | 151 |
| 151 private: | 152 private: |
| 152 void validate(TextGranularity = CharacterGranularity); | 153 void validate(TextGranularity = CharacterGranularity); |
| 153 | 154 |
| 154 // Support methods for validate() | 155 // Support methods for validate() |
| 155 void setBaseAndExtentToDeepEquivalents(); | 156 void setBaseAndExtentToDeepEquivalents(); |
| 156 void adjustSelectionToAvoidCrossingShadowBoundaries(); | 157 void adjustSelectionToAvoidCrossingShadowBoundaries(); |
| 157 void adjustSelectionToAvoidCrossingEditingBoundaries(); | 158 void adjustSelectionToAvoidCrossingEditingBoundaries(); |
| 158 void updateSelectionType(); | 159 void updateSelectionType(); |
| 159 | 160 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 199 |
| 199 } // namespace blink | 200 } // namespace blink |
| 200 | 201 |
| 201 #ifndef NDEBUG | 202 #ifndef NDEBUG |
| 202 // Outside the WebCore namespace for ease of invocation from gdb. | 203 // Outside the WebCore namespace for ease of invocation from gdb. |
| 203 void showTree(const blink::VisibleSelection&); | 204 void showTree(const blink::VisibleSelection&); |
| 204 void showTree(const blink::VisibleSelection*); | 205 void showTree(const blink::VisibleSelection*); |
| 205 #endif | 206 #endif |
| 206 | 207 |
| 207 #endif // VisibleSelection_h | 208 #endif // VisibleSelection_h |
| OLD | NEW |