blob: e2f76f1b62aaf85bf65525942baa4e2d19cc2827 [file] [log] [blame]
Michael Kolb8233fac2010-10-26 16:08:53 -07001/*
2 * Copyright (C) 2010 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.browser;
18
Michael Kolb8233fac2010-10-26 16:08:53 -070019import android.content.res.Configuration;
20import android.graphics.Bitmap;
21import android.os.Bundle;
22import android.view.ActionMode;
23import android.view.Menu;
24import android.view.View;
25import android.webkit.WebChromeClient.CustomViewCallback;
Michael Kolb1514bb72010-11-22 09:11:48 -080026import android.webkit.WebView;
Michael Kolb8233fac2010-10-26 16:08:53 -070027
Michael Kolb1bf23132010-11-19 12:55:12 -080028import java.util.List;
29
Michael Kolb8233fac2010-10-26 16:08:53 -070030/**
31 * UI interface definitions
32 */
Michael Kolb66706532010-12-12 19:50:22 -080033public interface UI {
Michael Kolb8233fac2010-10-26 16:08:53 -070034
35 public void onPause();
36
37 public void onResume();
38
39 public void onDestroy();
40
41 public void onConfigurationChanged(Configuration config);
42
43 public boolean onBackKey();
44
Michael Kolb1bf23132010-11-19 12:55:12 -080045 public boolean needsRestoreAllTabs();
46
Michael Kolb8233fac2010-10-26 16:08:53 -070047 public void addTab(Tab tab);
48
49 public void removeTab(Tab tab);
50
51 public void setActiveTab(Tab tab);
52
Michael Kolb1bf23132010-11-19 12:55:12 -080053 public void updateTabs(List<Tab> tabs);
54
Michael Kolb8233fac2010-10-26 16:08:53 -070055 public void detachTab(Tab tab);
56
57 public void attachTab(Tab tab);
58
Michael Kolba713ec82010-11-29 17:27:06 -080059 public void onSetWebView(Tab tab, WebView view);
60
Michael Kolb1514bb72010-11-22 09:11:48 -080061 public void createSubWindow(Tab tab, WebView subWebView);
62
Michael Kolb8233fac2010-10-26 16:08:53 -070063 public void attachSubWindow(View subContainer);
64
65 public void removeSubWindow(View subContainer);
66
John Reck30c714c2010-12-16 17:30:34 -080067 public void onTabDataChanged(Tab tab);
Michael Kolb8233fac2010-10-26 16:08:53 -070068
69 public void onPageStopped(Tab tab);
70
John Reck30c714c2010-12-16 17:30:34 -080071 public void onProgressChanged(Tab tab);
Michael Kolb8233fac2010-10-26 16:08:53 -070072
73 public void showActiveTabsPage();
74
75 public void removeActiveTabsPage();
76
77 public void showComboView(boolean startWithHistory, Bundle extra);
78
79 public void hideComboView();
80
81 public void showCustomView(View view, CustomViewCallback callback);
82
83 public void onHideCustomView();
84
85 public boolean isCustomViewShowing();
86
87 public void showVoiceTitleBar(String title);
88
89 public void revertVoiceTitleBar(Tab tab);
90
91 // allow the ui to update state
92 public void onPrepareOptionsMenu(Menu menu);
93
94 public void onOptionsMenuOpened();
95
96 public void onExtendedMenuOpened();
97
98 public void onOptionsMenuClosed(boolean inLoad);
99
100 public void onExtendedMenuClosed(boolean inLoad);
101
102 public void onContextMenuCreated(Menu menu);
103
104 public void onContextMenuClosed(Menu menu, boolean inLoad);
105
106 public void onActionModeStarted(ActionMode mode);
107
108 public void onActionModeFinished(boolean inLoad);
109
110 public void setShouldShowErrorConsole(Tab tab, boolean show);
111
112 // returns if the web page is clear of any overlays (not including sub windows)
113 public boolean showsWeb();
114
115 Bitmap getDefaultVideoPoster();
116
117 View getVideoLoadingProgressView();
118
Leon Scroggins4cd97792010-12-03 15:31:56 -0500119 void bookmarkedStatusHasChanged(Tab tab);
Michael Kolb843510f2010-12-09 10:51:49 -0800120
121 void showMaxTabsWarning();
122
Michael Kolb8233fac2010-10-26 16:08:53 -0700123}