blob: b9e704285f841930e337b19cd52ebd972da7579e [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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
Nate Fischer3442c742017-09-08 17:02:00 -070019import android.annotation.Nullable;
Ignacio Solla451e3382014-11-10 10:35:54 +000020import android.annotation.SystemApi;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080021import 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
Torne (Richard Coles)e4b86642018-06-19 16:29:54 -040026 * item.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080027 * @see WebBackForwardList
28 */
Ignacio Solla451e3382014-11-10 10:35:54 +000029public abstract class WebHistoryItem implements Cloneable {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030 /**
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.
Kristian Monsenfc771652011-05-10 16:44:05 +010035 * @deprecated This method is now obsolete.
Kristian Monsenf4912582012-08-16 15:26:24 -040036 * @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080037 */
Ignacio Solla451e3382014-11-10 10:35:54 +000038 @SystemApi
Kristian Monsenfc771652011-05-10 16:44:05 +010039 @Deprecated
Ignacio Solla451e3382014-11-10 10:35:54 +000040 public abstract int getId();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080041
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.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080047 */
Ignacio Solla451e3382014-11-10 10:35:54 +000048 public abstract String getUrl();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049
50 /**
51 * Return the original url of this history item. This was the requested
Ignacio Solla451e3382014-11-10 10:35:54 +000052 * url, the final url may be different as there might have been
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080053 * redirects while loading the site.
54 * @return The original url of this history item.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080055 */
Ignacio Solla451e3382014-11-10 10:35:54 +000056 public abstract String getOriginalUrl();
57
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080058 /**
59 * Return the document title of this history item.
60 * @return The document title of this history item.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080061 */
Ignacio Solla451e3382014-11-10 10:35:54 +000062 public abstract String getTitle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080063
64 /**
Nate Fischer0a6140d2017-09-05 12:37:49 -070065 * Return the favicon of this history item or {@code null} if no favicon was found.
66 * @return A Bitmap containing the favicon for this history item or {@code null}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080067 */
Nate Fischer3442c742017-09-08 17:02:00 -070068 @Nullable
Ignacio Solla451e3382014-11-10 10:35:54 +000069 public abstract Bitmap getFavicon();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080070
71 /**
Torne (Richard Coles)e4b86642018-06-19 16:29:54 -040072 * Clone the history item for use by clients of WebView. On Android 4.4 and later
73 * there is no need to use this, as the object is already a read-only copy of the
74 * internal state.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080075 */
Ignacio Solla451e3382014-11-10 10:35:54 +000076 protected abstract WebHistoryItem clone();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080077}