blob: c8ce53d444d55e45ed0dcd2119dfcf158a250f4a [file] [log] [blame]
Jorim Jaggi28620472019-01-02 23:21:49 +01001/*
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
17package com.android.server.wm;
18
Tarandeep Singh0bedd942019-09-26 13:34:03 -070019import android.inputmethodservice.InputMethodService;
20import android.view.WindowInsets.Type.InsetType;
21
Jorim Jaggi28620472019-01-02 23:21:49 +010022/**
23 * Generalization of an object that can control insets state.
24 */
25interface InsetsControlTarget {
26 void notifyInsetsControlChanged();
Tarandeep Singh0bedd942019-09-26 13:34:03 -070027
28 /**
29 * Instructs the control target to show inset sources.
30 *
31 * @param types to specify which types of insets source window should be shown.
32 * @param fromIme {@code true} if IME show request originated from {@link InputMethodService}.
33 */
34 default void showInsets(@InsetType int types, boolean fromIme) {
35 }
Taran Singhf1e08872019-10-10 14:38:52 +020036
37 /**
38 * Instructs the control target to hide inset sources.
39 *
40 * @param types to specify which types of insets source window should be hidden.
41 * @param fromIme {@code true} if IME hide request originated from {@link InputMethodService}.
42 */
43 default void hideInsets(@InsetType int types, boolean fromIme) {
44 }
Jorim Jaggi956ca412019-01-07 14:49:14 +010045
46 /**
47 * Returns {@code true} if the control target allows the system to show transient windows.
48 */
49 default boolean canShowTransient() {
50 return false;
51 }
Jorim Jaggi28620472019-01-02 23:21:49 +010052}