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
18package android.support.v7.widget;
19
20import android.content.Context;
21import android.graphics.drawable.Drawable;
22import android.os.Parcelable;
23import android.support.v4.view.ViewPropertyAnimatorCompat;
24import android.support.v7.view.menu.MenuBuilder;
25import android.support.v7.view.menu.MenuPresenter;
26import android.util.SparseArray;
27import android.view.Menu;
28import android.view.View;
29import android.view.ViewGroup;
30import android.view.Window;
31import android.widget.AdapterView;
32import android.widget.SpinnerAdapter;
33
34/**
35 * Common interface for a toolbar that sits as part of the window decor.
36 * Layouts that control window decor use this as a point of interaction with different
37 * bar implementations.
38 *
39 * @hide
40 */
41public interface DecorToolbar {
42    ViewGroup getViewGroup();
43    Context getContext();
44    boolean hasExpandedActionView();
45    void collapseActionView();
46    void setWindowCallback(Window.Callback cb);
47    void setWindowTitle(CharSequence title);
48    CharSequence getTitle();
49    void setTitle(CharSequence title);
50    CharSequence getSubtitle();
51    void setSubtitle(CharSequence subtitle);
52    void initProgress();
53    void initIndeterminateProgress();
54    boolean hasIcon();
55    boolean hasLogo();
56    void setIcon(int resId);
57    void setIcon(Drawable d);
58    void setLogo(int resId);
59    void setLogo(Drawable d);
60    boolean canShowOverflowMenu();
61    boolean isOverflowMenuShowing();
62    boolean isOverflowMenuShowPending();
63    boolean showOverflowMenu();
64    boolean hideOverflowMenu();
65    void setMenuPrepared();
66    void setMenu(Menu menu, MenuPresenter.Callback cb);
67    void dismissPopupMenus();
68
69    int getDisplayOptions();
70    void setDisplayOptions(int opts);
71    void setEmbeddedTabView(ScrollingTabContainerView tabView);
72    boolean hasEmbeddedTabs();
73    boolean isTitleTruncated();
74    void setCollapsible(boolean collapsible);
75    void setHomeButtonEnabled(boolean enable);
76    int getNavigationMode();
77    void setNavigationMode(int mode);
78    void setDropdownParams(SpinnerAdapter adapter, AdapterView.OnItemSelectedListener listener);
79    void setDropdownSelectedPosition(int position);
80    int getDropdownSelectedPosition();
81    int getDropdownItemCount();
82    void setCustomView(View view);
83    View getCustomView();
84    void animateToVisibility(int visibility);
85    ViewPropertyAnimatorCompat setupAnimatorToVisibility(int visibility, long duration);
86    void setNavigationIcon(Drawable icon);
87    void setNavigationIcon(int resId);
88    void setNavigationContentDescription(CharSequence description);
89    void setNavigationContentDescription(int resId);
90    void setDefaultNavigationContentDescription(int defaultNavigationContentDescription);
91    void setDefaultNavigationIcon(Drawable icon);
92    void saveHierarchyState(SparseArray<Parcelable> toolbarStates);
93    void restoreHierarchyState(SparseArray<Parcelable> toolbarStates);
94    void setBackgroundDrawable(Drawable d);
95    int getHeight();
96    void setVisibility(int visible);
97    int getVisibility();
98    void setMenuCallbacks(MenuPresenter.Callback presenterCallback,
99            MenuBuilder.Callback menuBuilderCallback);
100    Menu getMenu();
101}