Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.browser; |
| 18 | |
Narayan Kamath | 5119edd | 2011-02-23 15:49:17 +0000 | [diff] [blame] | 19 | import com.android.browser.UI.DropdownChangeListener; |
| 20 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 21 | import android.content.Intent; |
Michael Kolb | 1acef69 | 2011-03-08 14:12:06 -0800 | [diff] [blame] | 22 | import android.view.MenuItem; |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 23 | import android.webkit.WebView; |
| 24 | |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 25 | import java.util.List; |
| 26 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 27 | |
| 28 | /** |
| 29 | * UI aspect of the controller |
| 30 | */ |
| 31 | public interface UiController extends BookmarksHistoryCallbacks { |
| 32 | |
| 33 | UI getUi(); |
| 34 | |
| 35 | WebView getCurrentWebView(); |
| 36 | |
| 37 | WebView getCurrentTopWebView(); |
| 38 | |
| 39 | TabControl getTabControl(); |
| 40 | |
Michael Kolb | 1bf2313 | 2010-11-19 12:55:12 -0800 | [diff] [blame] | 41 | List<Tab> getTabs(); |
| 42 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 43 | Tab openTabToHomePage(); |
| 44 | |
| 45 | Tab openIncognitoTab(); |
| 46 | |
| 47 | boolean switchToTab(int tabIndex); |
| 48 | |
| 49 | void closeCurrentTab(); |
| 50 | |
| 51 | void closeTab(Tab tab); |
| 52 | |
| 53 | void stopLoading(); |
| 54 | |
Leon Scroggins | bdff8a7 | 2011-02-11 15:49:04 -0500 | [diff] [blame] | 55 | void bookmarkCurrentPage(long folderId, boolean canBeAnEdit); |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 56 | |
| 57 | void bookmarksOrHistoryPicker(boolean openHistory); |
| 58 | |
Michael Kolb | dc2ee1b | 2011-02-14 14:34:40 -0800 | [diff] [blame] | 59 | void startSearch(String url); |
| 60 | |
Michael Kolb | cfa3af5 | 2010-12-14 10:36:11 -0800 | [diff] [blame] | 61 | void startVoiceSearch(); |
| 62 | |
Michael Kolb | 736990c | 2011-03-20 10:01:20 -0700 | [diff] [blame] | 63 | boolean supportsVoiceSearch(); |
| 64 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 65 | void showVoiceSearchResults(String title); |
| 66 | |
| 67 | void editUrl(); |
| 68 | |
| 69 | void removeActiveTabsPage(boolean attach); |
| 70 | |
| 71 | void handleNewIntent(Intent intent); |
| 72 | |
| 73 | boolean shouldShowErrorConsole(); |
| 74 | |
| 75 | void removeComboView(); |
| 76 | |
| 77 | void hideCustomView(); |
| 78 | |
| 79 | void attachSubWindow(Tab tab); |
| 80 | |
| 81 | void removeSubWindow(Tab tab); |
| 82 | |
| 83 | boolean isInCustomActionMode(); |
| 84 | |
| 85 | void endActionMode(); |
| 86 | |
Michael Kolb | ba99c5d | 2010-11-29 14:57:41 -0800 | [diff] [blame] | 87 | void shareCurrentPage(); |
| 88 | |
John Reck | b3417f0 | 2011-01-14 11:01:05 -0800 | [diff] [blame] | 89 | void registerOptionsMenuHandler(OptionsMenuHandler handler); |
| 90 | |
| 91 | void unregisterOptionsMenuHandler(OptionsMenuHandler handler); |
Narayan Kamath | 5119edd | 2011-02-23 15:49:17 +0000 | [diff] [blame] | 92 | |
| 93 | void registerDropdownChangeListener(DropdownChangeListener d); |
Michael Kolb | 1acef69 | 2011-03-08 14:12:06 -0800 | [diff] [blame] | 94 | |
| 95 | boolean onOptionsItemSelected(MenuItem item); |
| 96 | |
Michael Kolb | 8233fac | 2010-10-26 16:08:53 -0700 | [diff] [blame] | 97 | } |