OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WebSelectionBound_h | 5 #ifndef WebSelectionBound_h |
6 #define WebSelectionBound_h | 6 #define WebSelectionBound_h |
7 | 7 |
8 #include "public/platform/WebPoint.h" | 8 #include "public/platform/WebPoint.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 // An endpoint for an active selection region. | 12 // An endpoint for an active selection region. |
| 13 // TODO(jdduke): Move this to web/ after downstream code adopts |WebSelection|. |
13 struct WebSelectionBound { | 14 struct WebSelectionBound { |
| 15 // TODO(jdduke): Remove the type identifier after downstream code adopts |
| 16 // |WebSelection| for determining bound orientation. |
14 enum Type { | 17 enum Type { |
15 Caret, | 18 Caret, |
16 SelectionLeft, | 19 SelectionLeft, |
17 SelectionRight | 20 SelectionRight |
18 }; | 21 }; |
19 | 22 |
20 explicit WebSelectionBound(Type type) | 23 explicit WebSelectionBound(Type type) |
21 : type(type) | 24 : type(type) |
22 , layerId(0) | 25 , layerId(0) |
| 26 , isTextDirectionRTL(false) |
23 { | 27 { |
24 } | 28 } |
25 | 29 |
26 // The logical type of the endpoint. Note that this is dependent not only on | 30 // The logical type of the endpoint. Note that this is dependent not only on |
27 // the bound's relative location, but also the underlying text direction. | 31 // the bound's relative location, but also the underlying text direction. |
28 Type type; | 32 Type type; |
29 | 33 |
30 // The id of the platform layer to which the bound should be anchored. | 34 // The id of the platform layer to which the bound should be anchored. |
31 int layerId; | 35 int layerId; |
32 | 36 |
33 // The bottom and top coordinates of the edge (caret), in layer coordinates, | 37 // The bottom and top coordinates of the edge (caret), in layer coordinates, |
34 // that define the selection bound. | 38 // that define the selection bound. |
35 WebPoint edgeTopInLayer; | 39 WebPoint edgeTopInLayer; |
36 WebPoint edgeBottomInLayer; | 40 WebPoint edgeBottomInLayer; |
| 41 |
| 42 // Whether the text direction at this location is RTL. |
| 43 bool isTextDirectionRTL; |
37 }; | 44 }; |
38 | 45 |
39 } // namespace blink | 46 } // namespace blink |
40 | 47 |
41 #endif | 48 #endif |
OLD | NEW |