summaryrefslogtreecommitdiffstats
path: root/WebKit/qt/examples
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/qt/examples')
-rw-r--r--WebKit/qt/examples/examples.pro2
-rw-r--r--WebKit/qt/examples/platformplugin/README3
-rw-r--r--WebKit/qt/examples/platformplugin/WebPlugin.cpp23
-rw-r--r--WebKit/qt/examples/platformplugin/WebPlugin.h8
-rw-r--r--WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h7
5 files changed, 27 insertions, 16 deletions
diff --git a/WebKit/qt/examples/examples.pro b/WebKit/qt/examples/examples.pro
new file mode 100644
index 0000000..f8dc589
--- /dev/null
+++ b/WebKit/qt/examples/examples.pro
@@ -0,0 +1,2 @@
+TEMPLATE = subdirs
+SUBDIRS = platformplugin \ No newline at end of file
diff --git a/WebKit/qt/examples/platformplugin/README b/WebKit/qt/examples/platformplugin/README
index 47ef797..e220d04 100644
--- a/WebKit/qt/examples/platformplugin/README
+++ b/WebKit/qt/examples/platformplugin/README
@@ -6,6 +6,9 @@ that will provide combo boxes popups to QtWebKit.
QtWebKit will look for the plugins automatically so there is no need to make any other configuration to
put the plugin into use. To stop using the plugin just remove the directory $$[QT_INSTALL_PLUGINS]/webkit.
+A copy of qwebkitplatformplugin.h is provided with the example, as platform plugins should not depend
+on the precense of QtWebKit to build.
+
This plugin can provide popups for <select multiple> elements but to use this feature QtWebKit must be
compiled with NO_LISTBOX_RENDERING enabled.
diff --git a/WebKit/qt/examples/platformplugin/WebPlugin.cpp b/WebKit/qt/examples/platformplugin/WebPlugin.cpp
index c3efb80..23b938e 100644
--- a/WebKit/qt/examples/platformplugin/WebPlugin.cpp
+++ b/WebKit/qt/examples/platformplugin/WebPlugin.cpp
@@ -210,15 +210,30 @@ MultipleSelectionPopup::MultipleSelectionPopup(const QWebSelectData& data)
bool WebPlugin::supportsExtension(Extension extension) const
{
- if (extension == MultipleSelections)
+ switch (extension) {
+ case MultipleSelections:
return true;
- if (extension == Notifications)
#if ENABLE_NOTIFICATIONS
+ case Notifications:
return true;
-#else
+#endif
+ default:
return false;
+ }
+}
+
+QObject* WebPlugin::createExtension(Extension extension) const
+{
+ switch (extension) {
+ case MultipleSelections:
+ return new WebPopup();
+#if ENABLE_NOTIFICATIONS
+ case Notifications:
+ return new WebNotificationPresenter();
#endif
- return false;
+ default:
+ return 0;
+ }
}
Q_EXPORT_PLUGIN2(platformplugin, WebPlugin)
diff --git a/WebKit/qt/examples/platformplugin/WebPlugin.h b/WebKit/qt/examples/platformplugin/WebPlugin.h
index 4af19f9..3df345f 100644
--- a/WebKit/qt/examples/platformplugin/WebPlugin.h
+++ b/WebKit/qt/examples/platformplugin/WebPlugin.h
@@ -87,14 +87,8 @@ class WebPlugin : public QObject, public QWebKitPlatformPlugin
Q_OBJECT
Q_INTERFACES(QWebKitPlatformPlugin)
public:
- virtual QWebSelectMethod* createSelectInputMethod() const { return new WebPopup(); }
virtual bool supportsExtension(Extension extension) const;
- virtual QWebNotificationPresenter* createNotificationPresenter() const {
- return new WebNotificationPresenter();
- }
- virtual QWebHapticFeedbackPlayer* createHapticFeedbackPlayer() const {
- return 0;
- }
+ virtual QObject* createExtension(Extension extension) const;
};
#endif // WEBPLUGIN_H
diff --git a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
index 76496c5..faa6989 100644
--- a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
+++ b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
@@ -110,12 +110,9 @@ public:
};
virtual bool supportsExtension(Extension extension) const = 0;
- virtual QWebSelectMethod* createSelectInputMethod() const = 0;
- virtual QWebNotificationPresenter* createNotificationPresenter() const = 0;
- virtual QWebHapticFeedbackPlayer* createHapticFeedbackPlayer() const = 0;
-
+ virtual QObject* createExtension(Extension extension) const = 0;
};
-Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.4");
+Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.5");
#endif // QWEBKITPLATFORMPLUGIN_H