Chromium Code Reviews| 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 "cc/output/viewport_selection_bound.h" | |
|
mfomitchev
2014/12/01 21:36:24
A bunch of these can simply be declared here and i
mohsen
2014/12/02 05:17:02
Done.
| |
| 9 #include "ui/base/ui_base_export.h" | |
| 10 #include "ui/gfx/point.h" | |
| 11 #include "ui/gfx/point_f.h" | |
| 12 #include "ui/gfx/rect.h" | |
| 13 | |
| 14 namespace ui { | |
| 15 | |
| 16 // Bound of a selection end-point. | |
| 17 class UI_BASE_EXPORT SelectionBound { | |
| 18 public: | |
| 19 enum Type { | |
| 20 LEFT, | |
| 21 RIGHT, | |
| 22 CENTER, | |
| 23 EMPTY, | |
| 24 LAST = EMPTY | |
| 25 }; | |
| 26 | |
| 27 SelectionBound(); | |
| 28 SelectionBound(const cc::ViewportSelectionBound& bound); | |
| 29 virtual ~SelectionBound(); | |
| 30 | |
| 31 Type type() const { return type_; } | |
| 32 void set_type(Type value) { type_ = value; } | |
| 33 | |
| 34 const gfx::PointF& edge_top() const { return edge_top_; } | |
| 35 const gfx::Point& edge_top_rounded() const { return edge_top_rounded_; } | |
| 36 void SetEdgeTop(const gfx::PointF& value); | |
|
mfomitchev
2014/12/01 21:36:24
Might be better to simply have SetEdge(top, bottom
mohsen
2014/12/02 05:17:02
Yeah. Added SetEdge(). (at least SetEdgeTop() is s
| |
| 37 | |
| 38 const gfx::PointF& edge_bottom() const { return edge_bottom_; } | |
| 39 const gfx::Point& edge_bottom_rounded() const { return edge_bottom_rounded_; } | |
| 40 void SetEdgeBottom(const gfx::PointF& value); | |
| 41 | |
| 42 bool visible() const { return visible_; } | |
| 43 void set_visible(bool value) { visible_ = value; } | |
| 44 | |
| 45 int GetHeight() const; | |
|
mfomitchev
2014/12/01 21:36:24
GetHeightRounded() for consistency?
mohsen
2014/12/02 05:17:02
Since this is kind of temporary and would go away
| |
| 46 | |
| 47 private: | |
| 48 Type type_; | |
| 49 gfx::PointF edge_top_; | |
| 50 gfx::PointF edge_bottom_; | |
| 51 gfx::Point edge_top_rounded_; | |
| 52 gfx::Point edge_bottom_rounded_; | |
| 53 bool visible_; | |
| 54 }; | |
| 55 | |
| 56 UI_BASE_EXPORT bool operator==(const SelectionBound& lhs, | |
| 57 const SelectionBound& rhs); | |
| 58 UI_BASE_EXPORT bool operator!=(const SelectionBound& lhs, | |
| 59 const SelectionBound& rhs); | |
| 60 | |
| 61 UI_BASE_EXPORT gfx::Rect RectBetweenSelectionBounds(const SelectionBound& b1, | |
| 62 const SelectionBound& b2); | |
| 63 | |
| 64 } // namespace ui | |
| 65 | |
| 66 #endif // UI_BASE_TOUCH_SELECTION_BOUND_H_ | |
| OLD | NEW |