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.PointF; 20 import android.graphics.Rect; 21 import android.view.accessibility.IWindowMagnificationConnectionCallback; 22 23 /** 24 * Interface for interaction between {@link AccessibilityManagerService} 25 * and {@link WindowMagnification} in SystemUI. 26 * 27 * @hide 28 */ 29 oneway interface IWindowMagnificationConnection { 30 31 /** 32 * Enables window magnification on specifed display with specified center and scale. 33 * 34 * @param displayId The logical display id. 35 * @param scale magnification scale. 36 * @param centerX the screen-relative X coordinate around which to center, 37 * or {@link Float#NaN} to leave unchanged. 38 * @param centerY the screen-relative Y coordinate around which to center, 39 * or {@link Float#NaN} to leave unchanged. 40 */ enableWindowMagnification(int displayId, float scale, float centerX, float centerY)41 void enableWindowMagnification(int displayId, float scale, float centerX, float centerY); 42 43 /** 44 * Sets the scale of the window magnifier on specifed display. 45 * 46 * @param displayId The logical display id. 47 * @param scale magnification scale. 48 */ setScale(int displayId, float scale)49 void setScale(int displayId, float scale); 50 51 /** 52 * Disables window magnification on specifed display. 53 * 54 * @param displayId The logical display id. 55 */ disableWindowMagnification(int displayId)56 void disableWindowMagnification(int displayId); 57 58 /** 59 * Moves the window magnifier on the specifed display. 60 * 61 * @param offsetX the amount in pixels to offset the window magnifier in the X direction, in 62 * current screen pixels. 63 * @param offsetY the amount in pixels to offset the window magnifier in the Y direction, in 64 * current screen pixels. 65 */ moveWindowMagnifier(int displayId, float offsetX, float offsetY)66 void moveWindowMagnifier(int displayId, float offsetX, float offsetY); 67 68 /** 69 * Sets {@link IWindowMagnificationConnectionCallback} to receive the request or the callback. 70 * 71 * 72 * @param callback the interface to be called. 73 */ setConnectionCallback(in IWindowMagnificationConnectionCallback callback)74 void setConnectionCallback(in IWindowMagnificationConnectionCallback callback); 75 } 76