OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_BASE_TOUCH_TOUCH_EDITING_CONTROLLER_H_ | 5 #ifndef UI_BASE_TOUCH_TOUCH_EDITING_CONTROLLER_H_ |
6 #define UI_BASE_TOUCH_TOUCH_EDITING_CONTROLLER_H_ | 6 #define UI_BASE_TOUCH_TOUCH_EDITING_CONTROLLER_H_ |
7 | 7 |
8 #include "ui/base/models/simple_menu_model.h" | 8 #include "ui/base/models/simple_menu_model.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 virtual gfx::Rect GetBounds() = 0; | 47 virtual gfx::Rect GetBounds() = 0; |
48 | 48 |
49 // Gets the NativeView hosting the client. | 49 // Gets the NativeView hosting the client. |
50 virtual gfx::NativeView GetNativeView() const = 0; | 50 virtual gfx::NativeView GetNativeView() const = 0; |
51 | 51 |
52 // Converts a point to/from screen coordinates from/to client view. | 52 // Converts a point to/from screen coordinates from/to client view. |
53 virtual void ConvertPointToScreen(gfx::Point* point) = 0; | 53 virtual void ConvertPointToScreen(gfx::Point* point) = 0; |
54 virtual void ConvertPointFromScreen(gfx::Point* point) = 0; | 54 virtual void ConvertPointFromScreen(gfx::Point* point) = 0; |
55 | 55 |
56 // Returns true if the editable draws its own handles (hence, the | 56 // Returns true if the editable draws its own handles (hence, the |
57 // TouchSelectionController need not draw handles). | 57 // TouchEditingControllerDeprecated need not draw handles). |
58 virtual bool DrawsHandles() = 0; | 58 virtual bool DrawsHandles() = 0; |
59 | 59 |
60 // Tells the editable to open context menu. | 60 // Tells the editable to open context menu. |
61 virtual void OpenContextMenu(const gfx::Point& anchor) = 0; | 61 virtual void OpenContextMenu(const gfx::Point& anchor) = 0; |
62 | 62 |
63 // Tells the editable to end touch editing and destroy touch selection | 63 // Tells the editable to end touch editing and destroy touch selection |
64 // controller it owns. | 64 // controller it owns. |
65 virtual void DestroyTouchSelection() = 0; | 65 virtual void DestroyTouchSelection() = 0; |
66 | 66 |
67 protected: | 67 protected: |
68 ~TouchEditable() override {} | 68 ~TouchEditable() override {} |
69 }; | 69 }; |
70 | 70 |
71 // This defines the callback interface for other code to be notified of changes | 71 // This defines the callback interface for other code to be notified of changes |
72 // in the state of a TouchEditable. | 72 // in the state of a TouchEditable. |
73 class UI_BASE_EXPORT TouchSelectionController { | 73 class UI_BASE_EXPORT TouchEditingControllerDeprecated { |
74 public: | 74 public: |
75 virtual ~TouchSelectionController() {} | 75 virtual ~TouchEditingControllerDeprecated() {} |
76 | 76 |
77 // Creates a TouchSelectionController. Caller owns the returned object. | 77 // Creates a TouchEditingControllerDeprecated. Caller owns the returned |
78 static TouchSelectionController* create( | 78 // object. |
| 79 static TouchEditingControllerDeprecated* Create( |
79 TouchEditable* client_view); | 80 TouchEditable* client_view); |
80 | 81 |
81 // Notifies the controller that the selection has changed. | 82 // Notifies the controller that the selection has changed. |
82 virtual void SelectionChanged() = 0; | 83 virtual void SelectionChanged() = 0; |
83 | 84 |
84 // Returns true if the user is currently dragging one of the handles. | 85 // Returns true if the user is currently dragging one of the handles. |
85 virtual bool IsHandleDragInProgress() = 0; | 86 virtual bool IsHandleDragInProgress() = 0; |
86 | 87 |
87 // Hides visible handles. According to the value of |quick|, handles might | 88 // Hides visible handles. According to the value of |quick|, handles might |
88 // fade out quickly or slowly. | 89 // fade out quickly or slowly. |
89 virtual void HideHandles(bool quick) = 0; | 90 virtual void HideHandles(bool quick) = 0; |
90 }; | 91 }; |
91 | 92 |
92 class UI_BASE_EXPORT TouchSelectionControllerFactory { | 93 class UI_BASE_EXPORT TouchEditingControllerFactory { |
93 public: | 94 public: |
94 static void SetInstance(TouchSelectionControllerFactory* instance); | 95 static void SetInstance(TouchEditingControllerFactory* instance); |
95 | 96 |
96 virtual TouchSelectionController* create(TouchEditable* client_view) = 0; | 97 virtual TouchEditingControllerDeprecated* Create(TouchEditable* client_view) |
| 98 = 0; |
97 | 99 |
98 protected: | 100 protected: |
99 virtual ~TouchSelectionControllerFactory() {} | 101 virtual ~TouchEditingControllerFactory() {} |
100 }; | 102 }; |
101 | 103 |
102 } // namespace ui | 104 } // namespace ui |
103 | 105 |
104 #endif // UI_BASE_TOUCH_TOUCH_EDITING_CONTROLLER_H_ | 106 #endif // UI_BASE_TOUCH_TOUCH_EDITING_CONTROLLER_H_ |
OLD | NEW |