1 /* 2 * Copyright (C) 2020 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 com.android.systemui.accessibility; 18 19 import android.graphics.Rect; 20 21 /** 22 * A callback to inform {@link com.android.server.accessibility.AccessibilityManagerService} about 23 * the UI state change or the user interaction. 24 */ 25 interface WindowMagnifierCallback { 26 /** 27 * Called when the bounds of window magnifier is changed. 28 * @param displayId The logical display id. 29 * @param bounds The bounds of window magnifier on the screen. 30 */ onWindowMagnifierBoundsChanged(int displayId, Rect bounds)31 void onWindowMagnifierBoundsChanged(int displayId, Rect bounds); 32 33 /** 34 * Called when the magnified bounds is changed. 35 * 36 * @param displayId The logical display id. 37 * @param sourceBounds The magnified bounds in screen coordinates. 38 */ onSourceBoundsChanged(int displayId, Rect sourceBounds)39 void onSourceBoundsChanged(int displayId, Rect sourceBounds); 40 41 /** 42 * Called when the accessibility action of scale requests to be performed. 43 * It is invoked from System UI. And the action is provided by the mirror window. 44 * 45 * @param displayId The logical display id. 46 * @param scale the target scale, or {@link Float#NaN} to leave unchanged 47 */ onPerformScaleAction(int displayId, float scale)48 void onPerformScaleAction(int displayId, float scale); 49 50 /** 51 * Called when the accessibility action is performed. 52 * 53 * @param displayId The logical display id. 54 */ onAccessibilityActionPerformed(int displayId)55 void onAccessibilityActionPerformed(int displayId); 56 } 57