[Qt][WK2] Move non-api classes to WebKit namespace at WebKit2/UiProcess/qt
[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 <QtGlobal>
25 #include <WKPage.h>
26
27 QT_BEGIN_NAMESPACE
28 class QUrl;
29 QT_END_NAMESPACE
30
31 class QQuickWebView;
32
33 namespace WebKit {
34
35 class QtWebPageLoadClient {
36 public:
37     QtWebPageLoadClient(WKPageRef, QQuickWebView*);
38
39     int loadProgress() const { return m_loadProgress; }
40
41 private:
42     void didStartProvisionalLoadForFrame(const QUrl&);
43     void didCommitLoadForFrame();
44     void didSameDocumentNavigationForFrame();
45     void didReceiveTitleForFrame();
46     void didFirstVisuallyNonEmptyLayoutForFrame();
47     void didChangeBackForwardList();
48
49     void dispatchLoadSucceeded();
50     void dispatchLoadFailed(WKErrorRef);
51     void setLoadProgress(int);
52
53     // WKPageLoadClient callbacks.
54     static void didStartProvisionalLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
55     static void didFailProvisionalLoadWithErrorForFrame(WKPageRef, WKFrameRef, WKErrorRef, WKTypeRef userData, const void* clientInfo);
56     static void didCommitLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
57     static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
58     static void didFailLoadWithErrorForFrame(WKPageRef, WKFrameRef, WKErrorRef, WKTypeRef userData, const void* clientInfo);
59     static void didSameDocumentNavigationForFrame(WKPageRef, WKFrameRef, WKSameDocumentNavigationType, WKTypeRef userData, const void* clientInfo);
60     static void didReceiveTitleForFrame(WKPageRef, WKStringRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
61     static void didStartProgress(WKPageRef, const void* clientInfo);
62     static void didChangeProgress(WKPageRef, const void* clientInfo);
63     static void didFinishProgress(WKPageRef, const void* clientInfo);
64     static void didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
65     static void didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef, WKArrayRef, const void *clientInfo);
66
67     QQuickWebView* m_webView;
68     int m_loadProgress;
69 };
70
71 } // namespace Webkit
72
73 #endif // QtWebPageLoadClient_h