blob: 4b58872f9bbe9138caa75f84399ca1973b5dc333 [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
John Reck2bc80422011-06-30 15:11:49 -070036 public static enum ComboViews {
37 History,
38 Bookmarks,
39 Snapshots,
40 }
41
Michael Kolb8233fac2010-10-26 16:08:53 -070042 public void onPause();
43
44 public void onResume();
45
46 public void onDestroy();
47
48 public void onConfigurationChanged(Configuration config);
49
50 public boolean onBackKey();
51
Michael Kolb2814a362011-05-19 15:49:41 -070052 public boolean onMenuKey();
53
Michael Kolb1bf23132010-11-19 12:55:12 -080054 public boolean needsRestoreAllTabs();
55
Michael Kolb8233fac2010-10-26 16:08:53 -070056 public void addTab(Tab tab);
57
58 public void removeTab(Tab tab);
59
60 public void setActiveTab(Tab tab);
61
Michael Kolb1bf23132010-11-19 12:55:12 -080062 public void updateTabs(List<Tab> tabs);
63
Michael Kolb8233fac2010-10-26 16:08:53 -070064 public void detachTab(Tab tab);
65
66 public void attachTab(Tab tab);
67
Michael Kolba713ec82010-11-29 17:27:06 -080068 public void onSetWebView(Tab tab, WebView view);
69
Michael Kolb1514bb72010-11-22 09:11:48 -080070 public void createSubWindow(Tab tab, WebView subWebView);
71
Michael Kolb8233fac2010-10-26 16:08:53 -070072 public void attachSubWindow(View subContainer);
73
74 public void removeSubWindow(View subContainer);
75
John Reck30c714c2010-12-16 17:30:34 -080076 public void onTabDataChanged(Tab tab);
Michael Kolb8233fac2010-10-26 16:08:53 -070077
78 public void onPageStopped(Tab tab);
79
John Reck30c714c2010-12-16 17:30:34 -080080 public void onProgressChanged(Tab tab);
Michael Kolb8233fac2010-10-26 16:08:53 -070081
82 public void showActiveTabsPage();
83
84 public void removeActiveTabsPage();
85
John Reck2bc80422011-06-30 15:11:49 -070086 public void showComboView(ComboViews startingView, Bundle extra);
Michael Kolb8233fac2010-10-26 16:08:53 -070087
Derek Sollenberger2d4f1e22011-06-01 14:50:42 -040088 public void showCustomView(View view, int requestedOrientation,
89 CustomViewCallback callback);
Michael Kolb8233fac2010-10-26 16:08:53 -070090
91 public void onHideCustomView();
92
93 public boolean isCustomViewShowing();
94
Michael Kolb11d19782011-03-20 10:17:40 -070095 public void showVoiceTitleBar(String title, List<String> results);
Michael Kolb8233fac2010-10-26 16:08:53 -070096
97 public void revertVoiceTitleBar(Tab tab);
98
Michael Kolb1acef692011-03-08 14:12:06 -080099 public boolean onPrepareOptionsMenu(Menu menu);
100
Michael Kolb8233fac2010-10-26 16:08:53 -0700101 public void onOptionsMenuOpened();
102
103 public void onExtendedMenuOpened();
104
105 public void onOptionsMenuClosed(boolean inLoad);
106
107 public void onExtendedMenuClosed(boolean inLoad);
108
109 public void onContextMenuCreated(Menu menu);
110
111 public void onContextMenuClosed(Menu menu, boolean inLoad);
112
113 public void onActionModeStarted(ActionMode mode);
114
115 public void onActionModeFinished(boolean inLoad);
116
117 public void setShouldShowErrorConsole(Tab tab, boolean show);
118
119 // returns if the web page is clear of any overlays (not including sub windows)
120 public boolean showsWeb();
121
122 Bitmap getDefaultVideoPoster();
123
124 View getVideoLoadingProgressView();
125
Leon Scroggins4cd97792010-12-03 15:31:56 -0500126 void bookmarkedStatusHasChanged(Tab tab);
Michael Kolb843510f2010-12-09 10:51:49 -0800127
128 void showMaxTabsWarning();
129
Michael Kolbdc2ee1b2011-02-14 14:34:40 -0800130 void editUrl(boolean clearInput);
131
Michael Kolba4183062011-01-16 10:43:21 -0800132 boolean dispatchKey(int code, KeyEvent event);
133
Narayan Kamath5119edd2011-02-23 15:49:17 +0000134 public static interface DropdownChangeListener {
135 void onNewDropdownDimensions(int height);
136 }
137 void registerDropdownChangeListener(DropdownChangeListener d);
Patrick Scott92066772011-03-10 08:46:27 -0500138
139 void showAutoLogin(Tab tab);
140
141 void hideAutoLogin(Tab tab);
Michael Kolbc38c6042011-04-27 10:46:06 -0700142
143 void setFullscreen(boolean enabled);
Michael Kolb0241e752011-07-07 14:58:50 -0700144
145 void setUseQuickControls(boolean enabled);
146
Michael Kolb8233fac2010-10-26 16:08:53 -0700147}