blob: 14d498c614c61237e8d59f4089ba4638ab83167c [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
19import android.content.Intent;
Michael Kolb4bf79712011-07-14 14:18:12 -070020import android.view.Menu;
Michael Kolb1acef692011-03-08 14:12:06 -080021import android.view.MenuItem;
Michael Kolb8233fac2010-10-26 16:08:53 -070022import android.webkit.WebView;
23
Michael Kolb4bf79712011-07-14 14:18:12 -070024import com.android.browser.UI.DropdownChangeListener;
25
Michael Kolb1bf23132010-11-19 12:55:12 -080026import java.util.List;
27
Michael Kolb8233fac2010-10-26 16:08:53 -070028
29/**
30 * UI aspect of the controller
31 */
John Reckd3e4d5b2011-07-13 15:48:43 -070032public interface UiController {
Michael Kolb8233fac2010-10-26 16:08:53 -070033
34 UI getUi();
35
36 WebView getCurrentWebView();
37
38 WebView getCurrentTopWebView();
39
John Reckef654f12011-07-12 16:42:08 -070040 Tab getCurrentTab();
41
Michael Kolb8233fac2010-10-26 16:08:53 -070042 TabControl getTabControl();
43
Michael Kolb1bf23132010-11-19 12:55:12 -080044 List<Tab> getTabs();
45
Michael Kolb8233fac2010-10-26 16:08:53 -070046 Tab openTabToHomePage();
47
Michael Kolb519d2282011-05-09 17:03:19 -070048 Tab openIncognitoTab();
49
Michael Kolb7bcafde2011-05-09 13:55:59 -070050 Tab openTab(String url, boolean incognito, boolean setActive,
51 boolean useCurrent);
Michael Kolba4261fd2011-05-05 11:27:37 -070052
Michael Kolbf2055602011-04-09 17:20:03 -070053 void setActiveTab(Tab tab);
54
Michael Kolbc831b632011-05-11 09:30:34 -070055 boolean switchToTab(Tab tab);
Michael Kolb8233fac2010-10-26 16:08:53 -070056
57 void closeCurrentTab();
58
59 void closeTab(Tab tab);
60
61 void stopLoading();
62
John Reckd3e4d5b2011-07-13 15:48:43 -070063 Intent createBookmarkCurrentPageIntent(boolean canBeAnEdit);
Michael Kolb8233fac2010-10-26 16:08:53 -070064
65 void bookmarksOrHistoryPicker(boolean openHistory);
66
Michael Kolbcfa3af52010-12-14 10:36:11 -080067 void startVoiceSearch();
68
Michael Kolb736990c2011-03-20 10:01:20 -070069 boolean supportsVoiceSearch();
70
Michael Kolb8233fac2010-10-26 16:08:53 -070071 void showVoiceSearchResults(String title);
72
73 void editUrl();
74
Michael Kolb8233fac2010-10-26 16:08:53 -070075 void handleNewIntent(Intent intent);
76
77 boolean shouldShowErrorConsole();
78
Michael Kolb8233fac2010-10-26 16:08:53 -070079 void hideCustomView();
80
81 void attachSubWindow(Tab tab);
82
83 void removeSubWindow(Tab tab);
84
85 boolean isInCustomActionMode();
86
87 void endActionMode();
88
Michael Kolbba99c5d2010-11-29 14:57:41 -080089 void shareCurrentPage();
90
Michael Kolb4bf79712011-07-14 14:18:12 -070091 void updateMenuState(Tab tab, Menu menu);
92
Narayan Kamath5119edd2011-02-23 15:49:17 +000093 void registerDropdownChangeListener(DropdownChangeListener d);
Michael Kolb1acef692011-03-08 14:12:06 -080094
95 boolean onOptionsItemSelected(MenuItem item);
96
John Reck2bc80422011-06-30 15:11:49 -070097 SnapshotTab createNewSnapshotTab(long snapshotId, boolean setActive);
98
John Reck71e51422011-07-01 16:49:28 -070099 void loadUrl(Tab tab, String url);
100
Michael Kolb8233fac2010-10-26 16:08:53 -0700101}