1 /* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.view.accessibility; 18 19 import android.graphics.Rect; 20 21 /** 22 * interface to notify the changes of the window magnification and request to change 23 * the magnification mode. 24 * 25 * @hide 26 */ 27 oneway interface IWindowMagnificationConnectionCallback { 28 29 /** 30 * Called when the bounds of the mirrow window is changed. 31 * 32 * @param displayId The logical display id. 33 * @param bounds The window magnifier bounds in screen coordinates. 34 */ onWindowMagnifierBoundsChanged(int displayId, in Rect bounds)35 void onWindowMagnifierBoundsChanged(int displayId, in Rect bounds); 36 37 /** 38 * Changes the magnification mode on specified display. It is invoked by System UI when the 39 * switch button is toggled. 40 * 41 * @param displayId The logical display id. 42 * @param magnificationMode new magnification mode. 43 */ onChangeMagnificationMode(int displayId, int magnificationMode)44 void onChangeMagnificationMode(int displayId, int magnificationMode); 45 46 /** 47 * Called when the magnified bounds is changed. 48 * 49 * @param displayId The logical display id. 50 * @param sourceBounds The magnified bounds in screen coordinates. 51 */ onSourceBoundsChanged(int displayId, in Rect sourceBounds)52 void onSourceBoundsChanged(int displayId, in Rect sourceBounds); 53 54 /** 55 * Called when the accessibility action of scale requests to be performed. 56 * It is invoked from System UI. And the action is provided by the mirror window. 57 * 58 * @param displayId The logical display id. 59 * @param scale the target scale, or {@link Float#NaN} to leave unchanged 60 * @param updatePersistence whether the new scale should be persisted in Settings 61 */ onPerformScaleAction(int displayId, float scale, boolean updatePersistence)62 void onPerformScaleAction(int displayId, float scale, boolean updatePersistence); 63 64 /** 65 * Called when the accessibility action is performed. 66 * 67 * @param displayId The logical display id. 68 */ onAccessibilityActionPerformed(int displayId)69 void onAccessibilityActionPerformed(int displayId); 70 71 /** 72 * Called when the user is performing move action. 73 * 74 * @param displayId The logical display id. 75 */ onMove(int displayId)76 void onMove(int displayId); 77 78 } 79