OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef UI_BASE_TOUCH_SELECTION_BOUND_H_ | |
6 #define UI_BASE_TOUCH_SELECTION_BOUND_H_ | |
7 | |
8 #include "ui/base/ui_base_export.h" | |
9 #include "ui/gfx/point.h" | |
10 #include "ui/gfx/point_f.h" | |
11 | |
12 namespace cc { | |
13 struct ViewportSelectionBound; | |
14 } | |
15 | |
16 namespace gfx { | |
17 class Rect; | |
18 } | |
19 | |
20 namespace ui { | |
21 | |
22 // Bound of a selection end-point. | |
23 class UI_BASE_EXPORT SelectionBound { | |
24 public: | |
25 enum Type { | |
26 LEFT, | |
27 RIGHT, | |
28 CENTER, | |
29 EMPTY, | |
30 LAST = EMPTY | |
31 }; | |
32 | |
33 SelectionBound(); | |
34 explicit SelectionBound(const cc::ViewportSelectionBound& bound); | |
jdduke (slow)
2014/12/02 16:35:37
Why is this virtual?
mohsen
2014/12/02 20:50:31
virtual removed.
| |
35 virtual ~SelectionBound(); | |
36 | |
37 Type type() const { return type_; } | |
38 void set_type(Type value) { type_ = value; } | |
39 | |
40 const gfx::PointF& edge_top() const { return edge_top_; } | |
41 const gfx::Point& edge_top_rounded() const { return edge_top_rounded_; } | |
42 void SetEdgeTop(const gfx::PointF& value); | |
43 | |
44 const gfx::PointF& edge_bottom() const { return edge_bottom_; } | |
45 const gfx::Point& edge_bottom_rounded() const { return edge_bottom_rounded_; } | |
46 void SetEdgeBottom(const gfx::PointF& value); | |
47 | |
48 void SetEdge(const gfx::PointF& top, const gfx::PointF& bottom); | |
49 | |
50 bool visible() const { return visible_; } | |
51 void set_visible(bool value) { visible_ = value; } | |
52 | |
53 int GetHeight() const; | |
jdduke (slow)
2014/12/02 16:35:36
Hmm, this might be worth a comment, as this could
mohsen
2014/12/02 20:50:31
Done.
| |
54 | |
55 private: | |
56 Type type_; | |
57 gfx::PointF edge_top_; | |
58 gfx::PointF edge_bottom_; | |
59 gfx::Point edge_top_rounded_; | |
60 gfx::Point edge_bottom_rounded_; | |
61 bool visible_; | |
62 }; | |
63 | |
64 UI_BASE_EXPORT bool operator==(const SelectionBound& lhs, | |
65 const SelectionBound& rhs); | |
66 UI_BASE_EXPORT bool operator!=(const SelectionBound& lhs, | |
67 const SelectionBound& rhs); | |
68 | |
69 UI_BASE_EXPORT gfx::Rect RectBetweenSelectionBounds(const SelectionBound& b1, | |
70 const SelectionBound& b2); | |
71 | |
72 } // namespace ui | |
73 | |
74 #endif // UI_BASE_TOUCH_SELECTION_BOUND_H_ | |
OLD | NEW |