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 19 import android.app.Activity; 20 import android.content.Intent; 21 import android.view.Menu; 22 import android.view.MenuItem; 23 import android.webkit.WebView; 24 25 import com.android.browser.UI.ComboViews; 26 27 import java.util.List; 28 29 30 /** 31 * UI aspect of the controller 32 */ 33 public interface UiController { 34 35 UI getUi(); 36 37 WebView getCurrentWebView(); 38 39 WebView getCurrentTopWebView(); 40 41 Tab getCurrentTab(); 42 43 TabControl getTabControl(); 44 45 List<Tab> getTabs(); 46 47 Tab openTabToHomePage(); 48 49 Tab openIncognitoTab(); 50 51 Tab openTab(String url, boolean incognito, boolean setActive, 52 boolean useCurrent); 53 54 void setActiveTab(Tab tab); 55 56 boolean switchToTab(Tab tab); 57 58 void closeCurrentTab(); 59 60 void closeTab(Tab tab); 61 62 void closeOtherTabs(); 63 64 void stopLoading(); 65 66 Intent createBookmarkCurrentPageIntent(boolean canBeAnEdit); 67 68 void bookmarksOrHistoryPicker(ComboViews startView); 69 70 void bookmarkCurrentPage(); 71 72 void editUrl(); 73 74 void handleNewIntent(Intent intent); 75 76 boolean shouldShowErrorConsole(); 77 78 void hideCustomView(); 79 80 void attachSubWindow(Tab tab); 81 82 void removeSubWindow(Tab tab); 83 84 boolean isInCustomActionMode(); 85 86 void endActionMode(); 87 88 void shareCurrentPage(); 89 90 void updateMenuState(Tab tab, Menu menu); 91 92 boolean onOptionsItemSelected(MenuItem item); 93 94 void loadUrl(Tab tab, String url); 95 96 void setBlockEvents(boolean block); 97 98 Activity getActivity(); 99 100 void showPageInfo(); 101 102 void openPreferences(); 103 104 void findOnPage(); 105 106 void toggleUserAgent(); 107 108 BrowserSettings getSettings(); 109 110 boolean supportsVoice(); 111 112 void startVoiceRecognizer(); 113 114 } 115