2 * Copyright (C) 2010 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 library 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 library; 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 QWEBKITPLATFORMPLUGIN_H
22 #define QWEBKITPLATFORMPLUGIN_H
25 * Warning: The contents of this file is not part of the public QtWebKit API
26 * and may be changed from version to version or even be completely removed.
29 #if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA
30 #include <QMediaPlayer>
32 #include <QtCore/QObject>
33 #include <QtCore/QRect>
34 #include <QtCore/QUrl>
35 #include <QtGui/QColor>
36 #include <QtGui/QFont>
38 class QWebSelectData {
40 virtual ~QWebSelectData() {}
42 enum ItemType { Option, Group, Separator };
44 virtual ItemType itemType(int) const = 0;
45 virtual QString itemText(int index) const = 0;
46 virtual QString itemToolTip(int index) const = 0;
47 virtual bool itemIsEnabled(int index) const = 0;
48 virtual bool itemIsSelected(int index) const = 0;
49 virtual int itemCount() const = 0;
50 virtual bool multiple() const = 0;
51 virtual QColor backgroundColor() const = 0;
52 virtual QColor foregroundColor() const = 0;
53 virtual QColor itemBackgroundColor(int index) const = 0;
54 virtual QColor itemForegroundColor(int index) const = 0;
57 class QWebSelectMethod : public QObject {
60 virtual ~QWebSelectMethod() {}
62 virtual void show(const QWebSelectData&) = 0;
63 virtual void hide() = 0;
64 virtual void setGeometry(const QRect&) = 0;
65 virtual void setFont(const QFont&) = 0;
68 void selectItem(int index, bool allowMultiplySelections, bool shift);
72 class QWebNotificationData {
74 virtual ~QWebNotificationData() {}
76 virtual const QString title() const = 0;
77 virtual const QString message() const = 0;
78 virtual const QByteArray iconData() const = 0;
79 virtual const QUrl openerPageUrl() const = 0;
82 class QWebNotificationPresenter : public QObject {
85 QWebNotificationPresenter() {}
86 virtual ~QWebNotificationPresenter() {}
88 virtual void showNotification(const QWebNotificationData*) = 0;
91 void notificationClosed();
92 void notificationClicked();
95 class QWebHapticFeedbackPlayer: public QObject {
98 QWebHapticFeedbackPlayer() {}
99 virtual ~QWebHapticFeedbackPlayer() {}
101 enum HapticStrength {
102 None, Weak, Medium, Strong
109 virtual void playHapticFeedback(const HapticEvent, const QString& hapticType, const HapticStrength) = 0;
112 class QWebTouchModifier : public QObject {
115 virtual ~QWebTouchModifier() {}
117 enum PaddingDirection {
118 Up, Right, Down, Left
121 virtual unsigned hitTestPaddingForTouch(const PaddingDirection) const = 0;
124 #if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA
125 class QWebFullScreenVideoHandler : public QObject {
128 QWebFullScreenVideoHandler() {}
129 virtual ~QWebFullScreenVideoHandler() {}
130 virtual bool requiresFullScreenForVideoPlayback() const = 0;
133 void fullScreenClosed();
136 virtual void enterFullScreen(QMediaPlayer*) = 0;
137 virtual void exitFullScreen() = 0;
141 class QWebSpellChecker : public QObject {
144 struct GrammarDetail {
148 QString userDescription;
151 virtual bool isContinousSpellCheckingEnabled() const = 0;
152 virtual void toggleContinousSpellChecking() = 0;
154 virtual void learnWord(const QString& word) = 0;
155 virtual void ignoreWordInSpellDocument(const QString& word) = 0;
156 virtual void checkSpellingOfString(const QString& word, int* misspellingLocation, int* misspellingLength) = 0;
157 virtual QString autoCorrectSuggestionForMisspelledWord(const QString& word) = 0;
158 virtual void guessesForWord(const QString& word, const QString& context, QStringList& guesses) = 0;
160 virtual bool isGrammarCheckingEnabled() = 0;
161 virtual void toggleGrammarChecking() = 0;
162 virtual void checkGrammarOfString(const QString&, QList<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength) = 0;
165 class QWebKitPlatformPlugin {
167 virtual ~QWebKitPlatformPlugin() {}
174 FullScreenVideoPlayer,
178 virtual bool supportsExtension(Extension) const = 0;
179 virtual QObject* createExtension(Extension) const = 0;
183 Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.8");
186 #endif // QWEBKITPLATFORMPLUGIN_H