1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Veorsion 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 IMagnificationConnectionCallback {
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      */
35     @RequiresNoPermission
onWindowMagnifierBoundsChanged(int displayId, in Rect bounds)36     void onWindowMagnifierBoundsChanged(int displayId, in Rect bounds);
37 
38     /**
39      * Changes the magnification mode on specified display. It is invoked by System UI when the
40      *  switch button is toggled.
41      *
42      * @param displayId The logical display id.
43      * @param magnificationMode new magnification mode.
44      */
45     @RequiresNoPermission
onChangeMagnificationMode(int displayId, int magnificationMode)46     void onChangeMagnificationMode(int displayId, int magnificationMode);
47 
48     /**
49      * Called when the magnified bounds is changed.
50      *
51      * @param displayId The logical display id.
52      * @param sourceBounds The magnified bounds in screen coordinates.
53      */
54     @RequiresNoPermission
onSourceBoundsChanged(int displayId, in Rect sourceBounds)55     void onSourceBoundsChanged(int displayId, in Rect sourceBounds);
56 
57     /**
58      * Called when the accessibility action of scale requests to be performed.
59      * It is invoked from System UI. And the action is provided by the mirror window.
60      *
61      * @param displayId The logical display id.
62      * @param scale the target scale, or {@link Float#NaN} to leave unchanged
63      * @param updatePersistence whether the new scale should be persisted in Settings
64      */
65     @RequiresNoPermission
onPerformScaleAction(int displayId, float scale, boolean updatePersistence)66     void onPerformScaleAction(int displayId, float scale, boolean updatePersistence);
67 
68     /**
69      * Called when the accessibility action is performed.
70      *
71      * @param displayId The logical display id.
72      */
73     @RequiresNoPermission
onAccessibilityActionPerformed(int displayId)74     void onAccessibilityActionPerformed(int displayId);
75 
76     /**
77      * Called when the user is performing move action.
78      *
79      * @param displayId The logical display id.
80      */
81     @RequiresNoPermission
onMove(int displayId)82     void onMove(int displayId);
83 
84 }
85