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 21 matching lines...) Expand all Loading... |
32 #include "core/editing/SelectionTemplate.h" | 32 #include "core/editing/SelectionTemplate.h" |
33 #include "core/editing/SelectionType.h" | 33 #include "core/editing/SelectionType.h" |
34 #include "core/editing/TextAffinity.h" | 34 #include "core/editing/TextAffinity.h" |
35 #include "core/editing/TextGranularity.h" | 35 #include "core/editing/TextGranularity.h" |
36 #include "core/editing/VisiblePosition.h" | 36 #include "core/editing/VisiblePosition.h" |
37 #include "core/editing/VisibleUnits.h" | 37 #include "core/editing/VisibleUnits.h" |
38 #include "wtf/Allocator.h" | 38 #include "wtf/Allocator.h" |
39 | 39 |
40 namespace blink { | 40 namespace blink { |
41 | 41 |
42 class SelectionAdjuster; | |
43 | |
44 const TextAffinity SelDefaultAffinity = TextAffinity::Downstream; | 42 const TextAffinity SelDefaultAffinity = TextAffinity::Downstream; |
45 enum SelectionDirection { | 43 enum SelectionDirection { |
46 DirectionForward, | 44 DirectionForward, |
47 DirectionBackward, | 45 DirectionBackward, |
48 DirectionRight, | 46 DirectionRight, |
49 DirectionLeft | 47 DirectionLeft |
50 }; | 48 }; |
51 | 49 |
52 template <typename Strategy> | 50 template <typename Strategy> |
53 class CORE_TEMPLATE_CLASS_EXPORT VisibleSelectionTemplate { | 51 class CORE_TEMPLATE_CLASS_EXPORT VisibleSelectionTemplate { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 const PositionTemplate<Strategy>&); | 127 const PositionTemplate<Strategy>&); |
130 | 128 |
131 DECLARE_TRACE(); | 129 DECLARE_TRACE(); |
132 | 130 |
133 #ifndef NDEBUG | 131 #ifndef NDEBUG |
134 void showTreeForThis() const; | 132 void showTreeForThis() const; |
135 #endif | 133 #endif |
136 static void PrintTo(const VisibleSelectionTemplate&, std::ostream*); | 134 static void PrintTo(const VisibleSelectionTemplate&, std::ostream*); |
137 | 135 |
138 private: | 136 private: |
139 friend class SelectionAdjuster; | |
140 | |
141 VisibleSelectionTemplate(const SelectionTemplate<Strategy>&); | 137 VisibleSelectionTemplate(const SelectionTemplate<Strategy>&); |
142 | 138 |
143 void validate(TextGranularity = CharacterGranularity); | 139 void validate(TextGranularity = CharacterGranularity); |
144 | 140 |
145 // Support methods for validate() | 141 // Support methods for validate() |
146 void setBaseAndExtentToDeepEquivalents(); | 142 void setBaseAndExtentToDeepEquivalents(); |
147 void adjustSelectionToAvoidCrossingShadowBoundaries(); | 143 void adjustSelectionToAvoidCrossingShadowBoundaries(); |
148 void adjustSelectionToAvoidCrossingEditingBoundaries(); | 144 void adjustSelectionToAvoidCrossingEditingBoundaries(); |
149 void updateSelectionType(); | 145 void updateSelectionType(); |
150 | 146 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 200 |
205 #ifndef NDEBUG | 201 #ifndef NDEBUG |
206 // Outside the WebCore namespace for ease of invocation from gdb. | 202 // Outside the WebCore namespace for ease of invocation from gdb. |
207 void showTree(const blink::VisibleSelection&); | 203 void showTree(const blink::VisibleSelection&); |
208 void showTree(const blink::VisibleSelection*); | 204 void showTree(const blink::VisibleSelection*); |
209 void showTree(const blink::VisibleSelectionInFlatTree&); | 205 void showTree(const blink::VisibleSelectionInFlatTree&); |
210 void showTree(const blink::VisibleSelectionInFlatTree*); | 206 void showTree(const blink::VisibleSelectionInFlatTree*); |
211 #endif | 207 #endif |
212 | 208 |
213 #endif // VisibleSelection_h | 209 #endif // VisibleSelection_h |
OLD | NEW |