blob: 154cde1408104c30300b6947c091ff989ec2e668 [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;
Tiger Huang332793b2019-10-29 23:21:27 +080020import android.view.WindowInsets.Type.InsetsType;
Tarandeep Singh0bedd942019-09-26 13:34:03 -070021
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 */
Tiger Huang332793b2019-10-29 23:21:27 +080034 default void showInsets(@InsetsType int types, boolean fromIme) {
Tarandeep Singh0bedd942019-09-26 13:34:03 -070035 }
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 */
Tiger Huang332793b2019-10-29 23:21:27 +080043 default void hideInsets(@InsetsType int types, boolean fromIme) {
Taran Singhf1e08872019-10-10 14:38:52 +020044 }
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}