blob: 9b75aca24ec55041b3a1122387dfd387d0b9ffe1 [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
39 TabControl getTabControl();
40
Michael Kolb1bf23132010-11-19 12:55:12 -080041 List<Tab> getTabs();
42
Michael Kolb8233fac2010-10-26 16:08:53 -070043 Tab openTabToHomePage();
44
45 Tab openIncognitoTab();
46
Michael Kolba4261fd2011-05-05 11:27:37 -070047 Tab createNewTab(String url, boolean incognito);
48
Michael Kolbf2055602011-04-09 17:20:03 -070049 void setActiveTab(Tab tab);
50
Michael Kolb8233fac2010-10-26 16:08:53 -070051 boolean switchToTab(int tabIndex);
52
53 void closeCurrentTab();
54
55 void closeTab(Tab tab);
56
57 void stopLoading();
58
Leon Scrogginsbdff8a72011-02-11 15:49:04 -050059 void bookmarkCurrentPage(long folderId, boolean canBeAnEdit);
Michael Kolb8233fac2010-10-26 16:08:53 -070060
61 void bookmarksOrHistoryPicker(boolean openHistory);
62
Michael Kolbcfa3af52010-12-14 10:36:11 -080063 void startVoiceSearch();
64
Michael Kolb736990c2011-03-20 10:01:20 -070065 boolean supportsVoiceSearch();
66
Michael Kolb8233fac2010-10-26 16:08:53 -070067 void showVoiceSearchResults(String title);
68
69 void editUrl();
70
71 void removeActiveTabsPage(boolean attach);
72
73 void handleNewIntent(Intent intent);
74
75 boolean shouldShowErrorConsole();
76
77 void removeComboView();
78
79 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
John Reckb3417f02011-01-14 11:01:05 -080091 void registerOptionsMenuHandler(OptionsMenuHandler handler);
92
93 void unregisterOptionsMenuHandler(OptionsMenuHandler handler);
Narayan Kamath5119edd2011-02-23 15:49:17 +000094
95 void registerDropdownChangeListener(DropdownChangeListener d);
Michael Kolb1acef692011-03-08 14:12:06 -080096
97 boolean onOptionsItemSelected(MenuItem item);
98
Michael Kolb8233fac2010-10-26 16:08:53 -070099}