1 // Copyright 2012 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 package org.chromium.content.browser.input; 6 7 import android.view.ViewTreeObserver; 8 9 /** 10 * A CursorController instance can be used to control a cursor in the text. 11 */ 12 interface CursorController extends ViewTreeObserver.OnTouchModeChangeListener { 13 14 /** 15 * Hide the cursor controller from screen. 16 */ hide()17 void hide(); 18 19 /** 20 * @return true if the CursorController is currently visible 21 */ isShowing()22 boolean isShowing(); 23 24 /** 25 * Called when the handle is about to start updating its position. 26 * @param handle 27 */ beforeStartUpdatingPosition(HandleView handle)28 void beforeStartUpdatingPosition(HandleView handle); 29 30 /** 31 * Update the controller's position. 32 */ updatePosition(HandleView handle, int x, int y)33 void updatePosition(HandleView handle, int x, int y); 34 35 /** 36 * Called when the view is detached from window. Perform house keeping task, such as 37 * stopping Runnable thread that would otherwise keep a reference on the context, thus 38 * preventing the activity to be recycled. 39 */ onDetached()40 void onDetached(); 41 } 42