Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 package org.chromium.chromoting; | 5 package org.chromium.chromoting; |
| 6 | 6 |
| 7 import android.content.Context; | |
| 7 import android.graphics.Point; | 8 import android.graphics.Point; |
| 9 import android.view.SurfaceView; | |
| 8 | 10 |
| 9 import org.chromium.chromoting.jni.Client; | 11 import org.chromium.chromoting.jni.Client; |
| 10 | 12 |
| 11 /** | 13 /** |
| 12 * Callback interface to allow the TouchInputHandler to request actions on the D esktopView. | 14 * Callback interface to allow the TouchInputHandler to request actions on the D esktopView. |
| 13 */ | 15 */ |
| 14 public interface DesktopViewInterface { | 16 public abstract class AbstractDesktopView extends SurfaceView { |
| 17 public AbstractDesktopView(Context context) { | |
| 18 super(context); | |
| 19 } | |
| 20 | |
| 15 /** | 21 /** |
| 16 * Initializes the instance. Implementations can assume this function will b e called exactly | 22 * Initializes the instance. Implementations can assume this function will b e called exactly |
| 17 * once after constructor but before other functions. | 23 * once after constructor but before other functions. |
| 18 */ | 24 */ |
| 19 void init(Desktop desktop, Client client); | 25 public abstract void init(Desktop desktop, Client client); |
| 20 | 26 |
| 21 /** Triggers a brief animation to indicate the existence and location of an input event. */ | 27 /** Triggers a brief animation to indicate the existence and location of an input event. */ |
| 22 void showInputFeedback(DesktopView.InputFeedbackType feedbackToShow, Point p os); | 28 public abstract void showInputFeedback(DesktopView.InputFeedbackType feedbac kToShow, Point pos); |
| 23 | 29 |
| 24 /** Shows the action bar. */ | 30 /** Shows the action bar. */ |
| 25 void showActionBar(); | 31 public abstract void showActionBar(); |
|
Lambros
2016/07/08 22:02:36
Do showActionBar() and showKeyboard() need to be p
Yuwei
2016/07/08 23:07:54
Agreed. These functions are only being used by Tou
| |
| 26 | 32 |
| 27 /** Shows the software keyboard. */ | 33 /** Shows the software keyboard. */ |
| 28 void showKeyboard(); | 34 public abstract void showKeyboard(); |
| 29 | 35 |
| 30 /** | 36 /** |
| 31 * Informs the view that its transformation matrix (for rendering the remote desktop bitmap) | 37 * Informs the view that its transformation matrix (for rendering the remote desktop bitmap) |
| 32 * has been changed by the TouchInputHandler, which requires repainting. | 38 * has been changed by the TouchInputHandler, which requires repainting. |
| 33 */ | 39 */ |
| 34 void transformationChanged(); | 40 public abstract void transformationChanged(); |
| 35 | 41 |
| 36 /** | 42 /** |
| 37 * Informs the view that the cursor has been moved by the TouchInputHandler, which requires | 43 * Informs the view that the cursor has been moved by the TouchInputHandler, which requires |
| 38 * repainting. | 44 * repainting. |
| 39 */ | 45 */ |
| 40 void cursorMoved(); | 46 public abstract void cursorMoved(); |
| 41 | 47 |
| 42 /** | 48 /** |
| 43 * Informs the view that the cursor visibility has been changed (for differe nt input mode) by | 49 * Informs the view that the cursor visibility has been changed (for differe nt input mode) by |
| 44 * the TouchInputHandler, which requires repainting. | 50 * the TouchInputHandler, which requires repainting. |
| 45 */ | 51 */ |
| 46 void cursorVisibilityChanged(); | 52 public abstract void cursorVisibilityChanged(); |
| 47 | 53 |
| 48 /** | 54 /** |
| 49 * Starts or stops an animation. Whilst the animation is running, the Deskto pView will | 55 * Starts or stops an animation. Whilst the animation is running, the Deskto pView will |
| 50 * periodically call TouchInputHandler.processAnimation() and repaint itself . | 56 * periodically call TouchInputHandler.processAnimation() and repaint itself . |
| 51 */ | 57 */ |
| 52 void setAnimationEnabled(boolean enabled); | 58 public abstract void setAnimationEnabled(boolean enabled); |
| 53 | 59 |
| 54 /** | 60 /** |
| 55 * An {@link Event} which is triggered when the view is being painted. Addin g handlers to this | 61 * An {@link Event} which is triggered when the view is being painted. Addin g handlers to this |
| 56 * event causes painting to be triggered continuously until they are all rem oved. | 62 * event causes painting to be triggered continuously until they are all rem oved. |
| 57 */ | 63 */ |
| 58 Event<PaintEventParameter> onPaint(); | 64 public abstract Event<PaintEventParameter> onPaint(); |
| 59 | 65 |
| 60 /** An {@link Event} which is triggered when the client size is changed. */ | 66 /** An {@link Event} which is triggered when the client size is changed. */ |
| 61 Event<SizeChangedEventParameter> onClientSizeChanged(); | 67 public abstract Event<SizeChangedEventParameter> onClientSizeChanged(); |
| 62 | 68 |
| 63 /** An {@link Event} which is triggered when the host size is changed. */ | 69 /** An {@link Event} which is triggered when the host size is changed. */ |
| 64 Event<SizeChangedEventParameter> onHostSizeChanged(); | 70 public abstract Event<SizeChangedEventParameter> onHostSizeChanged(); |
| 65 | 71 |
| 66 /** An {@link Event} which is triggered when user touchs the screen. */ | 72 /** An {@link Event} which is triggered when user touchs the screen. */ |
|
Lambros
2016/07/08 22:02:36
s/touchs/touches/
Yuwei
2016/07/08 23:46:01
Done.
| |
| 67 Event<TouchEventParameter> onTouch(); | 73 public abstract Event<TouchEventParameter> onTouch(); |
| 68 } | 74 } |
| OLD | NEW |