blob: 551d0ce3587f7139b8077c329b1d7532565cb7c6 [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;
22import android.webkit.WebView;
23
Michael Kolb1bf23132010-11-19 12:55:12 -080024import java.util.List;
25
Michael Kolb8233fac2010-10-26 16:08:53 -070026
27/**
28 * UI aspect of the controller
29 */
30public interface UiController extends BookmarksHistoryCallbacks {
31
32 UI getUi();
33
34 WebView getCurrentWebView();
35
36 WebView getCurrentTopWebView();
37
38 TabControl getTabControl();
39
Michael Kolb1bf23132010-11-19 12:55:12 -080040 List<Tab> getTabs();
41
Michael Kolb8233fac2010-10-26 16:08:53 -070042 Tab openTabToHomePage();
43
44 Tab openIncognitoTab();
45
46 boolean switchToTab(int tabIndex);
47
48 void closeCurrentTab();
49
50 void closeTab(Tab tab);
51
52 void stopLoading();
53
Leon Scrogginsbdff8a72011-02-11 15:49:04 -050054 void bookmarkCurrentPage(long folderId, boolean canBeAnEdit);
Michael Kolb8233fac2010-10-26 16:08:53 -070055
56 void bookmarksOrHistoryPicker(boolean openHistory);
57
Michael Kolbdc2ee1b2011-02-14 14:34:40 -080058 void startSearch(String url);
59
Michael Kolbcfa3af52010-12-14 10:36:11 -080060 void startVoiceSearch();
61
Michael Kolb8233fac2010-10-26 16:08:53 -070062 void showVoiceSearchResults(String title);
63
64 void editUrl();
65
66 void removeActiveTabsPage(boolean attach);
67
68 void handleNewIntent(Intent intent);
69
70 boolean shouldShowErrorConsole();
71
72 void removeComboView();
73
74 void hideCustomView();
75
76 void attachSubWindow(Tab tab);
77
78 void removeSubWindow(Tab tab);
79
80 boolean isInCustomActionMode();
81
82 void endActionMode();
83
Michael Kolbba99c5d2010-11-29 14:57:41 -080084 void shareCurrentPage();
85
John Reckb3417f02011-01-14 11:01:05 -080086 void registerOptionsMenuHandler(OptionsMenuHandler handler);
87
88 void unregisterOptionsMenuHandler(OptionsMenuHandler handler);
Narayan Kamath5119edd2011-02-23 15:49:17 +000089
90 void registerDropdownChangeListener(DropdownChangeListener d);
Michael Kolb8233fac2010-10-26 16:08:53 -070091}