blob: 08cf33a0fd39459ee2f8d9e95e4502a06c35c300 [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
19import com.android.browser.ScrollWebView.ScrollListener;
20
21import android.content.res.Configuration;
22import android.graphics.Bitmap;
23import android.os.Bundle;
24import android.view.ActionMode;
25import android.view.Menu;
26import android.view.View;
27import android.webkit.WebChromeClient.CustomViewCallback;
28
Michael Kolb1bf23132010-11-19 12:55:12 -080029import java.util.List;
30
Michael Kolb8233fac2010-10-26 16:08:53 -070031/**
32 * UI interface definitions
33 */
34public interface UI extends ScrollListener {
35
36 public void onPause();
37
38 public void onResume();
39
40 public void onDestroy();
41
42 public void onConfigurationChanged(Configuration config);
43
44 public boolean onBackKey();
45
Michael Kolb1bf23132010-11-19 12:55:12 -080046 public boolean needsRestoreAllTabs();
47
Michael Kolb8233fac2010-10-26 16:08:53 -070048 public void addTab(Tab tab);
49
50 public void removeTab(Tab tab);
51
52 public void setActiveTab(Tab tab);
53
Michael Kolb1bf23132010-11-19 12:55:12 -080054 public void updateTabs(List<Tab> tabs);
55
Michael Kolb8233fac2010-10-26 16:08:53 -070056 public void detachTab(Tab tab);
57
58 public void attachTab(Tab tab);
59
60 public void attachSubWindow(View subContainer);
61
62 public void removeSubWindow(View subContainer);
63
64 // TODO: consolidate
65 public void setUrlTitle(Tab tab, String url, String title);
66
67 // TODO: consolidate
68 public void setFavicon(Tab tab, Bitmap icon);
69
70 public void resetTitleAndRevertLockIcon(Tab tab);
71
72 public void resetTitleAndIcon(Tab tab);
73
74 public void onPageStarted(Tab tab, String url, Bitmap favicon);
75
76 public void onPageFinished(Tab tab, String url);
77
78 public void onPageStopped(Tab tab);
79
80 public void onProgressChanged(Tab tab, int progress);
81
82 public void showActiveTabsPage();
83
84 public void removeActiveTabsPage();
85
86 public void showComboView(boolean startWithHistory, Bundle extra);
87
88 public void hideComboView();
89
90 public void showCustomView(View view, CustomViewCallback callback);
91
92 public void onHideCustomView();
93
94 public boolean isCustomViewShowing();
95
96 public void showVoiceTitleBar(String title);
97
98 public void revertVoiceTitleBar(Tab tab);
99
100 // allow the ui to update state
101 public void onPrepareOptionsMenu(Menu menu);
102
103 public void onOptionsMenuOpened();
104
105 public void onExtendedMenuOpened();
106
107 public void onOptionsMenuClosed(boolean inLoad);
108
109 public void onExtendedMenuClosed(boolean inLoad);
110
111 public void onContextMenuCreated(Menu menu);
112
113 public void onContextMenuClosed(Menu menu, boolean inLoad);
114
115 public void onActionModeStarted(ActionMode mode);
116
117 public void onActionModeFinished(boolean inLoad);
118
119 public void setShouldShowErrorConsole(Tab tab, boolean show);
120
121 // returns if the web page is clear of any overlays (not including sub windows)
122 public boolean showsWeb();
123
124 Bitmap getDefaultVideoPoster();
125
126 View getVideoLoadingProgressView();
127
128}