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