| 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 UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ | 5 #ifndef UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ |
| 6 #define UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ | 6 #define UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "ui/base/touch/selection_bound.h" | 8 #include "ui/base/touch/selection_bound.h" |
| 9 #include "ui/gfx/geometry/point_f.h" | 9 #include "ui/gfx/geometry/point_f.h" |
| 10 #include "ui/gfx/geometry/rect_f.h" | 10 #include "ui/gfx/geometry/rect_f.h" |
| 11 #include "ui/touch_selection/selection_event_type.h" | 11 #include "ui/touch_selection/selection_event_type.h" |
| 12 #include "ui/touch_selection/selection_granularity.h" |
| 12 #include "ui/touch_selection/touch_handle.h" | 13 #include "ui/touch_selection/touch_handle.h" |
| 13 #include "ui/touch_selection/ui_touch_selection_export.h" | 14 #include "ui/touch_selection/ui_touch_selection_export.h" |
| 14 | 15 |
| 15 namespace ui { | 16 namespace ui { |
| 16 class MotionEvent; | 17 class MotionEvent; |
| 17 | 18 |
| 18 // Interface through which |TouchSelectionController| issues selection-related | 19 // Interface through which |TouchSelectionController| issues selection-related |
| 19 // commands, notifications and requests. | 20 // commands, notifications and requests. |
| 20 class UI_TOUCH_SELECTION_EXPORT TouchSelectionControllerClient { | 21 class UI_TOUCH_SELECTION_EXPORT TouchSelectionControllerClient { |
| 21 public: | 22 public: |
| 22 virtual ~TouchSelectionControllerClient() {} | 23 virtual ~TouchSelectionControllerClient() {} |
| 23 | 24 |
| 24 virtual bool SupportsAnimation() const = 0; | 25 virtual bool SupportsAnimation() const = 0; |
| 25 virtual void SetNeedsAnimate() = 0; | 26 virtual void SetNeedsAnimate() = 0; |
| 26 virtual void MoveCaret(const gfx::PointF& position) = 0; | 27 virtual void MoveCaret(const gfx::PointF& position) = 0; |
| 27 virtual void MoveRangeSelectionExtent(const gfx::PointF& extent) = 0; | 28 virtual void MoveRangeSelectionExtent( |
| 29 const gfx::PointF& extent, |
| 30 ui::TextSelectionGranularity granularity) = 0; |
| 28 virtual void SelectBetweenCoordinates(const gfx::PointF& base, | 31 virtual void SelectBetweenCoordinates(const gfx::PointF& base, |
| 29 const gfx::PointF& extent) = 0; | 32 const gfx::PointF& extent) = 0; |
| 30 virtual void OnSelectionEvent(SelectionEventType event, | 33 virtual void OnSelectionEvent(SelectionEventType event, |
| 31 const gfx::PointF& position) = 0; | 34 const gfx::PointF& position) = 0; |
| 32 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() = 0; | 35 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() = 0; |
| 33 }; | 36 }; |
| 34 | 37 |
| 35 // Controller for manipulating text selection via touch input. | 38 // Controller for manipulating text selection via touch input. |
| 36 class UI_TOUCH_SELECTION_EXPORT TouchSelectionController | 39 class UI_TOUCH_SELECTION_EXPORT TouchSelectionController |
| 37 : public TouchHandleClient { | 40 : public TouchHandleClient { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 bool selection_editable_; | 156 bool selection_editable_; |
| 154 | 157 |
| 155 bool temporarily_hidden_; | 158 bool temporarily_hidden_; |
| 156 | 159 |
| 157 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); | 160 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); |
| 158 }; | 161 }; |
| 159 | 162 |
| 160 } // namespace ui | 163 } // namespace ui |
| 161 | 164 |
| 162 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ | 165 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ |
| OLD | NEW |