summaryrefslogtreecommitdiffstats
path: root/chromium/ui/base/touch/touch_editing_controller.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/base/touch/touch_editing_controller.h')
-rw-r--r--chromium/ui/base/touch/touch_editing_controller.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/chromium/ui/base/touch/touch_editing_controller.h b/chromium/ui/base/touch/touch_editing_controller.h
index 2c94f0a7534..9c0298efd10 100644
--- a/chromium/ui/base/touch/touch_editing_controller.h
+++ b/chromium/ui/base/touch/touch_editing_controller.h
@@ -13,8 +13,11 @@ namespace ui {
// An interface implemented by widget that has text that can be selected/edited
// using touch.
-class UI_EXPORT TouchEditable : public ui::SimpleMenuModel::Delegate {
+class UI_BASE_EXPORT TouchEditable : public ui::SimpleMenuModel::Delegate {
public:
+ // TODO(mohsen): Consider switching from local coordinates to screen
+ // coordinates in this interface and see if it will simplify things.
+
// Select everything between start and end (points are in view's local
// coordinate system). |start| is the logical start and |end| is the logical
// end of selection. Visually, |start| may lie after |end|.
@@ -24,7 +27,8 @@ class UI_EXPORT TouchEditable : public ui::SimpleMenuModel::Delegate {
virtual void MoveCaretTo(const gfx::Point& point) = 0;
// Gets the end points of the current selection. The end points p1 and p2 must
- // be the cursor rect for the start and end of selection:
+ // be the cursor rect for the start and end of selection (in local
+ // coordinates):
// ____________________________________
// | textfield with |selected text| |
// ------------------------------------
@@ -34,11 +38,11 @@ class UI_EXPORT TouchEditable : public ui::SimpleMenuModel::Delegate {
// visually, p1 could be to the right of p2 in the figure above.
virtual void GetSelectionEndPoints(gfx::Rect* p1, gfx::Rect* p2) = 0;
- // Gets the bounds of the client view in parent's coordinates.
+ // Gets the bounds of the client view in its local coordinates.
virtual gfx::Rect GetBounds() = 0;
// Gets the NativeView hosting the client.
- virtual gfx::NativeView GetNativeView() = 0;
+ virtual gfx::NativeView GetNativeView() const = 0;
// Converts a point to/from screen coordinates from/to client view.
virtual void ConvertPointToScreen(gfx::Point* point) = 0;
@@ -51,13 +55,17 @@ class UI_EXPORT TouchEditable : public ui::SimpleMenuModel::Delegate {
// Tells the editable to open context menu.
virtual void OpenContextMenu(const gfx::Point& anchor) = 0;
+ // Tells the editable to end touch editing and destroy touch selection
+ // controller it owns.
+ virtual void DestroyTouchSelection() = 0;
+
protected:
virtual ~TouchEditable() {}
};
// This defines the callback interface for other code to be notified of changes
// in the state of a TouchEditable.
-class UI_EXPORT TouchSelectionController {
+class UI_BASE_EXPORT TouchSelectionController {
public:
virtual ~TouchSelectionController() {}
@@ -70,9 +78,13 @@ class UI_EXPORT TouchSelectionController {
// Returns true if the user is currently dragging one of the handles.
virtual bool IsHandleDragInProgress() = 0;
+
+ // Hides visible handles. According to the value of |quick|, handles might
+ // fade out quickly or slowly.
+ virtual void HideHandles(bool quick) = 0;
};
-class UI_EXPORT TouchSelectionControllerFactory {
+class UI_BASE_EXPORT TouchSelectionControllerFactory {
public:
static void SetInstance(TouchSelectionControllerFactory* instance);