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