blob: 10821cdfde0344293af148f736fc55d7998ec3fe [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 */
32public interface UiController extends BookmarksHistoryCallbacks {
33
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 Reck3ffc5ca2011-06-10 15:56:06 -070063 void bookmarkCurrentPage(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
79 void removeComboView();
80
81 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
John Reckb3417f02011-01-14 11:01:05 -080093 void registerOptionsMenuHandler(OptionsMenuHandler handler);
94
95 void unregisterOptionsMenuHandler(OptionsMenuHandler handler);
Narayan Kamath5119edd2011-02-23 15:49:17 +000096
Michael Kolb4bf79712011-07-14 14:18:12 -070097 void updateMenuState(Tab tab, Menu menu);
98
Narayan Kamath5119edd2011-02-23 15:49:17 +000099 void registerDropdownChangeListener(DropdownChangeListener d);
Michael Kolb1acef692011-03-08 14:12:06 -0800100
101 boolean onOptionsItemSelected(MenuItem item);
102
John Reck2bc80422011-06-30 15:11:49 -0700103 SnapshotTab createNewSnapshotTab(long snapshotId, boolean setActive);
104
John Reck71e51422011-07-01 16:49:28 -0700105 void loadUrl(Tab tab, String url);
106
Michael Kolb8233fac2010-10-26 16:08:53 -0700107}