History support on platform Qt. r=lars
[WebKit-https.git] / WebKitQt / Api / qwebpagehistory.h
1 #ifndef QWEBPAGEHISTORY_H
2 #define QWEBPAGEHISTORY_H
3
4 #include <QUrl>
5 #include <QString>
6 #include <QIcon>
7 #include <QDateTime>
8 #include <QSharedData>
9
10 class QWebPage;
11
12 class QWebHistoryItemPrivate;
13 class QWebHistoryItem
14 {
15 public:
16     ~QWebHistoryItem();
17
18     QWebHistoryItem *parent() const;
19     QList<QWebHistoryItem*> children() const;
20
21     QUrl originalUrl() const;
22     QUrl currentUrl() const;
23
24     QString title() const;
25     QDateTime lastVisited() const;
26
27     QPixmap icon() const;
28
29     QWebHistoryItem(QWebHistoryItemPrivate *priv);
30 private:
31     friend class QWebPageHistory;
32     friend class QWebPage;
33     QExplicitlySharedDataPointer<QWebHistoryItemPrivate> d;
34 };
35
36 class QWebPageHistoryPrivate;
37 class QWebPageHistory
38 {
39 public:
40     QWebPageHistory(const QWebPageHistory &other);
41     ~QWebPageHistory();
42     
43     QList<QWebHistoryItem> items() const;
44     QList<QWebHistoryItem> backItems(int maxItems) const;
45     QList<QWebHistoryItem> forwardItems(int maxItems) const;
46
47     void goBack();
48     void goForward();
49     void goToItem(QWebHistoryItem *item);
50
51     QWebHistoryItem backItem() const;
52     QWebHistoryItem currentItem() const;
53     QWebHistoryItem forwardItem() const;
54     QWebHistoryItem itemAtIndex(int i) const;
55
56     
57     QWebPageHistory(QWebPageHistoryPrivate *priv);
58 private:
59     QExplicitlySharedDataPointer<QWebPageHistoryPrivate> d;
60 };
61
62 #endif