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 | |
Bijan Amirzada | 41242f2 | 2014-03-21 12:12:18 -0700 | [diff] [blame] | 17 | package com.android.browser; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 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; |
Michael Kolb | 3ca1275 | 2011-07-20 13:52:25 -0700 | [diff] [blame] | 25 | import android.view.MenuItem; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 26 | import android.view.View; |
| 27 | import android.webkit.WebChromeClient.CustomViewCallback; |
Bijan Amirzada | 9b1e988 | 2014-02-26 17:15:46 -0800 | [diff] [blame] | 28 | import org.codeaurora.swe.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 | */ |
Michael Kolb | 6670653 | 2010-12-12 19:50:22 -0800 | [diff] [blame] | 35 | public interface UI { |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 36 | |
John Reck | 2bc8042 | 2011-06-30 15:11:49 -0700 | [diff] [blame] | 37 | public static enum ComboViews { |
| 38 | History, |
| 39 | Bookmarks, |
| 40 | Snapshots, |
| 41 | } |
| 42 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 43 | public void onPause(); |
| 44 | |
| 45 | public void onResume(); |
| 46 | |
| 47 | public void onDestroy(); |
| 48 | |
| 49 | public void onConfigurationChanged(Configuration config); |
| 50 | |
| 51 | public boolean onBackKey(); |
| 52 | |
Michael Kolb | 2814a36 | 2011-05-19 15:49:41 -0700 | [diff] [blame] | 53 | public boolean onMenuKey(); |
| 54 | |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 55 | public boolean needsRestoreAllTabs(); |
| 56 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 57 | public void addTab(Tab tab); |
| 58 | |
| 59 | public void removeTab(Tab tab); |
| 60 | |
| 61 | public void setActiveTab(Tab tab); |
| 62 | |
Sagar Dhawan | f7b5d0b | 2015-02-06 15:47:20 -0800 | [diff] [blame] | 63 | public void cancelNavScreenRequest(); |
| 64 | |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 65 | public void updateTabs(List<Tab> tabs); |
| 66 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 67 | public void detachTab(Tab tab); |
| 68 | |
| 69 | public void attachTab(Tab tab); |
| 70 | |
Michael Kolb | a713ec8 | 2010-11-29 17:27:06 -0800 | [diff] [blame] | 71 | public void onSetWebView(Tab tab, WebView view); |
| 72 | |
Michael Kolb | 1514bb7 | 2010-11-22 09:11:48 -0800 | [diff] [blame] | 73 | public void createSubWindow(Tab tab, WebView subWebView); |
| 74 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 75 | public void attachSubWindow(View subContainer); |
| 76 | |
| 77 | public void removeSubWindow(View subContainer); |
| 78 | |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 79 | public void onTabDataChanged(Tab tab); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 80 | |
| 81 | public void onPageStopped(Tab tab); |
| 82 | |
John Reck | 30c714c | 2010-12-16 17:30:34 -0800 | [diff] [blame] | 83 | public void onProgressChanged(Tab tab); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 84 | |
| 85 | public void showActiveTabsPage(); |
| 86 | |
| 87 | public void removeActiveTabsPage(); |
| 88 | |
John Reck | 2bc8042 | 2011-06-30 15:11:49 -0700 | [diff] [blame] | 89 | public void showComboView(ComboViews startingView, Bundle extra); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 90 | |
Tarun Nainani | 87a8668 | 2015-02-05 11:47:35 -0800 | [diff] [blame^] | 91 | public void hideComboView(); |
| 92 | |
Derek Sollenberger | 2d4f1e2 | 2011-06-01 14:50:42 -0400 | [diff] [blame] | 93 | public void showCustomView(View view, int requestedOrientation, |
| 94 | CustomViewCallback callback); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 95 | |
| 96 | public void onHideCustomView(); |
| 97 | |
| 98 | public boolean isCustomViewShowing(); |
| 99 | |
Michael Kolb | 1acef69 | 2011-03-08 14:12:06 -0800 | [diff] [blame] | 100 | public boolean onPrepareOptionsMenu(Menu menu); |
| 101 | |
Michael Kolb | 7bdee0b | 2011-08-01 11:55:38 -0700 | [diff] [blame] | 102 | public void updateMenuState(Tab tab, Menu menu); |
| 103 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 104 | public void onOptionsMenuOpened(); |
| 105 | |
| 106 | public void onExtendedMenuOpened(); |
| 107 | |
Michael Kolb | 3ca1275 | 2011-07-20 13:52:25 -0700 | [diff] [blame] | 108 | public boolean onOptionsItemSelected(MenuItem item); |
| 109 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 110 | public void onOptionsMenuClosed(boolean inLoad); |
| 111 | |
| 112 | public void onExtendedMenuClosed(boolean inLoad); |
| 113 | |
| 114 | public void onContextMenuCreated(Menu menu); |
| 115 | |
| 116 | public void onContextMenuClosed(Menu menu, boolean inLoad); |
| 117 | |
| 118 | public void onActionModeStarted(ActionMode mode); |
| 119 | |
| 120 | public void onActionModeFinished(boolean inLoad); |
| 121 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 122 | // returns if the web page is clear of any overlays (not including sub windows) |
John Reck | 3ba4553 | 2011-08-11 16:26:53 -0700 | [diff] [blame] | 123 | public boolean isWebShowing(); |
| 124 | |
Tarun Nainani | 87a8668 | 2015-02-05 11:47:35 -0800 | [diff] [blame^] | 125 | public boolean isComboViewShowing(); |
| 126 | |
John Reck | 3ba4553 | 2011-08-11 16:26:53 -0700 | [diff] [blame] | 127 | public void showWeb(boolean animate); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 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 | 1f9b356 | 2012-04-24 14:38:34 -0700 | [diff] [blame] | 137 | void editUrl(boolean clearInput, boolean forceIME); |
Michael Kolb | dc2ee1b | 2011-02-14 14:34:40 -0800 | [diff] [blame] | 138 | |
Michael Kolb | 42c0c06 | 2011-08-02 12:56:06 -0700 | [diff] [blame] | 139 | boolean isEditingUrl(); |
| 140 | |
Michael Kolb | a418306 | 2011-01-16 10:43:21 -0800 | [diff] [blame] | 141 | boolean dispatchKey(int code, KeyEvent event); |
| 142 | |
Michael Kolb | c38c604 | 2011-04-27 10:46:06 -0700 | [diff] [blame] | 143 | void setFullscreen(boolean enabled); |
Sudheer Koganti | 2476688 | 2014-10-02 10:58:09 -0700 | [diff] [blame] | 144 | void showFullscreen(boolean show); |
Michael Kolb | 0241e75 | 2011-07-07 14:58:50 -0700 | [diff] [blame] | 145 | |
Tarun Nainani | 8eb0091 | 2014-07-17 12:28:32 -0700 | [diff] [blame] | 146 | void translateTitleBar(float topControlsOffsetYPix); |
Vivek Sekhar | 8ee3abb | 2014-07-14 12:32:05 -0700 | [diff] [blame] | 147 | |
John Reck | 1cf4b79 | 2011-07-26 10:22:22 -0700 | [diff] [blame] | 148 | public boolean shouldCaptureThumbnails(); |
| 149 | |
Michael Kolb | bae0cb2 | 2012-05-29 11:15:27 -0700 | [diff] [blame] | 150 | boolean blockFocusAnimations(); |
| 151 | |
Michael Kolb | 0b12912 | 2012-06-04 16:31:58 -0700 | [diff] [blame] | 152 | void onVoiceResult(String result); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 153 | } |