Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / public / platform / WebSelectionBound.h
blob08609de94cbd6324157cb3c1d917e721b092d17b
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
3 // found in the LICENSE file.
5 #ifndef WebSelectionBound_h
6 #define WebSelectionBound_h
8 #include "public/platform/WebPoint.h"
10 namespace blink {
12 // An endpoint for an active selection region.
13 // TODO(jdduke): Move this to web/ after downstream code adopts |WebSelection|.
14 struct WebSelectionBound {
15 // TODO(jdduke): Remove the type identifier after downstream code adopts
16 // |WebSelection| for determining bound orientation.
17 enum Type {
18 Caret,
19 SelectionLeft,
20 SelectionRight
23 explicit WebSelectionBound(Type type)
24 : type(type)
25 , layerId(0)
26 , isTextDirectionRTL(false)
30 // The logical type of the endpoint. Note that this is dependent not only on
31 // the bound's relative location, but also the underlying text direction.
32 Type type;
34 // The id of the platform layer to which the bound should be anchored.
35 int layerId;
37 // The bottom and top coordinates of the edge (caret), in layer coordinates,
38 // that define the selection bound.
39 WebPoint edgeTopInLayer;
40 WebPoint edgeBottomInLayer;
42 // Whether the text direction at this location is RTL.
43 bool isTextDirectionRTL;
46 } // namespace blink
48 #endif