1 /* 2 * Copyright (C) 2006 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 android.webkit; 18 19 import android.graphics.Bitmap; 20 21 /** 22 * A convenience class for accessing fields in an entry in the back/forward list 23 * of a WebView. Each WebHistoryItem is a snapshot of the requested history 24 * item. Each history item may be updated during the load of a page. 25 * @see WebBackForwardList 26 */ 27 public class WebHistoryItem implements Cloneable { 28 29 /** 30 * @hide 31 */ 32 public WebHistoryItem() { 33 } 34 35 /** 36 * Return an identifier for this history item. If an item is a copy of 37 * another item, the identifiers will be the same even if they are not the 38 * same object. 39 * @return The id for this item. 40 * @deprecated This method is now obsolete. 41 * @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} 42 */ 43 @Deprecated 44 public int getId() { 45 throw new MustOverrideException(); 46 } 47 48 /** 49 * Return the url of this history item. The url is the base url of this 50 * history item. See getTargetUrl() for the url that is the actual target of 51 * this history item. 52 * @return The base url of this history item. 53 * Note: The VM ensures 32-bit atomic read/write operations so we don't have 54 * to synchronize this method. 55 */ 56 public String getUrl() { 57 throw new MustOverrideException(); 58 } 59 60 /** 61 * Return the original url of this history item. This was the requested 62 * url, the final url may be different as there might have been 63 * redirects while loading the site. 64 * @return The original url of this history item. 65 */ 66 public String getOriginalUrl() { 67 throw new MustOverrideException(); 68 } 69 70 /** 71 * Return the document title of this history item. 72 * @return The document title of this history item. 73 * Note: The VM ensures 32-bit atomic read/write operations so we don't have 74 * to synchronize this method. 75 */ 76 public String getTitle() { 77 throw new MustOverrideException(); 78 } 79 80 /** 81 * Return the favicon of this history item or null if no favicon was found. 82 * @return A Bitmap containing the favicon for this history item or null. 83 * Note: The VM ensures 32-bit atomic read/write operations so we don't have 84 * to synchronize this method. 85 */ 86 public Bitmap getFavicon() { 87 throw new MustOverrideException(); 88 } 89 90 /** 91 * Clone the history item for use by clients of WebView. 92 */ 93 protected synchronized WebHistoryItem clone() { 94 throw new MustOverrideException(); 95 } 96 97 } 98