1 /* 2 * Copyright (C) 2014 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 18 package com.android.internal.widget; 19 20 import android.graphics.drawable.Drawable; 21 import android.os.Parcelable; 22 import android.util.SparseArray; 23 import android.view.Menu; 24 import android.view.Window; 25 26 import com.android.internal.view.menu.MenuPresenter; 27 28 /** 29 * Implemented by the top-level decor layout for a window. DecorContentParent offers 30 * entry points for a number of title/window decor features. 31 */ 32 public interface DecorContentParent { setWindowCallback(Window.Callback cb)33 void setWindowCallback(Window.Callback cb); setWindowTitle(CharSequence title)34 void setWindowTitle(CharSequence title); getTitle()35 CharSequence getTitle(); initFeature(int windowFeature)36 void initFeature(int windowFeature); setUiOptions(int uiOptions)37 void setUiOptions(int uiOptions); hasIcon()38 boolean hasIcon(); hasLogo()39 boolean hasLogo(); setIcon(int resId)40 void setIcon(int resId); setIcon(Drawable d)41 void setIcon(Drawable d); setLogo(int resId)42 void setLogo(int resId); canShowOverflowMenu()43 boolean canShowOverflowMenu(); isOverflowMenuShowing()44 boolean isOverflowMenuShowing(); isOverflowMenuShowPending()45 boolean isOverflowMenuShowPending(); showOverflowMenu()46 boolean showOverflowMenu(); hideOverflowMenu()47 boolean hideOverflowMenu(); setMenuPrepared()48 void setMenuPrepared(); setMenu(Menu menu, MenuPresenter.Callback cb)49 void setMenu(Menu menu, MenuPresenter.Callback cb); saveToolbarHierarchyState(SparseArray<Parcelable> toolbarStates)50 void saveToolbarHierarchyState(SparseArray<Parcelable> toolbarStates); restoreToolbarHierarchyState(SparseArray<Parcelable> toolbarStates)51 void restoreToolbarHierarchyState(SparseArray<Parcelable> toolbarStates); dismissPopups()52 void dismissPopups(); notifyContentChanged()53 void notifyContentChanged(); 54 } 55