Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.browser; |
| 18 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 19 | import android.content.res.Configuration; |
| 20 | import android.graphics.Bitmap; |
| 21 | import android.os.Bundle; |
| 22 | import android.view.ActionMode; |
Michael Kolb | a418306 | 2011-01-16 10:43:21 -0800 | [diff] [blame] | 23 | import android.view.KeyEvent; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 24 | import android.view.Menu; |
| 25 | import android.view.View; |
| 26 | import android.webkit.WebChromeClient.CustomViewCallback; |
Michael Kolb | 1514bb7 | 2010-11-22 09:11:48 -0800 | [diff] [blame] | 27 | import android.webkit.WebView; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 28 | |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 29 | import java.util.List; |
| 30 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 31 | /** |
| 32 | * UI interface definitions |
| 33 | */ |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 34 | public interface UI { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 35 | |
| 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 Kolb | 2814a36 | 2011-05-19 15:49:41 -0700 | [diff] [blame] | 46 | public boolean onMenuKey(); |
| 47 | |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 48 | public boolean needsRestoreAllTabs(); |
| 49 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 50 | public void addTab(Tab tab); |
| 51 | |
| 52 | public void removeTab(Tab tab); |
| 53 | |
| 54 | public void setActiveTab(Tab tab); |
| 55 | |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 56 | public void updateTabs(List<Tab> tabs); |
| 57 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 58 | public void detachTab(Tab tab); |
| 59 | |
| 60 | public void attachTab(Tab tab); |
| 61 | |
Michael Kolb | a713ec8 | 2010-11-29 17:27:06 -0800 | [diff] [blame] | 62 | public void onSetWebView(Tab tab, WebView view); |
| 63 | |
Michael Kolb | 1514bb7 | 2010-11-22 09:11:48 -0800 | [diff] [blame] | 64 | public void createSubWindow(Tab tab, WebView subWebView); |
| 65 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 66 | public void attachSubWindow(View subContainer); |
| 67 | |
| 68 | public void removeSubWindow(View subContainer); |
| 69 | |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 70 | public void onTabDataChanged(Tab tab); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 71 | |
| 72 | public void onPageStopped(Tab tab); |
| 73 | |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 74 | public void onProgressChanged(Tab tab); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 75 | |
| 76 | public void showActiveTabsPage(); |
| 77 | |
| 78 | public void removeActiveTabsPage(); |
| 79 | |
| 80 | public void showComboView(boolean startWithHistory, Bundle extra); |
| 81 | |
| 82 | public void hideComboView(); |
| 83 | |
Derek Sollenberger | 2d4f1e2 | 2011-06-01 14:50:42 -0400 | [diff] [blame^] | 84 | public void showCustomView(View view, int requestedOrientation, |
| 85 | CustomViewCallback callback); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 86 | |
| 87 | public void onHideCustomView(); |
| 88 | |
| 89 | public boolean isCustomViewShowing(); |
| 90 | |
Michael Kolb | 11d1978 | 2011-03-20 10:17:40 -0700 | [diff] [blame] | 91 | public void showVoiceTitleBar(String title, List<String> results); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 92 | |
| 93 | public void revertVoiceTitleBar(Tab tab); |
| 94 | |
Michael Kolb | 1acef69 | 2011-03-08 14:12:06 -0800 | [diff] [blame] | 95 | public boolean onPrepareOptionsMenu(Menu menu); |
| 96 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 97 | public void onOptionsMenuOpened(); |
| 98 | |
| 99 | public void onExtendedMenuOpened(); |
| 100 | |
| 101 | public void onOptionsMenuClosed(boolean inLoad); |
| 102 | |
| 103 | public void onExtendedMenuClosed(boolean inLoad); |
| 104 | |
| 105 | public void onContextMenuCreated(Menu menu); |
| 106 | |
| 107 | public void onContextMenuClosed(Menu menu, boolean inLoad); |
| 108 | |
| 109 | public void onActionModeStarted(ActionMode mode); |
| 110 | |
| 111 | public void onActionModeFinished(boolean inLoad); |
| 112 | |
| 113 | public void setShouldShowErrorConsole(Tab tab, boolean show); |
| 114 | |
| 115 | // returns if the web page is clear of any overlays (not including sub windows) |
| 116 | public boolean showsWeb(); |
| 117 | |
| 118 | Bitmap getDefaultVideoPoster(); |
| 119 | |
| 120 | View getVideoLoadingProgressView(); |
| 121 | |
Leon Scroggins | 4cd9779 | 2010-12-03 15:31:56 -0500 | [diff] [blame] | 122 | void bookmarkedStatusHasChanged(Tab tab); |
Michael Kolb | 843510f | 2010-12-09 10:51:49 -0800 | [diff] [blame] | 123 | |
| 124 | void showMaxTabsWarning(); |
| 125 | |
Michael Kolb | dc2ee1b | 2011-02-14 14:34:40 -0800 | [diff] [blame] | 126 | void editUrl(boolean clearInput); |
| 127 | |
Michael Kolb | a418306 | 2011-01-16 10:43:21 -0800 | [diff] [blame] | 128 | boolean dispatchKey(int code, KeyEvent event); |
| 129 | |
Narayan Kamath | 5119edd | 2011-02-23 15:49:17 +0000 | [diff] [blame] | 130 | public static interface DropdownChangeListener { |
| 131 | void onNewDropdownDimensions(int height); |
| 132 | } |
| 133 | void registerDropdownChangeListener(DropdownChangeListener d); |
Patrick Scott | 9206677 | 2011-03-10 08:46:27 -0500 | [diff] [blame] | 134 | |
| 135 | void showAutoLogin(Tab tab); |
| 136 | |
| 137 | void hideAutoLogin(Tab tab); |
Michael Kolb | c38c604 | 2011-04-27 10:46:06 -0700 | [diff] [blame] | 138 | |
| 139 | void setFullscreen(boolean enabled); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 140 | } |