WebHistoryItem.java revision 5b0c36ab3062d160328faaa6075324378985f7cc
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.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 */
27public 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     */
42    @Deprecated
43    public int getId() {
44        throw new MustOverrideException();
45    }
46
47    /**
48     * Return the url of this history item. The url is the base url of this
49     * history item. See getTargetUrl() for the url that is the actual target of
50     * this history item.
51     * @return The base url of this history item.
52     * Note: The VM ensures 32-bit atomic read/write operations so we don't have
53     * to synchronize this method.
54     */
55    public String getUrl() {
56        throw new MustOverrideException();
57    }
58
59    /**
60     * Return the original url of this history item. This was the requested
61     * url, the final url may be different as there might have been
62     * redirects while loading the site.
63     * @return The original url of this history item.
64     */
65    public String getOriginalUrl() {
66        throw new MustOverrideException();
67    }
68
69    /**
70     * Return the document title of this history item.
71     * @return The document title of this history item.
72     * Note: The VM ensures 32-bit atomic read/write operations so we don't have
73     * to synchronize this method.
74     */
75    public String getTitle() {
76        throw new MustOverrideException();
77    }
78
79    /**
80     * Return the favicon of this history item or null if no favicon was found.
81     * @return A Bitmap containing the favicon for this history item or null.
82     * Note: The VM ensures 32-bit atomic read/write operations so we don't have
83     * to synchronize this method.
84     */
85    public Bitmap getFavicon() {
86        throw new MustOverrideException();
87    }
88
89    /**
90     * Clone the history item for use by clients of WebView.
91     */
92    protected synchronized WebHistoryItem clone() {
93        throw new MustOverrideException();
94    }
95
96}
97