WebBackForwardList.h [plain text]
#ifndef WebBackForwardList_h
#define WebBackForwardList_h
#include "APIObject.h"
#include "WebBackForwardListItem.h"
#include "WebPageProxy.h"
#include <wtf/Ref.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
#if USE(CF)
#include <CoreFoundation/CFDictionary.h>
#endif
namespace WebKit {
struct BackForwardListState;
class WebBackForwardList : public API::ObjectImpl<API::Object::Type::BackForwardList> {
public:
static Ref<WebBackForwardList> create(WebPageProxy& page)
{
return adoptRef(*new WebBackForwardList(page));
}
void pageClosed();
virtual ~WebBackForwardList();
void addItem(WebBackForwardListItem*);
void goToItem(WebBackForwardListItem*);
void removeAllItems();
void clear();
WebBackForwardListItem* currentItem() const;
WebBackForwardListItem* backItem() const;
WebBackForwardListItem* forwardItem() const;
WebBackForwardListItem* itemAtIndex(int) const;
const BackForwardListItemVector& entries() const { return m_entries; }
uint32_t currentIndex() const { return m_currentIndex; }
int backListCount() const;
int forwardListCount() const;
Ref<API::Array> backList() const;
Ref<API::Array> forwardList() const;
Ref<API::Array> backListAsAPIArrayWithLimit(unsigned limit) const;
Ref<API::Array> forwardListAsAPIArrayWithLimit(unsigned limit) const;
BackForwardListState backForwardListState(WTF::Function<bool (WebBackForwardListItem&)>&&) const;
void restoreFromState(BackForwardListState);
Vector<BackForwardListItemState> itemStates() const;
private:
explicit WebBackForwardList(WebPageProxy&);
void didRemoveItem(WebBackForwardListItem&);
WebPageProxy* m_page;
BackForwardListItemVector m_entries;
bool m_hasCurrentIndex;
unsigned m_currentIndex;
unsigned m_capacity;
};
}
#endif // WebBackForwardList_h