blob: 421dc1491b559c9b89c90b920efe5bfab7206d13 [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
Narayan Kamath5119edd2011-02-23 15:49:17 +000019import com.android.browser.UI.DropdownChangeListener;
20
Michael Kolb8233fac2010-10-26 16:08:53 -070021import android.content.Intent;
Michael Kolb1acef692011-03-08 14:12:06 -080022import android.view.MenuItem;
Michael Kolb8233fac2010-10-26 16:08:53 -070023import android.webkit.WebView;
24
Michael Kolb1bf23132010-11-19 12:55:12 -080025import java.util.List;
26
Michael Kolb8233fac2010-10-26 16:08:53 -070027
28/**
29 * UI aspect of the controller
30 */
31public interface UiController extends BookmarksHistoryCallbacks {
32
33 UI getUi();
34
35 WebView getCurrentWebView();
36
37 WebView getCurrentTopWebView();
38
John Reckef654f12011-07-12 16:42:08 -070039 Tab getCurrentTab();
40
Michael Kolb8233fac2010-10-26 16:08:53 -070041 TabControl getTabControl();
42
Michael Kolb1bf23132010-11-19 12:55:12 -080043 List<Tab> getTabs();
44
Michael Kolb8233fac2010-10-26 16:08:53 -070045 Tab openTabToHomePage();
46
Michael Kolb519d2282011-05-09 17:03:19 -070047 Tab openIncognitoTab();
48
Michael Kolb7bcafde2011-05-09 13:55:59 -070049 Tab openTab(String url, boolean incognito, boolean setActive,
50 boolean useCurrent);
Michael Kolba4261fd2011-05-05 11:27:37 -070051
Michael Kolbf2055602011-04-09 17:20:03 -070052 void setActiveTab(Tab tab);
53
Michael Kolbc831b632011-05-11 09:30:34 -070054 boolean switchToTab(Tab tab);
Michael Kolb8233fac2010-10-26 16:08:53 -070055
56 void closeCurrentTab();
57
58 void closeTab(Tab tab);
59
60 void stopLoading();
61
John Reck3ffc5ca2011-06-10 15:56:06 -070062 void bookmarkCurrentPage(boolean canBeAnEdit);
Michael Kolb8233fac2010-10-26 16:08:53 -070063
64 void bookmarksOrHistoryPicker(boolean openHistory);
65
Michael Kolbcfa3af52010-12-14 10:36:11 -080066 void startVoiceSearch();
67
Michael Kolb736990c2011-03-20 10:01:20 -070068 boolean supportsVoiceSearch();
69
Michael Kolb8233fac2010-10-26 16:08:53 -070070 void showVoiceSearchResults(String title);
71
72 void editUrl();
73
Michael Kolb8233fac2010-10-26 16:08:53 -070074 void handleNewIntent(Intent intent);
75
76 boolean shouldShowErrorConsole();
77
78 void removeComboView();
79
80 void hideCustomView();
81
82 void attachSubWindow(Tab tab);
83
84 void removeSubWindow(Tab tab);
85
86 boolean isInCustomActionMode();
87
88 void endActionMode();
89
Michael Kolbba99c5d2010-11-29 14:57:41 -080090 void shareCurrentPage();
91
John Reckb3417f02011-01-14 11:01:05 -080092 void registerOptionsMenuHandler(OptionsMenuHandler handler);
93
94 void unregisterOptionsMenuHandler(OptionsMenuHandler handler);
Narayan Kamath5119edd2011-02-23 15:49:17 +000095
96 void registerDropdownChangeListener(DropdownChangeListener d);
Michael Kolb1acef692011-03-08 14:12:06 -080097
98 boolean onOptionsItemSelected(MenuItem item);
99
John Reck2bc80422011-06-30 15:11:49 -0700100 SnapshotTab createNewSnapshotTab(long snapshotId, boolean setActive);
101
John Reck71e51422011-07-01 16:49:28 -0700102 void loadUrl(Tab tab, String url);
103
Michael Kolb8233fac2010-10-26 16:08:53 -0700104}