[Qt][WK2] History is not accessible in QML.
[WebKit-https.git] / Source / WebKit2 / UIProcess / qt / QtWebPageLoadClient.h
1 /*
2  * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this program; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  *
19  */
20
21 #ifndef QtWebPageLoadClient_h
22 #define QtWebPageLoadClient_h
23
24 #include "QtWebError.h"
25 #include <QtCore/QString>
26 #include <QtCore/QUrl>
27 #include <WKPage.h>
28
29 class QQuickWebView;
30
31 class QtWebPageLoadClient {
32 public:
33     QtWebPageLoadClient(WKPageRef, QQuickWebView*);
34
35     int loadProgress() const { return m_loadProgress; }
36
37 private:
38     void didStartProvisionalLoadForFrame();
39     void didCommitLoadForFrame(const QUrl&);
40     void didSameDocumentNavigationForFrame(const QUrl&);
41     void didReceiveTitleForFrame(const QString&);
42     void didFirstVisuallyNonEmptyLayoutForFrame();
43     void didChangeBackForwardList();
44
45     void dispatchLoadSucceeded();
46     void dispatchLoadFailed(WKErrorRef);
47     void setLoadProgress(int);
48
49     // WKPageLoadClient callbacks.
50     static void didStartProvisionalLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
51     static void didFailProvisionalLoadWithErrorForFrame(WKPageRef, WKFrameRef, WKErrorRef, WKTypeRef userData, const void* clientInfo);
52     static void didCommitLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
53     static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
54     static void didFailLoadWithErrorForFrame(WKPageRef, WKFrameRef, WKErrorRef, WKTypeRef userData, const void* clientInfo);
55     static void didSameDocumentNavigationForFrame(WKPageRef, WKFrameRef, WKSameDocumentNavigationType, WKTypeRef userData, const void* clientInfo);
56     static void didReceiveTitleForFrame(WKPageRef, WKStringRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
57     static void didStartProgress(WKPageRef, const void* clientInfo);
58     static void didChangeProgress(WKPageRef, const void* clientInfo);
59     static void didFinishProgress(WKPageRef, const void* clientInfo);
60     static void didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
61     static void didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef, WKArrayRef, const void *clientInfo);
62
63     QQuickWebView* m_webView;
64     int m_loadProgress;
65 };
66
67 #endif // QtWebPageLoadClient_h