initial import
[vuplus_webkit] / Source / WebKit2 / UIProcess / qt / ViewInterface.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 ViewInterface_h
22 #define ViewInterface_h
23
24 #include <QtCore/QSharedPointer>
25 #include <QtCore/QSize>
26 #include <QtGui/QMenu>
27 #include <WebKit2/WKBase.h>
28
29 QT_BEGIN_NAMESPACE
30 class QCursor;
31 class QGraphicsWidget;
32 class QImage;
33 class QJSEngine;
34 class QJSValue;
35 class QMimeData;
36 class QPoint;
37 class QRect;
38 class QUrl;
39 class QWidget;
40 QT_END_NAMESPACE
41
42 namespace WebCore {
43 class ViewportArguments;
44 }
45
46 namespace WebKit {
47
48 class ViewInterface
49 {
50 public:
51     enum FileChooserType {
52         SingleFileSelection,
53         MultipleFilesSelection
54     };
55
56     virtual void setViewNeedsDisplay(const QRect&) = 0;
57
58     virtual QSize drawingAreaSize() = 0;
59     virtual void contentSizeChanged(const QSize&) = 0;
60
61     virtual bool isActive() = 0;
62     virtual bool hasFocus() = 0;
63     virtual bool isVisible() = 0;
64
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;
67
68     virtual void didFindZoomableArea(const QPoint&, const QRect&) = 0;
69
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;
80
81     virtual void showContextMenu(QSharedPointer<QMenu>) = 0;
82     virtual void hideContextMenu() = 0;
83
84     virtual void processDidCrash() = 0;
85     virtual void didRelaunchProcess() = 0;
86
87     virtual QJSEngine* engine() = 0;
88
89     virtual void chooseFiles(WKOpenPanelResultListenerRef, const QStringList& selectedFileNames, FileChooserType) = 0;
90 };
91
92 }
93
94 #endif /* ViewInterface_h */