blob: 00dacdb369c83f0f03d9e044be5eeb852908d278 [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
Bijan Amirzada41242f22014-03-21 12:12:18 -070017package com.android.browser;
Michael Kolb8233fac2010-10-26 16:08:53 -070018
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;
Michael Kolb3ca12752011-07-20 13:52:25 -070025import android.view.MenuItem;
Michael Kolb8233fac2010-10-26 16:08:53 -070026import android.view.View;
27import android.webkit.WebChromeClient.CustomViewCallback;
Bijan Amirzada9b1e9882014-02-26 17:15:46 -080028import org.codeaurora.swe.WebView;
Michael Kolb8233fac2010-10-26 16:08:53 -070029
Michael Kolb1bf23132010-11-19 12:55:12 -080030import java.util.List;
31
Michael Kolb8233fac2010-10-26 16:08:53 -070032/**
33 * UI interface definitions
34 */
Michael Kolb66706532010-12-12 19:50:22 -080035public interface UI {
Michael Kolb8233fac2010-10-26 16:08:53 -070036
John Reck2bc80422011-06-30 15:11:49 -070037 public static enum ComboViews {
38 History,
39 Bookmarks,
40 Snapshots,
41 }
42
Michael Kolb8233fac2010-10-26 16:08:53 -070043 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 Kolb2814a362011-05-19 15:49:41 -070053 public boolean onMenuKey();
54
Michael Kolb1bf23132010-11-19 12:55:12 -080055 public boolean needsRestoreAllTabs();
56
Michael Kolb8233fac2010-10-26 16:08:53 -070057 public void addTab(Tab tab);
58
59 public void removeTab(Tab tab);
60
61 public void setActiveTab(Tab tab);
62
Michael Kolb1bf23132010-11-19 12:55:12 -080063 public void updateTabs(List<Tab> tabs);
64
Michael Kolb8233fac2010-10-26 16:08:53 -070065 public void detachTab(Tab tab);
66
67 public void attachTab(Tab tab);
68
Michael Kolba713ec82010-11-29 17:27:06 -080069 public void onSetWebView(Tab tab, WebView view);
70
Michael Kolb1514bb72010-11-22 09:11:48 -080071 public void createSubWindow(Tab tab, WebView subWebView);
72
Michael Kolb8233fac2010-10-26 16:08:53 -070073 public void attachSubWindow(View subContainer);
74
75 public void removeSubWindow(View subContainer);
76
John Reck30c714c2010-12-16 17:30:34 -080077 public void onTabDataChanged(Tab tab);
Michael Kolb8233fac2010-10-26 16:08:53 -070078
79 public void onPageStopped(Tab tab);
80
John Reck30c714c2010-12-16 17:30:34 -080081 public void onProgressChanged(Tab tab);
Michael Kolb8233fac2010-10-26 16:08:53 -070082
83 public void showActiveTabsPage();
84
85 public void removeActiveTabsPage();
86
John Reck2bc80422011-06-30 15:11:49 -070087 public void showComboView(ComboViews startingView, Bundle extra);
Michael Kolb8233fac2010-10-26 16:08:53 -070088
Derek Sollenberger2d4f1e22011-06-01 14:50:42 -040089 public void showCustomView(View view, int requestedOrientation,
90 CustomViewCallback callback);
Michael Kolb8233fac2010-10-26 16:08:53 -070091
92 public void onHideCustomView();
93
94 public boolean isCustomViewShowing();
95
Michael Kolb1acef692011-03-08 14:12:06 -080096 public boolean onPrepareOptionsMenu(Menu menu);
97
Michael Kolb7bdee0b2011-08-01 11:55:38 -070098 public void updateMenuState(Tab tab, Menu menu);
99
Michael Kolb8233fac2010-10-26 16:08:53 -0700100 public void onOptionsMenuOpened();
101
102 public void onExtendedMenuOpened();
103
Michael Kolb3ca12752011-07-20 13:52:25 -0700104 public boolean onOptionsItemSelected(MenuItem item);
105
Michael Kolb8233fac2010-10-26 16:08:53 -0700106 public void onOptionsMenuClosed(boolean inLoad);
107
108 public void onExtendedMenuClosed(boolean inLoad);
109
110 public void onContextMenuCreated(Menu menu);
111
112 public void onContextMenuClosed(Menu menu, boolean inLoad);
113
114 public void onActionModeStarted(ActionMode mode);
115
116 public void onActionModeFinished(boolean inLoad);
117
118 public void setShouldShowErrorConsole(Tab tab, boolean show);
119
120 // returns if the web page is clear of any overlays (not including sub windows)
John Reck3ba45532011-08-11 16:26:53 -0700121 public boolean isWebShowing();
122
123 public void showWeb(boolean animate);
Michael Kolb8233fac2010-10-26 16:08:53 -0700124
125 Bitmap getDefaultVideoPoster();
126
127 View getVideoLoadingProgressView();
128
Leon Scroggins4cd97792010-12-03 15:31:56 -0500129 void bookmarkedStatusHasChanged(Tab tab);
Michael Kolb843510f2010-12-09 10:51:49 -0800130
131 void showMaxTabsWarning();
132
Michael Kolb1f9b3562012-04-24 14:38:34 -0700133 void editUrl(boolean clearInput, boolean forceIME);
Michael Kolbdc2ee1b2011-02-14 14:34:40 -0800134
Michael Kolb42c0c062011-08-02 12:56:06 -0700135 boolean isEditingUrl();
136
Michael Kolba4183062011-01-16 10:43:21 -0800137 boolean dispatchKey(int code, KeyEvent event);
138
Patrick Scott92066772011-03-10 08:46:27 -0500139 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
John Reck1cf4b792011-07-26 10:22:22 -0700147 public boolean shouldCaptureThumbnails();
148
Michael Kolbbae0cb22012-05-29 11:15:27 -0700149 boolean blockFocusAnimations();
150
Michael Kolb0b129122012-06-04 16:31:58 -0700151 void onVoiceResult(String result);
Michael Kolb8233fac2010-10-26 16:08:53 -0700152}