Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: Source/core/editing/VisibleSelection.h

Issue 988023005: Implementing directional selection strategy in Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Missing file. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 196
196 } // namespace blink 197 } // namespace blink
197 198
198 #ifndef NDEBUG 199 #ifndef NDEBUG
199 // Outside the WebCore namespace for ease of invocation from gdb. 200 // Outside the WebCore namespace for ease of invocation from gdb.
200 void showTree(const blink::VisibleSelection&); 201 void showTree(const blink::VisibleSelection&);
201 void showTree(const blink::VisibleSelection*); 202 void showTree(const blink::VisibleSelection*);
202 #endif 203 #endif
203 204
204 #endif // VisibleSelection_h 205 #endif // VisibleSelection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698