2 * Copyright (C) 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 ViewInterface_h
22 #define ViewInterface_h
24 #include <QtCore/QSharedPointer>
25 #include <QtCore/QSize>
26 #include <QtGui/QMenu>
27 #include <WebKit2/WKBase.h>
31 class QGraphicsWidget;
43 class ViewportArguments;
51 enum FileChooserType {
53 MultipleFilesSelection
56 virtual void setViewNeedsDisplay(const QRect&) = 0;
58 virtual QSize drawingAreaSize() = 0;
59 virtual void contentSizeChanged(const QSize&) = 0;
61 virtual bool isActive() = 0;
62 virtual bool hasFocus() = 0;
63 virtual bool isVisible() = 0;
65 virtual void startDrag(Qt::DropActions supportedDropActions, const QImage& dragImage, QMimeData* data, QPoint* clientPosition, QPoint* globalPosition, Qt::DropAction* dropAction) = 0;
66 virtual void didReceiveViewportArguments(const WebCore::ViewportArguments&) = 0;
68 virtual void didFindZoomableArea(const QPoint&, const QRect&) = 0;
70 virtual void didChangeUrl(const QUrl&) = 0;
71 virtual void didChangeTitle(const QString&) = 0;
72 virtual void didChangeToolTip(const QString&) = 0;
73 virtual void didChangeStatusText(const QString&) = 0;
74 virtual void didChangeCursor(const QCursor&) = 0;
75 virtual void loadDidBegin() = 0;
76 virtual void loadDidCommit() = 0;
77 virtual void loadDidSucceed() = 0;
78 virtual void loadDidFail(const QJSValue&) = 0;
79 virtual void didChangeLoadProgress(int) = 0;
81 virtual void showContextMenu(QSharedPointer<QMenu>) = 0;
82 virtual void hideContextMenu() = 0;
84 virtual void processDidCrash() = 0;
85 virtual void didRelaunchProcess() = 0;
87 virtual QJSEngine* engine() = 0;
89 virtual void chooseFiles(WKOpenPanelResultListenerRef, const QStringList& selectedFileNames, FileChooserType) = 0;
94 #endif /* ViewInterface_h */