/*! Returns the item at index \a i in the history. */ QWebHistoryItem QWebHistory::itemAt(int i) const { WebCore::HistoryItem *item = d->lst->itemAtIndex(i); QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(item); return QWebHistoryItem(priv); }
/*! Returns the item at index \a i in the history. */ QWebHistoryItem QWebHistory::itemAt(int i) const { QWebHistoryItemPrivate *priv; if (i < 0 || i >= count()) priv = new QWebHistoryItemPrivate(0); else { WebCore::HistoryItem *item = d->lst->entries()[i].get(); priv = new QWebHistoryItemPrivate(item); } return QWebHistoryItem(priv); }
/*! Returns a list of all items currently in the history. \sa count(), clear() */ QList<QWebHistoryItem> QWebHistory::items() const { const WebCore::HistoryItemVector &items = d->lst->entries(); QList<QWebHistoryItem> ret; for (unsigned i = 0; i < items.size(); ++i) { QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(items[i].get()); ret.append(QWebHistoryItem(priv)); } return ret; }
/*! Returns the list of items in the forward history list. At most \a maxItems entries are returned. \sa backItems() */ QList<QWebHistoryItem> QWebHistory::forwardItems(int maxItems) const { WebCore::HistoryItemVector items(maxItems); d->lst->forwardListWithLimit(maxItems, items); QList<QWebHistoryItem> ret; for (unsigned i = 0; i < items.size(); ++i) { QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(items[i].get()); ret.append(QWebHistoryItem(priv)); } return ret; }
/*! Returns the item after the current item in the history. */ QWebHistoryItem QWebHistory::forwardItem() const { WebCore::HistoryItem *i = d->lst->forwardItem(); QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(i); return QWebHistoryItem(priv); }
/*! Returns the current item in the history. */ QWebHistoryItem QWebHistory::currentItem() const { WebCore::HistoryItem *i = d->lst->currentItem(); QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(i); return QWebHistoryItem(priv); }
QWebHistoryItem QWebPageHistory::backItem() const { WebCore::HistoryItem *i = d->lst->backItem(); QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(i); return QWebHistoryItem(priv); }