2 * Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies)
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.
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.
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.
21 #ifndef QtPageClient_h
22 #define QtPageClient_h
24 #include "DrawingAreaProxy.h"
25 #include "LayerTreeContext.h"
26 #include "PageClient.h"
27 #include "ShareableBitmap.h"
28 #include "ViewportArguments.h"
30 class QtWebPageEventHandler;
31 class QtWebUndoController;
34 using namespace WebKit;
36 class QtPageClient : public WebKit::PageClient {
41 void initialize(QQuickWebView*, QtWebPageEventHandler*, QtWebUndoController*);
44 virtual void setViewNeedsDisplay(const WebCore::IntRect&);
45 virtual WebCore::IntSize viewSize();
46 virtual bool isViewFocused();
47 virtual bool isViewVisible();
48 virtual void didReceiveMessageFromNavigatorQtObject(const String&);
49 virtual void pageDidRequestScroll(const WebCore::IntPoint&);
50 virtual void didChangeContentsSize(const WebCore::IntSize&);
51 virtual void didChangeViewportProperties(const WebCore::ViewportArguments&);
52 virtual void processDidCrash();
53 virtual void didRelaunchProcess();
54 virtual PassOwnPtr<DrawingAreaProxy> createDrawingAreaProxy();
55 virtual void handleDownloadRequest(DownloadProxy*);
56 virtual void handleApplicationSchemeRequest(PassRefPtr<QtRefCountedNetworkRequestData>);
57 virtual void handleAuthenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password);
58 virtual void handleCertificateVerificationRequest(const String& hostname, bool& ignoreErrors);
59 virtual void handleProxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password);
61 virtual void displayView();
62 virtual void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
63 virtual bool isViewWindowActive();
64 virtual bool isViewInWindow();
65 #if USE(ACCELERATED_COMPOSITING)
66 virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
67 virtual void exitAcceleratedCompositingMode();
68 virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
69 #endif // USE(ACCELERATED_COMPOSITING)
70 virtual void pageClosed() { }
71 virtual void startDrag(const WebCore::DragData&, PassRefPtr<ShareableBitmap> dragImage);
72 virtual void setCursor(const WebCore::Cursor&);
73 virtual void setCursorHiddenUntilMouseMoves(bool);
74 virtual void toolTipChanged(const String&, const String&);
76 // QtWebUndoController
77 virtual void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo);
78 virtual void clearAllEditCommands();
79 virtual bool canUndoRedo(WebPageProxy::UndoOrRedo);
80 virtual void executeUndoRedo(WebPageProxy::UndoOrRedo);
82 virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
83 virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
84 virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
85 virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&);
86 virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) { }
87 virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
88 virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*);
89 virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate) { }
90 virtual void didCommitLoadForMainFrame(bool useCustomRepresentation) { }
91 virtual void didFinishLoadingDataForCustomRepresentation(const String& suggestedFilename, const CoreIPC::DataReference&) { }
92 virtual double customRepresentationZoomFactor() { return 1; }
93 virtual void setCustomRepresentationZoomFactor(double) { }
94 virtual void didChangeScrollbarsForMainFrame() const { }
95 virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>& updateRects);
96 virtual void findStringInCustomRepresentation(const String&, WebKit::FindOptions, unsigned maxMatchCount) { }
97 virtual void countStringMatchesInCustomRepresentation(const String&, WebKit::FindOptions, unsigned maxMatchCount) { }
98 virtual void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
99 virtual void updateTextInputState();
100 virtual void doneWithGestureEvent(const WebGestureEvent&, bool wasEventHandled);
101 virtual void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled);
104 QQuickWebView* m_webView;
105 QtWebPageEventHandler* m_eventHandler;
106 QtWebUndoController* m_undoController;
109 #endif /* QtPageClient_h */