blob: 9b48c46a636a4821e0606e15f3ea3a0bc4d63cb5 [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
17package com.android.browser;
18
John Recke1a03a32011-09-14 17:04:16 -070019import android.app.Activity;
Michael Kolb8233fac2010-10-26 16:08:53 -070020import android.content.Intent;
Michael Kolb4bf79712011-07-14 14:18:12 -070021import android.view.Menu;
Michael Kolb1acef692011-03-08 14:12:06 -080022import android.view.MenuItem;
Michael Kolb8233fac2010-10-26 16:08:53 -070023import android.webkit.WebView;
24
Michael Kolb315d5022011-10-13 12:47:11 -070025import com.android.browser.UI.ComboViews;
Michael Kolb4bf79712011-07-14 14:18:12 -070026import com.android.browser.UI.DropdownChangeListener;
27
Michael Kolb1bf23132010-11-19 12:55:12 -080028import java.util.List;
29
Michael Kolb8233fac2010-10-26 16:08:53 -070030
31/**
32 * UI aspect of the controller
33 */
John Reckd3e4d5b2011-07-13 15:48:43 -070034public interface UiController {
Michael Kolb8233fac2010-10-26 16:08:53 -070035
36 UI getUi();
37
38 WebView getCurrentWebView();
39
40 WebView getCurrentTopWebView();
41
John Reckef654f12011-07-12 16:42:08 -070042 Tab getCurrentTab();
43
Michael Kolb8233fac2010-10-26 16:08:53 -070044 TabControl getTabControl();
45
Michael Kolb1bf23132010-11-19 12:55:12 -080046 List<Tab> getTabs();
47
Michael Kolb8233fac2010-10-26 16:08:53 -070048 Tab openTabToHomePage();
49
Michael Kolb519d2282011-05-09 17:03:19 -070050 Tab openIncognitoTab();
51
Michael Kolb7bcafde2011-05-09 13:55:59 -070052 Tab openTab(String url, boolean incognito, boolean setActive,
53 boolean useCurrent);
Michael Kolba4261fd2011-05-05 11:27:37 -070054
Michael Kolbf2055602011-04-09 17:20:03 -070055 void setActiveTab(Tab tab);
56
Michael Kolbc831b632011-05-11 09:30:34 -070057 boolean switchToTab(Tab tab);
Michael Kolb8233fac2010-10-26 16:08:53 -070058
59 void closeCurrentTab();
60
61 void closeTab(Tab tab);
62
63 void stopLoading();
64
John Reckd3e4d5b2011-07-13 15:48:43 -070065 Intent createBookmarkCurrentPageIntent(boolean canBeAnEdit);
Michael Kolb8233fac2010-10-26 16:08:53 -070066
Michael Kolb315d5022011-10-13 12:47:11 -070067 void bookmarksOrHistoryPicker(ComboViews startView);
Michael Kolb8233fac2010-10-26 16:08:53 -070068
Michael Kolbcfa3af52010-12-14 10:36:11 -080069 void startVoiceSearch();
70
Michael Kolb736990c2011-03-20 10:01:20 -070071 boolean supportsVoiceSearch();
72
Michael Kolb8233fac2010-10-26 16:08:53 -070073 void showVoiceSearchResults(String title);
74
75 void editUrl();
76
Michael Kolb8233fac2010-10-26 16:08:53 -070077 void handleNewIntent(Intent intent);
78
79 boolean shouldShowErrorConsole();
80
Michael Kolb8233fac2010-10-26 16:08:53 -070081 void hideCustomView();
82
83 void attachSubWindow(Tab tab);
84
85 void removeSubWindow(Tab tab);
86
87 boolean isInCustomActionMode();
88
89 void endActionMode();
90
Michael Kolbba99c5d2010-11-29 14:57:41 -080091 void shareCurrentPage();
92
Michael Kolb4bf79712011-07-14 14:18:12 -070093 void updateMenuState(Tab tab, Menu menu);
94
Narayan Kamath5119edd2011-02-23 15:49:17 +000095 void registerDropdownChangeListener(DropdownChangeListener d);
Michael Kolb1acef692011-03-08 14:12:06 -080096
97 boolean onOptionsItemSelected(MenuItem item);
98
John Reck2bc80422011-06-30 15:11:49 -070099 SnapshotTab createNewSnapshotTab(long snapshotId, boolean setActive);
100
John Reck71e51422011-07-01 16:49:28 -0700101 void loadUrl(Tab tab, String url);
102
Michael Kolbc3af0672011-08-09 10:24:41 -0700103 void setBlockEvents(boolean block);
104
John Recke1a03a32011-09-14 17:04:16 -0700105 Activity getActivity();
106
Michael Kolb315d5022011-10-13 12:47:11 -0700107 void showPageInfo();
108
Michael Kolb8233fac2010-10-26 16:08:53 -0700109}