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 android.view; 18 19 import android.graphics.Point; 20 import android.graphics.Rect; 21 import android.view.Surface; 22 23 import android.view.IScrollCaptureClient; 24 25 /** 26 * Interface to a controller passed to the {@link IScrollCaptureClient} which provides the client an 27 * asynchronous callback channel for responses. 28 * 29 * {@hide} 30 */ 31 interface IScrollCaptureController { 32 /** 33 * Scroll capture is available, and a client connect has been returned. 34 * 35 * @param client interface to a ScrollCaptureCallback in the window process 36 * @param scrollAreaInWindow the location of scrolling in global (window) coordinate space 37 */ onClientConnected(in IScrollCaptureClient client, in Rect scrollBounds, in Point positionInWindow)38 oneway void onClientConnected(in IScrollCaptureClient client, in Rect scrollBounds, 39 in Point positionInWindow); 40 41 /** 42 * Nothing in the window can be scrolled, scroll capture not offered. 43 */ onClientUnavailable()44 oneway void onClientUnavailable(); 45 46 /** 47 * Notifies the system that the client has confirmed the request and is ready to begin providing 48 * image requests. 49 */ onCaptureStarted()50 oneway void onCaptureStarted(); 51 52 /** 53 * Received a response from a capture request. 54 */ onCaptureBufferSent(long frameNumber, in Rect capturedArea)55 oneway void onCaptureBufferSent(long frameNumber, in Rect capturedArea); 56 57 /** 58 * Signals that the capture session has completed and the target window may be returned to 59 * normal interactive use. This may be due to normal shutdown, or after a timeout or other 60 * unrecoverable state change such as activity lifecycle, window visibility or focus. 61 */ onConnectionClosed()62 oneway void onConnectionClosed(); 63 } 64