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 | |
| 19 | import com.android.browser.ScrollWebView.ScrollListener; |
| 20 | |
| 21 | import android.content.res.Configuration; |
| 22 | import android.graphics.Bitmap; |
| 23 | import android.os.Bundle; |
| 24 | import android.view.ActionMode; |
| 25 | import android.view.Menu; |
| 26 | import android.view.View; |
| 27 | import android.webkit.WebChromeClient.CustomViewCallback; |
Michael Kolb | 1514bb7 | 2010-11-22 09:11:48 -0800 | [diff] [blame] | 28 | import android.webkit.WebView; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 29 | |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 30 | import java.util.List; |
| 31 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 32 | /** |
| 33 | * UI interface definitions |
| 34 | */ |
| 35 | public interface UI extends ScrollListener { |
| 36 | |
| 37 | public void onPause(); |
| 38 | |
| 39 | public void onResume(); |
| 40 | |
| 41 | public void onDestroy(); |
| 42 | |
| 43 | public void onConfigurationChanged(Configuration config); |
| 44 | |
| 45 | public boolean onBackKey(); |
| 46 | |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 47 | public boolean needsRestoreAllTabs(); |
| 48 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 49 | public void addTab(Tab tab); |
| 50 | |
| 51 | public void removeTab(Tab tab); |
| 52 | |
| 53 | public void setActiveTab(Tab tab); |
| 54 | |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 55 | public void updateTabs(List<Tab> tabs); |
| 56 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 57 | public void detachTab(Tab tab); |
| 58 | |
| 59 | public void attachTab(Tab tab); |
| 60 | |
Michael Kolb | a713ec8 | 2010-11-29 17:27:06 -0800 | [diff] [blame] | 61 | public void onSetWebView(Tab tab, WebView view); |
| 62 | |
Michael Kolb | 1514bb7 | 2010-11-22 09:11:48 -0800 | [diff] [blame] | 63 | public void createSubWindow(Tab tab, WebView subWebView); |
| 64 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 65 | public void attachSubWindow(View subContainer); |
| 66 | |
| 67 | public void removeSubWindow(View subContainer); |
| 68 | |
| 69 | // TODO: consolidate |
| 70 | public void setUrlTitle(Tab tab, String url, String title); |
| 71 | |
| 72 | // TODO: consolidate |
| 73 | public void setFavicon(Tab tab, Bitmap icon); |
| 74 | |
| 75 | public void resetTitleAndRevertLockIcon(Tab tab); |
| 76 | |
| 77 | public void resetTitleAndIcon(Tab tab); |
| 78 | |
| 79 | public void onPageStarted(Tab tab, String url, Bitmap favicon); |
| 80 | |
| 81 | public void onPageFinished(Tab tab, String url); |
| 82 | |
| 83 | public void onPageStopped(Tab tab); |
| 84 | |
| 85 | public void onProgressChanged(Tab tab, int progress); |
| 86 | |
| 87 | public void showActiveTabsPage(); |
| 88 | |
| 89 | public void removeActiveTabsPage(); |
| 90 | |
| 91 | public void showComboView(boolean startWithHistory, Bundle extra); |
| 92 | |
| 93 | public void hideComboView(); |
| 94 | |
| 95 | public void showCustomView(View view, CustomViewCallback callback); |
| 96 | |
| 97 | public void onHideCustomView(); |
| 98 | |
| 99 | public boolean isCustomViewShowing(); |
| 100 | |
| 101 | public void showVoiceTitleBar(String title); |
| 102 | |
| 103 | public void revertVoiceTitleBar(Tab tab); |
| 104 | |
| 105 | // allow the ui to update state |
| 106 | public void onPrepareOptionsMenu(Menu menu); |
| 107 | |
| 108 | public void onOptionsMenuOpened(); |
| 109 | |
| 110 | public void onExtendedMenuOpened(); |
| 111 | |
| 112 | public void onOptionsMenuClosed(boolean inLoad); |
| 113 | |
| 114 | public void onExtendedMenuClosed(boolean inLoad); |
| 115 | |
| 116 | public void onContextMenuCreated(Menu menu); |
| 117 | |
| 118 | public void onContextMenuClosed(Menu menu, boolean inLoad); |
| 119 | |
| 120 | public void onActionModeStarted(ActionMode mode); |
| 121 | |
| 122 | public void onActionModeFinished(boolean inLoad); |
| 123 | |
| 124 | public void setShouldShowErrorConsole(Tab tab, boolean show); |
| 125 | |
| 126 | // returns if the web page is clear of any overlays (not including sub windows) |
| 127 | public boolean showsWeb(); |
| 128 | |
| 129 | Bitmap getDefaultVideoPoster(); |
| 130 | |
| 131 | View getVideoLoadingProgressView(); |
| 132 | |
Leon Scroggins | 4cd9779 | 2010-12-03 15:31:56 -0500 | [diff] [blame] | 133 | void bookmarkedStatusHasChanged(Tab tab); |
Michael Kolb | 843510f | 2010-12-09 10:51:49 -0800 | [diff] [blame] | 134 | |
| 135 | void showMaxTabsWarning(); |
| 136 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 137 | } |