blob: cf989e8e9b5d4ba6abeb1eecf1b33657513b7214 [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
Bijan Amirzada41242f22014-03-21 12:12:18 -070017package com.android.browser;
Michael Kolb8233fac2010-10-26 16:08:53 -070018
John Recke1a03a32011-09-14 17:04:16 -070019import android.app.Activity;
Michael Kolb8233fac2010-10-26 16:08:53 -070020import android.content.Intent;
Michael Kolb4bf79712011-07-14 14:18:12 -070021import android.view.Menu;
Michael Kolb1acef692011-03-08 14:12:06 -080022import android.view.MenuItem;
Bijan Amirzada9b1e9882014-02-26 17:15:46 -080023import org.codeaurora.swe.WebView;
Michael Kolb8233fac2010-10-26 16:08:53 -070024
Bijan Amirzada41242f22014-03-21 12:12:18 -070025import com.android.browser.UI.ComboViews;
Michael Kolb4bf79712011-07-14 14:18:12 -070026
Michael Kolb1bf23132010-11-19 12:55:12 -080027import java.util.List;
28
Michael Kolb8233fac2010-10-26 16:08:53 -070029
30/**
31 * UI aspect of the controller
32 */
John Reckd3e4d5b2011-07-13 15:48:43 -070033public interface UiController {
Michael Kolb8233fac2010-10-26 16:08:53 -070034
35 UI getUi();
36
37 WebView getCurrentWebView();
38
39 WebView getCurrentTopWebView();
40
John Reckef654f12011-07-12 16:42:08 -070041 Tab getCurrentTab();
42
Michael Kolb8233fac2010-10-26 16:08:53 -070043 TabControl getTabControl();
44
Michael Kolb1bf23132010-11-19 12:55:12 -080045 List<Tab> getTabs();
46
Michael Kolb8233fac2010-10-26 16:08:53 -070047 Tab openTabToHomePage();
48
Michael Kolb519d2282011-05-09 17:03:19 -070049 Tab openIncognitoTab();
50
Michael Kolb7bcafde2011-05-09 13:55:59 -070051 Tab openTab(String url, boolean incognito, boolean setActive,
52 boolean useCurrent);
Michael Kolba4261fd2011-05-05 11:27:37 -070053
Michael Kolbf2055602011-04-09 17:20:03 -070054 void setActiveTab(Tab tab);
55
Michael Kolbc831b632011-05-11 09:30:34 -070056 boolean switchToTab(Tab tab);
Michael Kolb8233fac2010-10-26 16:08:53 -070057
58 void closeCurrentTab();
59
60 void closeTab(Tab tab);
61
Afzal Najamd4e33312012-04-26 01:54:01 -040062 void closeOtherTabs();
63
Michael Kolb8233fac2010-10-26 16:08:53 -070064 void stopLoading();
65
John Reckd3e4d5b2011-07-13 15:48:43 -070066 Intent createBookmarkCurrentPageIntent(boolean canBeAnEdit);
Michael Kolb8233fac2010-10-26 16:08:53 -070067
Michael Kolb315d5022011-10-13 12:47:11 -070068 void bookmarksOrHistoryPicker(ComboViews startView);
Michael Kolb8233fac2010-10-26 16:08:53 -070069
Michael Kolb80f75082012-04-10 10:50:06 -070070 void bookmarkCurrentPage();
71
Michael Kolb8233fac2010-10-26 16:08:53 -070072 void editUrl();
73
Michael Kolb8233fac2010-10-26 16:08:53 -070074 void handleNewIntent(Intent intent);
75
Michael Kolb8233fac2010-10-26 16:08:53 -070076 void hideCustomView();
77
78 void attachSubWindow(Tab tab);
79
80 void removeSubWindow(Tab tab);
81
82 boolean isInCustomActionMode();
83
84 void endActionMode();
85
Michael Kolbba99c5d2010-11-29 14:57:41 -080086 void shareCurrentPage();
87
Michael Kolb4bf79712011-07-14 14:18:12 -070088 void updateMenuState(Tab tab, Menu menu);
89
Michael Kolb1acef692011-03-08 14:12:06 -080090 boolean onOptionsItemSelected(MenuItem item);
91
John Reck2bc80422011-06-30 15:11:49 -070092 SnapshotTab createNewSnapshotTab(long snapshotId, boolean setActive);
93
John Reck71e51422011-07-01 16:49:28 -070094 void loadUrl(Tab tab, String url);
95
Michael Kolbc3af0672011-08-09 10:24:41 -070096 void setBlockEvents(boolean block);
97
John Recke1a03a32011-09-14 17:04:16 -070098 Activity getActivity();
99
Michael Kolb315d5022011-10-13 12:47:11 -0700100 void showPageInfo();
101
Michael Kolb80f75082012-04-10 10:50:06 -0700102 void openPreferences();
103
104 void findOnPage();
105
106 void toggleUserAgent();
107
Michael Kolbaf63dba2012-05-16 12:58:05 -0700108 BrowserSettings getSettings();
109
Michael Kolb0b129122012-06-04 16:31:58 -0700110 boolean supportsVoice();
111
112 void startVoiceRecognizer();
113
Pankaj Garg7b279f62014-08-12 14:47:18 -0700114 void setWindowDimming(float level);
115
Michael Kolb8233fac2010-10-26 16:08:53 -0700116}