blob: 8de2b19abc061ea2536e3d7181c24cb834eba36b [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;
Michael Kolba4183062011-01-16 10:43:21 -080023import android.view.KeyEvent;
Michael Kolb8233fac2010-10-26 16:08:53 -070024import android.view.Menu;
25import android.view.View;
26import android.webkit.WebChromeClient.CustomViewCallback;
Michael Kolb1514bb72010-11-22 09:11:48 -080027import android.webkit.WebView;
Michael Kolb8233fac2010-10-26 16:08:53 -070028
Michael Kolb1bf23132010-11-19 12:55:12 -080029import java.util.List;
30
Michael Kolb8233fac2010-10-26 16:08:53 -070031/**
32 * UI interface definitions
33 */
Michael Kolb66706532010-12-12 19:50:22 -080034public interface UI {
Michael Kolb8233fac2010-10-26 16:08:53 -070035
36 public void onPause();
37
38 public void onResume();
39
40 public void onDestroy();
41
42 public void onConfigurationChanged(Configuration config);
43
44 public boolean onBackKey();
45
Michael Kolb1bf23132010-11-19 12:55:12 -080046 public boolean needsRestoreAllTabs();
47
Michael Kolb8233fac2010-10-26 16:08:53 -070048 public void addTab(Tab tab);
49
50 public void removeTab(Tab tab);
51
52 public void setActiveTab(Tab tab);
53
Michael Kolb1bf23132010-11-19 12:55:12 -080054 public void updateTabs(List<Tab> tabs);
55
Michael Kolb8233fac2010-10-26 16:08:53 -070056 public void detachTab(Tab tab);
57
58 public void attachTab(Tab tab);
59
Michael Kolba713ec82010-11-29 17:27:06 -080060 public void onSetWebView(Tab tab, WebView view);
61
Michael Kolb1514bb72010-11-22 09:11:48 -080062 public void createSubWindow(Tab tab, WebView subWebView);
63
Michael Kolb8233fac2010-10-26 16:08:53 -070064 public void attachSubWindow(View subContainer);
65
66 public void removeSubWindow(View subContainer);
67
John Reck30c714c2010-12-16 17:30:34 -080068 public void onTabDataChanged(Tab tab);
Michael Kolb8233fac2010-10-26 16:08:53 -070069
70 public void onPageStopped(Tab tab);
71
John Reck30c714c2010-12-16 17:30:34 -080072 public void onProgressChanged(Tab tab);
Michael Kolb8233fac2010-10-26 16:08:53 -070073
74 public void showActiveTabsPage();
75
76 public void removeActiveTabsPage();
77
78 public void showComboView(boolean startWithHistory, Bundle extra);
79
80 public void hideComboView();
81
82 public void showCustomView(View view, CustomViewCallback callback);
83
84 public void onHideCustomView();
85
86 public boolean isCustomViewShowing();
87
88 public void showVoiceTitleBar(String title);
89
90 public void revertVoiceTitleBar(Tab tab);
91
Michael Kolb8233fac2010-10-26 16:08:53 -070092 public void onOptionsMenuOpened();
93
94 public void onExtendedMenuOpened();
95
96 public void onOptionsMenuClosed(boolean inLoad);
97
98 public void onExtendedMenuClosed(boolean inLoad);
99
100 public void onContextMenuCreated(Menu menu);
101
102 public void onContextMenuClosed(Menu menu, boolean inLoad);
103
104 public void onActionModeStarted(ActionMode mode);
105
106 public void onActionModeFinished(boolean inLoad);
107
108 public void setShouldShowErrorConsole(Tab tab, boolean show);
109
110 // returns if the web page is clear of any overlays (not including sub windows)
111 public boolean showsWeb();
112
113 Bitmap getDefaultVideoPoster();
114
115 View getVideoLoadingProgressView();
116
Leon Scroggins4cd97792010-12-03 15:31:56 -0500117 void bookmarkedStatusHasChanged(Tab tab);
Michael Kolb843510f2010-12-09 10:51:49 -0800118
119 void showMaxTabsWarning();
120
Michael Kolba4183062011-01-16 10:43:21 -0800121 boolean dispatchKey(int code, KeyEvent event);
122
Michael Kolb8233fac2010-10-26 16:08:53 -0700123}