blob: 172509b23f512f15565ffebf2fc2bfcee5e38438 [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
Sagar Dhawanf7b5d0b2015-02-06 15:47:20 -080063 public void cancelNavScreenRequest();
64
Michael Kolb1bf23132010-11-19 12:55:12 -080065 public void updateTabs(List<Tab> tabs);
66
Michael Kolb8233fac2010-10-26 16:08:53 -070067 public void detachTab(Tab tab);
68
69 public void attachTab(Tab tab);
70
Michael Kolba713ec82010-11-29 17:27:06 -080071 public void onSetWebView(Tab tab, WebView view);
72
Michael Kolb1514bb72010-11-22 09:11:48 -080073 public void createSubWindow(Tab tab, WebView subWebView);
74
Michael Kolb8233fac2010-10-26 16:08:53 -070075 public void attachSubWindow(View subContainer);
76
77 public void removeSubWindow(View subContainer);
78
John Reck30c714c2010-12-16 17:30:34 -080079 public void onTabDataChanged(Tab tab);
Michael Kolb8233fac2010-10-26 16:08:53 -070080
81 public void onPageStopped(Tab tab);
82
John Reck30c714c2010-12-16 17:30:34 -080083 public void onProgressChanged(Tab tab);
Michael Kolb8233fac2010-10-26 16:08:53 -070084
85 public void showActiveTabsPage();
86
87 public void removeActiveTabsPage();
88
John Reck2bc80422011-06-30 15:11:49 -070089 public void showComboView(ComboViews startingView, Bundle extra);
Michael Kolb8233fac2010-10-26 16:08:53 -070090
Derek Sollenberger2d4f1e22011-06-01 14:50:42 -040091 public void showCustomView(View view, int requestedOrientation,
92 CustomViewCallback callback);
Michael Kolb8233fac2010-10-26 16:08:53 -070093
94 public void onHideCustomView();
95
96 public boolean isCustomViewShowing();
97
Michael Kolb1acef692011-03-08 14:12:06 -080098 public boolean onPrepareOptionsMenu(Menu menu);
99
Michael Kolb7bdee0b2011-08-01 11:55:38 -0700100 public void updateMenuState(Tab tab, Menu menu);
101
Michael Kolb8233fac2010-10-26 16:08:53 -0700102 public void onOptionsMenuOpened();
103
104 public void onExtendedMenuOpened();
105
Michael Kolb3ca12752011-07-20 13:52:25 -0700106 public boolean onOptionsItemSelected(MenuItem item);
107
Michael Kolb8233fac2010-10-26 16:08:53 -0700108 public void onOptionsMenuClosed(boolean inLoad);
109
110 public void onExtendedMenuClosed(boolean inLoad);
111
112 public void onContextMenuCreated(Menu menu);
113
114 public void onContextMenuClosed(Menu menu, boolean inLoad);
115
116 public void onActionModeStarted(ActionMode mode);
117
118 public void onActionModeFinished(boolean inLoad);
119
Michael Kolb8233fac2010-10-26 16:08:53 -0700120 // 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
Michael Kolbc38c6042011-04-27 10:46:06 -0700139 void setFullscreen(boolean enabled);
Sudheer Koganti24766882014-10-02 10:58:09 -0700140 void showFullscreen(boolean show);
Michael Kolb0241e752011-07-07 14:58:50 -0700141
Tarun Nainani8eb00912014-07-17 12:28:32 -0700142 void translateTitleBar(float topControlsOffsetYPix);
Vivek Sekhar8ee3abb2014-07-14 12:32:05 -0700143
John Reck1cf4b792011-07-26 10:22:22 -0700144 public boolean shouldCaptureThumbnails();
145
Michael Kolbbae0cb22012-05-29 11:15:27 -0700146 boolean blockFocusAnimations();
147
Michael Kolb0b129122012-06-04 16:31:58 -0700148 void onVoiceResult(String result);
Michael Kolb8233fac2010-10-26 16:08:53 -0700149}